[PATCH 15/15] sata_sil24: add hotplug support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add hotplug support by enabling PORT_IRQ_PHYRDY_CHG and scheduling
probe when either of PORT_IRQ_PHYRDY_CHG or PORT_IRQ_DEV_XCHG happens.
Explicit ata_schedule_probe() is necessary because sil24's SError
doesn't always reflect DEV_XCHG or PHYRDY_CHG conditions properly.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>

---

 drivers/scsi/sata_sil24.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

dc756727b3be5cf5bff4a327bc13604235419fc6
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 1ca76f7..06c0ab0 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -156,7 +156,8 @@ enum {
 	PORT_IRQ_HANDSHAKE	= (1 << 10), /* handshake error threshold */
 	PORT_IRQ_SDB_NOTIFY	= (1 << 11), /* SDB notify received */
 
-	PORT_IRQ_FREEZE		= PORT_IRQ_DEV_XCHG | PORT_IRQ_UNK_FIS,
+	PORT_IRQ_FREEZE		= PORT_IRQ_PHYRDY_CHG | PORT_IRQ_DEV_XCHG |
+				  PORT_IRQ_UNK_FIS,
 	DEF_PORT_IRQ		= PORT_IRQ_FREEZE |
 				  PORT_IRQ_COMPLETE | PORT_IRQ_ERROR,
 
@@ -770,15 +771,20 @@ static unsigned int sil24_eh_autopsy(str
 	desc += rc;
 	desc_sz -= rc;
 
-	if (irq_stat & PORT_IRQ_DEV_XCHG) {
+	if (irq_stat & (PORT_IRQ_PHYRDY_CHG | PORT_IRQ_DEV_XCHG)) {
 		err_mask |= AC_ERR_ATA_BUS;
 		/* sil24 doesn't recover very well from phy
 		 * disconnection with a softreset.  Force hardreset.
 		 */
 		action |= ATA_PORT_HARDRESET;
-		rc = scnprintf(desc, desc_sz, ", device exchanged");
+		rc = scnprintf(desc, desc_sz, ", %s",
+			       irq_stat & PORT_IRQ_PHYRDY_CHG ?
+			       "PHY RDY changed" : "device exchanged");
 		desc += rc;
 		desc_sz -= rc;
+
+		/* request probing */
+		ata_schedule_probe(ap);
 	}
 
 	if (irq_stat & PORT_IRQ_UNK_FIS) {
-- 
1.2.4


-
: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux