On Mon, Oct 01, 2018 at 04:57:39PM -0400, tedheadster wrote:
> Christoph,
>   I was able to bisect this to your patch "scsi: reduce use of block
> bounce buffers". I am getting the error on a 32-bit Dell PowerEdge
> 6650. It has the aic7xxx integrated onto the motherboard.
> 
> Again, here is the error:
> 
> aic7xxx 0000:00:03.0: dma_direct_map_sg: overflow
> 0x00000003ff800000+65536 of device mask ffffffff
> 
> I wonder if the odd 39-bit mask used in aic7xxx is part of the problem?

It probably is involved in one way or another..  How much memory
does the system have?

The odd thing is that the above claims you have a 32-bit dma mask,
but we also aren't using swiotlb.

Can you check if the patch below gives any interesting news?  Please
attach the full dmesg, just in case.

diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c 
b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 0fc14dac7070..3dd198e6f962 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -237,18 +237,37 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
        }
        pci_set_master(pdev);
 
-       if (sizeof(dma_addr_t) > 4
-           && ahc->features & AHC_LARGE_SCBS
-           && dma_set_mask(dev, mask_39bit) == 0
-           && dma_get_required_mask(dev) > DMA_BIT_MASK(32)) {
-               ahc->flags |= AHC_39BIT_ADDRESSING;
-       } else {
-               if (dma_set_mask(dev, DMA_BIT_MASK(32))) {
-                       ahc_free(ahc);
-                       printk(KERN_WARNING "aic7xxx: No suitable DMA 
available.\n");
-                       return (-ENODEV);
-               }
+       if (sizeof(dma_addr_t) <= 4) {
+               printk("aic7xxx: 32-bit dma-addr_t\n");
+               goto set_32bit_dma;
+       }
+
+       if (!(ahc->features & AHC_LARGE_SCBS)) {
+               printk("aic7xxx: large SCBS not supported\n");
+               goto set_32bit_dma;
+       }
+
+       if (dma_set_mask(dev, mask_39bit)) {
+               printk("aic7xxx: failed to set 39-bit mask\n");
+               goto set_32bit_dma;
+       }
+
+       if (dma_get_required_mask(dev) <= DMA_BIT_MASK(32)) {
+               printk("aic7xxx: large DMA mask not required\n");
+               goto set_32bit_dma;
+       }
+
+       printk("aic7xxx: using 39-bit addressing\n");
+       ahc->flags |= AHC_39BIT_ADDRESSING;
+       goto done;
+
+set_32bit_dma:
+       if (dma_set_mask(dev, DMA_BIT_MASK(32))) {
+               ahc_free(ahc);
+               printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
+                       return (-ENODEV);
        }
+done:
        ahc->dev_softc = pci;
        error = ahc_pci_config(ahc, entry);
        if (error != 0) {

Reply via email to