From patchwork Mon Jul 17 12:05:03 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: 121268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1079851vqt; Mon, 17 Jul 2023 05:31:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlFrp3AW4AJf8z6+fI1cSdw9z2/a6XKCeJKPJhHbRG4RTBWsJtFuBt/NPok9TgzbQ898WrUY X-Received: by 2002:a05:6e02:1d0c:b0:348:9111:1574 with SMTP id i12-20020a056e021d0c00b0034891111574mr398936ila.22.1689597111870; Mon, 17 Jul 2023 05:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689597111; cv=none; d=google.com; s=arc-20160816; b=q0R2PO2F3r2U5HTNGdLNXc6xdat9Npne59pB+H6DhulzwERKGBEb7wE71u+qL00lbO hESx7f+EdAeulyJrrl3esplKLqK6ouquo6cNIFxgJtrlYtXhfdYLIbYuqfMD777ogrvn BEEqUFLnDv43huCi4UQzI+PRbdI+45UE/+AG2KHU0RoZFciAoK8kRu1SI5Mmo05l68tK st6g/Wk68T33Xhr0P2g435k/iSp2Py5tDObKtmE/vN6PEIB+XpJkAdJaJA0jp+rUlqPq AMqXeAKfbLg8XJFFRcZoV4L2TVg1Pixz9x0qYgTAd3SFMgmcs5DlSSdJ6wh4NpMSw9S8 iKYw== 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:date:subject:cc:to:from :dkim-signature; bh=egxuTEmhZPXosA43WyyqLqcB74HopWBUN/Wym6ZGhXg=; fh=tlb5yQT84yvM9qcxhWDjR4Be2EXaiDtMe8bPoQZwqRA=; b=VZyKDLt37dtjvn0YfSbQNDv6nV7gKWmj5L34OzE/zYdse3yF6VbhvB5vjOhYnkcK9S Rv1Z9VD3/UKZHL/McJuoMq3H69staJGOmM4TRz8rtNsZKsmeQ9h2X7Z30siixr3uoXJE +3IC058qZdII9U1r3xpbVt11sngHoramSsgY45+6CWq6WyPXzQffm8Z1ocOoto2k9Tis PndX4nIwAZYAxZrb71PS8Kr3ivNSMFXXEIanzsQfFX3gvs+9aB+tueb2xnpb9n5Nvl8T /RnWElEswc/zmqgyaa5Wpp/63nGqi1xdi1BYkRKuhaZ4yVX6CAcqZYym0kAAYNJw7mzp bkOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VUmHmtKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v20-20020a634654000000b0055b7319a311si4444714pgk.356.2023.07.17.05.31.38; Mon, 17 Jul 2023 05:31:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VUmHmtKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjGQMIJ (ORCPT + 99 others); Mon, 17 Jul 2023 08:08:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231229AbjGQMH7 (ORCPT ); Mon, 17 Jul 2023 08:07:59 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF0C8E58; Mon, 17 Jul 2023 05:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689595655; x=1721131655; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WP9jbrwJlCzDhGsE/E1k9YoxHP6CB4ER/l8Uze8ZUhU=; b=VUmHmtKw3+V42iWkXCTgXkiGTj4CJyxGrrr5Ms0I109kVZouKhHgUt5e 1r28kx5QtN1ijv0wbR7WNK/ak1FVKwbxQNCzkGKZsNSRwj9wIls8JdsZ0 3zqJHAxJ+0EE5R1WKNrU70uGoSZtXVDuOV4+k8xq7JNgwXGkqlLM/n2pW DaBG7wWAZzdBCtoPPJQ5U7fd9pCusF0OjGpRoCKdCk2NL41Tk2CrAhT3m BB7IHn1/tIvJjaOxUJZUBHQ8kJEYEmc3KcbwV/HKwzggWe3vHPPbt3/Pt gokginQ5eqnFlz6raXWRz0XoaSMyHP89IZTg8CGAMMBj82HL81k3cG8fN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="432082001" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="432082001" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 05:07:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10773"; a="752876486" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="752876486" Received: from dkravtso-mobl1.ccr.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.45.233]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 05:07:10 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Emmanuel Grumbach , "Rafael J . Wysocki" , Heiner Kallweit , Lukas Wunner , Andy Shevchenko , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dean Luick , =?utf-8?q?Jonas_Dre=C3=9Fl?= =?utf-8?q?er?= , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v5 11/11] PCI: Document the Capability accessor RMW improvements Date: Mon, 17 Jul 2023 15:05:03 +0300 Message-Id: <20230717120503.15276-12-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230717120503.15276-1-ilpo.jarvinen@linux.intel.com> References: <20230717120503.15276-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771670981499770067 X-GMAIL-MSGID: 1771670981499770067 Documentation claims port service drivers should play nice wrt. PCIe Capability changes but the concurrency control is now provided in the Capability accessors as long as the correct ones are used. Update the documention to match the RMW accessor behavior. Signed-off-by: Ilpo Järvinen --- Documentation/PCI/pciebus-howto.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Documentation/PCI/pciebus-howto.rst b/Documentation/PCI/pciebus-howto.rst index f882ff62c51f..a0027e8fb0d0 100644 --- a/Documentation/PCI/pciebus-howto.rst +++ b/Documentation/PCI/pciebus-howto.rst @@ -213,8 +213,12 @@ PCI Config Registers -------------------- Each service driver runs its PCI config operations on its own -capability structure except the PCI Express capability structure, in -which Root Control register and Device Control register are shared -between PME and AER. This patch assumes that all service drivers -will be well behaved and not overwrite other service driver's -configuration settings. +capability structure except the PCI Express capability structure, +that is shared between many drivers including the service drivers. +RMW Capability accessors (pcie_capability_clear_and_set_word(), +pcie_capability_set_word(), and pcie_capability_clear_word()) protect +a selected set of PCI Express Capability Registers (Link Control +Register and Root Control Register). Any change to those registers +should be performed using RMW accessors to avoid problems due to +concurrent updates. For the up-to-date list of protected registers, +see pcie_capability_clear_and_set_word().