* [PATCH] mmc: core: Add new flag to force hardware reset
@ 2023-09-14 0:03 Michael Wu
2023-09-14 8:00 ` Wenchao Chen
0 siblings, 1 reply; 6+ messages in thread
From: Michael Wu @ 2023-09-14 0:03 UTC (permalink / raw)
To: ulf.hansson, CLoehle, adrian.hunter, jinpu.wang, hare,
victor.shih, avri.altman, asuk4.q
Cc: axboe, brauner, f.fainelli, beanhuo, linux-mmc, linux-kernel
Entering the recovery system itself indicates a transmission error.
In this situation, we intend to execute the mmc_blk_reset function
to clear any anomalies that may be caused by errors. We have previously
discussed with several MMC device manufacturers, and they expressed
their desire for us to reset the device when errors occur to ensure
stable operation. We aim to make this code compatible with all devices
and ensure its stable performance, so we would like to add this patch
Signed-off-by: Michael Wu <michael@allwinnertech.com>
---
drivers/mmc/core/block.c | 2 +-
include/linux/mmc/host.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index b5b414a71e0b..29fbe0ddeadb 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1503,7 +1503,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
pr_debug("%s: CQE recovery start\n", mmc_hostname(host));
err = mmc_cqe_recovery(host);
- if (err)
+ if (err || host->cqe_recovery_reset_always)
mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 62a6847a3b6f..f578541a06b5 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -518,6 +518,7 @@ struct mmc_host {
int cqe_qdepth;
bool cqe_enabled;
bool cqe_on;
+ bool cqe_recovery_reset_always;
/* Inline encryption support */
#ifdef CONFIG_MMC_CRYPTO
--
2.29.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mmc: core: Add new flag to force hardware reset
2023-09-14 0:03 [PATCH] mmc: core: Add new flag to force hardware reset Michael Wu
@ 2023-09-14 8:00 ` Wenchao Chen
2023-09-25 13:59 ` Ulf Hansson
0 siblings, 1 reply; 6+ messages in thread
From: Wenchao Chen @ 2023-09-14 8:00 UTC (permalink / raw)
To: Michael Wu
Cc: ulf.hansson, CLoehle, adrian.hunter, jinpu.wang, hare,
victor.shih, avri.altman, asuk4.q, axboe, brauner, f.fainelli,
beanhuo, linux-mmc, linux-kernel
On Thu, 14 Sept 2023 at 08:04, Michael Wu <michael@allwinnertech.com> wrote:
>
> Entering the recovery system itself indicates a transmission error.
> In this situation, we intend to execute the mmc_blk_reset function
> to clear any anomalies that may be caused by errors. We have previously
> discussed with several MMC device manufacturers, and they expressed
> their desire for us to reset the device when errors occur to ensure
> stable operation. We aim to make this code compatible with all devices
> and ensure its stable performance, so we would like to add this patch
>
> Signed-off-by: Michael Wu <michael@allwinnertech.com>
like: https://lore.kernel.org/linux-mmc/20220603051534.22672-1-quic_sartgarg@quicinc.com/
You should enable it in the vendor host.
> ---
> drivers/mmc/core/block.c | 2 +-
> include/linux/mmc/host.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index b5b414a71e0b..29fbe0ddeadb 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -1503,7 +1503,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
> pr_debug("%s: CQE recovery start\n", mmc_hostname(host));
>
> err = mmc_cqe_recovery(host);
> - if (err)
> + if (err || host->cqe_recovery_reset_always)
> mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
> mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
>
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 62a6847a3b6f..f578541a06b5 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -518,6 +518,7 @@ struct mmc_host {
> int cqe_qdepth;
> bool cqe_enabled;
> bool cqe_on;
> + bool cqe_recovery_reset_always;
>
> /* Inline encryption support */
> #ifdef CONFIG_MMC_CRYPTO
> --
> 2.29.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mmc: core: Add new flag to force hardware reset
2023-09-14 8:00 ` Wenchao Chen
@ 2023-09-25 13:59 ` Ulf Hansson
2023-11-06 12:26 ` Michael Wu
0 siblings, 1 reply; 6+ messages in thread
From: Ulf Hansson @ 2023-09-25 13:59 UTC (permalink / raw)
To: Michael Wu, Wenchao Chen
Cc: adrian.hunter, jinpu.wang, victor.shih, avri.altman, asuk4.q,
f.fainelli, beanhuo, linux-mmc, linux-kernel, Sarthak Garg
- trimmed cc-list, + Sartak Garg
On Thu, 14 Sept 2023 at 10:00, Wenchao Chen <wenchao.chen666@gmail.com> wrote:
>
> On Thu, 14 Sept 2023 at 08:04, Michael Wu <michael@allwinnertech.com> wrote:
> >
> > Entering the recovery system itself indicates a transmission error.
> > In this situation, we intend to execute the mmc_blk_reset function
> > to clear any anomalies that may be caused by errors. We have previously
> > discussed with several MMC device manufacturers, and they expressed
> > their desire for us to reset the device when errors occur to ensure
> > stable operation. We aim to make this code compatible with all devices
> > and ensure its stable performance, so we would like to add this patch
> >
> > Signed-off-by: Michael Wu <michael@allwinnertech.com>
>
> like: https://lore.kernel.org/linux-mmc/20220603051534.22672-1-quic_sartgarg@quicinc.com/
Looks like this series didn't make it. I was awaiting a rebase from
Sartak to apply it, but apparently something got in his way for a new
submission.
>
> You should enable it in the vendor host.
Yes! We don't want unused code in the core. We need a user of it too.
May I suggest that you pick up Sartak's patch for the core and thus
add another patch for the host driver you care about and then
re-submit it as a small series.
Kind regards
Uffe
>
> > ---
> > drivers/mmc/core/block.c | 2 +-
> > include/linux/mmc/host.h | 1 +
> > 2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> > index b5b414a71e0b..29fbe0ddeadb 100644
> > --- a/drivers/mmc/core/block.c
> > +++ b/drivers/mmc/core/block.c
> > @@ -1503,7 +1503,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
> > pr_debug("%s: CQE recovery start\n", mmc_hostname(host));
> >
> > err = mmc_cqe_recovery(host);
> > - if (err)
> > + if (err || host->cqe_recovery_reset_always)
> > mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
> > mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
> >
> > diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> > index 62a6847a3b6f..f578541a06b5 100644
> > --- a/include/linux/mmc/host.h
> > +++ b/include/linux/mmc/host.h
> > @@ -518,6 +518,7 @@ struct mmc_host {
> > int cqe_qdepth;
> > bool cqe_enabled;
> > bool cqe_on;
> > + bool cqe_recovery_reset_always;
> >
> > /* Inline encryption support */
> > #ifdef CONFIG_MMC_CRYPTO
> > --
> > 2.29.0
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mmc: core: Add new flag to force hardware reset
2023-09-25 13:59 ` Ulf Hansson
@ 2023-11-06 12:26 ` Michael Wu
2023-11-06 14:19 ` Ulf Hansson
0 siblings, 1 reply; 6+ messages in thread
From: Michael Wu @ 2023-11-06 12:26 UTC (permalink / raw)
To: Ulf Hansson, Wenchao Chen
Cc: adrian.hunter, jinpu.wang, victor.shih, avri.altman, asuk4.q,
f.fainelli, beanhuo, linux-mmc, linux-kernel, Sarthak Garg
On 9/25/2023 9:59 PM, Ulf Hansson wrote:
> - trimmed cc-list, + Sartak Garg
>
> On Thu, 14 Sept 2023 at 10:00, Wenchao Chen <wenchao.chen666@gmail.com> wrote:
>>
>> On Thu, 14 Sept 2023 at 08:04, Michael Wu <michael@allwinnertech.com> wrote:
>>>
>>> Entering the recovery system itself indicates a transmission error.
>>> In this situation, we intend to execute the mmc_blk_reset function
>>> to clear any anomalies that may be caused by errors. We have previously
>>> discussed with several MMC device manufacturers, and they expressed
>>> their desire for us to reset the device when errors occur to ensure
>>> stable operation. We aim to make this code compatible with all devices
>>> and ensure its stable performance, so we would like to add this patch
>>>
>>> Signed-off-by: Michael Wu <michael@allwinnertech.com>
>>
>> like: https://lore.kernel.org/linux-mmc/20220603051534.22672-1-quic_sartgarg@quicinc.com/
>
> Looks like this series didn't make it. I was awaiting a rebase from
> Sartak to apply it, but apparently something got in his way for a new
> submission.
>
>>
>> You should enable it in the vendor host.
>
> Yes! We don't want unused code in the core. We need a user of it too.
>
> May I suggest that you pick up Sartak's patch for the core and thus
> add another patch for the host driver you care about and then
> re-submit it as a small series.
>
> Kind regards
> Uffe
>
>>
>>> ---
>>> drivers/mmc/core/block.c | 2 +-
>>> include/linux/mmc/host.h | 1 +
>>> 2 files changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
>>> index b5b414a71e0b..29fbe0ddeadb 100644
>>> --- a/drivers/mmc/core/block.c
>>> +++ b/drivers/mmc/core/block.c
>>> @@ -1503,7 +1503,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
>>> pr_debug("%s: CQE recovery start\n", mmc_hostname(host));
>>>
>>> err = mmc_cqe_recovery(host);
>>> - if (err)
>>> + if (err || host->cqe_recovery_reset_always)
>>> mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
>>> mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
>>>
>>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>>> index 62a6847a3b6f..f578541a06b5 100644
>>> --- a/include/linux/mmc/host.h
>>> +++ b/include/linux/mmc/host.h
>>> @@ -518,6 +518,7 @@ struct mmc_host {
>>> int cqe_qdepth;
>>> bool cqe_enabled;
>>> bool cqe_on;
>>> + bool cqe_recovery_reset_always;
>>>
>>> /* Inline encryption support */
>>> #ifdef CONFIG_MMC_CRYPTO
>>> --
>>> 2.29.0
>>>
Dear Ulf,
I have tested Sartak's patch and it is also able to resolve the issue we
are currently facing. Therefore, I would like to inquire about the
expected timeline for merging Sartak's patch.
--
Regards,
Michael Wu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mmc: core: Add new flag to force hardware reset
2023-11-06 12:26 ` Michael Wu
@ 2023-11-06 14:19 ` Ulf Hansson
2024-01-11 6:05 ` Wenchao Chen
0 siblings, 1 reply; 6+ messages in thread
From: Ulf Hansson @ 2023-11-06 14:19 UTC (permalink / raw)
To: Michael Wu
Cc: Wenchao Chen, adrian.hunter, jinpu.wang, victor.shih,
avri.altman, asuk4.q, f.fainelli, beanhuo, linux-mmc,
linux-kernel, Sarthak Garg
On Mon, 6 Nov 2023 at 13:26, Michael Wu <michael@allwinnertech.com> wrote:
>
> On 9/25/2023 9:59 PM, Ulf Hansson wrote:
> > - trimmed cc-list, + Sartak Garg
> >
> > On Thu, 14 Sept 2023 at 10:00, Wenchao Chen <wenchao.chen666@gmail.com> wrote:
> >>
> >> On Thu, 14 Sept 2023 at 08:04, Michael Wu <michael@allwinnertech.com> wrote:
> >>>
> >>> Entering the recovery system itself indicates a transmission error.
> >>> In this situation, we intend to execute the mmc_blk_reset function
> >>> to clear any anomalies that may be caused by errors. We have previously
> >>> discussed with several MMC device manufacturers, and they expressed
> >>> their desire for us to reset the device when errors occur to ensure
> >>> stable operation. We aim to make this code compatible with all devices
> >>> and ensure its stable performance, so we would like to add this patch
> >>>
> >>> Signed-off-by: Michael Wu <michael@allwinnertech.com>
> >>
> >> like: https://lore.kernel.org/linux-mmc/20220603051534.22672-1-quic_sartgarg@quicinc.com/
> >
> > Looks like this series didn't make it. I was awaiting a rebase from
> > Sartak to apply it, but apparently something got in his way for a new
> > submission.
> >
> >>
> >> You should enable it in the vendor host.
> >
> > Yes! We don't want unused code in the core. We need a user of it too.
> >
> > May I suggest that you pick up Sartak's patch for the core and thus
> > add another patch for the host driver you care about and then
> > re-submit it as a small series.
> >
> > Kind regards
> > Uffe
> >
> >>
> >>> ---
> >>> drivers/mmc/core/block.c | 2 +-
> >>> include/linux/mmc/host.h | 1 +
> >>> 2 files changed, 2 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> >>> index b5b414a71e0b..29fbe0ddeadb 100644
> >>> --- a/drivers/mmc/core/block.c
> >>> +++ b/drivers/mmc/core/block.c
> >>> @@ -1503,7 +1503,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
> >>> pr_debug("%s: CQE recovery start\n", mmc_hostname(host));
> >>>
> >>> err = mmc_cqe_recovery(host);
> >>> - if (err)
> >>> + if (err || host->cqe_recovery_reset_always)
> >>> mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
> >>> mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
> >>>
> >>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> >>> index 62a6847a3b6f..f578541a06b5 100644
> >>> --- a/include/linux/mmc/host.h
> >>> +++ b/include/linux/mmc/host.h
> >>> @@ -518,6 +518,7 @@ struct mmc_host {
> >>> int cqe_qdepth;
> >>> bool cqe_enabled;
> >>> bool cqe_on;
> >>> + bool cqe_recovery_reset_always;
> >>>
> >>> /* Inline encryption support */
> >>> #ifdef CONFIG_MMC_CRYPTO
> >>> --
> >>> 2.29.0
> >>>
> Dear Ulf,
> I have tested Sartak's patch and it is also able to resolve the issue we
> are currently facing. Therefore, I would like to inquire about the
> expected timeline for merging Sartak's patch.
Hi Michael,
There is another series [1] that Adrian is working on that is related
to the problem in $subject patch. Perhaps you can take a look and try
it out instead of Sartak's patch, which seems to have gotten stalled.
Kind regards
Uffe
[1]
https://lore.kernel.org/all/20231103084720.6886-1-adrian.hunter@intel.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mmc: core: Add new flag to force hardware reset
2023-11-06 14:19 ` Ulf Hansson
@ 2024-01-11 6:05 ` Wenchao Chen
0 siblings, 0 replies; 6+ messages in thread
From: Wenchao Chen @ 2024-01-11 6:05 UTC (permalink / raw)
To: Ulf Hansson
Cc: Michael Wu, adrian.hunter, jinpu.wang, victor.shih, avri.altman,
asuk4.q, f.fainelli, beanhuo, linux-mmc, linux-kernel,
Sarthak Garg
On Mon, 6 Nov 2023 at 22:20, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Mon, 6 Nov 2023 at 13:26, Michael Wu <michael@allwinnertech.com> wrote:
> >
> > On 9/25/2023 9:59 PM, Ulf Hansson wrote:
> > > - trimmed cc-list, + Sartak Garg
> > >
> > > On Thu, 14 Sept 2023 at 10:00, Wenchao Chen <wenchao.chen666@gmail.com> wrote:
> > >>
> > >> On Thu, 14 Sept 2023 at 08:04, Michael Wu <michael@allwinnertech.com> wrote:
> > >>>
> > >>> Entering the recovery system itself indicates a transmission error.
> > >>> In this situation, we intend to execute the mmc_blk_reset function
> > >>> to clear any anomalies that may be caused by errors. We have previously
> > >>> discussed with several MMC device manufacturers, and they expressed
> > >>> their desire for us to reset the device when errors occur to ensure
> > >>> stable operation. We aim to make this code compatible with all devices
> > >>> and ensure its stable performance, so we would like to add this patch
> > >>>
> > >>> Signed-off-by: Michael Wu <michael@allwinnertech.com>
> > >>
> > >> like: https://lore.kernel.org/linux-mmc/20220603051534.22672-1-quic_sartgarg@quicinc.com/
> > >
> > > Looks like this series didn't make it. I was awaiting a rebase from
> > > Sartak to apply it, but apparently something got in his way for a new
> > > submission.
> > >
> > >>
> > >> You should enable it in the vendor host.
> > >
> > > Yes! We don't want unused code in the core. We need a user of it too.
> > >
> > > May I suggest that you pick up Sartak's patch for the core and thus
> > > add another patch for the host driver you care about and then
> > > re-submit it as a small series.
> > >
> > > Kind regards
> > > Uffe
> > >
> > >>
> > >>> ---
> > >>> drivers/mmc/core/block.c | 2 +-
> > >>> include/linux/mmc/host.h | 1 +
> > >>> 2 files changed, 2 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> > >>> index b5b414a71e0b..29fbe0ddeadb 100644
> > >>> --- a/drivers/mmc/core/block.c
> > >>> +++ b/drivers/mmc/core/block.c
> > >>> @@ -1503,7 +1503,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
> > >>> pr_debug("%s: CQE recovery start\n", mmc_hostname(host));
> > >>>
> > >>> err = mmc_cqe_recovery(host);
> > >>> - if (err)
> > >>> + if (err || host->cqe_recovery_reset_always)
> > >>> mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
> > >>> mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
> > >>>
> > >>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> > >>> index 62a6847a3b6f..f578541a06b5 100644
> > >>> --- a/include/linux/mmc/host.h
> > >>> +++ b/include/linux/mmc/host.h
> > >>> @@ -518,6 +518,7 @@ struct mmc_host {
> > >>> int cqe_qdepth;
> > >>> bool cqe_enabled;
> > >>> bool cqe_on;
> > >>> + bool cqe_recovery_reset_always;
> > >>>
> > >>> /* Inline encryption support */
> > >>> #ifdef CONFIG_MMC_CRYPTO
> > >>> --
> > >>> 2.29.0
> > >>>
> > Dear Ulf,
> > I have tested Sartak's patch and it is also able to resolve the issue we
> > are currently facing. Therefore, I would like to inquire about the
> > expected timeline for merging Sartak's patch.
>
Hi Sartak
Any updates?
> Hi Michael,
>
> There is another series [1] that Adrian is working on that is related
> to the problem in $subject patch. Perhaps you can take a look and try
> it out instead of Sartak's patch, which seems to have gotten stalled.
>
> Kind regards
> Uffe
>
> [1]
> https://lore.kernel.org/all/20231103084720.6886-1-adrian.hunter@intel.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-11 6:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-14 0:03 [PATCH] mmc: core: Add new flag to force hardware reset Michael Wu
2023-09-14 8:00 ` Wenchao Chen
2023-09-25 13:59 ` Ulf Hansson
2023-11-06 12:26 ` Michael Wu
2023-11-06 14:19 ` Ulf Hansson
2024-01-11 6:05 ` Wenchao Chen
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.