Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1417420pxb; Sat, 16 Oct 2021 09:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi0ZZyDbAeqdnq1VE0jXN/vZvQ7ye2N1huZrKnuVnhijoi8asUHr9OcOeLI88BKi83TJR/ X-Received: by 2002:a17:906:fad8:: with SMTP id lu24mr16327961ejb.133.1634401463664; Sat, 16 Oct 2021 09:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634401463; cv=none; d=google.com; s=arc-20160816; b=NBBOHOInQMV97opfI6ToDq9FVifTHvFXF1pSKdR98/Y6UPdD2tNUgoTSdL/2Bkn2Xw vxL4K4zYFpW3q+iJ70zSpJ+zxr3eCfV6KmmdwlOmIUoEOFhj8UrTqNE/6CFqiy1wAV04 M5xcJ7pYmbwGr++sViozRzeSSAzT4wNkQsBXkb3YFmkK4jv3GLAA7CkbtChqmCU6jSay vxJGK3sBJjXRwh2qKMnxsS0hu+skdQjnr7ONmnWFK/99uBU8rEs4Sw++hcAy1xHXtQ4a NULJvy9GodYXIdvSXwFz0Lz6YTSg4tYuOKXdjW7QJO8ILL25wpovh6qIuyUJcg3E1rGT Chcg== 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=ldCoPF9oxZH7/MigxipjFPAj1P91oCyhQC/cTDGjKcc=; b=NQr/aPAiRqb+gYOLZ+pHZ7Tl2klFHoo4eFTnoj5D1eyhJI1hPpddDJ55iu2Q906Lwo VopXarMIN2pBig/9sj8RKboMYASwwlww71+PDCfLQGfoyLbeixg/F0GjFFxeblOkZ/CB JiDnru3BhvkepPV9yytJ/6HTXyNBb9uX3qkP8TlhPfvYIhWH7j4aN4MA8ZrNTr9GSsb0 A3q/ESlNOvj3YwuTTRTYHFiw1BCzNWjoTI5A7pk/cT6Oy5k0elGOdLW6vwJHXzIN+KEu PLktSZZeuSwvV1EdlGDMDVMLowsH/qxcJYbytt15h19M+5BrxdtrD5zbatq4A01ZI6hL P28Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OouScJo8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si13450348edd.589.2021.10.16.09.23.57; Sat, 16 Oct 2021 09:24:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OouScJo8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240653AbhJOOq0 (ORCPT + 99 others); Fri, 15 Oct 2021 10:46:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232140AbhJOOq0 (ORCPT ); Fri, 15 Oct 2021 10:46:26 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFD8EC061570; Fri, 15 Oct 2021 07:44:19 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id ls14-20020a17090b350e00b001a00e2251c8so7410207pjb.4; Fri, 15 Oct 2021 07:44:19 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=ldCoPF9oxZH7/MigxipjFPAj1P91oCyhQC/cTDGjKcc=; b=OouScJo8ja/pvkJtRdlEZQtihBai8aqlCVtV47g3ith2pLVFv5EggIkWjSQWXjBLiy bR69cFniJIc7JI+EN7zvxDMqjH/wbKmOYW1/ir5pvriC6V7njh5I9OPvIL5ioktJbzlH nzNOREwfyuzcCPSkEHB4vY+kVvH7aeG7MGiC2upZxQeYtJTrT8INkJbYhzm7x1JqU0AU +c9lMyAhN1HtAvEnyk0sKpqvlJ1PaVFxM+6hK6+INVKviS7s5nUuKJDLMOvqhDq0rM2x N9kHtFZgO1ChtjMAz4XLU1nM0VZHmvwZURWHw8W3/8YdPGAI8H2MOo69KwX0vCgytfH3 G5dg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ldCoPF9oxZH7/MigxipjFPAj1P91oCyhQC/cTDGjKcc=; b=zeAMN6Iz2DllqtHnWWRMB3hQK0hftYdY2nX/xyP8XNTSSeizmaYIQ8pwnr0Wa8RGvS vG2DzoVaqt9LHKMvxyfdNmywn7Q0Kzut7GSnRjDL0Kby8Qm0z6wr07i3gn7RjXd49Kzs q8zsEZH07913pGiXoIzXCIZ73gN5ID40QSAJSgqjzRSnJKPzbbdCTSNGXfEJH/LQB51v Aup2ueRSW4B4D9y8cutydXsTk2hJ2GLFYtuBlQHsXAJ+h4M1B1buxMst8IXbtX8UXf9R TfZtwxYvS5UPEiSnO+0hNaAcA+NyGAJJtxQdsuMaXAhmCHPAWaND5vgQbwRYrSJ4jxLH 7mXw== X-Gm-Message-State: AOAM532PtjGlAn4H/wLsskOIwWt+wyZrEXXK3yNbcAOSR9gFt8dg+W/T gAPykx+ggmtlCi19OlIbENA= X-Received: by 2002:a17:90a:e7c8:: with SMTP id kb8mr13809594pjb.95.1634309059387; Fri, 15 Oct 2021 07:44:19 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:4806:9a51:7f4b:9b5c:337a]) by smtp.gmail.com with ESMTPSA id f18sm5293491pfa.60.2021.10.15.07.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:44:19 -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, Xiaowei Song , Binghui Wang , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= Subject: [PATCH v2 10/24] PCI: kirin: Remove redundant error fabrication when device read fails Date: Fri, 15 Oct 2021 20:08:51 +0530 Message-Id: <9ccf6dd66a61b3889eddb36b0713ad5d65bf4744.1634306198.git.naveennaidu479@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. The host controller drivers sets the error response values (~0) and returns an error when faulty hardware read occurs. But the error response value (~0) is already being set in PCI_OP_READ and PCI_USER_READ_CONFIG whenever a read by host controller driver fails. Thus, it's no longer necessary for the host controller drivers to fabricate any error response. This helps unify PCI error response checking and make error check consistent and easier to find. Signed-off-by: Naveen Naidu --- drivers/pci/controller/dwc/pcie-kirin.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c index 026fd1e42a55..56ccc5ceee50 100644 --- a/drivers/pci/controller/dwc/pcie-kirin.c +++ b/drivers/pci/controller/dwc/pcie-kirin.c @@ -330,10 +330,8 @@ static int kirin_pcie_rd_own_conf(struct pci_bus *bus, unsigned int devfn, { struct dw_pcie *pci = to_dw_pcie_from_pp(bus->sysdata); - if (PCI_SLOT(devfn)) { - *val = ~0; + if (PCI_SLOT(devfn)) return PCIBIOS_DEVICE_NOT_FOUND; - } *val = dw_pcie_read_dbi(pci, where, size); return PCIBIOS_SUCCESSFUL; -- 2.25.1