Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[marvell-armhf] Armada A385 soc support #176

Merged
merged 7 commits into from
Dec 17, 2020

Conversation

antony-rheneus
Copy link
Contributor

@antony-rheneus antony-rheneus commented Dec 1, 2020

Add platform specific SOC kernel configuration based on CONFIGURED_PLATFORM variable passed from sonic-buildimage.

Marvell patches applied to Linux 4.19 are removed,
Kernel driver for SFF, optoe Eeprom are enabled for Armhf architecture.
Due to a platform limitation the (compressed) Linux kernel size can only be 6 MB, so the Linux kernel configuration is shrinked to reduce the size.
Enable MTD parts and command line to access the nand flash

@antony-rheneus
Copy link
Contributor Author

Duplicate of PR 172 #172,
Opened this to addess the review comments, which I could not proceed in the same PR 172 due to multiple merge conflicts during git rebase.

@lguohan
Copy link
Contributor

lguohan commented Dec 3, 2020

@paulmenzel, can you take a look at this pr?

@antony-rheneus
Copy link
Contributor Author

@paulmenzel , Would you please review the PR?

@paulmenzel
Copy link
Contributor

Sorry, I thought, I replied in #172 to keep discussion there.

@antony-rheneus
Copy link
Contributor Author

Sorry, I thought, I replied in #172 to keep discussion there.

Marvell armhf requires configuration from "sonic-linux-kernel/linux-4.19.118/arch/arm/configs/mvebu_v7_defconfig" however it is not so when debian prepares the .config.

@carl-nokia
Copy link

Paul - what is missing or required from Marvell/Nokia teams to merge this PR? -- we need to get this merged ASAP please

@paulmenzel
Copy link
Contributor

Paul - what is missing or required from Marvell/Nokia teams to merge this PR? -- we need to get this merged ASAP please

Please read the discussion in merge/pull request #172.

@carl-nokia
Copy link

Please forgive my lack of clarity on this PR, but I did read PR 172 before asking you for help on this PR 176. I just re-read it again. I want to help resolve whatever is needed ASAP.
The best I can tell is that you are still waiting for the PR description and 23 commit messages to follow "How to Write a Git Commit Message" best practices properly.

Is my understanding correct? ... or are you also looking for a rebase to better define the list of commits for review?

@paulmenzel
Copy link
Contributor

Yes, your understanding is correct.

