Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3230933pxj; Mon, 24 May 2021 01:39:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0/4/2fpYedgD94pvjI019FoPvhwle5+1EOoTmy9Hoi8OH/wRKoiGnMdDk1OiI4WQ7SGpo X-Received: by 2002:a5e:c00e:: with SMTP id u14mr13703808iol.106.1621845550371; Mon, 24 May 2021 01:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621845550; cv=none; d=google.com; s=arc-20160816; b=DytgMP57DZe3eUyVQKXIZBDf7GyoSX9ef+Eku7CaudkD60DUVZMx6duR//0y2jb2Th FxqVItRFA9InCm/joGN6LpiRomrU6dOTnh+87I+z9OQXLhkDOy9iKY0pxMhSEZ9YN7Hi u6RGIZXGk95NEzQPoMblgtv9XPykJfvSHtCb0Oi31mNhtxdhtj5FshZdMfjNPXaMDHVm Fr5/phv5rmGnY/4hJlcv18WgvUfx98lijJYyEJZhrvyzK0H2uqxCHbeHjAlPiabswBVU MMuuzflnhVxNFrzIiX+jOlUbsdztVp0MwImWWQCw81mbwf9tsaLqTDxEAcuff60bVqeP 7KRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr; bh=rp1fti5rwMPfCS3VDa4iRyJlg13RYdYiO0MaHL2mXyE=; b=v3dBQVwEAB8H9xJOgUCwzSjgUuyrk9zxMzFEA0Dh9rRxUtjXeXV4yTi6jP77gLuRPK NVLP2la1R9YxvKNyZ0GF8a9T4oYmcU8Mbjo0AJOcP16g+4A83k6XynW0VsDJRuxSBnWy a6lGxeNX1lAyrqaPNgIljr3dVj3gJgy20+/J8PtMxbc5Awy4wfPwYRZQgx9m1Q2ggrYl VJapsRgNYmTeQ5QavI2W/pdW/COGn8s5st0Wc40Bg3tudNMNAQaWnb/wquxjWWQ3fknQ ekEtW93Undp7L3Mi531e6rIaIrs6mPgqgYS89rIXqgGo5PSkMKLE0xTTFWEX7/6jwFhK r5ww== ARC-Authentication-Results: i=1; mx.google.com; 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 j13si3447757ilk.14.2021.05.24.01.38.57; Mon, 24 May 2021 01:39:10 -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; 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 S232424AbhEXIij (ORCPT + 99 others); Mon, 24 May 2021 04:38:39 -0400 Received: from labrats.qualcomm.com ([199.106.110.90]:12145 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232313AbhEXIij (ORCPT ); Mon, 24 May 2021 04:38:39 -0400 IronPort-SDR: ZzQS+FN4lAjrIbd6BaXDIqC1HEoUUMkGnMC+K9FtIVF7bYWdzd6SsuwyUta2DB8quQT5+Ic0Cf x5ezx8lxrd9L8unW06lFkyhQE9riRtE/XZcTM+7f/vwp4Pv53w+Mam76iKCTNglEs+pMSW3O5q 5Rn7X8XVJ5evrJ20UrIirlFnD0gVMDmQVc7Lq5wdG+F/oeoa/15ex0MHO33ILUdGhonvVUBZqs J/jkYO2ZG8hQfYgUNf7ncci1GcUiy/qwraxdd3mHSTJuKaURkX4iLOpmj695n1xgd9HTsCMU/c kqM= X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="29772328" Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by labrats.qualcomm.com with ESMTP; 24 May 2021 01:37:11 -0700 X-QCInternal: smtphost Received: from stor-presley.qualcomm.com ([192.168.140.85]) by ironmsg03-sd.qualcomm.com with ESMTP; 24 May 2021 01:37:10 -0700 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id A7B8421AD7; Mon, 24 May 2021 01:37:10 -0700 (PDT) From: Can Guo To: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, cang@codeaurora.org Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Jaegeuk Kim , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 1/3] scsi: ufs: Remove a redundant command completion logic in error handler Date: Mon, 24 May 2021 01:36:56 -0700 Message-Id: <1621845419-14194-2-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621845419-14194-1-git-send-email-cang@codeaurora.org> References: <1621845419-14194-1-git-send-email-cang@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ufshcd_host_reset_and_restore() anyways completes all pending requests before starts re-probing, so there is no need to complete the command on the highest bit in tr_doorbell in advance. Signed-off-by: Can Guo --- drivers/scsi/ufs/ufshcd.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index d543864..c4b37d2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6123,19 +6123,6 @@ static void ufshcd_err_handler(struct work_struct *work) do_reset: /* Fatal errors need reset */ if (needs_reset) { - unsigned long max_doorbells = (1UL << hba->nutrs) - 1; - - /* - * ufshcd_reset_and_restore() does the link reinitialization - * which will need atleast one empty doorbell slot to send the - * device management commands (NOP and query commands). - * If there is no slot empty at this moment then free up last - * slot forcefully. - */ - if (hba->outstanding_reqs == max_doorbells) - __ufshcd_transfer_req_compl(hba, - (1UL << (hba->nutrs - 1))); - hba->force_reset = false; spin_unlock_irqrestore(hba->host->host_lock, flags); err = ufshcd_reset_and_restore(hba); -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.