public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fwd: [Kernel-discuss] [PATCH] g_ether+pxa27x_udc compiled in kernel not working
       [not found] <20060920123429.GA8780@localhost>
@ 2006-09-22  2:29 ` Paul Sokolovsky
  0 siblings, 0 replies; only message in thread
From: Paul Sokolovsky @ 2006-09-22  2:29 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, kernel-discuss
  Cc: David Brownell, Richard Purdie

Greetings,

          We at Handhelds.org are having troubles with Ethernet USB
gadget driver after upgrading kernel to 2.6.17. Our systems are
embedded ARMs. The symptom is connections not being recognized after
plugging in USB socket. After some investigation, we found this patch
and applied it to our 2.6.17 tree:

http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a353678d3136306c1d00f0d2319de1dac8a6b1db

          However, it appeared that there's still a problem if g_ether
is builtin. The mail below describes the issue. It is confirmed that patch
below fixes the issue. Also, 2.6.18 appears to have this issue present
(from looking at source code, we didn't try it yet). Also, the same
issue seems to be present in other USB gadget drivers.


Thanks,
Handhelds.org developers


This is a forwarded message
From: Anton <cbou-at-mail.ru>
To: kernel-discuss@handhelds.org
Date: Wednesday, September 20, 2006, 3:34:29 PM
Subject: [Kernel-discuss] [PATCH] g_ether+pxa27x_udc compiled in kernel not working

===8<==============Original message text===============
Hi all,

In recent kernels (2.6.17-hh1) g_ether compiled in kernel do not work
with pxa27x_udc. Here are code snippets:

- drivers/usb/gadget/ether.c:2609:
        static struct usb_gadget_driver eth_driver = {
        ...
               .bind           = eth_bind,
               .unbind         = __exit_p(eth_unbind),
        ...
        };

- include/linux/init.h:273
        #ifdef MODULE
        #define __exit_p(x) x
        #else
        #define __exit_p(x) NULL
        #endif

- drivers/usb/gadget/pxa27x_udc.c:1454
        int usb_gadget_register_driver(struct usb_gadget_driver *driver)
        {
        ...
                if (!driver     || driver->speed != USB_SPEED_FULL
                        || !driver->bind
                        || !driver->unbind
                        || !driver->disconnect
                        || !driver->setup)
                return -EINVAL;


Thus, pxa27x_udc will not run g_ether code if it is compiled in.

Trivial patch attached.

There is the second way to deal with it: remove "|| !driver->unbind" check
from pxa27x_udc.c.

Which solution is better?


Thanks,

-- Anton (irc: bd2)

===8<===========End of original message text===========


Index: drivers/usb/gadget/ether.c
===================================================================
RCS file: /cvs/linux/kernel26/drivers/usb/gadget/ether.c,v
retrieving revision 1.32
diff -u -p -b -B -r1.32 ether.c
--- drivers/usb/gadget/ether.c  7 Sep 2006 02:48:35 -0000       1.32
+++ drivers/usb/gadget/ether.c  20 Sep 2006 11:58:26 -0000
@@ -2606,7 +2606,7 @@ static struct usb_gadget_driver eth_driv
 
        .function       = (char *) driver_desc,
        .bind           = eth_bind,
-       .unbind         = __exit_p(eth_unbind),
+       .unbind         = eth_unbind,
 
        .setup          = eth_setup,
        .disconnect     = eth_disconnect,




-- 
Best regards,
 Paul                            mailto:pmiscml@gmail.com


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-22  2:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20060920123429.GA8780@localhost>
2006-09-22  2:29 ` Fwd: [Kernel-discuss] [PATCH] g_ether+pxa27x_udc compiled in kernel not working Paul Sokolovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox