31 Mar, 2011

1 commit


23 Dec, 2010

1 commit


17 Nov, 2010

1 commit

  • 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
    Acked-by: James Bottomley
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

02 Nov, 2010

1 commit

  • "gadget", "through", "command", "maintain", "maintain", "controller", "address",
    "between", "initiali[zs]e", "instead", "function", "select", "already",
    "equal", "access", "management", "hierarchy", "registration", "interest",
    "relative", "memory", "offset", "already",

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Jiri Kosina

    Uwe Kleine-König
     

03 Sep, 2010

1 commit


16 Dec, 2009

1 commit


04 Dec, 2009

1 commit

  • That is "success", "unknown", "through", "performance", "[re|un]mapping"
    , "access", "default", "reasonable", "[con]currently", "temperature"
    , "channel", "[un]used", "application", "example","hierarchy", "therefore"
    , "[over|under]flow", "contiguous", "threshold", "enough" and others.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Jiri Kosina

    André Goddard Rosa
     

22 Jun, 2009

1 commit


21 May, 2009

2 commits

  • Make the sym53c8xx_2 driver slave_alloc/destroy less unsafe. References
    to the destroyed LCB are cleared from the target structure (instead of
    leaving a dangling pointer), and when the last LCB for the target is
    destroyed the reference to the upper layer target data is cleared. The
    host lock is used to prevent a race with the interrupt handler. Also
    user commands are prevented for targets with all LCBs destroyed.

    Signed-off-by: Aaro Koskinen
    Tested-by: Tony Battersby
    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Aaro Koskinen
     
  • (Resent with proper formatting)

    Fix for the sym53c8xx_2 driver to initialize lun's to_clear flag after
    a bus reset (a failed clear can trigger a bus reset and it should not
    be attemped again after that).

    Signed-off-by: Aaro Koskinen
    Tested-by: Tony Battersby
    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Aaro Koskinen
     

07 Apr, 2009

3 commits


03 Apr, 2009

1 commit


13 Mar, 2009

8 commits

  • sym53c8xx prints a negotiation message after every check condition.
    This can add up to a lot of messages for removable-medium devices
    (CD-ROM, tape drives, etc.) that are being polled, since they return
    check condition when no medium is present. This patch suppresses the
    negotiation message if it would be the same as the last one printed.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • sym53c8xx uses a command queue depth of 2 for untagged devices,
    without good reason. This _mostly_ seems to work ok, but it has
    caused me some subtle problems. For example, I have an application
    where one thread sends write commands to a tape drive, and another
    thread sends log sense polling commands. With a queue depth of
    2, the polling commands end up being starved for long periods of
    time while multiple write commands are serviced (this may also be
    related to the fact the the sg driver queues commands in LIFO order).
    This problem is fixed by changing the queue depth to 1 for untagged
    devices. I have tested this change extensively with many different
    tape drives, medium changers, and disk drives (disk drives of course
    use tagged commands and are therefore unaffected by this patch).

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • sym_init_device() doesn't check if pci_iomap() fails. It also tries
    to map device RAM without first checking FE_RAM.

    1) Move some initialization from sym_init_device() to the top of
    sym2_probe().
    2) Rename sym_init_device() to sym_iomap_device().
    3) Call sym_iomap_device() after sym_check_supported() instead of
    before so that device->chip.features will be set.
    4) Check FE_RAM in sym_iomap_device() before mapping RAM.
    5) If sym_iomap_device() cannot map registers, then abort.
    6) If sym_iomap_device() cannot map RAM, then fall back to not using
    RAM and continue.
    7) Remove the check for FE_RAM in sym_attach() since dev->ram_base
    is now always set correctly.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • During sym2_probe(), sym_init_device() does pci_iomap(), but there is
    no corresponding pci_iounmap() if an error occurs before sym_attach()
    copies sym_device::s.{ioaddr,ramaddr} to np.
    1) Add the sym_iounmap_device() function.
    2) Call sym_iounmap_device() if an error occurs between
    sym_init_device() and the time sym_attach() allocates np.
    3) Make sym_attach() copy sym_device::s.{ioaddr,ramaddr} to np before
    calling any function that can fail so that sym_free_resources()
    will do the unmap instead of sym_iounmap_device().

    Also fixed by this patch:
    During sym2_probe(), if sym_check_raid() returns nonzero, then
    pci_release_regions() is never called.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • If sym_attach() gets an error at or before request_irq(), then
    sym_free_resources() will call free_irq() for an unregistered
    interrupt handler.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • If sym_attach() fails to allocate np, the error path will dereference
    a NULL pointer for printk.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • This patch fixes two bugs:

    1) rmmod sym53c8xx uses shost after freeing it with
    scsi_put_host(shost).

    2) insmod sym53c8xx doesn't call scsi_put_host(shost) if
    scsi_add_host() fails, causing a memory leak on the error path.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • (The patch updated based on testing and comments from Tony Battersby.)

    Change the sym53c8xx_2 driver negotiation logic so that the driver will
    tolerate better device removals. Negotiation message(s) will be sent
    with every INQUIRY and REQUEST SENSE command, and whenever there is a
    change in goals or when the device reports check condition.

    The patch was made specifically to address the case where you hotswap
    the disk using remove-single-device/add-single-device commands through
    /proc/scsi/scsi. Without the patch the driver keeps using old transfer
    parameters even though the target is reset and reports check condition,
    so the data transfer of the very first INQUIRY will fail.

    Signed-off-by: Aaro Koskinen
    Tested-by: Tony Battersby
    Signed-off-by: James Bottomley

    Aaro Koskinen
     

