From mboxrd@z Thu Jan 1 00:00:00 1970 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 E64D9C4332F for ; Wed, 18 May 2022 19:23:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241899AbiERTXb (ORCPT ); Wed, 18 May 2022 15:23:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241903AbiERTXa (ORCPT ); Wed, 18 May 2022 15:23:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A64F621271 for ; Wed, 18 May 2022 12:23:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 356DD618FA for ; Wed, 18 May 2022 19:23:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F348EC36AE2; Wed, 18 May 2022 19:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652901804; bh=GfJu7dQBwFQci22KG5K0sfCnkvzqKSWVHCrllpzLtJA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=XwlJQmmmTLIyPwqqEPkBVzx3dBt6acZ9bSmjQ+3hzgCDipUst4ptbj8wZhmWBiBci b0fQ02uFAqGXLQrSlZEquJ12EifOA/dsrX1CFmFStBVMh5JMa5OPH7mD6G18pGr0zv xrNl9y6Va9d76IW2S+oMFC/I7/7owpJQ2pcvYgcNzYxHBoF3s09sizwDtgXIg83leD oKVYBhO2B8nsOMAfxTlek8T+di6KabnoAePy0sl7c8esakTuo/SjIGv0a5NHvi5vzX SoMVfSt7ZIv34zb0y0oLThXXiMuAnVmZBfI4n7VvKa/e7m73p3cnGI7sf5u+ZJqcM5 kCQPzGZERhgxA== Date: Wed, 18 May 2022 14:23:22 -0500 From: Bjorn Helgaas To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Marc Zyngier , pali@kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Gregory CLEMENT Subject: Re: [PATCH 04/18] PCI: Add PCI_EXP_SLTCAP_*_SHIFT macros Message-ID: <20220518192322.GA1155024@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220220193346.23789-5-kabel@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Sun, Feb 20, 2022 at 08:33:32PM +0100, Marek Behún wrote: > From: Pali Rohár > > These macros allows to easily compose and extract Slot Power Limit and > Physical Slot Number values from Slot Capability Register. > > Signed-off-by: Pali Rohár > Signed-off-by: Marek Behún Acked-by: Bjorn Helgaas We talked about using FIELD_PREP() / FIELD_GET(), which I think would remove the need for the *_SHIFT macros. But we can always do that later. > --- > include/uapi/linux/pci_regs.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h > index bee1a9ed6e66..d825e17e448c 100644 > --- a/include/uapi/linux/pci_regs.h > +++ b/include/uapi/linux/pci_regs.h > @@ -591,10 +591,13 @@ > #define PCI_EXP_SLTCAP_HPS 0x00000020 /* Hot-Plug Surprise */ > #define PCI_EXP_SLTCAP_HPC 0x00000040 /* Hot-Plug Capable */ > #define PCI_EXP_SLTCAP_SPLV 0x00007f80 /* Slot Power Limit Value */ > +#define PCI_EXP_SLTCAP_SPLV_SHIFT 7 /* Slot Power Limit Value shift */ > #define PCI_EXP_SLTCAP_SPLS 0x00018000 /* Slot Power Limit Scale */ > +#define PCI_EXP_SLTCAP_SPLS_SHIFT 15 /* Slot Power Limit Scale shift */ > #define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */ > #define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */ > #define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ > +#define PCI_EXP_SLTCAP_PSN_SHIFT 19 /* Physical Slot Number shift */ > #define PCI_EXP_SLTCTL 0x18 /* Slot Control */ > #define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */ > #define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */ > -- > 2.34.1 > From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D4A7C433EF for ; Wed, 18 May 2022 19:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=VjIa4ZWzRyZPyj5chDZMdXqevxXDHmrjYEUqdmg0aoo=; b=IhS6/CIfyn+oZw 3hW9mWrlFpOC0m4DnGQjVkMS8xSBu1vcz8lMnENmR0SPIeWi1eWuFEt9HE5LFnk4JxDtbkHTa0FXV 6uHexAgA7xInZEFkXmUxrODjIXOpG8ltKp95AGS0NKQvOGrfKmFct5MdFbr2Y+CZP2GpKvMbKJGE1 Y8Y0FvcL+Y7/1pOgJ/+C5CdoUdx5ZmzqeaNwQAvrtupcwQgOfhFjZzP4TY0izRp9bvDTbQ/gLJV8W SLDZmyHu5nLnIBxnPcN0DXXEiXXJOgIWIMhVi1SW1OxqlGp6NfFq6Ex+efsnV2hHEtdegC/UDtuTL nfCuaN/jDSwnPUiyslMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrPGe-003c2K-3J; Wed, 18 May 2022 19:23:32 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrPGY-003c16-V5 for linux-arm-kernel@lists.infradead.org; Wed, 18 May 2022 19:23:29 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A1FD61935; Wed, 18 May 2022 19:23:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F348EC36AE2; Wed, 18 May 2022 19:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652901804; bh=GfJu7dQBwFQci22KG5K0sfCnkvzqKSWVHCrllpzLtJA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=XwlJQmmmTLIyPwqqEPkBVzx3dBt6acZ9bSmjQ+3hzgCDipUst4ptbj8wZhmWBiBci b0fQ02uFAqGXLQrSlZEquJ12EifOA/dsrX1CFmFStBVMh5JMa5OPH7mD6G18pGr0zv xrNl9y6Va9d76IW2S+oMFC/I7/7owpJQ2pcvYgcNzYxHBoF3s09sizwDtgXIg83leD oKVYBhO2B8nsOMAfxTlek8T+di6KabnoAePy0sl7c8esakTuo/SjIGv0a5NHvi5vzX SoMVfSt7ZIv34zb0y0oLThXXiMuAnVmZBfI4n7VvKa/e7m73p3cnGI7sf5u+ZJqcM5 kCQPzGZERhgxA== Date: Wed, 18 May 2022 14:23:22 -0500 From: Bjorn Helgaas To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Marc Zyngier , pali@kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Gregory CLEMENT Subject: Re: [PATCH 04/18] PCI: Add PCI_EXP_SLTCAP_*_SHIFT macros Message-ID: <20220518192322.GA1155024@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220220193346.23789-5-kabel@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220518_122327_075427_C94A2A85 X-CRM114-Status: GOOD ( 14.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Feb 20, 2022 at 08:33:32PM +0100, Marek Beh=FAn wrote: > From: Pali Roh=E1r > = > These macros allows to easily compose and extract Slot Power Limit and > Physical Slot Number values from Slot Capability Register. > = > Signed-off-by: Pali Roh=E1r > Signed-off-by: Marek Beh=FAn Acked-by: Bjorn Helgaas We talked about using FIELD_PREP() / FIELD_GET(), which I think would remove the need for the *_SHIFT macros. But we can always do that later. > --- > include/uapi/linux/pci_regs.h | 3 +++ > 1 file changed, 3 insertions(+) > = > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h > index bee1a9ed6e66..d825e17e448c 100644 > --- a/include/uapi/linux/pci_regs.h > +++ b/include/uapi/linux/pci_regs.h > @@ -591,10 +591,13 @@ > #define PCI_EXP_SLTCAP_HPS 0x00000020 /* Hot-Plug Surprise */ > #define PCI_EXP_SLTCAP_HPC 0x00000040 /* Hot-Plug Capable */ > #define PCI_EXP_SLTCAP_SPLV 0x00007f80 /* Slot Power Limit Value */ > +#define PCI_EXP_SLTCAP_SPLV_SHIFT 7 /* Slot Power Limit Value shift */ > #define PCI_EXP_SLTCAP_SPLS 0x00018000 /* Slot Power Limit Scale */ > +#define PCI_EXP_SLTCAP_SPLS_SHIFT 15 /* Slot Power Limit Scale shift */ > #define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Pr= esent */ > #define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support = */ > #define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ > +#define PCI_EXP_SLTCAP_PSN_SHIFT 19 /* Physical Slot Number shift */ > #define PCI_EXP_SLTCTL 0x18 /* Slot Control */ > #define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */ > #define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */ > -- = > 2.34.1 > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel