Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1432586pxb; Sat, 16 Oct 2021 09:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC4xNUYj+pG8rG0fep5ur9t9JC6H45hQhBkpLbZWHckBDdXXg8MrjpP0h3ZthGU/CCAjWm X-Received: by 2002:a17:906:22c9:: with SMTP id q9mr16667485eja.216.1634402843989; Sat, 16 Oct 2021 09:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634402843; cv=none; d=google.com; s=arc-20160816; b=lOSfZAUtgDJSTEXVYZLWtFl4q81TYEOu9KY1nHp7Ni7tPURcKZuz/6UoYNbb7698Vi 5uMZE4T/gwp/dmh8kDi0UYT3Dmw8tyqg8VDj9wRKTuqVpBj9HzC4FRAEEH8nOuBoQvAR vo/BiMMBuUV3IOrjsKj+oP7U1QpmMU45vb2paUGA3kKbTp3wif/PU/FTuc/c0T9+lIc4 1BTmHoo8BTcKGl6LmIG0iKTZX06SSNnYyX0lYedNJQyK9fPvtMwInAqCdQYxubdpgbd4 DwHDtxY+chT5xGSGmHVgDIMjJYOt3DnLK+/S2RSL8WqFuQ5wcmSg7xHn5cDyOk53cIrl VS4g== 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=oxis35XdZSIgJr6mklaAXMEQHUEVDMfz+GZuoz2m4I8=; b=cpXhoi4Aqmlh7NdG71+Pf36h3V4d0UMoLgc/gJ4ZP1hjboRAdR7LV9HAOMdIfx4SD3 unzFHr/wE07Z1Lj+hPGh7yoSQGlZpcBEl0TTu46Umpx4i9fVCzQKccnXU8xZ7spuzRTU AFt2FZpZ7p0fK3y2LADfma9WIPm2OvF+j7/5Lbhe/3fERKNi1pgiVxGSrnHyntUn2U2d VAFYs8S4nv0Lcia20aJ9UU8yWFwJk9tcfBUxT+6rc74T8heXNvfBFaSL77we2vSdaIRp Pwrra2ZYICt+mj8aLwcQatsJd05fWEYCvAaKugqAgtSTAifhPpRwGO8tBjMSaULLSKVg iAig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bHF3MVmM; 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 v24si12682332ejc.441.2021.10.16.09.46.59; Sat, 16 Oct 2021 09:47: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=bHF3MVmM; 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 S240702AbhJOOrX (ORCPT + 99 others); Fri, 15 Oct 2021 10:47:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240681AbhJOOrW (ORCPT ); Fri, 15 Oct 2021 10:47:22 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6916EC061764; Fri, 15 Oct 2021 07:45:16 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id f5so8792711pgc.12; Fri, 15 Oct 2021 07:45: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=oxis35XdZSIgJr6mklaAXMEQHUEVDMfz+GZuoz2m4I8=; b=bHF3MVmMD4KZ3VipJ6gbsgTAs58lBf7KZekNmTmtHSVziT8Bj5Q4nj6WoGR4JJh1X9 ptoYV/uKzVs7KLN79M4K1dzreOtUNb3OmhKFeQMusup3PG8bmgu8CiNw3FPEYJaSgecw F5KNxdHmHmbQmrDwWHdIJMc7EQMypxSo+ZckstpfprL10QAqD5Wu4hVtllulE6qOjIsU Gre2jphM64b+ETzcdr5HAuHIgCP1bUlletjTOtO96cvW+D60ab9ERHcl8PWksUIWxawH WdMcMIrisLQeK8YuWhXYZGSySNUvCWKsXceWP6SViEtyTw1woJ5paAWojSijJnSA54OM FpUA== 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=oxis35XdZSIgJr6mklaAXMEQHUEVDMfz+GZuoz2m4I8=; b=J9tnTqElRf49xt2KiCAWCSocULQy6ihZtjRmkkndM3TvpsPB/USr5zzzvVAfnm1BaR vraTa58kT91qa39Jg93jLU+ks6elBKoFap3jQRGGlpyyQknaPoz0H4i8XSIBk4qhDMLY dOLeFRgdvZoSogLEtRCvWdgmAhRyuSZZbiOTF+AxTjM/y+L+wMr4ubmR89yysC4gXa+k i/Gg64pNE7yoZqmeII4TlvHsmdGqyyDxJB5gvSHdntt+FzLdlIaJZvK50cAOcOmMyssk G89UeVjT54d/oqLh1SKg3wysAJvi2A7iL8mBAgQdj1QYyDWvPCuzUTU9eer0B6334D6D Qang== X-Gm-Message-State: AOAM532FBJ2wEYhbN1fpUpHMiBuimZcmJSKlkLj1PwPmvY/0UdtIMbch PMZKPlFUYGgUwUGZlBVj4Yg= X-Received: by 2002:a63:f346:: with SMTP id t6mr9505513pgj.345.1634309115853; Fri, 15 Oct 2021 07:45:15 -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.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:45:15 -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, Joyce Ooi , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= Subject: [PATCH v2 13/24] PCI: altera: Remove redundant error fabrication when device read fails Date: Fri, 15 Oct 2021 20:08:54 +0530 Message-Id: <178022540498862f4d16e5738b5d5c1fac008afe.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/pcie-altera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 2513e9363236..a6bdf9aff833 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -510,10 +510,8 @@ static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn, if (altera_pcie_hide_rc_bar(bus, devfn, where)) return PCIBIOS_BAD_REGISTER_NUMBER; - if (!altera_pcie_valid_device(pcie, bus, PCI_SLOT(devfn))) { - *value = 0xffffffff; + if (!altera_pcie_valid_device(pcie, bus, PCI_SLOT(devfn))) return PCIBIOS_DEVICE_NOT_FOUND; - } return _altera_pcie_cfg_read(pcie, bus->number, devfn, where, size, value); -- 2.25.1