09 Oct, 2008

1 commit

  • Right now SCSI and others do their own command timeout handling.
    Move those bits to the block layer.

    Instead of having a timer per command, we try to be a bit more clever
    and simply have one per-queue. This avoids the overhead of having to
    tear down and setup a timer for each command, so it will result in a lot
    less timer fiddling.

    Signed-off-by: Mike Anderson
    Signed-off-by: Jens Axboe

    Jens Axboe
     

27 Jul, 2008

1 commit

  • This patch frees the luntbl dma area in sym_hcb_free if allocated.
    Since the luntbl is part of a larger dma coherent area not freeing the
    luntbl kept a 64k dma coherent area previous allocated through
    dma_alloc_coherent allocated. This prevented a DLPAR remove IO
    operation from completing successfully.

    Signed-off-by: Mike Anderson
    Cc: Matthew Wilcox
    Signed-off-by: James Bottomley

    Mike Anderson
     

12 Jul, 2008

1 commit


29 Apr, 2008

1 commit

  • drivers/scsi/aic7xxx/aic7770_osm.c:53:58: warning: Using plain integer as NULL pointer
    drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:355:47: warning: Using plain integer as NULL pointer
    drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:372:55: warning: Using plain integer as NULL pointer
    drivers/scsi/aha152x.c:997:28: warning: Using plain integer as NULL pointer
    drivers/scsi/aha152x.c:1003:28: warning: Using plain integer as NULL pointer
    drivers/scsi/aha152x.c:1165:46: warning: Using plain integer as NULL pointer
    drivers/scsi/fdomain.c:1446:40: warning: Using plain integer as NULL pointer
    drivers/scsi/sym53c8xx_2/sym_hipd.c:1650:51: warning: Using plain integer as NULL pointer
    drivers/scsi/sym53c8xx_2/sym_hipd.c:3171:42: warning: Using plain integer as NULL pointer
    drivers/scsi/sym53c8xx_2/sym_hipd.c:5732:52: warning: Using plain integer as NULL pointer
    drivers/scsi/ncr53c8xx.c:8189:31: warning: Using plain integer as NULL pointer
    drivers/scsi/ncr53c8xx.c:8225:34: warning: Using plain integer as NULL pointer
    drivers/scsi/dpt_i2o.c:156:32: warning: Using plain integer as NULL pointer
    drivers/scsi/ultrastor.c:954:42: warning: Using plain integer as NULL pointer
    drivers/scsi/ultrastor.c:1104:18: warning: Using plain integer as NULL pointer

    Signed-off-by: Harvey Harrison
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     

08 Feb, 2008

1 commit

  • This patch fixes the calculation of the data transfer residual for the
    case of a command that is supposed to transfer an odd number of bytes on
    a wide bus but transfers nothing instead.

    Signed-off-by: Tony Battersby
    Cc: Matthew Wilcox
    Signed-off-by: James Bottomley

    Tony Battersby
     

31 Jan, 2008

2 commits

  • With the sg table code, every SCSI driver is now either chain capable
    or broken (or has sg_tablesize set so chaining is never activated), so
    there's no need to have a check in the host template.

    Also tidy up the code by moving the scatterlist size defines into the
    SCSI includes and permit the last entry of the scatterlist pools not
    to be a power of two.
    Signed-off-by: James Bottomley

    James Bottomley
     
  • On a big powerpc box I got the following oops with 2.6.24-git2:

    sym0: rev 0x1 at pci 0000:d0:01.0 irq 215
    sym0: No NVRAM, ID 7, Fast-80, LVD, parity checking
    sym0: SCSI BUS has been reset.
    scsi0 : sym-2.2.3
    target0:0:8: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 31)
    scsi 0:0:8:0: Direct-Access IBM ST318305LC C509 PQ: 0
    ANSI: 3
    target0:0:8: tagged command queuing enabled, command queue depth 16.
    target0:0:8: Beginning Domain Validation
    target0:0:8: asynchronous
    target0:0:8: wide asynchronous
    target0:0:8: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 31)
    target0:0:8: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 31)
    Unable to handle kernel paging request for data at address 0x00000000
    Faulting instruction address: 0xc000000000038460
    cpu 0x25: Vector: 300 (Data Access) at [c00000000f567840]
    pc: c000000000038460: .memcpy+0x60/0x280
    lr: d000000000050280: .sym_set_cam_result_error+0xfc/0x1e0 [sym53c8xx]
    sp: c00000000f567ac0
    msr: 8000000000009032
    dar: 0
    dsisr: 42000000
    current = 0xc000006d1e0af0a0
    paca = 0xc0000000004afc00
    pid = 0, comm = swapper
    enter ? for help
    [link register ] d000000000050280
    .sym_set_cam_result_error+0xfc/0x1e0 [sym53c8xx]
    [c00000000f567ac0] c00000000f567b80 (unreliable)
    [c00000000f567b80] d0000000000552b8 .sym_complete_error+0x12c/0x1bc [sym53c8xx]
    [c00000000f567c20] d0000000000561a4 .sym_int_sir+0xaa4/0x1718 [sym53c8xx]
    [c00000000f567d00] d000000000057e8c .sym_interrupt+0x4e4/0x6ec [sym53c8xx]
    [c00000000f567dc0] d00000000004fdf4 .sym53c8xx_intr+0x6c/0xdc [sym53c8xx]
    [c00000000f567e50] c0000000000a83e0 .handle_IRQ_event+0x7c/0xec
    [c00000000f567ef0] c0000000000aa344 .handle_fasteoi_irq+0x130/0x1f0
    [c00000000f567f90] c00000000002a538 .call_handle_irq+0x1c/0x2c
    [c000004d5e0b3a90] c00000000000c320 .do_IRQ+0x108/0x1d0
    [c000004d5e0b3b20] c000000000004790 hardware_interrupt_entry+0x18/0x1c

    The memset() in sym_set_cam_result_error() would appear to be trashing
    the scsi_cmnd struct instead of clearing sense_buffer.

    Signed-off-by: Nathan Lynch
    Signed-off-by: James Bottomley

    Nathan Lynch
     

24 Jan, 2008

2 commits

  • This replaces sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE in
    several LLDs. It's a preparation for the future changes to remove
    sense_buffer array in scsi_cmnd structure.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     
  • This patch fixes two bugs pointed by James Bottomley:

    1. the if (!sym_data->io_reset). That variable is only ever filled
    by a stack based completion. If we find it non empty it means
    this code has been entered twice and we have a severe problem,
    so that should just become a BUG_ON(sym_data->io_reset).
    2. sym_data->io_reset should be set to NULL before the routine is
    exited otherwise the PCI recovery code could end up completing
    what will be a bogus pointer into the stack.

    Big thanks to James Bottomley for help with the patch.

    Signed-off-by: Krzysztof Helt
    Signed-off-by: James Bottomley

    Krzysztof Helt
     

