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 76869C433F5 for ; Fri, 15 Oct 2021 17:06:08 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 0D8AA60F25 for ; Fri, 15 Oct 2021 17:06:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D8AA60F25 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 smtp4.osuosl.org (Postfix) with ESMTP id C4BE040687; Fri, 15 Oct 2021 17:06:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 rPbNof4_I6rW; Fri, 15 Oct 2021 17:06:07 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id D79164075E; Fri, 15 Oct 2021 17:06:06 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BA9C7C000F; Fri, 15 Oct 2021 17:06:06 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8C7ABC000D for ; Fri, 15 Oct 2021 17:06:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 66E584041E for ; Fri, 15 Oct 2021 17:06:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p-KaiXbirQ4l for ; Fri, 15 Oct 2021 17:06:04 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by smtp2.osuosl.org (Postfix) with ESMTPS id 8EEE2400BB for ; Fri, 15 Oct 2021 17:06:04 +0000 (UTC) Received: by mail-pg1-x535.google.com with SMTP id s136so5897372pgs.4 for ; 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=d/OZSPp/fOGpWIelu8WrRmhGL+iFLKzhIVFdvstFLHqirgbpLWjTLTPzJSg79Az63h wALcKQtojiYCd58tFA2zm2bCQJKtOLvlk/7i6kmrEGg6EPjKRU9SDF/c9m89vEUlKXK5 8HWcqXwJZChh18kleLQaZ+w+YRjiB6WbsIetVIGlEfYqM2YpzPT283y90XsEmht0bNjG IAoe2oS7FhUX0B1n6fNknzBJcJJTWEPZMt0tkYFIAlzLutQ3m2XEeThHMf7DAsSU2THk nrxvcHy++Lv6uAG7O15Fwo1hgsle69YVh3OGr10ynl+WH5LVkWQY7ENc3NRFrfuqjMSr Ob1g== X-Gm-Message-State: AOAM532lwOFLyR584gBU7wN8Rs7RO1ZxTCls2PsU3C1rrLwrHXUi/Hd2 qoArDkysZthO05YoPAcb3aKjZ2nRJ9gcgDuy X-Google-Smtp-Source: ABdhPJwm9rJNVdj0Qh6+rCPdEpEM9SAT0p+nmVQMRFCjROXihNP69pqeyY8uGOfEu5PUiAhQgGi4Hw== 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 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-Disposition: inline In-Reply-To: Cc: Rob Herring , Lorenzo Pieralisi , Scott Branden , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, "maintainer:BROADCOM IPROC ARM ARCHITECTURE" , Ray Jui , bhelgaas@google.com, linux-kernel-mentees@lists.linuxfoundation.org, "moderated list:BROADCOM IPROC ARM ARCHITECTURE" 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" 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 _______________________________________________ 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 B65B9C4332F for ; Fri, 15 Oct 2021 17:06:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93D1460F25 for ; Fri, 15 Oct 2021 17:06:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237893AbhJORIQ (ORCPT ); Fri, 15 Oct 2021 13:08:16 -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-Google-Smtp-Source: ABdhPJwm9rJNVdj0Qh6+rCPdEpEM9SAT0p+nmVQMRFCjROXihNP69pqeyY8uGOfEu5PUiAhQgGi4Hw== 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 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 02C96C433EF for ; Fri, 15 Oct 2021 17:11:37 +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 BB8B5610E8 for ; Fri, 15 Oct 2021 17:11:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BB8B5610E8 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wGIGHoR2JhXNxUmj+1nih0WHkdpj+HKeBFWlzgsgvtE=; b=IIGRLgBQbN4rgr Tt9cgYhSbnadJaZ94THU7m4gg/wLRvP+4WbA/iLBfi9xvdGh1sR3yirtFBLbVtGyGLcHNhXtGbZ9+ bqAdlmThWcPqOHViYGMh4uW9OdxTXK3EGFLKlGHuEBYKm/XuSsOL7POeue1I47H5HoqqOnku6aV1j HeqR7DtDRhAE7KHgNb6PFztVoy5QYgUNGA8sfDRueIXyrf87s1UsiPQSt7eVetvxNfPLy85nOyel2 +TVe1snQITh7EJfLVayYiw0LSKLujSVEIKJbdKUIuzFLGPrdmoQXBRihv1vCVZI2DLK7rq5XvgPCh 4xQXpq2jOp7W0tn3yEPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbQi1-008FW0-8e; Fri, 15 Oct 2021 17:09:30 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbQei-008Ekj-Kw for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 17:06:06 +0000 Received: by mail-pf1-x433.google.com with SMTP id y7so8876538pfg.8 for ; 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=7AFz9yJ7KjVYTgTwuQSwajo5iRtXAPy5/08M152nlFJq7OQjxthvMzmnjKjqPvHZDY Kx3U2+99pW1Qmqo5tpctdIEvLeTJwTu7JOr1IPEmUO28M+hR+Isji0EjtguytvXG2iTt G8KiiJ2ioeo9QRiXty6LUOSDtFNKjR5KHaEcgcNvWM9ZEYSNEUjM6vN640WgIvWAJAjC lTfugDSH4UthNDQmOUN0DZWJoO6QfeBMqnag/GXue2WiK5BzfaxUbqzIwGjoRNPRDLh8 i89l7w6Ja9pJMEuLGYL26bspAfaxem1MYpiHYLFSL1JKH7o594Ojo4+R09CKWxogz2UO r/cA== X-Gm-Message-State: AOAM531hMT/1skW4OYweTh8lmDv+cNYxy3Ke81fyNZGvWKMcFdMQhipZ HwbQRPE662mC2AkraLIRvrM= X-Google-Smtp-Source: ABdhPJwm9rJNVdj0Qh6+rCPdEpEM9SAT0p+nmVQMRFCjROXihNP69pqeyY8uGOfEu5PUiAhQgGi4Hw== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_100604_768463_1173DEAF X-CRM114-Status: GOOD ( 29.74 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel