15 Feb, 2017

1 commit

  • commit 8af8e1c22f9994bb1849c01d66c24fe23f9bc9a0 upstream.

    commit 78cbccd3bd68 ("aacraid: Fix for KDUMP driver hang")

    caused a problem on older controllers which do not support MSI-x (namely
    ASR3405,ASR3805). This patch conditionalizes the previous patch to
    controllers which support MSI-x

    Fixes: 78cbccd3bd68 ("aacraid: Fix for KDUMP driver hang")
    Reported-by: Arkadiusz Miskiewicz
    Signed-off-by: Dave Carroll
    Reviewed-by: Raghava Aditya Renukunta
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Dave Carroll
     

09 Jan, 2017

1 commit

  • commit ae2aae2421983f6f68eb7c4692624bc43ea50712 upstream.

    Controllers with this PCI ID never shipped outside of
    PMCS/Microsemi. Remove the ID from the aacraid driver. smartpqi is the
    correct driver for these controllers.

    [mkp: patch description]

    Reviewed-by: Scott Teel
    Signed-off-by: Kevin Barnett
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Kevin Barnett
     

08 Oct, 2016

1 commit

  • Pull SCSI updates from James Bottomley:
    "This update includes the usual round of major driver updates (hpsa,
    be2iscsi, hisi_sas, zfcp, cxlflash). There's a new incarnation of hpsa
    called smartpqi for which a driver is added, there's some cleanup work
    of the ibm vscsi target and updates to libfc, plus a whole host of
    minor fixes and updates and finally the removal of several ISA drivers
    which seem not to have been used for years"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (173 commits)
    scsi: mvsas: Mark symbols static where possible
    scsi: pm8001: Mark symbols static where possible
    scsi: arcmsr: Simplify user_len checking
    scsi: fcoe: fix off by one in eth2fc_speed()
    scsi: dtc: remove from tree
    scsi: t128: remove from tree
    scsi: pas16: remove from tree
    scsi: u14-34f: remove from tree
    scsi: ultrastor: remove from tree
    scsi: in2000: remove from tree
    scsi: wd7000: remove from tree
    scsi: scsi_dh_alua: Fix memory leak in alua_rtpg()
    scsi: lpfc: Mark symbols static where possible
    scsi: hpsa: correct call to hpsa_do_reset
    scsi: ufs: Get a TM service response from the correct offset
    scsi: ibmvfc: Fix I/O hang when port is not mapped
    scsi: megaraid_sas: clean function declarations in megaraid_sas_base.c up
    scsi: ipr: Remove redundant messages at adapter init time
    scsi: ipr: Don't log unnecessary 9084 error details
    scsi: smartpqi: raid bypass lba calculation fix
    ...

    Linus Torvalds
     

09 Sep, 2016

1 commit

  • We get 1 warning when building kernel with W=1:
    drivers/scsi/aacraid/src.c:616:5: warning: no previous prototype for 'aac_src_select_comm' [-Wmissing-prototypes]

    In fact, this function is only used in the file in which it is declared
    and don't need a declaration, but can be made static. so this patch
    marks this function with 'static'.

    Signed-off-by: Baoyou Xie
    Acked-by: Arnd Bergmann
    Acked-by: Dave Carroll
    Signed-off-by: Martin K. Petersen

    Baoyou Xie
     

09 Aug, 2016

1 commit

  • In aacraid's ioctl_send_fib() we do two fetches from userspace, one the
    get the fib header's size and one for the fib itself. Later we use the
    size field from the second fetch to further process the fib. If for some
    reason the size from the second fetch is different than from the first
    fix, we may encounter an out-of- bounds access in aac_fib_send(). We
    also check the sender size to insure it is not out of bounds. This was
    reported in https://bugzilla.kernel.org/show_bug.cgi?id=116751 and was
    assigned CVE-2016-6480.

    Reported-by: Pengfei Wang
    Fixes: 7c00ffa31 '[SCSI] 2.6 aacraid: Variable FIB size (updated patch)'
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Carroll
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Dave Carroll
     

13 Jul, 2016

1 commit

  • Use kmemdup when some other buffer is immediately copied into allocated
    region. It replaces call to allocation followed by memcpy, by a single
    call to kmemdup.

    Signed-off-by: Muhammad Falak R Wani
    Reviewed-by: Raghava Aditya Renukunta
    Signed-off-by: Martin K. Petersen

    Muhammad Falak R Wani
     

