All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH] media change events - do not emit change event at device add
Date: Wed, 19 Mar 2008 13:09:56 +0100	[thread overview]
Message-ID: <1205928596.8810.22.camel@lov.site> (raw)

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;



                 reply	other threads:[~2008-03-19 21:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1205928596.8810.22.camel@lov.site \
    --to=kay.sievers@vrfy.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@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 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.