* [PATCH] media change events - do not emit change event at device add
@ 2008-03-19 12:09 Kay Sievers
0 siblings, 0 replies; only message in thread
From: Kay Sievers @ 2008-03-19 12:09 UTC (permalink / raw)
To: James Bottomley; +Cc: scsi
Hi James,
we like to see this in 2.6.25. There is no need to send out "change"
events immediately after we added a new device. Presetting the state flag
prevents this.
Thanks,
Kay
From: Kay Sievers <kay.sievers@vrfy.org>
Subject: [SCSI] media change events - do not emit change event at device add
Initialize the "state changed" flag, so we do not send a change event
immediately after registering a new device.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 7aee64d..5fe7aae 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1654,6 +1654,7 @@ static int sd_probe(struct device *dev)
sdkp->disk = gd;
sdkp->index = index;
sdkp->openers = 0;
+ sdkp->previous_state = 1;
if (!sdp->timeout) {
if (sdp->type != TYPE_MOD)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 208565b..7ee86d4 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -623,6 +623,7 @@ static int sr_probe(struct device *dev)
cd->disk = disk;
cd->capacity = 0x1fffff;
cd->device->changed = 1; /* force recheck CD type */
+ cd->previous_state = 1;
cd->use = 1;
cd->readcd_known = 0;
cd->readcd_cdda = 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-19 21:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-19 12:09 [PATCH] media change events - do not emit change event at device add Kay Sievers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox