All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sourav Poddar <sourav.poddar@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: Marek Vasut <marex@denx.de>,
	devicetree@vger.kernel.org, computersforpeace@gmail.com,
	balbi@ti.com, linux-spi@vger.kernel.org,
	linux-mtd@lists.infradead.org, bcousson@baylibre.com,
	linux-omap@vger.kernel.org, dwmw2@infradead.org
Subject: Re: [PATCHv2 00/10] Add memory mapped support for ti qspi, m25p80 serial flash.
Date: Wed, 11 Dec 2013 10:07:11 +0530	[thread overview]
Message-ID: <52A7EBF7.4040601@ti.com> (raw)
In-Reply-To: <20131210182904.GG11468@sirena.org.uk>

Hi Mark,
On Tuesday 10 December 2013 11:59 PM, Mark Brown wrote:
> On Tue, Dec 10, 2013 at 07:22:10PM +0100, Marek Vasut wrote:
>> On Tuesday, December 10, 2013 at 05:11:43 PM, Mark Brown wrote:
>>> There is some stuff that pushes up into the controller in that while the
>>> device is in memory mapped mode as far as I can tell it's not safe to do
>>> other accesses so if someone's put more than one device on the SPI bus
>>> we need to handle interactions there.
>> OK, so it's either-or . That seems OK, you might want to have two drivers for
>> this ip block, one to handle it as a SPI block and one to handle it as a SPI-NOR
>> block. ... that is of course, if these two modes can't work together.
> Or the client disables the memory map when it's not actively being used
> and the stops other transfers starting while the mapping is in place.
> I'd expect we'll have to cope with shared use at some point, hardware
> engineers will probably build such systems.
So, what I am doing here in my code is that whenever I desired to use a
mmap operations I do a

a. flash_lock()
b. wait till the previous erase/write is finished
c. 'get_buf' which in turn does
       - get_sync
       - enable memory mapped

d. memcpy
e. 'put_buf' which in turn does
            - disable memory mapped
            - put_sync


f. flash_unlock

Do you see any point missing here?

On your comment about disabling transfers while doing a mmap..
Are you suggesting on having a check in qspi transfer api something like 
this..

transfer_one_message {
  if (mmap)
      return -EINPROGRESS;
}

Where mmap can be set/unset in get_buf/put_buf respectively.

WARNING: multiple messages have this Message-ID (diff)
From: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org
Subject: Re: [PATCHv2 00/10] Add memory mapped support for ti qspi, m25p80 serial flash.
Date: Wed, 11 Dec 2013 10:07:11 +0530	[thread overview]
Message-ID: <52A7EBF7.4040601@ti.com> (raw)
In-Reply-To: <20131210182904.GG11468-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

Hi Mark,
On Tuesday 10 December 2013 11:59 PM, Mark Brown wrote:
> On Tue, Dec 10, 2013 at 07:22:10PM +0100, Marek Vasut wrote:
>> On Tuesday, December 10, 2013 at 05:11:43 PM, Mark Brown wrote:
>>> There is some stuff that pushes up into the controller in that while the
>>> device is in memory mapped mode as far as I can tell it's not safe to do
>>> other accesses so if someone's put more than one device on the SPI bus
>>> we need to handle interactions there.
>> OK, so it's either-or . That seems OK, you might want to have two drivers for
>> this ip block, one to handle it as a SPI block and one to handle it as a SPI-NOR
>> block. ... that is of course, if these two modes can't work together.
> Or the client disables the memory map when it's not actively being used
> and the stops other transfers starting while the mapping is in place.
> I'd expect we'll have to cope with shared use at some point, hardware
> engineers will probably build such systems.
So, what I am doing here in my code is that whenever I desired to use a
mmap operations I do a

a. flash_lock()
b. wait till the previous erase/write is finished
c. 'get_buf' which in turn does
       - get_sync
       - enable memory mapped

d. memcpy
e. 'put_buf' which in turn does
            - disable memory mapped
            - put_sync


f. flash_unlock

Do you see any point missing here?

On your comment about disabling transfers while doing a mmap..
Are you suggesting on having a check in qspi transfer api something like 
this..

transfer_one_message {
  if (mmap)
      return -EINPROGRESS;
}

Where mmap can be set/unset in get_buf/put_buf respectively.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
	<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	<dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	<balbi-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCHv2 00/10] Add memory mapped support for ti qspi, m25p80 serial flash.
Date: Wed, 11 Dec 2013 10:07:11 +0530	[thread overview]
Message-ID: <52A7EBF7.4040601@ti.com> (raw)
In-Reply-To: <20131210182904.GG11468-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

Hi Mark,
On Tuesday 10 December 2013 11:59 PM, Mark Brown wrote:
> On Tue, Dec 10, 2013 at 07:22:10PM +0100, Marek Vasut wrote:
>> On Tuesday, December 10, 2013 at 05:11:43 PM, Mark Brown wrote:
>>> There is some stuff that pushes up into the controller in that while the
>>> device is in memory mapped mode as far as I can tell it's not safe to do
>>> other accesses so if someone's put more than one device on the SPI bus
>>> we need to handle interactions there.
>> OK, so it's either-or . That seems OK, you might want to have two drivers for
>> this ip block, one to handle it as a SPI block and one to handle it as a SPI-NOR
>> block. ... that is of course, if these two modes can't work together.
> Or the client disables the memory map when it's not actively being used
> and the stops other transfers starting while the mapping is in place.
> I'd expect we'll have to cope with shared use at some point, hardware
> engineers will probably build such systems.
So, what I am doing here in my code is that whenever I desired to use a
mmap operations I do a

