All of lore.kernel.org
 help / color / mirror / Atom feed
From: Subhash Jadavani <subhashj@codeaurora.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	martin.petersen@oracle.com, asias@redhat.com, tj@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Russell King <linux@arm.linux.org.uk>
Subject: Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors
Date: Wed, 16 Jan 2013 18:09:14 +0530	[thread overview]
Message-ID: <50F69F72.4030807@codeaurora.org> (raw)
In-Reply-To: <1358332355.2384.11.camel@dabdike.int.hansenpartnership.com>

On 1/16/2013 4:02 PM, James Bottomley wrote:
> On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote:
>
>> Now consider this call stack from MMC block driver (this is on the ARmv7
>> based board):
>>       [   98.918174] [<c001b50c>] (v7_dma_inv_range+0x30/0x48) from
>> [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c)
>>       [   98.927819] [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c) from
>> [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c)
>>       [   98.937982] [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c) from
>> [<c0017ff8>] (dma_map_sg+0x3c/0x114)
> OK, so this is showing that ARM itself is making the assumption that the
> pages are contiguous in the page offset map.
>
> Fix this by doing the increment via the pfn, which will do the right
> thing whatever the memory model.
>
> Signed-off-by: James Bottomley <JBottomley@Parallels.com>

Thanks James. Yes, it make sense to fix the ARM code itself if it is the 
only one giving this trouble.
I have tried your change below and it also fixes this issue (without 
having my blk-merge patch). I will forward your change to Russel King to 
see what he thinks about it.

Regards,
Subhash
>
> ---
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index 6b2fb87..ab88c5b 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -809,7 +809,7 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset,
>   			op(vaddr, len, dir);
>   		}
>   		offset = 0;
> -		page++;
> +		page = pfn_to_page(page_to_pfn(page) + 1);
>   		left -= len;
>   	} while (left);
>   }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: subhashj@codeaurora.org (Subhash Jadavani)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors
Date: Wed, 16 Jan 2013 18:09:14 +0530	[thread overview]
Message-ID: <50F69F72.4030807@codeaurora.org> (raw)
In-Reply-To: <1358332355.2384.11.camel@dabdike.int.hansenpartnership.com>

On 1/16/2013 4:02 PM, James Bottomley wrote:
> On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote:
>
>> Now consider this call stack from MMC block driver (this is on the ARmv7
>> based board):
>>       [   98.918174] [<c001b50c>] (v7_dma_inv_range+0x30/0x48) from
>> [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c)
>>       [   98.927819] [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c) from
>> [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c)
>>       [   98.937982] [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c) from
>> [<c0017ff8>] (dma_map_sg+0x3c/0x114)
> OK, so this is showing that ARM itself is making the assumption that the
> pages are contiguous in the page offset map.
>
> Fix this by doing the increment via the pfn, which will do the right
> thing whatever the memory model.
>
> Signed-off-by: James Bottomley <JBottomley@Parallels.com>

Thanks James. Yes, it make sense to fix the ARM code itself if it is the 
only one giving this trouble.
I have tried your change below and it also fixes this issue (without 
having my blk-merge patch). I will forward your change to Russel King to 
see what he thinks about it.

Regards,
Subhash
>
> ---
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index 6b2fb87..ab88c5b 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -809,7 +809,7 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset,
>   			op(vaddr, len, dir);
>   		}
>   		offset = 0;
> -		page++;
> +		page = pfn_to_page(page_to_pfn(page) + 1);
>   		left -= len;
>   	} while (left);
>   }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-01-16 12:39 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 16:01 [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors Subhash Jadavani
2013-01-15 16:19 ` James Bottomley
2013-01-16  6:37   ` Subhash Jadavani
2013-01-16  9:25     ` James Bottomley
2013-01-16 10:32     ` James Bottomley
2013-01-16 10:32       ` James Bottomley
2013-01-16 12:39       ` Subhash Jadavani [this message]
2013-01-16 12:39         ` Subhash Jadavani
2013-01-16 12:47         ` ARM DMA: Fix in dma_cache_maint_page Subhash Jadavani
2013-01-16 12:47           ` Subhash Jadavani
2013-01-16 12:51           ` James Bottomley
2013-01-16 12:51             ` James Bottomley
2013-01-16 13:08             ` Russell King - ARM Linux
2013-01-16 13:08               ` Russell King - ARM Linux
2013-01-16 15:50               ` James Bottomley
2013-01-16 15:50                 ` James Bottomley
2013-01-16 23:14       ` [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors Russell King - ARM Linux
2013-01-16 23:14         ` Russell King - ARM Linux
2013-01-17  8:54         ` James Bottomley
2013-01-17  8:54           ` James Bottomley
2013-01-16 23:18       ` Tejun Heo
2013-01-16 23:18         ` Tejun Heo
2013-01-17  9:11         ` James Bottomley
2013-01-17  9:11           ` James Bottomley
2013-01-17 10:37           ` Russell King - ARM Linux
2013-01-17 10:37             ` Russell King - ARM Linux
2013-01-17 10:47             ` Russell King - ARM Linux
2013-01-17 10:47               ` Russell King - ARM Linux
2013-01-17 11:01               ` James Bottomley
2013-01-17 11:01                 ` James Bottomley
2013-01-17 11:04                 ` Russell King - ARM Linux
2013-01-17 11:04                   ` Russell King - ARM Linux
2013-01-17 11:19                   ` James Bottomley
2013-01-17 11:19                     ` James Bottomley
2013-01-17 11:40                     ` Russell King - ARM Linux
2013-01-17 11:40                       ` Russell King - ARM Linux
2013-01-17 14:58               ` Subhash Jadavani
2013-01-17 14:58                 ` Subhash Jadavani

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=50F69F72.4030807@codeaurora.org \
    --to=subhashj@codeaurora.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=asias@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=martin.petersen@oracle.com \
    --cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.