Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp722517pxb; Thu, 21 Oct 2021 08:16:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNzz+SQ2QyRqJusX8f9JAoOzxKISJlPl+fuUAtybtK70bLG67ALuE7TixayLeTES0AcNd+ X-Received: by 2002:a17:903:18d:b0:13e:f1ef:d80c with SMTP id z13-20020a170903018d00b0013ef1efd80cmr5771558plg.63.1634829396406; Thu, 21 Oct 2021 08:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634829396; cv=none; d=google.com; s=arc-20160816; b=TylybB31I6ID18nHvlEZEnKOGxwvwbMfjtuWIhlUOqZnWdIpBKoEzyhQka4Lhup0h8 gHwMkKGL4Ow5YboYMlB6FnfBVxe9FVDFDbAgfZjK+RXAlrlP0Tp+wRMWgqGXtr3Fl7Hx 27fFoNuQqNdYxopuSjxe/G0Vao2fEuDU6LmEbOvAC9IJfbUySeEj/RZ1Y5g84ubHpwNY R8OpvRDlZYgrGBcv9BvcvJnXxO2EDiO385knKVcexmEQu1gGlUi5rvwIm1wlZ7VHc/rW RTsClr/xOMa0LTPQKUvapTbd/dAVfEKGRVoOCEiL32ksNJa+RIJPqCXpcYKo+8xZ2+Q7 aZ4g== 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=g4G4Yffk64HxtbjZzw9/E8PSnsLTvUujtQvSwE3J4gU=; b=cV//VVivGeKb31/GQtYlQReA5mJKY2oP8tQ1O83EpR+0TpiyQzeXh7jxj+99NGnkhg eznXq/HioNGcPHd38TSW7TAB6IhbWFIQAI4cwxTzcl4aHrsCACMbq8S9H8IklBkuYzf0 0nmNZAinlTQ1Kb31fk4O3eibrA5zGdmubuVLSIhLlVHgBah4kDVgNNcktttkoT9zssa+ INzv38qFKFsuiJ9uC6fELM75qCx40ghMQKpy++PcloCpF4bRUK6LHSektyi8rS4ePASH 4efv0NFm/hmcG9wHghphd76cT1LEkZxxYd1qN8A8ndYoq24XIlY0RzBcmkk1mRca5HC9 P01g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cI4maM6s; 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 g12si6688635pjl.69.2021.10.21.08.16.18; Thu, 21 Oct 2021 08:16:36 -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=cI4maM6s; 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 S232102AbhJUPQM (ORCPT + 99 others); Thu, 21 Oct 2021 11:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232069AbhJUPPj (ORCPT ); Thu, 21 Oct 2021 11:15:39 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87153C06122C; Thu, 21 Oct 2021 08:13:13 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id f21so645644plb.3; Thu, 21 Oct 2021 08:13: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=g4G4Yffk64HxtbjZzw9/E8PSnsLTvUujtQvSwE3J4gU=; b=cI4maM6sHC3cIMldIjQc1WksuleNIofwFqWYF4hgi1mSUPjEGy/WmXoWahcRKKe5+w j+zLwnck9MFzmr8MftgklxRZ5wNxIbu4G2AheKg9ZMv2lHgNNhGgL2J7UsV3l6gjZExb H4tZgM8wyBorCpeRi921+Tm3u0WVTydBr3Tj3cAhZ9aNPzvoqZ4hpLqS+KH5vxfSS8kl RuDF/0hlWT9G4JzVK0afVRra+EpY2rFrGAa9crTmNU2ssX8sWEbik9C86qDFbaKzhp+l Qiuu1E0eKf6ZEerz3y53kIBw8RH87UqQ0r1zBn0XyLQryf6q11P3qfumh997IU+rjQxH 8n1g== 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=g4G4Yffk64HxtbjZzw9/E8PSnsLTvUujtQvSwE3J4gU=; b=4BEaDgR7WXMTsTe4Hhmh2swoNTEFDsbhCIT0x5j0buBukkAk1fIyEAnqSafCC6pvZu id86LgmFzf+pNx5RvmJ/8Bojrzk/Rdxj2yazemefd6HBhHEQ8PpxEoaQITfuItW/osXE RMTc6vFaMlW0bGk9NBoda7nE6Jc70pxJdEvCguThwZEmMfz/ScZ4ua9N9750SpJAmLD+ me6RUVOSpO+a2IW4E+2y6+Yjpa1hWLvv5ezHhAgwOxemcRzbz3WPmqQl1QI8wXazyOsD 4Cix+I6cHPqbGQXC5o8YbPhi7WXEvHNmbisA/0VEUxvs1AAvmv9E7U4NyTnGIc5ohZys Epog== X-Gm-Message-State: AOAM532gsgqLtreMI6/Hiw4FCDM3XDDG94+aztRg+NQQVbYurGGAoKAI PzOptgrU4rYtj8/SRwMjWgM= X-Received: by 2002:a17:90b:1a87:: with SMTP id ng7mr7478114pjb.69.1634829192977; Thu, 21 Oct 2021 08:13:12 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:29a4:d874:a949:6890:f95f]) by smtp.gmail.com with ESMTPSA id c9sm5508027pgq.58.2021.10.21.08.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:13: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, skhan@linuxfoundation.org, Shawn Lin , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Heiko Stuebner , linux-rockchip@lists.infradead.org (open list:PCIE DRIVER FOR ROCKCHIP), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support) Subject: [PATCH v3 15/25] PCI: rockchip: Remove redundant error fabrication when device read fails Date: Thu, 21 Oct 2021 20:37:40 +0530 Message-Id: <59113f443210c0c4d9d7696b22274c21ec2b7276.1634825082.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/pcie-rockchip-host.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index c52316d0bfd2..45a28880f322 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -221,10 +221,8 @@ static int rockchip_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, { struct rockchip_pcie *rockchip = bus->sysdata; - if (!rockchip_pcie_valid_device(rockchip, bus, PCI_SLOT(devfn))) { - *val = 0xffffffff; + if (!rockchip_pcie_valid_device(rockchip, bus, PCI_SLOT(devfn))) return PCIBIOS_DEVICE_NOT_FOUND; - } if (pci_is_root_bus(bus)) return rockchip_pcie_rd_own_conf(rockchip, where, size, val); -- 2.25.1