a. flash_lock()
b. wait till the previous erase/write is finished
c. 'get_buf' which in turn does
       - get_sync
       - enable memory mapped

d. memcpy
e. 'put_buf' which in turn does
            - disable memory mapped
            - put_sync


f. flash_unlock

Do you see any point missing here?

On your comment about disabling transfers while doing a mmap..
Are you suggesting on having a check in qspi transfer api something like 
this..

transfer_one_message {
  if (mmap)
      return -EINPROGRESS;
}

Where mmap can be set/unset in get_buf/put_buf respectively.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-12-11  4:37 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 14:24 [PATCHv2 00/10] Add memory mapped support for ti qspi, m25p80 serial flash Sourav Poddar
2013-12-06 14:24 ` Sourav Poddar
2013-12-06 14:24 ` Sourav Poddar
2013-12-06 14:24 ` [PATCHv2 01/10] spi/spi.h: Add get_buf/put_buf support in spi master Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-19 13:31   ` Mark Brown
2013-12-19 13:31     ` Mark Brown
2013-12-06 14:24 ` [PATCHv2 02/10] spi/qspi: parse register by name Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-19 13:34   ` Mark Brown
2013-12-19 13:34     ` Mark Brown
2013-12-06 14:24 ` [PATCHv2 03/10] spi/qspi: Add support to switc to memory mapped operation Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-10 12:54   ` Marek Vasut
2013-12-10 12:54     ` Marek Vasut
2013-12-06 14:24 ` [PATCHv2 04/10] spi/qspi: configure set up register for memory map Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-10 12:57   ` Marek Vasut
2013-12-10 12:57     ` Marek Vasut
2013-12-10 17:13     ` Sourav Poddar
2013-12-10 17:13       ` Sourav Poddar
2013-12-10 17:13       ` Sourav Poddar
2013-12-06 14:24 ` [PATCHv2 05/10] spi/qspi: Add api for get_buf/put_buf Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-10 12:58   ` Marek Vasut
2013-12-10 12:58     ` Marek Vasut
2013-12-10 17:10     ` Sourav Poddar
2013-12-10 17:10       ` Sourav Poddar
2013-12-10 17:10       ` Sourav Poddar
2013-12-06 14:24 ` [PATCHv2 06/10] drivers: mtd: m25p80: Add api to configure master register Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24 ` [PATCHv2 07/10] drivers: mtd: m25p80: Adapt driver to support memory mapped read Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-12  7:55   ` Huang Shijie
2013-12-12  7:55     ` Huang Shijie
2013-12-12  8:15     ` Sourav Poddar
2013-12-12  8:15       ` Sourav Poddar
2013-12-12  8:15       ` Sourav Poddar
2013-12-12  8:31       ` Huang Shijie
2013-12-12  8:31         ` Huang Shijie
2013-12-06 14:24 ` [PATCHv2 08/10] Documentation: bindings: ti-qspi: update binding information Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-19 13:34   ` Mark Brown
2013-12-19 13:34     ` Mark Brown
2013-12-06 14:24 ` [PATCHv2 09/10] arm: dts: dra7: Add qspi device Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-09 17:42   ` Tony Lindgren
2013-12-09 17:42     ` Tony Lindgren
2013-12-10  4:25     ` Sourav Poddar
2013-12-10  4:25       ` Sourav Poddar
2013-12-10  4:25       ` Sourav Poddar
2013-12-10 10:31       ` Mark Brown
2013-12-10 10:31         ` Mark Brown
2013-12-10 10:45         ` Sourav Poddar
2013-12-10 10:45           ` Sourav Poddar
2013-12-10 10:45           ` Sourav Poddar
2013-12-12  4:20         ` Sourav Poddar
2013-12-12  4:20           ` Sourav Poddar
2013-12-06 14:24 ` [PATCHv2 10/10] arm: dts: am43x-epos: " Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-06 14:24   ` Sourav Poddar
2013-12-10 12:49 ` [PATCHv2 00/10] Add memory mapped support for ti qspi, m25p80 serial flash Marek Vasut
2013-12-10 12:49   ` Marek Vasut
2013-12-10 16:11   ` Mark Brown
2013-12-10 16:11     ` Mark Brown
2013-12-10 18:22     ` Marek Vasut
2013-12-10 18:22       ` Marek Vasut
2013-12-10 18:29       ` Mark Brown
2013-12-10 18:29         ` Mark Brown
2013-12-10 18:34         ` Marek Vasut
2013-12-10 18:34           ` Marek Vasut
2013-12-11  4:37         ` Sourav Poddar [this message]
2013-12-11  4:37           ` Sourav Poddar
2013-12-11  4:37           ` Sourav Poddar
2013-12-11  4:19       ` Sourav Poddar
2013-12-11  4:19         ` Sourav Poddar
2013-12-11  4:19         ` Sourav Poddar
2013-12-11  4:18   ` Sourav Poddar
2013-12-11  4:18     ` Sourav Poddar
2013-12-11  4:18     ` Sourav Poddar
2013-12-11 10:44     ` Marek Vasut
2013-12-11 10:44       ` Marek Vasut
2013-12-11 12:01       ` Mark Brown
2013-12-11 12:01         ` Mark Brown

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=52A7EBF7.4040601@ti.com \
    --to=sourav.poddar@ti.com \
    --cc=balbi@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marex@denx.de \
    /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.