>  ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id 
> *ent)
>  {
>       char             buf[80];
> +     const uint64_t   mask_39bit = 0x7FFFFFFFFFULL;
>       struct           ahd_softc *ahd;
>       ahd_dev_softc_t  pci;
>       struct           ahd_pci_identity *entry;
>       char            *name;
>       int              error;
> +     struct device   *dev = &pdev->dev;
>  
>       pci = pdev;
>       entry = ahd_find_pci_device(pci);
> @@ -161,20 +163,17 @@ ahd_linux_pci_dev_probe(struct pci_dev *
>       pci_set_master(pdev);
>  
>       if (sizeof(dma_addr_t) > 4) {
> -             uint64_t   memsize;
> -             const uint64_t mask_39bit = 0x7FFFFFFFFFULL;
> -
> -             memsize = ahd_linux_get_memsize();
> -
> -             if (memsize >= 0x8000000000ULL
> -              && pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
> +             if (dma_set_mask(dev, DMA_64BIT_MASK)
> +                 && dma_get_required_mask(dev) > mask_39bit)
>                       ahd->flags |= AHD_64BIT_ADDRESSING;
> -             } else if (memsize > 0x80000000
> -                     && pci_set_dma_mask(pdev, mask_39bit) == 0) {
> +             else if (dma_set_mask(dev, mask_39bit) == 0
> +                      && dma_get_required_mask(dev) > DMA_32BIT_MASK)
>                       ahd->flags |= AHD_39BIT_ADDRESSING;
> -             }
> +             else
> +                     dma_set_mask(dev, DMA_32BIT_MASK);
> +                     
>       } else {
> -             pci_set_dma_mask(pdev, DMA_32BIT_MASK);
> +             dma_set_mask(dev, DMA_32BIT_MASK);

The logic here seems odd to me.  Shouldn't we first check
dma_get_required_mask and the do dma_set_mask?

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to