From: Mark Brown <broonie@kernel.org>
To: Md Sadre Alam <md.alam@oss.qualcomm.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Md Sadre Alam <mdalam@qti.qualcomm.com>
Subject: Re: [PATCH 2/3] spi: spi-qpic-snand: add quad mode support
Date: Wed, 29 Jul 2026 15:46:43 +0100 [thread overview]
Message-ID: <a9595e1c-fa08-4d1d-a13b-3ea89a27519a@sirena.org.uk> (raw)
In-Reply-To: <20260716-quad-v1-2-636f74da17e1@qti.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]
On Thu, Jul 16, 2026 at 10:57:46AM +0530, Md Sadre Alam wrote:
> Add support for quad (x4) transfer mode in the QPIC SPI NAND driver.
> The controller supports both single (x1) and quad (x4) SPI transfers,
> but the driver currently operates only in x1 mode.
> @@ -1025,12 +1040,16 @@ static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode,
> *cmd = SPINAND_WRITE_EN;
> break;
> case SPINAND_PROGRAM_EXECUTE:
> - *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 |
> - SPI_WP | SPI_HOLD | OP_PROGRAM_PAGE);
> + if (snandc->qspi->quad_mode)
> + *cmd = (PAGE_ACC | LAST_PAGE | transfer_mode |
> + SPI_WP | SPI_HOLD | OP_PROGRAM_PAGE);
This succeeds but does not initialize cmd, previously we'd accept and
use x1.
> @@ -1042,6 +1061,15 @@ static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode,
> static int qcom_spi_read_page(struct qcom_nand_controller *snandc,
> const struct spi_mem_op *op)
> {
> + int ret;
> + u32 cmd;
> + /* Call mapping once again to update the quad mode based on
> + * buswidth
> + */
> + ret = qcom_spi_cmd_mapping(snandc, op, &cmd);
> + if (ret < 0)
> + return ret;
> +
> if (snandc->qspi->page_rw && snandc->qspi->raw_rw)
> return qcom_spi_read_page_raw(snandc, op);
We never reference cmd in the rest of the function, either we didn't
need to do the mapping or there's a missing update.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-07-29 14:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 5:27 [PATCH 0/3] Add quad mode support for QPIC SNAND Md Sadre Alam
2026-07-16 5:27 ` [PATCH 1/3] spi: spi-qpic-snand: move command mapping helper Md Sadre Alam
2026-07-16 5:27 ` [PATCH 2/3] spi: spi-qpic-snand: add quad mode support Md Sadre Alam
2026-07-29 14:46 ` Mark Brown [this message]
2026-08-07 16:22 ` Md Sadre Alam
2026-07-16 5:27 ` [PATCH 3/3] spi: spi-qpic-snand: Handle Macronix quad read opcode 0x6b Md Sadre Alam
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=a9595e1c-fa08-4d1d-a13b-3ea89a27519a@sirena.org.uk \
--to=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=md.alam@oss.qualcomm.com \
--cc=mdalam@qti.qualcomm.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
all inboxes | Powered by JetHome®