Then for example, it might become clear, why you have to add certain configs to the inclusion file, and it’s opposite configuration to the exclusion file at the same time (CONFIG_KERNEL_GZIP=y vs. CONFIG_KERNEL_XZ. Only one should be necessary, as it’s a choice.

@paulmenzel
Copy link
Contributor

Having to merge/pull requests is now even more confusing, but so be it. For example 9976144:

[kernel] [marvell-armhf]

Set cpu frequenc to 100HZ as per armada cpu
Enable periodic timer and not dynamic for better performance of a385 soc

I asked several times to follow the guide on how to write commit messages. The summary belongs in the first line for example, and that’s what it at the very beginning and also well seen in the Linux kernel and git project repository.

Why the kernel tag? It’s the sonic-linux-kernel repository. Maybe:

marvell-armhf: armada: Set CPU frequency to 100HZ and use periodic timer

Enable periodic timer and not dynamic for better performance of a385 soc.

[Add explanation here, why 100 HZ increases the performance, how you tested it, and what the performance increase is.]

@antony-rheneus antony-rheneus force-pushed the armhf-master-review branch 2 times, most recently from 48eefd0 to c8cff7f Compare December 10, 2020 15:52
@antony-rheneus
Copy link
Contributor Author

@paulmenzel, @lguohan,
We cleaned up all the commit messages to make them more descriptive, following established github guidelines. The "Why" of all the commits were carefully added. Please review and let us know if any additional changes are required.

@paulmenzel
Copy link
Contributor

Thank you, much better!

Some nits:

  1. Why is GZIP in the inclusions not enough? Does the script have an error, so that KERNEL_XZ has to be added to the excludes?
  2. For the kernel image size reduction commit, can you please document what the old and new size is?
  3. not appened → not appended in the last commit message.

@antony-rheneus
Copy link
Contributor Author

Thank you, much better!

Some nits:

  1. Why is GZIP in the inclusions not enough? Does the script have an error, so that KERNEL_XZ has to be added to the excludes?
  2. For the kernel image size reduction commit, can you please document what the old and new size is?
  3. not appened → not appended in the last commit message.

@paulmenzel
Please review the update commits in the PR, Let us know if any additional changes required.

#1 Since only one compression method can be selected, added config to exclude XZ as it came as part of default config. The conf script didn't report any error.

#2 Documented the file size in the commit description as suggested, please check and confirm if that is fine.
Before size: 6197760
After size: 5192480

#3 Corrected the typo "appened" in commit description.

@lguohan
Copy link
Contributor

lguohan commented Dec 13, 2020

@antony-rheneus, it looks like this gz v.s xz issue has been brought up multiple times, and looks like xz is prefered over gz. since armhf maybe used for other sku in the future, can you change to xz instead of gz, so that in the future we won't need to discuss this option again.

@antony-rheneus antony-rheneus force-pushed the armhf-master-review branch 2 times, most recently from bceed9a to 4b676dc Compare December 15, 2020 07:11
@antony-rheneus
Copy link
Contributor Author

antony-rheneus commented Dec 15, 2020

@antony-rheneus, it looks like this gz v.s xz issue has been brought up multiple times, and looks like xz is prefered over gz. since armhf maybe used for other sku in the future, can you change to xz instead of gz, so that in the future we won't need to discuss this option again.

@lguohan, @paulmenzel ,
As requested, I have reverted the GZIP compression, and tested the same in our platform with XZ compression method.
Also I hase rebased to master to resolve the conflicts with patch/series.
Please do review the recent changes.

@lguohan
Copy link
Contributor

lguohan commented Dec 15, 2020

lgtm

Copy link
Contributor

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I feel like I am missing something, that I have all these questions, nobody else has during review. Also, I am now spent over one hour with the merge/pull request, which actually tries to do a simple thing. I know you spent more time on it, but I actually do not get paid for this, and only stumbled upon in, while looking at the “project status” of SONiC.

patch/kconfig-inclusions Outdated Show resolved Hide resolved
patch/kconfig-inclusions Outdated Show resolved Hide resolved
CONFIG_NO_HZ_IDLE
CONFIG_HZ_250
CONFIG_SLUB
CONFIG_DEBUG_SLAB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that added here? The config defaults to n, doesn’t it?

patch/kconfig-exclusions Outdated Show resolved Hide resolved
@carl-nokia
Copy link

Paul - I will set up a meeting with you - this merge is blocking many people - lets get on a call please to answer your questions - we need to wrap this up please. I will send you invite and cc Guohan now.

@paulmenzel
Copy link
Contributor

Paul - I will set up a meeting with you - this merge is blocking many people - lets get on a call please to answer your questions - we need to wrap this up please. I will send you invite and cc Guohan now.

Thanks. It would be nice though to get some written reply to my comments beforehand.

@antony-rheneus
Copy link
Contributor Author

@paulmenzel , @lguohan ,
I have reverted the configurations to be in sync with the upstreamed version for mvebu_def_config. Let us know if you have any comments.

@antony-rheneus
Copy link
Contributor Author

Below are the recent commits under review.

$ git log --oneline -n 7
bd6a99e armhf: Update linux debian image file name
873ee9f Marvell-armhf: Disable uefi firmware for marvell
305dc69 Marvell-armhf: Reduce kernel image size for u-boot
b6ee695 Marvell-armhf: Enable optoe and i2c mux
b78363e Marvell-armhf: armada: Set gpio and mtd platform specific configuration
65f6779 Marvell-armhf: Enable platform specific kconfig
a3d548c Marvell-armhf: Remove obsolete patches applied for marvell arm

@radha-danda
Copy link

Paul - I will set up a meeting with you - this merge is blocking many people - lets get on a call please to answer your questions - we need to wrap this up please. I will send you invite and cc Guohan now.

Thanks. It would be nice though to get some written reply to my comments beforehand.

@paulmenzel, Antony addressed your comment and pushed the changes. Can you please review and let us know if you have any further comments

@paulmenzel
Copy link
Contributor

Thank you for the last changes. In commit 305dc69 you cite the numbers below:

Testing:

  • Check kernel boots without any memory overlapping errors
  • kernel binary size before this commit : 6197760 bytes
  • kernel binary size after this commit : 5192480 bytes

Is that a hardware limitation? Or a U-Boot issue? Do you have an upstream bug report for that?

So as talked about in the conference, it would be great, if you documented the maximum allowed size, and what compression algorithm was used (if it actually plays a role). The merge/pull request description would be something like (just a made-up suggestion):

Add platform specific SOC kernel configuration.

Marvell patches applied to Linux 4.19 are removed, and due to a platform limitation the (compressed) Linux kernel size can only be 6 MB, so the Linux kernel configuration is shrinked to reduce the size.

In earlier sonic-kernel version to support nand flash driver has been
back ported to it. With the recent kernel version driver is upstreamed
Also the kernel kconfig variables were managed as a patch to .config
file which is no longer needed with "manage-config" script

Deleted backported nand flash patch
Deleted kernel .config patches for armhf and arm64
Update series to remove marvell specific commented/unused patch files

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
Current sonic-linux-kernel does not support the platform specific kernel
configuration. This commit addresses this by adding support to parse
kconfig-inclusions and kconfig-exclusions based on platform string along
with CPU architecture string

Update manage-config script to parse the platform string to
enable platform specific kconfig CONFIG_xxx variables based on CONFIGURED_PLATFORM.
CONFIGURED_PLATFORM value will be passed from sonic-buildimage Makefile

Testing: Checked the kernel builds and boots with proper .config

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
As per the base configuration from the upstreamed linux community
linux-4.19.118/arch/arm/configs/mvebu_v7_defconfig, the following
configuration changes are made

 - Set number of gpio pins to 0 as it would be configured from fdt
 - Enable mtd parts to access flash partition layout for nand mtd devices
   provided from fdt

   Testing:
   - Checked gpio pins are configured as per platform specific fdt
   - Checked mtd block and char devices accessible as defined in fdt

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
The current kernel configuration does not include optoe driver for
qsfp/sfp eeprom, and gpio driver for gpio pin based i2c muxes

 - Enable OPTOE driver for [Q]SFP eeprom
 - Enable I2C Mux for gpio pin based mux

Testing:
 - Checked sfp eeprom is accessible via optoe driver through gpio
   based i2c mux

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
Marvell-armhf platforms using u-boot has constraints when loading the
kernel image into the physical memory region reserved for the kernel
and ramdisk image.  The size constraint is platform specific.
This commit reduces the size of the kernel image to
meet those constraints. The compression used for the kernel is xz.

- Disable unused architectures to reduce the size of the kernel
- Disable sound device driver module

Testing:
 - Check kernel boots without any memory overlapping errors
 - kernel binary size before this commit : 6197760 bytes
 - kernel binary size after this commit  : 3600624 bytes

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
As per the base configuration from the upstreamed linux community
linux-4.19.118/arch/arm/configs/mvebu_v7_defconfig, the following
configuration changes are made

 - Disable EFI as it is not supported in marvell armada soc
 - Disable uefi based kernel module load security

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
For armhf "unsigned" is not appended to the linux-image file name
Hence removed it from the target name

Testing:
 - Checked linux image debian is copied properly after sucessful
   build

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
@antony-rheneus
Copy link
Contributor Author

Thank you for the last changes. In commit 305dc69 you cite the numbers below:

Testing:

  • Check kernel boots without any memory overlapping errors
  • kernel binary size before this commit : 6197760 bytes
  • kernel binary size after this commit : 5192480 bytes

Is that a hardware limitation? Or a U-Boot issue? Do you have an upstream bug report for that?

So as talked about in the conference, it would be great, if you documented the maximum allowed size, and what compression algorithm was used (if it actually plays a role). The merge/pull request description would be something like (just a made-up suggestion):

Add platform specific SOC kernel configuration.
Marvell patches applied to Linux 4.19 are removed, and due to a platform limitation the (compressed) Linux kernel size can only be 6 MB, so the Linux kernel configuration is shrinked to reduce the size.

Size constraint is hardware specific limitation for u-boot based platforms.

@antony-rheneus
Copy link
Contributor Author

@paulmenzel , I have updated the comment description, and also the PR description. Would you please review?

@paulmenzel
Copy link
Contributor

Size constraint is hardware specific limitation for u-boot based platforms.

Do you have a reference for that?

@paulmenzel
Copy link
Contributor

Nice, looks good.

Just to be sure: I made up the number in “Linux kernel size can only be 6 MB,”. That is correct.

Also, just to be sure:

Testing:

  • Check kernel boots without any memory overlapping errors
  • kernel binary size before this commit : 6197760 bytes
  • kernel binary size after this commit : 3600624 bytes

The 6.2 MB is really XZ compressed image or was it with GZIP? Because if you try XZ which results in smaller size, maybe you can use the default kernel configuration.

@paulmenzel
Copy link
Contributor

Just to be clear, although I am interested in the answers of the questions above, I do not want to hold anything up. So, if @lguohan wants to accept this, please go ahead.

@lguohan
Copy link
Contributor

lguohan commented Dec 17, 2020

@paulmenzel , thanks for the reviewing. the pr is good. @antony-rheneus , please try to answer the questions, I am also curious to learn.

@lguohan lguohan merged commit 6f53047 into sonic-net:master Dec 17, 2020
@paulmenzel
Copy link
Contributor

@antony-rheneus, it’d be great if you replied to my questions.

@antony-rheneus
Copy link
Contributor Author

@antony-rheneus, it’d be great if you replied to my questions.

@paulmenzel , sure, I will test the kernel with the changes and reply back.

@antony-rheneus
Copy link
Contributor Author

antony-rheneus commented Dec 22, 2020

@antony-rheneus, it’d be great if you replied to my questions.

@paulmenzel , sure, I will test the kernel with the changes and reply back.

@paulmenzel ,
After removing all the SOCs define in "exclusion" file, now the image is reduced to 4.2MB with xz compression

ls -l linux-4.19.118/debian/build/build_armhf_none_armmp/arch/arm/boot/zImage
-rwxr-xr-x 1 root root 4260352 Dec 21 23:10 linux-4.19.118/debian/build/build_armhf_none_armmp/arch/arm/boot/zImage

However, the kernel hangs, so there is some conflicting CONFIG variable when all SOCs are defined. I will require some more time to debug this to narrow down the invalid configuration.


Starting kernel ...

<<<HUNG>>>

@paulmenzel
Copy link
Contributor

Over three months have passed. Were you able to fix the issue?

@antony-rheneus
Copy link
Contributor Author

Over three months have passed. Were you able to fix the issue?

Not yet, we will get back.

@paulmenzel
Copy link
Contributor

@carl-nokia, could you (or the responsible project manager) please allocate time for @antony-rheneus or some other developer/engineer to work on this?

@paulmenzel
Copy link
Contributor

Over a year has passed, and the promised work, convincing the reviewers to merge the changes, has not happened yet.

@antony-rheneus
Copy link
Contributor Author

@paulmenzel,
Redirecting the request to the Project Manager (@radha-danda)

@radha-danda
Copy link

radha-danda commented Mar 24, 2022

@paulmenzel, If I recollect the issue,

However, the kernel hangs, so there is some conflicting CONFIG variable when all SOCs are defined. I will require some more time to debug this to narrow down the invalid configuration.

This was the question remained unanswered. Please help me recollect the issue.

And to add more details, if above was the issue that left unanswered, we had similar issue with Kernel hang due to image size
and here is the rootcause sonic-net/sonic-buildimage#10204 and we are planning to backport the PR to 202012 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants