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 05E8EC433F5 for ; Fri, 15 Oct 2021 14:27:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D43EC611C8 for ; Fri, 15 Oct 2021 14:27:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237152AbhJOO3U (ORCPT ); Fri, 15 Oct 2021 10:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236991AbhJOO3T (ORCPT ); Fri, 15 Oct 2021 10:29:19 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7640EC061570; Fri, 15 Oct 2021 07:27:13 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id q19so8512507pfl.4; Fri, 15 Oct 2021 07:27:13 -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=mW0YwkEYI+SkJyiLxlQX3Zdlu5EyWW8zMrdZ1/82zOBc94fM7nZ5imuO8lI0tb5Mlc GJX5XvSWu1L0mHI8nSrIRx+Do7SdcoiQJmua/qyhISbG1tvsgGAtKU2iaSZvTJBb65H4 yybCzMgblNgOoHva0cf/tJmCf6kFhrzB7ImRJELkl+97pLZdPXanfD/7ui3T8inIbbwi STKVz/5qY9Dvta4IbwFgUI2HPfp+DgGS87+bamOPu7vRmCtOakuf4SGBbo8DvAGhvNNk uMToZ3PnjDxeoU2qn1wjU0aa9BC12o3ATwUQxwGE8QbXhHsGamQhQZz4miZcGUh7D1CO yNxQ== 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=t+tsIz5+Sg24GgOjSMYuazAyocM0enmt56f/QyIuHyye3njOijxqubLJIgPLZEfN47 /nbEQ+NCwSbqMfvDydQbfqYAaWKIImvC/FqRBy1zwyTyaAQfEiVgyIJ9g6Un1cAUIqx7 t4mcg+yMvP6phnCJJzf0mJrZDJ6/RCxup9JM90eMZGQaBdwC1Z48uHQ3XqVE1g2gBiQU /Ez6Z3hpgxf8e0u3M/CpX6BnSC8deC+gmb/G0mhK6Qo3jKKFpg8iF2psm+6/bsbDQYZ5 xXz4NWuiCBArVMKdRoe8alK+XP44OtbpnAutK4VtfkHUBzap7XWyzBsEH+MSn2GyC94Y wzSg== X-Gm-Message-State: AOAM531rLPG7JSs5VTJm27dTrwKTHPg+QUp9V+wUE+UfC7LCfG5FaYoS kejn+XzrY/QSdjSwRZBF0Io= X-Google-Smtp-Source: ABdhPJxFKApjvWHOznC1si5BoWluKZQ8jEGESoKMvikMsJGlwrW7cHZUum4j158SdHMlbo9VkZ0e4A== X-Received: by 2002:a62:ab17:0:b0:44c:f727:98cd with SMTP id p23-20020a62ab17000000b0044cf72798cdmr12077120pff.35.1634308032813; Fri, 15 Oct 2021 07:27:12 -0700 (PDT) Received: from localhost.localdomain ([2405:204:5414:a8c0:67be:6f68:5d31:1ee2]) by smtp.gmail.com with ESMTPSA id ls7sm5408396pjb.16.2021.10.15.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:27:12 -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 19:56:31 +0530 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.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 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 79D47C433F5 for ; Fri, 15 Oct 2021 14:27:17 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 1AC98610E5 for ; Fri, 15 Oct 2021 14:27:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1AC98610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D9FB560785; Fri, 15 Oct 2021 14:27:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5kb9a6bhGeVo; Fri, 15 Oct 2021 14:27:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id DB5216076B; Fri, 15 Oct 2021 14:27:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BD6E0C000F; Fri, 15 Oct 2021 14:27:15 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id DFB75C000D for ; Fri, 15 Oct 2021 14:27:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C7D1B4075E for ; Fri, 15 Oct 2021 14:27:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aQbfyyEgHsPp for ; Fri, 15 Oct 2021 14:27:13 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8991A40755 for ; Fri, 15 Oct 2021 14:27:13 +0000 (UTC) Received: by mail-pf1-x42a.google.com with SMTP id m14so8486276pfc.9 for ; Fri, 15 Oct 2021 07:27:13 -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=mW0YwkEYI+SkJyiLxlQX3Zdlu5EyWW8zMrdZ1/82zOBc94fM7nZ5imuO8lI0tb5Mlc GJX5XvSWu1L0mHI8nSrIRx+Do7SdcoiQJmua/qyhISbG1tvsgGAtKU2iaSZvTJBb65H4 yybCzMgblNgOoHva0cf/tJmCf6kFhrzB7ImRJELkl+97pLZdPXanfD/7ui3T8inIbbwi STKVz/5qY9Dvta4IbwFgUI2HPfp+DgGS87+bamOPu7vRmCtOakuf4SGBbo8DvAGhvNNk uMToZ3PnjDxeoU2qn1wjU0aa9BC12o3ATwUQxwGE8QbXhHsGamQhQZz4miZcGUh7D1CO yNxQ== 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=bSyxnAENVmRzonWaAsupEdjqwRpxcvMKCiVuz1z99AfmENOgzLmCcXFRQYvBBhjA8A gNi+M1mRQgqB/n42aPbQQ2udrntTjuXxBHjhwNy4dhwJzx8SjVJz+xrYqftZiAl2hcHm SZaPUlFWfWnmY4JI0LvHcKJuNjJgg7ARjefK/sFVGidf6MG94VvDISVRW/aLno3ZQApO ZiivPwOgL42H/G9N4eGHD97oiEgU2xWrYki9tO+KHVKvG41eV9mw1B4QufFcICo4AVmH PiFapf5J3PeapzP7ICV9YIcrExNcGz8AhqYNdyd0DXh3ArcOmJZJ5NG8xUZ6Sy8t/PHK JiQQ== X-Gm-Message-State: AOAM531tZXi51Zuj1WxwfDL5Sv1lfKAJZzPDfN5oUe/I1laEtkTissAI zFTwsXcjeXMQH0ZQONcoCxg= X-Google-Smtp-Source: ABdhPJxFKApjvWHOznC1si5BoWluKZQ8jEGESoKMvikMsJGlwrW7cHZUum4j158SdHMlbo9VkZ0e4A== X-Received: by 2002:a62:ab17:0:b0:44c:f727:98cd with SMTP id p23-20020a62ab17000000b0044cf72798cdmr12077120pff.35.1634308032813; Fri, 15 Oct 2021 07:27:12 -0700 (PDT) Received: from localhost.localdomain ([2405:204:5414:a8c0:67be:6f68:5d31:1ee2]) by smtp.gmail.com with ESMTPSA id ls7sm5408396pjb.16.2021.10.15.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:27:12 -0700 (PDT) From: Naveen Naidu To: bhelgaas@google.com Subject: [PATCH v2 00/24] Unify PCI error response checking Date: Fri, 15 Oct 2021 19:56:31 +0530 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: Rob Herring , linux-hyperv@vger.kernel.org, linux-samsung-soc@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , linux-rockchip@lists.infradead.org, linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" 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-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees 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 37F4DC433F5 for ; Fri, 15 Oct 2021 14:33:04 +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 EF13D60E09 for ; Fri, 15 Oct 2021 14:33:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EF13D60E09 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=s8zuRVghnKYtL4IkRzschPDXzXsd3Y2APTJYNssim80=; b=L+xphcRTk92A1y dhtowWdFtN7+pdQo9POwTqih4VehZ2Wg8AeZE2RoJe1NlAgulorDO9sR3uquqbq01QExARwPraOrQ Bt2U8tAsuMMTZXzPz6CdiP/i90lpipF8pASzyfHriu7i5JHB+Yxe+qNR3e9aPrLr6N/7mwN6SynTY Sgt7kbYbO1pdWOZDzjE2v4r6reMMGV6s+wZ6f4aiZP9qzyU6tzE+B6YrtedRMcfkrt6fBA/94sTpn iizU7gwmwdBlGcCf3/W7GiAadKodFcsga6t+IpF552nrZPjgj9EhxT6xr71dR3KtU2UtHnUI/1IGY oOb/uoW/k8XnhLz/CWow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOGQ-007cyw-S1; Fri, 15 Oct 2021 14:32:50 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOB0-007aaT-Us; Fri, 15 Oct 2021 14:27:17 +0000 Received: by mail-pf1-x434.google.com with SMTP id 187so8484345pfc.10; Fri, 15 Oct 2021 07:27:13 -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=mW0YwkEYI+SkJyiLxlQX3Zdlu5EyWW8zMrdZ1/82zOBc94fM7nZ5imuO8lI0tb5Mlc GJX5XvSWu1L0mHI8nSrIRx+Do7SdcoiQJmua/qyhISbG1tvsgGAtKU2iaSZvTJBb65H4 yybCzMgblNgOoHva0cf/tJmCf6kFhrzB7ImRJELkl+97pLZdPXanfD/7ui3T8inIbbwi STKVz/5qY9Dvta4IbwFgUI2HPfp+DgGS87+bamOPu7vRmCtOakuf4SGBbo8DvAGhvNNk uMToZ3PnjDxeoU2qn1wjU0aa9BC12o3ATwUQxwGE8QbXhHsGamQhQZz4miZcGUh7D1CO yNxQ== 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=Ta18B5JfVt0N+68883ddT7sepJxocas6lqAaelSjnu1xd83ZjfaEULkNVeMZZewWvq n5asFHtiP8xV5JdstxuaQ85h9T/ZUqdrQV5h2uimU1rZFkg2qPk9W8CYkBnGj7qWhaMD QIcLI4DjWI3vStirQrdThWFKvScJcP3GWisDGI1MgOiTicnLFo0kVUirkhxRjgN7cBip ZVlcrss/Hu9pmUJJ1U39ULzbMVi+ubWCp9FF7jLtPJHNi1xDZtw4nMOAng1jQr20wpnG kgEeBnfOTJpb+TieqFbv2pnA1eiAvWJfzwuw9cz2r736CB4X+TyHhJGHqlnhTiboIG2u DdGw== X-Gm-Message-State: AOAM532LNawnWau73p+OPvnyxhR8L+Wa/Gmfs/CaXzyAos7LBXnChqtr /keP0L95z36WM+4LNIS9DAjwfbK23p6D4/nc X-Google-Smtp-Source: ABdhPJxFKApjvWHOznC1si5BoWluKZQ8jEGESoKMvikMsJGlwrW7cHZUum4j158SdHMlbo9VkZ0e4A== X-Received: by 2002:a62:ab17:0:b0:44c:f727:98cd with SMTP id p23-20020a62ab17000000b0044cf72798cdmr12077120pff.35.1634308032813; Fri, 15 Oct 2021 07:27:12 -0700 (PDT) Received: from localhost.localdomain ([2405:204:5414:a8c0:67be:6f68:5d31:1ee2]) by smtp.gmail.com with ESMTPSA id ls7sm5408396pjb.16.2021.10.15.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:27:12 -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 19:56:31 +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_072715_090170_32ECA80B X-CRM114-Status: GOOD ( 17.51 ) X-BeenThere: linux-mediatek@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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 C494AC433F5 for ; Fri, 15 Oct 2021 14:32:58 +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 8D12A60E09 for ; Fri, 15 Oct 2021 14:32:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D12A60E09 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=uMCZWlAesjEMQy XNUYeRfhNuOhaeRsA/tNAIhCq1Fzn9+9wzZNoYgOoZGSqA2fm3DmDm7F4arwiqJtzkueLwj5wWmP6 VYijVPW+P8rzb1cHZA63658zN80sVXcE2FTM0Ifdf6vWA3Yl9egMXkl4/+lBEanxMEvxw1H+zATsB an4iKOU4E+/6znScPPdhrLZ2bY/3RRfJja+rRRmijZSHmvMhq7RwSARi8cJWn6dxAGtsjCU0GGsJG T76n5uuY7rqGBzkMNZKIChI7zeRH+UWIazHjp8TDagUuWUX5wYBkaYDrkln6f02ckuONaXhqEk/JG oR9Lb7DeAxZ2xM6YiIdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOGV-007d0V-Af; Fri, 15 Oct 2021 14:32:55 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOB0-007aaT-Us; Fri, 15 Oct 2021 14:27:17 +0000 Received: by mail-pf1-x434.google.com with SMTP id 187so8484345pfc.10; Fri, 15 Oct 2021 07:27:13 -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=mW0YwkEYI+SkJyiLxlQX3Zdlu5EyWW8zMrdZ1/82zOBc94fM7nZ5imuO8lI0tb5Mlc GJX5XvSWu1L0mHI8nSrIRx+Do7SdcoiQJmua/qyhISbG1tvsgGAtKU2iaSZvTJBb65H4 yybCzMgblNgOoHva0cf/tJmCf6kFhrzB7ImRJELkl+97pLZdPXanfD/7ui3T8inIbbwi STKVz/5qY9Dvta4IbwFgUI2HPfp+DgGS87+bamOPu7vRmCtOakuf4SGBbo8DvAGhvNNk uMToZ3PnjDxeoU2qn1wjU0aa9BC12o3ATwUQxwGE8QbXhHsGamQhQZz4miZcGUh7D1CO yNxQ== 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=Ta18B5JfVt0N+68883ddT7sepJxocas6lqAaelSjnu1xd83ZjfaEULkNVeMZZewWvq n5asFHtiP8xV5JdstxuaQ85h9T/ZUqdrQV5h2uimU1rZFkg2qPk9W8CYkBnGj7qWhaMD QIcLI4DjWI3vStirQrdThWFKvScJcP3GWisDGI1MgOiTicnLFo0kVUirkhxRjgN7cBip ZVlcrss/Hu9pmUJJ1U39ULzbMVi+ubWCp9FF7jLtPJHNi1xDZtw4nMOAng1jQr20wpnG kgEeBnfOTJpb+TieqFbv2pnA1eiAvWJfzwuw9cz2r736CB4X+TyHhJGHqlnhTiboIG2u DdGw== X-Gm-Message-State: AOAM532LNawnWau73p+OPvnyxhR8L+Wa/Gmfs/CaXzyAos7LBXnChqtr /keP0L95z36WM+4LNIS9DAjwfbK23p6D4/nc X-Google-Smtp-Source: ABdhPJxFKApjvWHOznC1si5BoWluKZQ8jEGESoKMvikMsJGlwrW7cHZUum4j158SdHMlbo9VkZ0e4A== X-Received: by 2002:a62:ab17:0:b0:44c:f727:98cd with SMTP id p23-20020a62ab17000000b0044cf72798cdmr12077120pff.35.1634308032813; Fri, 15 Oct 2021 07:27:12 -0700 (PDT) Received: from localhost.localdomain ([2405:204:5414:a8c0:67be:6f68:5d31:1ee2]) by smtp.gmail.com with ESMTPSA id ls7sm5408396pjb.16.2021.10.15.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:27:12 -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 19:56:31 +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_072715_090170_32ECA80B 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 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 5ADF0C433FE for ; Fri, 15 Oct 2021 14:28:02 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 A9A50610E5 for ; Fri, 15 Oct 2021 14:28:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A9A50610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HW7sW5D29z3cBq for ; Sat, 16 Oct 2021 01:27:59 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=mW0YwkEY; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::42f; helo=mail-pf1-x42f.google.com; envelope-from=naveennaidu479@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=mW0YwkEY; dkim-atps=neutral Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HW7rj023fz2yMV for ; Sat, 16 Oct 2021 01:27:16 +1100 (AEDT) Received: by mail-pf1-x42f.google.com with SMTP id m26so8516057pff.3 for ; Fri, 15 Oct 2021 07:27:16 -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=mW0YwkEYI+SkJyiLxlQX3Zdlu5EyWW8zMrdZ1/82zOBc94fM7nZ5imuO8lI0tb5Mlc GJX5XvSWu1L0mHI8nSrIRx+Do7SdcoiQJmua/qyhISbG1tvsgGAtKU2iaSZvTJBb65H4 yybCzMgblNgOoHva0cf/tJmCf6kFhrzB7ImRJELkl+97pLZdPXanfD/7ui3T8inIbbwi STKVz/5qY9Dvta4IbwFgUI2HPfp+DgGS87+bamOPu7vRmCtOakuf4SGBbo8DvAGhvNNk uMToZ3PnjDxeoU2qn1wjU0aa9BC12o3ATwUQxwGE8QbXhHsGamQhQZz4miZcGUh7D1CO yNxQ== 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=0MaI82CDa6HIe7Ev+E/bwbLer6B5cNVm+k+g3rlr8TV+EIsEiJGqn/4ybWwZkA9aAZ zQbHs+c2dCuboLQ3rpUxerms2i/2BvIdjSt+QW38i485vuCd5nUXVuU1meyGWBuPnk65 LjIR5C/pDXd9Oj9hzWdX3OrleYI8thrB+gqvBTljBJ61WgJMzID//av7DpfDOtsl00Wt LpuDnVricBCpXQVBI/nc9TQqxvGHzuIDFL9U7gp+ZLsHKhRhHgZX+++/RZwvDBx/yC7g mRBVmczTq2oF+i13gjb372P7b2kv3QuDAVayIKe0ZDBXPAfrtyTNq7Ry+vgRI8wxdQ7d oJ0A== X-Gm-Message-State: AOAM530bovujdzD2Aat8rtJxggCfb0a/KyJ65MToVYfiKUNUSmdTgoPo J1cN8Vj4l64W2bdonHb+Ezs= X-Google-Smtp-Source: ABdhPJxFKApjvWHOznC1si5BoWluKZQ8jEGESoKMvikMsJGlwrW7cHZUum4j158SdHMlbo9VkZ0e4A== X-Received: by 2002:a62:ab17:0:b0:44c:f727:98cd with SMTP id p23-20020a62ab17000000b0044cf72798cdmr12077120pff.35.1634308032813; Fri, 15 Oct 2021 07:27:12 -0700 (PDT) Received: from localhost.localdomain ([2405:204:5414:a8c0:67be:6f68:5d31:1ee2]) by smtp.gmail.com with ESMTPSA id ls7sm5408396pjb.16.2021.10.15.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:27:12 -0700 (PDT) From: Naveen Naidu To: bhelgaas@google.com Subject: [PATCH v2 00/24] Unify PCI error response checking Date: Fri, 15 Oct 2021 19:56:31 +0530 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , linux-hyperv@vger.kernel.org, linux-samsung-soc@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , linux-rockchip@lists.infradead.org, linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Naveen Naidu , linux-mediatek@lists.infradead.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 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 5D6C3C433F5 for ; Fri, 15 Oct 2021 14:33:33 +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 2C88E61090 for ; Fri, 15 Oct 2021 14:33:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C88E61090 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=HOe80m/6f64QKAVdwHjWN8kp+598QJXHrgti8oED+LQ=; b=SW5mkESodJtxQ5 TnNylQrh8M8wEEJDa5EIdiKQUUfcIwScUXeU9Jja395kbKkTEtkexVS6XQ40PKZYx+5jAS9u+/Cy6 KwSw17IEFRx746yaDnZVeCDnjqRjofk4vXwwm1etnvoq84EGPVka52ljeX1x9TSYNYMtMYMJeKvP1 QDa9IJ/+q6igen6fTZvDPONUq+Vkz+yTSa+739ClePcDf4O4M2O9ke1vwUKW70isisZs+ualA6d3A icV113BbkAB3qeyPg7K45Th7ka6Mb+i2EX9y+8Naxl6TTM1aSbcpUEMS5gGeKgD+xUSsdQKRr14Su SOToYjQQWdoTXfFmELkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOFM-007cUe-4V; Fri, 15 Oct 2021 14:31:46 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOB0-007aaT-Us; Fri, 15 Oct 2021 14:27:17 +0000 Received: by mail-pf1-x434.google.com with SMTP id 187so8484345pfc.10; Fri, 15 Oct 2021 07:27:13 -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=mW0YwkEYI+SkJyiLxlQX3Zdlu5EyWW8zMrdZ1/82zOBc94fM7nZ5imuO8lI0tb5Mlc GJX5XvSWu1L0mHI8nSrIRx+Do7SdcoiQJmua/qyhISbG1tvsgGAtKU2iaSZvTJBb65H4 yybCzMgblNgOoHva0cf/tJmCf6kFhrzB7ImRJELkl+97pLZdPXanfD/7ui3T8inIbbwi STKVz/5qY9Dvta4IbwFgUI2HPfp+DgGS87+bamOPu7vRmCtOakuf4SGBbo8DvAGhvNNk uMToZ3PnjDxeoU2qn1wjU0aa9BC12o3ATwUQxwGE8QbXhHsGamQhQZz4miZcGUh7D1CO yNxQ== 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=Ta18B5JfVt0N+68883ddT7sepJxocas6lqAaelSjnu1xd83ZjfaEULkNVeMZZewWvq n5asFHtiP8xV5JdstxuaQ85h9T/ZUqdrQV5h2uimU1rZFkg2qPk9W8CYkBnGj7qWhaMD QIcLI4DjWI3vStirQrdThWFKvScJcP3GWisDGI1MgOiTicnLFo0kVUirkhxRjgN7cBip ZVlcrss/Hu9pmUJJ1U39ULzbMVi+ubWCp9FF7jLtPJHNi1xDZtw4nMOAng1jQr20wpnG kgEeBnfOTJpb+TieqFbv2pnA1eiAvWJfzwuw9cz2r736CB4X+TyHhJGHqlnhTiboIG2u DdGw== X-Gm-Message-State: AOAM532LNawnWau73p+OPvnyxhR8L+Wa/Gmfs/CaXzyAos7LBXnChqtr /keP0L95z36WM+4LNIS9DAjwfbK23p6D4/nc X-Google-Smtp-Source: ABdhPJxFKApjvWHOznC1si5BoWluKZQ8jEGESoKMvikMsJGlwrW7cHZUum4j158SdHMlbo9VkZ0e4A== X-Received: by 2002:a62:ab17:0:b0:44c:f727:98cd with SMTP id p23-20020a62ab17000000b0044cf72798cdmr12077120pff.35.1634308032813; Fri, 15 Oct 2021 07:27:12 -0700 (PDT) Received: from localhost.localdomain ([2405:204:5414:a8c0:67be:6f68:5d31:1ee2]) by smtp.gmail.com with ESMTPSA id ls7sm5408396pjb.16.2021.10.15.07.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:27:12 -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 19:56:31 +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_072715_090170_32ECA80B X-CRM114-Status: GOOD ( 17.51 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel