Message ID | 8e5593feaac75660ff132d67ee5d9130e628fefb.1716359578.git.quic_nguyenb@quicinc.com |
---|---|
State | New |
Headers | show |
Series | Allow vendor drivers to update UIC command timeout | expand |
On 5/22/24 00:01, Bao D. Nguyen wrote: > Change the UIC command timeout to 2 seconds. > This extra time is to allow the uart occasionally print long > debug messages and logging from different modules during > product development. With the default hardcoded 500ms timeout, > the uart printing with interrupt disabled may cause the UIC command > interrupt get starved, resulting in a UIC command timeout and > eventually a watchdog timeout. > When a product development completes, the vendors may > select a different UIC command timeout as desired. > > Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com> > --- > drivers/ufs/host/ufs-qcom.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 79f8cb3..4649e0f 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -49,6 +49,7 @@ enum { > > #define QCOM_UFS_MAX_GEAR 4 > #define QCOM_UFS_MAX_LANE 2 > +#define QCOM_UIC_CMD_TIMEOUT_MS 2000 > > enum { > MODE_MIN, > @@ -1111,6 +1112,8 @@ static int ufs_qcom_init(struct ufs_hba *hba) > dev_warn(dev, "%s: failed to configure the testbus %d\n", > __func__, err); > > + hba->uic_cmd_timeout = QCOM_UIC_CMD_TIMEOUT_MS; > + > return 0; > > out_variant_clear: Given the description of patch 1, the addressed issue is not specific to a single vendor. Is that correct? Since the described issue is only encountered during development, why to modify the UIC command timeout unconditionally? Thanks, Bart.
On 5/22/2024 11:18 AM, Bart Van Assche wrote: > On 5/22/24 00:01, Bao D. Nguyen wrote: >> Change the UIC command timeout to 2 seconds. >> This extra time is to allow the uart occasionally print long >> debug messages and logging from different modules during >> product development. With the default hardcoded 500ms timeout, >> the uart printing with interrupt disabled may cause the UIC command >> interrupt get starved, resulting in a UIC command timeout and >> eventually a watchdog timeout. >> When a product development completes, the vendors may >> select a different UIC command timeout as desired. >> >> Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com> >> --- >> drivers/ufs/host/ufs-qcom.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c >> index 79f8cb3..4649e0f 100644 >> --- a/drivers/ufs/host/ufs-qcom.c >> +++ b/drivers/ufs/host/ufs-qcom.c >> @@ -49,6 +49,7 @@ enum { >> #define QCOM_UFS_MAX_GEAR 4 >> #define QCOM_UFS_MAX_LANE 2 >> +#define QCOM_UIC_CMD_TIMEOUT_MS 2000 >> enum { >> MODE_MIN, >> @@ -1111,6 +1112,8 @@ static int ufs_qcom_init(struct ufs_hba *hba) >> dev_warn(dev, "%s: failed to configure the testbus %d\n", >> __func__, err); >> + hba->uic_cmd_timeout = QCOM_UIC_CMD_TIMEOUT_MS; >> + >> return 0; >> out_variant_clear: > > Given the description of patch 1, the addressed issue is not specific to > a single vendor. Is that correct? The issue we are trying to address is not specific to a single vendor. Any vendor would have a freedom to choose the UIC command timeout. At different times during their product development, they can choose different UIC command timeout, or use the default 500ms. It's the flexibility we would like to give to vendors. > > Since the described issue is only encountered during development, why to > modify the UIC command timeout unconditionally? The vendors can enjoy the default 500ms UIC timeout if they prefer. As long as they don't write to hba->uic_cmd_timeout in the vendor's initialization routine, the default value of 500ms will be used. Thanks, Bao > > Thanks, > > Bart.
On 5/22/24 13:56, Bao D. Nguyen wrote: > On 5/22/2024 11:18 AM, Bart Van Assche wrote: >> Since the described issue is only encountered during development, why to >> modify the UIC command timeout unconditionally? > > The vendors can enjoy the default 500ms UIC timeout if they prefer. > As long as they don't write to hba->uic_cmd_timeout in the vendor's initialization routine, the default value of 500ms will be used. Since this issue is not vendor specific, I think it would be better to modify the UFSHCI core driver only. Has it been considered to introduce a kernel module parameter for setting the UIC command timeout instead of the approach of this patch? As you probably know there are multiple mechanisms for specifying kernel module parameters, e.g. the bootargs parameter in the device tree. Thanks, Bart.
> On 5/22/24 13:56, Bao D. Nguyen wrote: > > On 5/22/2024 11:18 AM, Bart Van Assche wrote: > >> Since the described issue is only encountered during development, why to > >> modify the UIC command timeout unconditionally? > > > > The vendors can enjoy the default 500ms UIC timeout if they prefer. > > As long as they don't write to hba->uic_cmd_timeout in the vendor's > initialization routine, the default value of 500ms will be used. > > Since this issue is not vendor specific, I think it would be better to > modify the UFSHCI core driver only. Has it been considered to introduce a > kernel module parameter for setting the UIC command timeout instead of the > approach of this patch? As you probably know there are multiple mechanisms > for specifying kernel module parameters, e.g. the bootargs parameter in the > device tree. Since the problem statement is "During product development...", why not just a debugfs? Thanks, Avri > > Thanks, > > Bart.
On 5/22/2024 2:01 PM, Bart Van Assche wrote: > On 5/22/24 13:56, Bao D. Nguyen wrote: >> On 5/22/2024 11:18 AM, Bart Van Assche wrote: >>> Since the described issue is only encountered during development, why to >>> modify the UIC command timeout unconditionally? >> >> The vendors can enjoy the default 500ms UIC timeout if they prefer. >> As long as they don't write to hba->uic_cmd_timeout in the vendor's >> initialization routine, the default value of 500ms will be used. > > Since this issue is not vendor specific, I think it would be better to > modify the UFSHCI core driver only. Has it been considered to introduce a > kernel module parameter for setting the UIC command timeout instead of the > approach of this patch? As you probably know there are multiple mechanisms > for specifying kernel module parameters, e.g. the bootargs parameter in the > device tree. The proposal here uses similar implementation as the auto hibern8 timer (hba->ahit). The ahit mechanism has been working well and stable, so I thought why not keep using it? Let see if other members have any comments about kernel module parameter/bootargs suggestion. Thanks, Bao > > Thanks, > > Bart. >
On 5/22/2024 8:18 PM, Avri Altman wrote: >> On 5/22/24 13:56, Bao D. Nguyen wrote: >>> On 5/22/2024 11:18 AM, Bart Van Assche wrote: >>>> Since the described issue is only encountered during development, why to >>>> modify the UIC command timeout unconditionally? >>> >>> The vendors can enjoy the default 500ms UIC timeout if they prefer. >>> As long as they don't write to hba->uic_cmd_timeout in the vendor's >> initialization routine, the default value of 500ms will be used. >> >> Since this issue is not vendor specific, I think it would be better to >> modify the UFSHCI core driver only. Has it been considered to introduce a >> kernel module parameter for setting the UIC command timeout instead of the >> approach of this patch? As you probably know there are multiple mechanisms >> for specifying kernel module parameters, e.g. the bootargs parameter in the >> device tree. > Since the problem statement is "During product development...", why not just a debugfs? Hi Avri, if I am not mistaken, debugfs is not available at the initial stage of ufs probe/init time right? > > Thanks, > Avri > >> >> Thanks, >> >> Bart. >
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 79f8cb3..4649e0f 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -49,6 +49,7 @@ enum { #define QCOM_UFS_MAX_GEAR 4 #define QCOM_UFS_MAX_LANE 2 +#define QCOM_UIC_CMD_TIMEOUT_MS 2000 enum { MODE_MIN, @@ -1111,6 +1112,8 @@ static int ufs_qcom_init(struct ufs_hba *hba) dev_warn(dev, "%s: failed to configure the testbus %d\n", __func__, err); + hba->uic_cmd_timeout = QCOM_UIC_CMD_TIMEOUT_MS; + return 0; out_variant_clear:
Change the UIC command timeout to 2 seconds. This extra time is to allow the uart occasionally print long debug messages and logging from different modules during product development. With the default hardcoded 500ms timeout, the uart printing with interrupt disabled may cause the UIC command interrupt get starved, resulting in a UIC command timeout and eventually a watchdog timeout. When a product development completes, the vendors may select a different UIC command timeout as desired. Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com> --- drivers/ufs/host/ufs-qcom.c | 3 +++ 1 file changed, 3 insertions(+)