All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vipin Kumar <vipin.kumar@st.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	viresh kumar <viresh.kumar@linaro.org>,
	Artem Bityutskiy <dedekind1@gmail.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	spear-devel <spear-devel@list.st.com>,
	"plagnioj@jcrosoft.com" <plagnioj@jcrosoft.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 07/11] fsmc/nand: Provide contiguous buffers to dma
Date: Fri, 12 Oct 2012 09:25:34 +0530	[thread overview]
Message-ID: <507794B6.2000107@st.com> (raw)
In-Reply-To: <CACRpkdYjA8QUh4HqvE1rsnXcGA4WafTkMq_wLNJ__gXEnEYrow@mail.gmail.com>

On 10/11/2012 9:36 PM, Linus Walleij wrote:
> On Thu, Oct 11, 2012 at 6:15 AM, viresh kumar<viresh.kumar@linaro.org>  wrote:
>> On Wed, Oct 10, 2012 at 10:37 PM, Linus Walleij
>> <linus.walleij@linaro.org>  wrote:
>
>>> dma_sync_single_for_device() is translating the virtual
>>> address to physical for every chunk BTW.
>>
>> I pray that i am wrong here, otherwise i would be thrown out from
>> the maintainers list for this driver :)
>>
>> dma_sync_single_for_device() is not doing anything on the buffer, but
>> on the LLI item. Actually it is flushing LLI struct so that DMA h/w can get
>> the correct values.
>
> Sorry no, I'm the one who's wrong...
>
> So the DMA engine memcpy() is not mapping virt->phys
> but expects physical addresses to be provided.
>
> So dma_map_single() needs to be called on the stuff
> passed in to dev->device_prep_dma_memcpy().
>
> And currently there is indeed a dma_map_single() in
> dma_xfer() in fsmc_nand.c which should work just fine.
>
> dma_map_single() will only work if the buffer is
> physically contiguous.
>
> And the block layer of the subsystem should take care
> of only handing the driver buffers that are contiguous
> I think? Not that I'm an expert here ... more some
> guesswork :-/

The buffers provided to the driver are actually user buffers. The reason 
I say that is because the generic nand test modules eg 
drivers/mtd/nand/mtd_stresstest.c calls mtd->_read with a user buffer as 
an argument

This same buffer directly trickles down to the driver

Artem, should we clearly cast this buffer as a user pointer instead of 
just a 'uint8_t *'.

Regards
Vipin

WARNING: multiple messages have this Message-ID (diff)
From: vipin.kumar@st.com (Vipin Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/11] fsmc/nand: Provide contiguous buffers to dma
Date: Fri, 12 Oct 2012 09:25:34 +0530	[thread overview]
Message-ID: <507794B6.2000107@st.com> (raw)
In-Reply-To: <CACRpkdYjA8QUh4HqvE1rsnXcGA4WafTkMq_wLNJ__gXEnEYrow@mail.gmail.com>

On 10/11/2012 9:36 PM, Linus Walleij wrote:
> On Thu, Oct 11, 2012 at 6:15 AM, viresh kumar<viresh.kumar@linaro.org>  wrote:
>> On Wed, Oct 10, 2012 at 10:37 PM, Linus Walleij
>> <linus.walleij@linaro.org>  wrote:
>
>>> dma_sync_single_for_device() is translating the virtual
>>> address to physical for every chunk BTW.
>>
>> I pray that i am wrong here, otherwise i would be thrown out from
>> the maintainers list for this driver :)
>>
>> dma_sync_single_for_device() is not doing anything on the buffer, but
>> on the LLI item. Actually it is flushing LLI struct so that DMA h/w can get
>> the correct values.
>
> Sorry no, I'm the one who's wrong...
>
> So the DMA engine memcpy() is not mapping virt->phys
> but expects physical addresses to be provided.
>
> So dma_map_single() needs to be called on the stuff
> passed in to dev->device_prep_dma_memcpy().
>
> And currently there is indeed a dma_map_single() in
> dma_xfer() in fsmc_nand.c which should work just fine.
>
> dma_map_single() will only work if the buffer is
> physically contiguous.
>
> And the block layer of the subsystem should take care
> of only handing the driver buffers that are contiguous
> I think? Not that I'm an expert here ... more some
> guesswork :-/

The buffers provided to the driver are actually user buffers. The reason 
I say that is because the generic nand test modules eg 
drivers/mtd/nand/mtd_stresstest.c calls mtd->_read with a user buffer as 
an argument

This same buffer directly trickles down to the driver

Artem, should we clearly cast this buffer as a user pointer instead of 
just a 'uint8_t *'.

