All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Pratyush Yadav" <pratyush@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>
Cc: "Alexander Stein" <alexander.stein@ew.tq-group.com>,
	<tudor.ambarus@linaro.org>, <richard@nod.at>, <vigneshr@ti.com>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<alvinzhou@mxic.com.tw>, <leoyu@mxic.com.tw>,
	"Cheng Ming Lin" <chengminglin@mxic.com.tw>,
	<stable@vger.kernel.org>,
	"Cheng Ming Lin" <linchengming884@gmail.com>
Subject: Re: [PATCH v2 1/1] mtd: spi-nor: core: replace dummy buswidth from addr to data
Date: Wed, 15 Jan 2025 08:26:11 +0100	[thread overview]
Message-ID: <D72GVBSZNP5J.1NMQYXQ4SZLNF@kernel.org> (raw)
In-Reply-To: <mafs0ldvd5l2k.fsf@kernel.org>


[-- Attachment #1.1: Type: text/plain, Size: 2053 bytes --]

Hi,

> >>>> --- a/drivers/mtd/spi-nor/core.c
> >>>> +++ b/drivers/mtd/spi-nor/core.c
> >>>> @@ -89,7 +89,7 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
> >>>>  		op->addr.buswidth = spi_nor_get_protocol_addr_nbits(proto);
> >>>>  
> >>>>  	if (op->dummy.nbytes)
> >>>> -		op->dummy.buswidth = spi_nor_get_protocol_addr_nbits(proto);
> >>>> +		op->dummy.buswidth = spi_nor_get_protocol_data_nbits(proto);
> >
> > Facing recently a similar issue myself in the SPI NAND world, I believe
> > we should get rid of the notion of bits when it comes to the dummy
> > phase. I would appreciate a clarification like "dummy.cycles" which
> > would typically not require any bus width implications.
>
> I agree. All peripheral drivers convert cycles to bytes, and controller
> drivers convert them back to cycles. This whole thing should be avoided,
> especially since it contains some traps with division truncation.

Here is the relevant discussion:
https://lore.kernel.org/linux-mtd/f647e713a65f5d3f0f2e3af95c4d0a89@walle.cc/

TLDR: yes, please use the notion of (clock) cycles. But there are
some problems to solve first.

> >> Since we are quite late in the cycle, and that changing
> >> spi_mem_check_buswidth() might cause all sorts of breakages, I think the
> >> best idea currently would be to revert this patch, and resend it with
> >> the other changes later.
> >>
> >> Tudor, Michael, Miquel, what do you think about this? We are at rc7 but
> >> I think we should send out a fixes PR with a revert. If you agree, I
> >> will send out a patch and a PR.
> >
> > Either way I am fine. the -rc cycles are also available for us to
> > settle. But it's true we can bikeshed a little bit, so feel free to
> > revert this patch before sending the MR.
>
> To be clear, since the patch was added in v6.13-rc1 I want to revert it
> via a fixes pull request to Linus before he releases v6.13 this week. I
> want to fix it in v6.13, not in v6.14.

Since it's clearly a regression, I'd revert it.

-michael

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: "Michael Walle" <mwalle@kernel.org>
To: "Pratyush Yadav" <pratyush@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>
Cc: "Alexander Stein" <alexander.stein@ew.tq-group.com>,
	<tudor.ambarus@linaro.org>, <richard@nod.at>, <vigneshr@ti.com>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<alvinzhou@mxic.com.tw>, <leoyu@mxic.com.tw>,
	"Cheng Ming Lin" <chengminglin@mxic.com.tw>,
	<stable@vger.kernel.org>,
	"Cheng Ming Lin" <linchengming884@gmail.com>
Subject: Re: [PATCH v2 1/1] mtd: spi-nor: core: replace dummy buswidth from addr to data
Date: Wed, 15 Jan 2025 08:26:11 +0100	[thread overview]
Message-ID: <D72GVBSZNP5J.1NMQYXQ4SZLNF@kernel.org> (raw)
In-Reply-To: <mafs0ldvd5l2k.fsf@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2053 bytes --]

Hi,