12 Jan, 2008

1 commit


19 Dec, 2007

2 commits

  • The patch described by the following excerpt from ChangeLog-2.6.24-rc1
    eventually causes a "irq X: nobody cared" error after a while:

    commit 99c9e0a1d6cfe1ba1169a7a81435ee85bc00e4a1
    Author: Matthew Wilcox
    Date: Fri Oct 5 15:55:12 2007 -0400

    [SCSI] sym53c8xx: Make interrupt handler capable of returning IRQ_NONE

    After this happens, the kernel disables the IRQ, causing the SCSI card
    to stop working until the next reboot. The problem is caused by the
    interrupt handler returning IRQ_NONE instead of IRQ_HANDLED after
    handling an interrupt-on-the-fly (INTF) condition. The following patch
    fixes the problem.

    Signed-off-by: Tony Battersby
    Acked-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • The following commit changed the pointer passed to request_irq(), but
    failed to change the pointer passed to free_irq():

    commit 99c9e0a1d6cfe1ba1169a7a81435ee85bc00e4a1
    Author: Matthew Wilcox
    Date: Fri Oct 5 15:55:12 2007 -0400

    [SCSI] sym53c8xx: Make interrupt handler capable of returning IRQ_NONE

    ...

    The result is that free_irq() doesn't actually take any action. This
    patch fixes it.

    Signed-off-by: Tony Battersby
    Acked-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Tony Battersby
     

24 Oct, 2007

6 commits

  • * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (39 commits)
    [SCSI] qla2xxx: Update version number to 8.02.00-k5.
    [SCSI] qla2xxx: Correct display of ISP serial-number.
    [SCSI] qla2xxx: Correct residual-count handling discrepancies during UNDERRUN handling.
    [SCSI] qla2xxx: Make driver (mostly) legacy I/O port free.
    [SCSI] qla2xxx: Fix issue where final flash-segment updates were falling into the slow-path write handler.
    [SCSI] qla2xxx: Handle unaligned sector writes during NVRAM/VPD updates.
    [SCSI] qla2xxx: Defer explicit interrupt-polling processing to init-time scenarios.
    [SCSI] qla2xxx: Resync with latest HBA SSID specification -- 2.2u.
    [SCSI] sym53c8xx: Remove sym_xpt_async_sent_bdr
    [SCSI] sym53c8xx: Remove pci_dev pointer from sym_shcb
    [SCSI] sym53c8xx: Make interrupt handler capable of returning IRQ_NONE
    [SCSI] sym53c8xx: Get rid of IRQ_FMT and IRQ_PRM
    [SCSI] sym53c8xx: Use scmd_printk where appropriate
    [SCSI] sym53c8xx: Simplify DAC DMA handling
    [SCSI] sym53c8xx: Remove tag_ctrl module parameter
    [SCSI] sym53c8xx: Remove io_ws, mmio_ws and ram_ws elements
    [SCSI] sym53c8xx: Remove ->device_id
    [SCSI] sym53c8xx: Use pdev->revision
    [SCSI] sym53c8xx: PCI Error Recovery support
    [SCSI] sym53c8xx: Stop overriding scsi_done
    ...

    Linus Torvalds
     
  • This function just printed a message to the user; move the print to its
    only caller, and turn it into an starget_printk.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     
  • This structure is accessed by the device; the fewer Linux things in it,
    the better. Using the pci_dev pointer from the hostdata requires a lot
    of changes:

    - Pass Scsi_Host to a lot of routines which currently take a sym_hcb.
    - Set the Scsi_Host as the pci drvdata (instead of the sym_hcb)

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     
  • Make sym_interrupt return an irqreturn_t instead of void, and take a
    Scsi_Host instead of a sym_hcb. Pass the Scsi_Host to the interrupt
    handler instead of the sym_hcb. Rename the host_data to sym_data.
    Keep a pci_dev pointer in the sym_data. Rename the Scsi_Host from
    instance to shost.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     
  • These macros aren't needed any more. They used to be used for SPARC.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     
  • If we have a scsi_cmnd, it gives the user more information than the
    sym_name, and maybe the target.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox