07 Jan, 2016

9 commits

  • Because of the rudimentary design of the chip, it is necessary to poll the
    SCSI bus signals during PIO and this tends to hog the CPU. The driver will
    accept new commands while others execute, and this causes a soft lockup
    because the workqueue item will not terminate until the issue queue is
    emptied.

    When exercising dmx3191d using sequential IO from dd, the driver is sent
    512 KiB WRITE commands and 128 KiB READs. For a PIO transfer, the rate is
    is only about 300 KiB/s, so these are long-running commands. And although
    PDMA may run at several MiB/s, interrupts are disabled for the duration
    of the transfer.

    Fix the unresponsiveness and soft lockup issues by calling cond_resched()
    after each command is completed and by limiting max_sectors for drivers
    that don't implement real DMA.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Ondrej Zary
    Tested-by: Michael Schmitz
    Signed-off-by: Martin K. Petersen

    Finn Thain
     
  • 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

    Finn Thain
     
  • 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

    Finn Thain
     
  • Remove unused includes (stat.h, signal.h, proc_fs.h) and move includes
    needed by the core drivers into the common header (delay.h etc).

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Ondrej Zary
    Tested-by: Michael Schmitz
    Signed-off-by: Martin K. Petersen

    Finn Thain
     
  • Follow the example of the atari_NCR5380.c core driver and adopt the
    NCR5380_dma_xfer_len() hook. Implement NCR5380_dma_xfer_len() for dtc.c
    and g_NCR5380.c to take care of the limitations of these cards. Keep the
    default for drivers using PSEUDO_DMA.

    Eliminate the unused macro LIMIT_TRANSFERSIZE.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Ondrej Zary
    Tested-by: Michael Schmitz
    Signed-off-by: Martin K. Petersen

    Finn Thain
     
  • 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

    Finn Thain
     
  • Commit 8b801ead3d7a ("[ARM] rpc: update Acorn SCSI drivers to modern ecard
    interfaces") neglected to remove a request_region() call in cumana_1.c.

    Commit eda32612f7b2 ("[PATCH] give all LLDD driver a ->release method") in
    history/history.git added some pointless release_region() calls in dtc.c,
    pas16.c and t128.c.

    Fix these issues.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Finn Thain
     
  • 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
    Reviewed-by: Hannes Reinecke
    Tested-by: Ondrej Zary
    Signed-off-by: Martin K. Petersen

    Finn Thain
     
  • 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
    Reviewed-by: Hannes Reinecke
    Tested-by: Ondrej Zary
    Signed-off-by: Martin K. Petersen

    Finn Thain
     

01 Jun, 2015

1 commit


03 Feb, 2015

1 commit


20 Nov, 2014

7 commits

  • 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

    Finn Thain
     
  • 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

    Finn Thain
     
  • 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
    Reviewed-by: Hannes Reinecke
    Tested-by: Michael Schmitz
    Signed-off-by: Christoph Hellwig

    Finn Thain
     
  • 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

    Finn Thain
     
  • 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

    Finn Thain
     
  • 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

    Finn Thain
     
  • 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

    Finn Thain
     

12 Nov, 2014

5 commits

  • 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
    Reviewed-by: Robert Elliott
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     
  • print_opcode_name() was only ever called with a '0' argument
    from LLDDs and ULDs which were _not_ supporting variable length
    CDBs, so the 'if' clause was never triggered.
    Instead we should be using the last argument to specify
    the cdb length to avoid accidental overflow when reading
    the cdb buffer.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Robert Elliott
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     
  • Update logging messages to use dev_printk() variants for correct
    device annotations.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Robert Elliott
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     
  • fas216 returns DID_BAD_TARGET for an incomplete data
    transfer. The midlayer uses DID_BAD_TARGET to signal
    a non-existing or not reachable target. So we should
    rather be using DID_ERROR here.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Robert Elliott
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     
  • Update acornscsi to use scsi_print_command() instead of the
    underscore version and use scmd_printk() in acornscsi_done().
    This will add correct device annotations in the resulting message.
    And we should be using set_host_byte() for setting the
    final result.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Robert Elliott
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     

18 Jul, 2014

1 commit

  • 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
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Ewan Milne
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     

29 May, 2014

1 commit

  • The acornscsi driver was added in v2.1.88. It has always #undef-ed
    CONFIG_SCSI_ACORNSCSI_LINK near the top of acornscsi.c. And, just to be
    sure, it has also always triggered a preprocessor error if
    CONFIG_SCSI_ACORNSCSI_LINK was still defined. But, as far as I can see,
    it has never even been possible to set SCSI_ACORNSCSI_LINK through
    kconfig, or its predecessors, in the first place.

    Let's remove the code involved.

    Signed-off-by: Paul Bolle
    Acked-by: Russell King
    Acked-by: Hannes Reinecke
    Signed-off-by: Christoph Hellwig

    Paul Bolle
     

28 May, 2014

1 commit


20 Mar, 2014

1 commit


10 Apr, 2013

3 commits


22 Jan, 2013

1 commit

  • The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
    while now and is almost always enabled by default. As agreed during the
    Linux kernel summit, remove it from any "depends on" lines in Kconfigs.

    CC: Russell King
    CC: "James E.J. Bottomley"
    Signed-off-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     

04 Jan, 2013

1 commit

  • 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
    Cc: Adam Radford
    Cc: "James E.J. Bottomley"
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Oct, 2012

1 commit

  • …nel/git/arm/arm-soc into fixes

    A collection of warning fixes on non-ARM code from Arnd Bergmann:

    * 'testing/driver-warnings' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: s3c: mark s3c2440_clk_add as __init_refok
    spi/s3c64xx: use correct dma_transfer_direction type
    pcmcia: sharpsl: don't discard sharpsl_pcmcia_ops
    USB: EHCI: mark ehci_orion_conf_mbus_windows __devinit
    mm/slob: use min_t() to compare ARCH_SLAB_MINALIGN
    SCSI: ARM: make fas216_dumpinfo function conditional
    SCSI: ARM: ncr5380/oak uses no interrupts

    Olof Johansson
     

10 Oct, 2012

2 commits

  • The fas216_dumpinfo function is only used by __fas216_checkmagic,
    which is conditionally compiled, so we should put both functions
    inside of the same #ifdef.

    Without this patch, building rpc_defconfig results in:

    drivers/scsi/arm/fas216.c:182:13: warning: 'fas216_dumpinfo' defined but not used [-Wunused-function]

    Signed-off-by: Arnd Bergmann
    Cc: Russell King
    Cc: "James E.J. Bottomley"
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-scsi@vger.kernel.org

    Arnd Bergmann
     
  • The ncr5380 driver is included by multiple board specific
    drivers, which may or may not use the interrupt handler.
    The oak variant doesn't, and should set the DONT_USE_INTR
    macro.

    Without this patch, building rpc_defconfig results in:

    drivers/scsi/arm/../NCR5380.c:1160:20: warning: 'oakscsi_intr' defined but not used [-Wunused-function]

    Signed-off-by: Arnd Bergmann
    Cc: Russell King
    Cc: "James E.J. Bottomley"
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-scsi@vger.kernel.org

    Arnd Bergmann
     

19 Sep, 2012

1 commit


29 Mar, 2012

2 commits

  • …m/linux/kernel/git/dhowells/linux-asm_system

    Pull "Disintegrate and delete asm/system.h" from David Howells:
    "Here are a bunch of patches to disintegrate asm/system.h into a set of
    separate bits to relieve the problem of circular inclusion
    dependencies.

    I've built all the working defconfigs from all the arches that I can
    and made sure that they don't break.

    The reason for these patches is that I recently encountered a circular
    dependency problem that came about when I produced some patches to
    optimise get_order() by rewriting it to use ilog2().

    This uses bitops - and on the SH arch asm/bitops.h drags in
    asm-generic/get_order.h by a circuituous route involving asm/system.h.

    The main difficulty seems to be asm/system.h. It holds a number of
    low level bits with no/few dependencies that are commonly used (eg.
    memory barriers) and a number of bits with more dependencies that
    aren't used in many places (eg. switch_to()).

    These patches break asm/system.h up into the following core pieces:

    (1) asm/barrier.h

    Move memory barriers here. This already done for MIPS and Alpha.

    (2) asm/switch_to.h

    Move switch_to() and related stuff here.

    (3) asm/exec.h

    Move arch_align_stack() here. Other process execution related bits
    could perhaps go here from asm/processor.h.

    (4) asm/cmpxchg.h

    Move xchg() and cmpxchg() here as they're full word atomic ops and
    frequently used by atomic_xchg() and atomic_cmpxchg().

    (5) asm/bug.h

    Move die() and related bits.

    (6) asm/auxvec.h

    Move AT_VECTOR_SIZE_ARCH here.

    Other arch headers are created as needed on a per-arch basis."

    Fixed up some conflicts from other header file cleanups and moving code
    around that has happened in the meantime, so David's testing is somewhat
    weakened by that. We'll find out anything that got broken and fix it..

    * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits)
    Delete all instances of asm/system.h
    Remove all #inclusions of asm/system.h
    Add #includes needed to permit the removal of asm/system.h
    Move all declarations of free_initmem() to linux/mm.h
    Disintegrate asm/system.h for OpenRISC
    Split arch_align_stack() out from asm-generic/system.h
    Split the switch_to() wrapper out of asm-generic/system.h
    Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h
    Create asm-generic/barrier.h
    Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h
    Disintegrate asm/system.h for Xtensa
    Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt]
    Disintegrate asm/system.h for Tile
    Disintegrate asm/system.h for Sparc
    Disintegrate asm/system.h for SH
    Disintegrate asm/system.h for Score
    Disintegrate asm/system.h for S390
    Disintegrate asm/system.h for PowerPC
    Disintegrate asm/system.h for PA-RISC
    Disintegrate asm/system.h for MN10300
    ...

    Linus Torvalds
     
  • 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

    David Howells
     

24 Mar, 2012

1 commit


31 Mar, 2011

1 commit