> >>>> --- a/drivers/mtd/spi-nor/core.c
> >>>> +++ b/drivers/mtd/spi-nor/core.c
> >>>> @@ -89,7 +89,7 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
> >>>>  		op->addr.buswidth = spi_nor_get_protocol_addr_nbits(proto);
> >>>>  
> >>>>  	if (op->dummy.nbytes)
> >>>> -		op->dummy.buswidth = spi_nor_get_protocol_addr_nbits(proto);
> >>>> +		op->dummy.buswidth = spi_nor_get_protocol_data_nbits(proto);
> >
> > Facing recently a similar issue myself in the SPI NAND world, I believe
> > we should get rid of the notion of bits when it comes to the dummy
> > phase. I would appreciate a clarification like "dummy.cycles" which
> > would typically not require any bus width implications.
>
> I agree. All peripheral drivers convert cycles to bytes, and controller
> drivers convert them back to cycles. This whole thing should be avoided,
> especially since it contains some traps with division truncation.

Here is the relevant discussion:
https://lore.kernel.org/linux-mtd/f647e713a65f5d3f0f2e3af95c4d0a89@walle.cc/

TLDR: yes, please use the notion of (clock) cycles. But there are
some problems to solve first.

> >> Since we are quite late in the cycle, and that changing
> >> spi_mem_check_buswidth() might cause all sorts of breakages, I think the
> >> best idea currently would be to revert this patch, and resend it with
> >> the other changes later.
> >>
> >> Tudor, Michael, Miquel, what do you think about this? We are at rc7 but
> >> I think we should send out a fixes PR with a revert. If you agree, I
> >> will send out a patch and a PR.
> >
> > Either way I am fine. the -rc cycles are also available for us to
> > settle. But it's true we can bikeshed a little bit, so feel free to
> > revert this patch before sending the MR.
>
> To be clear, since the patch was added in v6.13-rc1 I want to revert it
> via a fixes pull request to Linus before he releases v6.13 this week. I
> want to fix it in v6.13, not in v6.14.

Since it's clearly a regression, I'd revert it.

-michael

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

  reply	other threads:[~2025-01-15  7:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12  7:52 [PATCH v2 0/1] mtd: spi-nor: core: replace dummy buswidth from addr to data Cheng Ming Lin
2024-11-12  7:52 ` Cheng Ming Lin
2024-11-12  7:52 ` [PATCH v2 1/1] " Cheng Ming Lin
2024-11-12  7:52   ` Cheng Ming Lin
2025-01-14 12:57   ` Alexander Stein
2025-01-14 12:57     ` Alexander Stein
2025-01-14 13:26     ` Tudor Ambarus
2025-01-14 13:26       ` Tudor Ambarus
2025-01-14 16:24       ` Alexander Stein
2025-01-14 16:24         ` Alexander Stein
2025-01-14 16:29         ` Pratyush Yadav
2025-01-14 16:29           ` Pratyush Yadav
2025-01-14 16:15     ` Pratyush Yadav
2025-01-14 16:15       ` Pratyush Yadav
2025-01-14 17:51       ` Miquel Raynal
2025-01-14 17:51         ` Miquel Raynal
2025-01-14 18:04         ` Pratyush Yadav
2025-01-14 18:04           ` Pratyush Yadav
2025-01-15  7:26           ` Michael Walle [this message]
2025-01-15  7:26             ` Michael Walle
2025-01-15  6:27         ` Tudor Ambarus
2025-01-15  6:27           ` Tudor Ambarus
2025-01-15  6:54       ` Alexander Stein
2025-01-15  6:54         ` Alexander Stein
2024-11-12  8:36 ` [PATCH v2 0/1] " Tudor Ambarus
2024-11-12  8:36   ` Tudor Ambarus
2024-11-12  8:43   ` Cheng Ming Lin
2024-11-12  8:43     ` Cheng Ming Lin

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=D72GVBSZNP5J.1NMQYXQ4SZLNF@kernel.org \
    --to=mwalle@kernel.org \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=alvinzhou@mxic.com.tw \
    --cc=chengminglin@mxic.com.tw \
    --cc=leoyu@mxic.com.tw \
    --cc=linchengming884@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=vigneshr@ti.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.