aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ata_piix.c36
-rw-r--r--drivers/scsi/ibmvscsi/rpa_vscsi.c11
-rw-r--r--drivers/scsi/iscsi_tcp.c67
-rw-r--r--drivers/scsi/iscsi_tcp.h6
-rw-r--r--drivers/scsi/libata-core.c13
-rw-r--r--drivers/scsi/mac53c94.c2
-rw-r--r--drivers/scsi/mesh.c5
-rw-r--r--drivers/scsi/sata_mv.c3
-rw-r--r--drivers/scsi/sata_svw.c2
-rw-r--r--drivers/scsi/sata_via.c1
-rw-r--r--drivers/scsi/scsi_error.c2
11 files changed, 96 insertions, 52 deletions
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 2d20caf377f..a9bb3cb7e89 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -123,7 +123,8 @@ enum {
123 ich6_sata = 4, 123 ich6_sata = 4,
124 ich6_sata_ahci = 5, 124 ich6_sata_ahci = 5,
125 ich6m_sata_ahci = 6, 125 ich6m_sata_ahci = 6,
126 ich8_sata_ahci = 7, 126 ich7m_sata_ahci = 7,
127 ich8_sata_ahci = 8,
127 128
128 /* constants for mapping table */ 129 /* constants for mapping table */
129 P0 = 0, /* port 0 */ 130 P0 = 0, /* port 0 */
@@ -188,7 +189,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
188 /* 82801GB/GR/GH (ICH7, identical to ICH6) */ 189 /* 82801GB/GR/GH (ICH7, identical to ICH6) */
189 { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 190 { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
190 /* 2801GBM/GHM (ICH7M, identical to ICH6M) */ 191 /* 2801GBM/GHM (ICH7M, identical to ICH6M) */
191 { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci }, 192 { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7m_sata_ahci },
192 /* Enterprise Southbridge 2 (where's the datasheet?) */ 193 /* Enterprise Southbridge 2 (where's the datasheet?) */
193 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 194 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
194 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */ 195 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */
@@ -336,6 +337,24 @@ static const struct piix_map_db ich6m_map_db = {
336 }, 337 },
337}; 338};
338 339
340static const struct piix_map_db ich7m_map_db = {
341 .mask = 0x3,
342 .port_enable = 0x5,
343 .present_shift = 4,
344
345 /* Map 01b isn't specified in the doc but some notebooks use
346 * it anyway. ATM, the only case spotted carries subsystem ID
347 * 1025:0107. This is the only difference from ich6m.
348 */
349 .map = {
350 /* PM PS SM SS MAP */
351 { P0, P2, RV, RV }, /* 00b */
352 { IDE, IDE, P1, P3 }, /* 01b */
353 { P0, P2, IDE, IDE }, /* 10b */
354 { RV, RV, RV, RV },
355 },
356};
357
339static const struct piix_map_db ich8_map_db = { 358static const struct piix_map_db ich8_map_db = {
340 .mask = 0x3, 359 .mask = 0x3,
341 .port_enable = 0x3, 360 .port_enable = 0x3,
@@ -355,6 +374,7 @@ static const struct piix_map_db *piix_map_db_table[] = {
355 [ich6_sata] = &ich6_map_db, 374 [ich6_sata] = &ich6_map_db,
356 [ich6_sata_ahci] = &ich6_map_db, 375 [ich6_sata_ahci] = &ich6_map_db,
357 [ich6m_sata_ahci] = &ich6m_map_db, 376 [ich6m_sata_ahci] = &ich6m_map_db,
377 [ich7m_sata_ahci] = &ich7m_map_db,
358 [ich8_sata_ahci] = &ich8_map_db, 378 [ich8_sata_ahci] = &ich8_map_db,
359}; 379};
360 380
@@ -444,6 +464,18 @@ static struct ata_port_info piix_port_info[] = {
444 .port_ops = &piix_sata_ops, 464 .port_ops = &piix_sata_ops,
445 }, 465 },
446 466
467 /* ich7m_sata_ahci */
468 {
469 .sht = &piix_sht,
470 .host_flags = ATA_FLAG_SATA |
471 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR |
472 PIIX_FLAG_AHCI,
473 .pio_mask = 0x1f, /* pio0-4 */
474 .mwdma_mask = 0x07, /* mwdma0-2 */
475 .udma_mask = 0x7f, /* udma0-6 */
476 .port_ops = &piix_sata_ops,
477 },
478
447 /* ich8_sata_ahci */ 479 /* ich8_sata_ahci */
448 { 480 {
449 .sht = &piix_sht, 481 .sht = &piix_sht,
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c
index ed22b96580c..01b8ac641eb 100644
--- a/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -156,8 +156,8 @@ static void gather_partition_info(void)
156{ 156{
157 struct device_node *rootdn; 157 struct device_node *rootdn;
158 158
159 char *ppartition_name; 159 const char *ppartition_name;
160 unsigned int *p_number_ptr; 160 const unsigned int *p_number_ptr;
161 161
162 /* Retrieve information about this partition */ 162 /* Retrieve information about this partition */
163 rootdn = find_path_device("/"); 163 rootdn = find_path_device("/");
@@ -165,14 +165,11 @@ static void gather_partition_info(void)
165 return; 165 return;
166 } 166 }
167 167
168 ppartition_name = 168 ppartition_name = get_property(rootdn, "ibm,partition-name", NULL);
169 get_property(rootdn, "ibm,partition-name", NULL);
170 if (ppartition_name) 169 if (ppartition_name)
171 strncpy(partition_name, ppartition_name, 170 strncpy(partition_name, ppartition_name,
172 sizeof(partition_name)); 171 sizeof(partition_name));
173 p_number_ptr = 172 p_number_ptr = get_property(rootdn, "ibm,partition-no", NULL);
174 (unsigned int *)get_property(rootdn, "ibm,partition-no",
175 NULL);
176 if (p_number_ptr) 173 if (p_number_ptr)
177 partition_number = *p_number_ptr; 174 partition_number = *p_number_ptr;
178} 175}
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index d91e8949c71..0a9dbc59663 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -108,7 +108,7 @@ iscsi_hdr_digest(struct iscsi_conn *conn, struct iscsi_buf *buf,
108{ 108{
109 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; 109 struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
110 110
111 crypto_digest_digest(tcp_conn->tx_tfm, &buf->sg, 1, crc); 111 crypto_hash_digest(&tcp_conn->tx_hash, &buf->sg, buf->sg.length, crc);
112 buf->sg.length = tcp_conn->hdr_size; 112 buf->sg.length = tcp_conn->hdr_size;
113} 113}
114 114
@@ -468,7 +468,8 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn)
468 468
469 sg_init_one(&sg, (u8 *)hdr, 469 sg_init_one(&sg, (u8 *)hdr,
470 sizeof(struct iscsi_hdr) + ahslen); 470 sizeof(struct iscsi_hdr) + ahslen);
471 crypto_digest_digest(tcp_conn->rx_tfm, &sg, 1, (u8 *)&cdgst); 471 crypto_hash_digest(&tcp_conn->rx_hash, &sg, sg.length,
472 (u8 *)&cdgst);
472 rdgst = *(uint32_t*)((char*)hdr + sizeof(struct iscsi_hdr) + 473 rdgst = *(uint32_t*)((char*)hdr + sizeof(struct iscsi_hdr) +
473 ahslen); 474 ahslen);
474 if (cdgst != rdgst) { 475 if (cdgst != rdgst) {
@@ -675,7 +676,7 @@ iscsi_tcp_copy(struct iscsi_conn *conn, int buf_size)
675} 676}
676 677
677static inline void 678static inline void
678partial_sg_digest_update(struct crypto_tfm *tfm, struct scatterlist *sg, 679partial_sg_digest_update(struct hash_desc *desc, struct scatterlist *sg,
679 int offset, int length) 680 int offset, int length)
680{ 681{
681 struct scatterlist temp; 682 struct scatterlist temp;
@@ -683,7 +684,7 @@ partial_sg_digest_update(struct crypto_tfm *tfm, struct scatterlist *sg,
683 memcpy(&temp, sg, sizeof(struct scatterlist)); 684 memcpy(&temp, sg, sizeof(struct scatterlist));
684 temp.offset = offset; 685 temp.offset = offset;
685 temp.length = length; 686 temp.length = length;
686 crypto_digest_update(tfm, &temp, 1); 687 crypto_hash_update(desc, &temp, length);
687} 688}
688 689
689static void 690static void
@@ -692,7 +693,7 @@ iscsi_recv_digest_update(struct iscsi_tcp_conn *tcp_conn, char* buf, int len)
692 struct scatterlist tmp; 693 struct scatterlist tmp;
693 694
694 sg_init_one(&tmp, buf, len); 695 sg_init_one(&tmp, buf, len);
695 crypto_digest_update(tcp_conn->rx_tfm, &tmp, 1); 696 crypto_hash_update(&tcp_conn->rx_hash, &tmp, len);
696} 697}
697 698
698static int iscsi_scsi_data_in(struct iscsi_conn *conn) 699static int iscsi_scsi_data_in(struct iscsi_conn *conn)
@@ -746,12 +747,12 @@ static int iscsi_scsi_data_in(struct iscsi_conn *conn)
746 if (!rc) { 747 if (!rc) {
747 if (conn->datadgst_en) { 748 if (conn->datadgst_en) {
748 if (!offset) 749 if (!offset)
749 crypto_digest_update( 750 crypto_hash_update(
750 tcp_conn->rx_tfm, 751 &tcp_conn->rx_hash,
751 &sg[i], 1); 752 &sg[i], 1);
752 else 753 else
753 partial_sg_digest_update( 754 partial_sg_digest_update(
754 tcp_conn->rx_tfm, 755 &tcp_conn->rx_hash,
755 &sg[i], 756 &sg[i],
756 sg[i].offset + offset, 757 sg[i].offset + offset,
757 sg[i].length - offset); 758 sg[i].length - offset);
@@ -765,9 +766,10 @@ static int iscsi_scsi_data_in(struct iscsi_conn *conn)
765 /* 766 /*
766 * data-in is complete, but buffer not... 767 * data-in is complete, but buffer not...
767 */ 768 */
768 partial_sg_digest_update(tcp_conn->rx_tfm, 769 partial_sg_digest_update(&tcp_conn->rx_hash,
769 &sg[i], 770 &sg[i],
770 sg[i].offset, sg[i].length-rc); 771 sg[i].offset,
772 sg[i].length-rc);
771 rc = 0; 773 rc = 0;
772 break; 774 break;
773 } 775 }
@@ -885,7 +887,7 @@ more:
885 rc = iscsi_tcp_hdr_recv(conn); 887 rc = iscsi_tcp_hdr_recv(conn);
886 if (!rc && tcp_conn->in.datalen) { 888 if (!rc && tcp_conn->in.datalen) {
887 if (conn->datadgst_en) 889 if (conn->datadgst_en)
888 crypto_digest_init(tcp_conn->rx_tfm); 890 crypto_hash_init(&tcp_conn->rx_hash);
889 tcp_conn->in_progress = IN_PROGRESS_DATA_RECV; 891 tcp_conn->in_progress = IN_PROGRESS_DATA_RECV;
890 } else if (rc) { 892 } else if (rc) {
891 iscsi_conn_failure(conn, rc); 893 iscsi_conn_failure(conn, rc);
@@ -942,11 +944,11 @@ more:
942 tcp_conn->in.padding); 944 tcp_conn->in.padding);
943 memset(pad, 0, tcp_conn->in.padding); 945 memset(pad, 0, tcp_conn->in.padding);
944 sg_init_one(&sg, pad, tcp_conn->in.padding); 946 sg_init_one(&sg, pad, tcp_conn->in.padding);
945 crypto_digest_update(tcp_conn->rx_tfm, 947 crypto_hash_update(&tcp_conn->rx_hash,
946 &sg, 1); 948 &sg, sg.length);
947 } 949 }
948 crypto_digest_final(tcp_conn->rx_tfm, 950 crypto_hash_final(&tcp_conn->rx_hash,
949 (u8 *) &tcp_conn->in.datadgst); 951 (u8 *) &tcp_conn->in.datadgst);
950 debug_tcp("rx digest 0x%x\n", tcp_conn->in.datadgst); 952 debug_tcp("rx digest 0x%x\n", tcp_conn->in.datadgst);
951 tcp_conn->in_progress = IN_PROGRESS_DDIGEST_RECV; 953 tcp_conn->in_progress = IN_PROGRESS_DDIGEST_RECV;
952 tcp_conn->data_copied = 0; 954 tcp_conn->data_copied = 0;
@@ -1191,7 +1193,7 @@ static inline void
1191iscsi_data_digest_init(struct iscsi_tcp_conn *tcp_conn, 1193iscsi_data_digest_init(struct iscsi_tcp_conn *tcp_conn,
1192 struct iscsi_tcp_cmd_task *tcp_ctask) 1194 struct iscsi_tcp_cmd_task *tcp_ctask)
1193{ 1195{
1194 crypto_digest_init(tcp_conn->tx_tfm); 1196 crypto_hash_init(&tcp_conn->tx_hash);
1195 tcp_ctask->digest_count = 4; 1197 tcp_ctask->digest_count = 4;
1196} 1198}
1197 1199
@@ -1447,8 +1449,9 @@ iscsi_send_padding(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
1447 iscsi_buf_init_iov(&tcp_ctask->sendbuf, (char*)&tcp_ctask->pad, 1449 iscsi_buf_init_iov(&tcp_ctask->sendbuf, (char*)&tcp_ctask->pad,
1448 tcp_ctask->pad_count); 1450 tcp_ctask->pad_count);
1449 if (conn->datadgst_en) 1451 if (conn->datadgst_en)
1450 crypto_digest_update(tcp_conn->tx_tfm, 1452 crypto_hash_update(&tcp_conn->tx_hash,
1451 &tcp_ctask->sendbuf.sg, 1); 1453 &tcp_ctask->sendbuf.sg,
1454 tcp_ctask->sendbuf.sg.length);
1452 } else if (!(tcp_ctask->xmstate & XMSTATE_W_RESEND_PAD)) 1455 } else if (!(tcp_ctask->xmstate & XMSTATE_W_RESEND_PAD))
1453 return 0; 1456 return 0;
1454 1457
@@ -1480,7 +1483,7 @@ iscsi_send_digest(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,
1480 tcp_conn = conn->dd_data; 1483 tcp_conn = conn->dd_data;
1481 1484
1482 if (!(tcp_ctask->xmstate & XMSTATE_W_RESEND_DATA_DIGEST)) { 1485 if (!(tcp_ctask->xmstate & XMSTATE_W_RESEND_DATA_DIGEST)) {
1483 crypto_digest_final(tcp_conn->tx_tfm, (u8*)digest); 1486 crypto_hash_final(&tcp_conn->tx_hash, (u8*)digest);
1484 iscsi_buf_init_iov(buf, (char*)digest, 4); 1487 iscsi_buf_init_iov(buf, (char*)digest, 4);
1485 } 1488 }
1486 tcp_ctask->xmstate &= ~XMSTATE_W_RESEND_DATA_DIGEST; 1489 tcp_ctask->xmstate &= ~XMSTATE_W_RESEND_DATA_DIGEST;
@@ -1514,7 +1517,7 @@ iscsi_send_data(struct iscsi_cmd_task *ctask, struct iscsi_buf *sendbuf,
1514 rc = iscsi_sendpage(conn, sendbuf, count, &buf_sent); 1517 rc = iscsi_sendpage(conn, sendbuf, count, &buf_sent);
1515 *sent = *sent + buf_sent; 1518 *sent = *sent + buf_sent;
1516 if (buf_sent && conn->datadgst_en) 1519 if (buf_sent && conn->datadgst_en)
1517 partial_sg_digest_update(tcp_conn->tx_tfm, 1520 partial_sg_digest_update(&tcp_conn->tx_hash,
1518 &sendbuf->sg, sendbuf->sg.offset + offset, 1521 &sendbuf->sg, sendbuf->sg.offset + offset,
1519 buf_sent); 1522 buf_sent);
1520 if (!iscsi_buf_left(sendbuf) && *sg != tcp_ctask->bad_sg) { 1523 if (!iscsi_buf_left(sendbuf) && *sg != tcp_ctask->bad_sg) {
@@ -1768,18 +1771,22 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
1768 /* initial operational parameters */ 1771 /* initial operational parameters */
1769 tcp_conn->hdr_size = sizeof(struct iscsi_hdr); 1772 tcp_conn->hdr_size = sizeof(struct iscsi_hdr);
1770 1773
1771 tcp_conn->tx_tfm = crypto_alloc_tfm("crc32c", 0); 1774 tcp_conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0,
1772 if (!tcp_conn->tx_tfm) 1775 CRYPTO_ALG_ASYNC);
1776 tcp_conn->tx_hash.flags = 0;
1777 if (!tcp_conn->tx_hash.tfm)
1773 goto free_tcp_conn; 1778 goto free_tcp_conn;
1774 1779
1775 tcp_conn->rx_tfm = crypto_alloc_tfm("crc32c", 0); 1780 tcp_conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0,
1776 if (!tcp_conn->rx_tfm) 1781 CRYPTO_ALG_ASYNC);
1782 tcp_conn->rx_hash.flags = 0;
1783 if (!tcp_conn->rx_hash.tfm)
1777 goto free_tx_tfm; 1784 goto free_tx_tfm;
1778 1785
1779 return cls_conn; 1786 return cls_conn;
1780 1787
1781free_tx_tfm: 1788free_tx_tfm:
1782 crypto_free_tfm(tcp_conn->tx_tfm); 1789 crypto_free_hash(tcp_conn->tx_hash.tfm);
1783free_tcp_conn: 1790free_tcp_conn:
1784 kfree(tcp_conn); 1791 kfree(tcp_conn);
1785tcp_conn_alloc_fail: 1792tcp_conn_alloc_fail:
@@ -1819,10 +1826,10 @@ iscsi_tcp_conn_destroy(struct iscsi_cls_conn *cls_conn)
1819 1826
1820 /* now free tcp_conn */ 1827 /* now free tcp_conn */
1821 if (digest) { 1828 if (digest) {
1822 if (tcp_conn->tx_tfm) 1829 if (tcp_conn->tx_hash.tfm)
1823 crypto_free_tfm(tcp_conn->tx_tfm); 1830 crypto_free_hash(tcp_conn->tx_hash.tfm);
1824 if (tcp_conn->rx_tfm) 1831 if (tcp_conn->rx_hash.tfm)
1825 crypto_free_tfm(tcp_conn->rx_tfm); 1832 crypto_free_hash(tcp_conn->rx_hash.tfm);
1826 } 1833 }
1827 1834
1828 kfree(tcp_conn); 1835 kfree(tcp_conn);
diff --git a/drivers/scsi/iscsi_tcp.h b/drivers/scsi/iscsi_tcp.h
index 609f4778d12..32736831790 100644
--- a/drivers/scsi/iscsi_tcp.h
+++ b/drivers/scsi/iscsi_tcp.h
@@ -49,6 +49,7 @@
49#define ISCSI_SG_TABLESIZE SG_ALL 49#define ISCSI_SG_TABLESIZE SG_ALL
50#define ISCSI_TCP_MAX_CMD_LEN 16 50#define ISCSI_TCP_MAX_CMD_LEN 16
51 51
52struct crypto_hash;
52struct socket; 53struct socket;
53 54
54/* Socket connection recieve helper */ 55/* Socket connection recieve helper */
@@ -81,6 +82,7 @@ struct iscsi_tcp_conn {
81 * stop to terminate */ 82 * stop to terminate */
82 /* iSCSI connection-wide sequencing */ 83 /* iSCSI connection-wide sequencing */
83 int hdr_size; /* PDU header size */ 84 int hdr_size; /* PDU header size */
85
84 /* control data */ 86 /* control data */
85 struct iscsi_tcp_recv in; /* TCP receive context */ 87 struct iscsi_tcp_recv in; /* TCP receive context */
86 int in_progress; /* connection state machine */ 88 int in_progress; /* connection state machine */
@@ -91,8 +93,8 @@ struct iscsi_tcp_conn {
91 void (*old_write_space)(struct sock *); 93 void (*old_write_space)(struct sock *);
92 94
93 /* data and header digests */ 95 /* data and header digests */
94 struct crypto_tfm *tx_tfm; /* CRC32C (Tx) */ 96 struct hash_desc tx_hash; /* CRC32C (Tx) */
95 struct crypto_tfm *rx_tfm; /* CRC32C (Rx) */ 97 struct hash_desc rx_hash; /* CRC32C (Rx) */
96 98
97 /* MIB custom statistics */ 99 /* MIB custom statistics */
98 uint32_t sendpage_failures_cnt; 100 uint32_t sendpage_failures_cnt;
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 73dd6c8deed..427b73a3886 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1256,10 +1256,15 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
1256 swap_buf_le16(id, ATA_ID_WORDS); 1256 swap_buf_le16(id, ATA_ID_WORDS);
1257 1257
1258 /* sanity check */ 1258 /* sanity check */
1259 if ((class == ATA_DEV_ATA) != (ata_id_is_ata(id) | ata_id_is_cfa(id))) { 1259 rc = -EINVAL;
1260 rc = -EINVAL; 1260 reason = "device reports illegal type";
1261 reason = "device reports illegal type"; 1261
1262 goto err_out; 1262 if (class == ATA_DEV_ATA) {
1263 if (!ata_id_is_ata(id) && !ata_id_is_cfa(id))
1264 goto err_out;
1265 } else {
1266 if (ata_id_is_ata(id))
1267 goto err_out;
1263 } 1268 }
1264 1269
1265 if (post_reset && class == ATA_DEV_ATA) { 1270 if (post_reset && class == ATA_DEV_ATA) {
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index 89ef34df5a1..6422de72bf4 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -431,7 +431,7 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat
431 struct fsc_state *state; 431 struct fsc_state *state;
432 struct Scsi_Host *host; 432 struct Scsi_Host *host;
433 void *dma_cmd_space; 433 void *dma_cmd_space;
434 unsigned char *clkprop; 434 const unsigned char *clkprop;
435 int proplen, rc = -ENODEV; 435 int proplen, rc = -ENODEV;
436 436
437 if (macio_resource_count(mdev) != 2 || macio_irq_count(mdev) != 2) { 437 if (macio_resource_count(mdev) != 2 || macio_irq_count(mdev) != 2) {
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index 5572981a9f9..592b52afe65 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1850,7 +1850,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
1850{ 1850{
1851 struct device_node *mesh = macio_get_of_node(mdev); 1851 struct device_node *mesh = macio_get_of_node(mdev);
1852 struct pci_dev* pdev = macio_get_pci_dev(mdev); 1852 struct pci_dev* pdev = macio_get_pci_dev(mdev);
1853 int tgt, *cfp, minper; 1853 int tgt, minper;
1854 const int *cfp;
1854 struct mesh_state *ms; 1855 struct mesh_state *ms;
1855 struct Scsi_Host *mesh_host; 1856 struct Scsi_Host *mesh_host;
1856 void *dma_cmd_space; 1857 void *dma_cmd_space;
@@ -1939,7 +1940,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
1939 ms->tgts[tgt].current_req = NULL; 1940 ms->tgts[tgt].current_req = NULL;
1940 } 1941 }
1941 1942
1942 if ((cfp = (int *) get_property(mesh, "clock-frequency", NULL))) 1943 if ((cfp = get_property(mesh, "clock-frequency", NULL)))
1943 ms->clk_freq = *cfp; 1944 ms->clk_freq = *cfp;
1944 else { 1945 else {
1945 printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n"); 1946 printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index 1053c7c76b7..fa38a413d16 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -1961,8 +1961,7 @@ comreset_retry:
1961 timeout = jiffies + msecs_to_jiffies(200); 1961 timeout = jiffies + msecs_to_jiffies(200);
1962 do { 1962 do {
1963 sata_scr_read(ap, SCR_STATUS, &sstatus); 1963 sata_scr_read(ap, SCR_STATUS, &sstatus);
1964 sstatus &= 0x3; 1964 if (((sstatus & 0x3) == 3) || ((sstatus & 0x3) == 0))
1965 if ((sstatus == 3) || (sstatus == 0))
1966 break; 1965 break;
1967 1966
1968 __msleep(1, can_sleep); 1967 __msleep(1, can_sleep);
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 7d0858095e1..6b70c3c76df 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -268,7 +268,7 @@ static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
268 /* Match it to a port node */ 268 /* Match it to a port node */
269 index = (ap == ap->host_set->ports[0]) ? 0 : 1; 269 index = (ap == ap->host_set->ports[0]) ? 0 : 1;
270 for (np = np->child; np != NULL; np = np->sibling) { 270 for (np = np->child; np != NULL; np = np->sibling) {
271 u32 *reg = (u32 *)get_property(np, "reg", NULL); 271 const u32 *reg = get_property(np, "reg", NULL);
272 if (!reg) 272 if (!reg)
273 continue; 273 continue;
274 if (index == *reg) 274 if (index == *reg)
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
index 01d40369a8a..a3727af8b9c 100644
--- a/drivers/scsi/sata_via.c
+++ b/drivers/scsi/sata_via.c
@@ -77,6 +77,7 @@ static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
77static void vt6420_error_handler(struct ata_port *ap); 77static void vt6420_error_handler(struct ata_port *ap);
78 78
79static const struct pci_device_id svia_pci_tbl[] = { 79static const struct pci_device_id svia_pci_tbl[] = {
80 { 0x1106, 0x0591, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 },
80 { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 }, 81 { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 },
81 { 0x1106, 0x3249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6421 }, 82 { 0x1106, 0x3249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6421 },
82 83
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index a8ed5a22009..3d355d05461 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -466,7 +466,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
466 struct scsi_device *sdev = scmd->device; 466 struct scsi_device *sdev = scmd->device;
467 struct Scsi_Host *shost = sdev->host; 467 struct Scsi_Host *shost = sdev->host;
468 int old_result = scmd->result; 468 int old_result = scmd->result;
469 DECLARE_COMPLETION(done); 469 DECLARE_COMPLETION_ONSTACK(done);
470 unsigned long timeleft; 470 unsigned long timeleft;
471 unsigned long flags; 471 unsigned long flags;
472 unsigned char old_cmnd[MAX_COMMAND_SIZE]; 472 unsigned char old_cmnd[MAX_COMMAND_SIZE];