Re: [PATCH 2/3] spi: spi-qpic-snand: add quad mode support

Md Sadre Alam <[email protected]>
Newsgroups org.kernel.vger.linux-spi,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Wed, Jul 29, 2026 at 03:46:43PM +0100, Mark Brown wrote:
> 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.

I have addressed both the comments in revision 2 [1]. Please review.

Thanks
Alam

1 - https://lore.kernel.org/linux-arm-msm/[email protected]/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.