linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
	Greg Kroah-Hartman <greg@kroah.com>,
	linux-usb@vger.kernel.org, linuxppc-dev@ozlabs.org,
	Alan Stern <stern@rowland.harvard.edu>,
	Li Yang <leoli@freescale.com>
Subject: Re: [PATCH v2] usb/fsl_qe_udc: Report disconnect before unbinding
Date: Mon, 17 Nov 2008 17:01:23 -0800	[thread overview]
Message-ID: <200811171701.23401.david-b@pacbell.net> (raw)
In-Reply-To: <20081113115720.GA28276@oksana.dev.rtsoft.ru>

On Thursday 13 November 2008, Anton Vorontsov wrote:
> Gadgets disable endpoints in their disconnect callbacks, so
> we must call disconnect before unbinding. This also fixes
> muram memory leak, since we free muram in the qe_ep_disable().
> 
> But mainly the patch fixes following badness:
> 
> root@b1:~# insmod fsl_qe_udc.ko
> fsl_qe_udc: Freescale QE/CPM USB Device Controller driver, 1.0
> fsl_qe_udc e01006c0.usb: QE USB controller initialized as device
> root@b1:~# insmod g_ether.ko
> g_ether gadget: using random self ethernet address
> g_ether gadget: using random host ethernet address
> usb0: MAC be:2d:3c:fa:be:f0
> usb0: HOST MAC 62:b8:6a:df:38:66
> g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
> g_ether gadget: g_ether ready
> fsl_qe_udc e01006c0.usb: fsl_qe_udc bind to driver g_ether
> g_ether gadget: high speed config #1: CDC Ethernet (ECM)
> root@b1:~# rmmod g_ether.ko
> ------------[ cut here ]------------
> Badness at drivers/usb/gadget/composite.c:871
> [...]
> NIP [d10c1374] composite_unbind+0x24/0x15c [g_ether]
> LR [d10a82f4] usb_gadget_unregister_driver+0x128/0x168 [fsl_qe_udc]
> Call Trace:
> [cfb93e80] [cfb1f3a0] 0xcfb1f3a0 (unreliable)
> [cfb93eb0] [d10a82f4] usb_gadget_unregister_driver+0x128/0x168 [fsl_qe_udc]
> [cfb93ed0] [d10c2a3c] usb_composite_unregister+0x3c/0x4c [g_ether]
> [cfb93ee0] [c006bde0] sys_delete_module+0x130/0x19c
> [cfb93f40] [c00142d8] ret_from_syscall+0x0/0x38
> [...]
> fsl_qe_udc e01006c0.usb: unregistered gadget driver 'g_ether'
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Acked-by: David Brownell <dbrownell@users.sourceforge.net>


> ---
> 
> v2:
> - Comment update per Alan Stern review.
> 
> replaces
> usb.current/usb-fsl_qe_udc-report-disconnect-before-unbinding-fixing-oopses.patch
> 
>  drivers/usb/gadget/fsl_qe_udc.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
> index 37c8575..3d6c956 100644
> --- a/drivers/usb/gadget/fsl_qe_udc.c
> +++ b/drivers/usb/gadget/fsl_qe_udc.c
> @@ -2382,6 +2382,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
>  		nuke(loop_ep, -ESHUTDOWN);
>  	spin_unlock_irqrestore(&udc_controller->lock, flags);
>  
> +	/* report disconnect; the controller is already quiesced */
> +	driver->disconnect(&udc_controller->gadget);
> +
>  	/* unbind gadget and unhook driver. */
>  	driver->unbind(&udc_controller->gadget);
>  	udc_controller->gadget.dev.driver = NULL;
> -- 
> 1.5.6.3
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

      reply	other threads:[~2008-11-18  1:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-12 18:56 [PATCH] usb/fsl_qe_udc: Report disconnect before unbinding Anton Vorontsov
2008-11-12 19:38 ` Alan Stern
2008-11-12 19:59   ` Anton Vorontsov
2008-11-12 20:12     ` Anton Vorontsov
2008-11-12 20:20       ` Anton Vorontsov
2008-11-12 21:12         ` Alan Stern
2008-11-13 11:57 ` [PATCH v2] " Anton Vorontsov
2008-11-18  1:01   ` David Brownell [this message]

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=200811171701.23401.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=avorontsov@ru.mvista.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=greg@kroah.com \
    --cc=leoli@freescale.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).