Re: [PATCH] usb: chipidea: fix linking of udc if gadget is build as module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Jul 16, 2012 at 09:57:27PM +0200, Marc Kleine-Budde wrote:
> Hello,
> 
> On 07/16/2012 04:20 PM, Felipe Balbi wrote:
> >>>>> This is not the real problem. The problem is that USB_CHIPIDEA depends
> >>>>> on USB (which is the Host side USB). So if you make host built-in, you
> >>>>> can make chipidea built-in regardless of the gadget setting. That's the
> >>>>> bug you want to solve.
> >>>>
> >>>> I don't think so. Have a look at the above mentioned undefined symbols:
> >>>> "usb_gadget_unmap_request", they are implemented in:
> >>>>
> >>>> $git grep usb_gadget_unmap_request | grep EXPORT
> >>>> drivers/usb/gadget/udc-core.c:EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
> >>>
> >>> of course... that's because chipidea can be built-in while gadget isn't.
> >>> The bug is exactly allowing chipidea to be built-in with no regards to
> >>> the gadget side.
> >>>
> >>>> CONFIG_USB_CHIPIDEA=y
> >>>> CONFIG_USB_GADGET=m
> >>>
> >>> there you go. Chipidea is built-in and gadget isn't.
> >>
> >> That's exactly what my patch fixes.
> > 
> > yeah, but you fix it the wrong way. CONFIG_USB_CHIPIDEA should not
> 
> Okay. Point taken. My patch only fixes the regression which was
> introduced in "5e0aa49 usb: chipidea: use generic map/unmap routines".
> Just a minimal patch to go into the current release cycle.
> 
> > depend on USB to start with. If you disable USB Host side, you can't
> > compile chipidea driver. The patch below fixes most of the failures. Now
> > the only problem is when we have both host and gadget enabled, if one of
> > them is built-in, chipidea can be built-in regardless of the other. But
> > that's something from the kbuild language I guess.
> 
> Hmmm...Same problem as before, but now also for the host side. I've
> wrapped my head around the problem and I think a found something...I'm
> not sure how "nice" the solution is.
> 
> > diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
> > index fd36dc8..e43bf69 100644
> > --- a/drivers/usb/chipidea/Kconfig
> > +++ b/drivers/usb/chipidea/Kconfig
> > @@ -1,6 +1,7 @@
> >  config USB_CHIPIDEA
> >  	tristate "ChipIdea Highspeed Dual Role Controller"
> > -	depends on USB
> > +	depends on USB_SUPPORT
>                    ^^^^^^^^^^^
> not needed as it is included from drivers/usb/Kconfig inside the big
> ifdef USB_SUPPORT...endif. (At least on 3.5-rc7)

true.

> > +	depends on USB || USB_GADGET
> >  	help
> >            Say Y here if your system has a dual role high speed USB
> >            controller based on ChipIdea silicon IP. Currently, only the
> > @@ -10,20 +11,6 @@ config USB_CHIPIDEA
> >  
> >  if USB_CHIPIDEA
> >  
> > -config USB_CHIPIDEA_UDC
> > -	bool "ChipIdea device controller"
> > -	depends on USB_GADGET
> > -	select USB_GADGET_DUALSPEED
> 
> What about the select?

indeed :D

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux