From: Stanley Chu <stanley.chu@mediatek.com>
To: "Bean Huo (beanhuo)" <beanhuo@micron.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"marc.w.gonzalez@free.fr" <marc.w.gonzalez@free.fr>,
"andy.teng@mediatek.com" <andy.teng@mediatek.com>,
"chun-hung.wu@mediatek.com" <chun-hung.wu@mediatek.com>,
"kuohong.wang@mediatek.com" <kuohong.wang@mediatek.com>,
"evgreen@chromium.org" <evgreen@chromium.org>,
"avri.altman@wdc.com" <avri.altman@wdc.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"peter.wang@mediatek.com" <peter.wang@mediatek.com>,
"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
"subhashj@codeaurora.org" <subhashj@codeaurora.org>,
"sayalil@codeaurora.org" <sayalil@codeaurora.org>,
"pedrom.sousa@synopsys.com" <pedrom.sousa@synopsys.com>,
"vivek.gautam@codeaurora.org" <vivek.gautam@codeaurora.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Subject: RE: [EXT] [PATCH v1 2/3] scsi: ufs: add error handling of auto-hibern8
Date: Wed, 15 May 2019 10:52:12 +0800 [thread overview]
Message-ID: <1557888732.24427.37.camel@mtkswgap22> (raw)
In-Reply-To: <BN7PR08MB56840A3CD3BA7C107D0230CADB080@BN7PR08MB5684.namprd08.prod.outlook.com>
Hi Bean,
On Tue, 2019-05-14 at 11:14 +0000, Bean Huo (beanhuo) wrote:
> Hi, Stanley
> Thanks for reply.
>
> >
> >On Mon, 2019-05-13 at 18:21 +0000, Bean Huo (beanhuo) wrote:
> >> Hi, Stanley
> >>
> >> >+
> >> >+static inline bool ufshcd_is_auto_hibern8_error(struct ufs_hba *hba,
> >> >+ u32 intr_mask)
> >> >+{
> >> >+ return (ufshcd_is_auto_hibern8_supported(hba) &&
> >> >+ !hba->uic_async_done &&
> >>
> >> Here check if uic_async_done is NULL, no big problem so far, but not safe
> >enough.
> >> How about setting a flag in ufshcd_auto_hibern8_enable(),
> >
> >>
> >> I concern about how to compatible with auto_hibern8 disabled condition.
> >
> >Currently auto-hibern8 disabling method is not implemented in mainstream,
> >so an "enabling" flag may looks redundant unless disabling path is really
> >existed.
> >
> Did you try to update Auto-Hibernate Idle Timer with 0 through '/sys' (scsi: ufs: Add support for Auto-Hibernate Idle Timer)?
> I don't know if this will disable your UFS controller Auto-Hibernate.
> If having a look at UFS host Spec, software writes “0” to disable Auto-Hibernate Idle Timer.
> Sorry I cannot verify this on my platform since it doesn't support auto-hibernate.
>
Sorry I missed this /sys interface for Auto-Hibernate control.
Yes, I have tested "Auto-Hibernate disabled" case, in this case,
UIC_HIBERNATE_ENTER and UIC_HIBERNATE_EXIT interrupts comes only if
Manual-Hibernate is performed and waiting for completion. Both
interrupts will not be identified as Auto-Hibernate errors by checking
hba->uic_async_done.
As for your concerning, I would like to make "Auto-Hibernate error
detection" more precise in next version: Use below conditions instead of
checking hba->uic_async_done:
As-is:
static inline bool ufshcd_is_auto_hibern8_error(struct ufs_hba *hba,
u32 intr_mask)
{
return (ufshcd_is_auto_hibern8_supported(hba) &&
!hba->uic_async_done &&
(intr_mask & UFSHCD_UIC_AH8_ERROR_MASK));
}
To-be:
static bool ufshcd_is_auto_hibern8_error(struct ufs_hba *hba,
u32 intr_mask)
{
if (!ufshcd_is_auto_hibern8_supported(hba))
return false;
if (!(intr_mask & UFSHCD_UIC_AH8_ERROR_MASK))
return false;
if (hba->active_uic_cmd &&
((hba->active_uic_cmd->command == UIC_CMD_DME_HIBER_ENTER) ||
(hba->active_uic_cmd->command == UIC_CMD_DME_HIBER_EXIT)))
return false;
return true;
}
What would you think about this change?
>
> >I agree that checking hba->uic_async_done here does not look so intuitive.
> >However even if auto-hibern8 is disabled, these checks could be safe enough
> >because both "UIC_HIBERNATE_ENTER" and "UIC_HIBERNATE_EXIT" are
> >raised only if "manual-hibernate" is performed, and in this case hba-
> >>uic_async_done shall be true.
> >
> Yes, most of cases ,this is no problem.
>
> >Anything else or corner case I missed?
> >
> The others are fine. I only concern checking hba->uic_async_done.
>
> //Bean
Many thanks,
Stanley
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-05-15 2:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 14:36 [PATCH v1 0/3] scsi: ufs: add error handlings of auto-hibern8 Stanley Chu
2019-05-13 14:36 ` [PATCH v1 1/3] scsi: ufs: do not overwrite auto-hibern8 timer Stanley Chu
2019-05-13 14:36 ` [PATCH v1 2/3] scsi: ufs: add error handling of auto-hibern8 Stanley Chu
2019-05-13 18:21 ` [EXT] " Bean Huo (beanhuo)
2019-05-14 6:58 ` Stanley Chu
2019-05-14 11:14 ` Bean Huo (beanhuo)
2019-05-15 2:52 ` Stanley Chu [this message]
2019-05-13 14:36 ` [PATCH v1 3/3] scsi: ufs: use re-factored auto_hibern8 function Stanley Chu
2019-05-13 14:51 ` [PATCH v1 0/3] scsi: ufs: add error handlings of auto-hibern8 Marc Gonzalez
2019-05-14 6:25 ` Stanley Chu
2019-05-20 5:58 ` Avri Altman
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=1557888732.24427.37.camel@mtkswgap22 \
--to=stanley.chu@mediatek.com \
--cc=alim.akhtar@samsung.com \
--cc=andy.teng@mediatek.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=chun-hung.wu@mediatek.com \
--cc=evgreen@chromium.org \
--cc=kuohong.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=marc.w.gonzalez@free.fr \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=pedrom.sousa@synopsys.com \
--cc=peter.wang@mediatek.com \
--cc=sayalil@codeaurora.org \
--cc=subhashj@codeaurora.org \
--cc=vivek.gautam@codeaurora.org \
/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