Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3577010pxj; Mon, 24 May 2021 09:45:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLmx8l3xT1MgZ2uG80JYMms7HV50od4Q1W3nxUT680mN8qlDI0SrVP0QBI1r0eVKJs6qX7 X-Received: by 2002:a6b:f60e:: with SMTP id n14mr16924850ioh.179.1621874721358; Mon, 24 May 2021 09:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621874721; cv=none; d=google.com; s=arc-20160816; b=WdVMtKsmFSwRsUG/Jh3S0lAE+v2MWRGDPbKL65wf+Pq9Z6L6qNbEpOLtkoYgBsAWwQ dqHABE8r0Jc2hpFiTK29UfyzVrhuvZtTWSFAxy6J2HuEKM4qlnGTuyYfLj5033G82xVk tdSy8IXtl78WO/eRbbQgTt4hkxJVOr8gBZe+XL9se7T1NxD4huxCHfMLdYyttaA/WBw9 dYurQrYXZcNONmkrO53M7ApTYfvzVbICbxNVwtRlyzwvBqwqOf8XIINX/YJgKH8TathO yhL+so5N8ywABAOz3L3eRncixHZgD4+xASqMMy3z5SKnSWAkTcCm7tpKitpAIK34Tn3x ajYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=18LZXFfoeDIVMuTxHOTE3u1Zu0pBl9ruKcbI+eZVKgw=; b=eTH0zRxGfTxNfPJXPRB5igD59eyw6/nP2lqxp1ATUhsvc6+8aaK9pWT9sVb7nj967c GND/gCLVQDbPJpQ9lGO9mmB6LAyaGynI//1F2GtWw9MblUeXJkZZAY1fj4/fuyME8xRN T5Ut16WegNzjN4iGpYzew1bVrtIOseAHdUhxLwyaHa4gDFTYz7qW7SjCZmPoCTu05oA8 sgSdVHa2Mra2jVF3DwCL1pM83qZikuAS3REHjgd3a6P9UpsrTL5HG15vYxq2JRaQm2+u 2/mKSNOZ7j2wkaI0S7Pm3gxUXlbWnGncTtfgQXsBxYtmAhcMVwLChbnGPcQzWAPvRheI XlIg== 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 f2si16546553ioz.41.2021.05.24.09.45.03; Mon, 24 May 2021 09:45:21 -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 S233155AbhEXQpH (ORCPT + 99 others); Mon, 24 May 2021 12:45:07 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:51779 "EHLO mail-pj1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232900AbhEXQpG (ORCPT ); Mon, 24 May 2021 12:45:06 -0400 Received: by mail-pj1-f42.google.com with SMTP id k5so15162003pjj.1; Mon, 24 May 2021 09:43:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=18LZXFfoeDIVMuTxHOTE3u1Zu0pBl9ruKcbI+eZVKgw=; b=LiDMQh+3pFWRhf6l8O2/n0NzO6ShOoL/V2FEHRyMrcEt2DB6k93WjVuGw/QYDx9uxh OUP/Z1qz5Oa9/QWwc8ScqXm+UFRIkYKhCT3V/6hE0G2FC7l4m6VKRE3kgE+p9EC+FOAU uzd5Tpz2w8vpFHqvzwqE7AGy/6m6qG3wJu79wICNdok6/xXbty9mEaaoIbzZ1hiCS5OH fI5NE2CMxYMsPoujlDwo1I4fJy0DFeAkirrAnDVBtRxKLu1h9hE/Q6Qe+8Iy2H0T6STE xbpJ2B3BfJvu+SFdTEUTmKKvx/kuNsNyzYkIjrixVyRTm3iIcFCFvjMo59m5vP4jucFf 4zOw== X-Gm-Message-State: AOAM5326cmKqU3qzogpcIY/2JrFeu1VMZh16cH+wpnu2xiRPT/4Sa1J1 FBm1T3OWB0VwrjB+QaerDhABto9c226QLw== X-Received: by 2002:a17:90b:4d11:: with SMTP id mw17mr25705564pjb.229.1621874617779; Mon, 24 May 2021 09:43:37 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id u10sm12417795pfl.123.2021.05.24.09.43.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 09:43:37 -0700 (PDT) Subject: Re: [PATCH v1 1/3] scsi: ufs: Remove a redundant command completion logic in error handler To: Can Guo , asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Jaegeuk Kim , open list References: <1621845419-14194-1-git-send-email-cang@codeaurora.org> <1621845419-14194-2-git-send-email-cang@codeaurora.org> From: Bart Van Assche Message-ID: <5e1ba70b-7cdd-a677-28b2-f0a441773969@acm.org> Date: Mon, 24 May 2021 09:43:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <1621845419-14194-2-git-send-email-cang@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/21 1:36 AM, Can Guo wrote: > 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); > Reviewed-by: Bart Van Assche