From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>
Cc: David Laight <David.Laight@ACULAB.COM>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
Felipe Balbi <balbi@ti.com>,
Sarah Sharp <sarah.a.sharp@linux.intel.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Subject: Re: [PATCH] usb: hcd: get/put device and hcd for hcd_buffers()
Date: Wed, 10 Dec 2014 19:25:24 +0100 [thread overview]
Message-ID: <20141210182524.GA26371@linutronix.de> (raw)
In-Reply-To: <20141209165415.GB10260@kroah.com>
* 'Greg Kroah-Hartman' | 2014-12-09 11:54:15 [-0500]:
>> You can unbind the HCD driver from the PCI-device via sysfs and this is
>> not something not only a developer does. This "unbind" calls the remove
>> function of the driver and the only difference between unbind and rmmod
>> is that the module remains inserted (but this is no news for you).
>
>If unbind causes a problem, it's the same problem that could happen if
>the hardware is hot-unplugged (like on a PCI card.) Stuff like that
>_does_ need to be fixed, and if your test shows this is a problem, I am
>all for fixing that.
so I tried this with unbind and it didn't explode as assumed. On musb,
for some reason the hcd struct never gets cleaned up. The driver free(s)
URB memory after the hcd_pools are gone but since its size is 32KiB it
uses dma_free_coherent() and this seems to work fine (sice the device is
still there).
So tried the same thing with EHCI. EHCI-hcd cleans up its HCD-struct as
expected so I would have to poke at musb and figure out why it does not
happen.
Also, there is another difference: with EHCI I see first removal of
buffers followed by removal of the pools. So it happens after disconnect
but before the HCD pools are gone. I'm not sure why this happens with
EHCI but not with MUSB. It seems that for some reason unbind triggers an
error on /dev/video0 which makes gst-launch close that file. Once all users
are gone, that hcd struct is cleaned up. Again, it works as I would
expect it with EHCI but not with MUSB.
So maybe, once I learned how MUSB dafeated the userspace notification
about a gone device I might gain the same behavior that EHCI has. Also
not freed hcd struct of musb looks also important :)
>thanks,
>
>greg k-h
Sebastian
next prev parent reply other threads:[~2014-12-10 18:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 20:03 [PATCH] usb: hcd: get/put device and hcd for hcd_buffers() Sebastian Andrzej Siewior
2014-12-05 21:19 ` Greg Kroah-Hartman
2014-12-05 23:13 ` Sebastian Andrzej Siewior
2014-12-06 0:37 ` Greg Kroah-Hartman
2014-12-08 9:44 ` David Laight
2014-12-09 15:24 ` 'Greg Kroah-Hartman'
2014-12-09 16:01 ` Sebastian Andrzej Siewior
2014-12-09 16:54 ` 'Greg Kroah-Hartman'
2014-12-10 18:25 ` Sebastian Andrzej Siewior [this message]
2014-12-05 21:21 ` Alan Stern
2014-12-05 23:23 ` Sebastian Andrzej Siewior
2014-12-08 8:43 ` Sebastian Andrzej Siewior
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=20141210182524.GA26371@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=David.Laight@ACULAB.COM \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=sarah.a.sharp@linux.intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.