23 May, 2016

1 commit

  • Only SRC-based adapters support the AifReqEvent function, so there is no
    point in trying to activate it on older, non-SRC based adapters. Doing
    so lead to crashes on older adapters.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Raghava Aditya Renukunta
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     

30 Apr, 2016

10 commits

  • Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • When KDUMP is triggered the driver first talks to the firmware in INTX
    mode, but the adapter firmware is still in MSIX mode. Therefore the first
    driver command hangs since the driver is waiting for an INTX response and
    firmware gives a MSIX response. If when the OS is installed on a RAID
    drive created by the adapter KDUMP will hang since the driver does not
    receive a response in sync mode.

    Fixed by: Change the firmware to INTX mode if it is in MSIX mode before
    sending the first sync command.

    Cc: stable@vger.kernel.org
    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • Currently driver completes double completed or spurious interrupted fibs.
    This is not necessary and causes the SCSI mid layer to issue aborts and
    resets, since completing a fib prematurely might trigger a race condition
    resulting in the driver not calling the scsi_done callback.

    Fixed by removing the call to fib complete.

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • Firmware AIF messages about cache loss and data recovery are being missed
    by the driver since currently they are not captured but rather let go.
    This patch to capture those messages and log them for the user.

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • Typically under error conditions, it is possible for aac_command_thread()
    to miss the wakeup from kthread_stop() and go back to sleep, causing it
    to hang aac_shutdown.

    In the observed scenario, the adapter is not functioning correctly and so
    aac_fib_send() never completes (or time-outs depending on how it was
    called). Shortly after aac_command_thread() starts it performs
    aac_fib_send(SendHostTime) which hangs. When aac_probe_one
    /aac_get_adapter_info send time outs, kthread_stop is called which breaks
    the command thread out of it's hang.

    The code will still go back to sleep in schedule_timeout() without
    checking kthread_should_stop() so it causes aac_probe_one to hang until
    the schedule_timeout() which is 30 minutes.

    Fixed by: Adding another kthread_should_stop() before schedule_timeout()
    Cc: stable@vger.kernel.org
    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • As the firmware for series 6, 7, 8 cards does not support msi, remove it
    in the driver

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • aac_fib_send has a special function case for initial commands during
    driver initialization using wait < 0(pseudo sync mode). In this case,
    the command does not sleep but rather spins checking for timeout.This
    loop is calls cpu_relax() in an attempt to allow other processes/threads
    to use the CPU, but this function does not relinquish the CPU and so the
    command will hog the processor. This was observed in a KDUMP
    "crashkernel" and that prevented the "command thread" (which is
    responsible for completing the command from being timed out) from
    starting because it could not get the CPU.

    Fixed by replacing "cpu_relax()" call with "schedule()"
    Cc: stable@vger.kernel.org
    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • The adapter has to be started after updating the number of MSIX Vectors

    Fixes: ecc479e00db8 (aacraid: Set correct MSIX count for EEH recovery)
    Cc: stable@vger.kernel.org
    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • Suggested-by: Seymour, Shane M
    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • Current driver checks for NULL return from aac_fib_alloc_tag, but it not
    possible for it to return NULL.

    Fixed by: Remove all the checks for NULL returns from aac_fib_alloc_tag

    Suggested-by: Tomas Henzl
    Signed-off-by: Raghava Aditya Renukunta
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     

22 Mar, 2016

1 commit

  • gcc-6 warns about obviously wrong indentation for newly added code in
    aac_slave_configure():

    drivers/scsi/aacraid/linit.c: In function 'aac_slave_configure':
    drivers/scsi/aacraid/linit.c:458:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
    sdev->tagged_supported = 1;
    ^~~~
    drivers/scsi/aacraid/linit.c:455:4: note: ...this 'else' clause, but it is not

    gcc is correct, and evidently this was meant to be within the curly
    braces that should have been there to start with. This patch adds them,
    which avoids the warning and makes it clear what was intended here.

    Nothing changes in behavior because in the 'if' block, the
    sdev->tagged_supported flag is known to be set already.

    Signed-off-by: Arnd Bergmann
    Fixes: 6bf3b630d0a7 ("aacraid: SCSI blk tag support")
    Reviewed-by: Raghava Aditya Renukunta
    Signed-off-by: Martin K. Petersen

    Arnd Bergmann
     

