From patchwork Fri Oct 13 11:20:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 15328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1816227vqb; Fri, 13 Oct 2023 04:21:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHCGb6lP4O93LlRai+/L21WSYYLvZhw3uv+BhVMan0KisITFz6C3tuxeCuCIJANpfI+8+J X-Received: by 2002:a05:6a20:8f01:b0:163:d382:ba99 with SMTP id b1-20020a056a208f0100b00163d382ba99mr32026075pzk.5.1697196062343; Fri, 13 Oct 2023 04:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697196062; cv=none; d=google.com; s=arc-20160816; b=GqYc+fBhVwP3dAXrOVD5S9tBoVqzxCNr0segCR8xKROiv/+vOByT3pIW2fTQ2j/okI WeJAtFhlEn3WFBjByvP0f3KCets0ne5JB0w4N1zpy0F+eW3Zxr8N7LPARwvFiHqK6yVV zAph6/XS2RW8/EXsOGaQTVO1HVxwpISkp9y4QLxF5QkgAAC0uXni1S6cgpwB3P373GRD qtmvF0PdoujIKsahhVTMd5LouUackYsq0Lx+3tpu4gEK1HUIUbtWytb3rTdgxjevNY/2 2TslEgFw74aBbhniY7d6qBQ/1qcMiUlWTghAsY22iYelEnYiAnJFl54325F+TgC+rDHk Qb2Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=b5E1c+66py39/yI99UfsvtJU/YlkqGeytm4sq4X8Sa4=; fh=v/gTcuW4RMBt2xtkjZeSkQod61XQ/SEN0dgeRBh6GoU=; b=IVqYqwUKcjKu/2CEDVdj5bojwDNjD8bW2enbgRhJ2hozI3G4qoci7PzZeGHmH5mLtz g8NBWxH5hRnCc6B2ups43dgt11vXgxwwSPCz7L5uKhcvEBMnvReQSGnA37HI1KkMS0hD H0dA1tJuOGRzprM3C3MqtKcNZflinZqZF1t8i41jwkobnEk2t/BuwkdrcscySBbSWSOI w5sgzWbQTMQNawWUx/SQwu5yOEp0VbMqUaFWr77zbIYritfQWtiaG5/iTZaPKQqY5f/B JsRChQJnPuiI9yMGh+J4x/8VTJ4rMQTKN+HJODJjKZlyXx/msrpLTcF+rywh04kRtlyy b65g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a4PTrsrt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id mp9-20020a17090b190900b0027766994586si4174863pjb.71.2023.10.13.04.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:21:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a4PTrsrt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3A2B0808BE4F; Fri, 13 Oct 2023 04:20:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbjJMLUT (ORCPT + 19 others); Fri, 13 Oct 2023 07:20:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230014AbjJMLUR (ORCPT ); Fri, 13 Oct 2023 07:20:17 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DA0CB7; Fri, 13 Oct 2023 04:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697196016; x=1728732016; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=v35k94BNYjpR/g40oHphqcfXoVx02xvQQJ6kG01eG9k=; b=a4PTrsrt8qn5KwHhqE/NikvJZMJU8y6t86fegZq13wNiG+/HeyWF5g5m crmXkini5e7GDqpcxGw4k7+GcWAtX7JNWSPKdE+d30LlVhUgZAQx+2wr+ J5KBpVWWKd50k6YkRaKvnIrmSOl9gzbQnkpRJj6HI+nsUXKQBcjAr32Zq 2MS4/Zb+lBhLDoDktLqT01eHG31cv8uSmgXKhOgjvaRWaqNWYSz/O2cIj afPF0JgJKGtV/gcPxaYN7mL1WVgo7LqsQr9E0RJpCQN3HKvCj9nH9Qxa8 B7/OHvs6AaZ7PHEZ7XWHSYUlD3h1X2tPw8eCfhu3Yfl4Kx626s25R6ttl g==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="416213486" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="416213486" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 04:20:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="754672560" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="754672560" Received: from rhaeussl-mobl.ger.corp.intel.com (HELO localhost) ([10.252.58.47]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 04:20:12 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Jonathan Cameron Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 0/2] PCI/DPC: Improve register field accessing Date: Fri, 13 Oct 2023 14:20:02 +0300 Message-Id: <20231013112004.4239-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 04:20:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779639058265951165 X-GMAIL-MSGID: 1779639058265951165 This an alternative approach to the patch in: https://lore.kernel.org/linux-pci/20231010204436.1000644-7-helgaas@kernel.org/ It adds names to all the reason literals too (which makes it incompatible with FIELD_GET() for the reason and ext_reason). When the reasons are named instead of literals, it's very easy to understand the code just by reading it (no need to lookup the meaning of those numbers from spec or otherwise). Also 0xfff4 the other patch missed is converted here. Just let me know if I should, for example, base the additional changes on top of that other change. Ilpo Järvinen (2): PCI: Add PCI_EXP_DPC_* field details PCI/DPC: Use defines with register fields drivers/pci/pcie/dpc.c | 39 +++++++++++++++++++++-------------- include/uapi/linux/pci_regs.h | 7 +++++++ 2 files changed, 31 insertions(+), 15 deletions(-)