linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: bfa: Remove useless DMA-32 fallback configuration
@ 2022-01-15  9:15 Christophe JAILLET
  2022-01-19  3:54 ` 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  9:15 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru, 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/bfa/bfad.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 440ef32be048..e5aa982ffedc 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -732,9 +732,6 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
 	pci_set_master(pdev);
 
 	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-	if (rc)
-		rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
-
 	if (rc) {
 		rc = -ENODEV;
 		printk(KERN_ERR "dma_set_mask_and_coherent fail %p\n", pdev);
@@ -1559,9 +1556,6 @@ bfad_pci_slot_reset(struct pci_dev *pdev)
 	pci_set_master(pdev);
 
 	rc = dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(64));
-	if (rc)
-		rc = dma_set_mask_and_coherent(&bfad->pcidev->dev,
-					       DMA_BIT_MASK(32));
 	if (rc)
 		goto out_disable_device;
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: bfa: Remove useless DMA-32 fallback configuration
  2022-01-15  9:15 [PATCH] scsi: bfa: Remove useless DMA-32 fallback configuration Christophe JAILLET
@ 2022-01-19  3:54 ` 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:54 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Anil Gurumurthy, Sudarsana Kalluru, 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: bfa: Remove useless DMA-32 fallback configuration
  2022-01-15  9:15 [PATCH] scsi: bfa: Remove useless DMA-32 fallback configuration Christophe JAILLET
  2022-01-19  3:54 ` 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: Anil Gurumurthy, James E.J. Bottomley, Sudarsana Kalluru,
	Christophe JAILLET
  Cc: Martin K . Petersen, linux-kernel, linux-scsi, kernel-janitors

On Sat, 15 Jan 2022 10:15:41 +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: bfa: Remove useless DMA-32 fallback configuration
      https://git.kernel.org/mkp/scsi/c/012d98dae453

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-25  5:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15  9:15 [PATCH] scsi: bfa: Remove useless DMA-32 fallback configuration Christophe JAILLET
2022-01-19  3:54 ` Martin K. Petersen
2022-01-25  5:40 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).