All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Russell King <linux@armlinux.org.uk>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Nishanth Menon <nm@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in
Date: Tue, 4 Apr 2023 15:59:53 +0300	[thread overview]
Message-ID: <87cc8d92-0345-bc4b-60e8-1ca016691371@kernel.org> (raw)
In-Reply-To: <08b12571-5ca6-4e3d-8c56-5fc48827d17a@app.fastmail.com>



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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Roger Quadros <rogerq@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Russell King <linux@armlinux.org.uk>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Nishanth Menon <nm@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in
Date: Tue, 4 Apr 2023 15:59:53 +0300	[thread overview]
Message-ID: <87cc8d92-0345-bc4b-60e8-1ca016691371@kernel.org> (raw)
In-Reply-To: <08b12571-5ca6-4e3d-8c56-5fc48827d17a@app.fastmail.com>



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

  reply	other threads:[~2023-04-04 13:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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:42 ` Roger Quadros
2023-04-04  8:51 ` Arnd Bergmann
2023-04-04  8:51   ` Arnd Bergmann
2023-04-04 10:01   ` Krzysztof Kozlowski
2023-04-04 10:01     ` Krzysztof Kozlowski
2023-04-04 11:46     ` Roger Quadros
2023-04-04 11:46       ` Roger Quadros
2023-04-04 12:14       ` Arnd Bergmann
2023-04-04 12:14         ` Arnd Bergmann
2023-04-04 12:59         ` Roger Quadros [this message]
2023-04-04 12:59           ` Roger Quadros
2023-04-04 13:08           ` Arnd Bergmann
2023-04-04 13:08             ` Arnd Bergmann
2023-04-04 15:09             ` Roger Quadros
2023-04-04 15:09               ` Roger Quadros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cc8d92-0345-bc4b-60e8-1ca016691371@kernel.org \
    --to=rogerq@kernel.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=arnd@arndb.de \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nm@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.