aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR5380.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-11-12 00:11:59 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-20 03:11:09 -0500
commita9c2dc43c14cc9e9333d451bc4db8a827a695332 (patch)
tree70e239cb8ebf6f09fa6d4c37cb3cc2884a37d144 /drivers/scsi/NCR5380.c
parent8c32513bd395dc5d382e4883097482567cf8bbc5 (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.c22
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)
692 NCR5380_dprint_phase(NDEBUG_ANY, instance); 692 NCR5380_dprint_phase(NDEBUG_ANY, instance);
693} 693}
694 694
695#ifdef PSEUDO_DMA
695/******************************************/ 696/******************************************/
696/* 697/*
697 * /proc/scsi/[dtc pas16 t128 generic]/[0-ASC_NUM_BOARD_SUPPORTED] 698 * /proc/scsi/[dtc pas16 t128 generic]/[0-ASC_NUM_BOARD_SUPPORTED]
@@ -709,14 +710,13 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
709static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance, 710static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance,
710 char *buffer, int length) 711 char *buffer, int length)
711{ 712{
712#ifdef DTC_PUBLIC_RELEASE 713 struct NCR5380_hostdata *hostdata = shost_priv(instance);
713 dtc_wmaxi = dtc_maxi = 0; 714
714#endif 715 hostdata->spin_max_r = 0;
715#ifdef PAS16_PUBLIC_RELEASE 716 hostdata->spin_max_w = 0;
716 pas_wmaxi = pas_maxi = 0; 717 return 0;
717#endif
718 return (-ENOSYS); /* Currently this is a no-op */
719} 718}
719#endif
720 720
721#undef SPRINTF 721#undef SPRINTF
722#define SPRINTF(args...) seq_printf(m, ## args) 722#define SPRINTF(args...) seq_printf(m, ## args)
@@ -751,11 +751,9 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
751 SPRINTF("PAS16 release=%d", PAS16_PUBLIC_RELEASE); 751 SPRINTF("PAS16 release=%d", PAS16_PUBLIC_RELEASE);
752#endif 752#endif
753 753
754#ifdef DTC_PUBLIC_RELEASE 754#ifdef PSEUDO_DMA
755 SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n", dtc_wmaxi, dtc_maxi); 755 SPRINTF("Highwater I/O busy spin counts: write %d, read %d\n",
756#endif 756 hostdata->spin_max_w, hostdata->spin_max_r);
757#ifdef PAS16_PUBLIC_RELEASE
758 SPRINTF("Highwater I/O busy_spin_counts -- write: %d read: %d\n", pas_wmaxi, pas_maxi);
759#endif 757#endif
760 spin_lock_irq(instance->host_lock); 758 spin_lock_irq(instance->host_lock);
761 if (!hostdata->connected) 759 if (!hostdata->connected)