aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mvsas/mv_64xx.c
diff options
context:
space:
mode:
authorSrinivas <satyasrinivasp@hcl.in>2010-02-15 01:00:00 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 15:44:01 -0400
commit9dc9fd9484c5168d23fe855e6c56543d96b6695b (patch)
tree514bbe305138f21af247441f535e20430c3829b6 /drivers/scsi/mvsas/mv_64xx.c
parentc8032216c9607ee8c62a39484711750c1445c6a4 (diff)
[SCSI] mvsas: fix hot plug handling and IO issues
This patch adds a bunch of fixes 1. Reduce sg table size to 64 (SG_MX) instead of default SG_ALL 2. clear task lists on phy down events 3. release all tasks on port deformation 4. release current task for device gone notification 5. Add sata abort handing 6. Add 10ms delay to each port reset (currently done serially and with interrupts disabled) [jejb: whitespace fixes and clean ups plus added description added dummy 94xx_clear_srs_irq function just to prevent the mismatch in the mvs_dispatch structure killing 94xx cards] Signed-off-by: Srinivas <satyasrinivasp@hcl.in> Cc: Andy Yan <ayan@marvell.com> Cc: qswang@marvell.com Cc: jfeng@marvell.com Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mvsas/mv_64xx.c')
-rw-r--r--drivers/scsi/mvsas/mv_64xx.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/scsi/mvsas/mv_64xx.c b/drivers/scsi/mvsas/mv_64xx.c
index 10a5077b6aed..afc7f6f3a13e 100644
--- a/drivers/scsi/mvsas/mv_64xx.c
+++ b/drivers/scsi/mvsas/mv_64xx.c
@@ -132,9 +132,9 @@ static void mvs_64xx_phy_reset(struct mvs_info *mvi, u32 phy_id, int hard)
132 tmp &= ~PHYEV_RDY_CH; 132 tmp &= ~PHYEV_RDY_CH;
133 mvs_write_port_irq_stat(mvi, phy_id, tmp); 133 mvs_write_port_irq_stat(mvi, phy_id, tmp);
134 tmp = mvs_read_phy_ctl(mvi, phy_id); 134 tmp = mvs_read_phy_ctl(mvi, phy_id);
135 if (hard) 135 if (hard == 1)
136 tmp |= PHY_RST_HARD; 136 tmp |= PHY_RST_HARD;
137 else 137 else if (hard == 0)
138 tmp |= PHY_RST; 138 tmp |= PHY_RST;
139 mvs_write_phy_ctl(mvi, phy_id, tmp); 139 mvs_write_phy_ctl(mvi, phy_id, tmp);
140 if (hard) { 140 if (hard) {
@@ -144,6 +144,26 @@ static void mvs_64xx_phy_reset(struct mvs_info *mvi, u32 phy_id, int hard)
144 } 144 }
145} 145}
146 146
147void mvs_64xx_clear_srs_irq(struct mvs_info *mvi, u8 reg_set, u8 clear_all)
148{
149 void __iomem *regs = mvi->regs;
150 u32 tmp;
151 if (clear_all) {
152 tmp = mr32(MVS_INT_STAT_SRS_0);
153 if (tmp) {
154 printk(KERN_DEBUG "check SRS 0 %08X.\n", tmp);
155 mw32(MVS_INT_STAT_SRS_0, tmp);
156 }
157 } else {
158 tmp = mr32(MVS_INT_STAT_SRS_0);
159 if (tmp & (1 << (reg_set % 32))) {
160 printk(KERN_DEBUG "register set 0x%x was stopped.\n",
161 reg_set);
162 mw32(MVS_INT_STAT_SRS_0, 1 << (reg_set % 32));
163 }
164 }
165}
166
147static int __devinit mvs_64xx_chip_reset(struct mvs_info *mvi) 167static int __devinit mvs_64xx_chip_reset(struct mvs_info *mvi)
148{ 168{
149 void __iomem *regs = mvi->regs; 169 void __iomem *regs = mvi->regs;
@@ -761,6 +781,7 @@ const struct mvs_dispatch mvs_64xx_dispatch = {
761 mvs_write_port_irq_mask, 781 mvs_write_port_irq_mask,
762 mvs_get_sas_addr, 782 mvs_get_sas_addr,
763 mvs_64xx_command_active, 783 mvs_64xx_command_active,
784 mvs_64xx_clear_srs_irq,
764 mvs_64xx_issue_stop, 785 mvs_64xx_issue_stop,
765 mvs_start_delivery, 786 mvs_start_delivery,
766 mvs_rx_update, 787 mvs_rx_update,