public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes
       [not found] ` <20130726151021.GU24642@n2100.arm.linux.org.uk>
@ 2013-07-26 16:28   ` Santosh Shilimkar
  2013-07-29 11:15     ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Santosh Shilimkar @ 2013-07-26 16:28 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Nicolas Pitre, Jens Axboe, linux-scsi, Catalin Marinas,
	Will Deacon, linux-kernel, Tejun Heo, linux-mmc, Chris Ball,
	linux-arm-kernel

On Friday 26 July 2013 11:10 AM, Russell King - ARM Linux wrote:
> On Fri, Jul 12, 2013 at 05:48:09PM -0400, Santosh Shilimkar wrote:
>> The series is an attempt to move ARM port to NO_BOOTMEM. As discussed
>> on list NO_BOOTMEM move needed updates to max*pfn meaning to be maximum
>> PFNs but that breaks the dma_mask for few block layer drivers since
>> ARM start of physical memory is not PFN0 unlike most of the architectures.
>> Some more read on it is here:
>> 	http://lwn.net/Articles/543408/
>> 	http://lwn.net/Articles/543424/
>>
>> To address this issue, we introduce generic dma_max_pfn() helper which
>> can be overridden from the architectures.
>> 	
>> Another intention behind move to nobootmem is also to convert ARM to
>> switch to memblock and getting rid of bootmem allocator dependency which
>> don't work for LPAE machines which has physical memory starting beyond
>> 4 GB boundary. It needs changes to core kernel and also a new memblock
>> API. More on this can be found here:
>> 	https://lkml.org/lkml/2013/6/29/77
>>
>> I have been trying to cook up these patches with kind help from Russell
>> and we know series don't solve all the dma_mask bad assumptions. But at
>> least I am hoping that it can get the ball rolling.	
>>
>> Comments/testing help is welcome !!
> 
> As this is related to some of the cleanup of dma_mask which I've been
> doing, I think it may make sense to roll this into one tree.  Any
> objection to that?
> 
> Can we get any acks on this stuff from Jens and Jejb etc - especially
> for the bits which touch block/ and for the scsi bits as these are
> touching other subsystems.  (oddly, linux-scsi wasn't on the original
> mail for this series summary.)
> 
Sorry I missed the scsi lists on the summary patch.

While browsing the code I found another spot in mmc layer which
needs fixing. The patch is at the end of the email with Chris
and linux-mmc cc'ed here.

Regards,
Santosh

>From 06a27a784a1fd86bf22adf1b247ac82a7c21d46b Mon Sep 17 00:00:00 2001
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
Date: Fri, 19 Jul 2013 21:36:46 -0400
Subject: [PATCH] mmc: Use dma_max_pfn(dev) helper for bounce_limit
 calculations

DMA bounce limit is the maximum direct DMA'able memory beyond which
bounce buffers has to be used to perform dma operations. MMC queue layer
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: Chris Ball <cjb@laptop.org>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 drivers/mmc/card/queue.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index fa9632e..357bbc5 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -15,6 +15,7 @@
 #include <linux/freezer.h>
 #include <linux/kthread.h>
 #include <linux/scatterlist.h>
+#include <linux/dma-mapping.h>
 
 #include <linux/mmc/card.h>
 #include <linux/mmc/host.h>
@@ -196,7 +197,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
 	struct mmc_queue_req *mqrq_prev = &mq->mqrq[1];
 
 	if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
-		limit = *mmc_dev(host)->dma_mask;
+		limit = dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT;
 
 	mq->card = card;
 	mq->queue = blk_init_queue(mmc_request_fn, lock);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes
  2013-07-26 16:28   ` [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes Santosh Shilimkar
@ 2013-07-29 11:15     ` Russell King - ARM Linux
  2013-07-29 13:26       ` Santosh Shilimkar
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-07-29 11:15 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-kernel, linux-arm-kernel, Catalin Marinas, Will Deacon,
	Nicolas Pitre, Tejun Heo, Jens Axboe, linux-scsi, Chris Ball,
	linux-mmc

On Fri, Jul 26, 2013 at 12:28:26PM -0400, Santosh Shilimkar wrote:
> On Friday 26 July 2013 11:10 AM, Russell King - ARM Linux wrote:
> > On Fri, Jul 12, 2013 at 05:48:09PM -0400, Santosh Shilimkar wrote:
> >> The series is an attempt to move ARM port to NO_BOOTMEM. As discussed
> >> on list NO_BOOTMEM move needed updates to max*pfn meaning to be maximum
> >> PFNs but that breaks the dma_mask for few block layer drivers since
> >> ARM start of physical memory is not PFN0 unlike most of the architectures.
> >> Some more read on it is here:
> >> 	http://lwn.net/Articles/543408/
> >> 	http://lwn.net/Articles/543424/
> >>
> >> To address this issue, we introduce generic dma_max_pfn() helper which
> >> can be overridden from the architectures.
> >> 	
> >> Another intention behind move to nobootmem is also to convert ARM to
> >> switch to memblock and getting rid of bootmem allocator dependency which
> >> don't work for LPAE machines which has physical memory starting beyond
> >> 4 GB boundary. It needs changes to core kernel and also a new memblock
> >> API. More on this can be found here:
> >> 	https://lkml.org/lkml/2013/6/29/77
> >>
> >> I have been trying to cook up these patches with kind help from Russell
> >> and we know series don't solve all the dma_mask bad assumptions. But at
> >> least I am hoping that it can get the ball rolling.	
> >>
> >> Comments/testing help is welcome !!
> > 
> > As this is related to some of the cleanup of dma_mask which I've been
> > doing, I think it may make sense to roll this into one tree.  Any
> > objection to that?
> > 
> > Can we get any acks on this stuff from Jens and Jejb etc - especially
> > for the bits which touch block/ and for the scsi bits as these are
> > touching other subsystems.  (oddly, linux-scsi wasn't on the original
> > mail for this series summary.)
> > 
> Sorry I missed the scsi lists on the summary patch.
> 
> While browsing the code I found another spot in mmc layer which
> needs fixing. The patch is at the end of the email with Chris
> and linux-mmc cc'ed here.

Would you mind putting them all in the patch system, I can add the acks
should anyone supply them later, and I'll repost them along with my set
of dma-mask patches.  Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Santosh Shilimkar @ 2013-07-29 13:26 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Catalin Marinas,
	Will Deacon, Nicolas Pitre, Tejun Heo, Jens Axboe,
	linux-scsi@vger.kernel.org, Chris Ball, linux-mmc@vger.kernel.org

On Monday 29 July 2013 07:15 AM, Russell King - ARM Linux wrote:
> On Fri, Jul 26, 2013 at 12:28:26PM -0400, Santosh Shilimkar wrote:
>> On Friday 26 July 2013 11:10 AM, Russell King - ARM Linux wrote:
>>> On Fri, Jul 12, 2013 at 05:48:09PM -0400, Santosh Shilimkar wrote:
>>>> The series is an attempt to move ARM port to NO_BOOTMEM. As discussed
>>>> on list NO_BOOTMEM move needed updates to max*pfn meaning to be maximum
>>>> PFNs but that breaks the dma_mask for few block layer drivers since
>>>> ARM start of physical memory is not PFN0 unlike most of the architectures.
>>>> Some more read on it is here:
>>>> 	http://lwn.net/Articles/543408/
>>>> 	http://lwn.net/Articles/543424/
>>>>
>>>> To address this issue, we introduce generic dma_max_pfn() helper which
>>>> can be overridden from the architectures.
>>>> 	
>>>> Another intention behind move to nobootmem is also to convert ARM to
>>>> switch to memblock and getting rid of bootmem allocator dependency which
>>>> don't work for LPAE machines which has physical memory starting beyond
>>>> 4 GB boundary. It needs changes to core kernel and also a new memblock
>>>> API. More on this can be found here:
>>>> 	https://lkml.org/lkml/2013/6/29/77
>>>>
>>>> I have been trying to cook up these patches with kind help from Russell
>>>> and we know series don't solve all the dma_mask bad assumptions. But at
>>>> least I am hoping that it can get the ball rolling.	
>>>>
>>>> Comments/testing help is welcome !!
>>>
>>> As this is related to some of the cleanup of dma_mask which I've been
>>> doing, I think it may make sense to roll this into one tree.  Any
>>> objection to that?
>>>
>>> Can we get any acks on this stuff from Jens and Jejb etc - especially
>>> for the bits which touch block/ and for the scsi bits as these are
>>> touching other subsystems.  (oddly, linux-scsi wasn't on the original
>>> mail for this series summary.)
>>>
>> Sorry I missed the scsi lists on the summary patch.
>>
>> While browsing the code I found another spot in mmc layer which
>> needs fixing. The patch is at the end of the email with Chris
>> and linux-mmc cc'ed here.
> 
> Would you mind putting them all in the patch system, I can add the acks
> should anyone supply them later, and I'll repost them along with my set
> of dma-mask patches.  Thanks.
> 
Done.
7794/1, 7795/1, 7796/1, 7797/1, 7798/1, 7799/1

Didn't know how to get XXXX/1,2,3,4... pushed into the tracker.
BTW, I have also pushed the patched on my git tree branch [1] just
in case you or some one needs it.

Regards,
Santosh
[1] git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
3.12/nobootmem_n_dma-mask


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes
  2013-07-29 13:26       ` Santosh Shilimkar
