Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp438404pxf; Wed, 10 Mar 2021 09:08:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBnMUPYNbdUAXxtUi7rxA5+uByM7QmFoIfEqVVwU526B08XRNBuLusAxFBesaXkKjxFMtv X-Received: by 2002:a17:906:fa04:: with SMTP id lo4mr4731697ejb.44.1615396102614; Wed, 10 Mar 2021 09:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615396102; cv=none; d=google.com; s=arc-20160816; b=R96J3z8E2UIn5PBUVdKandjJsVLmeN8xa63Dq/LwXxBLOw+NOj8A5p73FkIHBFvslh GfB8HlVRBAg7tYChWdGZWYBvTRiCGU+PCRPBKOl7HKpp7217olhmu6f8tSvmMBMHZDOY OyW9MJ9mKroJRgkVlsjK1vaXy6/yG7uQ5TZ2/68iFwEg4lesyc3+Ig6+qr6AERKtJxZj kryZJgeyKkbo+VTKaPHaRZA0dPPvXb36esZR7tSb4lsiLMCR9Q1PmvRrifmnMGxvCWOK QcFut1WVeNPc7nzQ42vBvZuOJ0RN8np39NsPzUuMAXOKCeoSFKDINHRoBSpaemYxC1k1 IjyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=NfjSu8oET9rxciuTn6CT63lHyFIE2Wh5ahAvo9BqhHI=; b=r14mslVemOheCkpXczgbrWhG/5imU1N6qlyJhedhVERGjmylNLHLeSkZtUP3zWaqtb 8/6/GuB8L+JsPJfEiNqnyL0UwgVQFExdio/3EuUqhbRVTXGAtUBjAl7/sgdjoSEu1Pwe ohNUNXhpsg5piguu7iYb96vnoksA+2B2i430Vd6D9I7/OAlfmols3XQLBdyzTm7wKMr0 62kyFZtQBQ5quaKhrJ/yokQ6l/1msMINDmHcKcLofmma2UYGbbde2Y4Ei6V4RQTY5h9V jt/ZSDjjKEkw/vp2AipqiwRvrEzjrhUwLdC6igq6erJwUwX0xKGykDLY7uKk7tRa8vYq 3QoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=T5EOg9SK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si7800743ejj.661.2021.03.10.09.07.50; Wed, 10 Mar 2021 09:08:22 -0800 (PST) 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; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=T5EOg9SK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbhCJRGg (ORCPT + 99 others); Wed, 10 Mar 2021 12:06:36 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:26203 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233219AbhCJRGb (ORCPT ); Wed, 10 Mar 2021 12:06:31 -0500 Date: Wed, 10 Mar 2021 17:06:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1615395989; bh=NfjSu8oET9rxciuTn6CT63lHyFIE2Wh5ahAvo9BqhHI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=T5EOg9SKnsicHZt6BpxzYMKo9Le91E5BLIkOLsU6Qmso25xkejzk7bedEG2nz17IK LjWsz51ONKZkbQZ7T3DeqjJBEcBk0fcmlH2/p67RismIdKNm/XF/1pnbMIZ0rwAVYq jbQzwHIO8vmzm8MO6fsiLqdUsvT7lQvFyPfTAA3k= To: Avri Altman , Alim Akhtar , "James E.J. Bottomley" , "Martin K. Petersen" From: Caleb Connolly Cc: "ejb@linux.ibm.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "beanhuo@micron.com" , "jaegeuk@kernel.org" , "asutoshd@codeaurora.org" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Christoph Hellwig Reply-To: Caleb Connolly Subject: Re: [PATCH v3 1/3] scsi: ufshcd: use a function to calculate versions Message-ID: In-Reply-To: References: <20210310153215.371227-1-caleb@connolly.tech> <20210310153215.371227-2-caleb@connolly.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Avri, On 10/03/2021 4:34 pm, Avri Altman wrote: >> @@ -9298,10 +9291,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem >> *mmio_base, unsigned int irq) >> /* Get UFS version supported by the controller */ >> hba->ufs_version =3D ufshcd_get_ufs_version(hba); >> >> - if ((hba->ufs_version !=3D UFSHCI_VERSION_10) && >> - (hba->ufs_version !=3D UFSHCI_VERSION_11) && >> - (hba->ufs_version !=3D UFSHCI_VERSION_20) && >> - (hba->ufs_version !=3D UFSHCI_VERSION_21)) >> + if (hba->ufs_version < ufshci_version(1, 0)) >> dev_err(hba->dev, "invalid UFS version 0x%x\n", >> hba->ufs_version); > Here you replaces the specific allowable values, with an expression > That doesn't really reflects those values. I took this approach based on feedback from previous patches: https://lore.kernel.org/linux-scsi/d1b23943b6b3ae6c1f6af041cc592932@codeaur= ora.org/ https://lkml.org/lkml/2020/4/25/159 Patch 3 of this series removes this check entirely, as it is neither=20 accurate or useful. The driver does not fail when printing this error, nor is the list of=20 "valid" UFS versions here kept up to date, I struggle to see a situation=20 in which that error message would actually be helpful. Responses to=20 previous patches (above) that added UFS 3.0 to the list have all=20 suggested that removing this check is a more sensible approach. Regards, Caleb