diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2014-11-12 16:11:59 +1100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-20 09:11:09 +0100 |
commit | a9c2dc43c14cc9e9333d451bc4db8a827a695332 (patch) | |
tree | 70e239cb8ebf6f09fa6d4c37cb3cc2884a37d144 /drivers/scsi/NCR5380.c | |
parent | 8c32513bd395dc5d382e4883097482567cf8bbc5 (diff) |
ncr5380: Move static PDMA spin counters to host data
Static variables from dtc.c and pas16.c should not appear in the core
NCR5380.c driver. Aside from being a layering issue this worsens the
divergence between the three core driver variants (atari_NCR5380.c and
sun3_NCR5380.c don't support PSEUDO_DMA) and it can mean multiple hosts
share the same counters.
Fix this by making the pseudo DMA spin counters in the core more generic.
This also avoids the abuse of the {DTC,PAS16}_PUBLIC_RELEASE macros, so
they can be removed.
oak.c doesn't use PDMA and hence it doesn't use the counters and hence it
needs no write_info() method. Remove it.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r-- | drivers/scsi/NCR5380.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index f1792bb80e70..77e8908f644e 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -692,6 +692,7 @@ static void NCR5380_print_status(struct Scsi_Host *instance) NCR5380_dprint_phase(NDEBUG_ANY, instance); } +#ifdef PSEUDO_DMA /******************************************/ /* * /proc/scsi/[dtc pas16 t128 generic]/[0-ASC_NUM_BOARD_SUPPORTED] @@ -709,14 +710,13 @@ static void NCR5380_print_status(struct Scsi_Host *instance) static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance, char *buffer, int length) { -#ifdef DTC_PUBLIC_RELEASE - dtc_wmaxi = dtc_maxi = 0; -#endif -#ifdef PAS16_PUBLIC_RELEASE - pas_wmaxi = pas_maxi = 0; -#endif - return (-ENOSYS); /* Currently this is a no-op */ + struct NCR5380_hostdata *hostdata = shost_priv(instance); + + hostdata->spin_max_r = 0; + hostdata->spin_max_w = 0; + return 0; } +#endif #undef SPRINTF #define SPRINTF(args...) seq_printf(m, ## args) @@ -751,11 +751,9 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m, SPRINTF("PAS16 release=%d", PAS16_PUBLIC_RELEASE); #endif -#ifdef DTC_PUBLIC_RELEASE - SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n", dtc_wmaxi, dtc_maxi); -#endif -#ifdef PAS16_PUBLIC_RELEASE - SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n", pas_wmaxi, pas_maxi); +#ifdef PSEUDO_DMA + SPRINTF("Highwater I/O busy spin counts: write %d, read %d\n", + hostdata->spin_max_w, hostdata->spin_max_r); #endif spin_lock_irq(instance->host_lock); if (!hostdata->connected) |