Regards
Vipin

  parent reply	other threads:[~2012-10-12  3:55 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 10:44 [PATCH 00/11] mtd/nand: fsmc driver updates Vipin Kumar
2012-10-09 10:44 ` Vipin Kumar
2012-10-09 10:44 ` [PATCH 01/11] fsmc/nand:FIX: Change the type for regs to void __iomem * Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 17:14   ` viresh kumar
2012-10-09 17:14     ` viresh kumar
2012-10-10 16:49   ` Linus Walleij
2012-10-10 16:49     ` Linus Walleij
2012-10-17 12:30   ` Artem Bityutskiy
2012-10-17 12:30     ` Artem Bityutskiy
2012-10-09 10:44 ` [PATCH 02/11] fsmc/nand: Rearrange the fsmc_nand_data structure and update comments Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 11:52   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-09 11:52     ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-11  4:24     ` Vipin Kumar
2012-10-11  4:24       ` Vipin Kumar
2012-10-09 17:15   ` viresh kumar
2012-10-09 17:15     ` viresh kumar
2012-10-09 10:44 ` [PATCH 03/11] fsmc/nand: Support multiple banks connected to controller Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 11:55   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-09 11:55     ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-10 10:28     ` Vipin Kumar
2012-10-10 10:28       ` Vipin Kumar
2012-10-17 12:31   ` Artem Bityutskiy
2012-10-17 12:31     ` Artem Bityutskiy
2012-10-09 10:44 ` [PATCH 04/11] fsmc/nand: Accept nand timing parameters via DT Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 11:57   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-09 11:57     ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-11  4:25     ` Vipin Kumar
2012-10-11  4:25       ` Vipin Kumar
2012-10-09 17:20   ` viresh kumar
2012-10-09 17:20     ` viresh kumar
2012-10-09 10:44 ` [PATCH 05/11] fsmc: Implement ready/busy through gpio pin Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 11:59   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-09 11:59     ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-09 17:34   ` viresh kumar
2012-10-09 17:34     ` viresh kumar
2012-10-09 10:44 ` [PATCH 06/11] fsmc/nand: Modify the wait to uninterruptible Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-10 17:10   ` Linus Walleij
2012-10-10 17:10     ` Linus Walleij
2012-10-17 12:47   ` Artem Bityutskiy
2012-10-17 12:47     ` Artem Bityutskiy
2012-10-09 10:44 ` [PATCH 07/11] fsmc/nand: Provide contiguous buffers to dma Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 17:41   ` viresh kumar
2012-10-09 17:41     ` viresh kumar
2012-10-10 17:07   ` Linus Walleij
2012-10-10 17:07     ` Linus Walleij
2012-10-11  3:16     ` viresh kumar
2012-10-11  3:16       ` viresh kumar
2012-10-11  4:07       ` Vipin Kumar
2012-10-11  4:07         ` Vipin Kumar
2012-10-11  4:08     ` Vipin Kumar
2012-10-11  4:08       ` Vipin Kumar
2012-10-11  4:15     ` viresh kumar
2012-10-11  4:15       ` viresh kumar
2012-10-11 16:06       ` Linus Walleij
2012-10-11 16:06         ` Linus Walleij
2012-10-11 17:07         ` viresh kumar
2012-10-11 17:07           ` viresh kumar
2012-10-11 21:51           ` Linus Walleij
2012-10-11 21:51             ` Linus Walleij
2012-10-12  3:55         ` Vipin Kumar [this message]
2012-10-12  3:55           ` Vipin Kumar
2012-10-15 13:18           ` Artem Bityutskiy
2012-10-15 13:18             ` Artem Bityutskiy
2012-10-15 16:27             ` Brian Norris
2012-10-15 16:27               ` Brian Norris
2012-10-15 19:51               ` Linus Walleij
2012-10-15 19:51                 ` Linus Walleij
2012-10-16  7:14                 ` Artem Bityutskiy
2012-10-16  7:14                   ` Artem Bityutskiy
2012-10-16 10:05                   ` Linus Walleij
2012-10-16 10:05                     ` Linus Walleij
2012-10-21  7:38                     ` Brian Norris
2012-10-21  7:38                       ` Brian Norris
2012-10-21 11:00                       ` Artem Bityutskiy
2012-10-21 11:00                         ` Artem Bityutskiy
2012-10-21 12:02                         ` Artem Bityutskiy
2012-10-21 12:02                           ` Artem Bityutskiy
2012-10-16  7:11               ` Artem Bityutskiy
2012-10-16  7:11                 ` Artem Bityutskiy
2012-10-21  7:21                 ` Brian Norris
2012-10-21  7:21                   ` Brian Norris
2012-10-09 10:44 ` [PATCH 08/11] fsmc/nand: Use relaxed variants of io accessors Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 17:42   ` viresh kumar
2012-10-09 17:42     ` viresh kumar
2012-10-10 17:09   ` Linus Walleij
2012-10-10 17:09     ` Linus Walleij
2012-10-09 10:44 ` [PATCH 09/11] fsmc/nand:FIX: replace change_bit routine Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-10 17:22   ` Linus Walleij
2012-10-10 17:22     ` Linus Walleij
2012-10-10 20:21     ` Nicolas Pitre
2012-10-10 20:21       ` Nicolas Pitre
2012-10-11  4:17       ` Vipin Kumar
2012-10-11  4:17         ` Vipin Kumar
2012-10-10 20:45     ` Russell King - ARM Linux
2012-10-10 20:45       ` Russell King - ARM Linux
2012-10-11  4:20       ` Vipin Kumar
2012-10-11  4:20         ` Vipin Kumar
2012-10-09 10:44 ` [PATCH 10/11] fsmc/nand: Add sw bch support for ecc calculation/correction Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-09 11:50   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-09 11:50     ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-10 10:33     ` Vipin Kumar
2012-10-10 10:33       ` Vipin Kumar
2012-10-09 10:44 ` [PATCH 11/11] nand: Increase the ecc placement locations to 640 Vipin Kumar
2012-10-09 10:44   ` Vipin Kumar
2012-10-17 12:47   ` Artem Bityutskiy
2012-10-17 12:47     ` Artem Bityutskiy
2012-10-18  6:36   ` Brian Norris
2012-10-18  6:36     ` Brian Norris
2012-10-17 12:48 ` [PATCH 00/11] mtd/nand: fsmc driver updates Artem Bityutskiy
2012-10-17 12:48   ` Artem Bityutskiy
2012-10-18  4:13   ` Vipin Kumar
2012-10-18  4:13     ` Vipin Kumar

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=507794B6.2000107@st.com \
    --to=vipin.kumar@st.com \
    --cc=dedekind1@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=spear-devel@list.st.com \
    --cc=vinod.koul@intel.com \
    --cc=viresh.kumar@linaro.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.