scsi: qla1280.c
Subsystems (2)
PATCH v2 1/1 scsi: qla1280.c
In order to prevent file system corruption on disks attached
to 32-bit ISP1020/1040 cards in 64-bit enabled systems, while maintaing the possibility to run other qlogic cards in 64-bit mode, limit DMA_BIT_MASK to 32-bit.
--- drivers/scsi/qla1280.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/scsi/qla1280.c +12 -3
@@ -8,9 +8,12 @@* Copyright (C) 2003-2004 Christoph Hellwig * ******************************************************************************/ -#define QLA1280_VERSION "3.27.1" +#define QLA1280_VERSION "3.27.2"/***************************************************************************** Revision History: +Rev 3.27.2, October 31, 2024, Magnus Lindholm +- Limit DMA_BIT_MASK to 32-bit for QLA1020 and QLA1040 cards in order to prevent +file system corruption on some platforms Rev 3.27.1, February 8, 2010, Michael Reed - Retain firmware image for error recovery. Rev 3.27, February 10, 2009, Michael Reed
@@ -4142,6 +4145,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)struct qla_boards *bdp = &ql1280_board_tbl[devnum];struct Scsi_Host *host;struct scsi_qla_host *ha; +u64 mask;int error = -ENODEV ;/* Bypass all AMI SUBSYS VENDOR IDs */
@@ -4177,8 +4181,13 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->devnum = devnum;/* specifies microcode load address */ #ifdef QLA_64BIT_PTR -if (dma_set_mask_and_coherent (&ha->pdev->dev,DMA_BIT_MASK (64 ))) { -if (dma_set_mask (&ha->pdev->dev,DMA_BIT_MASK (32 ))) { +/* for 1020 and 1040, force 32-bit DMA mask */ +if (IS_ISP1040 (ha)) + mask =DMA_BIT_MASK (32 ); +else + mask =DMA_BIT_MASK (64 ); +if (dma_set_mask_and_coherent (&ha->pdev->dev, mask)) { +if (dma_set_mask (&ha->pdev->dev, mask)) {printk (KERN_WARNING "scsi(%li): Unable to set a " "suitable DMA mask - aborting\n" , ha->host_no); error = -ENODEV ;
Signature · 1 line
2.47.0
drivers/scsi/qla1280.c qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) · line 4188
Quoted 12 lines · On Thu, 31 Oct 2024 13:54:08 +0100 Magnus Lindholm <[email protected]> wrote:
In order to prevent file system corruption on disks attached
to 32-bit ISP1020/1040 cards in 64-bit enabled systems, while maintaing the possibility to run other qlogic cards in 64-bit mode, limitDMA_BIT_MASKto 32-bit. [..]
#ifdefQLA_64BIT_PTRdrivers/scsi/qla1280.c +5
-2-if (dma_set_mask_and_coherent (&ha->pdev->dev,DMA_BIT_MASK (64 ))) { -if (dma_set_mask (&ha->pdev->dev,DMA_BIT_MASK (32 ))) { +/* for 1020 and 1040, force 32-bit DMA mask */ +if (IS_ISP1040 (ha)) + mask =DMA_BIT_MASK (32 ); +else + mask =DMA_BIT_MASK (64 );
this breaks SGI Octane and SGI Origin systems:
qla1280: QLA1040 found on PCI bus 0, dev 0
qla1280 0000:00:00.0: enabling device (0006 -> 0007)
qla1280: Failed to get request memory
qla1280 0000:00:00.0: probe with driver qla1280 failed with error -12
qla1280: QLA1040 found on PCI bus 0, dev 1
qla1280 0000:00:01.0: enabling device (0006 -> 0007)
qla1280: Failed to get request memory
qla1280 0000:00:01.0: probe with driver qla1280 failed with error -12
They need 64bit DMA addresses.
Thomas.
Signature · 3 lines
SUSE Software Solutions Germany GmbH HRB 36809 (AG Nürnberg) Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich
Thanks so much for testing! I'll need to look more into why this fails on Alpha then.
Magnus
Quoted 19 lines
this breaks SGI Octane and SGI Origin systems:
qla1280: QLA1040 found on PCI bus 0, dev 0
qla1280 0000:00:00.0: enabling device (0006 -> 0007)
qla1280: Failed to get request memory
qla1280 0000:00:00.0: probe with driver qla1280 failed with error -12
qla1280: QLA1040 found on PCI bus 0, dev 1
qla1280 0000:00:01.0: enabling device (0006 -> 0007)
qla1280: Failed to get request memory
qla1280 0000:00:01.0: probe with driver qla1280 failed with error -12They need 64bit DMA addresses.
Thomas.
--
SUSE Software Solutions Germany GmbH
HRB 36809 (AG Nürnberg)
Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich