- Jan 07, 2016
-
-
Finn Thain authored
NCR5380.c is not compliant with the SCSI-2 standard (at least, not with the draft revision 10L that I have to refer to). The selection algorithm in atari_NCR5380.c is correct, so use that. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
If a target disappears from the SCSI bus, NCR5380_select() may subsequently fail with a time-out. In this situation, scsi_done is called and NCR5380_select() returns 0. Both hostdata->connected and hostdata->selecting are NULL and the main loop should proceed with the next command in the issue queue. Clarify this logic. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
Remove the restart_select and targets_present variables introduced in Linux v1.1.38. The former was used only for a questionable debug printk and the latter "so we can call a select failure a retryable condition". Well, retrying select failure in general is a different problem to a target that doesn't assert BSY. We need to handle these two cases differently; the latter case can be left to the SCSI ML. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
The "failed" label in NCR5380_select() is not helpful. Some failures return 0, others -1. Use return instead of goto to improve clarity and brevity, like atari_NCR5380.c does. Fix the relevant comments. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
Remove the duplicate write to the Select Enable Register that appeared in v1.1.38. Also remove the redundant write to Initiator Command Register prior to calling do_abort(). Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
The aborted flag was introduced in v1.1.38 but never used. Remove it. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
Make use of do_reset() in the bus reset handler in atari_NCR5380.c. The version in NCR5380.c already does so. Keep them in sync. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
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 <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
Merge the bus reset code from NCR5380.c into atari_NCR5380.c. This allows for removal of a lot of duplicated code conditional on the RESET_BOOT macro (in the next patch). The atari_NCR5380.c fork lacks the do_reset() and NCR5380_poll_politely() routines from NCR5380.c, so introduce them. They are indispensible. Keep the two implementations in sync. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Tested-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
Move board-specific code like this, NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE); from the core driver to the board driver. Eliminate the NCR53C400 macro from the core driver. Removal of all macros like this one will be necessary in order to have one core driver that can support all kinds of boards. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
This patch splits the NCR5380_init() function into two parts, similar to the scheme used with atari_NCR5380.c. This avoids two problems. Firstly, NCR5380_init() may perform a bus reset, which would cause the chip to assert IRQ. The chip is unable to mask its bus reset interrupt. Drivers can't call request_irq() before calling NCR5380_init(), because initialization must happen before the interrupt handler executes. If driver initialization causes an interrupt it may be problematic on some platforms. To avoid that, first move the bus reset code into NCR5380_maybe_reset_bus(). Secondly, NCR5380_init() contains some board-specific interrupt setup code for the NCR53C400 that does not belong in the core driver. In moving this code, better not re-order interrupt initialization and bus reset. Again, the solution is to move the bus reset code into NCR5380_maybe_reset_bus(). Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
This macro makes the code cryptic. Remove it. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
The NCR5380_local_declare and NCR5380_setup macros exist to define and initialize a particular local variable, to provide the address of the chip registers needed for the driver's implementation of its NCR5380_read/write register access macros. In cumana_1 and macscsi, these macros generate pointless code like this, struct Scsi_Host *_instance; _instance = instance; In pas16, the use of NCR5380_read/write in pas16_hw_detect() requires that the io_port local variable has been defined and initialized, but the NCR5380_local_declare and NCR5380_setup macros can't be used for that purpose because the Scsi_Host struct has not yet been instantiated. Moreover, these macros were removed from atari_NCR5380.c long ago and now they constitute yet another discrepancy between the two core driver forks. Remove these "optimizations". Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Finn Thain authored
Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Reviewed-by:
Hannes Reinecke <hare@suse.com> Tested-by:
Ondrej Zary <linux@rainbow-software.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
- Mar 09, 2015
-
-
Nicholas Mc Guire authored
Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var). In addition some timing constants that assumed HZ 100 were adjusted to HZ independent settings based on review comments from Michael Schmitz <schmitzmic@gmail.com> and review of the original drivers in 1.0.31 and 2.2.16. Signed-off-by:
Nicholas Mc Guire <hofrat@osadl.org> Acked-by:
Michael Schmitz <schmitzmic@gmail.com> Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Signed-off-by:
James Bottomley <JBottomley@Parallels.com>
-
- Feb 02, 2015
-
-
Rasmus Villemoes authored
Using seq_putc to print a single character saves at least a strlen() call and a memory access, and may also give a small .text reduction. Signed-off-by:
Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by:
Finn Thain <fthain@telegraphics.com.au> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Rasmus Villemoes authored
Using seq_printf to print a simple string is a lot more expensive than it needs to be, since seq_puts exists. Replace seq_printf with seq_puts when possible. Signed-off-by:
Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by:
Finn Thain <fthain@telegraphics.com.au> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Rasmus Villemoes authored
The macro SPRINTF doesn't save a lot of typing or make the code more readable, and depending on a specific identifier (m) in the surrounding scope is generally frowned upon. Nuke it. Signed-off-by:
Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by:
Finn Thain <fthain@telegraphics.com.au> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
- Nov 20, 2014
-
-
Finn Thain authored
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 <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>
-
Finn Thain authored
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 <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>
-
Finn Thain authored
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>
-
Finn Thain authored
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 <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>
-
Finn Thain authored
The NCR5380_STATS option is only enabled by g_NCR5380 yet it adds clutter to all three core drivers. The atari_NCR5380.c and sun3_NCR5380.c core drivers have a slightly different implementation of the NCR5380_STATS option. Out of all ten NCR5380 drivers, only one of them (g_NCR5380) actually has the code to report on the collected stats. Aside from being unreadable, that code seems to be broken because there's no initialization of timebase. sun3_NCR5380.c and atari_NCR5380.c have the timebase initialization but lack the code to report the stats. Remove all of this code to improve readability and reduce divergence between the three core drivers. This patch and the next one completely eliminate the PRINTP and ANDP pre-processor abuse. 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>
-
Finn Thain authored
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 <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>
-
Finn Thain authored
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 <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>
-
Finn Thain authored
Both atari_NCR5380.c and sun3_NCR5380.c core drivers #undef TAG_NONE and then redefine it. But the original definition is unused because NCR5380.c lacks support for tagged queueing. So just define it once. The TAG_NEXT macro only appears in the arguments to NCR5380_select() calls. But that routine doesn't use its tag argument as the tag was already assigned in NCR5380_main(). So remove the unused argument and the macro. 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>
-
Finn Thain authored
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 <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>
-
- Nov 12, 2014
-
-
Hannes Reinecke authored
The .eh_abort_handler needs to return SUCCESS, FAILED, or FAST_IO_FAIL. So fixup all callers to adhere to this requirement. Reviewed-by:
Robert Elliott <elliott@hp.com> Cc: <stable@vger.kernel.org> Signed-off-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Hannes Reinecke authored
Calling scsi_print_command should not be necessary during abort; if the information is required one should enable scsi logging. Signed-off-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Robert Elliott <elliott@hp.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
- Jul 17, 2014
-
-
Hannes Reinecke authored
The SCSI standard defines 64-bit values for LUNs, and large arrays employing large or hierarchical LUN numbers become more and more common. So update the linux SCSI stack to use 64-bit LUN numbers. Signed-off-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Christoph Hellwig <hch@infradead.org> Reviewed-by:
Ewan Milne <emilne@redhat.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
- May 28, 2014
-
-
Finn Thain authored
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 f566a576 and 185a7a1c.) 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 used The debugging code is now enabled when NDEBUG != 0. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Acked-by:
Sam Creasey <sammy@sammy.net> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Finn Thain authored
There are three implementations of the core NCR5380 driver and three sets of debugging macro definitions. And all three implementations use the NCR5380.h header as well. Two of the definitions of the dprintk macro accept a variable argument list whereas the third does not. Standardize on the variable argument list. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Acked-by:
Sam Creasey <sammy@sammy.net> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Finn Thain authored
The change from cmd->target to cmd->device->id was apparently the purpose of commit a7f251228390e87d86c5e3846f99a455517fdd8e in kernel/git/tglx/history.git but some instances have been missed. Also fix the "NDEBUG_LAST_WRITE_SENT" and "NDEBUG_ALL" typo's. Also fix some format strings (%ul becomes %lu) that caused compiler warnings. Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Acked-by:
Sam Creasey <sammy@sammy.net> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
Finn Thain authored
Signed-off-by:
Finn Thain <fthain@telegraphics.com.au> Acked-by:
Sam Creasey <sammy@sammy.net> Signed-off-by:
Christoph Hellwig <hch@lst.de>
-
- Mar 19, 2014
-
-
Michael Opdenacker authored
It's a NOOP since 2.6.35 and it will be removed one day. [jejb: remove from missed arm scsi drivers] Signed-off-by:
Michael Opdenacker <michael.opdenacker@free-electrons.com> Signed-off-by:
James Bottomley <JBottomley@Parallels.com>
-
- Apr 09, 2013
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- Jan 03, 2013
-
-
Greg Kroah-Hartman authored
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Adam Radford <linuxraid@lsi.com> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- Mar 31, 2011
-
-
Lucas De Marchi authored
Fixes generated by 'codespell' and manually reviewed. Signed-off-by:
Lucas De Marchi <lucas.demarchi@profusion.mobi>
-
- Feb 12, 2011
-
-
Tejun Heo authored
Simple conversions to drop flush_scheduled_work() usages in drivers/scsi. More involved ones will be done in separate patches. * NCR5380, megaraid_sas: cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync(). * mpt2sas_scsih: drop unnecessary flush_scheduled_work(). * arcmsr_hba, ipr, pmcraid: flush the used work explicitly instead of using flush_scheduled_work(). Signed-off-by:
Tejun Heo <tj@kernel.org> Signed-off-by:
James Bottomley <James.Bottomley@suse.de>
-
- Nov 16, 2010
-
-
Jeff Garzik authored
Move the mid-layer's ->queuecommand() invocation from being locked with the host lock to being unlocked to facilitate speeding up the critical path for drivers who don't need this lock taken anyway. The patch below presents a simple SCSI host lock push-down as an equivalent transformation. No locking or other behavior should change with this patch. All existing bugs and locking orders are preserved. Additionally, add one parameter to queuecommand, struct Scsi_Host * and remove one parameter from queuecommand, void (*done)(struct scsi_cmnd *) Scsi_Host* is a convenient pointer that most host drivers need anyway, and 'done' is redundant to struct scsi_cmnd->scsi_done. Minimal code disturbance was attempted with this change. Most drivers needed only two one-line modifications for their host lock push-down. Signed-off-by:
Jeff Garzik <jgarzik@redhat.com> Acked-by:
James Bottomley <James.Bottomley@suse.de> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-