Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df49fd0f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Nine small fixes.

  The resume fix is a cosmetic removal of a warning with an incorrect
  condition causing it to alarm people wrongly.

  The other eight patches correct a thinko in Christoph Hellwig's DMA
  conversion series. Without it all these drivers end up with 32 bit DMA
  masks meaning they bounce any page over 4GB before sending it to the
  controller.

  Nowadays, even laptops mostly have memory above 4GB, so this can lead
  to significant performance degradation with all the bouncing"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: core: Avoid that system resume triggers a kernel warning
  scsi: hptiop: fix calls to dma_set_mask()
  scsi: hisi_sas: fix calls to dma_set_mask_and_coherent()
  scsi: csiostor: fix calls to dma_set_mask_and_coherent()
  scsi: bfa: fix calls to dma_set_mask_and_coherent()
  scsi: aic94xx: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-sas: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-9xxx: fix calls to dma_set_mask_and_coherent()
  scsi: lpfc: fix calls to dma_set_mask_and_coherent()
parents c93d9218 388b4e6a
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2009,7 +2009,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
	struct Scsi_Host *host = NULL;
	TW_Device_Extension *tw_dev;
	unsigned long mem_addr, mem_len;
	int retval = -ENODEV;
	int retval;

	retval = pci_enable_device(pdev);
	if (retval) {
@@ -2020,8 +2020,10 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
	pci_set_master(pdev);
	pci_try_set_mwi(pdev);

	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
	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, 0x23, "Failed to set dma mask");
		retval = -ENODEV;
		goto out_disable_device;
@@ -2240,8 +2242,10 @@ static int twa_resume(struct pci_dev *pdev)
	pci_set_master(pdev);
	pci_try_set_mwi(pdev);

	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
	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, 0x40, "Failed to set dma mask during resume");
		retval = -ENODEV;
		goto out_disable_device;
+8 −4
Original line number Diff line number Diff line
@@ -1573,8 +1573,10 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
	pci_set_master(pdev);
	pci_try_set_mwi(pdev);

	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
	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;
		goto out_disable_device;
@@ -1805,8 +1807,10 @@ static int twl_resume(struct pci_dev *pdev)
	pci_set_master(pdev);
	pci_try_set_mwi(pdev);

	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
	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;
		goto out_disable_device;
+5 −3
Original line number Diff line number Diff line
@@ -769,9 +769,11 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
	if (err)
		goto Err_remove;

	err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
	if (err)
		err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
	if (err) {
		err = -ENODEV;
	if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32))) {
		asd_printk("no suitable DMA mask for %s\n", pci_name(dev));
		goto Err_remove;
	}
+13 −5
Original line number Diff line number Diff line
@@ -739,8 +739,12 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)

	pci_set_master(pdev);

	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
	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);
		goto out_release_region;
	}
@@ -1534,6 +1538,7 @@ bfad_pci_slot_reset(struct pci_dev *pdev)
{
	struct bfad_s *bfad = pci_get_drvdata(pdev);
	u8 byte;
	int rc;

	dev_printk(KERN_ERR, &pdev->dev,
		   "bfad_pci_slot_reset flags: 0x%x\n", bfad->bfad_flags);
@@ -1561,8 +1566,11 @@ bfad_pci_slot_reset(struct pci_dev *pdev)
	pci_save_state(pdev);
	pci_set_master(pdev);

	if (dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(32)))
	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;

	if (restart_bfa(bfad) == -1)
+5 −2
Original line number Diff line number Diff line
@@ -210,8 +210,11 @@ csio_pci_init(struct pci_dev *pdev, int *bars)
	pci_set_master(pdev);
	pci_try_set_mwi(pdev);

	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
	rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
	if (rv)
		rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
	if (rv) {
		rv = -ENODEV;
		dev_err(&pdev->dev, "No suitable DMA available.\n");
		goto err_release_regions;
	}
Loading