projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull altix-ce1.0-asic into release branch
[linux-2.6-microblaze.git]
/
drivers
/
scsi
/
sata_qstor.c
diff --git
a/drivers/scsi/sata_qstor.c
b/drivers/scsi/sata_qstor.c
index
b2f6324
..
80480f0
100644
(file)
--- a/
drivers/scsi/sata_qstor.c
+++ b/
drivers/scsi/sata_qstor.c
@@
-41,7
+41,7
@@
#include <linux/libata.h>
#define DRV_NAME "sata_qstor"
#include <linux/libata.h>
#define DRV_NAME "sata_qstor"
-#define DRV_VERSION "0.0
4
"
+#define DRV_VERSION "0.0
5
"
enum {
QS_PORTS = 4,
enum {
QS_PORTS = 4,
@@
-170,7
+170,7
@@
static const struct ata_port_operations qs_ata_ops = {
.bmdma_status = qs_bmdma_status,
};
.bmdma_status = qs_bmdma_status,
};
-static struct ata_port_info qs_port_info[] = {
+static
const
struct ata_port_info qs_port_info[] = {
/* board_2068_idx */
{
.sht = &qs_ata_sht,
/* board_2068_idx */
{
.sht = &qs_ata_sht,
@@
-268,7
+268,7
@@
static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
writel(val, (void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8)));
}
writel(val, (void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8)));
}
-static
void
qs_fill_sg(struct ata_queued_cmd *qc)
+static
unsigned int
qs_fill_sg(struct ata_queued_cmd *qc)
{
struct scatterlist *sg;
struct ata_port *ap = qc->ap;
{
struct scatterlist *sg;
struct ata_port *ap = qc->ap;
@@
-277,7
+277,7
@@
static void qs_fill_sg(struct ata_queued_cmd *qc)
u8 *prd = pp->pkt + QS_CPB_BYTES;
assert(qc->__sg != NULL);
u8 *prd = pp->pkt + QS_CPB_BYTES;
assert(qc->__sg != NULL);
- assert(qc->n_elem > 0);
+ assert(qc->n_elem > 0
|| qc->pad_len > 0
);
nelem = 0;
ata_for_each_sg(sg, qc) {
nelem = 0;
ata_for_each_sg(sg, qc) {
@@
-296,6
+296,8
@@
static void qs_fill_sg(struct ata_queued_cmd *qc)
(unsigned long long)addr, len);
nelem++;
}
(unsigned long long)addr, len);
nelem++;
}
+
+ return nelem;
}
static void qs_qc_prep(struct ata_queued_cmd *qc)
}
static void qs_qc_prep(struct ata_queued_cmd *qc)
@@
-304,6
+306,7
@@
static void qs_qc_prep(struct ata_queued_cmd *qc)
u8 dflags = QS_DF_PORD, *buf = pp->pkt;
u8 hflags = QS_HF_DAT | QS_HF_IEN | QS_HF_VLD;
u64 addr;
u8 dflags = QS_DF_PORD, *buf = pp->pkt;
u8 hflags = QS_HF_DAT | QS_HF_IEN | QS_HF_VLD;
u64 addr;
+ unsigned int nelem;
VPRINTK("ENTER\n");
VPRINTK("ENTER\n");
@@
-313,7
+316,7
@@
static void qs_qc_prep(struct ata_queued_cmd *qc)
return;
}
return;
}
- qs_fill_sg(qc);
+
nelem =
qs_fill_sg(qc);
if ((qc->tf.flags & ATA_TFLAG_WRITE))
hflags |= QS_HF_DIRO;
if ((qc->tf.flags & ATA_TFLAG_WRITE))
hflags |= QS_HF_DIRO;
@@
-324,7
+327,7
@@
static void qs_qc_prep(struct ata_queued_cmd *qc)
buf[ 0] = QS_HCB_HDR;
buf[ 1] = hflags;
*(__le32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE);
buf[ 0] = QS_HCB_HDR;
buf[ 1] = hflags;
*(__le32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE);
- *(__le32 *)(&buf[ 8]) = cpu_to_le32(
qc->n_
elem);
+ *(__le32 *)(&buf[ 8]) = cpu_to_le32(
n
elem);
addr = ((u64)pp->pkt_dma) + QS_CPB_BYTES;
*(__le64 *)(&buf[16]) = cpu_to_le64(addr);
addr = ((u64)pp->pkt_dma) + QS_CPB_BYTES;
*(__le64 *)(&buf[16]) = cpu_to_le64(addr);
@@
-406,8
+409,8
@@
static inline unsigned int qs_intr_pkt(struct ata_host_set *host_set)
case 3: /* device error */
pp->state = qs_state_idle;
qs_enter_reg_mode(qc->ap);
case 3: /* device error */
pp->state = qs_state_idle;
qs_enter_reg_mode(qc->ap);
- ata_qc_complete(qc,
-
ac_err_mask(sDST)
);
+ qc->err_mask |= ac_err_mask(sDST);
+
ata_qc_complete(qc
);
break;
default:
break;
break;
default:
break;
@@
-444,7
+447,8
@@
static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set)
/* complete taskfile transaction */
pp->state = qs_state_idle;
/* complete taskfile transaction */
pp->state = qs_state_idle;
- ata_qc_complete(qc, ac_err_mask(status));
+ qc->err_mask |= ac_err_mask(status);
+ ata_qc_complete(qc);
handled = 1;
}
}
handled = 1;
}
}