From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition
Date: Fri, 23 Nov 2012 11:00:21 +0100 [thread overview]
Message-ID: <50AF4935.4000707@pengutronix.de> (raw)
In-Reply-To: <20121123053635.GB22420@nchen-desktop>
On 11/23/2012 06:36 AM, Peter Chen wrote:
> On Wed, Nov 21, 2012 at 03:06:29PM +0100, Michael Grzeschik wrote:
>> From: Marc Kleine-Budde <mkl@pengutronix.de>
>>
>> This fixes a potential race condition where the ci13xxx_imx glue code
>> could be fast enough to call one of the usbmisc_ops before he got a
>> valid value on the static usbmisc pointer. To fix that we first set
>> usbmisc, then call usbmisc_set_ops().
>
> usbmisc is subsys_initcall, and cil13xxx_imx is module_init. Any
> potential situation that the ci13xxx_imx's probe is ran before the
> usbmisc's probe is completed? Besides, there is usbmisc_ops value
> check at the beginning of cil13xxx_imx's probe.
It's bad practice to rely your code on some external ordering mechanism,
even more if the correct solution is so simple. And as Sascha pointed
out everything might be build as modules and loaded individually.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121123/0408da18/attachment.sig>
next prev parent reply other threads:[~2012-11-23 10:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 14:06 [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 1/7] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 2/7] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 3/7] usb: chipidea: usbmisc: fix a potential race condition Michael Grzeschik
2012-11-23 5:36 ` Peter Chen
2012-11-23 7:37 ` Sascha Hauer
2012-11-23 9:01 ` Alexander Shishkin
2012-11-23 10:00 ` Marc Kleine-Budde [this message]
2012-11-21 14:06 ` [PATCH v3 4/7] usb: chipidea: usbmisc: prepare driver to handle more than one soc Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock Michael Grzeschik
2012-11-23 6:51 ` Peter Chen
2012-11-23 16:20 ` Michael Grzeschik
2012-11-25 9:18 ` Peter Chen
2012-11-26 15:44 ` Michael Grzeschik
2012-11-21 14:06 ` [PATCH v3 6/7] usb: chipidea: usbmisc: add mx53 support Michael Grzeschik
2012-11-21 20:28 ` Sergei Shtylyov
2012-11-21 19:58 ` Michael Grzeschik
2012-11-23 6:53 ` Peter Chen
2012-11-23 7:39 ` Sascha Hauer
2012-11-25 8:05 ` Peter Chen
2012-11-23 10:02 ` Marc Kleine-Budde
2012-11-25 8:09 ` Peter Chen
2012-11-26 15:40 ` Grant Likely
2012-11-21 14:06 ` [PATCH v3 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25 Michael Grzeschik
2012-11-23 6:59 ` Peter Chen
2012-11-22 9:24 ` [PATCH v3 0/7] support other fsl SoCs with usbmisc + small fixes Alexander Shishkin
2012-11-22 9:31 ` Peter Chen
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=50AF4935.4000707@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 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).