* [PATCH v2] scsi: qla1280.c
@ 2024-10-31 12:54 Magnus Lindholm
2024-10-31 14:39 ` Thomas Bogendoerfer
0 siblings, 1 reply; 3+ messages in thread
From: Magnus Lindholm @ 2024-10-31 12:54 UTC (permalink / raw)
To: linux-scsi, James.Bottomley, mdr, martin.petersen, linmag7
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.
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
---
drivers/scsi/qla1280.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 8958547ac111..a732aaa3658a 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -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;
--
2.47.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] scsi: qla1280.c
2024-10-31 12:54 [PATCH v2] scsi: qla1280.c Magnus Lindholm
@ 2024-10-31 14:39 ` Thomas Bogendoerfer
2024-10-31 15:24 ` Magnus Lindholm
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bogendoerfer @ 2024-10-31 14:39 UTC (permalink / raw)
To: Magnus Lindholm; +Cc: linux-scsi, James.Bottomley, mdr, martin.petersen
On Thu, 31 Oct 2024 13:54:08 +0100
Magnus Lindholm <linmag7@gmail.com> 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, limit DMA_BIT_MASK to 32-bit.
> [..]
> #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);
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.
--
SUSE Software Solutions Germany GmbH
HRB 36809 (AG Nürnberg)
Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] scsi: qla1280.c
2024-10-31 14:39 ` Thomas Bogendoerfer
@ 2024-10-31 15:24 ` Magnus Lindholm
0 siblings, 0 replies; 3+ messages in thread
From: Magnus Lindholm @ 2024-10-31 15:24 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-scsi, James.Bottomley, martin.petersen
Thanks so much for testing! I'll need to look more into why this fails
on Alpha then.
Magnus
> 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.
>
> --
> SUSE Software Solutions Germany GmbH
> HRB 36809 (AG Nürnberg)
> Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-31 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-31 12:54 [PATCH v2] scsi: qla1280.c Magnus Lindholm
2024-10-31 14:39 ` Thomas Bogendoerfer
2024-10-31 15:24 ` Magnus Lindholm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox