From patchwork Sat Mar 28 02:27:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Can Guo X-Patchwork-Id: 11468065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DEC6159A for ; Tue, 31 Mar 2020 16:10:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24BF3206CC for ; Tue, 31 Mar 2020 16:10:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731149AbgCaQKP (ORCPT ); Tue, 31 Mar 2020 12:10:15 -0400 Received: from labrats.qualcomm.com ([199.106.110.90]:36630 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730562AbgCaQKO (ORCPT ); Tue, 31 Mar 2020 12:10:14 -0400 IronPort-SDR: 4cDDdotfZSrOFGqJiolPY42RKaKNCZFWr+ijJBDeoMtBy5Dvxkom/Sj9Tm1Vy0v8fUM5QpbtW2 fh+lXzG4U4cBb2L6v3R2JsTKQ6HElj/+RsxEcVODq4Vw1f/o6PHjLU5FHMiZP57Z0OjtAQW740 fzO+bAQAnm7VCYkyJM4kYtyJXCuuSO2dNCN+B9vXz5XL8YMlGz5auQ2TyUapusc0RrGtEf4bNS 76/z7o9dMoHFwGyTf79UQKW+wat6IGc2zB/wwX6eA4x37t85uwzIhcAAfyISfdJcwQTDguBjqK NJo= X-IronPort-AV: E=Sophos;i="5.72,314,1580803200"; d="scan'208";a="28621129" Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by labrats.qualcomm.com with ESMTP; 27 Mar 2020 19:27:37 -0700 Received: from pacamara-linux.qualcomm.com ([192.168.140.135]) by ironmsg03-sd.qualcomm.com with ESMTP; 27 Mar 2020 19:27:36 -0700 Received: by pacamara-linux.qualcomm.com (Postfix, from userid 359480) id AF31C3ABE; Fri, 27 Mar 2020 19:27:36 -0700 (PDT) From: Can Guo To: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, cang@codeaurora.org Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Bart Van Assche , Venkat Gopalakrishnan , Tomas Winkler , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 1/1] scsi: ufs: full reinit upon resume if link was off Date: Fri, 27 Mar 2020 19:27:31 -0700 Message-Id: <1585362454-5413-1-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Asutosh Das During suspend, if the link is put to off, it would require a full initialization during resume. This patch resets and restores both the hba and the card during initialization. Signed-off-by: Asutosh Das Signed-off-by: Can Guo Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index f19a11e..21e41e5 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8007,9 +8007,13 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) else goto vendor_suspend; } else if (ufshcd_is_link_off(hba)) { - ret = ufshcd_host_reset_and_restore(hba); /* - * ufshcd_host_reset_and_restore() should have already + * A full initialization of the host and the device is required + * since the link was put to off during suspend. + */ + ret = ufshcd_reset_and_restore(hba); + /* + * ufshcd_reset_and_restore() should have already * set the link state as active */ if (ret || !ufshcd_is_link_active(hba))