From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-scsi@vger.kernel.org
Subject: Re: [RFC/RFT PATCH 3/5] scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations
Date: Fri, 12 Jul 2013 23:25:06 +0100 [thread overview]
Message-ID: <20130712222506.GI24642@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <51E07B6E.5090900@cogentembedded.com>
On Sat, Jul 13, 2013 at 01:55:58AM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 07/13/2013 01:48 AM, Santosh Shilimkar wrote:
>
>> DMA bounce limit is the maximum direct DMA'able memory beyond which
>> bounce buffers has to be used to perform dma operations. SCSI driver
>> relies on dma_mask but its calculation is based on max_*pfn which
>> don't have uniform meaning across architectures. So make use of
>> dma_max_pfn() which is expected to return the DMAable maximum pfn
>> value across architectures.
>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: linux-scsi@vger.kernel.org
>
>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> ---
>> drivers/scsi/scsi_lib.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
>> index 86d5220..e8275fa 100644
>> --- a/drivers/scsi/scsi_lib.c
>> +++ b/drivers/scsi/scsi_lib.c
>> @@ -1668,7 +1668,7 @@ u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost)
>>
>> host_dev = scsi_get_device(shost);
>> if (host_dev && host_dev->dma_mask)
>> - bounce_limit = *host_dev->dma_mask;
>> + bounce_limit = dma_max_pfn(host_dev) << PAGE_SHIFT;
>
> You definitely forgot -1 here.
Please explain your point.
next prev parent reply other threads:[~2013-07-12 22:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1373665694-7580-1-git-send-email-santosh.shilimkar@ti.com>
2013-07-12 21:48 ` [RFC/RFT PATCH 3/5] scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations Santosh Shilimkar
2013-07-12 21:55 ` Sergei Shtylyov
2013-07-12 22:25 ` Russell King - ARM Linux [this message]
2013-07-12 23:08 ` Sergei Shtylyov
2013-07-12 23:42 ` Sergei Shtylyov
2013-07-12 23:57 ` Russell King - ARM Linux
2013-07-26 15:10 ` [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes Russell King - ARM Linux
2013-07-26 16:28 ` Santosh Shilimkar
2013-07-29 11:15 ` Russell King - ARM Linux
2013-07-29 13:26 ` Santosh Shilimkar
2013-07-29 13:40 ` Russell King - ARM Linux
2013-07-29 13:42 ` Santosh Shilimkar
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=20130712222506.GI24642@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=santosh.shilimkar@ti.com \
--cc=sergei.shtylyov@cogentembedded.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