1. 13 6月, 2015 1 次提交
  2. 01 6月, 2015 1 次提交
    • S
      megaraid_sas : Modify return value of megasas_issue_blocked_cmd() and... · 2be2a988
      Sumit.Saxena@avagotech.com 提交于
      megaraid_sas : Modify return value of megasas_issue_blocked_cmd() and wait_and_poll() to consider command status returned by firmware
      
      This patch is rebased on top of recently sent 18 patches(submitted by me) for
      megaraid_sas driver.
      
      Change the return value of wait_and_poll() and megsas_issue_blocked_cmd()
      based on MFI_STAT returned by firmware for that command. Earlier driver always
      send return type based on command completion (but never check MFI_STAT_OK for
      that command), so even if command is failed by firmware still driver will
      return SUCCESS status from these functions wait_and_poll() and
      megsas_issue_blocked_cmd() and if caller of these functions does not check
      command status (MFI_STAT), then it may endup using invalid data returned in
      DMA buffers(one of the example is megasas_ld_list_query DCMD). Best thing to
      avoid this type of issue is do error handling and set proper return type from
      caller function wait_and_poll() and megsas_issue_blocked_cmd().
      
      The change proposed in this patch will fix the regression introduced in patch-
      "90dc9d98 megaraid_sas : MFI MPT linked list corruption fix" inside function
      megasas_ld_list_query().  Prior to this MFI MPT linked list corruption fix
      patch, megasas_ld_list_query() function used to check DCMD status(returned by
      firmware) but with this linked list corruption fix patch, DCMD status will not
      be checked inside function megasas_ld_list_query() and introduced this issue
      of wrong data being used by function megasas_ld_list_query().
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      2be2a988
  3. 26 5月, 2015 1 次提交
  4. 25 5月, 2015 15 次提交
  5. 09 1月, 2015 5 次提交
  6. 24 11月, 2014 7 次提交
  7. 20 11月, 2014 1 次提交
  8. 12 11月, 2014 1 次提交
    • C
      scsi: don't set tagging state from scsi_adjust_queue_depth · c8b09f6f
      Christoph Hellwig 提交于
      Remove the tagged argument from scsi_adjust_queue_depth, and just let it
      handle the queue depth.  For most drivers those two are fairly separate,
      given that most modern drivers don't care about the SCSI "tagged" status
      of a command at all, and many old drivers allow queuing of multiple
      untagged commands in the driver.
      
      Instead we start out with the ->simple_tags flag set before calling
      ->slave_configure, which is how all drivers actually looking at
      ->simple_tags except for one worke anyway.  The one other case looks
      broken, but I've kept the behavior as-is for now.
      
      Except for that we only change ->simple_tags from the ->change_queue_type,
      and when rejecting a tag message in a single driver, so keeping this
      churn out of scsi_adjust_queue_depth is a clear win.
      
      Now that the usage of scsi_adjust_queue_depth is more obvious we can
      also remove all the trivial instances in ->slave_alloc or ->slave_configure
      that just set it to the cmd_per_lun default.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c8b09f6f
  9. 10 11月, 2014 1 次提交
  10. 17 9月, 2014 7 次提交
    • S
      megaraid_sas : Driver version update · 0d9d8b9f
      Sumit.Saxena@avagotech.com 提交于
      Resending the patch. Addressed the review comments by Tomas Henzl.
      
      Driver version upgrade patch.
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      0d9d8b9f
    • S
      megaraid_sas : MFI MPT linked list corruption fix · 90dc9d98
      Sumit.Saxena@avagotech.com 提交于
      Resending the patch. Addressed the review comments from Tomas Henzl.
      Added comment for to-do work.
      
      Problem statement:
      MFI link list in megaraid_sas driver is used from mfi-mpt pass-through commands.
      This list can be corrupted due to many possible race conditions in driver and
      eventually we may see kernel panic.
      
      One example -
      MFI frame is freed from calling process as driver send command via polling method and interrupt
      for that command comes after driver free mfi frame (actually even after some other context reuse
      the mfi frame). When driver receive MPT frame in ISR, driver will be using the index of MFI and
      access that MFI frame and finally in-used MFI frame’s list will be corrupted.
      
      High level description of new solution -
      Free MFI and MPT command from same context.
      Free both the command either from process (from where mfi-mpt pass-through was called) or from
      ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which
      will do MFI/MPT list corruption.
      
      Renamed the cmd_pool_lock which is used in instance as well as fusion with below name.
      mfi_pool_lock and mpt_pool_lock to add more code readability.
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      90dc9d98
    • S
      megaraid_sas : Add module parameter to disable IRQ-CPU affinity hint · ac95136a
      Sumit.Saxena@avagotech.com 提交于
      Resending the patch. Addressed the review comments from Tomas Henzl.
      
      For certain deployment, we may need to disable irq cpu affinity hint.
      This module parameter provides option for use to disable irq cpu affinity hint
      and allow irqbalancer to handle the rest.
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      ac95136a
    • S
      megaraid_sas : Host lock less mode to enabled asynchronous IO submission · fb1a24ff
      Sumit.Saxena@avagotech.com 提交于
      Resending the patch. Addressed the review comments from Tomas Henzl.
      
      Megaraid_sas driver can now work in host lock less mode.
      Remove host lock less as megaraid_sas driver will have safer access to raid map as described in earlier patch.
      
      We now keep Driver Raid map copy, which will make sure
      that driver will always have old or new map
      Driver raid map will be replaced safely in MR_PopulateDrvRaidMap(), so there is no issue
      even if IO is continue from the scsi mid layer.
      
      There is a plan to remove "host_lock" and "hba_lock" usage from megaraid_sas in future.
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      fb1a24ff
    • S
      megaraid_sas : Extended VD support · 51087a86
      Sumit.Saxena@avagotech.com 提交于
      Resending the patch. Addressed the review comments from Tomas Henzl.
      reserved1 field(part of union) of Raid map struct was not required so it is removed.
      
      Current MegaRAID firmware and hence the driver only supported 64VDs.
      E.g: If the user wants to create more than 64VD on a controller,
          it is not possible on current firmware/driver.
      
      New feature and requirement to support upto 256VD, firmware/driver/apps need changes.
      In addition to that there must be a backward compatibility of the new driver with the
      older firmware and vice versa.
      
      RAID map is the interface between Driver and FW to fetch all required
      fields(attributes) for each Virtual Drives.
      In the earlier design driver was using the FW copy of RAID map where as
      in the new design the Driver will keep the RAID map copy of its own; on which
      it will operate for any raid map access in fast path.
      
      Local driver raid map copy will provide ease of access through out the code
      and provide generic interface for future FW raid map changes.
      
      For the backward compatibility driver will notify FW that it supports 256VD
      to the FW in driver capability field.
      Based on the controller properly returned by the FW, the Driver will know
      whether it supports 256VD or not and will copy the RAID map accordingly.
      
      At any given time, driver will always have old or new Raid map.
      So with this changes, driver can also work in host lock less mode. Please
      see next patch which enable host lock less mode for megaraid_sas driver.
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      51087a86
    • S
      megaraid_sas : Firmware crash dump feature support · fc62b3fc
      Sumit.Saxena@avagotech.com 提交于
      Resending the patch. Addressed the review comments from Tomas Henzl.
      Move buff_offset inside spinlock, corrected loop at crash dump buffer free,
      reset_devices check is added to disable fw crash dump feature in kdump kernel.
      
      This feature will provide similar interface as kernel crash dump feature.
      When megaraid firmware encounter any crash, driver will collect the firmware raw image and
      dump it into pre-configured location.
      
      Driver will allocate two different segment of memory.
      #1 Non-DMA able large buffer (will be allocated on demand) to capture actual FW crash dump.
      #2 DMA buffer (persistence allocation) just to do a arbitrator job.
      
      Firmware will keep writing Crash dump data in chucks of DMA buffer size into #2,
      which will be copy back by driver to the host memory as described in #1.
      
      Driver-Firmware interface:
      ==================
      A.) Host driver can allocate maximum 512MB Host memory to store crash dump data.
      
      This memory will be internal to the host and will not be exposed to the Firmware.
      Driver may not be able to allocate 512 MB. In that case, driver will do possible memory
      (available at run time) allocation to store crash dump data.
      
      Let’s call this buffer as Host Crash Buffer.
      
      Host Crash buffer will not be contigious as a whole, but it will have multiple chunk of contigious memory.
      This will be internal to driver and firmware/application are unaware of it.
      Partial allocation of Host Crash buffer may have valid information to debug depending upon
      what was collected in that buffer and depending on nature of failure.
      
      Complete Crash dump is the best case, but we do want to capture partial buffer just to grab something rather than nothing.
      Host Crash buffer will be allocated only when FW Crash dump data is available,
      and will be deallocated once application copy Host Crash buffer to the file.
      Host Crash buffer size can be anything between 1MB to 512MB. (It will be multiple of 1MBs)
      
      B.) Irrespective of underlying Firmware capability of crash dump support,
      driver will allocate DMA buffer at start of the day for each MR controllers.
      Let’s call this buffer as “DMA Crash Buffer”.
      
      For this feature, size of DMA crash buffer will be 1MB.
      (We will not gain much even if DMA buffer size is increased.)
      
      C.) Driver will now read Controller Info sending existing dcmd “MR_DCMD_CTRL_GET_INFO”.
      Driver should extract the information from ctrl info provided by firmware and
      figure out if firmware support crash dump feature or not.
      
      Driver will enable crash dump feature only if
      “Firmware support Crash dump” +
      “Driver was able to create DMA Crash Buffer”.
      
      If either one from above is not set, Crash dump feature should be disable in driver.
      Firmware will enable crash dump feature only if “Driver Send DCMD- MR_DCMD_SET_CRASH_BUF_PARA with MR_CRASH_BUF_TURN_ON”
      
      Helper application/script should use sysfs parameter fw_crash_xxx to actually copy data from
      host memory to the filesystem.
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      fc62b3fc
    • S
      megaraid_sas : Do not scan non syspd drives · 07e38d94
      Sumit.Saxena@avagotech.com 提交于
      Resending the patch. Addressed the review comments from Tomas Henzl.
      
      Current driver allow device scan for all the devices on channel 0 and 1.
      E.a If we have two single drive raid volumes, we may see prints like below.
      First two prints are for physical device which are used to form VD.
      Prints like this creates confusion as it is really not required to scan any
      hidden physical devices.
      
      scsi1 : LSI SAS based MegaRAID driver
      scsi 1:0:0:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
      scsi 1:0:1:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
      scsi 1:2:0:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
      scsi 1:2:1:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
      
      When slave_alloc called, sdev-type will not be set, so current code will always
      return "0" in slave_alloc callback.
      This patch make sure that driver return "-ENXIO" for non-syspd devices.
      
      After this patch, we will see prints in syslog only for devices which are exposed.
      For current example, below print will be available in syslog.
      
      scsi1 : LSI SAS based MegaRAID driver
      scsi 1:2:0:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
      scsi 1:2:1:0: Direct-Access     LSI      MR9361-8i        4.21 PQ: 0 ANSI: 5
      Signed-off-by: NSumit Saxena <sumit.saxena@avagotech.com>
      Signed-off-by: NKashyap Desai <kashyap.desai@avagotech.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      07e38d94