From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Greg KH <gregkh@suse.de>
Cc: Andrew Morton <akpm@osdl.org>, Miles Lane <miles.lane@gmail.com>,
linux1394-devel@lists.sourceforge.net,
LKML <linux-kernel@vger.kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Ben Collins <bcollins@ubuntu.com>
Subject: Re: 2.6.18-rc5-mm1 + all hotfixes -- INFO: possible recursive locking detected
Date: Wed, 06 Sep 2006 18:50:48 +0200 [thread overview]
Message-ID: <44FEFC68.90201@s5r6.in-berlin.de> (raw)
In-Reply-To: <44FE751E.4030505@s5r6.in-berlin.de>
I wrote:
> I wrote:
>> Or maybe it's older. Nodemgr takes class->subsys.rwsem and
>> device.bus->subsys.rwsem. It always did. Could there be a change in
>> driver core which makes this recursive? Or has it always been recursive?
>> For example,
>>
>> static void nodemgr_update_pdrv(struct node_entry *ne)
>> {
>> struct unit_directory *ud;
>> struct hpsb_protocol_driver *pdrv;
>> struct class *class = &nodemgr_ud_class;
>> struct class_device *cdev;
>>
>> down_read(&class->subsys.rwsem);
>> list_for_each_entry(cdev, &class->children, node) {
This may be wrong anyway. According to include/linux/device.h,
class->sem should be used to protect access to class->children. There
are more places in nodemgr of this sort.
>> ud = container_of(cdev, struct unit_directory, class_dev);
>> if (ud->ne != ne || !ud->device.driver)
>> continue;
>>
>> pdrv = container_of(ud->device.driver, struct hpsb_protocol_driver, driver);
>>
>> if (pdrv->update && pdrv->update(ud)) {
>> down_write(&ud->device.bus->subsys.rwsem);
>> device_release_driver(&ud->device);
>> up_write(&ud->device.bus->subsys.rwsem);
>> }
>> }
>> up_read(&class->subsys.rwsem);
>> }
>
> Hi Greg,
>
> perhaps you could advise on this. It appears from grepping through the
> sources that drivers/ieee1394/nodemgr.c is the only one with mixed
> access to device.bus->subsys.rwsem and class->subsys.rwsem.
>
> Other usages of subsys.rwsem that I found are:
> 1a.) dev->bus->subsys.rwsem
> driver/ide/ide-proc.c and drivers/net/phy/phy_device.c take
> dev->bus->subsys.rwsem. drivers/pnp/card.c takes dev.bus->subsys.rwsem.
>
> 1b.) driver.bus->subsys.rwsem
> drivers/s390/net/qeth_proc.c takes driver.bus->subsys.rwsem.
>
> 2.) class->subsys.rwsem
> drivers/scsi/hosts.c takes class->subsys.rwsem.
>
> 3.) bustype.subsys.rwsem
> drivers/input/serio/serio.c takes serio_bus.subsys.rwsem.
> drivers/input/gameport/gameport.c takes gameport_bus.subsys.rwsem.
> drivers/base/power/shutdown.c takes devices_subsys.rwsem.
> drivers/usb/core/devices.c and devio.c take usb_bus_type.subsys.rwsem.
>
> Do class->subsys.rwsem, bus->subsys.rwsem, and bus_type.subsys.rwsem
> point to identical or different lock instances?
>
> Either way, could it hurt to convert nodemgr to uniformly use
> ieee1394_bus_type.subsys.rwsem all over the place?
>
> Thanks,
--
Stefan Richter
-=====-=-==- =--= --==-
http://arcgraph.de/sr/
next prev parent reply other threads:[~2006-09-06 16:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-05 17:37 2.6.18-rc5-mm1 + all hotfixes -- INFO: possible recursive locking detected Miles Lane
2006-09-05 18:13 ` Andrew Morton
2006-09-05 18:16 ` Miles Lane
2006-09-05 19:03 ` Stefan Richter
2006-09-05 19:19 ` Miles Lane
2006-09-05 19:51 ` Stefan Richter
2006-09-05 19:23 ` Stefan Richter
2006-09-05 21:07 ` Arjan van de Ven
2006-09-05 22:27 ` Stefan Richter
2006-09-06 0:10 ` Adrian Bunk
2006-09-06 7:13 ` Stefan Richter
2006-09-06 16:50 ` Stefan Richter [this message]
2006-09-06 17:04 ` [RFT PATCH 1/2] ieee1394: nodemgr: fix rwsem recursion Stefan Richter
2006-09-06 17:06 ` [RFT PATCH 2/2] ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_ne Stefan Richter
2006-09-07 22:45 ` 2.6.18-rc5-mm1 + all hotfixes -- INFO: possible recursive locking detected Miles Lane
2006-09-07 23:23 ` Stefan Richter
2006-09-06 22:35 ` Greg KH
2006-09-05 19:49 ` Miles Lane
2006-09-05 20:19 ` Stefan Richter
2006-09-05 20:26 ` Stefan Richter
2006-09-05 20:33 ` Andrew Morton
2006-09-06 6:39 ` Arjan van de Ven
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=44FEFC68.90201@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=akpm@osdl.org \
--cc=bcollins@ubuntu.com \
--cc=gregkh@suse.de \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=miles.lane@gmail.com \
/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