1. 23 2月, 2022 2 次提交
  2. 20 2月, 2022 4 次提交
  3. 03 12月, 2021 1 次提交
  4. 19 11月, 2021 1 次提交
  5. 17 10月, 2021 1 次提交
  6. 15 9月, 2021 2 次提交
  7. 13 7月, 2021 1 次提交
    • R
      scsi: pm8001: Clean up kernel-doc and comments · bb6beabf
      Randy Dunlap 提交于
      Fix kernel-doc warnings then test again, wash, rinse, find more, then
      repeat more/again.
      
      Also fix spellos, some grammar, and some punctuation.
      
      ../drivers/scsi/pm8001/pm8001_ctl.c:557: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       ** pm8001_ctl_fatal_log_show - fatal error logging
      ../drivers/scsi/pm8001/pm8001_ctl.c:577: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       ** non_fatal_log_show - non fatal error logging
      ../drivers/scsi/pm8001/pm8001_ctl.c:622: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
       ** pm8001_ctl_gsm_log_show - gsm dump collection
      
      Link: https://lore.kernel.org/r/20210708165723.8594-1-rdunlap@infradead.org
      Cc: Jack Wang <jinpu.wang@cloud.ionos.com>
      Cc: linux-scsi@vger.kernel.org
      Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Acked-by: NJack Wang <jinpu.wang@ionos.com>
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      bb6beabf
  8. 23 6月, 2021 1 次提交
  9. 16 5月, 2021 1 次提交
  10. 16 4月, 2021 1 次提交
  11. 25 3月, 2021 1 次提交
    • A
      scsi: pm8001: Avoid -Wrestrict warning · c2255ece
      Arnd Bergmann 提交于
      On some configurations, gcc warns about overlapping source and destination
      arguments to snprintf:
      
      drivers/scsi/pm8001/pm8001_init.c: In function 'pm8001_request_msix':
      drivers/scsi/pm8001/pm8001_init.c:977:3: error: 'snprintf' argument 4 may overlap destination object 'pm8001_ha' [-Werror=restrict]
        977 |   snprintf(drvname, len, "%s-%d", pm8001_ha->name, i);
            |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/pm8001/pm8001_init.c:962:56: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
        962 | static u32 pm8001_request_msix(struct pm8001_hba_info *pm8001_ha)
            |                                ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
      
      I first assumed this was a gcc bug, as that should not happen, but a
      reduced test case makes it clear that this happens when the loop counter is
      not bounded by the array size.
      
      Help the compiler out by adding an explicit limit here to make the code
      slightly more robust and avoid the warning.
      
      Link: https://godbolt.org/z/6T1qPM
      Link: https://lore.kernel.org/r/20210323125458.1825564-1-arnd@kernel.orgAcked-by: NJack Wang <jinpu.wang@ionos.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c2255ece
  12. 16 3月, 2021 1 次提交
  13. 21 1月, 2021 1 次提交
    • C
      scsi: pm80xx: Switch from 'pci_' to 'dma_' API · 8e60a7de
      Christophe JAILLET 提交于
      The wrappers in include/linux/pci-dma-compat.h should go away.
      
      The patch has been generated with the coccinelle script below and has been
      hand modified to replace GFP_ with a correct flag.  It has been compile
      tested.
      
      When memory is allocated in 'pm8001_init_ccb_tag()' GFP_KERNEL can be used
      because this function already uses this flag a few lines above.
      
      While at it, remove "pm80xx: " in a debug message. 'pm8001_dbg()' already
      adds the driver name in the message.
      
      @@
      @@
      -    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_dma_mask(e1, e2)
      +    dma_set_mask(&e1->dev, e2)
      
      @@
      expression e1, e2;
      @@
      -    pci_set_consistent_dma_mask(e1, e2)
      +    dma_set_coherent_mask(&e1->dev, e2)
      
      Link: https://lore.kernel.org/r/20210117132445.562552-1-christophe.jaillet@wanadoo.frAcked-by: NJack Wang <jinpu.wang@cloud.ionos.com>
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      8e60a7de
  14. 13 1月, 2021 1 次提交
    • A
      scsi: pm80xx: Check main config table address · 95652f98
      akshatzen 提交于
      The driver initializes main configuration, general status, inbound queue
      and outbound queue table addresses based on a value read from
      MSGU_SCRATCH_PAD_0 register.
      
      We should validate these addresses before dereferencing them.
      
      Adds two validations:
      
       1. Check if main configuration table offset lies within the pcibar
          mapped
      
       2. Check if first dword of main configuration table reads "PMCS"
      
      There are two calls to init_pci_device_addresses() done during
      pm8001_pci_probe() in this sequence:
      
       1. First inside chip_soft_rst, where if init_pci_device_addresses fails we
          will go ahead assuming MPI state is not ready and reset the device as
          long as bootloader is okay.  This gives chance to second call of
          init_pci_device_addresses to set up the addresses after reset.
      
       2. The second call is via pm80xx_chip_init, after soft reset is done and
          firmware is checked to be ready. Once that is done we are safe to go
          ahead and initialize default table values and use them.
      
      Tests:
      
       1. Enabled debugging logs and observed no issues during initialization,
          with a controller with no issues:
      
          pm80xx0:: pm8001_setup_msix 1034: pci_alloc_irq_vectors request ret:64 no of intr 64
          pm80xx0:: init_pci_device_addresses 917: Scratchpad 0 Offset: 0x2000 value 0x40002000
          pm80xx0:: init_pci_device_addresses 925: Scratchpad 0 PCI BAR: 0
          pm80xx0:: init_pci_device_addresses 952: VALID main config signature 0x53434d50
          pm80xx0:: init_pci_device_addresses 975: GST OFFSET 0xc4
          pm80xx0:: init_pci_device_addresses 978: INBND OFFSET 0x20000128
          pm80xx0:: init_pci_device_addresses 981: OBND OFFSET 0x24000928
          pm80xx0:: init_pci_device_addresses 984: IVT OFFSET 0x8001408
          pm80xx0:: init_pci_device_addresses 987: PSPA OFFSET 0x8001608
          pm80xx0:: init_pci_device_addresses 991: addr - main cfg (ptrval) general status (ptrval)
          pm80xx0:: init_pci_device_addresses 995: addr - inbnd (ptrval) obnd (ptrval)
          pm80xx0:: init_pci_device_addresses 999: addr - pspa (ptrval) ivt (ptrval)
          pm80xx0:: pm80xx_chip_soft_rst 1446: reset register before write : 0x0
          pm80xx0:: pm80xx_chip_soft_rst 1478: reset register after write 0x40
          pm80xx0:: pm80xx_chip_soft_rst 1544: SPCv soft reset Complete
          pm80xx0:: init_pci_device_addresses 917: Scratchpad 0 Offset: 0x2000 value 0x40002000
          pm80xx0:: init_pci_device_addresses 925: Scratchpad 0 PCI BAR: 0
          pm80xx0:: init_pci_device_addresses 952: VALID main config signature 0x53434d50
          pm80xx0:: init_pci_device_addresses 975: GST OFFSET 0xc4
          pm80xx0:: init_pci_device_addresses 978: INBND OFFSET 0x20000128
          pm80xx0:: init_pci_device_addresses 981: OBND OFFSET 0x24000928
          pm80xx0:: init_pci_device_addresses 984: IVT OFFSET 0x8001408
          pm80xx0:: init_pci_device_addresses 987: PSPA OFFSET 0x8001608
          pm80xx0:: init_pci_device_addresses 991: addr - main cfg (ptrval) general status (ptrval)
          pm80xx0:: init_pci_device_addresses 995: addr - inbnd (ptrval) obnd (ptrval)
          pm80xx0:: init_pci_device_addresses 999: addr - pspa (ptrval) ivt (ptrval)
          pm80xx0:: pm80xx_chip_init 1329: MPI initialize successful!
      
       2. Tested controller with firmware known to have initialization issue and
          observed no crashes with this fix:
      
          pm80xx 0000:01:00.0: pm80xx: driver version 0.1.38
          pm80xx 0000:01:00.0: Removing from 1:1 domain
          pm80xx 0000:01:00.0: Requesting non-1:1 mappings
          pm80xx0:: init_pci_device_addresses 948: BAD main config signature 0x0
          pm80xx0:: mpi_uninit_check 1365: Failed to init pci addresses
          pm80xx0:: pm80xx_chip_soft_rst 1435: MPI state is not ready scratch:0:8:62a01000:0
          pm80xx0:: pm80xx_chip_soft_rst 1518: Firmware is not ready!
          pm80xx0:: pm80xx_chip_soft_rst 1532: iButton Feature is not Available!!!
          pm80xx0:: pm80xx_chip_init 1301: Firmware is not ready!
          pm80xx0:: pm8001_pci_probe 1215: chip_init failed [ret: -16]
          pm80xx: probe of 0000:01:00.0 failed with error -16
          pm80xx 0000:07:00.0: pm80xx: driver version 0.1.38
          pm80xx 0000:07:00.0: Removing from 1:1 domain
          pm80xx 0000:07:00.0: Requesting non-1:1 mappings
          scsi host6: pm80xx
          pm80xx1:: pm8001_setup_sgpio 5568: failed sgpio_req timeout
          pm80xx1:: mpi_phy_start_resp 3447: phy start resp status:0x0, phyid:0x0
          pm80xx 0000:08:00.0: pm80xx: driver version 0.1.38
          pm80xx 0000:08:00.0: Removing from 1:1 domain
          pm80xx 0000:08:00.0: Requesting non-1:1 mappings
      
       3. Without this fix we observe crash on the same controller:
      
          pm80xx 0000:01:00.0: pm80xx: driver version 0.1.38
          pm80xx 0000:01:00.0: Removing from 1:1 domain
          pm80xx 0000:01:00.0: Requesting non-1:1 mappings
          [<ffffffffc0451b3b>] pm80xx_chip_soft_rst+0x6b/0x4c0 [pm80xx]
          [<ffffffffc043a933>] pm8001_pci_probe+0xa43/0x1630 [pm80xx]
          RIP: 0010:pm80xx_chip_soft_rst+0x71/0x4c0 [pm80xx]
          [<ffffffffc0451b3b>] ? pm80xx_chip_soft_rst+0x6b/0x4c0 [pm80xx]
          [<ffffffffc043a933>] pm8001_pci_probe+0xa43/0x1630 [pm80xx]
          pm80xx0:: mpi_uninit_check 1339: TIMEOUT:IBDB value/=2
          pm80xx0:: pm80xx_chip_soft_rst 1387: MPI state is not ready scratch:0:8:62a01000:0
          pm80xx0:: pm80xx_chip_soft_rst 1470: Firmware is not ready!
          pm80xx0:: pm80xx_chip_soft_rst 1484: iButton Feature is not Available!!!
          pm80xx0:: pm80xx_chip_init 1266: Firmware is not ready!
          pm80xx0:: pm8001_pci_probe 1207: chip_init failed [ret: -16]
          pm80xx: probe of 0000:01:00.0 failed with error -16
      
      Link: https://lore.kernel.org/r/20210109123849.17098-4-Viswas.G@microchip.comAcked-by: NJack Wang <jinpu.wang@cloud.ionos.com>
      Signed-off-by: Nakshatzen <akshatzen@google.com>
      Signed-off-by: NViswas G <Viswas.G@microchip.com>
      Signed-off-by: NRuksar Devadi <Ruksar.devadi@microchip.com>
      Signed-off-by: NRadha Ramachandran <radha@google.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      95652f98
  15. 08 12月, 2020 1 次提交
  16. 01 12月, 2020 2 次提交
  17. 26 11月, 2020 2 次提交
  18. 24 11月, 2020 3 次提交
  19. 05 11月, 2020 1 次提交
  20. 08 10月, 2020 3 次提交
  21. 16 7月, 2020 1 次提交
    • L
      scsi: pm8001: Demote obvious misuse of kerneldoc and update others · e802fc43
      Lee Jones 提交于
      More bitrot issues with function documentation not keeping up with API changes.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/scsi/pm8001/pm8001_init.c:64: warning: cannot understand function prototype: 'const struct pm8001_chip_info pm8001_chips[] = '
       drivers/scsi/pm8001/pm8001_init.c:86: warning: cannot understand function prototype: 'struct scsi_host_template pm8001_sht = '
       drivers/scsi/pm8001/pm8001_init.c:115: warning: cannot understand function prototype: 'struct sas_domain_function_template pm8001_transport_ops = '
       drivers/scsi/pm8001/pm8001_init.c:212: warning: Function parameter or member 'irq' not described in 'pm8001_interrupt_handler_msix'
       drivers/scsi/pm8001/pm8001_init.c:237: warning: Function parameter or member 'irq' not described in 'pm8001_interrupt_handler_intx'
       drivers/scsi/pm8001/pm8001_init.c:265: warning: Function parameter or member 'ent' not described in 'pm8001_alloc'
       drivers/scsi/pm8001/pm8001_init.c:624: warning: Function parameter or member 'pm8001_ha' not described in 'pm8001_init_sas_add'
       drivers/scsi/pm8001/pm8001_init.c:624: warning: Excess function parameter 'chip_info' description in 'pm8001_init_sas_add'
       drivers/scsi/pm8001/pm8001_init.c:900: warning: Function parameter or member 'pm8001_ha' not described in 'pm8001_setup_msix'
       drivers/scsi/pm8001/pm8001_init.c:900: warning: Excess function parameter 'chip_info' description in 'pm8001_setup_msix'
       drivers/scsi/pm8001/pm8001_init.c:900: warning: Excess function parameter 'irq_handler' description in 'pm8001_setup_msix'
       drivers/scsi/pm8001/pm8001_init.c:981: warning: Function parameter or member 'pm8001_ha' not described in 'pm8001_request_irq'
       drivers/scsi/pm8001/pm8001_init.c:981: warning: Excess function parameter 'chip_info' description in 'pm8001_request_irq'
      
      Link: https://lore.kernel.org/r/20200713074645.126138-27-lee.jones@linaro.org
      Cc: Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
      Cc: Sangeetha Gnanasekaran <Sangeetha.Gnanasekaran@pmcs.com>
      Cc: Nikith Ganigarakoppal <Nikith.Ganigarakoppal@pmcs.com>
      Acked-by: NJack Wang <jinpu.wang@cloud.ionos.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      e802fc43
  22. 16 6月, 2020 1 次提交
  23. 18 3月, 2020 5 次提交
  24. 03 1月, 2020 1 次提交
    • A
      compat_ioctl: scsi: handle HDIO commands from drivers · 75c0b0e1
      Arnd Bergmann 提交于
      The ata_sas_scsi_ioctl() function implements a number of HDIO_* commands
      for SCSI devices, it is used by all libata drivers as well as a few
      drivers that support SAS attached SATA drives.
      
      The only command that is not safe for compat ioctls here is
      HDIO_GET_32BIT. Change the implementation to check for in_compat_syscall()
      in order to do both cases correctly, and change all callers to use it
      as both native and compat callback pointers, including the indirect
      callers through sas_ioctl and ata_scsi_ioctl.
      Reviewed-by: NBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      75c0b0e1
  25. 20 11月, 2019 1 次提交