@ 2013-07-29 13:40         ` Russell King - ARM Linux
  2013-07-29 13:42           ` Santosh Shilimkar
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-07-29 13:40 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Catalin Marinas,
	Will Deacon, Nicolas Pitre, Tejun Heo, Jens Axboe,
	linux-scsi@vger.kernel.org, Chris Ball, linux-mmc@vger.kernel.org

On Mon, Jul 29, 2013 at 09:26:44AM -0400, Santosh Shilimkar wrote:
> On Monday 29 July 2013 07:15 AM, Russell King - ARM Linux wrote:
> > Would you mind putting them all in the patch system, I can add the acks
> > should anyone supply them later, and I'll repost them along with my set
> > of dma-mask patches.  Thanks.
> > 
> Done.
> 7794/1, 7795/1, 7796/1, 7797/1, 7798/1, 7799/1
> 
> Didn't know how to get XXXX/1,2,3,4... pushed into the tracker.
> BTW, I have also pushed the patched on my git tree branch [1] just
> in case you or some one needs it.

Thanks.  I'd prefer not to have them as stable commits yet because should
we get acks from Jens, Jejb or cjb, we will need to add their acks to them.

My dma-masks branch is still very much unstable at the moment (which is
why its not published) but I shall be posting the patches during this
week.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes
  2013-07-29 13:40         ` Russell King - ARM Linux
@ 2013-07-29 13:42           ` Santosh Shilimkar
  0 siblings, 0 replies; 5+ messages in thread
From: Santosh Shilimkar @ 2013-07-29 13:42 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Nicolas Pitre, Jens Axboe, linux-scsi@vger.kernel.org,
	Catalin Marinas, Will Deacon, linux-kernel@vger.kernel.org,
	Tejun Heo, linux-mmc@vger.kernel.org, Chris Ball,
	linux-arm-kernel@lists.infradead.org

On Monday 29 July 2013 09:40 AM, Russell King - ARM Linux wrote:
> On Mon, Jul 29, 2013 at 09:26:44AM -0400, Santosh Shilimkar wrote:
>> On Monday 29 July 2013 07:15 AM, Russell King - ARM Linux wrote:
>>> Would you mind putting them all in the patch system, I can add the acks
>>> should anyone supply them later, and I'll repost them along with my set
>>> of dma-mask patches.  Thanks.
>>>
>> Done.
>> 7794/1, 7795/1, 7796/1, 7797/1, 7798/1, 7799/1
>>
>> Didn't know how to get XXXX/1,2,3,4... pushed into the tracker.
>> BTW, I have also pushed the patched on my git tree branch [1] just
>> in case you or some one needs it.
> 
> Thanks.  I'd prefer not to have them as stable commits yet because should
> we get acks from Jens, Jejb or cjb, we will need to add their acks to them.
>
right.
 
> My dma-masks branch is still very much unstable at the moment (which is
> why its not published) but I shall be posting the patches during this
> week.
> 
Sure.

Regards,
Santosh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-29 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1373665694-7580-1-git-send-email-santosh.shilimkar@ti.com>
     [not found] ` <20130726151021.GU24642@n2100.arm.linux.org.uk>
2013-07-26 16:28   ` [RFC/RFT PATCH 0/5] mm: ARM nobootmem and few dma_mask fixes 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox