Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp2075072rdb; Wed, 31 Jan 2024 19:52:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMsGA3BYQmzEypQObLX2m0InSLERm6a8j3UhwfYvJZBztlwB0P6qAzGvWEDK8x1cUY3SFS X-Received: by 2002:a17:902:d4cc:b0:1d8:f072:ec9f with SMTP id o12-20020a170902d4cc00b001d8f072ec9fmr1424003plg.28.1706759521819; Wed, 31 Jan 2024 19:52:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706759521; cv=pass; d=google.com; s=arc-20160816; b=ZyvvsN4lJApMteZ8xHcTnEN4aEtJA6B4FYoU4bENSFmHxCNaNBSpOYQNXpNWPU6stA O3jXPNzAVdrAKsZXhF/ib6Q8EdPO5H2XaKBb2C8AKFfi8gIq7NxdcBC2eksUhPZW0c75 yVtAYe+gbUA2qfYAAaP2hqtaQr7tNy138BEXr+3gCa3bsGkqysUVNd2aIE5SxUD/KUoV ptF1KqsavHPh3b9ebgtyY23ggWaJ/DqAnqC8TwKZWpCCXZuhfruvOeXE176Ubq15Lh17 evlam+CCi1qjveiKKGWTgQYRi7mDQ7ygcq4NC1H93kHt2dTmal/apnfHG4okxz2h4zeI y5EA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=hDXm8bbfVsYkdRMP++yi7/3ByrToweDaaBP8GUMHS3k=; fh=8vlx+xt/g9weoJPKTm7LiT6y7tndeTYOsT5I/MJgGT8=; b=T1JrdbsFHkUd+d8ImdaiTKYIWsU+lbrNSF+V7ALuHQLnq+oTd8J6JAyLYu3nWdOzR6 JOldLhiUEMNO2eU3qoXJV3QRtDheyoBOsHXqU9JsjSRoh7KC5sxK/8ql8wVPw0kjmiNj SZFIoE2ksyBZxllxzjgwRP4zOvf7fKBjqAktKXBJb1WjoA4qbNsN9SoNsGMB3B9zgSY9 h797HvGricQlw/muyYR/rOhzkrSyzk8AWACz+D4W7O2q4M/7vEo5ywZHMxRegbvVgTG8 1n/aMtEFxdIJ4oRLWXv3oc8kWER8YfoLVC299+ifwt7P1fIKVF6IefNOK9/aOEe34/4y 0c/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kFJfbRzr; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-47587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCWkwpITFLmXYay5BsSiho8E07nYGIkfSyrKyrUTf1bADggOrziW7R//pYiyoVjl4p2FDu/LNyWyiYAOYSetFV+G4fCSnoHTOZuH8k+umw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r4-20020a1709028bc400b001d7105e7ff9si10658668plo.546.2024.01.31.19.52.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 19:52:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kFJfbRzr; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-47587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2A362B21D26 for ; Thu, 1 Feb 2024 03:37:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B14553B187; Thu, 1 Feb 2024 03:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="kFJfbRzr" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 381AB282EB; Thu, 1 Feb 2024 03:36:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706758611; cv=none; b=jkmayETDnVDnLTFPIfhVXV+GrJNX9kox+sNhlqFt1SICprJyXlep+gUJZj9VfBlpY5HCxVH9xj1rXROYr5Qd34Ivl4G50oq3HoLLRvGAW4PphVcEy89XowhTy78oWWKsYIR3QBUXe9dW7Ld6wkvR2jjbzXVmuLYMtbc5YVPDiiQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706758611; c=relaxed/simple; bh=Bq55cvGNwwVVpOCiQwwFt8k52ct0mUs6l4Q52OlVgMM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=k6Yv33hvoZxuMz0mfPcf5oGGKUHyai4opeVefjFl6fNFtC067ttNSsz0MakwYWMKHP/JGXphIptloHkkN5ksjxzDjJZOlRVzBNYb45ZY/DJxulpuo9z9CJhyXGxpt3WDRzBN0R6M4BJIIXpNPh9H77uDB57bOpqExm+Nscoh0Wg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=kFJfbRzr; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4112wc09022667; Thu, 1 Feb 2024 03:36:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=hDXm8bbfVsYkdRMP++yi7/3ByrToweDaaBP8GUMHS3k=; b=kF JfbRzr01oH+ZjmJLWhvMGJV5pXCXkipsCpme+rgALTu5UGrrZoPmqzQzNiurOCH6 b/OBAefJvi7M2DloXxZOXJGpQ93iXz9GeS6FqHCoPb4iuorEgu2x7kyVBMe+FbO4 /dtC+FBDVrwiXwqMtAExsLHBk2CmrSxoHiMY2kj7rQO83N97eXhwNZltOnEgvgAL SjJr2lfLnwJ/pXkH902mG4ENs36DyIc2dnYMFYh96D/hlsTuamXlp5aldaXuUtnB aS9U+lhmKA0slFmQohjqsOI9S+Y0vsX340lHb3uM7z4l/Z/iPGZi/mPRy6PNLYV+ mdFSFpoWXIwArA5Ng3hQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vyx6drmw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Feb 2024 03:36:39 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4113aclN030218 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Feb 2024 03:36:38 GMT Received: from [10.253.15.67] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 31 Jan 2024 19:36:34 -0800 Message-ID: Date: Thu, 1 Feb 2024 11:36:18 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] scsi: ufs: core: Remove the ufshcd_release in ufshcd_err_handling_prepare To: Bart Van Assche , SEO HOYOUNG , , , , , , , , , , , , , , , References: <20240122083324.11797-1-hy50.seo@samsung.com> <0ae6c12e-3b55-4d90-b042-e8c2b3a2c4a7@acm.org> Content-Language: en-US From: Can Guo In-Reply-To: <0ae6c12e-3b55-4d90-b042-e8c2b3a2c4a7@acm.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: awebamET4vpZBG3GKjS_OsFbmEaHInGD X-Proofpoint-GUID: awebamET4vpZBG3GKjS_OsFbmEaHInGD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-31_10,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 mlxscore=0 malwarescore=0 adultscore=0 clxscore=1011 lowpriorityscore=0 suspectscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2402010027 On 2/1/2024 1:44 AM, Bart Van Assche wrote: > On 1/22/24 00:33, SEO HOYOUNG wrote: >> This is because ufshcd_errhandling_prepare() and >> ufshcd_err_handling_unprepare() repeatedly release calls. > > It would have been much more clear if it would have been mentioned that > ufshcd_err_handling_prepare() should call ufshcd_hold() once and > also that ufshcd_err_handling_unprepare() should call ufshcd_release() > once. > > Additionally, a Fixes: tag is missing. Is this patch perhaps a fix for > commit > c72e79c0ad2b ("scsi: ufs: Recover HBA runtime PM error in error handler")? > Can Guo, since you wrote that patch, can you please take a look at this > patch? > >> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c >> index 7c59d7a02243..423e83074a20 100644 >> --- a/drivers/ufs/core/ufshcd.c >> +++ b/drivers/ufs/core/ufshcd.c >> @@ -6351,7 +6351,6 @@ static void ufshcd_err_handling_prepare(struct >> ufs_hba *hba) >>           ufshcd_hold(hba); >>           if (!ufshcd_is_clkgating_allowed(hba)) >>               ufshcd_setup_clocks(hba, true); >> -        ufshcd_release(hba); When we are here, it means runtime resume has failed. When I wrote the code (in older kernel), ufshcd_runtime_resume(), if fails, bails without calling ufshcd_release(), eventually ufshcd_err_handling_unprepare() would call ufshcd_release() to balance. But now, I see that if __ufshcd_wl_resume() fails, ufshcd_release() is called anyways, so ufshcd_release() is not required here. Hence, Reviewed-by: Can Guo >>           pm_op = hba->is_sys_suspended ? UFS_SYSTEM_PM : UFS_RUNTIME_PM; >>           ufshcd_vops_resume(hba, pm_op); >>       } else { > > Reviewed-by: Bart Van Assche