Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2736545rdh; Wed, 27 Sep 2023 11:03:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNaUCFGbHOW/sJ5/MXpcjSS1/0MYP8vgDEFmJr7uAmQx5Cxm4QUf0v4CONSGtyC60Rczbm X-Received: by 2002:a05:6a20:9794:b0:14c:d5e9:21b8 with SMTP id hx20-20020a056a20979400b0014cd5e921b8mr2524449pzc.30.1695837816962; Wed, 27 Sep 2023 11:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695837816; cv=none; d=google.com; s=arc-20160816; b=zt72xiK3A5bYb5ZmWNS7UwUWLGzU7XZZtfay51Lusa56NQQYjPCsKHa6NPcqsXVRVS PL92/X/ow8mxfIh8H4fBtcHZNLXVxUbH9DUii1xc2Aub/k/CmqXWFzblKMb/AH7StyBc 8G/+CV2JCpaAKqj++aw30ZXueJdq0k/NaRwA4X+VmvGNytUyE0fIiz6PEbJ8OQASRCLG 3ZOeknFPEVY4RUeRIDosJT9BNbhVix2CzHKIPt0hjYJVQtrGcnw6RwLoip8Cf5BX2ilp dV6RSiDW84MqvUDt7GpZRjkKhwamMc3gp5GL+3gFc3P8fQLgupsA0C98lU+mb5VUt22s 5SVQ== 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=ElsoI+B/ZEHU3pgUWDYVT+qJp8+fO8PQ5xRpWMWfS88=; fh=SL9xiCfvVet9ugBN3In1QhwZCsIOPUamqEaCXjxKFIc=; b=z/vuJsTdI3ReXjrDTXQjQeBGxxWtvU7WNDipchlJvPr/xwax9Juvh3mw1+u5KL09Ib fr9mpZ1GzGKfbVmeVGTFCR2tVz18YtRGLlWq7z5SsydyVZijARy28mv4d8ya5SSABj74 GiwXzWcA6uC7ZzHAxnrN2tiJQypSfbkZh398oGbFKmAUjwC00sJFEelKJTotvne5d7Ku w5oFwBiCWbM6kyXj6+ABiQQuS3q8LbQ7wpiFa9OcnNUFL3eCEPKWV/tF3xlP04eF7DC3 IDQZ8RRKKohgY5JTcY5eOAZQRQ7fh2iBGy5sCd/ELt1estLFHUuvfnmlaJtnBu2EqDfD P6gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NRgoEnRT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id u191-20020a6385c8000000b00573f9dbef8asi16717084pgd.266.2023.09.27.11.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 11:03:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NRgoEnRT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 9E36380215FC; Wed, 27 Sep 2023 10:56:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbjI0Rzr (ORCPT + 99 others); Wed, 27 Sep 2023 13:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjI0Rzp (ORCPT ); Wed, 27 Sep 2023 13:55:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F40FDA1; Wed, 27 Sep 2023 10:55:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 504FDC433C7; Wed, 27 Sep 2023 17:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695837344; bh=YWY1pyf8MtEkd6eJhAPHczfGvF6Owa5tbXmP/WVgLMU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NRgoEnRTPkUxDJfSAg22dvbMv0o7P+aiMaU+hrFKT6KEdma8oTW/Lpn/ECBb19RtA +8T7UzqRABdIZ+uYKKc4wS2KzStSHPLgG+SjHuCjy0D2W6lyn0wUYpcJDLOLllKtEX XITi9rgdX6EG4lKiDDne6GElZioCNUo/54z1zlHc7eICG/O4cr9ugzL/Q89qkHS4Ym kGk/FzOjXSDhQ5QkJhJNt3bVztUmVQxD/rV1qo7azgeNZHa1oNFSFQtOc5hlSwxCR0 rEiAKPgDtNKDugR7dzchKwVeNFe3PO6NJEx0ABOtzXESjQfp8Ir1UKdihd8ROpPEN1 9w33dJoWMOd4w== Date: Wed, 27 Sep 2023 12:55:42 -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: <20230927175542.GA455424@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230927154603.172049-2-manivannan.sadhasivam@linaro.org> 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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 27 Sep 2023 10:56:17 -0700 (PDT) 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. In subject, /Make use of/Use/ would make better use of the subject line. Lots of "uses" there :) Above, s/let's//, and also s/make use of/use/. > +#define QCOM_PCIE_LINK_SPEED_TO_BW(speed) \ > + Mbps_to_icc(PCIE_SPEED2MBS_ENC(pcie_link_speed[speed])) It's a shame to have to duplicate this macro in pcie-qcom.c and in pcie-qcom-ep.c, especially since there's nothing qcom-specific in it. Would a macro like this fit in interconnect.h? > - 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.) Bjorn