From: Scott Wood <scottwood@freescale.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Greg KH <greg@kroah.com>, <linuxppc-dev@ozlabs.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] powerpc: Dont require a dma_ops struct to set dma mask
Date: Wed, 22 Jun 2011 12:53:20 -0500 [thread overview]
Message-ID: <20110622125320.79b97a9c@schlenkerla.am.freescale.net> (raw)
In-Reply-To: <1308744176-24491-3-git-send-email-galak@kernel.crashing.org>
On Wed, 22 Jun 2011 07:02:56 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:
> The only reason to require a dma_ops struct is to see if it has
> implemented set_dma_mask. If not we can fall back to setting the mask
> directly.
>
> This resolves an issue with how to sequence the setting of a DMA mask
> for platform devices. Before we had an issue in that we have no way of
> setting the DMA mask before the various low level bus notifiers get
> called that might check it (swiotlb).
>
> So now we can do:
>
> pdev = platform_device_alloc("foobar", 0);
> dma_set_mask(&pdev->dev, DMA_BIT_MASK(37));
> platform_device_register(pdev);
Despite what Documentation/driver-model/platform.txt says, it looks like
platform_device_add() is what you want after platform_device_alloc().
Otherwise device_initialize() gets called twice, as would a call to the
archdata hook if one is added to platform_device_register().
-Scott
next prev parent reply other threads:[~2011-06-22 17:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 12:02 [PATCH 1/3] driver core: Add ability for arch code to setup pdev_archdata Kumar Gala
2011-06-22 12:02 ` [PATCH 2/3] powerpc: implement arch_setup_pdev_archdata Kumar Gala
2011-06-22 12:02 ` [PATCH 3/3] powerpc: Dont require a dma_ops struct to set dma mask Kumar Gala
2011-06-22 17:53 ` Scott Wood [this message]
2011-06-22 14:37 ` [PATCH 1/3] driver core: Add ability for arch code to setup pdev_archdata Mike Frysinger
2011-06-22 15:09 ` [PATCH v2 " Kumar Gala
2011-06-22 17:52 ` Scott Wood
2011-06-23 11:33 ` [PATCH v3 " Kumar Gala
2011-06-23 11:33 ` [PATCH v3 2/3] powerpc: implement arch_setup_pdev_archdata Kumar Gala
2011-06-23 11:33 ` [PATCH v3 3/3] powerpc: Dont require a dma_ops struct to set dma mask Kumar Gala
2011-07-01 22:09 ` [PATCH v3 1/3] driver core: Add ability for arch code to setup pdev_archdata Greg KH
2011-07-07 13:55 ` Kumar Gala
2011-07-07 14:11 ` Greg KH
2011-07-08 4:03 ` Kumar Gala
-- strict thread matches above, loose matches on Subject: below --
2010-08-05 15:15 [PATCH 0/3] " Kumar Gala
2010-08-05 15:15 ` [PATCH 1/3] " Kumar Gala
2010-08-05 15:15 ` [PATCH 2/3] powerpc: implement arch_setup_pdev_archdata Kumar Gala
2010-08-05 15:15 ` [PATCH 3/3] powerpc: Dont require a dma_ops struct to set dma mask Kumar Gala
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=20110622125320.79b97a9c@schlenkerla.am.freescale.net \
--to=scottwood@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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
all inboxes | Powered by JetHome®