Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3528235rdh; Thu, 28 Sep 2023 14:39:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQv65adJccwCES/AP4pUeo0uXqIwQG0mbbz+IXBLlsCnwQ4qMOJbCh46qprCc1N9IH9n48 X-Received: by 2002:a05:6808:8cd:b0:3a1:eccc:26da with SMTP id k13-20020a05680808cd00b003a1eccc26damr2284201oij.25.1695937143981; Thu, 28 Sep 2023 14:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695937143; cv=none; d=google.com; s=arc-20160816; b=abj3oxKaVG4lddh6/sbPoEHymBMk0LLytBc1dagK1UW5jiR3jYzB9L6YWh41QQS58C 2kea6bHO5UqOuviE4wW1IYL74lb6U4v0ui8Fc1SU2tLv4Go6HnCKk/H+MWIZ41MQ2Ygm aD9GVc7sCMA9hHcZ8REw9YXhmWlL03x/r1URWvbdn3KwXsRceIeBp3MhTTb0IagTy9px qFIw9DTn4xrJZoOMH7JHp9iJ2zHmf0Ti3ot0Li5qeMHnw89OO2PqJoYFplUNlwne3h7S fMADlPbg6cumGsvK94t8PdJVnlF3wlipiU/n+cGuSziIdl+tlx6Kfwc3gBIQDymFVWZ6 LdjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=VLPyX3plJbN9qq/Bx+7QLT54RVNt/7MIF2NZsSI1fQk=; fh=SL9xiCfvVet9ugBN3In1QhwZCsIOPUamqEaCXjxKFIc=; b=WAuwpKHjkNqfjn1pzNpjqEJkCNsBbLGD9r+37RIZO9Dz2NRm+c29A3SgkIKamSjOiR w+W89euRKY2OTygCW40CLZSrody18V5iutgYBpjvJ8i0xJXci+Wjo8q8DWUSF+XRxJbA dUwwU6Aib0+O5RO7UUhQSDVLzaJDMBTUNSyhcaU56ZZTW2j72FjUueNwiq5CkrmwuwoZ fuHHKvvTCqy4rQpk0irqtOFHn3OTy0Zk13NKUdf+gGh3OqGH0g5M2uJ9xeOktjVsTBaZ VB8GqyKeLIKlc2QjtqHpF9XijxxrwkC0ZydhGDP2egVc3q2fd8gzNqCi5FMTZ3ABDHB3 Ve3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ecqYzacM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ck8-20020a056a00328800b00690f9ca0f99si4216150pfb.12.2023.09.28.14.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 14:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ecqYzacM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 56B448130CAB; Thu, 28 Sep 2023 14:28:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232569AbjI1V2E (ORCPT + 99 others); Thu, 28 Sep 2023 17:28:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbjI1V2B (ORCPT ); Thu, 28 Sep 2023 17:28:01 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A6BC19F; Thu, 28 Sep 2023 14:28:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A2ECC433C9; Thu, 28 Sep 2023 21:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695936479; bh=oG15rWzQuTMZwy4r8BMtMTNBgXeakzWaG3G44Ogz5Hc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ecqYzacMYlsoPCYeyLSvWbRz716bMYzbrykMgjLb91xMxBr8Q47uh9OV63Ecy7NVY gIzXuIXUhrcOab3gRokbAFp8Ru5JYjBaESHZaENryhazYAelYRkhLCI0bqrsL6VMDj Eoh1b7CGagctEFpdNiGBn84lVXS/dN3BOG7/GNfVn0FAggGpEy7fBdED3C6ukO+6uO dZihjoWT9JCpbcrnAVhTN9PKTVvhM0FJSuSJHHj8mSSxB2uPASjn/O0uV17RhV/N5I xxV/1+ShYwpQgzHvWrZHpxTche5qmJJXOfA1gnYQURwa3YOj43XWBIYVz3qHOfDI7N P4bKMFGvTIKpQ== Date: Thu, 28 Sep 2023 16:27:57 -0500 From: Bjorn Helgaas To: Manivannan Sadhasivam Cc: lpieralisi@kernel.org, kw@linux.com, andersson@kernel.org, konrad.dybcio@linaro.org, bhelgaas@google.com, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, abel.vesa@linaro.org Subject: Re: [PATCH v3 2/3] PCI: qcom-ep: Make use of PCIE_SPEED2MBS_ENC() macro for encoding link speed Message-ID: <20230928212757.GA502911@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230928184808.GA12574@thinkpad> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 28 Sep 2023 14:28:24 -0700 (PDT) On Thu, Sep 28, 2023 at 08:48:08PM +0200, Manivannan Sadhasivam wrote: > On Wed, Sep 27, 2023 at 12:55:42PM -0500, Bjorn Helgaas wrote: > > On Wed, Sep 27, 2023 at 05:46:02PM +0200, Manivannan Sadhasivam wrote: > > > Instead of hardcoding the link speed in MBps, let's make use of the > > > existing PCIE_SPEED2MBS_ENC() macro that does the encoding of the > > > link speed for us. Also, let's Wrap it with QCOM_PCIE_LINK_SPEED_TO_BW() > > > macro to do the conversion to ICC speed. > > > - ret = icc_set_bw(pcie_ep->icc_mem, 0, MBps_to_icc(PCIE_GEN1_BW_MBPS)); > > > + ret = icc_set_bw(pcie_ep->icc_mem, 0, QCOM_PCIE_LINK_SPEED_TO_BW(1)); > > > > "1" is not very informative here. Maybe PCIE_SPEED_2_5GT? (I didn't > > completely verify that this is equivalent.) > > No. PCIE_SPEED_2_5GT is defined as 0x14 in pci.h. And I do not want to add a > macro for just "1" here. Is there no other existing macro that contains the 2.5GT/s hint?