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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5509DC433EF for ; Fri, 15 Oct 2021 14:46:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2BC0D611C3 for ; Fri, 15 Oct 2021 14:46:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2BC0D611C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6O7anbI8TFFukxWe+2Uy1+h3U+GaxPnIwCN9+AtC0O4=; b=ymlY088Uhni7Rx VZ23D31R8OlweuyJlxrqgA+kS5D/3mHmAiQlZCkIQc9D9ls4j5aPfjwb5KkutfUIH9UQWApe3cA99 buVWO/0s/bzvKEssCjD3ymA/a8nlRcYov2gHxXJyj7Qdga/8dsq3XrKF+MmjN9WI/VWBBW3wfoWGv 5zhK5GGa1rMCwMVAQp1Dhx3rZ6MHtYpJtPwueCW6ugwA98v4VLVsgwXl6wExYY1ooYW3LkAKQFvp9 abjUPzQpSNKCd0/su5/ZDWjW7TJh7PI2IQQhSiEjLz6dp1tgPa/GOLp1B4rf6IbAlskofk6SVpFdq j9e4blbGEd+HpbtGL0Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOT5-007hEy-W5; Fri, 15 Oct 2021 14:45:56 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOJd-007e9M-Np; Fri, 15 Oct 2021 14:36:11 +0000 Received: by mail-pg1-x52f.google.com with SMTP id m21so8762496pgu.13; Fri, 15 Oct 2021 07:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A1+buzEnWHFfl/ZaWbrWJXy+M9IGPXk9SXcGFxZnAfs=; b=RPL7BCrK2/jYy7dA9EeV9fzfOZdBvV8FM1iW0gA441nrIxQ1xg44AUgbJZXbJN0dLZ h8GZ848pgkw/SpggGk3Zko6r2dmRVDyVgm4Qzpu+JQZBNG9uUyRXcLcXSMbKPNZdxitc /r2CDWerhToBA5WnN6QULeO+FTZ6euC8cju6Uchf4G5vUgen13X2ecOGczouC8L9W32b 3MlEbvo6LetX8BjoFIfC7+6AN6NRzKguY9vM57zS01VuXgIlLpDVdVL+ConAEe3b3USo OdQi9coc7ijOlKl5z4CG4gkXjcOES8tkv7Dlj3zY2sw4Iv3ZuUxfFKTnCjHiYeOB4D8z dzyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A1+buzEnWHFfl/ZaWbrWJXy+M9IGPXk9SXcGFxZnAfs=; b=zDH5odVzDA4zj+2S6TA8QTr0FQ4fiyzCwlZ4vSSzRy7xb0Kp5Tv6LCqu1ub2zqntij UpvYjVLUTODn7qgyZpjl/q3V6skM/yFyk0SmqjuU3j/pl8XV9ghRXhSnxrEJSgXvWJbr DoG8V3GBSW3Gi/dEa7i9TJAnvN/K1zmfJg2UZKaJFmKM1kvzuHgfT/4M9F3biZs103/i K61cDohbSAmonS5/Ky33P3IQymJDU+gTIdyotOaonPpoh1d58thEjnXXAHtzRQmbPYaz wGJx993Im6Ng2LzV5r4nRFDpFcyQNDQZMK72h7i3z3Pq96zmpIZBhLScq+rEzMe8fhZP 2IsA== X-Gm-Message-State: AOAM533N19vXkR3480K7P6sFQlhFSEKm6FqZqaiV5DKyCVPTT6mMUdsJ a0JRPl+dbJYWohSDZP93P/s= X-Google-Smtp-Source: ABdhPJyWuQ1K1JxflSMa0Mke7WMw5bxh8bvQ3ExR+gido75xKDvVtio4NGskzHymTTSJ5ZhB267d6g== X-Received: by 2002:a62:ed01:0:b0:44d:6aa6:30eb with SMTP id u1-20020a62ed01000000b0044d6aa630ebmr12041882pfh.53.1634308567962; Fri, 15 Oct 2021 07:36:07 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:4806:9a51:7f4b:9b5c:337a]) by smtp.gmail.com with ESMTPSA id x7sm11536941pjg.5.2021.10.15.07.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:36:07 -0700 (PDT) From: Naveen Naidu To: bhelgaas@google.com Cc: Naveen Naidu , linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-mediatek@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Rob Herring , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH v2 00/24] Unify PCI error response checking Date: Fri, 15 Oct 2021 20:05:51 +0530 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_073609_820634_CD5191BF X-CRM114-Status: GOOD ( 17.51 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org An MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. This patch series adds PCI_ERROR_RESPONSE definition and other helper definition SET_PCI_ERROR_RESPONSE and RESPONSE_IS_PCI_ERROR and uses it where appropriate to make these checks consistent and easier to find. This helps unify PCI error response checking and make error check consistent and easier to find. This series also ensures that the error response fabrication now happens in the PCI_OP_READ and PCI_USER_READ_CONFIG. This removes the responsibility from controller drivers to do the error response setting. Patch 1: - Adds the PCI_ERROR_RESPONSE and other related defintions - All other patches are dependent on this patch. This patch needs to be applied first, before the others Patch 2: - Error fabrication happens in PCI_OP_READ and PCI_USER_READ_CONFIG whenever the data read via the controller driver fails. - This patch needs to be applied before, Patch 4/24 to Patch 15/24 are applied. Patch 3: - Uses SET_PCI_ERROR_RESPONSE() when device is not found and RESPONSE_IS_PCI_ERROR() to check hardware read from the hardware. Patch 4 - 15: - Removes redundant error fabrication that happens in controller drivers when the read from a PCI device fails. - These patches are dependent on Patch 2/24 of the series. - These can be applied in any order. Patch 16 - 22: - Uses RESPONSE_IS_PCI_ERROR() to check the reads from hardware - Patches can be applied in any order. Patch 23 - 24: - Edits the comments to include PCI_ERROR_RESPONSE alsong with 0xFFFFFFFF, so that it becomes easier to grep for faulty hardware reads. Changelog ========= v2: - Instead of using SET_PCI_ERROR_RESPONSE in all controller drivers to fabricate error response, only use them in PCI_OP_READ and PCI_USER_READ_CONFIG Naveen Naidu (24): [PATCH 1/24] PCI: Add PCI_ERROR_RESPONSE and it's related definitions [PATCH 2/24] PCI: Set error response in config access defines when ops->read() fails [PATCH 3/24] PCI: Unify PCI error response checking [PATCH 4/24] PCI: Remove redundant error fabrication when device read fails [PATCH 5/24] PCI: thunder: Remove redundant error fabrication when device read fails [PATCH 6/24] PCI: iproc: Remove redundant error fabrication when device read fails [PATCH 7/24] PCI: mediatek: Remove redundant error fabrication when device read fails [PATCH 8/24] PCI: exynos: Remove redundant error fabrication when device read fails [PATCH 9/24] PCI: histb: Remove redundant error fabrication when device read fails [PATCH 10/24] PCI: kirin: Remove redundant error fabrication when device read fails [PATCH 11/24] PCI: aardvark: Remove redundant error fabrication when device read fails [PATCH 12/24] PCI: mvebu: Remove redundant error fabrication when device read fails [PATCH 13/24] PCI: altera: Remove redundant error fabrication when device read fails [PATCH 14/24] PCI: rcar: Remove redundant error fabrication when device read fails [PATCH 15/24] PCI: rockchip: Remove redundant error fabrication when device read fails [PATCH 16/24] PCI/ERR: Use RESPONSE_IS_PCI_ERROR() to check read from hardware [PATCH 17/24] PCI: vmd: Use RESPONSE_IS_PCI_ERROR() to check read from hardware [PATCH 18/24] PCI: pciehp: Use RESPONSE_IS_PCI_ERROR() to check read from hardware [PATCH 19/24] PCI/DPC: Use RESPONSE_IS_PCI_ERROR() to check read from hardware [PATCH 20/24] PCI/PME: Use RESPONSE_IS_PCI_ERROR() to check read from hardware [PATCH 21/24] PCI: cpqphp: Use RESPONSE_IS_PCI_ERROR() to check read from hardware [PATCH 22/24] PCI: keystone: Use PCI_ERROR_RESPONSE to specify hardware error [PATCH 23/24] PCI: hv: Use PCI_ERROR_RESPONSE to specify hardware read error [PATCH 24/24] PCI: xgene: Use PCI_ERROR_RESPONSE to specify hardware error drivers/pci/access.c | 36 ++++++++-------- drivers/pci/controller/dwc/pci-exynos.c | 4 +- drivers/pci/controller/dwc/pci-keystone.c | 4 +- drivers/pci/controller/dwc/pcie-histb.c | 4 +- drivers/pci/controller/dwc/pcie-kirin.c | 4 +- drivers/pci/controller/pci-aardvark.c | 10 +---- drivers/pci/controller/pci-hyperv.c | 2 +- drivers/pci/controller/pci-mvebu.c | 8 +--- drivers/pci/controller/pci-thunder-ecam.c | 46 +++++++-------------- drivers/pci/controller/pci-thunder-pem.c | 4 +- drivers/pci/controller/pci-xgene.c | 8 ++-- drivers/pci/controller/pcie-altera.c | 4 +- drivers/pci/controller/pcie-iproc.c | 4 +- drivers/pci/controller/pcie-mediatek.c | 11 +---- drivers/pci/controller/pcie-rcar-host.c | 4 +- drivers/pci/controller/pcie-rockchip-host.c | 4 +- drivers/pci/controller/vmd.c | 2 +- drivers/pci/hotplug/cpqphp_ctrl.c | 4 +- drivers/pci/hotplug/pciehp_hpc.c | 10 ++--- drivers/pci/pci.c | 10 ++--- drivers/pci/pcie/dpc.c | 4 +- drivers/pci/pcie/pme.c | 4 +- drivers/pci/probe.c | 10 ++--- include/linux/pci.h | 9 ++++ 24 files changed, 87 insertions(+), 123 deletions(-) -- 2.25.1 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip