08 May, 2008

2 commits

  • This message appears on modprobe/rmmod/modprobe of the driver. It's
    caused because if the driver has no instances, it returns an error
    from gdth_init, which causes the module to fail to load.
    Unfortunately, the module's pci driver is still registered at this
    point.

    Fix this by making gdth behave like a modern driver and insert even if
    it doesn't find any instances (in case of hot plug or software driven
    binding).

    Signed-off-by: James Bottomley

    James Bottomley
     
  • The global timer handling is problematic in that if someone unbinds a
    PCI gdth instance, the BUG_ON() in the timer will cause a panic.

    Fix this by making the timer start and stop depending on whether there
    are instances present. This should also permit binding and unbinding
    to work.

    Signed-off-by: James Bottomley

    James Bottomley
     

02 May, 2008

1 commit

  • - struct scsi_cmnd had a 16 bytes command buffer of its own.
    This is an unnecessary duplication and copy of request's
    cmd. It is probably left overs from the time that scsi_cmnd
    could function without a request attached. So clean that up.

    - Once above is done, few places, apart from scsi-ml, needed
    adjustments due to changing the data type of scsi_cmnd->cmnd.

    - Lots of drivers still use MAX_COMMAND_SIZE. So I have left
    that #define but equate it to BLK_MAX_CDB. The way I see it
    and is reflected in the patch below is.
    MAX_COMMAND_SIZE - means: The longest fixed-length (*) SCSI CDB
    as per the SCSI standard and is not related
    to the implementation.
    BLK_MAX_CDB. - The allocated space at the request level

    - I have audit all ISA drivers and made sure none use ->cmnd in a DMA
    Operation. Same audit was done by Andi Kleen.

    (*)fixed-length here means commands that their size can be determined
    by their opcode and the CDB does not carry a length specifier, (unlike
    the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly
    true and the SCSI standard also defines extended commands and
    vendor specific commands that can be bigger than 16 bytes. The kernel
    will support these using the same infrastructure used for VARLEN CDB's.
    So in effect MAX_COMMAND_SIZE means the maximum size command
    scsi-ml supports without specifying a cmd_len by ULD's

    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

08 Apr, 2008

3 commits

  • These are no longer necessary.

    Signed-off-by: Boaz Harrosh
    Tested-by: Joerg Dorchain:
    Tested-by: Stefan Priebe
    Tested-by: Jon Chelton
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • - remove PCI device sort, which greatly simplifies PCI probe,
    permitting direct, per-HBA function calls rather than an indirect
    route to the same end result.

    - remove need for pcistr[]

    Signed-off-by: Jeff Garzik
    Signed-off-by: James Bottomley

    Jeff Garzik
     
  • - Reduce uses of gdth_pci_str::pdev, preferring a local variable
    (or function arg) 'pdev' instead.

    - Reduce uses of gdth_pcistr array, preferring local variable
    (or function arg) 'pcistr' instead.

    - Eliminate lone use of gdth_pci_str::irq, using equivalent
    pdev->irq instead

    - Eliminate assign-only gdth_pci_str::io_mm

    Note: If the indentation seems weird, that's because a line was
    converted from spaces to tabs, when it was modified.

    Signed-off-by: Jeff Garzik
    Signed-off-by: James Bottomley

    Jeff Garzik
     

15 Mar, 2008

1 commit


28 Feb, 2008

2 commits

  • The recent patch named:
    [SCSI] gdth: !use_sg cleanup and use of scsi accessors

    has done a bad job in handling internal commands issued by gdth_execute().

    Internal commands are issued with device gdth_cmd_str ready made directly
    to the card, without any mapping or translations of scsi commands. So here
    I added a gdth_cmd_str pointer to the gdth_cmndinfo private structure which
    is then copied directly to host.

    following this patch is a cleanup that removes the home cooked accessors
    and reverts them to regular scsi_cmnd accessors. Since they are not used
    anymore. After review maybe the 2 patches should be squashed together.

    FIXME: There is still a problem with gdth_get_info(). as reported there
    is a WARN_ON trigerd in dma_free_coherent() when doing:
    $ cat /proc/sys/gdth/0

    Signed-off-by: Boaz Harrosh
    Tested-by: Joerg Dorchain:
    Tested-by: Stefan Priebe
    Tested-by: Jon Chelton
    Cc: Stable Tree
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • gdth_exit would first remove all cards then stop the timer
    and would not sync with the timer function. This caused a crash
    in gdth_timer() when module was unloaded.
    So del_timer_sync the timer before we delete the cards.

    also the reboot notifier function would crash. So clean
    that up and fix the crashes.

    Signed-off-by: Boaz Harrosh
    Tested-by: Joerg Dorchain:
    Tested-by: Stefan Priebe
    Tested-by: Jon Chelton
    Cc: Stable Tree
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

13 Feb, 2008

2 commits

  • Fix compilation warning in gdth.c, which was using the deprecated
    pci_find_device.

    drivers/scsi/gdth.c:645: warning: 'pci_find_device' is deprecated (declared at include/linux/pci.h:495)

    Changing it to use pci_get_device, instead.

    Signed-off-by: Sergio Luis
    Signed-off-by: James Bottomley

    Sergio Luis
     
  • The patch: "gdth: switch to modern scsi host registration"

    missed one simple fact when moving a way from scsi_module.c.
    That is to call scsi_scan_host() on the probed host.
    With this the gdth driver from 2.6.24 is again able to
    see drives and boot.

    Signed-off-by: Boaz Harrosh
    Tested-by: Joerg Dorchain
    Tested-by: Stefan Priebe
    Tested-by: Jon Chelton
    Cc: Stable Tree
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

12 Jan, 2008

1 commit

  • Neither gdth_get_status() nor __gdth_interrupt() need their 'irq' argument,
    so remove it.

    [akpm@linux-foundation.org: coding style fixes]
    Signed-off-by: Jeff Garzik
    Acked-by: Boaz Harrosh
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Jeff Garzik
     

24 Oct, 2007

1 commit

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

23 Oct, 2007

1 commit


18 Oct, 2007

1 commit

  • This patch fixes the following build warnings:

    WARNING: vmlinux.o(.text+0xbcffdb): Section mismatch: reference to .init.text.20:gdth_search_drives (between 'gdth_pci_probe_one' and 'gdth_start_timeout')
    WARNING: vmlinux.o(.text+0xbd0102): Section mismatch: reference to .init.text.20:gdth_enable_int (between 'gdth_pci_probe_one' and 'gdth_start_timeout')

    Signed-off-by: Adrian Bunk
    Signed-off-by: James Bottomley

    Adrian Bunk
     

16 Oct, 2007

1 commit

  • If the gdth module is loaded (or compiled in), the gdth_timeout function
    gets started even if no actual gdth controllers are found b the probing.

    That ends up not only being unnecessary, but also causes a crash due to
    the function blindly just trying to pick the first entry off the
    "gdth_instances" list, and accessing it - which obviously doesn't work
    if the list is empty!

    Noticed by Ingo Molnar.

    Tested-by: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

13 Oct, 2007

18 commits

  • drivers/scsi/gdth.c: In function ‘gdth_search_dev’:
    drivers/scsi/gdth.c:646: warning: ‘pci_find_device’ is deprecated
    (declared at include/linux/pci.h:482)
    drivers/scsi/gdth.c: In function ‘gdth_init_isa’:
    drivers/scsi/gdth.c:857: error: ‘gdth_irq_tab’ undeclared (first use in
    this function)
    drivers/scsi/gdth.c:857: error: (Each undeclared identifier is reported
    only once
    drivers/scsi/gdth.c:857: error: for each function it appears in.)
    drivers/scsi/gdth.c: In function ‘gdth_copy_internal_data’:
    drivers/scsi/gdth.c:2362: warning: unused variable ‘sg’

    Looking into the code I notice that gdth_irq_tab is not declared with
    CONFIG_ISA=y and !CONFIG_EISA.

    The values seem to be same in 2.6.23 (I am not sure why it has been put
    with #ifdefs in -mm) so I have just modified the #ifdef to take care of
    CONFIG_ISA as well.

    Signed-off-by: Dhaval Giani
    Signed-off-by: James Bottomley

    Dhaval Giani
     
  • gdth_execute() will issue an internal, none scsi-standard commands
    onto __gdth_queuecommand(). Since it is not recommended to set
    struct scsi_cmnd IO members in llds, gdth now uses internal IO
    members for IO. In the case of gdth_execute() these members will be
    set properly. In case the command was issued from scsi-ml
    (by gdth_queuecommand) they will be set from scsi IO accessors.

    * define gdth IO accessors and use them throughout the driver.
    * use an sg-of-one in gdth_execute() and fix gdth_special_cmd()
    accordingly.
    * Clean the not use_sg code path and company

    Signed-off-by Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • - Cleanup the rest of the scsi_cmnd->SCp members and move them
    to gdth_cmndinfo:
    SCp.this_residual => priority
    SCp.buffers_residual => timeout
    SCp.Status => status and dma_dir
    SCp.Message => info
    SCp.have_data_in => volatile wait_for_completion
    SCp.sent_command => OpCode
    SCp.phase => phase

    - Two more members will be naturally removed in the !use_sg cleanup

    TODO: What is the meaning of gdth_cmndinfo.phase? (rhetorically)

    Signed-off-by Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • - scsi_cmnd and specifically ->SCp of, where heavily abused
    with internal meaning members and flags. So introduce a new
    struct gdth_cmndinfo, put it on ->host_scribble and define a
    gdth_cmnd_priv() accessor to retrieve it from a scsi_cmnd.

    - The structure now holds two members:
    internal_command - replaces the IS_GDTH_INTERNAL_CMD() croft.
    sense_paddr - which was a 64-bit spanning on 2 32-bit members of SCp.
    More overloaded members from SCp and scsi_cmnd will be moved in a later
    patch (For easy review).

    - Split up gdth_queuecommand to an additional internal_function. The later
    is the one called by gdth_execute(). This will be more evident later in
    the scsi accessors patch, but it also facilitates in the differentiation
    between internal_command and external. And the setup of gdth_cmndinfo of
    each command.

    Signed-off-by Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • - Places like Initialization and Reset that Just loop on all devices can
    use the link list with the list_for_each_entry macro.
    But the io_ctrl from user mode now suffers performance-wise because
    code has to do a sequential search for the requested host number.
    I have isolated this search in a gdth_find_ha(int hanum) member
    for future enhancement if needed.

    Signed-off-by Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • - Use scsi_add_host and friends and track instances ourselves. And
    generally modernize the driver's structure.

    - TODO: Next we can remove the controller table
    - TODO: Fix use of deprecated pci_find_device()

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Christoph Hellwig
     
  • - gdth_get_status() returns a single device interrupt IStatus
    - gdth_interrupt split to __gdth_interrupt() that receives
    flags if is called from gdth_wait().
    - Use dev_id passed from kernel and do not loop on all
    controllers.
    - gdth_wait(), get read of all global variables and call the new
    __gdth_interrupt with these variables on the stack

    Signed-off-by Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • - Based on same patch from Christoph Hellwig

    - Get rid of all the indirection in the Scsi_Host private data and always
    put the gdth_ha_str directly into it.

    - Change all internal functions prototype to recieve an "gdth_ha_str *ha"
    pointer directlly and kill all that redundent access to the "gdth_ctr_tab[]"
    controller-table.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • The virt_ctr option allows to register a new scsi_host for each bus
    on the raid controller. This non-default option makes no sense with
    the current scsi code and prevents cleaning up the host registration,
    so remove it.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Christoph Hellwig
     
  • shuffle scsi_host_template members such that they appear in the
    order in which they are defined in the header. this makes is easier
    to verify when initializers are missing members.

    Signed-off-by: Jeff Garzik
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Jeff Garzik
     
  • They are direct equivalents to {read,write}[bwl].

    Signed-off-by: Jeff Garzik
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Jeff Garzik
     
  • * Remove in-source changelog. It's archived permanently in git and
    various kernel archives, and changelogs should exist purely in git.

    * Remove 2.4.x kernel support. It is an active obstacle to
    modernizing this driver, at this point. This includes killing
    gdth_kcompat.h which is 100% redundant in modern kernels.

    Signed-off-by: Jeff Garzik
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Jeff Garzik
     
  • Split out per-device pci probing and put it under proper CONFIG_PCI.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Christoph Hellwig
     
  • Split eisa probing into it's own helper, and do proper error unwinding.
    Protect EISA probind by the proper CONFIG_EISA symbol.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Christoph Hellwig
     
  • (note: this is ontop of Jeff's pci cleanup patch)

    Split out isa probing into a helper of it's own. Error handling is
    cleaned up, but errors are not propagated yet. Also enclose the isa
    probe under the proper CONFIG_ISA symbol instead of the !IA64 hack.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Christoph Hellwig
     
  • Rather than having internal commands abuse scsi_done to call
    gdth_scsi_done, have all the places that use to call scsi_done directly
    call gdth_scsi_done, which now checks whether the command was internal,
    and calls scsi_done if not.

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

    Matthew Wilcox
     
  • The ->done member was being used to mark commands as being internal.
    I decided to put a magic number in ->underflow instead. I believe this
    to be safe as no current user of ->underflow has any of the bottom 9
    bits set.

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

    Matthew Wilcox
     
  • In NCR_D700, a4000t, aic7xxx_old, bvme6000, dpt_i2o, gdth, lpfc,
    megaraid, mvme16x osst, pluto, qla2xxx, zorro7xx

    Signed-off-by: Mariusz Kozlowski
    Signed-off-by: James Bottomley

    Mariusz Kozlowski
     

31 Jul, 2007

1 commit

  • This patch

    * removes struct members that duplicate pci_dev members
    * replaces ha->stype usage with ha->pdev->device usage where feasible

    Signed-off-by: Jeff Garzik
    Acked-by: Christoph Hellwig
    Acked-by: Achim Leubner
    Signed-off-by: James Bottomley

    Jeff Garzik
     

30 May, 2007

2 commits

  • Fix misspelled "spin_lock_irqrestore" to read "spin_unlock_irqrestore"
    instead.

    Presumably, GDTH_RTC doesn't get used a lot.

    Signed-off-by: Robert P. J. Day
    Acked-by: Achim Leubner
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Robert P. J. Day
     
  • Labeling a variable as __attribute_used__ is ambiguous: it means
    __attribute__((unused)) for gcc =3.4.
    There is no such thing as labeling a variable as __attribute__((used)). We
    assume that we're simply suppressing a warning here if gdthtable[] is declared
    but unreferenced.

    Acked-by: Achim Leubner
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    David Rientjes
     

11 Mar, 2007

1 commit

  • Recent alterations to the gdth_fill_raw_cmd() path no longer set the
    sg_ranz field for zero transfer commands. However, this field is used
    lower down in the function to initialise ha->cmd_len to the size of
    the firmware packet. If this uninitialised field contains a bogus
    value, ha->cmd_len can become much larger than the actual firmware
    packet and end up oopsing in gdth_copy_cmd() as it tries to copy this
    huge packet to the device (usually because it runs into an unallocated
    page).

    The fix is to initialise the sg_ranz field to zero at the start of
    gdth_fill_raw_cmd().

    Signed-off-by: Joerg Dorchain
    Acked-by: "Leubner, Achim"
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Joerg Dorchain
     

15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven