1. 05 11月, 2020 1 次提交
  2. 25 8月, 2020 1 次提交
    • S
      scsi: mpt3sas: Remove pci-dma-compat wrapper API · a5a20c4a
      Suraj Upadhyay 提交于
      The legacy API wrappers in include/linux/pci-dma-compat.h should go away as
      they create unnecessary midlayering for include/linux/dma-mapping.h API.
      Instead use dma-mapping.h API directly.
      
      The patch has been generated with the coccinelle script below.  Compile
      tested.
      
      @@@@
      - PCI_DMA_BIDIRECTIONAL
      + DMA_BIDIRECTIONAL
      
      @@@@
      - PCI_DMA_TODEVICE
      + DMA_TO_DEVICE
      
      @@@@
      - PCI_DMA_FROMDEVICE
      + DMA_FROM_DEVICE
      
      @@@@
      - PCI_DMA_NONE
      + DMA_NONE
      
      @@ expression E1, E2, E3; @@
      - pci_alloc_consistent(E1, E2, E3)
      + dma_alloc_coherent(&E1->dev, E2, E3, GFP_)
      
      @@ expression E1, E2, E3; @@
      - pci_zalloc_consistent(E1, E2, E3)
      + dma_alloc_coherent(&E1->dev, E2, E3, GFP_)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_free_consistent(E1, E2, E3, E4)
      + dma_free_coherent(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_map_single(E1, E2, E3, E4)
      + dma_map_single(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_unmap_single(E1, E2, E3, E4)
      + dma_unmap_single(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4, E5; @@
      - pci_map_page(E1, E2, E3, E4, E5)
      + dma_map_page(&E1->dev, E2, E3, E4, E5)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_unmap_page(E1, E2, E3, E4)
      + dma_unmap_page(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_map_sg(E1, E2, E3, E4)
      + dma_map_sg(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_unmap_sg(E1, E2, E3, E4)
      + dma_unmap_sg(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_dma_sync_single_for_cpu(E1, E2, E3, E4)
      + dma_sync_single_for_cpu(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_dma_sync_single_for_device(E1, E2, E3, E4)
      + dma_sync_single_for_device(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_dma_sync_sg_for_cpu(E1, E2, E3, E4)
      + dma_sync_sg_for_cpu(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2, E3, E4; @@
      - pci_dma_sync_sg_for_device(E1, E2, E3, E4)
      + dma_sync_sg_for_device(&E1->dev, E2, E3, E4)
      
      @@ expression E1, E2; @@
      - pci_dma_mapping_error(E1, E2)
      + dma_mapping_error(&E1->dev, E2)
      
      @@ expression E1, E2; @@
      - pci_set_consistent_dma_mask(E1, E2)
      + dma_set_coherent_mask(&E1->dev, E2)
      
      @@ expression E1, E2; @@
      - pci_set_dma_mask(E1, E2)
      + dma_set_mask(&E1->dev, E2)
      
      Link: https://lore.kernel.org/r/e825ac7108092cc8fa8d462dc702098ef10fc6a2.1596045683.git.usuraj35@gmail.comSigned-off-by: NSuraj Upadhyay <usuraj35@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      a5a20c4a
  3. 24 8月, 2020 1 次提交
  4. 21 8月, 2020 1 次提交
  5. 08 7月, 2020 2 次提交
  6. 03 7月, 2020 1 次提交
    • D
      scsi: mpt3sas: Fix unlock imbalance · cb551b8d
      Damien Le Moal 提交于
      In BRM_status_show(), if the condition "!ioc->is_warpdrive" tested on entry
      to the function is true, a "goto out" is called. This results in unlocking
      ioc->pci_access_mutex without this mutex lock being taken.  This generates
      the following splat:
      
      [ 1148.539883] mpt3sas_cm2: BRM_status_show: BRM attribute is only for warpdrive
      [ 1148.547184]
      [ 1148.548708] =====================================
      [ 1148.553501] WARNING: bad unlock balance detected!
      [ 1148.558277] 5.8.0-rc3+ #827 Not tainted
      [ 1148.562183] -------------------------------------
      [ 1148.566959] cat/5008 is trying to release lock (&ioc->pci_access_mutex) at:
      [ 1148.574035] [<ffffffffc070b7a3>] BRM_status_show+0xd3/0x100 [mpt3sas]
      [ 1148.580574] but there are no more locks to release!
      [ 1148.585524]
      [ 1148.585524] other info that might help us debug this:
      [ 1148.599624] 3 locks held by cat/5008:
      [ 1148.607085]  #0: ffff92aea3e392c0 (&p->lock){+.+.}-{3:3}, at: seq_read+0x34/0x480
      [ 1148.618509]  #1: ffff922ef14c4888 (&of->mutex){+.+.}-{3:3}, at: kernfs_seq_start+0x2a/0xb0
      [ 1148.630729]  #2: ffff92aedb5d7310 (kn->active#224){.+.+}-{0:0}, at: kernfs_seq_start+0x32/0xb0
      [ 1148.643347]
      [ 1148.643347] stack backtrace:
      [ 1148.655259] CPU: 73 PID: 5008 Comm: cat Not tainted 5.8.0-rc3+ #827
      [ 1148.665309] Hardware name: HGST H4060-S/S2600STB, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019
      [ 1148.678394] Call Trace:
      [ 1148.684750]  dump_stack+0x78/0xa0
      [ 1148.691802]  lock_release.cold+0x45/0x4a
      [ 1148.699451]  __mutex_unlock_slowpath+0x35/0x270
      [ 1148.707675]  BRM_status_show+0xd3/0x100 [mpt3sas]
      [ 1148.716092]  dev_attr_show+0x19/0x40
      [ 1148.723664]  sysfs_kf_seq_show+0x87/0x100
      [ 1148.731193]  seq_read+0xbc/0x480
      [ 1148.737882]  vfs_read+0xa0/0x160
      [ 1148.744514]  ksys_read+0x58/0xd0
      [ 1148.751129]  do_syscall_64+0x4c/0xa0
      [ 1148.757941]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [ 1148.766240] RIP: 0033:0x7f1230566542
      [ 1148.772957] Code: Bad RIP value.
      [ 1148.779206] RSP: 002b:00007ffeac1bcac8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
      [ 1148.790063] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f1230566542
      [ 1148.800284] RDX: 0000000000020000 RSI: 00007f1223460000 RDI: 0000000000000003
      [ 1148.810474] RBP: 00007f1223460000 R08: 00007f122345f010 R09: 0000000000000000
      [ 1148.820641] R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000000000
      [ 1148.830728] R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000
      
      Fix this by returning immediately instead of jumping to the out label.
      
      Link: https://lore.kernel.org/r/20200701085254.51740-1-damien.lemoal@wdc.comReviewed-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Acked-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      cb551b8d
  7. 03 1月, 2020 3 次提交
  8. 10 10月, 2019 1 次提交
  9. 01 10月, 2019 10 次提交
  10. 30 8月, 2019 1 次提交
  11. 08 8月, 2019 5 次提交
    • S
      scsi: mpt3sas: Add sysfs to know supported features · 3ac8e47b
      Suganath Prabu 提交于
      Currently with sysfs parameter "drv_support_bitmap" driver exposes whether
      driver supports toolbox memory move command or not.
      
      And application should issue the toolbox memory move command only if driver
      tell that memory move tool box command is supported through this sysfs
      parameter.
      
      In future we can utilize this sysfs parameter if any new feature is added
      and need to notify the same to applications.
      Signed-off-by: NSuganath Prabu <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      3ac8e47b
    • S
      scsi: mpt3sas: Support MEMORY MOVE Tool box command · ba630ea0
      Suganath Prabu 提交于
      Host uses the Memory Move Tool to copy data from any source/destination
      combination of system memory and IOC memory.
      
      Memory Move Tool box request contains two SGE fields, First SGE field must
      contains the source buffer details described by an MPI Simple SGE.  The
      second SGE field must contains the destination buffer details described by
      an MPI Simple SGE.
      
       Source   ->   Destination
      
      1. IOC    ->   IOC    (Both the SGE's will be filled by application)
      
      2. HOST   ->   HOST   (Both the SGE's will be filled by the host,
                     application should give sgl_offset to first SGE offset)
      
      3. IOC    ->   HOST   (Application will fill the first SGE and set the
                     sgl_offset to second SGE and hence driver fills
                     the second SGE)
      4. HOST   ->   IOC    (Application will fill IOC buffer information in the
                     first SGE and set the sgl_offset to second SGE.
                     Then driver will fill the second SGE with Host buffer
                     information and just before posting the command to the
                     firmware, driver will swap these two SGEs so that first
                     SGE contains the HOST buffer information and second SGE
                     contains the IOC information.
      
      Driver has to take care only of the 4th case, other three cases are by
      default supported by the current driver design.
      Signed-off-by: NSuganath Prabu <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      ba630ea0
    • S
      scsi: mpt3sas: Enumerate SES of a managed PCIe switch · 5bb309db
      Suganath Prabu 提交于
      SES device of managed PCIe switch will be enumerated same as NVMe drives.
      
      The device info type for this SES device is
      
              MPI26_PCIE_DEVINFO_SCSI (0x4),
      
      whereas the device info type for NVMe drives is
      
              MPI26_PCIE_DEVINFO_NVME (0x3).
      
      Based on this device info type driver determines whether the device is NVMe
      drive or a SES device of a managed PCIe switch.
      
      This SES device doesn't have the PCIe device page 2 information like NVMe
      drives, so driver won't read PCIe device page 2 information for SES device.
      
      This SES device uses only IEEE SGL's, So driver build's IEEE SGL's whenever
      it receives any SCSI commands for this SES device.
      Signed-off-by: NSuganath Prabu <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      5bb309db
    • S
      scsi: mpt3sas: memset request frame before reusing · e224e03b
      Suganath Prabu 提交于
      Driver gets a request frame from the free pool of DMA-able request frames
      and fill in the required information and pass the address of the frame to
      IOC/FW to pull the complete request frame. In certain places the driver
      used the request frame allocated from the free pool without completely
      clearing the previous data stored in it. The request contents were cleared
      only for the size of the new request to be issued and that left out some
      stale data in the unused part of the request. Though the IOC/FW is not
      expected to access the request beyond the specified size, it is good
      practice to clear complete request message frame.
      
      So reinitialize the complete request message frame with 0s before using
      it.
      Signed-off-by: NSuganath Prabu <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      e224e03b
    • S
      scsi: mpt3sas: Add support for PCIe Lane margin · f23ca2cb
      Suganath Prabu 提交于
      PCIe Lane margin tool box request requires IEEE sgl's and hence driver
      fills the SGL field with IEEE sgl's while issuing the PCIe Lane margin
      ioctl request to the HBA firmware.
      Signed-off-by: NSuganath Prabu <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      f23ca2cb
  12. 31 7月, 2019 2 次提交
    • M
      scsi: mpt3sas: support target smid for [abort|query] task · 8f55c307
      Minwoo Im 提交于
      We can request task management IOCTL command(MPI2_FUNCTION_SCSI_TASK_MGMT)
      to /dev/mpt3ctl.  If the given task_type is either abort task or query
      task, it may need a field named "Initiator Port Transfer Tag to Manage" in
      the IU.
      
      Current code does not support to check target IPTT tag from the tm_request.
      This patch introduces to check TaskMID given from the userspace as a target
      tag.  We have a rule of relationship between
      (struct request *req->tag) and smid in mpt3sas_base.c:
      
      3318 u16
      3319 mpt3sas_base_get_smid_scsiio(struct MPT3SAS_ADAPTER *ioc, u8 cb_idx,
      3320         struct scsi_cmnd *scmd)
      3321 {
      3322         struct scsiio_tracker *request = scsi_cmd_priv(scmd);
      3323         unsigned int tag = scmd->request->tag;
      3324         u16 smid;
      3325
      3326         smid = tag + 1;
      
      So if we want to abort a request tagged #X, then we can pass (X + 1) to
      this IOCTL handler.  Otherwise, user space just can pass 0 TaskMID to abort
      the first outstanding smid which is legacy behaviour.
      
      Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
      Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      Cc: Sathya Prakash <sathya.prakash@broadcom.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: MPT-FusionLinux.pdl@broadcom.com
      Signed-off-by: NMinwoo Im <minwoo.im@samsung.com>
      Acked-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      8f55c307
    • D
      scsi: mpt3sas: clean up a couple sizeof() uses · 1de540a9
      Dan Carpenter 提交于
      There is a copy and paste bug here.  It uses EVENT_TRIGGERS size instead of
      SCSI_TRIGGERS size but fortunately both size are 84 bytes so it doesn't
      affect runtime.
      
      These days the preferred style is to just say sizeof(object) instead of
      sizeof(type) so I have updated the function to the latest style as well.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      1de540a9
  13. 21 6月, 2019 1 次提交
  14. 19 6月, 2019 2 次提交
  15. 07 11月, 2018 2 次提交
  16. 18 10月, 2018 1 次提交
  17. 11 10月, 2018 1 次提交
  18. 20 6月, 2018 3 次提交
  19. 19 6月, 2018 1 次提交