* [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in @ 2023-04-04 8:42 Roger Quadros 2023-04-04 8:51 ` Arnd Bergmann 0 siblings, 1 reply; 8+ messages in thread From: Roger Quadros @ 2023-04-04 8:42 UTC (permalink / raw) To: linux, arnd Cc: krzysztof.kozlowski, Thinh.Nguyen, nm, linux-arm-kernel, linux-kernel, Roger Quadros USB_DWC3 is not required for boot on most platforms make it as a module instead of built-in. Signed-off-by: Roger Quadros <rogerq@kernel.org> --- arch/arm/configs/multi_v7_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 084cc612ea23..755cc96f23c5 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -855,7 +855,7 @@ CONFIG_USB_UX500_DMA=y CONFIG_USB_INVENTRA_DMA=y CONFIG_USB_TI_CPPI41_DMA=y CONFIG_USB_TUSB_OMAP_DMA=y -CONFIG_USB_DWC3=y +CONFIG_USB_DWC3=m CONFIG_USB_DWC2=y CONFIG_USB_CHIPIDEA=y CONFIG_USB_CHIPIDEA_UDC=y -- 2.34.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in 2023-04-04 8:42 [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in Roger Quadros @ 2023-04-04 8:51 ` Arnd Bergmann 2023-04-04 10:01 ` Krzysztof Kozlowski 0 siblings, 1 reply; 8+ messages in thread From: Arnd Bergmann @ 2023-04-04 8:51 UTC (permalink / raw) To: Roger Quadros, Russell King Cc: Krzysztof Kozlowski, Thinh Nguyen, Nishanth Menon, linux-arm-kernel, linux-kernel On Tue, Apr 4, 2023, at 10:42, Roger Quadros wrote: > USB_DWC3 is not required for boot on most platforms make it > as a module instead of built-in. > > Signed-off-by: Roger Quadros <rogerq@kernel.org> > --- Does this save a significant amount of vmlinux size? Since this is a fairly common USB driver, I think it does help to have it built-in for users booting from USB_STORAGE or nfsroot over USB_USBNET, which are both built-in and not uncommon. Arnd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in 2023-04-04 8:51 ` Arnd Bergmann @ 2023-04-04 10:01 ` Krzysztof Kozlowski 2023-04-04 11:46 ` Roger Quadros 0 siblings, 1 reply; 8+ messages in thread From: Krzysztof Kozlowski @ 2023-04-04 10:01 UTC (permalink / raw) To: Arnd Bergmann, Roger Quadros, Russell King Cc: Thinh Nguyen, Nishanth Menon, linux-arm-kernel, linux-kernel On 04/04/2023 10:51, Arnd Bergmann wrote: > On Tue, Apr 4, 2023, at 10:42, Roger Quadros wrote: >> USB_DWC3 is not required for boot on most platforms make it >> as a module instead of built-in. >> >> Signed-off-by: Roger Quadros <rogerq@kernel.org> >> --- > > Does this save a significant amount of vmlinux size? Since this > is a fairly common USB driver, I think it does help to have it > built-in for users booting from USB_STORAGE or nfsroot over > USB_USBNET, which are both built-in and not uncommon. Especially that sometimes, at least for arm64 defconfig, we added as built-in less critical pieces (RENESAS_ETHER_SWITCH, MARVELL_10G_PHY, HTE_TEGRA194, SM_VIDEOCC_8250 and other non-core clock controllers). This change will require several systems to update their initrd to include USB. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in 2023-04-04 10:01 ` Krzysztof Kozlowski @ 2023-04-04 11:46 ` Roger Quadros 2023-04-04 12:14 ` Arnd Bergmann 0 siblings, 1 reply; 8+ messages in thread From: Roger Quadros @ 2023-04-04 11:46 UTC (permalink / raw) To: Krzysztof Kozlowski, Arnd Bergmann, Russell King Cc: Thinh Nguyen, Nishanth Menon, linux-arm-kernel, linux-kernel, Vignesh Raghavendra On 04/04/2023 13:01, Krzysztof Kozlowski wrote: > On 04/04/2023 10:51, Arnd Bergmann wrote: >> On Tue, Apr 4, 2023, at 10:42, Roger Quadros wrote: >>> USB_DWC3 is not required for boot on most platforms make it >>> as a module instead of built-in. >>> >>> Signed-off-by: Roger Quadros <rogerq@kernel.org> >>> --- >> >> Does this save a significant amount of vmlinux size? Since this vmlinux size reduces by ~529KB >> is a fairly common USB driver, I think it does help to have it >> built-in for users booting from USB_STORAGE or nfsroot over >> USB_USBNET, which are both built-in and not uncommon. OK. > > Especially that sometimes, at least for arm64 defconfig, we added as > built-in less critical pieces (RENESAS_ETHER_SWITCH, MARVELL_10G_PHY, > HTE_TEGRA194, SM_VIDEOCC_8250 and other non-core clock controllers). > This change will require several systems to update their initrd to > include USB. OK. Please ignore this patch and the arm64 defconfig one as well. ;) cheers, -roger ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in 2023-04-04 11:46 ` Roger Quadros @ 2023-04-04 12:14 ` Arnd Bergmann 2023-04-04 12:59 ` Roger Quadros 0 siblings, 1 reply; 8+ messages in thread From: Arnd Bergmann @ 2023-04-04 12:14 UTC (permalink / raw) To: Roger Quadros, Krzysztof Kozlowski, Russell King Cc: Thinh Nguyen, Nishanth Menon, linux-arm-kernel, linux-kernel, Vignesh Raghavendra On Tue, Apr 4, 2023, at 13:46, Roger Quadros wrote: > On 04/04/2023 13:01, Krzysztof Kozlowski wrote: >> On 04/04/2023 10:51, Arnd Bergmann wrote: >>> On Tue, Apr 4, 2023, at 10:42, Roger Quadros wrote: >>>> USB_DWC3 is not required for boot on most platforms make it >>>> as a module instead of built-in. >>>> >>>> Signed-off-by: Roger Quadros <rogerq@kernel.org> >>>> --- >>> >>> Does this save a significant amount of vmlinux size? Since this > > vmlinux size reduces by ~529KB That seems really high, so I had a look at what's going on. Testing this on multi_v7_defconfig with gcc-13, I only see 163KB difference in (uncompressed) vmlinux file size, or 140KB in the output of 'size vmlinux'. This still seems high, and looking more closely I find that a lot of that is for either Gadget mode or debugfs, while the driver itself is not all that big (most of the host logic is in the xhci driver). Turning off gadget mode altogether would save 248KB in 'size vmlinux' output, but would also prevent us from enabling gadget driver modules, which is not great either. I tried setting CONFIG_USB_GADGET=m, but that makes DWC3 and DWC2 host-only and turns CHIPIDEA into a loadable module, so we probably don't want to do that either: -CONFIG_USB_EHCI_HCD_OMAP=y +CONFIG_USB_EHCI_HCD_OMAP=m -CONFIG_USB_DWC3_DUAL_ROLE=y +CONFIG_USB_DWC3_HOST=y +CONFIG_USB_DWC2_HOST=y -CONFIG_USB_DWC2_DUAL_ROLE=y -CONFIG_USB_CHIPIDEA=y +CONFIG_USB_CHIPIDEA=m -CONFIG_USB_ISP1761_UDC=y -CONFIG_USB_ISP1760_DUAL_ROLE=y +CONFIG_USB_ISP1760_HOST_ROLE=y Arnd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in 2023-04-04 12:14 ` Arnd Bergmann @ 2023-04-04 12:59 ` Roger Quadros 2023-04-04 13:08 ` Arnd Bergmann 0 siblings, 1 reply; 8+ messages in thread From: Roger Quadros @ 2023-04-04 12:59 UTC (permalink / raw) To: Arnd Bergmann, Krzysztof Kozlowski, Russell King Cc: Thinh Nguyen, Nishanth Menon, linux-arm-kernel, linux-kernel, Vignesh Raghavendra On 04/04/2023 15:14, Arnd Bergmann wrote: > On Tue, Apr 4, 2023, at 13:46, Roger Quadros wrote: >> On 04/04/2023 13:01, Krzysztof Kozlowski wrote: >>> On 04/04/2023 10:51, Arnd Bergmann wrote: >>>> On Tue, Apr 4, 2023, at 10:42, Roger Quadros wrote: >>>>> USB_DWC3 is not required for boot on most platforms make it >>>>> as a module instead of built-in. >>>>> >>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org> >>>>> --- >>>> >>>> Does this save a significant amount of vmlinux size? Since this >> >> vmlinux size reduces by ~529KB > > That seems really high, so I had a look at what's going on. It was based on the configuration we are using at TI. (as built-in) $ size vmlinux text data bss dec hex filename 14616949 5285870 491776 20394595 1373263 vmlinux $ ls -l vmlinux -rwxrwxr-x 1 roger roger 120866544 Apr 4 15:54 vmlinux (as module) $ size vmlinux text data bss dec hex filename 14550571 5258106 491776 20300453 135c2a5 vmlinux $ ls -l vmlinux -rwxrwxr-x 1 roger roger 120324528 Apr 4 15:52 vmlinux $ diff built-in-config module-config 5547c5547 < CONFIG_USB_XHCI_PLATFORM=y --- > CONFIG_USB_XHCI_PLATFORM=m 5614c5614 < CONFIG_USB_DWC3=y --- > CONFIG_USB_DWC3=m > > Testing this on multi_v7_defconfig with gcc-13, I only see > 163KB difference in (uncompressed) vmlinux file size, or 140KB > in the output of 'size vmlinux'. This still seems high, and > looking more closely I find that a lot of that is for either > Gadget mode or debugfs, while the driver itself is not all > that big (most of the host logic is in the xhci driver). > > Turning off gadget mode altogether would save 248KB > in 'size vmlinux' output, but would also prevent us > from enabling gadget driver modules, which is not great > either. > > I tried setting CONFIG_USB_GADGET=m, but that makes > DWC3 and DWC2 host-only and turns CHIPIDEA into a loadable > module, so we probably don't want to do that either: > > -CONFIG_USB_EHCI_HCD_OMAP=y > +CONFIG_USB_EHCI_HCD_OMAP=m > -CONFIG_USB_DWC3_DUAL_ROLE=y > +CONFIG_USB_DWC3_HOST=y > +CONFIG_USB_DWC2_HOST=y > -CONFIG_USB_DWC2_DUAL_ROLE=y > -CONFIG_USB_CHIPIDEA=y > +CONFIG_USB_CHIPIDEA=m > -CONFIG_USB_ISP1761_UDC=y > -CONFIG_USB_ISP1760_DUAL_ROLE=y > +CONFIG_USB_ISP1760_HOST_ROLE=y > > Arnd cheers, -roger ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in 2023-04-04 12:59 ` Roger Quadros @ 2023-04-04 13:08 ` Arnd Bergmann 2023-04-04 15:09 ` Roger Quadros 0 siblings, 1 reply; 8+ messages in thread From: Arnd Bergmann @ 2023-04-04 13:08 UTC (permalink / raw) To: Roger Quadros, Krzysztof Kozlowski, Russell King Cc: Thinh Nguyen, Nishanth Menon, linux-arm-kernel, linux-kernel, Vignesh Raghavendra On Tue, Apr 4, 2023, at 14:59, Roger Quadros wrote: > On 04/04/2023 15:14, Arnd Bergmann wrote: >> On Tue, Apr 4, 2023, at 13:46, Roger Quadros wrote: >> That seems really high, so I had a look at what's going on. > > It was based on the configuration we are using at TI. > > (as built-in) > > $ size vmlinux > text data bss dec hex filename > 14616949 5285870 491776 20394595 1373263 vmlinux > $ ls -l vmlinux > -rwxrwxr-x 1 roger roger 120866544 Apr 4 15:54 vmlinux > > (as module) > > $ size vmlinux > text data bss dec hex filename > 14550571 5258106 491776 20300453 135c2a5 vmlinux > $ ls -l vmlinux > -rwxrwxr-x 1 roger roger 120324528 Apr 4 15:52 vmlinux > > > $ diff built-in-config module-config > 5547c5547 > < CONFIG_USB_XHCI_PLATFORM=y > --- >> CONFIG_USB_XHCI_PLATFORM=m > 5614c5614 > < CONFIG_USB_DWC3=y > --- >> CONFIG_USB_DWC3=m Ok, so the size difference here is only 94KB, presumably because have the non-TI variants as well as debugfs and/or gadget mode disabled. For the file size, my guess is that you have CONFIG_DEBUG_INFO enabled in your config, which drastically increases the size of the vmlinux file, but not the in-memory size, or the size of the stripped and compressed zImage. Arnd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in 2023-04-04 13:08 ` Arnd Bergmann @ 2023-04-04 15:09 ` Roger Quadros 0 siblings, 0 replies; 8+ messages in thread From: Roger Quadros @ 2023-04-04 15:09 UTC (permalink / raw) To: Arnd Bergmann, Krzysztof Kozlowski, Russell King Cc: Thinh Nguyen, Nishanth Menon, linux-arm-kernel, linux-kernel, Vignesh Raghavendra On 04/04/2023 16:08, Arnd Bergmann wrote: > On Tue, Apr 4, 2023, at 14:59, Roger Quadros wrote: >> On 04/04/2023 15:14, Arnd Bergmann wrote: >>> On Tue, Apr 4, 2023, at 13:46, Roger Quadros wrote: >>> That seems really high, so I had a look at what's going on. >> >> It was based on the configuration we are using at TI. >> >> (as built-in) >> >> $ size vmlinux >> text data bss dec hex filename >> 14616949 5285870 491776 20394595 1373263 vmlinux >> $ ls -l vmlinux >> -rwxrwxr-x 1 roger roger 120866544 Apr 4 15:54 vmlinux >> >> (as module) >> >> $ size vmlinux >> text data bss dec hex filename >> 14550571 5258106 491776 20300453 135c2a5 vmlinux >> $ ls -l vmlinux >> -rwxrwxr-x 1 roger roger 120324528 Apr 4 15:52 vmlinux >> >> >> $ diff built-in-config module-config >> 5547c5547 >> < CONFIG_USB_XHCI_PLATFORM=y >> --- >>> CONFIG_USB_XHCI_PLATFORM=m >> 5614c5614 >> < CONFIG_USB_DWC3=y >> --- >>> CONFIG_USB_DWC3=m > > Ok, so the size difference here is only 94KB, presumably > because have the non-TI variants as well as debugfs and/or > gadget mode disabled. For the file size, my guess is that > you have CONFIG_DEBUG_INFO enabled in your config, which That's right. > drastically increases the size of the vmlinux file, but > not the in-memory size, or the size of the stripped and > compressed zImage. Image file diff is ~128K. Image.gz diff is ~33K. -- cheers, -roger ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-04-04 15:09 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-04-04 8:42 [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in Roger Quadros 2023-04-04 8:51 ` Arnd Bergmann 2023-04-04 10:01 ` Krzysztof Kozlowski 2023-04-04 11:46 ` Roger Quadros 2023-04-04 12:14 ` Arnd Bergmann 2023-04-04 12:59 ` Roger Quadros 2023-04-04 13:08 ` Arnd Bergmann 2023-04-04 15:09 ` Roger Quadros
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox