Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1002649rwb; Thu, 8 Dec 2022 05:46:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf66IkyN61SFGdu33LAXZaAWvGBG0KQTVlTPzOjuoAwY7r+927K3zgC3w1AGxuEJXc6Llp+i X-Received: by 2002:a63:602:0:b0:478:ac4b:fb45 with SMTP id 2-20020a630602000000b00478ac4bfb45mr18312870pgg.397.1670507201744; Thu, 08 Dec 2022 05:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670507201; cv=none; d=google.com; s=arc-20160816; b=JaQ1Qn/mtdcWi2JM2Nes2wuiJzTgk4MpRjEM+00q7lTQSoPQCJpeD4izZAwuEX/Jcd cWg9PjLgeYq/NNqU/Dj9kSaPEkZQkfnZhKCuJDA+F5M/OPFdJ/R6PF+cfZw+k6WrMWS8 ECsE2s9E5psSWqVbTnxD1FsBsnDSN3tf+u28shkngQHWivt5GLiEBRtJeiOX+MtIGNbi K5wJUTJP5s03acgo6DLBHl6LXZ5sfc1te6hDAXY9ZZBaXoHmVjQDgD5zDQLu8H0k+7KL WD4q+RLnUGIMrgmsBISmvfUG6K2RaUKwT9CMVygW68qNsotsEHHp8cz6Oy1L/gtMqgm3 p3SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=i5lRBdAoPLMSOy6lJ9M0RNuDyhnO6PTxXoPAh60xUpM=; b=JBJA5ZP2esDER/n708IvE2K6UZ+s11txisgp8IzGfO0cZNJyrpDuWfFanQqZkIRiyD C0TpvyDNE82DgtEX5db+3jrOBtm2ZIeQM4jEdx7E3lg0BFaQhtJfLfKt3MSB4H9D284r DEcrq6aj2le1hpjYUzUoqx4YpLlUDoOelZeFe5NWmw4ywgoLsDYkKkRty/gAZSy0fHUS uDvXpuuiPKRrAyzsaSmftlhpdxcaH+QnZBPYa8NzynCUBmRsz5ZGG7gOi1CZgC8RCcA3 NNX62H7giZRpp3THHEVl3sdJKs59jUU2eockSkol+oTU8r509MITwFqMBYco+mBnkrdL JAmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cIlcWPq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b00477e0e4d2fbsi23035458pgq.412.2022.12.08.05.46.32; Thu, 08 Dec 2022 05:46:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cIlcWPq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiLHMWZ (ORCPT + 72 others); Thu, 8 Dec 2022 07:22:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbiLHMWV (ORCPT ); Thu, 8 Dec 2022 07:22:21 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A4592E9F1; Thu, 8 Dec 2022 04:22:19 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id ud5so3439734ejc.4; Thu, 08 Dec 2022 04:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=i5lRBdAoPLMSOy6lJ9M0RNuDyhnO6PTxXoPAh60xUpM=; b=cIlcWPq2u+2Ko4OG4WF2lQV351M/f/MveQeVD3o9/zHtEM3Lb7UqF9GH4WdeceAIA6 ZVLURjQ51BGxRYnmsJyy7Zc9ITXgAgPKc+Z0RwydCGhIXQHVFSQ+tgSDyOlTOzTsOnHn mP5CzrA1gN8IHxFTJOAIBEqh9qVw0VhgJM7mQAo+/fKciDYDdQEo4w9E13FQj2k3K0Ry JLetA+OseBk/xTgWvDvL6gJEfFLuUFpxSltQ0zxuelfvp8c4Re835oZBrtbB2mOeBuIf VOCiZhlVbV4J7qXCJv4fofZE3vWITkjbnJ1Ij6ek7srf+snsyDNXBoeEX5UEGtueTUyr mR3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=i5lRBdAoPLMSOy6lJ9M0RNuDyhnO6PTxXoPAh60xUpM=; b=KxLqagrpZmmQAE2fO8Fg7PSBAhGSBrmb06gsNyOeSzZXOfMu61tz9bekrSHl9D/M7s VICL1TKo5LgSFKO/W7+G2JTX616s1LLpU5O11pvZwZa9SHZlUDCWxDjjhO/y/t62FIlJ QvlxAPmHIJdmRe1v9xVSsRksznAbD5mwk/GPpWlEezlr3QIWZKflRNryCYkgvClPLpkK cjSKrviCow0aQd3CjAyQgKohRnXqdLzy0er6MCkoKeg3dDFCYOjCLAv16DFzB+mZous7 MoUoH4Nf+vkcw8FEiFhY5d1YGNI3yn4jin2U3irl1gK2UZKvN9rkWGLKJzWpGwy1EAEk rilw== X-Gm-Message-State: ANoB5pmIRUuhYC+Lu2JFGJPujoZ4lARSZ3igCZChfFORg81EW68CnMo+ X31eDzWrW2lWo2sUUxby0WE= X-Received: by 2002:a17:906:6b97:b0:7c0:fe68:35e9 with SMTP id l23-20020a1709066b9700b007c0fe6835e9mr11384665ejr.49.1670502138053; Thu, 08 Dec 2022 04:22:18 -0800 (PST) Received: from [10.176.235.173] ([137.201.254.41]) by smtp.gmail.com with ESMTPSA id f17-20020a05640214d100b0045b4b67156fsm3295382edx.45.2022.12.08.04.22.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Dec 2022 04:22:17 -0800 (PST) Message-ID: <0a44763d-8c40-b9e7-6268-01567c401884@gmail.com> Date: Thu, 8 Dec 2022 13:22:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v4 1/4] ufs: core: Remove redundant wb check To: Bart Van Assche , Arthur Simchaev , martin.petersen@oracle.com Cc: beanhuo@micron.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <1669550910-9672-1-git-send-email-Arthur.Simchaev@wdc.com> <1669550910-9672-2-git-send-email-Arthur.Simchaev@wdc.com> Content-Language: en-US From: Bean Huo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.12.22 12:31 AM, Bart Van Assche wrote: > On 11/27/22 04:08, Arthur Simchaev wrote: >> We used to use the extended-feature field in the device descriptor, >> as an indication that the device supports ufs2.2 or later. >> Remove that as this check is specifically done few lines above. >> >> Reviewed-by: Bean Huo >> Signed-off-by: Arthur Simchaev >> --- >>   drivers/ufs/core/ufshcd.c | 4 ---- >>   1 file changed, 4 deletions(-) >> >> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c >> index 2dbe249..2e47c69 100644 >> --- a/drivers/ufs/core/ufshcd.c >> +++ b/drivers/ufs/core/ufshcd.c >> @@ -7608,10 +7608,6 @@ static void ufshcd_wb_probe(struct ufs_hba >> *hba, const u8 *desc_buf) >>            (hba->dev_quirks & >> UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES))) >>           goto wb_disabled; >>   -    if (hba->desc_size[QUERY_DESC_IDN_DEVICE] < >> -        DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 4) >> -        goto wb_disabled; >> - >>       ext_ufs_feature = get_unaligned_be32(desc_buf + >>                       DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP); > > Does this code really have to be removed? I see a check of the > UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES flag above the removed > code but no check of the descriptor size? > it is not necessary to check this, but if you have concern, we could change to like this:         if (desc_buf[DEVICE_DESC_PARAM_LEN] <             DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 4)                 goto wb_disabled; then   hba->desc_size could be removed. Kind regards, Bean