Skip to contentSkip to conversation

mvsas: fixed some disk spin up issue

PATCH New [email protected] 1 participant 1 message Sep 28, 2011 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 3/8 mvsas: fixed some disk spin up issue

From: Xiangliang Yu <[email protected]>

-- spin up issue: some direct attached SAS device can't spin up

---
 drivers/scsi/mvsas/mv_94xx.c |    4 ++++
 drivers/scsi/mvsas/mv_sas.c  |   12 ++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
drivers/scsi/mvsas/mv_94xx.c +4 -0
index 3501291..8f32c7c 100644
@@ -823,6 +823,10 @@ static void mvs_94xx_fix_phy_info(struct mvs_info *mvi, int i,
 		phy->att_dev_info = PORT_DEV_STP_TRGT | 1;
 	}
 
+	/* enable spin up bit */
+	mvs_write_port_cfg_addr(mvi, i, PHYR_PHY_STAT);
+	mvs_write_port_cfg_data(mvi, i, 0x04);
+
 }
 
 void mvs_94xx_phy_set_link_rate(struct mvs_info *mvi, u32 phy_id,
drivers/scsi/mvsas/mv_sas.c +12 -0
index 86847c6..15e9a31 100644
@@ -265,6 +265,12 @@ static void mvs_bytes_dmaed(struct mvs_info *mvi, int i)
 		id->dev_type = phy->identify.device_type;
 		id->initiator_bits = SAS_PROTOCOL_ALL;
 		id->target_bits = phy->identify.target_port_protocols;
+
+		/* direct attached SAS device */
+		if(phy->att_dev_info & PORT_SSP_TRGT_MASK) {
+			MVS_CHIP_DISP->write_port_cfg_addr(mvi, i, PHYR_PHY_STAT);
+			MVS_CHIP_DISP->write_port_cfg_data(mvi, i, 0x00);
+		}
 	} else if (phy->phy_type & PORT_TYPE_SATA) {
 		/*Nothing*/
 	}
@@ -1241,6 +1247,12 @@ static void mvs_port_notify_formed(struct asd_sas_phy *sas_phy, int lock)
 		port->wide_port_phymap = sas_port->phy_mask;
 		mv_printk("set wide port phy map %x\n", sas_port->phy_mask);
 		mvs_update_wideport(mvi, sas_phy->id);
+
+		/* direct attached SAS device */
+		if(phy->att_dev_info & PORT_SSP_TRGT_MASK) {
+			MVS_CHIP_DISP->write_port_cfg_addr(mvi, i, PHYR_PHY_STAT);
+			MVS_CHIP_DISP->write_port_cfg_data(mvi, i, 0x04);
+		}
 	}
 	if (lock)
 		spin_unlock_irqrestore(&mvi->lock, flags);
Signature · 1 line
1.7.4.4