From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5ABAC6FD1D for ; Tue, 4 Apr 2023 13:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KP2KUIk3aJNismjmjkqNfCBmHsasma0PHv4mEC3I9KY=; b=OrNHBut6K4N+BI eW83hzJvEN252Dp6M+TcP8nMX3AazP4xvqLrxRwS1/Bn3f6T5qN114cVkw/BQIUVEDzaIdf9fTBDm ALvua7wFREPp5NwYLZDv+MsdBKUYJBJ1U7uHVS1cxIImPBHt9DlFEM3+ICFMYquB/3mKRcOqMfzgK SEw2fRWZBVdjt2lNTR6uZeyXRG8qPqC1LjTRdMXNXpIT2AkDltjKaZ6p6KVcMfZtfWy2S/FebiqG0 m8KFFVemLXV4jzACKaTLxOl7qZhNfesGaOeGxj9mW3iMOs9hYhNvLcsZukjPG3kgesagu5hFHMve9 A9zE9rB2YvCd0radU34Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjgGX-001NW4-1g; Tue, 04 Apr 2023 13:00:01 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjgGU-001NVD-2a for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 13:00:00 +0000 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 542F96335F; Tue, 4 Apr 2023 12:59:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5A6FC433D2; Tue, 4 Apr 2023 12:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680613197; bh=fodprQ7jZamAExd0tbBd2YeF/mqBlgT3HS3YDEqP/l4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GsdaYq2XFlMx+HRvmxtB553rQGPAFzIitFwP2bR8792kgZHHJkKIDD1tuvAOo3mAq 9G5Y6RynxSl++UooCpq+Rnwf7wHwZgkaruW/hmNK7CqH07UAEdkZFT2zgsJmQkZJdL uGYXGTgCHMnoTe6shJjfAY4kge5cr2rQHKbrCiWKGGXH310ZWRySsDTNEvi7Sdcf4t dmEj3sLy1XlR5OifDfOgkFItqtFvvVt26ulD1Bmj0NjETRNvw6e7S3+GwqkQzNZKB0 ymTqu+9LLL/Jz9lZeliGLQ+3lqksloFK3c4mOmz3Z9wqFsuLEPaBtVXEoUTrxQgEek TJbj10D5cC+Dw== Message-ID: <87cc8d92-0345-bc4b-60e8-1ca016691371@kernel.org> Date: Tue, 4 Apr 2023 15:59:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in To: Arnd Bergmann , Krzysztof Kozlowski , Russell King Cc: Thinh Nguyen , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Vignesh Raghavendra References: <20230404084259.13752-1-rogerq@kernel.org> <283f8f4c-9f8d-48b1-b161-3b712104583b@app.fastmail.com> <0ffa9690-9709-669c-b44d-dbb93446ec95@linaro.org> <076b5775-18eb-05b3-b803-c54420b3e5fe@kernel.org> <08b12571-5ca6-4e3d-8c56-5fc48827d17a@app.fastmail.com> Content-Language: en-US From: Roger Quadros In-Reply-To: <08b12571-5ca6-4e3d-8c56-5fc48827d17a@app.fastmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_055958_916835_529C2806 X-CRM114-Status: GOOD ( 19.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 >>>>> --- >>>> >>>> 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D8E4C761A6 for ; Tue, 4 Apr 2023 13:00:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234464AbjDDNAB (ORCPT ); Tue, 4 Apr 2023 09:00:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234191AbjDDM77 (ORCPT ); Tue, 4 Apr 2023 08:59:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8B9E1722 for ; Tue, 4 Apr 2023 05:59:58 -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 50B306327D for ; Tue, 4 Apr 2023 12:59:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5A6FC433D2; Tue, 4 Apr 2023 12:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680613197; bh=fodprQ7jZamAExd0tbBd2YeF/mqBlgT3HS3YDEqP/l4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GsdaYq2XFlMx+HRvmxtB553rQGPAFzIitFwP2bR8792kgZHHJkKIDD1tuvAOo3mAq 9G5Y6RynxSl++UooCpq+Rnwf7wHwZgkaruW/hmNK7CqH07UAEdkZFT2zgsJmQkZJdL uGYXGTgCHMnoTe6shJjfAY4kge5cr2rQHKbrCiWKGGXH310ZWRySsDTNEvi7Sdcf4t dmEj3sLy1XlR5OifDfOgkFItqtFvvVt26ulD1Bmj0NjETRNvw6e7S3+GwqkQzNZKB0 ymTqu+9LLL/Jz9lZeliGLQ+3lqksloFK3c4mOmz3Z9wqFsuLEPaBtVXEoUTrxQgEek TJbj10D5cC+Dw== Message-ID: <87cc8d92-0345-bc4b-60e8-1ca016691371@kernel.org> Date: Tue, 4 Apr 2023 15:59:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] ARM: multi_v7_defconfig: make USB_DWC3 as a module instead of built-in To: Arnd Bergmann , Krzysztof Kozlowski , Russell King Cc: Thinh Nguyen , Nishanth Menon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Vignesh Raghavendra References: <20230404084259.13752-1-rogerq@kernel.org> <283f8f4c-9f8d-48b1-b161-3b712104583b@app.fastmail.com> <0ffa9690-9709-669c-b44d-dbb93446ec95@linaro.org> <076b5775-18eb-05b3-b803-c54420b3e5fe@kernel.org> <08b12571-5ca6-4e3d-8c56-5fc48827d17a@app.fastmail.com> Content-Language: en-US From: Roger Quadros In-Reply-To: <08b12571-5ca6-4e3d-8c56-5fc48827d17a@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>>>> --- >>>> >>>> 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