public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel@vger.kernel.org
Subject: Re: drivers using the non-PCI dma_set_mask() on PCI devices
Date: Mon, 22 Dec 2008 22:43:33 -0600	[thread overview]
Message-ID: <49506C75.8010200@shaw.ca> (raw)
In-Reply-To: <200812222132.mBMLWrNU028431@harpo.it.uu.se>

Mikael Pettersson wrote:
> Several drivers do the following:
> 
> 	struct pci_dev *pdev = ...;
> 	...
> 	if (dma_set_mask(&pdev->dev, mask))
> 		...
> 
> But pdev->dev.dma_mask == &pdev->dma_mask, so this is essentially a
> roundabout way of saying
> 
> 	if (pci_set_dma_mask(pdev, mask))
> 
> except that it bypasses the PCI-specific operations pci_set_dma_mask()
> may do on that platform.
> 
> Drivers doing this include drivers/scsi/aic7xxx/aic79xx_osm_pci.c,
> drivers/scsi/aic7xxxx/aic7xxx_osm_pci.c, drivers/scsi/qla2xxx/qla_os.c,
> drivers/net/wireless/rt2x00/rt2x00pci.c, and drivers/media/video/meye.c.
> 
> Is it considered acceptable that drivers bypass the PCI DMA API on
> PCI devices like this, or are these drivers in error?
> 
> I'm doing some work on an embedded platform (ARM IXP4xx) with some
> PCI DMA restrictions. To handle these the platform provides its own
> versions of pci_set_dma_mask() and pci_set_consistent_dma_mask(),
> but its dma_set_mask() currently does not do anything PCI-specific.
> The question is: should dma_set_mask() have PCI knowledge or not?

AFAIK pci_set_dma_mask is somewhat deprecated, and dma_set_mask should 
be used instead. If the platform fails to do what's needed when 
dma_set_mask is called on a PCI device then it would seem the platform 
code is in error.


      reply	other threads:[~2008-12-23  4:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22 21:32 drivers using the non-PCI dma_set_mask() on PCI devices Mikael Pettersson
2008-12-23  4:43 ` Robert Hancock [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49506C75.8010200@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox