From: <Tudor.Ambarus@microchip.com>
To: <vigneshr@ti.com>, <miquel.raynal@bootlin.com>, <richard@nod.at>,
<marek.vasut@gmail.com>
Cc: yogeshnarayan.gaur@nxp.com, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org, bbrezillon@kernel.org
Subject: Re: [PATCH v2 1/2] mtd: spi-nor: Move m25p80 code in spi-nor.c
Date: Wed, 31 Jul 2019 06:19:26 +0000 [thread overview]
Message-ID: <a7dca16d-c20a-da4d-6a33-ecf043b241cb@microchip.com> (raw)
In-Reply-To: <512b5fac-b1e4-0350-a07c-184008f67341@ti.com>
On 07/30/2019 09:04 PM, Vignesh Raghavendra wrote:
>>> + */
>>> +static int spi_nor_exec_op(struct spi_nor *nor, struct spi_mem_op *op,
>>> + u64 *addr, void *buf, size_t len)
>>> +{
>>> + int ret;
>>> + bool usebouncebuf = false;
>> I don't think we need a bounce buffer for regs. What is the maximum size that we
>> read/write regs, SPI_NOR_MAX_CMD_SIZE(8)?
>>
>> In spi-nor.c the maximum length that we pass to nor->read_reg()/write_reg() is
>> SPI_NOR_MAX_ID_LEN(6).
>>
>> I can provide a patch to always use nor->cmd_buf when reading/writing regs so
>> you respin the series on top of it, if you feel the same.
>>
>
>> With nor->cmd_buf this function will be reduced to the following:
>>
> I will move the code introducing bounce buffer into separate patch at
> the beginning of this series and switch over all read/write regs
> functions to use bounce buffer instead of cmd_buf. cmd_buf will be dropped.
> And then simplify this patch to spi_nor_spimem_xfer_reg() to you pointed
> out below. Does that sound good?
>
Please do. Probably we can get rid of spi_nor_spimem_xfer_reg entirely and use
spi_mem_exec_op() directly when interacting with registers. I'll wait for your v3.
Cheers,
ta
>> static int spi_nor_spimem_xfer_reg(struct spi_nor *nor, struct spi_mem_op *op)
>> {
>> if (!op || (op->data.nbytes && !nor->cmd_buf))
>> return -EINVAL;
>>
>> return spi_mem_exec_op(nor->spimem, op);
>> }
>>
>> spi_nor_exec_op() always received a NULL addr, let's get rid of it. We won't
>> need buf anymore and you can retrieve the length from op->data.nbytes. Now that
>> we trimmed the arguments, I think I would get rid of the
>> spi_nor_data/nodata_op() wrappers and use spi_nor_spimem_xfer_reg() directly.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-07-31 6:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-20 8:00 [PATCH v2 0/2] ] Merge m25p80 into spi-nor Vignesh Raghavendra
2019-07-20 8:00 ` [PATCH v2 1/2] mtd: spi-nor: Move m25p80 code in spi-nor.c Vignesh Raghavendra
2019-07-25 11:19 ` Tudor.Ambarus
2019-07-25 11:44 ` Tudor.Ambarus
2019-07-25 12:37 ` Boris Brezillon
2019-07-25 13:17 ` Tudor.Ambarus
2019-07-25 13:35 ` Tudor.Ambarus
2019-07-25 14:00 ` Boris Brezillon
2019-07-25 14:36 ` Tudor.Ambarus
2019-07-30 18:04 ` Vignesh Raghavendra
2019-07-31 6:19 ` Tudor.Ambarus [this message]
2019-07-20 8:00 ` [PATCH v2 2/2] mtd: spi-nor: Rework hwcaps selection for the spi-mem case Vignesh Raghavendra
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=a7dca16d-c20a-da4d-6a33-ecf043b241cb@microchip.com \
--to=tudor.ambarus@microchip.com \
--cc=bbrezillon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--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).