From patchwork Wed Jul 27 07:04:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 594024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03A9EC04A68 for ; Wed, 27 Jul 2022 07:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbiG0HER (ORCPT ); Wed, 27 Jul 2022 03:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiG0HEP (ORCPT ); Wed, 27 Jul 2022 03:04:15 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E8631D0EA for ; Wed, 27 Jul 2022 00:04:14 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20220727070412epoutp02b9152dbb62b9f418f6411e17d2064793~FnbgoC8nf2318523185epoutp02z for ; Wed, 27 Jul 2022 07:04:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20220727070412epoutp02b9152dbb62b9f418f6411e17d2064793~FnbgoC8nf2318523185epoutp02z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658905452; bh=LXR6+O3eDWHctBCVff2wddft4H7hjY69vVRu/Mki4Uk=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=QYkW1oEC1f49N7wxkZz+zBS5+Mz2yeg6VKgswL8Ja2kaGeaFn1/zPEbtryg2Gmi44 /qHvhsGIFrZiFIi+2MlvZmoA1sq1IgTLtuzb99uDPyTdBFt6OUNc+sP2YoSwphMzGT i/Xfm13WV6g3nf+FDjA7nNNS2CktWq0/EdT0uORo= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220727070411epcas2p2bf17ee8cd775ee25c08011dd302627c6~FnbgLo7RU0217702177epcas2p2J; Wed, 27 Jul 2022 07:04:11 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.68]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4Lt4Wt6znRz4x9Q1; Wed, 27 Jul 2022 07:04:10 +0000 (GMT) X-AuditID: b6c32a45-471ff700000025c2-c9-62e0e36a7e60 Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id ED.0B.09666.A63E0E26; Wed, 27 Jul 2022 16:04:10 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v4 1/7] scsi: ufs: wb: Move ufshcd_is_wb_allowed() to callee Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> Date: Wed, 27 Jul 2022 16:04:10 +0900 X-CMS-MailID: 20220727070410epcms2p5206785e4d960b32dcbb6729710dab535 X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPJsWRmVeSWpSXmKPExsWy7bCmuW7W4wdJBh+eWVicfLKGzeLBvG1s Fi9/XmWzOPiwk8Vi2oefzBYvD2laLLqxjcni8q45bBbd13ewWSw//o/Jgcvj8hVvj8V7XjJ5 TFh0gNHj+/oONo+PT2+xePRtWcXo8XmTnEf7gW6mAI6obJuM1MSU1CKF1Lzk/JTMvHRbJe/g eOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoBOVFMoSc0qBQgGJxcVK+nY2RfmlJakKGfnF JbZKqQUpOQXmBXrFibnFpXnpenmpJVaGBgZGpkCFCdkZ/9+9YS5o56k4+nIdawNjI1cXIyeH hICJxNp1O5m7GLk4hAR2MEq0X5vB3sXIwcErICjxd4cwSI2wgI/EoUWb2UFsIQEliXNrZjGC lAgLGEjc6jUHCbMJ6En8XDKDDWSMiMBZZomFD6cwQcznlZjR/pQFwpaW2L58KyOIzSngJ/Fq yl5GiLiGxI9lvcwQtqjEzdVv2WHs98fmQ9WISLTeOwtVIyjx4OduqLikxKFDX9lA7pEQyJfY cCAQIlwj8Xb5AagSfYlrHRvBTuAV8JU4fPEnG4jNIqAqcW/2K6gaF4nN61rAbGYBeYntb+cw g4xkFtCUWL9LH2K6ssSRWywwTzVs/M2OzmYW4JPoOPwXLr5j3hMmiFY1iUVNRhBhGYmvh+ez T2BUmoUI5VlI1s5CWLuAkXkVo1hqQXFuemqxUYEhPGKT83M3MYJTqpbrDsbJbz/oHWJk4mA8 xCjBwawkwpsQfT9JiDclsbIqtSg/vqg0J7X4EKMp0MMTmaVEk/OBST2vJN7QxNLAxMzM0NzI 1MBcSZzXK2VDopBAemJJanZqakFqEUwfEwenVAOTEu+Sre+sPI+fv5xv67U5zsp1hWdm6YHp 7zQj1R4s6WJyLv4pf6FysZP1Z7uaFbz5lQwlsUuyE/qN/iUETJ8o/aNB0TJU0PWcPkfuQTFh V0bm9LSJ8h1X922I/PdPQPZVQqV5w3GbO0FzuhrXyG7X/Hbm0anZmbOz16y9wHs6NuWsXCrb 6+kz9324fCSwZP6GBTHMlamZ72cHTF17L+5OWZuojKxZ8o2VHfHZcesslUJfhc9Yquz4b2q1 0Q7DXytDlxf0zeQRXRMfMKHbOs9p8qJZu/z2P26Z1P3Ma2vIE1Z/lyjfjtA3fe9s17Cwl/ua nNkcFMY+mTU5fq53zJfoObHVW1u+x7TvdV31o0CJpTgj0VCLuag4EQDEvCr+MgQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d References: <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The condition test is performed for each function calling __ufshcd_wb_toggle(). By modifying the position, it removes the code redundancy and prevents the test from being missing in the caller function. Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi Reviewed-by: Bean Huo --- drivers/ufs/core/ufshcd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 8f11f118c30e..a3bdf9986511 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5722,6 +5722,9 @@ static int __ufshcd_wb_toggle(struct ufs_hba *hba, bool set, enum flag_idn idn) enum query_opcode opcode = set ? UPIU_QUERY_OPCODE_SET_FLAG : UPIU_QUERY_OPCODE_CLEAR_FLAG; + if (!ufshcd_is_wb_allowed(hba)) + return -EPERM; + index = ufshcd_wb_get_query_index(hba); return ufshcd_query_flag_retry(hba, opcode, idn, index, NULL); } @@ -5730,9 +5733,6 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable) { int ret; - if (!ufshcd_is_wb_allowed(hba)) - return 0; - if (!(enable ^ hba->dev_info.wb_enabled)) return 0; @@ -5769,8 +5769,7 @@ static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable) { int ret; - if (!ufshcd_is_wb_allowed(hba) || - hba->dev_info.wb_buf_flush_enabled == enable) + if (hba->dev_info.wb_buf_flush_enabled == enable) return; ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_BUFF_FLUSH_EN); From patchwork Wed Jul 27 07:05:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 594316 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62B93C04A68 for ; Wed, 27 Jul 2022 07:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbiG0HF2 (ORCPT ); Wed, 27 Jul 2022 03:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbiG0HF1 (ORCPT ); Wed, 27 Jul 2022 03:05:27 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CF8DEF9 for ; Wed, 27 Jul 2022 00:05:25 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20220727070523epoutp0231e2a114dcc54cba7457954fe3db0c7e~FncjQ6JQM2448024480epoutp02l for ; Wed, 27 Jul 2022 07:05:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20220727070523epoutp0231e2a114dcc54cba7457954fe3db0c7e~FncjQ6JQM2448024480epoutp02l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658905523; bh=R6OHZS8L6v6uGk9MS1iioqNTlA6txP76blUF08vlRRs=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=kU92BbhfG+juNXHex4nfROQrZXD7uA7jcrBitotCEOffGEWbur+vAEHKBXr09oJoM 05vLvufMD+A+J6wNH6rkNy4e70qDnwisPr+ohaqH1gYFMd8S0a7v8hTIHT93GXJpV0 4WmqRnver02ot76TuvpQ0/7vczSQQFFnfX3eDvv0= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20220727070523epcas2p167dff79a64fd544b7fa80694b4c297cb~Fnci3g7m41693016930epcas2p1n; Wed, 27 Jul 2022 07:05:23 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.90]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4Lt4YG5VCdz4x9QL; Wed, 27 Jul 2022 07:05:22 +0000 (GMT) X-AuditID: b6c32a45-45bff700000025c2-3f-62e0e3b2b448 Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 03.9B.09666.2B3E0E26; Wed, 27 Jul 2022 16:05:22 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v4 2/7] scsi: ufs: wb: Change wb_enabled condition test Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220727070522epcms2p5ad2dd21b471acee963dd58b37d35e11f@epcms2p5> Date: Wed, 27 Jul 2022 16:05:22 +0900 X-CMS-MailID: 20220727070522epcms2p5ad2dd21b471acee963dd58b37d35e11f X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPJsWRmVeSWpSXmKPExsWy7bCmme6mxw+SDPas1bY4+WQNm8WDedvY LF7+vMpmcfBhJ4vFtA8/mS1eHtK0WHRjG5PF5V1z2Cy6r+9gs1h+/B+TA5fH5SveHov3vGTy mLDoAKPH9/UdbB4fn95i8ejbsorR4/MmOY/2A91MARxR2TYZqYkpqUUKqXnJ+SmZeem2St7B 8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5QCcqKZQl5pQChQISi4uV9O1sivJLS1IVMvKL S2yVUgtScgrMC/SKE3OLS/PS9fJSS6wMDQyMTIEKE7Iz7jdtYS3oZqtoPnCcuYFxImsXIyeH hICJxKJVBxm7GLk4hAR2MErsejoPKMHBwSsgKPF3hzBIjbCAu8T0v3+ZQGwhASWJc2tmMYKU CAsYSNzqNQcJswnoSfxcMoMNZIyIwFlmiYUPpzBBzOeVmNH+lAXClpbYvnwrI4jNKeAn0fPi BNQNGhI/lvUyQ9iiEjdXv2WHsd8fm88IYYtItN47C1UjKPHg526ouKTEoUNf2UDukRDIl9hw IBAiXCPxdvkBqBJ9iWsdG8FO4BXwlWi4NgPsNBYBVYnZz/uhTnCRmPd2KVgNs4C8xPa3c5hB RjILaEqs36UPMV1Z4sgtFpinGjb+ZkdnMwvwSXQc/gsX3zHvCRNEq5rEoiYjiLCMxNfD89kn MCrNQoTyLCRrZyGsXcDIvIpRLLWgODc9tdiowBAescn5uZsYwSlVy3UH4+S3H/QOMTJxMB5i lOBgVhLhTYi+nyTEm5JYWZValB9fVJqTWnyI0RTo4YnMUqLJ+cCknlcSb2hiaWBiZmZobmRq YK4kzuuVsiFRSCA9sSQ1OzW1ILUIpo+Jg1OqgWnjOzmFxacXTFn2/UHb3/J2naAC3ZuaVprH HikpTDq4WpjPtzX3oVnt7/CgKb88j29+13Nk6dmwgP9h/iL8x5dXKrFz55/0fzEzf+21OoZr D2V0FA3/iYWu4356WJe564D/fD9JJYn724Jf/suvSTrWWLFvYbXF9eps06JJ+9Y55LGk3f9m 4BoyRURsI+f2rlki9U9OsWRruzxWWDL5Z5v7vMVH/8xWY7zkZHlbk4OlZMbbo6pHrhws2GB9 +65/caDhz5PtrbfjQ/8uvBvluFdAMjzms6fd8Y2nsrYfYtHKa98RuSDKXKHefqfL5KpTx3cc 39SzrlN1dgSXS3Nvx5eq6i1qfsGmJ1zyJfvipiuxFGckGmoxFxUnAgBGWGPvMgQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d References: <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Changed to improve readability. As implemented in ufshcd_wb_togle_flush(), the conditional test is modified in the same way. Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi --- drivers/ufs/core/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index a3bdf9986511..48ba109e29f7 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5733,7 +5733,7 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable) { int ret; - if (!(enable ^ hba->dev_info.wb_enabled)) + if (hba->dev_info.wb_enabled == enable) return 0; ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_EN); From patchwork Wed Jul 27 07:07:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 594023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E2CEC04A68 for ; Wed, 27 Jul 2022 07:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229698AbiG0HH3 (ORCPT ); Wed, 27 Jul 2022 03:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbiG0HH2 (ORCPT ); Wed, 27 Jul 2022 03:07:28 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71D143135D for ; Wed, 27 Jul 2022 00:07:27 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220727070725epoutp04eb8787005d6569669d649a4bb89c9c83~FneVFVUu92253622536epoutp04K for ; Wed, 27 Jul 2022 07:07:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220727070725epoutp04eb8787005d6569669d649a4bb89c9c83~FneVFVUu92253622536epoutp04K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658905645; bh=pFDs8N3oHmGo6gWocH4YoHqcmEMLBNY95qrWeadYc8Y=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=ZyTQBB9U5MEBQhEGS7DQV9HXcLG3iedHG/XA6NYDOTcqGD4URB/Q1cDOm44BLVjjK BHWngYbkP7HZGatsm2yDt+4jx64IjvvX/m7QW7Iv+B5ZJmlPz8dYaFeg8Rv0CVKXm/ gc8NipvcyATpUQwsAbGGp/nPU1vhu8Ygx9RBeymY= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220727070725epcas2p235d37d9273cd19d4be71c22a8f93643a~FneUgxaxw1101911019epcas2p2j; Wed, 27 Jul 2022 07:07:25 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.100]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Lt4bc4160z4x9Pv; Wed, 27 Jul 2022 07:07:24 +0000 (GMT) X-AuditID: b6c32a48-9f7ff700000025be-9e-62e0e42c7677 Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id CE.65.09662.C24E0E26; Wed, 27 Jul 2022 16:07:24 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v4 3/7] scsi: ufs: wb: Change functions name and modify Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220727070724epcms2p8e449d0c89b52f03a9d3dc254df0ec547@epcms2p8> Date: Wed, 27 Jul 2022 16:07:24 +0900 X-CMS-MailID: 20220727070724epcms2p8e449d0c89b52f03a9d3dc254df0ec547 X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHJsWRmVeSWpSXmKPExsWy7bCmha7OkwdJBqemyVucfLKGzeLBvG1s Fi9/XmWzOPiwk8Vi2oefzBYvD2laLLqxjcni8q45bBbd13ewWSw//o/Jgcvj8hVvj8V7XjJ5 TFh0gNHj+/oONo+PT2+xePRtWcXo8XmTnEf7gW6mAI6obJuM1MSU1CKF1Lzk/JTMvHRbJe/g eOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoBOVFMoSc0qBQgGJxcVK+nY2RfmlJakKGfnF JbZKqQUpOQXmBXrFibnFpXnpenmpJVaGBgZGpkCFCdkZa/c8Yyv4JVNx6nppA+N6iS5GTg4J AROJOZ0tjF2MXBxCAjsYJW6sfgHkcHDwCghK/N0hDFIjLOAu8avpMROILSSgJHFuzSywEmEB A4lbveYgYTYBPYmfS2awgYwRETjLLLHw4RQmiPm8EjPan7JA2NIS25dvZQSxOQX8JHpenGCF iGtI/FjWywxhi0rcXP2WHcZ+f2w+I4QtItF67yxUjaDEg5+7oeKSEocOfWUDuUdCIF9iw4FA iHCNxNvlB6BK9CWudWwEO4FXwFdiy8zFbCA2i4CqxNWNd9kgalwkJt49BlbPLCAvsf3tHGaQ kcwCmhLrd+lDTFeWOHKLBeapho2/2dHZzAJ8Eh2H/8LFd8x7wgTRqiaxqMkIIiwj8fXwfPYJ jEqzEKE8C8naWQhrFzAyr2IUSy0ozk1PLTYqMIHHa3J+7iZGcELV8tjBOPvtB71DjEwcjIcY JTiYlUR4E6LvJwnxpiRWVqUW5ccXleakFh9iNAV6eCKzlGhyPjCl55XEG5pYGpiYmRmaG5ka mCuJ83qlbEgUEkhPLEnNTk0tSC2C6WPi4JRqYNqxpOHqcsZf5wPrTVfkPtafkJ30e+rvB5zc 0l626TWlAcJSXX6aOvJTpayKlytvVSxd8U5lkxm39pv3Lh8Xxv1lCeSSXqGu/+TPs61Kzxtm rH693o9X74WmjkuZvrRg+MUpP1ZO26AZaa59ot62y/vT7Cud3mIHIkRns0i8UxXRciw25/vu msIdO0XUuvjlgUqN08VTvb4btko56bYstfplEbiZ8fzOJOlpK+4qrvAK/vQs7iJ/WIr9fsVt Kw9PLusRefMydnZ/eTsLm8/8K/NOHEj81fM5NyV7lV+e27qVtQHzuSzevuQpKwvdaHf7kZ1e 5IwTb/LOOrU5N/fzhm1X1/KMlN/HxlRnojVXiaU4I9FQi7moOBEAjbzAJjEEAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d References: <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The parameter name of ufshcd_wb_toggle_flush_during_h8() has been changed in the same as other toggle functions. Function names were ambiguous. So changed to suit the meaning. Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi --- drivers/ufs/core/ufshcd.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 48ba109e29f7..52377fedae49 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -265,8 +265,9 @@ static int ufshcd_setup_vreg(struct ufs_hba *hba, bool on); static inline int ufshcd_config_vreg_hpm(struct ufs_hba *hba, struct ufs_vreg *vreg); static int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag); -static void ufshcd_wb_toggle_flush_during_h8(struct ufs_hba *hba, bool set); -static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable); +static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba, + bool enable); +static void ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable); static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba); static void ufshcd_hba_vreg_set_hpm(struct ufs_hba *hba); @@ -286,16 +287,16 @@ static inline void ufshcd_disable_irq(struct ufs_hba *hba) } } -static inline void ufshcd_wb_config(struct ufs_hba *hba) +static void ufshcd_wb_set_default_flags(struct ufs_hba *hba) { if (!ufshcd_is_wb_allowed(hba)) return; ufshcd_wb_toggle(hba, true); - ufshcd_wb_toggle_flush_during_h8(hba, true); + ufshcd_wb_toggle_buf_flush_during_h8(hba, true); if (!(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)) - ufshcd_wb_toggle_flush(hba, true); + ufshcd_wb_toggle_buf_flush(hba, true); } static void ufshcd_scsi_unblock_requests(struct ufs_hba *hba) @@ -5750,22 +5751,23 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable) return ret; } -static void ufshcd_wb_toggle_flush_during_h8(struct ufs_hba *hba, bool set) +static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba, + bool enable) { int ret; - ret = __ufshcd_wb_toggle(hba, set, + ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_BUFF_FLUSH_DURING_HIBERN8); if (ret) { dev_err(hba->dev, "%s: WB-Buf Flush during H8 %s failed: %d\n", - __func__, set ? "enable" : "disable", ret); + __func__, enable ? "enable" : "disable", ret); return; } dev_dbg(hba->dev, "%s WB-Buf Flush during H8 %s\n", - __func__, set ? "enabled" : "disabled"); + __func__, enable ? "enabled" : "disabled"); } -static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable) +static void ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable) { int ret; @@ -5814,9 +5816,9 @@ static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba, static void ufshcd_wb_force_disable(struct ufs_hba *hba) { if (!(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)) - ufshcd_wb_toggle_flush(hba, false); + ufshcd_wb_toggle_buf_flush(hba, false); - ufshcd_wb_toggle_flush_during_h8(hba, false); + ufshcd_wb_toggle_buf_flush_during_h8(hba, false); ufshcd_wb_toggle(hba, false); hba->caps &= ~UFSHCD_CAP_WB_EN; @@ -8213,7 +8215,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params) */ ufshcd_set_active_icc_lvl(hba); - ufshcd_wb_config(hba); + /* Enable UFS Write Booster if supported */ + ufshcd_wb_set_default_flags(hba); + if (hba->ee_usr_mask) ufshcd_write_ee_control(hba); /* Enable Auto-Hibernate if configured */ From patchwork Wed Jul 27 07:08:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 594315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B8A6C04A68 for ; Wed, 27 Jul 2022 07:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbiG0HIq (ORCPT ); Wed, 27 Jul 2022 03:08:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbiG0HIp (ORCPT ); Wed, 27 Jul 2022 03:08:45 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CCAB31DD8 for ; Wed, 27 Jul 2022 00:08:44 -0700 (PDT) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20220727070842epoutp038fe16b15fc0fd7c5c2730334d4a8a0a6~FnfciWLk02506225062epoutp03K for ; Wed, 27 Jul 2022 07:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20220727070842epoutp038fe16b15fc0fd7c5c2730334d4a8a0a6~FnfciWLk02506225062epoutp03K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658905722; bh=kE5ExXSvw6fqt9zPwb7EORYse8FtwZoVjEh3xB9n0C0=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=YEIc68ecIl0VBnlF09hJ/xYhEzUQIU7tI29juoXyIzKnN9HiFsUDfgS74DctQ76Yc RAp4rsMQKrzTttsh0IClYy4Nna89DZ/3VOvuvMVgOBLrLwmAYjdUzzKLl9YygucTXQ ZqSTr5B6xBIA7zFXU7t3pyKtoY+M7/uGSrq0feTA= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20220727070842epcas2p11f795dedb46f6256ec7e3053fa07bf98~FnfcGHI4m2410824108epcas2p1n; Wed, 27 Jul 2022 07:08:42 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.68]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Lt4d552GFz4x9QB; Wed, 27 Jul 2022 07:08:41 +0000 (GMT) X-AuditID: b6c32a47-5f7ff700000025aa-3f-62e0e479e8f9 Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id EF.45.09642.974E0E26; Wed, 27 Jul 2022 16:08:41 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v4 4/7] scsi: ufs: wb: Add explicit flush sysfs attribute Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220727070724epcms2p8e449d0c89b52f03a9d3dc254df0ec547@epcms2p8> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220727070841epcms2p5e212d617dd0f985555fa052f099013f0@epcms2p5> Date: Wed, 27 Jul 2022 16:08:41 +0900 X-CMS-MailID: 20220727070841epcms2p5e212d617dd0f985555fa052f099013f0 X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLJsWRmVeSWpSXmKPExsWy7bCmuW7lkwdJBvd2KlucfLKGzeLBvG1s Fi9/XmWzOPiwk8Vi2oefzBYvD2laLLqxjcni8q45bBbd13ewWSw//o/Jgcvj8hVvj8V7XjJ5 TFh0gNHj+/oONo+PT2+xePRtWcXo8XmTnEf7gW6mAI6obJuM1MSU1CKF1Lzk/JTMvHRbJe/g eOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoBOVFMoSc0qBQgGJxcVK+nY2RfmlJakKGfnF JbZKqQUpOQXmBXrFibnFpXnpenmpJVaGBgZGpkCFCdkZT9s7mArOalTMW2TVwPhAsYuRk0NC wETi+vw1bF2MXBxCAjsYJTpONDF1MXJw8AoISvzdIQxSIyzgKTG78zUbiC0koCRxbs0sRpAS YQEDiVu95iBhNgE9iZ9LZoCNERE4yyyx8OEUJoj5vBIz2p+yQNjSEtuXb2UEsTkF/CRa575k hYhrSPxY1ssMYYtK3Fz9lh3Gfn9sPiOELSLReu8sVI2gxIOfu6HikhKHDn1lA7lHQiBfYsOB QIhwjcTb5QegSvQlrnVsBDuBV8BXYuvsV2AfsgioSvRfs4IocZG49+8w2HRmAXmJ7W/nMIOU MAtoSqzfpQ8xXFniyC0WmJ8aNv5mR2czC/BJdBz+CxffMe8JE0SrmsSiJiOIsIzE18Pz2Scw Ks1CBPIsJGtnIaxdwMi8ilEstaA4Nz212KjAGB6tyfm5mxjB6VTLfQfjjLcf9A4xMnEwHmKU 4GBWEuFNiL6fJMSbklhZlVqUH19UmpNafIjRFOjficxSosn5wISeVxJvaGJpYGJmZmhuZGpg riTO65WyIVFIID2xJDU7NbUgtQimj4mDU6qBye8+Q3Dxk+iDjCwvAnkOBWxa7VHkku+yKGfL k2zrieWOhmyrWRb8fP58H4NvY5PsnVeW9ts3Lag087L5+oHNe2ZicHX1HcHpGlwTnzvmLYxU vvp36pdW3rQ1jAev5RYltbf8nKFbvWBLUFyxhaG4zp/r22cYuXZ0/l+g4eV+bInH5EKWvOzo 3Xl+GpI9HE0i+9ateHV1i8PysEsi9W4ZClIFeT0qK7SF+PYsedcTqfEx/NTZtEtrc3T4lPbL JjxLT9pZE2tyanP1k1mqqnd6Ledu+ngvy+ofq6PltNu21+LKN9caJemw8NZt+TpD5LDC46M/ GJ8uKdR1kd3NcW6K/vb3VwVX85255DTFwTxFiaU4I9FQi7moOBEAxc1ldzAEAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d References: <20220727070724epcms2p8e449d0c89b52f03a9d3dc254df0ec547@epcms2p8> <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org There is the following quirk to bypass "WB Flush" in Write Booster. - UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL If this quirk is not set, there is no knob that can control "WB Flush". There are three flags that control Write Booster Feature. 1. WB ON/OFF 2. WB Hibern Flush ON/OFF (implicitly) 3. WB Flush ON/OFF (explicit) The sysfs attribute that controls the WB was implemented. (1) In the case of "Hibern Flush", it is always good to turn on. Control may not be required. (2) Finally, "Flush" may be necessary because the Auto-Hibern8 is not supported in a specific environment. So the sysfs attribute that controls this is necessary. (3) Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi --- drivers/ufs/core/ufs-sysfs.c | 45 ++++++++++++++++++++++++++++++++++++ drivers/ufs/core/ufshcd.c | 9 ++++---- include/ufs/ufshcd.h | 1 + 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c index 0a088b47d557..e7800e49998a 100644 --- a/drivers/ufs/core/ufs-sysfs.c +++ b/drivers/ufs/core/ufs-sysfs.c @@ -254,6 +254,49 @@ static ssize_t wb_on_store(struct device *dev, struct device_attribute *attr, return res < 0 ? res : count; } +static ssize_t wb_buf_flush_en_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct ufs_hba *hba = dev_get_drvdata(dev); + + return sysfs_emit(buf, "%d\n", hba->dev_info.wb_buf_flush_enabled); +} + +static ssize_t wb_buf_flush_en_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct ufs_hba *hba = dev_get_drvdata(dev); + unsigned int wb_buf_flush_en; + ssize_t res; + + if (ufshcd_is_wb_allowed(hba) && + !(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)) { + dev_warn(dev, "It is not allowed to configure WB buf flush!\n"); + return -EOPNOTSUPP; + } + + if (kstrtouint(buf, 0, &wb_buf_flush_en)) + return -EINVAL; + + if (wb_buf_flush_en != 0 && wb_buf_flush_en != 1) + return -EINVAL; + + down(&hba->host_sem); + if (!ufshcd_is_user_access_allowed(hba)) { + res = -EBUSY; + goto out; + } + + ufshcd_rpm_get_sync(hba); + res = ufshcd_wb_toggle_buf_flush(hba, wb_buf_flush_en); + ufshcd_rpm_put_sync(hba); +out: + up(&hba->host_sem); + return res < 0 ? res : count; +} + static DEVICE_ATTR_RW(rpm_lvl); static DEVICE_ATTR_RO(rpm_target_dev_state); static DEVICE_ATTR_RO(rpm_target_link_state); @@ -262,6 +305,7 @@ static DEVICE_ATTR_RO(spm_target_dev_state); static DEVICE_ATTR_RO(spm_target_link_state); static DEVICE_ATTR_RW(auto_hibern8); static DEVICE_ATTR_RW(wb_on); +static DEVICE_ATTR_RW(wb_buf_flush_en); static struct attribute *ufs_sysfs_ufshcd_attrs[] = { &dev_attr_rpm_lvl.attr, @@ -272,6 +316,7 @@ static struct attribute *ufs_sysfs_ufshcd_attrs[] = { &dev_attr_spm_target_link_state.attr, &dev_attr_auto_hibern8.attr, &dev_attr_wb_on.attr, + &dev_attr_wb_buf_flush_en.attr, NULL }; diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 52377fedae49..a8a797e0033d 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -267,7 +267,6 @@ static inline int ufshcd_config_vreg_hpm(struct ufs_hba *hba, static int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag); static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba, bool enable); -static void ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable); static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba); static void ufshcd_hba_vreg_set_hpm(struct ufs_hba *hba); @@ -5767,24 +5766,26 @@ static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba, __func__, enable ? "enabled" : "disabled"); } -static void ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable) +int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable) { int ret; if (hba->dev_info.wb_buf_flush_enabled == enable) - return; + return 0; ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_BUFF_FLUSH_EN); if (ret) { dev_err(hba->dev, "%s WB-Buf Flush %s failed %d\n", __func__, enable ? "enable" : "disable", ret); - return; + return ret; } hba->dev_info.wb_buf_flush_enabled = enable; dev_dbg(hba->dev, "%s WB-Buf Flush %s\n", __func__, enable ? "enabled" : "disabled"); + + return ret; } static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba, diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 7fe1a926cd99..94bcfec98fb8 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1211,6 +1211,7 @@ int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba, enum query_opcode desc_op); int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable); +int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable); int ufshcd_suspend_prepare(struct device *dev); int __ufshcd_suspend_prepare(struct device *dev, bool rpm_ok_for_spm); void ufshcd_resume_complete(struct device *dev); From patchwork Wed Jul 27 07:10:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 594314 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7147C04A68 for ; Wed, 27 Jul 2022 07:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbiG0HKh (ORCPT ); Wed, 27 Jul 2022 03:10:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiG0HK3 (ORCPT ); Wed, 27 Jul 2022 03:10:29 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8346C380 for ; Wed, 27 Jul 2022 00:10:27 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220727071026epoutp01c03ba1c003902601572cb35d1462f16c~Fng88NaHC2179821798epoutp01w for ; Wed, 27 Jul 2022 07:10:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220727071026epoutp01c03ba1c003902601572cb35d1462f16c~Fng88NaHC2179821798epoutp01w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658905826; bh=yAjYthTYZ1VyQYto1gO6QWEcENXGTa9Eb2Hnw6HNmz0=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=IATVFzNG57C5SWtHwqD6uoLNgBrR6gOuHyT3y4UNJ+tn4bVknZC1KAFLpx3tNKZKI ebUNs+jmQYh+NSXRvL6yQN5BhZVz0rGozXV5fzFI5I3bLNeavLFmAwIoYXs+TdnPGJ u1YGWj9m6sfrjgTgVKzlFvIjK20IZ6sPAbsDr8NE= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220727071025epcas2p291524394ff894074012c809c4472ef65~Fng8ecihB1321913219epcas2p2R; Wed, 27 Jul 2022 07:10:25 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.102]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Lt4g51fryz4x9Pv; Wed, 27 Jul 2022 07:10:25 +0000 (GMT) X-AuditID: b6c32a48-9e1ff700000025be-ed-62e0e4e1d6e9 Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id E1.47.09662.1E4E0E26; Wed, 27 Jul 2022 16:10:25 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v4 5/7] scsi: ufs: wb: Add ufshcd_is_wb_buf_flush_allowed() Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220727070841epcms2p5e212d617dd0f985555fa052f099013f0@epcms2p5> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220727071024epcms2p70366b54ac8eca3758b7cf4336e0d457c@epcms2p7> Date: Wed, 27 Jul 2022 16:10:24 +0900 X-CMS-MailID: 20220727071024epcms2p70366b54ac8eca3758b7cf4336e0d457c X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDJsWRmVeSWpSXmKPExsWy7bCmme7DJw+SDD4fYbM4+WQNm8WDedvY LF7+vMpmcfBhJ4vFtA8/mS1eHtK0WHRjG5PF5V1z2Cy6r+9gs1h+/B+TA5fH5SveHov3vGTy mLDoAKPH9/UdbB4fn95i8ejbsorR4/MmOY/2A91MARxR2TYZqYkpqUUKqXnJ+SmZeem2St7B 8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5QCcqKZQl5pQChQISi4uV9O1sivJLS1IVMvKL S2yVUgtScgrMC/SKE3OLS/PS9fJSS6wMDQyMTIEKE7Izbt6+wl6wWrji5ffUBsbjAl2MnBwS AiYSs1s+MYPYQgI7GCVWfNXsYuTg4BUQlPi7QxgkLCzgLfHv2WUWiBIliXNrZjGClAgLGEjc 6jUHCbMJ6En8XDKDrYuRi0NE4CyzxMKHU5ggxvNKzGh/ygJhS0tsX76VEcTmFPCTeDJzPitE XEPix7JeZghbVOLm6rfsMPb7Y/MZIWwRidZ7Z6FqBCUe/NwNFZeUOHToKxvIPRIC+RIbDgRC hGsk3i4/AFWiL3GtYyMLxFe+EvcmxIOEWQRUJU6svwtV4iLxafk3MJtZQF5i+9s5zCDlzAKa Eut36UMMV5Y4cosF5qeGjb/Z0dnMAnwSHYf/wsV3zHvCBNGqJrGoyQgiLCPx9fB89gmMSrMQ gTwLydpZCGsXMDKvYhRLLSjOTU8tNiowgcdqcn7uJkZwMtXy2ME4++0HvUOMTByMhxglOJiV RHgTou8nCfGmJFZWpRblxxeV5qQWH2I0BXp4IrOUaHI+MJ3nlcQbmlgamJiZGZobmRqYK4nz eqVsSBQSSE8sSc1OTS1ILYLpY+LglGpgckxn+v89mn21VGdx2sFN/yZ9LQ44LvnuP1shT/8u oc7001JKwifP/Y8+Mvmr4+QlHv6fLoTbZDxrfqByX3LHmRXXpz/pMn812f/NkRdKr6cwitxX VkirvtUdHDvTNvDKj8zHEz6JzGH059p1btXV2erLdnuVsPZ07ouO/nJO2WatyVdOJ/aCzpyL 5RLLXJnd3Y7vXXiCKc6jUeF63GrbHYuNlJ5Y+V7YZpvKrnonLjFp/bSFFglybd9Un+iETI3p 87nwMMWu4q5hrMzx0ms8EbMdT5cVPl98PatdUye+u/jCv8jtT9qZZhXGqmvKn2XqrVfcG+zY fbjd+oNm8xvtdr7bf+aUNlXNn3zX/fp8JZbijERDLeai4kQATm7UfS8EAAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d References: <20220727070841epcms2p5e212d617dd0f985555fa052f099013f0@epcms2p5> <20220727070724epcms2p8e449d0c89b52f03a9d3dc254df0ec547@epcms2p8> <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The explicit flushing should check the following. - UFSHCD_CAP_WB_EN - UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Changed to improve readability. Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi --- drivers/ufs/core/ufs-sysfs.c | 3 +-- drivers/ufs/core/ufshcd.c | 5 +++-- include/ufs/ufshcd.h | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c index e7800e49998a..63b02b2541c8 100644 --- a/drivers/ufs/core/ufs-sysfs.c +++ b/drivers/ufs/core/ufs-sysfs.c @@ -271,8 +271,7 @@ static ssize_t wb_buf_flush_en_store(struct device *dev, unsigned int wb_buf_flush_en; ssize_t res; - if (ufshcd_is_wb_allowed(hba) && - !(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)) { + if (!ufshcd_is_wb_buf_flush_allowed(hba)) { dev_warn(dev, "It is not allowed to configure WB buf flush!\n"); return -EOPNOTSUPP; } diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index a8a797e0033d..17a14b046c44 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -294,7 +294,8 @@ static void ufshcd_wb_set_default_flags(struct ufs_hba *hba) ufshcd_wb_toggle(hba, true); ufshcd_wb_toggle_buf_flush_during_h8(hba, true); - if (!(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)) + + if (ufshcd_is_wb_buf_flush_allowed(hba)) ufshcd_wb_toggle_buf_flush(hba, true); } @@ -5816,7 +5817,7 @@ static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba, static void ufshcd_wb_force_disable(struct ufs_hba *hba) { - if (!(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL)) + if (ufshcd_is_wb_buf_flush_allowed(hba)) ufshcd_wb_toggle_buf_flush(hba, false); ufshcd_wb_toggle_buf_flush_during_h8(hba, false); diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 94bcfec98fb8..78adc556444a 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1017,6 +1017,12 @@ static inline bool ufshcd_is_wb_allowed(struct ufs_hba *hba) return hba->caps & UFSHCD_CAP_WB_EN; } +static inline bool ufshcd_is_wb_buf_flush_allowed(struct ufs_hba *hba) +{ + return ufshcd_is_wb_allowed(hba) && + !(hba->quirks & UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL); +} + #define ufshcd_writel(hba, val, reg) \ writel((val), (hba)->mmio_base + (reg)) #define ufshcd_readl(hba, reg) \ From patchwork Wed Jul 27 07:11:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 594021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 274FCC04A68 for ; Wed, 27 Jul 2022 07:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbiG0HMC (ORCPT ); Wed, 27 Jul 2022 03:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiG0HLs (ORCPT ); Wed, 27 Jul 2022 03:11:48 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E41D638C for ; Wed, 27 Jul 2022 00:11:46 -0700 (PDT) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20220727071145epoutp03e8842c7b5cedd555374f03c78ae52b01~FniG4Xabq2964829648epoutp03U for ; Wed, 27 Jul 2022 07:11:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20220727071145epoutp03e8842c7b5cedd555374f03c78ae52b01~FniG4Xabq2964829648epoutp03U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658905905; bh=aMAw6thkPoTeXrTfsk+Y/If2jxMbn2Y91W57A2JrNSA=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=mBsvF9IZartw/kNaSEDQeUs/SxAelbgybEgyvPI7Av+72Vr6R+eNTVEn1GZGRsoh1 osx0LOooDcQN24F6HFNWAq81zgMWzdtj7QfsVnTG2z78TErWcsCtT4RFa6bEDO2oVQ NWgJVMrh53RhXaw3CH6hIIevUrX2FV5U9urlvnUc= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20220727071144epcas2p49fd10d35bbea551895b4200f80ddb18e~FniGSi4fq1781017810epcas2p4H; Wed, 27 Jul 2022 07:11:44 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.88]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4Lt4hc2jfDz4x9Pw; Wed, 27 Jul 2022 07:11:44 +0000 (GMT) X-AuditID: b6c32a47-5f7ff700000025aa-7b-62e0e530b6dc Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id A3.07.09642.035E0E26; Wed, 27 Jul 2022 16:11:44 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v4 6/7] scsi: ufs: wb: Modify messages Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220727071024epcms2p70366b54ac8eca3758b7cf4336e0d457c@epcms2p7> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220727071143epcms2p4936513ee2d020b914db53f438445801a@epcms2p4> Date: Wed, 27 Jul 2022 16:11:43 +0900 X-CMS-MailID: 20220727071143epcms2p4936513ee2d020b914db53f438445801a X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPJsWRmVeSWpSXmKPExsWy7bCmma7B0wdJBptPCFmcfLKGzeLBvG1s Fi9/XmWzOPiwk8Vi2oefzBYvD2laLLqxjcni8q45bBbd13ewWSw//o/Jgcvj8hVvj8V7XjJ5 TFh0gNHj+/oONo+PT2+xePRtWcXo8XmTnEf7gW6mAI6obJuM1MSU1CKF1Lzk/JTMvHRbJe/g eOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoBOVFMoSc0qBQgGJxcVK+nY2RfmlJakKGfnF JbZKqQUpOQXmBXrFibnFpXnpenmpJVaGBgZGpkCFCdkZ37dsZS24L1mxcF8PewPjR5EuRk4O CQETiTm7TzN3MXJxCAnsYJS4M3UeexcjBwevgKDE3x3CIDXCAmYSW7u3MYLYQgJKEufWzGIE KREWMJC41WsOEmYT0JP4uWQGG8gYEYGzzBILH05hgpjPKzGj/SkLhC0tsX35VrA5nAJ+Er9+ dbFCxDUkfizrZYawRSVurn7LDmO/PzafEcIWkWi9dxaqRlDiwc/dUHFJiUOHvrKB3CMhkC+x 4UAgRLhG4u3yA1Al+hLXOjaCncAr4Cvx7uQ/sPEsAqoSqze1QJ3mInH7wn6wOLOAvMT2t3OY QUYyC2hKrN+lDzFdWeLILRaYpxo2/mZHZzML8El0HP4LF98x7wkTRKuaxKImI4iwjMTXw/PZ JzAqzUKE8iwka2chrF3AyLyKUSy1oDg3PbXYqMAYHrHJ+bmbGMEpVct9B+OMtx/0DjEycTAe YpTgYFYS4U2Ivp8kxJuSWFmVWpQfX1Sak1p8iNEU6OGJzFKiyfnApJ5XEm9oYmlgYmZmaG5k amCuJM7rlbIhUUggPbEkNTs1tSC1CKaPiYNTqoGJmzf4P/NMPw/Fto8bz30/cvzDNQub584W z4+yxb+fmv0tysxTaz3HL09FS+93n1fVfTB+WT3HuES885fN7+P9auvzPC9WBR9KMhT6s3H3 f7n/VUp7K/OYy94LCh3jXJB91UnphtlP14eW2/amzk7N+7WdrfTh9QM+Ft/8b+wW3mrvFnzz x+72I4FPT+XyZZZbz1hTxXV42uoErztypmqpk0MOc8XysN/w7tuixRr9kSP6yBIxF7PlVX9X qpXE1yzbxTf7X4doZPi2p/vnrLr2NNraWUN62sdQhZMqrOv+rXi0dO2jqDvGGrmm1y7GCqsl vrvaZLj7kqiys8mdbdELp65g+j2xcXPAac9/NwsfK7EUZyQaajEXFScCANa5WjwyBAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d References: <20220727071024epcms2p70366b54ac8eca3758b7cf4336e0d457c@epcms2p7> <20220727070841epcms2p5e212d617dd0f985555fa052f099013f0@epcms2p5> <20220727070724epcms2p8e449d0c89b52f03a9d3dc254df0ec547@epcms2p8> <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Messages are modified to fit the format of others. Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi --- drivers/ufs/core/ufs-sysfs.c | 2 +- drivers/ufs/core/ufshcd.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c index 63b02b2541c8..35e4f0056de6 100644 --- a/drivers/ufs/core/ufs-sysfs.c +++ b/drivers/ufs/core/ufs-sysfs.c @@ -230,7 +230,7 @@ static ssize_t wb_on_store(struct device *dev, struct device_attribute *attr, * If the platform supports UFSHCD_CAP_CLK_SCALING, turn WB * on/off will be done while clock scaling up/down. */ - dev_warn(dev, "To control WB through wb_on is not allowed!\n"); + dev_warn(dev, "It is not allowed to configure WB!\n"); return -EOPNOTSUPP; } diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 17a14b046c44..c91010fb2105 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5739,13 +5739,13 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable) ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_EN); if (ret) { - dev_err(hba->dev, "%s Write Booster %s failed %d\n", + dev_err(hba->dev, "%s: Write Booster %s failed %d\n", __func__, enable ? "enable" : "disable", ret); return ret; } hba->dev_info.wb_enabled = enable; - dev_info(hba->dev, "%s Write Booster %s\n", + dev_info(hba->dev, "%s: Write Booster %s\n", __func__, enable ? "enabled" : "disabled"); return ret; @@ -5763,7 +5763,7 @@ static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba, __func__, enable ? "enable" : "disable", ret); return; } - dev_dbg(hba->dev, "%s WB-Buf Flush during H8 %s\n", + dev_info(hba->dev, "%s: WB-Buf Flush during H8 %s\n", __func__, enable ? "enabled" : "disabled"); } @@ -5776,14 +5776,13 @@ int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable) ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_BUFF_FLUSH_EN); if (ret) { - dev_err(hba->dev, "%s WB-Buf Flush %s failed %d\n", __func__, + dev_err(hba->dev, "%s: WB-Buf Flush %s failed %d\n", __func__, enable ? "enable" : "disable", ret); return ret; } hba->dev_info.wb_buf_flush_enabled = enable; - - dev_dbg(hba->dev, "%s WB-Buf Flush %s\n", + dev_info(hba->dev, "%s: WB-Buf Flush %s\n", __func__, enable ? "enabled" : "disabled"); return ret; @@ -5801,7 +5800,7 @@ static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba, QUERY_ATTR_IDN_CURR_WB_BUFF_SIZE, index, 0, &cur_buf); if (ret) { - dev_err(hba->dev, "%s dCurWriteBoosterBufferSize read failed %d\n", + dev_err(hba->dev, "%s: dCurWriteBoosterBufferSize read failed %d\n", __func__, ret); return false; } @@ -5886,7 +5885,7 @@ static bool ufshcd_wb_need_flush(struct ufs_hba *hba) QUERY_ATTR_IDN_AVAIL_WB_BUFF_SIZE, index, 0, &avail_buf); if (ret) { - dev_warn(hba->dev, "%s dAvailableWriteBoosterBufferSize read failed %d\n", + dev_warn(hba->dev, "%s: dAvailableWriteBoosterBufferSize read failed %d\n", __func__, ret); return false; } From patchwork Wed Jul 27 07:12:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 594313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E5E5C04A68 for ; Wed, 27 Jul 2022 07:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbiG0HMy (ORCPT ); Wed, 27 Jul 2022 03:12:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiG0HMx (ORCPT ); Wed, 27 Jul 2022 03:12:53 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97B371BEB1 for ; Wed, 27 Jul 2022 00:12:52 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20220727071250epoutp02e44e46bd24a9421469b303942648d5eb~FnjDxzTUh3132831328epoutp02t for ; Wed, 27 Jul 2022 07:12:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20220727071250epoutp02e44e46bd24a9421469b303942648d5eb~FnjDxzTUh3132831328epoutp02t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658905970; bh=l0Bgpxh4TlvdrkA1gLCilMGgdoJi0qUAAhSNhvZnPXg=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=nStfzfYopHWZ6rbznG4J3lV8gkZX0KVeFxtRgJ6QD63vjyis0isTWp7WQ2p6J8+EV gCDaiQKJWm3NWNbe2vW1h7ibI5feoceTEzZczmbiEGH4I+4bJ65xYME9JLdUlmX4Ey 51JYO1eVqZCx8ysbX1sqVIKYDUHUmvgIh4XJoHzQ= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20220727071250epcas2p3778c09190e5c5250eeac8e237aa36882~FnjDLMhmf2750027500epcas2p3G; Wed, 27 Jul 2022 07:12:50 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.68]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4Lt4js5lQ1z4x9Q1; Wed, 27 Jul 2022 07:12:49 +0000 (GMT) X-AuditID: b6c32a47-5f7ff700000025aa-98-62e0e571d589 Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id E2.87.09642.175E0E26; Wed, 27 Jul 2022 16:12:49 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v4 7/7] scsi: ufs: wb: Move the comment to the right position Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220727071143epcms2p4936513ee2d020b914db53f438445801a@epcms2p4> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220727071249epcms2p4f014deb4b3eef7d37f810bc26b1160e7@epcms2p4> Date: Wed, 27 Jul 2022 16:12:49 +0900 X-CMS-MailID: 20220727071249epcms2p4f014deb4b3eef7d37f810bc26b1160e7 X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPJsWRmVeSWpSXmKPExsWy7bCmmW7h0wdJBo9WaFucfLKGzeLBvG1s Fi9/XmWzOPiwk8Vi2oefzBYvD2laLLqxjcni8q45bBbd13ewWSw//o/Jgcvj8hVvj8V7XjJ5 TFh0gNHj+/oONo+PT2+xePRtWcXo8XmTnEf7gW6mAI6obJuM1MSU1CKF1Lzk/JTMvHRbJe/g eOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoBOVFMoSc0qBQgGJxcVK+nY2RfmlJakKGfnF JbZKqQUpOQXmBXrFibnFpXnpenmpJVaGBgZGpkCFCdkZiyf3MhYsZatYdfY1awPjLNYuRk4O CQETicMzDgHZXBxCAjsYJY79fc3YxcjBwSsgKPF3hzBIjbCAv8TNe+/B6oUElCTOrZkFViIs YCBxq9ccJMwmoCfxc8kMNpAxIgJnmSUWPpzCBDGfV2JG+1MWCFtaYvvyrYwgNqeAn8TMqQfY IOIaEj+W9TJD2KISN1e/ZYex3x+bzwhhi0i03jsLVSMo8eDnbqi4pMShQ1/ZQO6REMiX2HAg ECJcI/F2+QGoEn2Jax0bwU7gFfCVmP9nEth4FgFViWU9W6BOc5E4tfkwWJxZQF5i+9s5zCAj mQU0Jdbv0oeYrixx5BYLzFMNG3+zo7OZBfgkOg7/hYvvmPeECaJVTWJRkxFEWEbi6+H57BMY lWYhQnkWkrWzENYuYGRexSiWWlCcm55abFRgDI/Y5PzcTYzglKrlvoNxxtsPeocYmTgYDzFK cDArifAmRN9PEuJNSaysSi3Kjy8qzUktPsRoCvTwRGYp0eR8YFLPK4k3NLE0MDEzMzQ3MjUw VxLn9UrZkCgkkJ5YkpqdmlqQWgTTx8TBKdXAJHlN5uZSFt8Av0t6XfvvLJ3+XXsvt96BU5kf b0w+81fmnoB9auIRIcUzXzh4158q/mj07vl7g/9LLPO/h0/cYnetXKv7818V0bvP5wX26lq7 GH35sXNxlm3hmwCDO49Y51l21NfIPf76xZlpw/33RSIvYte02Pe9ChPb+3qPed2L3a511S8S ruqc1tkbKL1AI9J5/SRdRS+7oN4XDa9edzStXbiHe1HnigDzuyz/rNx/ON/T9BG8av1D9Vfe BMGkfTl/Nzr2Xb2wjyt6ZvnO5Vzr72Vpm68Q6bR98Det/4mb9H0P49XbXzQG7qwztJicetrk xNZjGqGxD34wCtVE/Klzvf3JYTeP5x3lCOvZZkosxRmJhlrMRcWJAF0fKEAyBAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d References: <20220727071143epcms2p4936513ee2d020b914db53f438445801a@epcms2p4> <20220727071024epcms2p70366b54ac8eca3758b7cf4336e0d457c@epcms2p7> <20220727070841epcms2p5e212d617dd0f985555fa052f099013f0@epcms2p5> <20220727070724epcms2p8e449d0c89b52f03a9d3dc254df0ec547@epcms2p8> <20220727070410epcms2p5206785e4d960b32dcbb6729710dab535@epcms2p5> <20220727065904epcms2p60a7a56101785ddefa55c82b3cc25116d@epcms2p6> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The location of the comment is wrong. so fix it. Reviewed-by: Avri Altman Signed-off-by: Jinyoung Choi --- drivers/ufs/core/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index c91010fb2105..cc149f78f38f 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -1298,9 +1298,10 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up) } } - /* Enable Write Booster if we have scaled up else disable it */ downgrade_write(&hba->clk_scaling_lock); is_writelock = false; + + /* Enable Write Booster if we have scaled up else disable it */ ufshcd_wb_toggle(hba, scale_up); out_unprepare: