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]

 



On 07/16/2012 03:38 PM, Felipe Balbi wrote:
> Hi,
> 
> On Mon, Jul 16, 2012 at 03:31:54PM +0200, Marc Kleine-Budde wrote:
>> On 07/16/2012 03:19 PM, Felipe Balbi wrote:
>>> Hi,
>>>
>>> On Mon, Jul 16, 2012 at 03:10:48PM +0200, Marc Kleine-Budde wrote:
>>>> Since commit 5e0aa49 usb: chipidea: use generic map/unmap routines,
>>>> the udc part of the chipidea driver needs the generic usb gadget helper
>>>> functions. If the chipidea driver with udc support is build into the
>>>> kernel and usb gadget is build a module, the linking of the kernel
>>>> fails with:
>>>>
>>>> drivers/built-in.o: In function `_hardware_dequeue':
>>>> drivers/usb/chipidea/udc.c:527: undefined reference to `usb_gadget_unmap_request'
>>>> drivers/usb/chipidea/udc.c:1269: undefined reference to `usb_gadget_unmap_request'
>>>> drivers/usb/chipidea/udc.c:1821: undefined reference to `usb_del_gadget_udc'
>>>> drivers/usb/chipidea/udc.c:443: undefined reference to `usb_gadget_map_request'
>>>> drivers/usb/chipidea/udc.c:1774: undefined reference to `usb_add_gadget_udc'
>>>>
>>>> This patch changes the dependencies, so that udc can only be built-in of the
>>>> usb gadget is built-in, too.
>>>>
>>>> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
>>>> Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
>>>> ---
>>>> Hello,
>>>>
>>>> this patch is based on v3.5-rc7, is this a candidate for 3.5?
>>>>
>>>> Another solution would be to "select USB_GADGET"....
>>>
>>> no select please ;-)
>>
>> Sure :)
>>
>>>
>>>> regards, Marc
>>>>
>>>>  drivers/usb/chipidea/Kconfig |    2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
>>>> index fd36dc8..9993a66 100644
>>>> --- a/drivers/usb/chipidea/Kconfig
>>>> +++ b/drivers/usb/chipidea/Kconfig
>>>> @@ -12,7 +12,7 @@ if USB_CHIPIDEA
>>>>  
>>>>  config USB_CHIPIDEA_UDC
>>>>  	bool "ChipIdea device controller"
>>>> -	depends on USB_GADGET
>>>> +	depends on USB_GADGET=USB_CHIPIDEA
>>
>> This patch says if USB_CHIPIDEA is builtin, so USB_GADGET has to be, too
>>
>>> 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.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP 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