24 Feb, 2016

10 commits

  • Updated diver version to 41052

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • During EEH PCI hotplug activity kernel unloads and loads the driver,
    causing character device to be unregistered(aac_remove_one).When the
    driver is loaded back using aac_probe_one the character device needs
    to be registered again for the AIF management tools to work.

    Fixed by adding code to register character device in aac_probe_one if
    it is unregistered in aac_remove_one.

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Shane Seymour
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • while driver removal is in progress or PCI shutdown is invoked, driver
    kills AIF aacraid thread, but IOCTL requests from the management tools
    re-start AIF thread leading to IOP_RESET.

    Fixed by setting adapter_shutdown flag when PCI shutdown is invoked.

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Shane Seymour
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Tomas Henzl
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • aac_mutex was used to create protect the ioctl path for only the compat
    path, it would be make more sense to place mutex in aac_do_ioctl, which
    is the main ioctl function call that handles all ioctl commands.

    Created new mutex ioctl_mutex in struct aac_dev to protect switch case
    in aac_do_ioctl and removed aac_mutex from aac_cfg_ioctl and
    aac_compat_do_ioctl

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Tomas Henzl
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • Series 7 does not support PCI hot reset used by EEH.

    Enabled fundamental reset only for Series 7

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Tomas Henzl
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • During EEH recovery number of online CPU's might change thereby changing
    the number of MSIx vectors. Since each fib is allocated to a vector,
    changes in the number of vectors causes fib to be sent thru invalid
    vectors.In addition the correct number of MSIx vectors is not updated in
    the INIT struct sent to the controller, when it is reinitialized.

    Fixed by reassigning vectors to fibs based on the updated number of MSIx
    vectors and updating the INIT structure before sending to controller.

    Fixes: MSI-X vector calculation for suspend/resume
    Cc: stable@vger.kernel.org

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Shane Seymour
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • aac_fib_map_free() calls pci_free_consistent() without checking that
    dev->hw_fib_va is not NULL and dev->max_fib_size is not zero.If they are
    indeed NULL/0, this will result in a hang as pci_free_consistent() will
    attempt to invalidate cache for the entire 64-bit address space
    (which would take a very long time).

    Fixed by adding a check to make sure that dev->hw_fib_va and
    dev->max_fib_size are not NULL and 0 respectively.

    Fixes: 9ad5204d6 - "[SCSI]aacraid: incorrect dma mapping mask during blinked recover or user initiated reset"
    Cc: stable@vger.kernel.org

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Tomas Henzl
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • Added support for PCI EEH (extended error handling).

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Tomas Henzl
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • The driver utilizes an array of atomic variables to keep track of IO
    submissions to each vector. To submit an IO multiple threads iterate
    through the array to find a vector which has empty slots to send an
    IO. The reading and updating of the variable is not atomic, causing race
    conditions when a thread uses a full vector to submit an IO.

    Fixed by mapping each FIB to a vector, the submission path then uses
    said vector to submit IO thereby removing the possibly of a race
    condition.The vector assignment is started from 1 since vector 0 is
    reserved for the use of AIF management FIBS.If the number of MSIx
    vectors is 1 (MSI or INTx mode) then all the fibs are allocated to
    vector 0.

    Fixes: 495c0217 "aacraid: MSI-x support"
    Cc: stable@vger.kernel.org # v4.1

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Tomas Henzl
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     
  • The method to allocate and free FIB's in the present code utilizes
    spinlocks. Multiple IO's have to wait on the spinlock to acquire or free
    fibs creating a performance bottleneck.

    An alternative solution would be to use block layer tags to keep track
    of the fibs allocated and freed. To this end aac_fib_alloc_tag was
    created to utilize the blk layer tags to plug into the Fib pool.These
    functions are used exclusively in the IO path. 8 fibs are reserved for
    the use of AIF management software and utilize the previous spinlock
    based implementations.

    Signed-off-by: Raghava Aditya Renukunta
    Reviewed-by: Shane Seymour
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Tomas Henzl
    Signed-off-by: Martin K. Petersen

    Raghava Aditya Renukunta
     

26 Nov, 2015

1 commit


10 Nov, 2015

9 commits


25 May, 2015

1 commit


10 Apr, 2015

1 commit