summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2016-03-23 06:10:15 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2016-04-11 16:57:09 -0400
commitf825e40b235f4daf1c9017366809d34c7f5c8c7f (patch)
tree73dfa8695b119f5330344924cf141fe5de7251ad
parent1bb4600245d4d40245dd505ca17528e0b9a9ba8c (diff)
ncr5380: Remove PSEUDO_DMA macro
For those wrapper drivers which only implement Programmed IO, have NCR5380_dma_xfer_len() evaluate to zero. That allows PDMA to be easily disabled at run-time and so the PSEUDO_DMA macro is no longer needed. Also remove the spin counters used for debugging pseudo DMA drivers. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/NCR5380.c32
-rw-r--r--drivers/scsi/NCR5380.h4
-rw-r--r--drivers/scsi/arm/cumana_1.c2
-rw-r--r--drivers/scsi/arm/oak.c3
-rw-r--r--drivers/scsi/dmx3191d.c4
-rw-r--r--drivers/scsi/dtc.c7
-rw-r--r--drivers/scsi/dtc.h2
-rw-r--r--drivers/scsi/g_NCR5380.c1
-rw-r--r--drivers/scsi/g_NCR5380.h1
-rw-r--r--drivers/scsi/mac_scsi.c10
-rw-r--r--drivers/scsi/pas16.c10
-rw-r--r--drivers/scsi/pas16.h2
-rw-r--r--drivers/scsi/t128.c4
-rw-r--r--drivers/scsi/t128.h2
14 files changed, 6 insertions, 78 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 69c73c36b923..fc86cde2d28e 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -469,34 +469,9 @@ static void prepare_info(struct Scsi_Host *instance)
469#ifdef PARITY 469#ifdef PARITY
470 "PARITY " 470 "PARITY "
471#endif 471#endif
472#ifdef PSEUDO_DMA
473 "PSEUDO_DMA "
474#endif
475 ""); 472 "");
476} 473}
477 474
478#ifdef PSEUDO_DMA
479static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance,
480 char *buffer, int length)
481{
482 struct NCR5380_hostdata *hostdata = shost_priv(instance);
483
484 hostdata->spin_max_r = 0;
485 hostdata->spin_max_w = 0;
486 return 0;
487}
488
489static int __maybe_unused NCR5380_show_info(struct seq_file *m,
490 struct Scsi_Host *instance)
491{
492 struct NCR5380_hostdata *hostdata = shost_priv(instance);
493
494 seq_printf(m, "Highwater I/O busy spin counts: write %d, read %d\n",
495 hostdata->spin_max_w, hostdata->spin_max_r);
496 return 0;
497}
498#endif
499
500/** 475/**
501 * NCR5380_init - initialise an NCR5380 476 * NCR5380_init - initialise an NCR5380
502 * @instance: adapter to configure 477 * @instance: adapter to configure
@@ -1436,7 +1411,6 @@ timeout:
1436 return -1; 1411 return -1;
1437} 1412}
1438 1413
1439#if defined(PSEUDO_DMA)
1440/* 1414/*
1441 * Function : int NCR5380_transfer_dma (struct Scsi_Host *instance, 1415 * Function : int NCR5380_transfer_dma (struct Scsi_Host *instance,
1442 * unsigned char *phase, int *count, unsigned char **data) 1416 * unsigned char *phase, int *count, unsigned char **data)
@@ -1592,7 +1566,6 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
1592 *phase = NCR5380_read(STATUS_REG) & PHASE_MASK; 1566 *phase = NCR5380_read(STATUS_REG) & PHASE_MASK;
1593 return foo; 1567 return foo;
1594} 1568}
1595#endif /* PSEUDO_DMA */
1596 1569
1597/* 1570/*
1598 * Function : NCR5380_information_transfer (struct Scsi_Host *instance) 1571 * Function : NCR5380_information_transfer (struct Scsi_Host *instance)
@@ -1683,7 +1656,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
1683 * in an unconditional loop. 1656 * in an unconditional loop.
1684 */ 1657 */
1685 1658
1686#if defined(PSEUDO_DMA)
1687 transfersize = 0; 1659 transfersize = 0;
1688 if (!cmd->device->borken) 1660 if (!cmd->device->borken)
1689 transfersize = NCR5380_dma_xfer_len(instance, cmd, phase); 1661 transfersize = NCR5380_dma_xfer_len(instance, cmd, phase);
@@ -1706,9 +1678,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
1706 /* XXX - need to source or sink data here, as appropriate */ 1678 /* XXX - need to source or sink data here, as appropriate */
1707 } else 1679 } else
1708 cmd->SCp.this_residual -= transfersize - len; 1680 cmd->SCp.this_residual -= transfersize - len;
1709 } else 1681 } else {
1710#endif /* PSEUDO_DMA */
1711 {
1712 /* Break up transfer into 3 ms chunks, 1682 /* Break up transfer into 3 ms chunks,
1713 * presuming 6 accesses per handshake. 1683 * presuming 6 accesses per handshake.
1714 */ 1684 */
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index 7b488a082462..8adf7377de4c 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -257,10 +257,6 @@ struct NCR5380_hostdata {
257#ifdef SUPPORT_TAGS 257#ifdef SUPPORT_TAGS
258 struct tag_alloc TagAlloc[8][8]; /* 8 targets and 8 LUNs */ 258 struct tag_alloc TagAlloc[8][8]; /* 8 targets and 8 LUNs */
259#endif 259#endif
260#ifdef PSEUDO_DMA
261 unsigned spin_max_r;
262 unsigned spin_max_w;
263#endif
264 struct workqueue_struct *work_q; 260 struct workqueue_struct *work_q;
265 unsigned long accesses_per_ms; /* chip register accesses per ms */ 261 unsigned long accesses_per_ms; /* chip register accesses per ms */
266}; 262};
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index 76b2d3364d9f..6e9de19fc3c2 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -13,8 +13,6 @@
13 13
14#include <scsi/scsi_host.h> 14#include <scsi/scsi_host.h>
15 15
16#define PSEUDO_DMA
17
18#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) 16#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
19#define NCR5380_read(reg) cumanascsi_read(instance, reg) 17#define NCR5380_read(reg) cumanascsi_read(instance, reg)
20#define NCR5380_write(reg, value) cumanascsi_write(instance, reg, value) 18#define NCR5380_write(reg, value) cumanascsi_write(instance, reg, value)
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index 8d8426535e6d..63abd6b248a6 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -14,7 +14,6 @@
14 14
15#include <scsi/scsi_host.h> 15#include <scsi/scsi_host.h>
16 16
17/*#define PSEUDO_DMA*/
18#define DONT_USE_INTR 17#define DONT_USE_INTR
19 18
20#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) 19#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
@@ -24,7 +23,7 @@
24#define NCR5380_write(reg, value) \ 23#define NCR5380_write(reg, value) \
25 writeb(value, priv(instance)->base + ((reg) << 2)) 24 writeb(value, priv(instance)->base + ((reg) << 2))
26 25
27#define NCR5380_dma_xfer_len(instance, cmd, phase) (cmd->transfersize) 26#define NCR5380_dma_xfer_len(instance, cmd, phase) (0)
28 27
29#define NCR5380_queue_command oakscsi_queue_command 28#define NCR5380_queue_command oakscsi_queue_command
30#define NCR5380_info oakscsi_info 29#define NCR5380_info oakscsi_info
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
index e9e96af96104..929bc1b618f8 100644
--- a/drivers/scsi/dmx3191d.c
+++ b/drivers/scsi/dmx3191d.c
@@ -39,6 +39,10 @@
39#define NCR5380_read(reg) inb(instance->io_port + reg) 39#define NCR5380_read(reg) inb(instance->io_port + reg)
40#define NCR5380_write(reg, value) outb(value, instance->io_port + reg) 40#define NCR5380_write(reg, value) outb(value, instance->io_port + reg)
41 41
42#define NCR5380_dma_xfer_len(instance, cmd, phase) (0)
43#define NCR5380_pread(instance, dst, len) (0)
44#define NCR5380_pwrite(instance, src, len) (0)
45
42#define NCR5380_implementation_fields /* none */ 46#define NCR5380_implementation_fields /* none */
43 47
44#include "NCR5380.h" 48#include "NCR5380.h"
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index 30919f42759a..30d3e73f70ca 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -1,4 +1,3 @@
1#define PSEUDO_DMA
2#define DONT_USE_INTR 1#define DONT_USE_INTR
3 2
4/* 3/*
@@ -352,8 +351,6 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst,
352 while (!(NCR5380_read(DTC_CONTROL_REG) & D_CR_ACCESS)) 351 while (!(NCR5380_read(DTC_CONTROL_REG) & D_CR_ACCESS))
353 ++i; 352 ++i;
354 rtrc(0); 353 rtrc(0);
355 if (i > hostdata->spin_max_r)
356 hostdata->spin_max_r = i;
357 return (0); 354 return (0);
358} 355}
359 356
@@ -400,8 +397,6 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src,
400 rtrc(7); 397 rtrc(7);
401 /* Check for parity error here. fixme. */ 398 /* Check for parity error here. fixme. */
402 rtrc(0); 399 rtrc(0);
403 if (i > hostdata->spin_max_w)
404 hostdata->spin_max_w = i;
405 return (0); 400 return (0);
406} 401}
407 402
@@ -440,8 +435,6 @@ static struct scsi_host_template driver_template = {
440 .detect = dtc_detect, 435 .detect = dtc_detect,
441 .release = dtc_release, 436 .release = dtc_release,
442 .proc_name = "dtc3x80", 437 .proc_name = "dtc3x80",
443 .show_info = dtc_show_info,
444 .write_info = dtc_write_info,
445 .info = dtc_info, 438 .info = dtc_info,
446 .queuecommand = dtc_queue_command, 439 .queuecommand = dtc_queue_command,
447 .eh_abort_handler = dtc_abort, 440 .eh_abort_handler = dtc_abort,
diff --git a/drivers/scsi/dtc.h b/drivers/scsi/dtc.h
index 56732cba8aba..1bc638730dda 100644
--- a/drivers/scsi/dtc.h
+++ b/drivers/scsi/dtc.h
@@ -27,8 +27,6 @@
27#define NCR5380_abort dtc_abort 27#define NCR5380_abort dtc_abort
28#define NCR5380_bus_reset dtc_bus_reset 28#define NCR5380_bus_reset dtc_bus_reset
29#define NCR5380_info dtc_info 29#define NCR5380_info dtc_info
30#define NCR5380_show_info dtc_show_info
31#define NCR5380_write_info dtc_write_info
32 30
33/* 15 12 11 10 31/* 15 12 11 10
34 1001 1100 0000 0000 */ 32 1001 1100 0000 0000 */
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index aaeb6b6b4b16..fc7bcbcf3f43 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -57,7 +57,6 @@
57 */ 57 */
58 58
59#define AUTOPROBE_IRQ 59#define AUTOPROBE_IRQ
60#define PSEUDO_DMA
61 60
62#include <asm/io.h> 61#include <asm/io.h>
63#include <linux/blkdev.h> 62#include <linux/blkdev.h>
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index 3fb0d8529429..a231a8c52d87 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -70,7 +70,6 @@
70#define NCR5380_pread generic_NCR5380_pread 70#define NCR5380_pread generic_NCR5380_pread
71#define NCR5380_pwrite generic_NCR5380_pwrite 71#define NCR5380_pwrite generic_NCR5380_pwrite
72#define NCR5380_info generic_NCR5380_info 72#define NCR5380_info generic_NCR5380_info
73#define NCR5380_show_info generic_NCR5380_show_info
74 73
75#define BOARD_NCR5380 0 74#define BOARD_NCR5380 0
76#define BOARD_NCR53C400 1 75#define BOARD_NCR53C400 1
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index a8f5433b515e..1e0d07ac83a1 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -28,8 +28,6 @@
28 28
29/* Definitions for the core NCR5380 driver. */ 29/* Definitions for the core NCR5380 driver. */
30 30
31#define PSEUDO_DMA
32
33#define NCR5380_implementation_fields unsigned char *pdma_base 31#define NCR5380_implementation_fields unsigned char *pdma_base
34 32
35#define NCR5380_read(reg) macscsi_read(instance, reg) 33#define NCR5380_read(reg) macscsi_read(instance, reg)
@@ -46,8 +44,6 @@
46#define NCR5380_abort macscsi_abort 44#define NCR5380_abort macscsi_abort
47#define NCR5380_bus_reset macscsi_bus_reset 45#define NCR5380_bus_reset macscsi_bus_reset
48#define NCR5380_info macscsi_info 46#define NCR5380_info macscsi_info
49#define NCR5380_show_info macscsi_show_info
50#define NCR5380_write_info macscsi_write_info
51 47
52#include "NCR5380.h" 48#include "NCR5380.h"
53 49
@@ -111,7 +107,6 @@ static int __init mac_scsi_setup(char *str)
111__setup("mac5380=", mac_scsi_setup); 107__setup("mac5380=", mac_scsi_setup);
112#endif /* !MODULE */ 108#endif /* !MODULE */
113 109
114#ifdef PSEUDO_DMA
115/* 110/*
116 Pseudo-DMA: (Ove Edlund) 111 Pseudo-DMA: (Ove Edlund)
117 The code attempts to catch bus errors that occur if one for example 112 The code attempts to catch bus errors that occur if one for example
@@ -303,7 +298,6 @@ static int macscsi_pwrite(struct Scsi_Host *instance,
303 298
304 return 0; 299 return 0;
305} 300}
306#endif
307 301
308static int macscsi_dma_xfer_len(struct Scsi_Host *instance, 302static int macscsi_dma_xfer_len(struct Scsi_Host *instance,
309 struct scsi_cmnd *cmd) 303 struct scsi_cmnd *cmd)
@@ -324,8 +318,6 @@ static int macscsi_dma_xfer_len(struct Scsi_Host *instance,
324static struct scsi_host_template mac_scsi_template = { 318static struct scsi_host_template mac_scsi_template = {
325 .module = THIS_MODULE, 319 .module = THIS_MODULE,
326 .proc_name = DRV_MODULE_NAME, 320 .proc_name = DRV_MODULE_NAME,
327 .show_info = macscsi_show_info,
328 .write_info = macscsi_write_info,
329 .name = "Macintosh NCR5380 SCSI", 321 .name = "Macintosh NCR5380 SCSI",
330 .info = macscsi_info, 322 .info = macscsi_info,
331 .queuecommand = macscsi_queue_command, 323 .queuecommand = macscsi_queue_command,
@@ -351,9 +343,7 @@ static int __init mac_scsi_probe(struct platform_device *pdev)
351 if (!pio_mem) 343 if (!pio_mem)
352 return -ENODEV; 344 return -ENODEV;
353 345
354#ifdef PSEUDO_DMA
355 pdma_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); 346 pdma_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
356#endif
357 347
358 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 348 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
359 349
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
index 7589fea01186..9c06eb637417 100644
--- a/drivers/scsi/pas16.c
+++ b/drivers/scsi/pas16.c
@@ -1,5 +1,3 @@
1#define PSEUDO_DMA
2
3/* 1/*
4 * This driver adapted from Drew Eckhardt's Trantor T128 driver 2 * This driver adapted from Drew Eckhardt's Trantor T128 driver
5 * 3 *
@@ -479,7 +477,6 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
479 P_DATA_REG_OFFSET); 477 P_DATA_REG_OFFSET);
480 register int i = len; 478 register int i = len;
481 int ii = 0; 479 int ii = 0;
482 struct NCR5380_hostdata *hostdata = shost_priv(instance);
483 480
484 while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) ) 481 while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) )
485 ++ii; 482 ++ii;
@@ -492,8 +489,6 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
492 instance->host_no); 489 instance->host_no);
493 return -1; 490 return -1;
494 } 491 }
495 if (ii > hostdata->spin_max_r)
496 hostdata->spin_max_r = ii;
497 return 0; 492 return 0;
498} 493}
499 494
@@ -516,7 +511,6 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src
516 register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET); 511 register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET);
517 register int i = len; 512 register int i = len;
518 int ii = 0; 513 int ii = 0;
519 struct NCR5380_hostdata *hostdata = shost_priv(instance);
520 514
521 while ( !((inb(instance->io_port + P_STATUS_REG_OFFSET)) & P_ST_RDY) ) 515 while ( !((inb(instance->io_port + P_STATUS_REG_OFFSET)) & P_ST_RDY) )
522 ++ii; 516 ++ii;
@@ -529,8 +523,6 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src
529 instance->host_no); 523 instance->host_no);
530 return -1; 524 return -1;
531 } 525 }
532 if (ii > hostdata->spin_max_w)
533 hostdata->spin_max_w = ii;
534 return 0; 526 return 0;
535} 527}
536 528
@@ -550,8 +542,6 @@ static struct scsi_host_template driver_template = {
550 .detect = pas16_detect, 542 .detect = pas16_detect,
551 .release = pas16_release, 543 .release = pas16_release,
552 .proc_name = "pas16", 544 .proc_name = "pas16",
553 .show_info = pas16_show_info,
554 .write_info = pas16_write_info,
555 .info = pas16_info, 545 .info = pas16_info,
556 .queuecommand = pas16_queue_command, 546 .queuecommand = pas16_queue_command,
557 .eh_abort_handler = pas16_abort, 547 .eh_abort_handler = pas16_abort,
diff --git a/drivers/scsi/pas16.h b/drivers/scsi/pas16.h
index d37527717225..1695885ce40c 100644
--- a/drivers/scsi/pas16.h
+++ b/drivers/scsi/pas16.h
@@ -109,8 +109,6 @@
109#define NCR5380_abort pas16_abort 109#define NCR5380_abort pas16_abort
110#define NCR5380_bus_reset pas16_bus_reset 110#define NCR5380_bus_reset pas16_bus_reset
111#define NCR5380_info pas16_info 111#define NCR5380_info pas16_info
112#define NCR5380_show_info pas16_show_info
113#define NCR5380_write_info pas16_write_info
114 112
115/* 15 14 12 10 7 5 3 113/* 15 14 12 10 7 5 3
116 1101 0100 1010 1000 */ 114 1101 0100 1010 1000 */
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c
index 6cb8bdd2f4e6..ce2395f3fae9 100644
--- a/drivers/scsi/t128.c
+++ b/drivers/scsi/t128.c
@@ -1,5 +1,3 @@
1#define PSEUDO_DMA
2
3/* 1/*
4 * Trantor T128/T128F/T228 driver 2 * Trantor T128/T128F/T228 driver
5 * Note : architecturally, the T100 and T130 are different and won't 3 * Note : architecturally, the T100 and T130 are different and won't
@@ -394,8 +392,6 @@ static struct scsi_host_template driver_template = {
394 .detect = t128_detect, 392 .detect = t128_detect,
395 .release = t128_release, 393 .release = t128_release,
396 .proc_name = "t128", 394 .proc_name = "t128",
397 .show_info = t128_show_info,
398 .write_info = t128_write_info,
399 .info = t128_info, 395 .info = t128_info,
400 .queuecommand = t128_queue_command, 396 .queuecommand = t128_queue_command,
401 .eh_abort_handler = t128_abort, 397 .eh_abort_handler = t128_abort,
diff --git a/drivers/scsi/t128.h b/drivers/scsi/t128.h
index dd16d85497e1..c369b50de746 100644
--- a/drivers/scsi/t128.h
+++ b/drivers/scsi/t128.h
@@ -83,8 +83,6 @@
83#define NCR5380_abort t128_abort 83#define NCR5380_abort t128_abort
84#define NCR5380_bus_reset t128_bus_reset 84#define NCR5380_bus_reset t128_bus_reset
85#define NCR5380_info t128_info 85#define NCR5380_info t128_info
86#define NCR5380_show_info t128_show_info
87#define NCR5380_write_info t128_write_info
88 86
89/* 15 14 12 10 7 5 3 87/* 15 14 12 10 7 5 3
90 1101 0100 1010 1000 */ 88 1101 0100 1010 1000 */