Message ID | 20230404084259.13752-1-rogerq@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2873344vqo; Tue, 4 Apr 2023 01:53:41 -0700 (PDT) X-Google-Smtp-Source: AKy350bWuqv1Eto3n27pOf3eeiwo4D83lBdral7jmkj+PYkGm34r1nZyTgFyHkf9PBsm6/4KimA2 X-Received: by 2002:a17:906:fad6:b0:947:bf71:a54f with SMTP id lu22-20020a170906fad600b00947bf71a54fmr1767531ejb.52.1680598421020; Tue, 04 Apr 2023 01:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680598421; cv=none; d=google.com; s=arc-20160816; b=GPaQSNUFVnRPu0hhvaZJsPYJtzufCVuus406qH/XSj2Wbhxuzy9nUclsrVE31vAB3H EF6hIB3vFPnryNhWuU9JUFuAhqbBQRi+agrTsG7v0Z5AUB2p/TVHZ4MKISvCR9XUDWrd ADp9M2hsaFOgJ3/RH4Dhk//aWudhWwHR7YnuIEicfvUeig3FFjvEsCOnl8bsD6ZUDFBB euI719/N0FlnhrmBECwcrnrtFFzCZRnvvWziEy0TrIa/pbCuespTROaEH7eEolVJGdew IvS6/3AHCI/Aa46F6wBRub+4HxZypOmZzt763t43P6rtFLTWHSUHQ4Uha7d7ps49yYds q9uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZvSlEJ2TBy/a388Qc1UIAW29pZ9kRlr1TM8JNHwNSHE=; b=wropeqefDQj4akSABVWNe/XiHW8VYT+sPyPqbEhs2RbcKNMeF6D6OY0cdlQunS633T h0uczmSgVSFe6/YvslnFf+Wdx+fAiGrHVhRKiKKCu7vyI9Fvg7wIwdLWF2k7Q6nYQKFt I7VZQDVPw1w24pMmtcZqgF7JwmK4np1PKRcPx1iMn/JW0/bA0DSDYtdCqR9Lksa64zLV 5rzgaXaaSHLTDNPqRna99HRXqLn2GCZJGCqe5IdLwAQiimzxs5bMuQ37VFhMSi1GLCzj ib1zCR/ekE+dbvSsbVEofDOnVhVA8ZY83WDjBRKcJI1KML/dY+QaSa6cTNLz9WIIsmph a3MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rmHMsmZq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a170906b08800b009220173aa75si5454446ejy.456.2023.04.04.01.53.16; Tue, 04 Apr 2023 01:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rmHMsmZq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233811AbjDDInX (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Tue, 4 Apr 2023 04:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233890AbjDDInV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Apr 2023 04:43:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A799268A for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 01:43:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 049D662EA7 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 08:43:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A8C7C433EF; Tue, 4 Apr 2023 08:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680597790; bh=+CwDQqmqGsUNWHze2us4Rgr7tqETv05FzxmPTtoaoB0=; h=From:To:Cc:Subject:Date:From; b=rmHMsmZq76ND8+h5A0Ul9SeGz586DdJO6WmX7VEu9ee6ASwMW6UMFZTes1N/MiSTb 2T2VB9W0ysRk0E3ODoADJg78H1fb93wbMfRJmPKJF7U6PrYfUy+aV6Dvek367gYNLP a41KRtz9l315cknqpE88WmLUkwQ/FGKCeDZPBVO0nWZBFZIKjbjMUtMZzZIu1opnxd bAupba1Jf5mwVi1Rua1G4zy7oHdHXOeXBg9f39Ec/VYM1OYv7gSir87d9uRBWHVDQR N31ua/etgVZhgXacaole9hD0RLBQ6Ttm7inBESbKj0bFMFqNTcVV2OsvV7TReKiwxF IQ8F/w+Umtdiw== From: Roger Quadros <rogerq@kernel.org> To: linux@armlinux.org.uk, arnd@arndb.de Cc: krzysztof.kozlowski@linaro.org, Thinh.Nguyen@synopsys.com, nm@ti.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Roger Quadros <rogerq@kernel.org> Subject: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in Date: Tue, 4 Apr 2023 11:42:59 +0300 Message-Id: <20230404084259.13752-1-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762235170420520146?= X-GMAIL-MSGID: =?utf-8?q?1762235170420520146?= |
Series |
ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in
|
|
Commit Message
Roger Quadros
April 4, 2023, 8:42 a.m. UTC
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(-)
Comments
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
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
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
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
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
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
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
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