devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sujit Reddy Thumma <sthumma@codeaurora.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Akinobu Mita <mita@fixstars.com>,
	linux-scsi@vger.kernel.org,
	Vinayak Holikatti <vinholikatti@gmail.com>,
	Santosh Y <santoshsy@gmail.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] ufs-pltfrm: initialize DMA mask for device-tree probed device
Date: Tue, 20 Aug 2013 12:56:21 +0530	[thread overview]
Message-ID: <52131A1D.2060907@codeaurora.org> (raw)
In-Reply-To: <1376922720.2069.10.camel@dabdike.int.hansenpartnership.com>

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/


-- 
Regards,
Sujit

       reply	other threads:[~2013-08-20  7:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1376920566-20325-1-git-send-email-mita@fixstars.com>
     [not found] ` <1376922720.2069.10.camel@dabdike.int.hansenpartnership.com>
2013-08-20  7:26   ` Sujit Reddy Thumma [this message]
2013-08-20 15:03     ` [PATCH 1/2] ufs-pltfrm: initialize DMA mask for device-tree probed device Akinobu Mita
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=52131A1D.2060907@codeaurora.org \
    --to=sthumma@codeaurora.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mita@fixstars.com \
    --cc=santoshsy@gmail.com \
    --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).