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 4DE052DCF45; Fri, 3 Apr 2026 09:26:54 +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=1775208414; cv=none; b=hz1lnBCC57QGW0kHtxQ8DJd/0P+or32WWFBpKC7vbqOxD+/XQmlEHQ9RupReSFlH8R9+h23G3wdac7PDY+69b+YridqoP9LrrLG/UuTjC3vHZSPTUkMYHtw41WPTy4Z3ZWoedJ8a5EJn3AaWaa5Biuf9BIV3w585kVKSAYtcbdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775208414; c=relaxed/simple; bh=IFW15AksXYhoF02+XCjmZnN3Zj/qKE14iDBL9F1cKjc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=axBKXtV9C4eRfmQ8XiAfAIBDBExdlSYF2W2lm2Sv87VNnJ+4E8gwgFwJ0RtAZ7AgX7RSK1qtmHRVqofP/12qc9Gnpz6fBLqDpUp5kZdyVbwQDJAupDFUoGb68inlhHpdTQMiVFwWgNcvxTzMSBN+H5m1DgAU57Dwsh22Sew/lBY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YiTbqW83; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YiTbqW83" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 101C2C4CEF7; Fri, 3 Apr 2026 09:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775208413; bh=IFW15AksXYhoF02+XCjmZnN3Zj/qKE14iDBL9F1cKjc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YiTbqW83vjLPTLXyp+2IYUcbQDM5huwVHhnSrRpW1J0fh4G0H51NSi9/hVcnkkW85 m9RXFOgnmLXFnUuQdFw+DV3KsMrX2YVCScijLsNbe3kVs3FNNRD/hMptHQ3LINFpiy k7RmzZ4Nwh8qLd28iaRcACyLUh/fj8rQMOWgtnu6kBkTRrIFtUsZEYCqKdJYD8jKWj HYBws2ADDLR68igF6WI2oExWkH5oFsPPWmuR5wDE6ejB1syAvsiYoksqxCwf7p30Az vYUXJLD/Wd5Isnxs2/0QpbtSKi/zqji/fvJu6zK59/aiqbCRubTri2zuozgyNvWNPz OLMwisFx4S7Wg== Date: Fri, 3 Apr 2026 17:26:49 +0800 From: "Peter Chen (CIX)" To: Arnd Bergmann Cc: Arnd Bergmann , Greg Kroah-Hartman , Pawel Laszczak , Roger Quadros , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: cdns3: attempt to fix Kconfig dependencies Message-ID: References: <20260402141008.2691819-1-arnd@kernel.org> <26779a33-135a-4881-8614-9987c5e90380@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <26779a33-135a-4881-8614-9987c5e90380@app.fastmail.com> On 26-04-03 10:39:18, Arnd Bergmann wrote: > On Fri, Apr 3, 2026, at 09:50, Peter Chen (CIX) wrote: > > On 26-04-02 16:09:55, Arnd Bergmann wrote: > >> --- > >> 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. > > > > cdns-usb-common.ko is a libary, and no USB/GADGET dependency, could builds in. > > ├── core.o > > └── drd.o > > > > cdns3-host.ko -> depends on USB/XHCI(it is m when USB = m > > cdns3.ko (gadget) -> depends on USB_GADGET > > cdnsp.ko (gadget) -> depends on USB_GADGET > > cdns3-plat.ko -> assign host_init/gadget_init function pointer > > This all sounds good. Ideally cdns3-plat.ko would also lose the > dependency on cdns3.ko/cdnsp.ko No, it can't. cdns3-plat.ko depends on cdns3.ko/cdsnp.ko or its stub. > > >> @@ -10,12 +11,24 @@ config USB_CDNS_SUPPORT > >> > >> config USB_CDNS_HOST > >> bool > >> + depends on USB=y || USB=USB_CDNS_SUPPORT > >> + > >> +config CONFIG_USB_CDNS_PLATFORM > > > > %s/CONFIG_USB_CDNS_PLATFORM/USB_CDNS_PLATFORM > > Oh, this means my patch did not actually work at all, and my testing > was pointless. I've fixed that now in my randconfig tree to see > if anything else comes up. > > Arnd I am afraid it may need to change more for your patch, otherwise, it could have error with below combinations: USB=y USB_GADGET=y USB_CDNS_SUPPORT=y USB_CDNS_HOST=y USB_CDNS_PLATFORM=y USB_CDNS3=y USB_CDNS3_GADGET=y USB_CDNS3_HOST=y USB_CDNSP=y USB_CDNSP_GADGET=m USB_CDNSP_HOST=y USB_CDNS_PLATFORM reference to the cdnsp_gadget_init which is built as module. drivers/usb/cdns3/cdns3-plat.c:52: undefined reference to `cdnsp_gadget_init' So far, below changes works okay at my test: diff --git a/drivers/usb/cdns3/Kconfig b/drivers/usb/cdns3/Kconfig index 07ed694e10b8..57cd7e3b5b22 100644 --- a/drivers/usb/cdns3/Kconfig +++ b/drivers/usb/cdns3/Kconfig @@ -13,11 +13,13 @@ config USB_CDNS_HOST bool depends on USB=y || USB=USB_CDNS_SUPPORT -config CONFIG_USB_CDNS_PLATFORM +config USB_CDNS_PLATFORM tristate "Cadence USB3 generic platform support" depends on USB_CDNSP || USB_CDNS3 depends on USB_CDNSP || !USB_CDNSP depends on USB_CDNS3 || !USB_CDNS3 + depends on USB_CDNS3_GADGET || !USB_CDNS3_GADGET + depends on USB_CDNSP_GADGET || !USB_CDNSP_GADGET help The platform driver support is needed on any SoC integrating a variant of the Cadence USB3 or USBSSP dual-role controllers, @@ -118,7 +120,7 @@ config USB_CDNSP if USB_CDNSP config USB_CDNSP_GADGET - bool "Cadence USBSSP device controller" + tristate "Cadence USBSSP device controller" depends on USB_GADGET=y || USB_GADGET=USB_CDNSP help Say Y here to enable device controller functionality of the -- Best regards, Peter