All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: "Marek Vasut" <marex@denx.de>,
	"Michal Suchanek" <hramrach@gmail.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>,
	linux-mtd@lists.infradead.org,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Alison Chaiken" <alison_chaiken@mentor.com>,
	"Bean Huo 霍斌斌 (beanhuo)" <beanhuo@micron.com>
Subject: Re: [PATCH 2/3] MTD: spi-nor: check for short writes in spi_nor_write.
Date: Fri, 22 May 2015 00:25:05 -0700	[thread overview]
Message-ID: <20150522072505.GE23718@brian-ubuntu> (raw)
In-Reply-To: <20150522071727.GD23718@brian-ubuntu>

(trimming CC a little this time, though it's still a bit large)

On Fri, May 22, 2015 at 12:17:27AM -0700, Brian Norris wrote:
> Admittedly, as he's using an out-of-tree driver, I'm not
> sure I know exactly what failure modes he is hitting yet.

Sorry, I realized I misread here. He's using spi-sunxi. Given that...

... is this code even valid?

static int sun6i_spi_transfer_one(struct spi_master *master,
                                  struct spi_device *spi,
                                  struct spi_transfer *tfr)
{
...
	/* We don't support transfer larger than the FIFO */
	if (tfr->len > SUN6I_FIFO_DEPTH)
		return -EINVAL;

Seems like it should be looping over the transfer in multiple chunks
instead.

Brian

WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "Michal Suchanek"
	<hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	"Marek Vasut" <marex-ynQEQJNshbs@public.gmane.org>,
	"Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Alison Chaiken"
	<alison_chaiken-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>,
	"Mika Westerberg"
	<mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	"Bean Huo 霍斌斌 (beanhuo)"
	<beanhuo-AL4WhLSQfzjQT0dZR+AlfA@public.gmane.org>,
	"Linux Kernel Mailing List"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/3] MTD: spi-nor: check for short writes in spi_nor_write.
Date: Fri, 22 May 2015 00:25:05 -0700	[thread overview]
Message-ID: <20150522072505.GE23718@brian-ubuntu> (raw)
In-Reply-To: <20150522071727.GD23718@brian-ubuntu>

(trimming CC a little this time, though it's still a bit large)

On Fri, May 22, 2015 at 12:17:27AM -0700, Brian Norris wrote:
> Admittedly, as he's using an out-of-tree driver, I'm not
> sure I know exactly what failure modes he is hitting yet.

Sorry, I realized I misread here. He's using spi-sunxi. Given that...

... is this code even valid?

static int sun6i_spi_transfer_one(struct spi_master *master,
                                  struct spi_device *spi,
                                  struct spi_transfer *tfr)
{
...
	/* We don't support transfer larger than the FIFO */
	if (tfr->len > SUN6I_FIFO_DEPTH)
		return -EINVAL;

Seems like it should be looping over the transfer in multiple chunks
instead.

Brian

WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <computersforpeace@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: "Michal Suchanek" <hramrach@gmail.com>,
	linux-sunxi <linux-sunxi@googlegroups.com>,
	"Marek Vasut" <marex@denx.de>, "Rafał Miłecki" <zajec5@gmail.com>,
	"Alison Chaiken" <alison_chaiken@mentor.com>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Bean Huo 霍斌斌 (beanhuo)" <beanhuo@micron.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-mtd@lists.infradead.org,
	linux-spi <linux-spi@vger.kernel.org>
Subject: Re: [PATCH 2/3] MTD: spi-nor: check for short writes in spi_nor_write.
Date: Fri, 22 May 2015 00:25:05 -0700	[thread overview]
Message-ID: <20150522072505.GE23718@brian-ubuntu> (raw)
In-Reply-To: <20150522071727.GD23718@brian-ubuntu>

(trimming CC a little this time, though it's still a bit large)

On Fri, May 22, 2015 at 12:17:27AM -0700, Brian Norris wrote:
> Admittedly, as he's using an out-of-tree driver, I'm not
> sure I know exactly what failure modes he is hitting yet.

Sorry, I realized I misread here. He's using spi-sunxi. Given that...

... is this code even valid?

static int sun6i_spi_transfer_one(struct spi_master *master,
                                  struct spi_device *spi,
                                  struct spi_transfer *tfr)
{
...
	/* We don't support transfer larger than the FIFO */
	if (tfr->len > SUN6I_FIFO_DEPTH)
		return -EINVAL;

Seems like it should be looping over the transfer in multiple chunks
instead.

Brian

  reply	other threads:[~2015-05-22  7:25 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 14:22 [PATCH 0/3] Using SPI NOR flah on sunxi Michal Suchanek
2015-04-30 14:22 ` Michal Suchanek
2015-04-30 13:33 ` [PATCH 1/3] MTD: m25p80: fix write return value Michal Suchanek
2015-04-30 13:33   ` Michal Suchanek
2015-04-30 18:43   ` Marek Vasut
2015-04-30 18:43     ` Marek Vasut
2015-04-30 18:43     ` Marek Vasut
2015-04-30 21:37     ` Michal Suchanek
2015-04-30 21:37       ` Michal Suchanek
2015-04-30 21:37       ` Michal Suchanek
2015-04-30 13:38 ` [PATCH 2/3] MTD: spi-nor: check for short writes in spi_nor_write Michal Suchanek
2015-04-30 13:38   ` Michal Suchanek
2015-05-20 23:38   ` Brian Norris
2015-05-20 23:38     ` Brian Norris
2015-05-20 23:38     ` Brian Norris
2015-05-21  8:39     ` Michal Suchanek
2015-05-21  8:39       ` Michal Suchanek
2015-05-21  8:39       ` Michal Suchanek
2015-05-21 10:28       ` Mark Brown
2015-05-21 10:28         ` Mark Brown
2015-05-21 10:28         ` Mark Brown
2015-05-22  7:17         ` Brian Norris
2015-05-22  7:17           ` Brian Norris
2015-05-22  7:17           ` Brian Norris
2015-05-22  7:25           ` Brian Norris [this message]
2015-05-22  7:25             ` Brian Norris
2015-05-22  7:25             ` Brian Norris
2015-05-22  9:37             ` Mark Brown
2015-05-22  9:37               ` Mark Brown
2015-05-22  9:37               ` Mark Brown
2015-04-30 13:46 ` [PATCH 3/3] MTD: m25p80: Add option to limit SPI transfer size Michal Suchanek
2015-04-30 13:46   ` Michal Suchanek
2015-04-30 14:58   ` [linux-sunxi] " Julian Calaby
2015-04-30 14:58     ` Julian Calaby
2015-04-30 14:58     ` Julian Calaby
2015-05-20 23:27     ` [linux-sunxi] " Brian Norris
2015-05-20 23:27       ` Brian Norris
2015-05-20 23:27       ` Brian Norris
2015-04-30 16:30 ` [PATCH 0/3] Using SPI NOR flah on sunxi Thomas.Betker
     [not found] ` <cover.1430403750.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-30 16:30   ` Thomas.Betker-Bf/A/FSCP0w3s4ca2cGeAgC/G2K4zDHf
2015-04-30 16:30 ` Thomas.Betker
2015-04-30 16:30   ` Thomas.Betker
2015-04-30 16:30   ` Thomas.Betker
2015-04-30 16:56   ` Michal Suchanek
2015-04-30 16:56     ` Michal Suchanek
2015-04-30 16:56     ` Michal Suchanek
2015-04-30 18:34     ` Marek Vasut
2015-04-30 18:34       ` Marek Vasut
2015-04-30 18:34       ` Marek Vasut
2015-05-20 23:54       ` Brian Norris
2015-05-20 23:54         ` Brian Norris
2015-05-20 23:54         ` Brian Norris
2015-05-20 23:54         ` Brian Norris
2015-04-30 16:30 ` Thomas.Betker
2015-05-01 12:27 ` Stefan Monnier
2015-05-04 10:32   ` [linux-sunxi] " Michal Suchanek
2015-05-04 10:32     ` Michal Suchanek
2015-05-04 10:32     ` Michal Suchanek

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=20150522072505.GE23718@brian-ubuntu \
    --to=computersforpeace@gmail.com \
    --cc=alison_chaiken@mentor.com \
    --cc=beanhuo@micron.com \
    --cc=broonie@kernel.org \
    --cc=hramrach@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=marex@denx.de \
    --cc=mika.westerberg@linux.intel.com \
    --cc=zajec5@gmail.com \
    /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.