From: "Akinobu Mita" <mita@fixstars.com>
To: Sujit Reddy Thumma <sthumma@codeaurora.org>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>,
Akinobu Mita <mita@fixstars.com>,
linux-scsi@vger.kernel.org,
Vinayak Holikatti <vinholikatti@gmail.com>,
Santosh Y <santoshsy@gmail.com>,
devicetree@vger.kernel.org,
Russell King <rmk+kernel@arm.linux.org.uk>
Subject: Re: [PATCH 1/2] ufs-pltfrm: initialize DMA mask for device-tree probed device
Date: Wed, 21 Aug 2013 00:03:50 +0900 [thread overview]
Message-ID: <ed58bd5b910baee6aa4c53752a45ecbc.squirrel@webmail.fixstars.com> (raw)
In-Reply-To: <52131A1D.2060907@codeaurora.org>
> On 8/19/2013 8:02 PM, James Bottomley wrote:
>> On Mon, 2013-08-19 at 22:56 +0900, Akinobu Mita wrote:
>>> The device-tree probed device for ARM doesn't have dev->dma_mask.
>>> So dma_set_mask() for the device doesn't succeed. The popular trick
>>> for this is - dev->dma_mask = &dev->coherent_dma_mask;
>>>
>>> Currently there is no dma_set_mask() call in ufs-pltfrm, but the
>>> forthcoming fix needs proper DMA mask setting in ufs core driver. So
>>> initializing dev->dma_mask as described above is required.
>>>
>>> Signed-off-by: Akinobu Mita <mita@fixstars.com>
>>> Cc: Sujit Reddy Thumma <sthumma@codeaurora.org>
>>> Cc: Vinayak Holikatti <vinholikatti@gmail.com>
>>> Cc: Santosh Y <santoshsy@gmail.com>
>>> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
>>> Cc: linux-scsi@vger.kernel.org
>>> ---
>>> drivers/scsi/ufs/ufshcd-pltfrm.c | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c
>>> b/drivers/scsi/ufs/ufshcd-pltfrm.c
>>> index 94ba40c..c780840 100644
>>> --- a/drivers/scsi/ufs/ufshcd-pltfrm.c
>>> +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
>>> @@ -122,6 +122,9 @@ static int ufshcd_pltfrm_probe(struct
>>> platform_device *pdev)
>>> goto out;
>>> }
>>>
>>> +if (!dev->dma_mask)
>>> +dev->dma_mask = &dev->coherent_dma_mask;
>>> +
>>
>> If the DMA mask is NULL, it means there's buggy platform code somewhere;
>> I'm not sure we should be hacking a fix in a SCSI driver.
>
> Yes, ideally DT core should do this, there are patches lying around but
> are not converged. Adding devicetree@vger.kernel.org to see if someone
> has better suggestions.
>
> Recent additions to kernel with similar hacks -
> https://patchwork.kernel.org/patch/2537021/
The discussion in that thread is useful. Also, I found that Russell King
proposed replacing the boilerplate by using dma_coerce_mask_and_coherent()
in his patch set "Preview of DMA mask changes".
https://patchwork.kernel.org/patch/2837359/
next prev parent reply other threads:[~2013-08-20 15:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-19 13:56 [PATCH 1/2] ufs-pltfrm: initialize DMA mask for device-tree probed device Akinobu Mita
2013-08-19 13:56 ` [PATCH 2/2] ufs: fix DMA mask setting Akinobu Mita
2013-08-19 14:32 ` [PATCH 1/2] ufs-pltfrm: initialize DMA mask for device-tree probed device James Bottomley
2013-08-20 7:26 ` Sujit Reddy Thumma
2013-08-20 15:03 ` Akinobu Mita [this message]
2013-08-20 20:54 ` Russell King - ARM Linux
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=ed58bd5b910baee6aa4c53752a45ecbc.squirrel@webmail.fixstars.com \
--to=mita@fixstars.com \
--cc=devicetree@vger.kernel.org \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=santoshsy@gmail.com \
--cc=sthumma@codeaurora.org \
--cc=vinholikatti@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).