12 Apr, 2016
4 commits
-
Now that atari_scsi and sun3_scsi have been converted to use the NCR5380.c
core driver, remove atari_NCR5380.c. Also remove the last vestiges of its
Tagged Command Queueing implementation from the wrapper drivers.The TCQ support in atari_NCR5380.c is abandoned by this patch. It is not
merged into the remaining core driver because,1) atari_scsi defines SUPPORT_TAGS but leaves FLAG_TAGGED_QUEUING disabled
by default, which indicates that it is mostly undesirable.2) I'm told that it doesn't work correctly when enabled.
3) The algorithm does not make use of block layer tags which it will have
to do because scmd->tag is deprecated.4) sun3_scsi doesn't define SUPPORT_TAGS at all, yet the the SUPPORT_TAGS
macro interacts with the CONFIG_SUN3 macro in 'interesting' ways.5) Compile-time configuration with macros like SUPPORT_TAGS caused the
configuration space to explode, leading to untestable and unmaintainable
code that is too hard to reason about.The merge_contiguous_buffers() code is also abandoned. This was unused
by sun3_scsi. Only atari_scsi used it and then only on TT, because only TT
supports scatter/gather. I suspect that the TT would work fine with
ENABLE_CLUSTERING instead. If someone can benchmark the difference then
perhaps the merge_contiguous_buffers() code can be be justified. Until
then we are better off without the extra complexity.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Tested-by: Ondrej Zary
Signed-off-by: Martin K. Petersen -
Add support for the custom Sun 3 DMA logic to the NCR5380.c core driver.
This code is copied from atari_NCR5380.c.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Tested-by: Ondrej Zary
Signed-off-by: Martin K. Petersen -
Only the atari_scsi and sun3_scsi drivers define DMA_MIN_SIZE.
Both drivers also define NCR5380_dma_xfer_len, which means
DMA_MIN_SIZE can be removed from the core driver.This removes another discrepancy between the two core drivers.
Signed-off-by: Finn Thain
Tested-by: Michael Schmitz
Reviewed-by: Hannes Reinecke
Signed-off-by: Martin K. Petersen -
For the NCR5380.c core driver, these macros are never used.
If REAL_DMA were to be defined, compilation would fail.For the atari_NCR5380.c core driver, REAL_DMA is always defined.
Hence these macros are pointless.
Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Tested-by: Ondrej Zary
Signed-off-by: Martin K. Petersen
07 Jan, 2016
7 commits
-
This refactoring removes two global Scsi_Host pointers. This
improves consistency with other ncr5380 drivers. Adopting the same
conventions as the other drivers makes them easier to read.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Martin K. Petersen -
The NCR5380 drivers have a home-spun linked list implementation for
scsi_cmnd structs that uses cmd->host_scribble as a 'next' pointer. Adopt
the standard list_head data structure and list operations instead. Remove
the eh_abort_handler rather than convert it. Doing the conversion would
only be churn because the existing EH handlers don't work and get replaced
in a subsequent patch.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Ondrej Zary
Tested-by: Michael Schmitz
Signed-off-by: Martin K. Petersen -
Some NCR5380 hosts offer a .show_info method to access the contents of
the various command list data structures from a procfs file. When NDEBUG
is set, the same information is sent to the console during EH.The two core drivers, atari_NCR5380.c and NCR5380.c differ here. Because
it is just for debugging, the easiest way to fix the discrepancy is
simply remove this code.The only remaining users of NCR5380_show_info() and NCR5380_write_info()
are drivers that define PSEUDO_DMA. The others have no use for the
.show_info method, so don't initialize it.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Ondrej Zary
Tested-by: Michael Schmitz
Signed-off-by: Martin K. Petersen -
Add missing .module initializer. Use distinct .proc_name values for the
g_NCR5380 and g_NCR5380_mmio modules. Remove pointless CAN_QUEUE and
CMD_PER_LUN override macros. Cleanup whitespace and code style.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Ondrej Zary
Tested-by: Michael Schmitz
Signed-off-by: Martin K. Petersen -
Allocate a work queue that will permit busy waiting and sleeping. This
means NCR5380_init() can potentially fail, so add this error path.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Ondrej Zary
Tested-by: Michael Schmitz
Signed-off-by: Martin K. Petersen -
The atari_NCR5380.c core driver now takes care of bus reset upon driver
initialization if required (same as NCR5380.c). Move the Toshiba CD-ROM
support into the core driver, enabled with a host flag, so that all
NCR5380 drivers can make use of it.Drop the RESET_BOOT macros and the ATARI_SCSI_RESET_BOOT and
ATARI_SCSI_TOSHIBA_DELAY Kconfig symbols, which are now redundant.Remove the atari_scsi_reset_boot(), mac_scsi_reset_boot() and
sun3_scsi_reset_boot() routines. None of this duplicated code is needed
now that all drivers can use NCR5380_maybe_reset_bus().This brings atari_scsi, mac_scsi and sun3_scsi into line with all of the
other NCR5380 drivers.The bus reset may raise an interrupt. That would be new behaviour for
atari_scsi only when CONFIG_ATARI_SCSI_RESET_BOOT=n. The ST DMA interrupt
is not assigned to atari_scsi at this stage, so
CONFIG_ATARI_SCSI_RESET_BOOT=y may well be problematic already.
Regardless, do_reset() now raises and clears the interrupt within
local_irq_save/restore which should avoid problems.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Ondrej Zary
Tested-by: Michael Schmitz
Signed-off-by: Martin K. Petersen -
Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Ondrej Zary
Signed-off-by: Martin K. Petersen
09 Mar, 2015
1 commit
-
This platform_driver does not need to set an owner, it will be populated by
the driver core.Signed-off-by: Wolfram Sang
Signed-off-by: Finn Thain
Signed-off-by: James Bottomley
20 Nov, 2014
16 commits
-
There's no need to run the cmd->done callback for aborted commands. Remove
the old EH code and the RESET_RUN_DONE macro.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
The static variable setup_use_tagged_queuing is declared in mac_scsi.c,
sun3_scsi.c and atari_scsi.c and doesn't belong in the core driver.
None of the other NCR5380 drivers suffer from this layering issue which
makes merging the core drivers more difficult and will likely hinder plans
for future use of platform data to configure the driver.Replace the static variable with a host flag. This way it can be reported
along with the other flags.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
Given the preceding changes to atari_NCR5380.c, this patch should not change
behaviour of the sun3_scsi and sun3_scsi_vme modules.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig -
atari_NCR5380.c enables its IRQ when it is already enabled. Sun3 doesn't
use the ENABLE_IRQ/DISABLE_IRQ cruft. Remove it.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
The #defines in sun3_scsi.h are intended to influence subsequent #includes
in sun3_scsi.c. IMHO, that's too convoluted.Move sun3_scsi.h macro definitions to sun3_scsi.c, consistent with other
NCR5380 drivers.Omit the unused NCR5380_local_declare() and NCR5380_setup() macros.
Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig -
Convert sun3_scsi to platform device and eliminate scsi_register().
Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Acked-by: Geert Uytterhoeven
Signed-off-by: Christoph Hellwig -
Convert Scsi_Cmnd to struct scsi_cmnd and drop the #include "scsi.h".
The sun3_NCR5380.c core driver already uses struct scsi_cmnd so converting
the other core drivers reduces the diff which makes them easier to unify.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
The *_RELEASE macros don't tell me anything. In some cases the version in
the macro contradicts the version in the comments. Anyway, the Linux kernel
version is sufficient information. Remove these macros to improve readability.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
Compile-time override of scsi host defaults is pointless for drivers that
provide module parameters and __setup options for that. Too many macros make
the code hard to read so remove them.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
If the host->info() method is not set, then host->name is used by default.
For atari_scsi, that is exactly the same text. So remove the redundant
info() method. Keep sun3_scsi.c in line with atari_scsi.Some NCR5380 drivers return an empty string from the info() method
(arm/cumana_1.c arm/oak.c mac_scsi.c) while other drivers use the default
(dmx3191d dtc.c g_NCR5380.c pas16.c t128.c).Implement a common info() method to replace a lot of duplicated code which
the various drivers use to announce the same information.This replaces most of the (deprecated) show_info() output and all of the
NCR5380_print_info() output. This also eliminates a bunch of code in
g_NCR5380 which just duplicates functionality in the core driver.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
Oak scsi doesn't use any IRQ, but it sets irq = IRQ_NONE rather than
SCSI_IRQ_NONE. Problem is, the core NCR5380 driver expects SCSI_IRQ_NONE
if it is to issue IDENTIFY commands that prevent target disconnection.
And, as Geert points out, IRQ_NONE is part of enum irqreturn.Other drivers, when they can't get an IRQ or can't use one, will set
host->irq = SCSI_IRQ_NONE (that is, 255). But when they exit they will
attempt to free IRQ 255 which was never requested.Fix these bugs by using NO_IRQ in place of SCSI_IRQ_NONE and IRQ_NONE.
That means IRQ 0 is no longer probed by ISA drivers but I don't think
this matters.Setting IRQ = 255 for these ISA drivers is understood to mean no IRQ.
This remains supported so as to avoid breaking existing ISA setups (which
can be difficult to get working) and because existing documentation
(SANE, TLDP etc) describes this usage for the ISA NCR5380 driver options.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
The LIMIT_TRANSFERSIZE, PSEUDO_DMA, PARITY and UNSAFE options are all
documented in the core drivers where they are used. The same goes for the
chip databook reference. Remove the duplicate comments.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig -
Every NCR5380 driver sets AUTOSENSE so it need not be optional (and the
mid-layer expects it). Remove this redundant macro to improve readability.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
Add missing static qualifiers and remove the now pointless prototypes. The
NCR5380_* prototypes are all declared in NCR5380.h and renamed using macros.
Further declarations are redundant (some are completely unused). Remove
them.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
Some macros are never evaluated (i.e. FOO, USLEEP, SCSI2 and USE_WRAPPER;
and in some drivers, NCR5380_intr and NCR5380_proc_info). DRIVER_SETUP
serves no purpose anymore. Remove these macro definitions.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Tested-by: Michael Schmitz
Signed-off-by: Christoph Hellwig -
Remove unused fields from hostdata structs declared with the
NCR5380_implementation_fields macro.Signed-off-by: Finn Thain
Reviewed-by: Hannes Reinecke
Signed-off-by: Christoph Hellwig
28 May, 2014
5 commits
-
The sun3 drivers suffer from a whole bunch of duplicated code. Fix this
by following the g_NCR5380_mmio example. (Notionally, sun3_scsi relates to
sun3_scsi_vme in the same way that g_NCR5380 relates to g_NCR5380_mmio.)Dead code is also removed: we now have working debug macros so
SUN3_SCSI_DEBUG is undesirable. Dead code within #ifdef OLD_DMA is also
dropped, consistent with sun3_scsi_vme.c.Signed-off-by: Finn Thain
Acked-by: Sam Creasey
Signed-off-by: Christoph Hellwig -
Move the #include "NCR5380.h" out of the sun3_scsi.h header file and into
the driver .c files, like all the other NCR5380 drivers in the tree.This improves uniformity and reduces the depth of nested includes. The
sequence of #include's, #define's and #if's no longer does my head in.Signed-off-by: Finn Thain
Acked-by: Sam Creasey
Signed-off-by: Christoph Hellwig -
All three NCR5380 core driver implementations share the same NCR5380.h
header file so they need to agree on certain macro definitions.The flag bit used by the NDEBUG_MERGING macro in atari_NCR5380 and
sun3_NCR5380 collides with the bit used by NDEBUG_LISTS.Moreover, NDEBUG_ABORT appears in NCR5380.c so it should be defined in
NCR5380.h rather than in each of the many drivers using that core.An undefined NDEBUG_ABORT macro caused compiler errors and led to dodgy
workarounds in the core driver that can now be removed.
(See commits f566a576bca09de85bf477fc0ab2c8c96405b77b and
185a7a1cd79b9891e3c17abdb103ba1c98d6ca7a.)Move all of the NDEBUG_ABORT, NDEBUG_TAGS and NDEBUG_MERGING macro
definitions into NCR5380.h where all the other NDEBUG macros live.Also, incorrect "#ifdef NDEBUG" becomes "#if NDEBUG" to fix the warning:
drivers/scsi/mac_scsi.c: At top level:
drivers/scsi/NCR5380.c:418: warning: 'NCR5380_print' defined but not used
drivers/scsi/NCR5380.c:459: warning: 'NCR5380_print_phase' defined but not usedThe debugging code is now enabled when NDEBUG != 0.
Signed-off-by: Finn Thain
Acked-by: Sam Creasey
Signed-off-by: Christoph Hellwig -
Only the NCR5380_dprint() macro should invoke the NCR5380_print() function.
That's why NCR5380.c only defines the function #if NDEBUG. Use the standard
macro.Signed-off-by: Finn Thain
Acked-by: Sam Creasey
Signed-off-by: Christoph Hellwig -
Signed-off-by: Finn Thain
Acked-by: Sam Creasey
Signed-off-by: Christoph Hellwig
20 May, 2014
1 commit
-
[Resend of earlier patch - added equivalent changes to sun3 NCR5380 code]
The abort/reset lowlevel return codes had changed with the new
error SCSI handling - update Atari and Sun3 NCR5380 drivers to reflect this.Change reset handling for Atari to clear queues only, do not attempt
to call done() on each command aborted by the reset. The EH code
should do that for us. Queues _must_ be cleared, otherwise
atari_scsi_bus_reset will not release the ST-DMA lock, deadlocking
further error recovery.Update the Sun3 NCR5380 driver as well - the Sun3 driver was
derived from the Atari one. Kudos to Finn Thain for the Sun3 part
and cleaning up the header files. After the header cleanup, the
initio.h include (!) can be dropped from sun3_scsi.h now.Signed-off-by: Michael Schmitz
Signed-off-by: Finn Thain
Acked-by: Sam Creasey
Cc: Geert Uytterhoeven
Cc: James E.J. Bottomley
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Christoph Hellwig
05 May, 2013
1 commit
-
Based on Al's changes to atari_scsi.
Signed-off-by: Geert Uytterhoeven
Signed-off-by: Al Viro
29 Mar, 2012
1 commit
-
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it. Performed with the following command:perl -p -i -e 's!^#\s*include\s*.*\n!!' `grep -Irl '^#\s*include\s*' *`
Signed-off-by: David Howells
30 Jun, 2011
3 commits
-
This fixes a.o.:
drivers/scsi/sun3_scsi.h:225:5: warning: "NDEBUG" is not defined
drivers/scsi/sun3_scsi.h:345:14: warning: "NDEBUG_ABORT" is not defined
drivers/scsi/sun3_scsi.h:351:14: warning: "NDEBUG_TAGS" is not defined
drivers/scsi/sun3_scsi.h:357:14: warning: "NDEBUG_MERGING" is not definedSigned-off-by: Geert Uytterhoeven
Signed-off-by: James Bottomley -
and call it from sun3scsi_release(), cfr. the other NCR5380 drivers.
This fixes:
drivers/scsi/NCR5380.h:303: warning: ‘NCR5380_exit’ declared ‘static’ but never defined
Signed-off-by: Geert Uytterhoeven
Signed-off-by: James Bottomley -
WARNING: vmlinux.o(.text+0x18545c): Section mismatch in reference from the function sun3scsi_detect() to the function .init.text:NCR5380_print_options()
WARNING: vmlinux.o(.text+0x18556c): Section mismatch in reference from the function sun3scsi_detect() to the function .init.text:NCR5380_print_options()
WARNING: vmlinux.o(.text+0x187692): Section mismatch in reference from the function sun3scsi_detect() to the function .init.text:NCR5380_print_options()
WARNING: vmlinux.o(.text+0x187770): Section mismatch in reference from the function sun3scsi_detect() to the function .init.text:NCR5380_print_options()Signed-off-by: Geert Uytterhoeven
Signed-off-by: James Bottomley
08 Aug, 2010
1 commit
-
Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
struct requests. This allows much easier grepping for different request
types instead of unwinding through macros.Signed-off-by: Christoph Hellwig
Signed-off-by: Jens Axboe