From patchwork Mon May 20 08:32:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanley Chu X-Patchwork-Id: 10950517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08B46912 for ; Mon, 20 May 2019 08:33:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE8D128753 for ; Mon, 20 May 2019 08:33:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC5B8286C2; Mon, 20 May 2019 08:33:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E11A28753 for ; Mon, 20 May 2019 08:33:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730764AbfETIdE (ORCPT ); Mon, 20 May 2019 04:33:04 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:36042 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729354AbfETIdC (ORCPT ); Mon, 20 May 2019 04:33:02 -0400 X-UUID: a1386b9aa6d1473cb06b166d46692dee-20190520 X-UUID: a1386b9aa6d1473cb06b166d46692dee-20190520 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1467952316; Mon, 20 May 2019 16:32:56 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 20 May 2019 16:32:54 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 20 May 2019 16:32:55 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , Stanley Chu Subject: [PATCH v3 0/3] scsi: ufs: Add error handling of Auto-Hibernate Date: Mon, 20 May 2019 16:32:15 +0800 Message-ID: <1558341138-18043-1-git-send-email-stanley.chu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "UIC_HIBERNATE_EXIT" shall be raised according to UFS specification. This patch adds auto-hibernate error-handling: - Monitor "Hibernate Enter" and "Hibernate Exit" interrupts after auto-hibernate feature is activated. - If fail happens, trigger error-handling just like "manual-hibernate" fail and apply the same recovery flow: schedule UFS error handler in ufshcd_check_errors(), and then do host reset and restore in UFS error handler. v3: - Fix typo in patch "scsi: ufs: Do not overwrite Auto-Hibernate timer" (Avri Altman) - Rebase to Linux 5.2-rc1 v2: - Fix sentences in commit message (Marc Gonzalez) - Make "Auto-Hibernate" error detection more precise (Bean Huo) Stanley Chu (3): scsi: ufs: Do not overwrite Auto-Hibernate timer scsi: ufs: Add error-handling of Auto-Hibernate scsi: ufs: Use re-factored Auto-Hibernate function drivers/scsi/ufs/ufshcd.c | 33 ++++++++++++++++++++++++++++++++- drivers/scsi/ufs/ufshcd.h | 5 +++++ drivers/scsi/ufs/ufshci.h | 3 +++ 3 files changed, 40 insertions(+), 1 deletion(-)