Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp308778pxb; Wed, 20 Oct 2021 23:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4X1b/MbkIb6SjqmvJm/yWdh46bSEVAkGYBOYsSM1tNWUr4EGfrQAlU3vldL5FKMdFx0ZF X-Received: by 2002:a17:907:3eaa:: with SMTP id hs42mr4761390ejc.429.1634796852729; Wed, 20 Oct 2021 23:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634796852; cv=none; d=google.com; s=arc-20160816; b=0lfpewb3Tzt7Gq24i/ivtzMI0OX0NN1w61jYETbxFkBW/vL21BePkOpHLP8d4kCydV MTylqVO+MuiTCJ6preMpRtAe2i3cPKzkKB5l25CwuEcOwUF22XBtxfRJbvUBTRxQZ8Wb MzuYVj/exskuENNyMs3yYBCABEGXfrTHNDCFz0wYXELmpF/lTtyotuV+32s6/B6h99eR 1JQk2g/4fIxIifOOnBlgn+8boQFYO+y2xlLQXSMQS92mkEjXDsD26wgQre0RU0J+KlWk lWAWtbWVbvRKh/0pQP9jxxHs64aqfYDUjAkqwufCiquiLSxTXd1dD3vtDSnj5O7KVXF/ pbYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=JfB3g7Mo4BBuUaUjm4HKsQghLnYQpwiZK7oz3TCDBnI=; b=P6QMyqh4zbsU309sRDhpIZ59leWXoB7vGhy6VOy6y5J2GHrY+mqqgeXfJYFaAtNYku tdzrnZdQiHnk4WpicPd+N/sO/0sx4I8ShlGOetqMlD/kSMV2Rfr7bUcZjR/b6DVo+gj8 HmRhanLVRWLm1Sa2WNJaMq57PaqCXRfFcCtZFdrdrRjj0o3PFgzxNJw4noK2bHqgdCsw s5YFoknMoGTHFO+rL0+e8wQe++SUAukgg1D4Pu7lIRJFG1cduMAWAsSqMV+wLK4gCm/z eosY6qaS6Mk/eaIqJCY/PPxuiRcE9pI8/7GDOpoQW1CcQd0ASrlyRZvoZjgWrI4u5qsU H/qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=mSIhJaH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo24si5809517ejb.197.2021.10.20.23.13.38; Wed, 20 Oct 2021 23:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=mSIhJaH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231232AbhJUGMu (ORCPT + 99 others); Thu, 21 Oct 2021 02:12:50 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:63789 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbhJUGMu (ORCPT ); Thu, 21 Oct 2021 02:12:50 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1634796634; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=JfB3g7Mo4BBuUaUjm4HKsQghLnYQpwiZK7oz3TCDBnI=; b=mSIhJaH6QjnZkYd4AMo1nuWxQpD/ysvcGc/Ok8v+63uVSgy8+nwk9OCY6VGE0tgHfp4D+ibP vg2VQ31v7XeQKYo/3d77lbP/7U/rddo1FeqCtFbPCNrtYE6eU8FhiX4dqBj7f8Cfyg4aJkdP ijOyx/vqLwJeu2fOMtGtAJcDomQ= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 6171044dbc30296958a54539 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 21 Oct 2021 06:10:21 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 36E02C4360D; Thu, 21 Oct 2021 06:10:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id 28BE3C4338F; Thu, 21 Oct 2021 06:10:19 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 21 Oct 2021 14:10:19 +0800 From: Can Guo To: Kiwoong Kim Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, adrian.hunter@intel.com, sc.suh@samsung.com, hy50.seo@samsung.com, sh425.lee@samsung.com, bhoon95.kim@samsung.com, vkumar.1997@samsung.com Subject: Re: [PATCH RESEND v2] scsi: ufs: clear doorbell for hibern8 errors when using ah8 In-Reply-To: <1634619427-171880-1-git-send-email-kwmad.kim@samsung.com> References: <1634619427-171880-1-git-send-email-kwmad.kim@samsung.com> Message-ID: X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-10-19 12:57, Kiwoong Kim wrote: > Changes from v1: > * Change the time to requeue pended commands > > When an scsi command is dispatched right after host complete > all the pended requests and ufs driver tries to ring a doorbell, > host might be still during entering into hibern8. > If the hibern8 error occurrs during that period, the doorbell > might not be zero and clearing it should have done. > But, current ufshcd_err_handler goes directly to reset > w/o clearing the doorbell when the driver's link state is broken. /* * Stop the host controller and complete the requests * cleared by h/w */ ufshcd_hba_stop(hba); hba->silence_err_logs = true; ufshcd_complete_requests(hba); Same ask as Adrian did, ufshcd_hba_stop() should clear all doorbell bits as it disables UFS host controller, then ufshcd_complete_requests() completes any pending requests, no? > This patch is to requeue pended commands after host reset. > > Here's an actual symptom that I've faced. At the time, tag #17 > is still pended even after host reset. And then the block timer > is expired. > > exynos-ufs 11100000.ufs: ufshcd_check_errors: Auto Hibern8 > Enter failed - status: 0x00000040, upmcrs: 0x00000001 > .. > host_regs: 00000050: b8671000 00000008 00020000 00000000 > .. > exynos-ufs 11100000.ufs: ufshcd_abort: Device abort task at tag 17 > > Signed-off-by: Kiwoong Kim > --- > drivers/scsi/ufs/ufshcd.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index 9faf02c..e5d4ef7 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -7136,8 +7136,10 @@ static int ufshcd_host_reset_and_restore(struct > ufs_hba *hba) > err = ufshcd_hba_enable(hba); > > /* Establish the link again and restore the device */ > - if (!err) > + if (!err) { > + ufshcd_retry_aborted_requests(hba); > err = ufshcd_probe_hba(hba, false); > + } > > if (err) > dev_err(hba->dev, "%s: Host init failed %d\n", __func__, err);