<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    Hi Russell,<br>
    <br>
    Is it possible to pick up James patch below? Thread here:
    <a class="moz-txt-link-freetext" href="http://comments.gmane.org/gmane.linux.kernel.mmc/18670">http://comments.gmane.org/gmane.linux.kernel.mmc/18670</a>, have the
    details on the motivation behind this fix.<br>
    <br>
    Regards,<br>
    Subhash<br>
    <div class="moz-forward-container"><br>
      -------- Original Message --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th nowrap="nowrap" valign="BASELINE" align="RIGHT">Subject:
            </th>
            <td>Re: [PATCH v2 1/1] block: blk-merge: don't merge the
              pages with non-contiguous descriptors</td>
          </tr>
          <tr>
            <th nowrap="nowrap" valign="BASELINE" align="RIGHT">Date: </th>
            <td>Wed, 16 Jan 2013 18:09:14 +0530</td>
          </tr>
          <tr>
            <th nowrap="nowrap" valign="BASELINE" align="RIGHT">From: </th>
            <td>Subhash Jadavani <a class="moz-txt-link-rfc2396E" href="mailto:subhashj@codeaurora.org"><subhashj@codeaurora.org></a></td>
          </tr>
          <tr>
            <th nowrap="nowrap" valign="BASELINE" align="RIGHT">To: </th>
            <td>James Bottomley
              <a class="moz-txt-link-rfc2396E" href="mailto:James.Bottomley@HansenPartnership.com"><James.Bottomley@HansenPartnership.com></a></td>
          </tr>
          <tr>
            <th nowrap="nowrap" valign="BASELINE" align="RIGHT">CC: </th>
            <td><a class="moz-txt-link-abbreviated" href="mailto:linux-kernel@vger.kernel.org">linux-kernel@vger.kernel.org</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:linux-scsi@vger.kernel.org">linux-scsi@vger.kernel.org</a>, <a class="moz-txt-link-abbreviated" href="mailto:linux-mmc@vger.kernel.org">linux-mmc@vger.kernel.org</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:linux-arm-msm@vger.kernel.org">linux-arm-msm@vger.kernel.org</a>, <a class="moz-txt-link-abbreviated" href="mailto:martin.petersen@oracle.com">martin.petersen@oracle.com</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:asias@redhat.com">asias@redhat.com</a>, <a class="moz-txt-link-abbreviated" href="mailto:tj@kernel.org">tj@kernel.org</a>,
              <a class="moz-txt-link-abbreviated" href="mailto:linux-arm-kernel@lists.infradead.org">linux-arm-kernel@lists.infradead.org</a>, Russell King
              <a class="moz-txt-link-rfc2396E" href="mailto:linux@arm.linux.org.uk"><linux@arm.linux.org.uk></a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>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 <a class="moz-txt-link-rfc2396E" href="mailto:JBottomley@Parallels.com"><JBottomley@Parallels.com></a>

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 <a class="moz-txt-link-abbreviated" href="mailto:majordomo@vger.kernel.org">majordomo@vger.kernel.org</a>
> More majordomo info at  <a class="moz-txt-link-freetext" href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to <a class="moz-txt-link-abbreviated" href="mailto:majordomo@vger.kernel.org">majordomo@vger.kernel.org</a>
More majordomo info at  <a class="moz-txt-link-freetext" href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a>
</pre>
      <br>
    </div>
    <br>
  </body>
</html>