From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/7] ide: __ide_port_unregister_devices() doesn't need an ide_lock held
Date: Wed, 08 Oct 2008 22:29:53 +0200 [thread overview]
Message-ID: <20081008202953.19112.36835.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20081008202930.19112.90371.sendpatchset@localhost.localdomain>
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: __ide_port_unregister_devices() doesn't need an ide_lock held
[ and ide_cfg_mtx mutex provides a sufficient protection for callers ]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide.c | 7 -------
1 file changed, 7 deletions(-)
Index: b/drivers/ide/ide.c
===================================================================
--- a/drivers/ide/ide.c 2008-09-17 22:17:58.000000000 -0700
+++ b/drivers/ide/ide.c 2008-09-17 22:20:15.000000000 -0700
@@ -130,7 +130,6 @@
}
}
-/* Called with ide_lock held. */
static void __ide_port_unregister_devices(ide_hwif_t *hwif)
{
int i;
@@ -139,10 +138,8 @@
ide_drive_t *drive = &hwif->drives[i];
if (drive->dev_flags & IDE_DFLAG_PRESENT) {
- spin_unlock_irq(&ide_lock);
device_unregister(&drive->gendev);
wait_for_completion(&drive->gendev_rel_comp);
- spin_lock_irq(&ide_lock);
}
}
}
@@ -150,11 +147,9 @@
void ide_port_unregister_devices(ide_hwif_t *hwif)
{
mutex_lock(&ide_cfg_mtx);
- spin_lock_irq(&ide_lock);
__ide_port_unregister_devices(hwif);
hwif->present = 0;
ide_port_init_devices_data(hwif);
- spin_unlock_irq(&ide_lock);
mutex_unlock(&ide_cfg_mtx);
}
EXPORT_SYMBOL_GPL(ide_port_unregister_devices);
@@ -192,12 +187,10 @@
mutex_lock(&ide_cfg_mtx);
- spin_lock_irq(&ide_lock);
if (hwif->present) {
__ide_port_unregister_devices(hwif);
hwif->present = 0;
}
- spin_unlock_irq(&ide_lock);
ide_proc_unregister_port(hwif);
next prev parent reply other threads:[~2008-10-08 20:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 20:29 [PATCH 0/7] ide: locking improvements Bartlomiej Zolnierkiewicz
2008-10-08 20:29 ` [PATCH 1/7] ide: unify ide_intr()'s exit points Bartlomiej Zolnierkiewicz
2008-10-08 20:29 ` [PATCH 2/7] ide: IDE settings don't need an ide_lock held Bartlomiej Zolnierkiewicz
2008-10-08 20:29 ` Bartlomiej Zolnierkiewicz [this message]
2008-10-08 20:30 ` [PATCH 4/7] ide: ide_hwgroup_t.rq doesn't " Bartlomiej Zolnierkiewicz
2008-10-10 8:34 ` Elias Oltmanns
2008-10-10 9:01 ` Jens Axboe
2008-10-10 9:37 ` Elias Oltmanns
2008-10-10 10:17 ` Jens Axboe
2008-10-10 16:20 ` Bartlomiej Zolnierkiewicz
2008-10-08 20:30 ` [PATCH 5/7] ide: push ide_lock to __ide_end_request() Bartlomiej Zolnierkiewicz
2008-10-08 20:30 ` [PATCH 6/7] ide: ide_lock + __blk_end_request() -> blk_end_request() Bartlomiej Zolnierkiewicz
2008-10-08 20:30 ` [PATCH 7/7] ide: use queue lock instead of ide_lock when possible Bartlomiej Zolnierkiewicz
2008-10-10 8:43 ` Elias Oltmanns
2008-10-10 8:52 ` Jens Axboe
2008-10-10 11:35 ` Jens Axboe
2008-10-09 6:51 ` [PATCH 0/7] ide: locking improvements Jens Axboe
2008-10-09 8:36 ` Bartlomiej Zolnierkiewicz
2008-10-09 8:40 ` Jens Axboe
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=20081008202953.19112.36835.sendpatchset@localhost.localdomain \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).