aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/eata.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/scsi/eata.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/scsi/eata.c')
-rw-r--r--drivers/scsi/eata.c75
1 files changed, 36 insertions, 39 deletions
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index d1c31378f6da..94de88955a99 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -63,7 +63,7 @@
63 * ep:[y|n] eisa_probe=[1|0] CONFIG_EISA defined 63 * ep:[y|n] eisa_probe=[1|0] CONFIG_EISA defined
64 * pp:[y|n] pci_probe=[1|0] CONFIG_PCI defined 64 * pp:[y|n] pci_probe=[1|0] CONFIG_PCI defined
65 * 65 *
66 * The default action is to perform probing if the corrisponding 66 * The default action is to perform probing if the corresponding
67 * bus is configured and to skip probing otherwise. 67 * bus is configured and to skip probing otherwise.
68 * 68 *
69 * + If pci_probe is in effect and a list of I/O ports is specified 69 * + If pci_probe is in effect and a list of I/O ports is specified
@@ -505,8 +505,7 @@
505 505
506static int eata2x_detect(struct scsi_host_template *); 506static int eata2x_detect(struct scsi_host_template *);
507static int eata2x_release(struct Scsi_Host *); 507static int eata2x_release(struct Scsi_Host *);
508static int eata2x_queuecommand(struct scsi_cmnd *, 508static int eata2x_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
509 void (*done) (struct scsi_cmnd *));
510static int eata2x_eh_abort(struct scsi_cmnd *); 509static int eata2x_eh_abort(struct scsi_cmnd *);
511static int eata2x_eh_host_reset(struct scsi_cmnd *); 510static int eata2x_eh_host_reset(struct scsi_cmnd *);
512static int eata2x_bios_param(struct scsi_device *, struct block_device *, 511static int eata2x_bios_param(struct scsi_device *, struct block_device *,
@@ -1758,7 +1757,7 @@ static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha)
1758 1757
1759} 1758}
1760 1759
1761static int eata2x_queuecommand(struct scsi_cmnd *SCpnt, 1760static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt,
1762 void (*done) (struct scsi_cmnd *)) 1761 void (*done) (struct scsi_cmnd *))
1763{ 1762{
1764 struct Scsi_Host *shost = SCpnt->device->host; 1763 struct Scsi_Host *shost = SCpnt->device->host;
@@ -1767,8 +1766,8 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,
1767 struct mscp *cpp; 1766 struct mscp *cpp;
1768 1767
1769 if (SCpnt->host_scribble) 1768 if (SCpnt->host_scribble)
1770 panic("%s: qcomm, pid %ld, SCpnt %p already active.\n", 1769 panic("%s: qcomm, SCpnt %p already active.\n",
1771 ha->board_name, SCpnt->serial_number, SCpnt); 1770 ha->board_name, SCpnt);
1772 1771
1773 /* i is the mailbox number, look for the first free mailbox 1772 /* i is the mailbox number, look for the first free mailbox
1774 starting from last_cp_used */ 1773 starting from last_cp_used */
@@ -1802,7 +1801,7 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,
1802 1801
1803 if (do_trace) 1802 if (do_trace)
1804 scmd_printk(KERN_INFO, SCpnt, 1803 scmd_printk(KERN_INFO, SCpnt,
1805 "qcomm, mbox %d, pid %ld.\n", i, SCpnt->serial_number); 1804 "qcomm, mbox %d.\n", i);
1806 1805
1807 cpp->reqsen = 1; 1806 cpp->reqsen = 1;
1808 cpp->dispri = 1; 1807 cpp->dispri = 1;
@@ -1834,8 +1833,7 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,
1834 if (do_dma(shost->io_port, cpp->cp_dma_addr, SEND_CP_DMA)) { 1833 if (do_dma(shost->io_port, cpp->cp_dma_addr, SEND_CP_DMA)) {
1835 unmap_dma(i, ha); 1834 unmap_dma(i, ha);
1836 SCpnt->host_scribble = NULL; 1835 SCpnt->host_scribble = NULL;
1837 scmd_printk(KERN_INFO, SCpnt, 1836 scmd_printk(KERN_INFO, SCpnt, "qcomm, adapter busy.\n");
1838 "qcomm, pid %ld, adapter busy.\n", SCpnt->serial_number);
1839 return 1; 1837 return 1;
1840 } 1838 }
1841 1839
@@ -1843,6 +1841,8 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,
1843 return 0; 1841 return 0;
1844} 1842}
1845 1843
1844static DEF_SCSI_QCMD(eata2x_queuecommand)
1845
1846static int eata2x_eh_abort(struct scsi_cmnd *SCarg) 1846static int eata2x_eh_abort(struct scsi_cmnd *SCarg)
1847{ 1847{
1848 struct Scsi_Host *shost = SCarg->device->host; 1848 struct Scsi_Host *shost = SCarg->device->host;
@@ -1850,14 +1850,12 @@ static int eata2x_eh_abort(struct scsi_cmnd *SCarg)
1850 unsigned int i; 1850 unsigned int i;
1851 1851
1852 if (SCarg->host_scribble == NULL) { 1852 if (SCarg->host_scribble == NULL) {
1853 scmd_printk(KERN_INFO, SCarg, 1853 scmd_printk(KERN_INFO, SCarg, "abort, cmd inactive.\n");
1854 "abort, pid %ld inactive.\n", SCarg->serial_number);
1855 return SUCCESS; 1854 return SUCCESS;
1856 } 1855 }
1857 1856
1858 i = *(unsigned int *)SCarg->host_scribble; 1857 i = *(unsigned int *)SCarg->host_scribble;
1859 scmd_printk(KERN_WARNING, SCarg, 1858 scmd_printk(KERN_WARNING, SCarg, "abort, mbox %d.\n", i);
1860 "abort, mbox %d, pid %ld.\n", i, SCarg->serial_number);
1861 1859
1862 if (i >= shost->can_queue) 1860 if (i >= shost->can_queue)
1863 panic("%s: abort, invalid SCarg->host_scribble.\n", ha->board_name); 1861 panic("%s: abort, invalid SCarg->host_scribble.\n", ha->board_name);
@@ -1901,8 +1899,8 @@ static int eata2x_eh_abort(struct scsi_cmnd *SCarg)
1901 SCarg->result = DID_ABORT << 16; 1899 SCarg->result = DID_ABORT << 16;
1902 SCarg->host_scribble = NULL; 1900 SCarg->host_scribble = NULL;
1903 ha->cp_stat[i] = FREE; 1901 ha->cp_stat[i] = FREE;
1904 printk("%s, abort, mbox %d ready, DID_ABORT, pid %ld done.\n", 1902 printk("%s, abort, mbox %d ready, DID_ABORT, done.\n",
1905 ha->board_name, i, SCarg->serial_number); 1903 ha->board_name, i);
1906 SCarg->scsi_done(SCarg); 1904 SCarg->scsi_done(SCarg);
1907 return SUCCESS; 1905 return SUCCESS;
1908 } 1906 }
@@ -1918,13 +1916,12 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
1918 struct Scsi_Host *shost = SCarg->device->host; 1916 struct Scsi_Host *shost = SCarg->device->host;
1919 struct hostdata *ha = (struct hostdata *)shost->hostdata; 1917 struct hostdata *ha = (struct hostdata *)shost->hostdata;
1920 1918
1921 scmd_printk(KERN_INFO, SCarg, 1919 scmd_printk(KERN_INFO, SCarg, "reset, enter.\n");
1922 "reset, enter, pid %ld.\n", SCarg->serial_number);
1923 1920
1924 spin_lock_irq(shost->host_lock); 1921 spin_lock_irq(shost->host_lock);
1925 1922
1926 if (SCarg->host_scribble == NULL) 1923 if (SCarg->host_scribble == NULL)
1927 printk("%s: reset, pid %ld inactive.\n", ha->board_name, SCarg->serial_number); 1924 printk("%s: reset, inactive.\n", ha->board_name);
1928 1925
1929 if (ha->in_reset) { 1926 if (ha->in_reset) {
1930 printk("%s: reset, exit, already in reset.\n", ha->board_name); 1927 printk("%s: reset, exit, already in reset.\n", ha->board_name);
@@ -1963,14 +1960,14 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
1963 1960
1964 if (ha->cp_stat[i] == READY || ha->cp_stat[i] == ABORTING) { 1961 if (ha->cp_stat[i] == READY || ha->cp_stat[i] == ABORTING) {
1965 ha->cp_stat[i] = ABORTING; 1962 ha->cp_stat[i] = ABORTING;
1966 printk("%s: reset, mbox %d aborting, pid %ld.\n", 1963 printk("%s: reset, mbox %d aborting.\n",
1967 ha->board_name, i, SCpnt->serial_number); 1964 ha->board_name, i);
1968 } 1965 }
1969 1966
1970 else { 1967 else {
1971 ha->cp_stat[i] = IN_RESET; 1968 ha->cp_stat[i] = IN_RESET;
1972 printk("%s: reset, mbox %d in reset, pid %ld.\n", 1969 printk("%s: reset, mbox %d in reset.\n",
1973 ha->board_name, i, SCpnt->serial_number); 1970 ha->board_name, i);
1974 } 1971 }
1975 1972
1976 if (SCpnt->host_scribble == NULL) 1973 if (SCpnt->host_scribble == NULL)
@@ -2024,8 +2021,8 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2024 ha->cp_stat[i] = LOCKED; 2021 ha->cp_stat[i] = LOCKED;
2025 2022
2026 printk 2023 printk
2027 ("%s, reset, mbox %d locked, DID_RESET, pid %ld done.\n", 2024 ("%s, reset, mbox %d locked, DID_RESET, done.\n",
2028 ha->board_name, i, SCpnt->serial_number); 2025 ha->board_name, i);
2029 } 2026 }
2030 2027
2031 else if (ha->cp_stat[i] == ABORTING) { 2028 else if (ha->cp_stat[i] == ABORTING) {
@@ -2038,8 +2035,8 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2038 ha->cp_stat[i] = FREE; 2035 ha->cp_stat[i] = FREE;
2039 2036
2040 printk 2037 printk
2041 ("%s, reset, mbox %d aborting, DID_RESET, pid %ld done.\n", 2038 ("%s, reset, mbox %d aborting, DID_RESET, done.\n",
2042 ha->board_name, i, SCpnt->serial_number); 2039 ha->board_name, i);
2043 } 2040 }
2044 2041
2045 else 2042 else
@@ -2053,7 +2050,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2053 do_trace = 0; 2050 do_trace = 0;
2054 2051
2055 if (arg_done) 2052 if (arg_done)
2056 printk("%s: reset, exit, pid %ld done.\n", ha->board_name, SCarg->serial_number); 2053 printk("%s: reset, exit, done.\n", ha->board_name);
2057 else 2054 else
2058 printk("%s: reset, exit.\n", ha->board_name); 2055 printk("%s: reset, exit.\n", ha->board_name);
2059 2056
@@ -2237,10 +2234,10 @@ static int reorder(struct hostdata *ha, unsigned long cursec,
2237 cpp = &ha->cp[k]; 2234 cpp = &ha->cp[k];
2238 SCpnt = cpp->SCpnt; 2235 SCpnt = cpp->SCpnt;
2239 scmd_printk(KERN_INFO, SCpnt, 2236 scmd_printk(KERN_INFO, SCpnt,
2240 "%s pid %ld mb %d fc %d nr %d sec %ld ns %u" 2237 "%s mb %d fc %d nr %d sec %ld ns %u"
2241 " cur %ld s:%c r:%c rev:%c in:%c ov:%c xd %d.\n", 2238 " cur %ld s:%c r:%c rev:%c in:%c ov:%c xd %d.\n",
2242 (ihdlr ? "ihdlr" : "qcomm"), 2239 (ihdlr ? "ihdlr" : "qcomm"),
2243 SCpnt->serial_number, k, flushcount, 2240 k, flushcount,
2244 n_ready, blk_rq_pos(SCpnt->request), 2241 n_ready, blk_rq_pos(SCpnt->request),
2245 blk_rq_sectors(SCpnt->request), cursec, YESNO(s), 2242 blk_rq_sectors(SCpnt->request), cursec, YESNO(s),
2246 YESNO(r), YESNO(rev), YESNO(input_only), 2243 YESNO(r), YESNO(rev), YESNO(input_only),
@@ -2284,10 +2281,10 @@ static void flush_dev(struct scsi_device *dev, unsigned long cursec,
2284 2281
2285 if (do_dma(dev->host->io_port, cpp->cp_dma_addr, SEND_CP_DMA)) { 2282 if (do_dma(dev->host->io_port, cpp->cp_dma_addr, SEND_CP_DMA)) {
2286 scmd_printk(KERN_INFO, SCpnt, 2283 scmd_printk(KERN_INFO, SCpnt,
2287 "%s, pid %ld, mbox %d, adapter" 2284 "%s, mbox %d, adapter"
2288 " busy, will abort.\n", 2285 " busy, will abort.\n",
2289 (ihdlr ? "ihdlr" : "qcomm"), 2286 (ihdlr ? "ihdlr" : "qcomm"),
2290 SCpnt->serial_number, k); 2287 k);
2291 ha->cp_stat[k] = ABORTING; 2288 ha->cp_stat[k] = ABORTING;
2292 continue; 2289 continue;
2293 } 2290 }
@@ -2397,12 +2394,12 @@ static irqreturn_t ihdlr(struct Scsi_Host *shost)
2397 panic("%s: ihdlr, mbox %d, SCpnt == NULL.\n", ha->board_name, i); 2394 panic("%s: ihdlr, mbox %d, SCpnt == NULL.\n", ha->board_name, i);
2398 2395
2399 if (SCpnt->host_scribble == NULL) 2396 if (SCpnt->host_scribble == NULL)
2400 panic("%s: ihdlr, mbox %d, pid %ld, SCpnt %p garbled.\n", ha->board_name, 2397 panic("%s: ihdlr, mbox %d, SCpnt %p garbled.\n", ha->board_name,
2401 i, SCpnt->serial_number, SCpnt); 2398 i, SCpnt);
2402 2399
2403 if (*(unsigned int *)SCpnt->host_scribble != i) 2400 if (*(unsigned int *)SCpnt->host_scribble != i)
2404 panic("%s: ihdlr, mbox %d, pid %ld, index mismatch %d.\n", 2401 panic("%s: ihdlr, mbox %d, index mismatch %d.\n",
2405 ha->board_name, i, SCpnt->serial_number, 2402 ha->board_name, i,
2406 *(unsigned int *)SCpnt->host_scribble); 2403 *(unsigned int *)SCpnt->host_scribble);
2407 2404
2408 sync_dma(i, ha); 2405 sync_dma(i, ha);
@@ -2448,11 +2445,11 @@ static irqreturn_t ihdlr(struct Scsi_Host *shost)
2448 if (spp->target_status && SCpnt->device->type == TYPE_DISK && 2445 if (spp->target_status && SCpnt->device->type == TYPE_DISK &&
2449 (!(tstatus == CHECK_CONDITION && ha->iocount <= 1000 && 2446 (!(tstatus == CHECK_CONDITION && ha->iocount <= 1000 &&
2450 (SCpnt->sense_buffer[2] & 0xf) == NOT_READY))) 2447 (SCpnt->sense_buffer[2] & 0xf) == NOT_READY)))
2451 printk("%s: ihdlr, target %d.%d:%d, pid %ld, " 2448 printk("%s: ihdlr, target %d.%d:%d, "
2452 "target_status 0x%x, sense key 0x%x.\n", 2449 "target_status 0x%x, sense key 0x%x.\n",
2453 ha->board_name, 2450 ha->board_name,
2454 SCpnt->device->channel, SCpnt->device->id, 2451 SCpnt->device->channel, SCpnt->device->id,
2455 SCpnt->device->lun, SCpnt->serial_number, 2452 SCpnt->device->lun,
2456 spp->target_status, SCpnt->sense_buffer[2]); 2453 spp->target_status, SCpnt->sense_buffer[2]);
2457 2454
2458 ha->target_to[SCpnt->device->id][SCpnt->device->channel] = 0; 2455 ha->target_to[SCpnt->device->id][SCpnt->device->channel] = 0;
@@ -2521,9 +2518,9 @@ static irqreturn_t ihdlr(struct Scsi_Host *shost)
2521 do_trace || msg_byte(spp->target_status)) 2518 do_trace || msg_byte(spp->target_status))
2522#endif 2519#endif
2523 scmd_printk(KERN_INFO, SCpnt, "ihdlr, mbox %2d, err 0x%x:%x," 2520 scmd_printk(KERN_INFO, SCpnt, "ihdlr, mbox %2d, err 0x%x:%x,"
2524 " pid %ld, reg 0x%x, count %d.\n", 2521 " reg 0x%x, count %d.\n",
2525 i, spp->adapter_status, spp->target_status, 2522 i, spp->adapter_status, spp->target_status,
2526 SCpnt->serial_number, reg, ha->iocount); 2523 reg, ha->iocount);
2527 2524
2528 unmap_dma(i, ha); 2525 unmap_dma(i, ha);
2529 2526