From: "Bjørn Mork" <bjorn-yOkvZcmFvRU@public.gmane.org>
To: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>
Cc: "Ming Lei" <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Marius Bjørnstad Kotsbak"
<marius.kotsbak-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH net] net: qmi_wwan: fix Oops while disconnecting
Date: Thu, 28 Jun 2012 10:55:34 +0200 [thread overview]
Message-ID: <87hatvdddl.fsf@nemi.mork.no> (raw)
In-Reply-To: <201206281035.19964.oneukum-l3A5Bk7waGM@public.gmane.org> (Oliver Neukum's message of "Thu, 28 Jun 2012 10:35:19 +0200")
Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org> writes:
> Am Dienstag, 26. Juni 2012, 09:23:19 schrieb Ming Lei:
>> On Mon, Jun 25, 2012 at 8:10 PM, Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org> wrote:
>
>> > At this point a minidriver must not follow the intfdata pointer,
>> > because the interface may again be probed. So if here a minidriver
>>
>> IMO, probe is serialized strictly with driver unbind since both the parent
>> lock and its own device lock have been held, so the probe may only be
>> started after driver unbinding is completed.
>
> Yes, but if you have a driver which claims multiple interfaces and uses
> a subdriver, then you will have cases of intfdate being NULL before
> disconnect() finishes.
This is true regardless of subdriver, isn't it? The subdriver issue is
special because it makes this a potentional problem even with a single
interface.
>> > still uses intfdata, locking will be needed. We want to catch those
>> > casees.
>>
>> Suppose infdata is used here somewhere, it is surely a bug because
>> the usbnet instance pointed by intfdata will be freed soon.
>
> Of course. That is the point.
>
>> So looks putting the set to NULL after driver_info->unbind is good,
>> doesn't it?
>
> Again, of course. We could drop it (but not the check for NULL in usbnet).
> It is a debugging aid.
>
>> > usb_kill_urb(dev->interrupt);
>> > usb_free_urb(dev->interrupt);
>> >
>> > free_netdev(net);
>> > usb_put_dev (xdev);
>> > }
>> >
>> >> > Sure, it is a debugging aid. It has the drawback that minidrivers have
>> >> > to be able to deal with intfdata being NULL. That is not hard to do.
>> >>
>> >> The check isn't needed if the set to NULL is put after driver_info->unbind
>> >> in usbnet_disconnect.
>> >
>> > True, but we don't catch bugs.
>>
>> If the check is added, the bugs may be hided, and no stack will be
>> dumped, :-)
>
> That is also true.
>
> Bjørn,
>
> do you use subdrivers with cdc-ether?
No, and I don't think it should ever be added there. It would add
complexity to the driver, and IMHO we really don't want that for the
generic cdc-ether. Better adding a new minidriver if the need to export
some other CDC embedded protocol to userspace shows up.
But given that all other embedded protocol examples I've seen are so
simple that they've been implemented inside their repective minidrivers
(sierra_net, hso, rndis_host), I don't think it's likely that any new
need for the cdc-wdm subdriver will show up soon. I could of course be
completely wrong, as usual.
Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-06-28 8:55 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 9:11 [PATCH net] net: qmi_wwan: fix Oops while disconnecting Bjørn Mork
[not found] ` <1340356279-3124-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2012-06-22 12:45 ` Ming Lei
2012-06-22 13:42 ` Bjørn Mork
2012-06-22 15:09 ` Ming Lei
[not found] ` <CACVXFVOQ3Uh50iJxboD-7=+J55MAW8Wjt3iY0WahauO2PrxT4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-22 16:18 ` Bjørn Mork
[not found] ` <877guzl3qz.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2012-06-22 16:52 ` Ming Lei
[not found] ` <CACVXFVNCAsM5NihpAFLU5rGo5ynr3=XU5gw7nM5Fi2mrrX+hKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-22 17:31 ` Bjørn Mork
2012-06-23 3:32 ` Ming Lei
2012-06-23 3:39 ` Ming Lei
[not found] ` <CACVXFVMJSrLjOyKUnZWr3CY2HJT6Wfm6AugZOhSCRUubV0hNMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-23 8:45 ` Bjørn Mork
2012-06-23 14:55 ` Ming Lei
2012-06-23 15:32 ` Bjørn Mork
[not found] ` <87hau2hwna.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2012-06-23 20:55 ` Oliver Neukum
[not found] ` <201206232255.08319.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2012-06-24 9:34 ` Bjørn Mork
2012-06-24 12:13 ` Oliver Neukum
2012-06-24 17:47 ` Bjørn Mork
2012-06-25 3:37 ` Ming Lei
2012-06-25 6:15 ` Oliver Neukum
2012-06-25 7:15 ` Ming Lei
[not found] ` <CACVXFVNUv6w5OjSZdQDbcLEPpDU5vO_Nmarm+fAfh0RkkL_hdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-25 12:10 ` Oliver Neukum
2012-06-26 7:23 ` Ming Lei
2012-06-28 8:35 ` Oliver Neukum
[not found] ` <201206281035.19964.oneukum-l3A5Bk7waGM@public.gmane.org>
2012-06-28 8:55 ` Bjørn Mork [this message]
2012-06-28 9:11 ` Ming Lei
[not found] ` <CACVXFVN3wJ3NWxSGj-yWCgtDE_sgJT5CZYHwYUWk1MxkphcsTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-25 7:24 ` Bjørn Mork
2012-06-25 8:08 ` Ming Lei
[not found] ` <CACVXFVOPjFSS6Sv6AUCSAs4nywR045QhjYAbN8g6U3adsUbujw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-25 8:27 ` Bjørn Mork
2012-06-28 8:36 ` Bjørn Mork
[not found] ` <87lij7de8u.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2012-06-28 8:40 ` Oliver Neukum
[not found] ` <201206281040.55402.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2012-06-28 23:54 ` David Miller
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=87hatvdddl.fsf@nemi.mork.no \
--to=bjorn-yokvzcmfvru@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marius.kotsbak-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=oneukum-l3A5Bk7waGM@public.gmane.org \
--cc=tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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.