From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
Cc: Vignesh R <vigneshr@ti.com>,
Tudor Ambarus <tudor.ambarus@microchip.com>,
Richard Weinberger <richard@nod.at>,
Cyrille Pitchen <cyrille.pitchen@microchip.com>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
Marek Vasut <marek.vasut@gmail.com>,
Frieder Schrempf <frieder.schrempf@exceet.de>,
Mark Brown <broonie@kernel.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v2 5/7] mtd: devices: m25p80: Use the spi-mem dirmap API
Date: Wed, 31 Oct 2018 11:49:51 +0100 [thread overview]
Message-ID: <20181031114951.55f662cc@bbrezillon> (raw)
In-Reply-To: <VI1PR04MB57269B26A682B1FCFAC4E6F399CD0@VI1PR04MB5726.eurprd04.prod.outlook.com>
On Wed, 31 Oct 2018 10:28:04 +0000
Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> wrote:
> > +static int m25p_create_read_dirmap(struct m25p *flash) {
> > + struct spi_nor *nor = &flash->spi_nor;
> > + struct spi_mem_dirmap_info info = {
> > + .op_tmpl = SPI_MEM_OP(SPI_MEM_OP_CMD(nor-
> > >read_opcode, 1),
> > + SPI_MEM_OP_ADDR(nor->addr_width, 0, 1),
> > + SPI_MEM_OP_DUMMY(nor->read_dummy,
> > 1),
> > + SPI_MEM_OP_DATA_IN(0, NULL, 1)),
> > + .offset = 0,
> > + .length = flash->spi_nor.mtd.size,
>
> I want to understand the sequence of calling up of this routine from drivers/mtd/spi-nor/spi-nor.c file.
> Because till point of JedecID read and SFDP command read mtd.size is not being populated and having value as 0. This would make length as 0.
When the dirmap is created mtd->size has been initialized already. But
you're right, nor->read() might be called before the read dirmap has
been created (SFDP read), which will lead to a NULL pointer exception.
>
> Did these read follow different path?
Nope.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2018-10-31 10:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 13:36 [PATCH v2 0/7] spi: spi-mem: Add a direct mapping API Boris Brezillon
2018-10-30 13:36 ` [PATCH v2 1/7] spi: spi-mem: Add missing word in the SPI_MEM_DATA_OUT description Boris Brezillon
2018-10-30 13:36 ` [PATCH v2 2/7] spi: spi-mem: Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum Boris Brezillon
2018-10-30 13:36 ` [PATCH v2 3/7] spi: spi-mem: Split spi_mem_exec_op() code Boris Brezillon
2018-10-30 13:36 ` [PATCH v2 4/7] spi: spi-mem: Add a new API to support direct mapping Boris Brezillon
2018-10-30 13:36 ` [PATCH v2 5/7] mtd: devices: m25p80: Use the spi-mem dirmap API Boris Brezillon
2018-10-31 10:28 ` Yogesh Narayan Gaur
2018-10-31 10:49 ` Boris Brezillon [this message]
2018-10-31 11:03 ` Boris Brezillon
2018-10-30 13:36 ` [PATCH v2 6/7] mtd: spinand: " Boris Brezillon
2018-10-30 13:36 ` [PATCH v2 7/7] spi: mxic: Add support for direct mapping Boris Brezillon
2018-11-06 13:21 ` [PATCH v2 0/7] spi: spi-mem: Add a direct mapping API Miquel Raynal
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=20181031114951.55f662cc@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=broonie@kernel.org \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@microchip.com \
--cc=dwmw2@infradead.org \
--cc=frieder.schrempf@exceet.de \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.com \
--cc=yogeshnarayan.gaur@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).