13 Nov, 2019

1 commit

  • Since the scsi subsystem adopted the blk-mq API, a host with zero
    sg_tablesize crashes with a NULL pointer dereference.

    blk_queue_max_segments: set to minimum 1
    scsi 0:0:0:0: Direct-Access QEMU QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5
    scsi target0:0:0: Beginning Domain Validation
    scsi target0:0:0: Domain Validation skipping write tests
    scsi target0:0:0: Ending Domain Validation
    blk_queue_max_segments: set to minimum 1
    scsi 0:0:1:0: Direct-Access QEMU QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5
    scsi target0:0:1: Beginning Domain Validation
    scsi target0:0:1: Domain Validation skipping write tests
    scsi target0:0:1: Ending Domain Validation
    blk_queue_max_segments: set to minimum 1
    scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5
    scsi target0:0:2: Beginning Domain Validation
    scsi target0:0:2: Domain Validation skipping write tests
    scsi target0:0:2: Ending Domain Validation
    blk_queue_max_segments: set to minimum 1
    blk_queue_max_segments: set to minimum 1
    blk_queue_max_segments: set to minimum 1
    blk_queue_max_segments: set to minimum 1
    sr 0:0:2:0: Power-on or device reset occurred
    sd 0:0:0:0: Power-on or device reset occurred
    sd 0:0:1:0: Power-on or device reset occurred
    sd 0:0:0:0: [sda] 10485762 512-byte logical blocks: (5.37 GB/5.00 GiB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
    Oops: 00000000
    Modules linked in:
    PC: [] blk_mq_free_request+0x66/0xe2
    SR: 2004 SP: (ptrval) a2: 00874520
    d0: 00000000 d1: 00000000 d2: 009ba800 d3: 00000000
    d4: 00000000 d5: 08000002 a0: 0087be68 a1: 009a81e0
    Process kworker/u2:2 (pid: 15, task=(ptrval))
    Frame format=7 eff addr=0000007a ssw=0505 faddr=0000007a
    wb 1 stat/addr/data: 0000 00000000 00000000
    wb 2 stat/addr/data: 0000 00000000 00000000
    wb 3 stat/addr/data: 0000 0000007a 00000000
    push data: 00000000 00000000 00000000 00000000
    Stack from 0087bd98:
    00000002 00000000 0087be72 009a7820 0087bdb4 001c4f6c 009a7820 0087bdd4
    0024d200 009a7820 0024d0dc 0087be72 009baa00 0087be68 009a5000 0087be7c
    00265d10 009a5000 0087be72 00000003 00000000 00000000 00000000 0087be68
    00000bb8 00000005 00000000 00000000 00000000 00000000 00265c56 00000000
    009ba60c 0036ddf4 00000002 ffffffff 009baa00 009ba600 009a50d6 0087be74
    00227ba0 009baa08 00000001 009baa08 009ba60c 0036ddf4 00000000 00000000
    Call Trace: [] blk_put_request+0xe/0x14
    [] __scsi_execute+0x124/0x174
    [] __scsi_execute+0x0/0x174
    [] sd_revalidate_disk+0xba/0x1f02
    [] sd_revalidate_disk+0x0/0x1f02
    [] strlen+0x0/0x22
    [] device_add+0x3da/0x604
    [] strlen+0x0/0x22
    [] sd_probe+0x30c/0x4b4
    [] process_one_work+0x0/0x402
    [] really_probe+0x226/0x354
    [] driver_probe_device+0xa4/0xf0
    [] process_one_work+0x0/0x402
    [] __driver_attach_async_helper+0x50/0x70
    [] async_run_entry_fn+0x36/0x130
    [] process_one_work+0x144/0x402
    [] worker_thread+0x0/0x570
    [] worker_thread+0xf0/0x570
    [] worker_thread+0x0/0x570
    [] schedule+0x0/0xb8
    [] __init_waitqueue_head+0x0/0x12
    [] kthread+0xc2/0xf6
    [] kthread_parkme+0x0/0x4e
    [] schedule+0x0/0xb8
    [] kthread+0x0/0xf6
    [] ret_from_kernel_thread+0xc/0x14
    Code: 0280 0006 0800 56c0 4400 0280 0000 00ff 0c3a 082b 0006 0013 6706 2042 53a8 00c4 4ab9 0047 3374 6640 202d 000c 670c
    Disabling lock debugging due to kernel taint

    Avoid this by setting sg_tablesize = 1.

    Link: https://lore.kernel.org/r/4567bcae94523b47d6f3b77450ba305823bca479.1572656814.git.fthain@telegraphics.com.au
    Reported-and-tested-by: Michael Schmitz
    Reviewed-by: Michael Schmitz
    References: commit 68ab2d76e4be ("scsi: cxlflash: Set sg_tablesize to 1 instead of SG_NONE")
    Signed-off-by: Finn Thain
    Signed-off-by: Martin K. Petersen

    Finn Thain
     

22 Jan, 2019

2 commits

  • Replace nvram_* functions with static functions in nvram.h. These will
    become wrappers for struct nvram_ops method calls.

    This patch effectively disables existing NVRAM functionality so as to
    allow the rest of the series to be bisected without build failures.
    That functionality is gradually re-implemented in subsequent patches.

    Replace the sole validate-checksum-and-read-byte sequence with a call to
    nvram_read() which will gain the same semantics in subsequent patches.

    Remove unused exports.

    Acked-by: Geert Uytterhoeven
    Signed-off-by: Finn Thain
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     
  • On powerpc, setting CONFIG_NVRAM=n builds a kernel with no NVRAM support.
    Setting CONFIG_NVRAM=m enables the /dev/nvram misc device module without
    enabling NVRAM support in drivers. Setting CONFIG_NVRAM=y enables the
    misc device (built-in) and also enables NVRAM support in drivers.

    m68k shares the valkyriefb driver with powerpc, and since that driver uses
    NVRAM, it is affected by CONFIG_ATARI_SCSI, because of the use of
    "select NVRAM". We can avoid the "select" here, but drivers still have
    to interpret the CONFIG_NVRAM symbol consistently regardless of platform.

    In this patch and the subsequent fbdev driver patch, the convention is
    adopted across all relevant platforms whereby NVRAM functionality gets
    enabled in a given device driver when the nvram misc device is built-in
    or when both drivers are modules.

    Acked-by: Michael Schmitz
    Signed-off-by: Finn Thain
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     

19 Dec, 2018

1 commit

  • The same effects can be achieved by setting the dma_boundary to
    PAGE_SIZE - 1 and the max_segment_size to PAGE_SIZE, so shift those
    settings into the drivers. Note that in many cases the setting might
    be bogus, but this keeps the status quo.

    [mkp: fix myrs and myrb]

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Christoph Hellwig
     

26 Aug, 2017

1 commit


13 Jun, 2017

1 commit

  • m68k_num_memory is unsuitable to test for the presence of FastRAM on
    CT60 if the kernel is located in FastRAM: in arch/m68k/mm/motorola.c the
    ST-RAM chunk is skipped and m68k_num_memory is decremented in this
    case. m68k_realnum_memory still contains the actual number of RAM chunks
    so use that.

    Signed-off-by: Michael Schmitz
    Tested-by: Christian T. Steigies
    Signed-off-by: Martin K. Petersen

    Michael Schmitz
     

01 Feb, 2017

3 commits

  • The atari_scsi driver should not access Falcon DMA chip registers unless
    it has acquired exclusive access to that chip. If the driver doesn't
    have exclusive access then there's no need for a DMA reset as there are
    no scsi commands in progress.

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

    Finn Thain
     
  • Avoid various warnings from "make C=1" by annotating a couple of
    unlock-then-lock sequences, replacing a zero with NULL and correcting
    some type casts.

    Also avoid a warning from "make W=1" by adding braces.

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

    Finn Thain
     
  • Remove dead code inside #if 0 conditionals.

    Remove the #ifdef __KERNEL__ test, since NCR5380.h has no definitions
    that relate to userspace code.

    Remove two redundant macro definitions which were overlooked in
    commit e9db3198e08b ("sun3_scsi: Adopt NCR5380.c core driver").

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

    Finn Thain
     

09 Nov, 2016

4 commits

  • Apply prototypes to get consistent function signatures for the DMA
    functions implemented in the board-specific drivers. To avoid using
    macros to alter actual parameters, some of those functions are reworked
    slightly.

    This is a step toward the goal of passing the board-specific routines
    to the core driver using an ops struct (as in a platform driver or
    library module).

    This also helps fix some inconsistent types: where the core driver uses
    ints (cmd->SCp.this_residual and hostdata->dma_len) for keeping track of
    transfers, certain board-specific routines used unsigned long.

    While we are fixing these function signatures, pass the hostdata pointer
    to DMA routines instead of a Scsi_Host pointer, for shorter and faster
    code.

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

    Finn Thain
     
  • Avoid the call to NCR5380_poll_politely2() when possible. The call is
    easily short-circuited on the PIO fast path, using the inline wrapper.
    This requires that the NCR5380_read macro be made available before
    any #include "NCR5380.h" so a few declarations have to be moved too.

    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
     
  • For timeout values adopt unsigned long, which is the type of jiffies etc.

    For chip register values and bit masks pass u8, which is the return type
    of readb, inb etc.

    For device register offsets adopt unsigned int, as it is suitable for
    adding to base addresses.

    Pass the NCR5380_hostdata pointer to the board-specific routines instead
    of the Scsi_Host pointer. The board-specific code is concerned with
    hardware and not with SCSI protocol or the mid-layer.

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

    Finn Thain
     
  • This patch fixes an old bug: accesses to device registers from the
    interrupt handler (after reselection, DMA completion etc.) could mess
    up a device register access elsewhere, if the latter takes place outside
    of an irq lock (during selection etc.).

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

    Finn Thain
     

12 Apr, 2016

7 commits

  • The benefit of limiting can_queue to 1 is that atari_scsi shares the
    ST DMA chip more fairly with other drivers (e.g. falcon-ide).

    Unfortunately, this can limit SCSI bus utilization. On systems without
    IDE, atari_scsi should issue SCSI commands whenever it can arbitrate for
    the bus. Make that possible by making can_queue configurable.

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

    Finn Thain
     
  • This setting does not need to be conditional on Atari ST or TT.

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

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

    Finn Thain
     
  • Add support for the Atari ST DMA chip 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

    Finn Thain
     
  • Standardize the DMA setup hooks so that the DMA implementation in
    atari_NCR5380.c can be reconciled with pseudo DMA implementation in
    NCR5380.c.

    Calls to NCR5380_dma_recv_setup() and NCR5380_dma_send_setup() return
    a negative value on failure, zero on PDMA transfer success and a positive
    byte count for DMA setup success.

    This convention is not entirely new, but is now applied consistently.

    Also remove a pointless Status Register access: the *phase assignment is
    redundant because after NCR5380_transfer_dma() returns control to
    NCR5380_information_transfer(), that routine then returns control
    to NCR5380_main(), which means *phase is dead.

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

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

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

    Finn Thain
     

07 Jan, 2016

8 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

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

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

    Finn Thain
     
  • The NVRAM location of this byte is 16, as documented in
    http://toshyp.atari.org/en/004009.html

    This was confirmed by Michael Schmitz, by setting the SCSI host ID
    under EmuTOS and then checking the value in /proc/driver/nvram and
    /dev/nvram under Linux.

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

    Finn Thain
     

09 Mar, 2015

1 commit


20 Nov, 2014

11 commits

  • Unlike NCR5380.c, the atari_NCR5380.c core driver is limited to a single
    instance because co-routine state is stored globally.

    Fix this by removing the static scsi host pointer. For the co-routine,
    obtain this pointer from the work_struct pointer instead. For the interrupt
    handler, obtain it from the dev_id argument.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Michael Schmitz
    Signed-off-by: Christoph Hellwig

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

    Finn Thain
     
  • There is very little difference between the sun3_NCR5380.c core driver
    and atari_NCR5380.c. The former is a fork of the latter.

    Merge the sun3_NCR5380.c core driver into atari_NCR5380.c so that
    sun3_scsi.c can adopt the latter and the former can be deleted.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Michael Schmitz
    Signed-off-by: Christoph Hellwig

    Finn Thain
     
  • Simplify falcon_release_lock_if_possible() by making callers responsible for
    disabling local IRQ's, which they must do anyway to correctly synchronize
    the ST DMA "lock" with core driver data structures. Move this
    synchronization logic to the core driver with which it is tightly coupled.

    Other LLD's like sun3_scsi and mac_scsi that can make use of this core
    driver can just stub out the NCR5380_acquire_dma_irq() and
    NCR5380_release_dma_irq() calls so the compiler will eliminate the
    ST DMA code.

    Remove a redundant local_irq_save/restore pair (irq's are disabled for
    interrupt handlers these days). Revise the locking for
    atari_scsi_bus_reset(): use local_irq_save/restore() instead of
    atari_turnoff/turnon_irq(). There is no guarantee that atari_scsi still
    holds the ST DMA lock during EH, so atari_turnoff/turnon_irq() could
    end up dropping an IDE or floppy interrupt.

    Signed-off-by: Finn Thain
    Tested-by: Michael Schmitz
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Christoph Hellwig

    Finn Thain
     
  • Make the atari_NCR5380.c core driver usable by sun3_scsi, mac_scsi and
    others by moving some of the Falcon-specific code out of the core driver:
    !IS_A_TT, atari_read_overruns and falcon_dont_release. Replace these with
    hostdata variables and flags. FLAG_CHECK_LAST_BYTE_SENT is unused in
    atari_NCR5380.c so don't set it.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Michael Schmitz
    Signed-off-by: Christoph Hellwig

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

    Finn Thain
     
  • The #defines in atari_scsi.h are intended to influence subsequent #includes
    in atari_scsi.c. IMHO, that's too convoluted.

    Remove atari_scsi.h by moving those macro definitions to atari_scsi.c,
    consistent with other NCR5380 drivers.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Michael Schmitz
    Signed-off-by: Christoph Hellwig

    Finn Thain
     
  • Convert atari_scsi to platform device and eliminate scsi_register().

    Validate __setup options later on so that module options are checked as well.

    Remove the comment about the scsi mid-layer disabling the host irq as it
    is no longer true (AFAICT). Also remove the obsolete slow interrupt stuff
    (IRQ_TYPE_SLOW == 0 anyway).

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Michael Schmitz
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Christoph Hellwig

    Finn Thain
     
  • Don't disable irqs when waiting for the ST DMA "lock"; its release may
    require an interrupt.

    Introduce stdma_try_lock() for use in soft irq context. atari_scsi now tells
    the SCSI mid-layer to defer queueing a command if the ST DMA lock is not
    available, as per Michael's patch:
    http://marc.info/?l=linux-m68k&m=139095335824863&w=2

    The falcon_got_lock variable is race prone: we can't disable IRQs while
    waiting to acquire the lock, so after acquiring it there must be some
    interval during which falcon_got_lock remains false. Introduce
    stdma_is_locked_by() to replace falcon_got_lock.

    The falcon_got_lock tests in the EH handlers are incorrect these days. It
    can happen that an EH handler is called after a command completes normally.
    Remove these checks along with falcon_got_lock.

    Also remove the complicated and racy fairness wait queues. If fairness is an
    issue (when SCSI competes with IDE for the ST DMA interrupt), the solution
    is likely to be a lower value for host->can_queue.

    Signed-off-by: Finn Thain
    Reviewed-by: Hannes Reinecke
    Tested-by: Michael Schmitz
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Christoph Hellwig

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

    Finn Thain