Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2045799pxb; Sun, 17 Oct 2021 04:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+WWT2aZ+8G4nlioTwYwAPMqXgTrR3p/w/cInYuCN5u0m2IJkbOxk4F4Ca25V2Fkd9lKkI X-Received: by 2002:a17:907:62a5:: with SMTP id nd37mr21796610ejc.114.1634470500192; Sun, 17 Oct 2021 04:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634470500; cv=none; d=google.com; s=arc-20160816; b=JRpN5ul1rQttMuiAC5Zzp51e2YZqu4LvWteawgxAN/FQbBf99zYiPZifPNRBl5d/vG VtSz3xEHtef2AhsoXXVwc0KnQ4OHZW4qNP/cKC5UwURnOqPVQJ0WNOsqMYeepNa5g1FN ekItRQ4HOWCG3K7RHLXQrY+a5BLpZdfAZ9whXLj84Rq3/JzeKa46iFs5tao0DDEqTnpl wzYVwBslbiLxkDCNFKevrMeAI07erU7uxKK0cmLJEJ0JpvPLPHdRVnZhh9ZoavxocQyA l4ubLDjzHIqLYOV8EkJ98jm8IPOKsIlvA+0orGnNHq2dkalQuxvXLUU595NQ0ukMTlnK 6BRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fgXRhIDv4avAhYWPVKqD4fihMIZxTJmiPhjtzsC9r0g=; b=VypNZliWIXHV6FaSvy3qWuAWXIyRgE2y+koAKtCw3PDsNW41C3UzBt0d5A2ezkep1G 9iTA5a6fQ0aIKKORy64sL8L5BRtx5cZ9L4kBoswH5TL4/tlZZau9SN/QgjmAN56+mrJF dlqzEERGa4ZIXr8qjMqu4NTkD6w7k54Wl6JY7CKHLZKVlN/+OyJj6j5mVZ27NKqm2dGs veJQNklh8fa7NciFsVSOs0JdeL7c7wsSFiML3WLY8N4FfnGFgNxBchDZ6d9B9XTOu6V4 oQd7MWLRFfHnO5Zwat8MknMQpIWn480BIbwHdxLMNrCLJuvTTv19UZpIb7KSYgNqFXLH 2Z8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=blvEzhzR; 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 op27si15274744ejb.723.2021.10.17.04.34.36; Sun, 17 Oct 2021 04:35:00 -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=blvEzhzR; 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 S237843AbhJORIP (ORCPT + 99 others); Fri, 15 Oct 2021 13:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242018AbhJORIK (ORCPT ); Fri, 15 Oct 2021 13:08:10 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71917C061570; Fri, 15 Oct 2021 10:06:04 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id j190so2400539pgd.0; Fri, 15 Oct 2021 10:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fgXRhIDv4avAhYWPVKqD4fihMIZxTJmiPhjtzsC9r0g=; b=blvEzhzRWWIU/TZxsMK2Eh5RErZ/DFjMxSPdwQiUQELylPvjitlEA2KS+l/0PNDtzr gFi1fmsOpzzU4aeTXv4XEqxpYH9pDazJwktWCjuz0XjRoxCe5EyjCehBOyrKoPrpPNOf bzow4Pf69nfg6Gx5qGYdFuBJREmLyx7HNBAh+kT7f+VBGrADy6E4wkuRwy45RVEVVqzz BQdC2+yD2vCj0tKEqeqjsiv2EFoP2VOmUfPwTklwkp0Qjytc5RA9so9uZMXn8TImDK4M zKRA+NbzDx8cfy76+2szt6uqCWVJcGZn0Ob4I7HnaZfoCou6N6B6jJ2eqNZcbEPMnXJZ 5PPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fgXRhIDv4avAhYWPVKqD4fihMIZxTJmiPhjtzsC9r0g=; b=SRz+hpFFfLUC0iBsU2oqHImg2LBtdAiMJIKwY6g3VdVnyxGWTwmtO86nFRuX754i8V in/OgoKrfRGyvKglrrUVYKF2oCqZv3LLykmvE7pXTkcbRlwErf3bf2Y2/3v0/2CTGXw1 9AFCPL0hQAzhEmoojTun3acy0TIZyCdsRsoMQThBYDjJ6jW+Kf7+zVJ6msOCgxg6yMYm oow4fly1Rl+SoXGAVUgiPCWmfQhmMUmK5+VnlZOPo6hvZ23G9cSu6Wfd958XQjUsSnuj lO8iiPVfvQkMIohPE0RhIqsAqWbBBbUD30VyzxTWNAVjGGCqPc226L8+raSYdtCp4dYP P3sw== X-Gm-Message-State: AOAM531RnSSD4vYASq/VBb+j9NUy9iUs19lQqZdPwJv+NymLYMGKVzVB QHo1sDeN6XZiv7i5A2GK9jg= X-Received: by 2002:a63:1a1b:: with SMTP id a27mr9985068pga.220.1634317563746; Fri, 15 Oct 2021 10:06:03 -0700 (PDT) Received: from theprophet ([2406:7400:63:4806:ba0d:a155:7e81:f0b2]) by smtp.gmail.com with ESMTPSA id m22sm5376221pfo.71.2021.10.15.10.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 10:06:03 -0700 (PDT) Date: Fri, 15 Oct 2021 22:35:52 +0530 From: Naveen Naidu To: Ray Jui Cc: bhelgaas@google.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Ray Jui , Scott Branden , "maintainer:BROADCOM IPROC ARM ARCHITECTURE" , "moderated list:BROADCOM IPROC ARM ARCHITECTURE" Subject: Re: [PATCH v2 06/24] PCI: iproc: Remove redundant error fabrication when device read fails Message-ID: <20211015170552.kl2unzbynygvw3lv@theprophet> References: <71757601a719e2ff6ca27615183e322a7709ff65.1634306198.git.naveennaidu479@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/10, Ray Jui wrote: > > > On 10/15/2021 7:38 AM, Naveen Naidu wrote: > > 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-iproc.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c > > index 30ac5fbefbbf..e3d86416a4fb 100644 > > --- a/drivers/pci/controller/pcie-iproc.c > > +++ b/drivers/pci/controller/pcie-iproc.c > > @@ -659,10 +659,8 @@ static int iproc_pci_raw_config_read32(struct iproc_pcie *pcie, > > void __iomem *addr; > > > > addr = iproc_pcie_map_cfg_bus(pcie, 0, devfn, where & ~0x3); > > - if (!addr) { > > - *val = ~0; > > + if (!addr) > > return PCIBIOS_DEVICE_NOT_FOUND; > > - } > > > > *val = readl(addr); > > > > > > I think it would be helpful if you include us in the review of the PCI > core code change (pci.h and access.c) so we get the right context to > review this change at the individual driver level. > I apologize for the rookie mistake ^^', I'll see to it from next time that I always add proper recepients to the patches so that everyone gets enough context. > The driver change looks fine to me, as long as the change in the core is > reviewed and approved. > Thank you very much for taking the time to review it. > Thanks, > > Ray