From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF04E21A447; Fri, 3 Apr 2026 12:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775217812; cv=none; b=HqiWnKJPeyIcS6f0wSeqlDCjWLcMm52zJvxEnPHIest5rcCg+exeypNU4yc1mW7crmjBxwcZg8pnV8DNMbCq/EZNh23QcOolxXXk2RYMOLU5r7dOrfOohbipv66Zxs3aW1MlEnnX3pYgT40Ea0BHjGyk/eDcIzRrtM2yYOJq44k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775217812; c=relaxed/simple; bh=uHc5YsrHfTkVT8EBijowwSaF1bhfQ6iwR+gHjnBhVXA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dVMCRLmu0H4D4E0G7XnBavp2QDYHsqf0GcAb1PxtUZmSZuV0JORVfpB7S8HRullpcO4GYZgzghNlYd0RF/XGo9fmJ7z6DCvbmoOKBUsa4Sn4g879QJU2hmjpuzNbUVbp5MR2e+i7JbhM4wmRoPzKaQjA/keuev7JtuUeRVhWgmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1nocCluc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1nocCluc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03775C4CEF7; Fri, 3 Apr 2026 12:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775217812; bh=uHc5YsrHfTkVT8EBijowwSaF1bhfQ6iwR+gHjnBhVXA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1nocClucvAt9BzbV/deA5N54IVMje5Tp6QUYUNkupXDo2Eht77vMLZFUqE7Ts403Z MkQDcg5uPJoZFR/P9HSVGoIp5Aiu3TZNUFzQd+vcnnMiowgkxA2vx7DQt7lzRWgMG2 aJ1nkFOexP3zYiBPe2GgugS4BBw8bbNorJPlqRJw= Date: Fri, 3 Apr 2026 14:03:29 +0200 From: Greg Kroah-Hartman To: "Peter Chen (CIX)" Cc: Arnd Bergmann , Pawel Laszczak , Arnd Bergmann , Roger Quadros , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: cdns3: attempt to fix Kconfig dependencies Message-ID: <2026040337-acutely-cinnamon-e751@gregkh> References: <20260402141008.2691819-1-arnd@kernel.org> <2026040328-residence-auction-d94d@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 03, 2026 at 05:40:33PM +0800, Peter Chen (CIX) wrote: > On 26-04-03 10:54:44, Greg Kroah-Hartman wrote: > > On Fri, Apr 03, 2026 at 03:50:45PM +0800, Peter Chen (CIX) wrote: > > > On 26-04-02 16:09:55, Arnd Bergmann wrote: > > > > From: Arnd Bergmann > > > > > > > > The way that dependencies between host and gadget mode, as well as cdns3 > > > > and cdnsp were handled was rather fragile before commit 6076388ca1ed > > > > ("usb: cdns3: Add USBSSP platform driver support"). > > > > > > > > After those changes, I get randconfig build failures: > > > > > > > > arm-linux-gnueabi-ld: drivers/usb/cdns3/cdnsp-gadget.o: in function `__cdnsp_gadget_init': > > > > cdnsp-gadget.c:(.text+0x12da): undefined reference to `cdns_drd_gadget_on' > > > > arm-linux-gnueabi-ld: drivers/usb/cdns3/cdnsp-gadget.o: in function `cdnsp_gadget_pullup': > > > > cdnsp-gadget.c:(.text+0x3030): undefined reference to `cdns_clear_vbus' > > > > arm-linux-gnueabi-ld: cdnsp-gadget.c:(.text+0x3138): undefined reference to `cdns_set_vbus' > > > > arm-linux-gnueabi-ld: drivers/usb/cdns3/cdnsp-gadget.o: in function `cdnsp_gadget_exit': > > > > cdnsp-gadget.c:(.text+0xe0): undefined reference to `cdns_drd_gadget_off' > > > > > > > > and I see additional configurations that are broken. The main problem > > > > here is that the 'common' module links against both host and gadget > > > > support if they are enabled, but there are insufficient protections > > > > agains it being built-in if only one of them is built-in and the other > > > > is in a loadable module, causing link failures. > > > > > > > > The use of IS_REACHABLE() in gadget-export.h works around a similar > > > > problem if one of cdns3 and cdnsp is built-in but the other one is > > > > =m. This one is worse because instead of a clear link failure, the > > > > logic just makes it not work at all despite support being enabled. > > > > > > > > To improve this mess, throw out both the Makefile hacks and the > > > > IS_REACHABLE() hack and replace these with regular Kconfig dependencies > > > > that ensure each driver is only enabled when its dependencies are there, > > > > as we do in most other drivers. The main downside here is that there is no > > > > good way to have built-in gadget support on cdn3 along with USB=m. Fixing > > > > this part proper would require cleaning up the code to turn the 'common' > > > > parts into a library module that only gets called by the other drivers > > > > but does not interact with either host or gadget support itself. > > > > > > > > Another problem that is not solved by this patch is the way that > > > > platform specific glue logic in this driver relies on having > > > > a soc specific device as the parent of a generic child, instead of > > > > the specific driver just calling into a common helper module. > > > > This may be impossible to fix without breaking the DT bindings. > > > > > > > > Fixes: 6076388ca1ed ("usb: cdns3: Add USBSSP platform driver support") > > > > > > Hi Arnd, > > > > > > Thanks for fixing it, I am sorry for taking your effort debug it. > > > > > > > Signed-off-by: Arnd Bergmann > > > > --- > > > > TBH, I would be more comfortable with reverting 6076388ca1ed altogether > > > > and asking for a new version with the proper fixups included along > > > > with more testing for the next merge window. > > > > > > It depends on Greg, I am okay for both ways. If Greg reverts the patch, > > > I will do below improvements and adapts for most of your changes for v3 > > > patch. > > > > I'll be glad to revert if you want me to, just let me know. > > > > Thanks, Greg. Please revert below two patches in your usb-next branch: > > 6076388ca1ed usb: cdns3: Add USBSSP platform driver support > fb14e7f7cbb4 dt-bindings: usb: cdns,usb3: document USBSSP controller support Ick, doesn't revert cleanly, I'm going to also have to drop commit 7b7f2dd91382 ("usb: cdnsp: Add support for device-only configuration") Will go do that now.... greg k-h