* [PATCH] scsi: 3w-sas: Remove useless DMA-32 fallback configuration
@ 2022-01-15 8:53 Christophe JAILLET
2022-01-19 3:53 ` Martin K. Petersen
2022-01-25 5:40 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2022-01-15 8:53 UTC (permalink / raw)
To: Adam Radford, James E.J. Bottomley, Martin K. Petersen
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-scsi
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.
Simplify code and remove some dead code accordingly.
[1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/scsi/3w-sas.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index b9482da79512..3ebe66151dcb 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -1567,8 +1567,6 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
pci_try_set_mwi(pdev);
retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (retval)
- retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask");
retval = -ENODEV;
@@ -1786,8 +1784,6 @@ static int __maybe_unused twl_resume(struct device *dev)
pci_try_set_mwi(pdev);
retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
- if (retval)
- retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume");
retval = -ENODEV;
--
2.32.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: 3w-sas: Remove useless DMA-32 fallback configuration
2022-01-15 8:53 [PATCH] scsi: 3w-sas: Remove useless DMA-32 fallback configuration Christophe JAILLET
@ 2022-01-19 3:53 ` Martin K. Petersen
2022-01-25 5:40 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-01-19 3:53 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Adam Radford, James E.J. Bottomley, Martin K. Petersen,
linux-kernel, kernel-janitors, linux-scsi
Christophe,
> As stated in [1], dma_set_mask() with a 64-bit mask never fails if
> dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will
> also fail for the same reason.
Applied to 5.17/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: 3w-sas: Remove useless DMA-32 fallback configuration
2022-01-15 8:53 [PATCH] scsi: 3w-sas: Remove useless DMA-32 fallback configuration Christophe JAILLET
2022-01-19 3:53 ` Martin K. Petersen
@ 2022-01-25 5:40 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-01-25 5:40 UTC (permalink / raw)
To: Adam Radford, James E.J. Bottomley, Christophe JAILLET
Cc: Martin K . Petersen, linux-scsi, linux-kernel, kernel-janitors
On Sat, 15 Jan 2022 09:53:03 +0100, Christophe JAILLET wrote:
> As stated in [1], dma_set_mask() with a 64-bit mask never fails if
> dev->dma_mask is non-NULL.
> So, if it fails, the 32 bits case will also fail for the same reason.
>
> Simplify code and remove some dead code accordingly.
>
> [1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t
>
> [...]
Applied to 5.17/scsi-fixes, thanks!
[1/1] scsi: 3w-sas: Remove useless DMA-32 fallback configuration
https://git.kernel.org/mkp/scsi/c/fb8d5ea8fd90
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-25 5:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 8:53 [PATCH] scsi: 3w-sas: Remove useless DMA-32 fallback configuration Christophe JAILLET
2022-01-19 3:53 ` Martin K. Petersen
2022-01-25 5:40 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.