diff options
Diffstat (limited to 'drivers/ata/sata_fsl.c')
-rw-r--r-- | drivers/ata/sata_fsl.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 172b57e6543f..a69192b38b43 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/slab.h> | ||
21 | 22 | ||
22 | #include <scsi/scsi_host.h> | 23 | #include <scsi/scsi_host.h> |
23 | #include <scsi/scsi_cmnd.h> | 24 | #include <scsi/scsi_cmnd.h> |
@@ -34,7 +35,7 @@ enum { | |||
34 | 35 | ||
35 | SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 36 | SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
36 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | 37 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | |
37 | ATA_FLAG_PMP | ATA_FLAG_NCQ), | 38 | ATA_FLAG_PMP | ATA_FLAG_NCQ | ATA_FLAG_AN), |
38 | 39 | ||
39 | SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH, | 40 | SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH, |
40 | SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */ | 41 | SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */ |
@@ -43,9 +44,9 @@ enum { | |||
43 | /* | 44 | /* |
44 | * SATA-FSL host controller supports a max. of (15+1) direct PRDEs, and | 45 | * SATA-FSL host controller supports a max. of (15+1) direct PRDEs, and |
45 | * chained indirect PRDEs upto a max count of 63. | 46 | * chained indirect PRDEs upto a max count of 63. |
46 | * We are allocating an array of 63 PRDEs contigiously, but PRDE#15 will | 47 | * We are allocating an array of 63 PRDEs contiguously, but PRDE#15 will |
47 | * be setup as an indirect descriptor, pointing to it's next | 48 | * be setup as an indirect descriptor, pointing to it's next |
48 | * (contigious) PRDE. Though chained indirect PRDE arrays are | 49 | * (contiguous) PRDE. Though chained indirect PRDE arrays are |
49 | * supported,it will be more efficient to use a direct PRDT and | 50 | * supported,it will be more efficient to use a direct PRDT and |
50 | * a single chain/link to indirect PRDE array/PRDT. | 51 | * a single chain/link to indirect PRDE array/PRDT. |
51 | */ | 52 | */ |
@@ -132,7 +133,7 @@ enum { | |||
132 | INT_ON_SINGL_DEVICE_ERR = (1 << 1), | 133 | INT_ON_SINGL_DEVICE_ERR = (1 << 1), |
133 | INT_ON_CMD_COMPLETE = 1, | 134 | INT_ON_CMD_COMPLETE = 1, |
134 | 135 | ||
135 | INT_ON_ERROR = INT_ON_FATAL_ERR | | 136 | INT_ON_ERROR = INT_ON_FATAL_ERR | INT_ON_SNOTIFY_UPDATE | |
136 | INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR, | 137 | INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR, |
137 | 138 | ||
138 | /* | 139 | /* |
@@ -153,7 +154,7 @@ enum { | |||
153 | IE_ON_CMD_COMPLETE = 1, | 154 | IE_ON_CMD_COMPLETE = 1, |
154 | 155 | ||
155 | DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG | | 156 | DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG | |
156 | IE_ON_SIGNATURE_UPDATE | | 157 | IE_ON_SIGNATURE_UPDATE | IE_ON_SNOTIFY_UPDATE | |
157 | IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, | 158 | IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, |
158 | 159 | ||
159 | EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), | 160 | EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), |
@@ -314,7 +315,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc, | |||
314 | u32 ttl_dwords = 0; | 315 | u32 ttl_dwords = 0; |
315 | 316 | ||
316 | /* | 317 | /* |
317 | * NOTE : direct & indirect prdt's are contigiously allocated | 318 | * NOTE : direct & indirect prdt's are contiguously allocated |
318 | */ | 319 | */ |
319 | struct prde *prd = (struct prde *)&((struct command_desc *) | 320 | struct prde *prd = (struct prde *)&((struct command_desc *) |
320 | cmd_desc)->prdt; | 321 | cmd_desc)->prdt; |
@@ -992,9 +993,8 @@ static void sata_fsl_error_intr(struct ata_port *ap) | |||
992 | */ | 993 | */ |
993 | 994 | ||
994 | sata_fsl_scr_read(&ap->link, SCR_ERROR, &SError); | 995 | sata_fsl_scr_read(&ap->link, SCR_ERROR, &SError); |
995 | if (unlikely(SError & 0xFFFF0000)) { | 996 | if (unlikely(SError & 0xFFFF0000)) |
996 | sata_fsl_scr_write(&ap->link, SCR_ERROR, SError); | 997 | sata_fsl_scr_write(&ap->link, SCR_ERROR, SError); |
997 | } | ||
998 | 998 | ||
999 | DPRINTK("error_intr,hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n", | 999 | DPRINTK("error_intr,hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n", |
1000 | hstatus, cereg, ioread32(hcr_base + DE), SError); | 1000 | hstatus, cereg, ioread32(hcr_base + DE), SError); |
@@ -1007,6 +1007,10 @@ static void sata_fsl_error_intr(struct ata_port *ap) | |||
1007 | freeze = 1; | 1007 | freeze = 1; |
1008 | } | 1008 | } |
1009 | 1009 | ||
1010 | /* Handle SDB FIS receive & notify update */ | ||
1011 | if (hstatus & INT_ON_SNOTIFY_UPDATE) | ||
1012 | sata_async_notification(ap); | ||
1013 | |||
1010 | /* Handle PHYRDY change notification */ | 1014 | /* Handle PHYRDY change notification */ |
1011 | if (hstatus & INT_ON_PHYRDY_CHG) { | 1015 | if (hstatus & INT_ON_PHYRDY_CHG) { |
1012 | DPRINTK("SATA FSL: PHYRDY change indication\n"); | 1016 | DPRINTK("SATA FSL: PHYRDY change indication\n"); |
@@ -1070,9 +1074,9 @@ static void sata_fsl_error_intr(struct ata_port *ap) | |||
1070 | } | 1074 | } |
1071 | 1075 | ||
1072 | /* record error info */ | 1076 | /* record error info */ |
1073 | if (qc) { | 1077 | if (qc) |
1074 | qc->err_mask |= err_mask; | 1078 | qc->err_mask |= err_mask; |
1075 | } else | 1079 | else |
1076 | ehi->err_mask |= err_mask; | 1080 | ehi->err_mask |= err_mask; |
1077 | 1081 | ||
1078 | ehi->action |= action; | 1082 | ehi->action |= action; |
@@ -1103,7 +1107,6 @@ static void sata_fsl_host_intr(struct ata_port *ap) | |||
1103 | if (unlikely(SError & 0xFFFF0000)) { | 1107 | if (unlikely(SError & 0xFFFF0000)) { |
1104 | DPRINTK("serror @host_intr : 0x%x\n", SError); | 1108 | DPRINTK("serror @host_intr : 0x%x\n", SError); |
1105 | sata_fsl_error_intr(ap); | 1109 | sata_fsl_error_intr(ap); |
1106 | |||
1107 | } | 1110 | } |
1108 | 1111 | ||
1109 | if (unlikely(hstatus & INT_ON_ERROR)) { | 1112 | if (unlikely(hstatus & INT_ON_ERROR)) { |