Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1830270rdb; Wed, 31 Jan 2024 10:15:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoPBq/cWMcFAW0dStKz2qZlmttTNb3N0i9wPa8FfwyOX+wKiWrPa1CTPo6oZKcofkwJMMv X-Received: by 2002:a9d:7694:0:b0:6dd:e95f:c6f5 with SMTP id j20-20020a9d7694000000b006dde95fc6f5mr2167680otl.37.1706724926186; Wed, 31 Jan 2024 10:15:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706724926; cv=pass; d=google.com; s=arc-20160816; b=jF2ArQz2X8L3IZQEjZYGjmhkpc/IDMRg/SmwRYByHvH8P3ajCxyPgOOTOLT+Lq/9jX WCz7GoD1qdvGYe+RmJpOFY3evvlj0WizUa6IMdZCNcwhsCN18CQMcs3jgqol9aiVkuTx +eADLOFCenKXjwNp3ltWdQ6MhqBAOnU9iOaYb9YzWJocFZrsozdb/9lQ2di06wFUXtY/ g9B9XVxDZeyFA/YV3F4dYX7/J/OId0mnMyK4xIQ1tRzxE9+dkxgAcx9VH79kcG7uq+mm uq4A/Rpw3cjj48ABV7qQxaaCW9HLpTL8FaOvhU33LtcXUBLxdsoAZ2jRr/k095n/cnOq X7Qg== 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:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=j0biSaZpPh88aXQJnfLxYrKqT7EKvScD1Wm7p/pQaoI=; fh=yM89GNtLp+6xKB1iKx4LdagK0ODKPmBKBJI+z84bALI=; b=EJ6fWe6uvAJvP8NoRdbWCEE8qGDeEj+QVvHcwFQ96AaAag780TsA4AZiuEtqxm8csB McUXjy7aINO38pdytOv35SVxE+SHA12xh4Ev9iJn+4zXJC1cVxbdgtL11uGd8a5rSBzV YdDXV6rQg4PjEWR2zySZaG3KYkRKYHoKvlxcVITGVHLZK3Oda05xPCzVlJMEBvszPXpT og//3wFJZdk41tLdn1CvRilTUBEHET8SP32QPm6xVZD1uU3j7VkJ4yOyxjsN+328DFFI QiGY/S8H0hCb6xY1wXojpvcnUf6GHnZUrwdbGYb71YRW0zGyTOnoh9C3bAX4Col4NNeH SPOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-46926-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org X-Forwarded-Encrypted: i=1; AJvYcCVFha9G2JhmIoFwu6l4RY3++m28bBWzPJljLtYtntDC80hLEyygS7E0eJixiex0eWftjK6IZnmv6H/rGidr4sLVJuBXUpoIE1ZBGL2D6A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bv10-20020a632e0a000000b005cdf48b01f4si8095021pgb.717.2024.01.31.10.15.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 10:15:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46926-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-46926-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46926-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org 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 54D75B28540 for ; Wed, 31 Jan 2024 17:45:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A4BE12F5A2; Wed, 31 Jan 2024 17:44:49 +0000 (UTC) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29FF712C54E; Wed, 31 Jan 2024 17:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706723088; cv=none; b=HIenoc/JWBpyqqtHs7bsatfxlMoWH8l2aIyTkKE1Pe/xcMAAc2kTwl7Rod3e/9OKKoZA+nwT4Tu/Q7aZ5tUUDrkGPuzB+euWgUdmDThmEQM0tGOasXs33O9gDujffOFPRa1guvSH04JB2UXYtGzsS2mUardG8zc/Ja4cQwdqjjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706723088; c=relaxed/simple; bh=lYoivAyk+e6CW1VcYsTxunEDWl28AOdTjol2cOLh4cw=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=IsJ/l64Y+MwLPlcJC2JiuGts/igjnNnWPQxT+J0AYxF0MGOPZOchrGDz75xqX4F6C2uI3cgdAfEqdnu7ARcYH0JZMYTdbMHa8EeDofDWgb+DfmKF4Uib8uT8O3K6i29mmDl/VujdsXLPbVotM78yrvaGerELNbBs0d3UWjDVAvU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d8a66a2976so116695ad.2; Wed, 31 Jan 2024 09:44:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706723086; x=1707327886; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j0biSaZpPh88aXQJnfLxYrKqT7EKvScD1Wm7p/pQaoI=; b=uG5/VBjmhOYb4BwT7EQ+wyAOyolETD0lnaPgjOO8h1MYaUJcPpSuMsi7AnRQYixwxd 1e4bffSahyGDDW4XNtopJaNiq1YGzIJ21VlLDlYrUPIuukVk9uIYHqPyjeT0z+107B34 QgnRfbCzncMtF66xURErR0+0lW1n27pdp8aFneluClDxrklG+OTNQbuQpF4p2Ik/UfMt OsnL6xhN81gf+WR0D6EKHY7JYbFLMpGJt7igSy7TqSaquw5CYFJaYScgA+8grgrwHhce PMXRQndtRC+TAC7GR9hq6Gy2C/giiVfsZAZobH+MCmc187bEvBy8j5nGgPBa4VSraPlT G1ag== X-Gm-Message-State: AOJu0YxqC1aN/r+9u5aS82jUlY5V2SrLoyaIZuBLZiZAooD9WPRWwCua mN2JtvnXogSX+tn0TluoP3WYr76fFsnnuOZlA8mhfzyVi8sbSt4Z X-Received: by 2002:a17:90a:fd95:b0:295:b4af:6600 with SMTP id cx21-20020a17090afd9500b00295b4af6600mr2498850pjb.7.1706723086230; Wed, 31 Jan 2024 09:44:46 -0800 (PST) Received: from ?IPV6:2620:0:1000:8411:1d95:ca94:1cbe:1409? ([2620:0:1000:8411:1d95:ca94:1cbe:1409]) by smtp.gmail.com with ESMTPSA id iq24-20020a17090afb5800b002906e09e1d1sm1787750pjb.18.2024.01.31.09.44.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Jan 2024 09:44:45 -0800 (PST) Message-ID: <0ae6c12e-3b55-4d90-b042-e8c2b3a2c4a7@acm.org> Date: Wed, 31 Jan 2024 09:44:43 -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 Content-Language: en-US To: SEO HOYOUNG , 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, kwangwon.min@samsung.com, kwmad.kim@samsung.com, sh425.lee@samsung.com, sc.suh@samsung.com, quic_nguyenb@quicinc.com, cpgs@samsung.com, grant.jung@samsung.com, junwoo80.lee@samsung.com, Can Guo References: <20240122083324.11797-1-hy50.seo@samsung.com> From: Bart Van Assche In-Reply-To: <20240122083324.11797-1-hy50.seo@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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); > pm_op = hba->is_sys_suspended ? UFS_SYSTEM_PM : UFS_RUNTIME_PM; > ufshcd_vops_resume(hba, pm_op); > } else { Reviewed-by: Bart Van Assche