public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Sokolovsky <pmiscml@gmail.com>
To: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-kernel@vger.kernel.org, <kernel-discuss@handhelds.org>
Cc: David Brownell <david-b@pacbell.net>, Richard Purdie <rpurdie@rpsys.net>
Subject: Fwd: [Kernel-discuss] [PATCH] g_ether+pxa27x_udc compiled in kernel not working
Date: Fri, 22 Sep 2006 05:29:25 +0300	[thread overview]
Message-ID: <784781139.20060922052925@gmail.com> (raw)
In-Reply-To: <20060920123429.GA8780@localhost>

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


           reply	other threads:[~2006-09-22  2:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20060920123429.GA8780@localhost>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=784781139.20060922052925@gmail.com \
    --to=pmiscml@gmail.com \
    --cc=david-b@pacbell.net \
    --cc=kernel-discuss@handhelds.org \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox