Skip to contentSkip to conversation

libata-scsi: don't start hotplug work queue if hotplug is disabled

PATCH Applied [email protected] 2 participants 2 messages Jul 30, 2008 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libata-scsi: don't start hotplug work queue if hotplug is disabled

From: Chunbo Luo <[email protected]>

Previously, queue_delayed_work() was started unconditionally, but if ATA_PFLAG_SCSI_HOTPLUG is not set and we do this, the work queue may cause multiple messages like this:

ata3.00: WARNING: ATAPI is not supported with this driver, device ignored.

So now,it is only started when the hotplug flag is actually set.

---

 drivers/ata/libata-scsi.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/ata/libata-scsi.c renamed from drivers/ata/libata-scsi.c~libata-scsi-dont-start-hotplug-work-queue-if-hotplug-is-disabled +3 -2
diff -puN drivers/ata/libata-scsi.c~libata-scsi-dont-start-hotplug-work-queue-if-hotplug-is-disabled drivers/ata/libata-scsi.c
@@ -3206,8 +3206,9 @@ void ata_scsi_scan_host(struct ata_port 
 				"                  switching to async\n");
 	}
 
-	queue_delayed_work(ata_aux_wq, &ap->hotplug_task,
-			   round_jiffies_relative(HZ));
+	if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
+		queue_delayed_work(ata_aux_wq, &ap->hotplug_task,
+				round_jiffies_relative(HZ));
 }
 
 /**

_

#1 lore raw
Quoted 6 lines · [email protected] wrote:

From: Chunbo Luo <[email protected]>

Previously, queue_delayed_work() was started unconditionally, but if ATA_PFLAG_SCSI_HOTPLUG is not set and we do this, the work queue may cause multiple messages like this:

Quoted 8 lines

ata3.00: WARNING: ATAPI is not supported with this driver, device ignored.

So now,it is only started when the hotplug flag is actually set.

Oops, I forgot to send the alternative patch (verified by Chunbo). I'm sending it to Jeff now and cc'ing you. Please drop this one when the patch hits -mm.

Thanks.

Signature · 1 line
tejun