Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1189907pxu; Wed, 6 Jan 2021 15:13:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQCQl2i2Z2Trjnkw6NUyqQF5Op4unLAaJdHxUzqIGC5c21YxgkD5Gq/KZ1W7nmk2YXM49d X-Received: by 2002:a17:906:7fca:: with SMTP id r10mr4547583ejs.24.1609974828391; Wed, 06 Jan 2021 15:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609974828; cv=none; d=google.com; s=arc-20160816; b=HpyvGzrtaQ7I4VdDiErMUar5vBSnTXIIEWJOT7JoU+K+PJzO0bHz56i0lNGSq8y9I0 wipEpK4Fvz/OfHcdGHfVLGEgYKyKSCsovBZ5ql5GbV3yhDfzu9zRBN6EKpd9ZgHzlFT6 GMAVbi/+YUUSZdH2oPlSg5Eo34+JrO+BJt3ehrTIKlMPtgkyASiXUbqW151dDInen1QU ZuCO9wU2+tF69zXz6wEQi+GGG77rlePoWLew63a4adi/MloL9QkXvYGSd71C7DieOZzl trlA38wQj0CaWNT9f6pTRiLIfJ7RPxjcqZXyVTTHQiBC4wk3XwdDS0WzWB7IDt3qEqTq UZ/g== 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 :message-id:subject:cc:to:from:date:dkim-signature; bh=X6ObHGq0bmzFQzLryPbAYuv8T3Q1ANEMNFzT5CfRBjQ=; b=RnqwCw8fAaScspTv10vPW0Lui9zoMHoVfU0YZbT1tFYnjcVijXhZy5CRTB2Nr7JmBX DcSNdLjqO+aw+CwFqMxsIj7Y0ZLccrektir/c11bseqOyxwaQx7V/yTNj0mJpudxKJ/3 JSSfL40EG5MQujPAe5yKjViHOd0mld44XGT1s0yzXp0pxwt7ZmPwWZ2LTKobMiFjMctq uHMetRC6x7MY4aSSfUUj/OEx+8GLzl7UZD9T+xdyH49WQuVHzjMHPpx6D8nZTM9MXygX qjGXrMTHA/6f7lebtA6Z3RLHEl4KOHAs68j1gJ0TBM52+kaHfdyLVRQ29m06my+PjCQh +crQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MPCGJRH+; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si1388834ejx.420.2021.01.06.15.13.24; Wed, 06 Jan 2021 15:13:48 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=MPCGJRH+; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727022AbhAFXMW (ORCPT + 99 others); Wed, 6 Jan 2021 18:12:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:47582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbhAFXMV (ORCPT ); Wed, 6 Jan 2021 18:12:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 631FD225AC; Wed, 6 Jan 2021 23:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609974700; bh=C4lkCxq3GgpIZnzJfvMgGcqHjmU2Xc7PbSpPSnKU/7A=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=MPCGJRH+rxnFAiLtgNX43diPJzGYKtNVmdsQNqc7ITnYe7s1YxYF4b5m23Xm0xgiJ owZ/vBZYJmDsixuBNrON2YUAMPMV3ks+B+pAPxj79/plkwvRe/4pdB79mLHgqLCROZ opbYJnAMrW/htY19T+KTSsGKVhdBiZyQ/TecMneAsH+uH+y97OdNkcPu5Rj131ZrGt y+kw6ft6WCt6a689lqrt2lpUW4Ay7nJAZijjPEo0vgfGDBrMPbgRWacXVSoKtZP+Ds kLjRgmeg5EU/faSdPi5YwVlX3RvTgcKbMRb+S471if/hTECfxAReQxyxe1UAOyNSfk KpLjyA2RguIlQ== Date: Wed, 6 Jan 2021 17:11:39 -0600 From: Bjorn Helgaas To: Jim Quinlan Cc: Jim Quinlan , Bjorn Helgaas , linux-pci , Nicolas Saenz Julienne , Mark Brown , bcm-kernel-feedback-list , Lorenzo Pieralisi , Rob Herring , Florian Fainelli , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v2 5/6] PCI: brcmstb: Add panic/die handler to RC driver Message-ID: <20210106231139.GA1350432@bjorn-Precision-5520> 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 Wed, Jan 06, 2021 at 02:57:19PM -0500, Jim Quinlan wrote: > On Wed, Jan 6, 2021 at 2:42 PM Jim Quinlan wrote: > > > > ---------- Forwarded message --------- > > From: Bjorn Helgaas > > Date: Wed, Jan 6, 2021 at 2:19 PM > > Subject: Re: [PATCH v2 5/6] PCI: brcmstb: Add panic/die handler to RC driver > > To: Jim Quinlan > > Cc: , Nicolas Saenz Julienne > > , , > > , Lorenzo Pieralisi > > , Rob Herring , Bjorn > > Helgaas , Florian Fainelli > > , moderated list:BROADCOM BCM2711/BCM2835 ARM > > ARCHITECTURE , moderated > > list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE > > , open list > > > > > > > > On Mon, Nov 30, 2020 at 04:11:42PM -0500, Jim Quinlan wrote: > > > Whereas most PCIe HW returns 0xffffffff on illegal accesses and the like, > > > by default Broadcom's STB PCIe controller effects an abort. This simple > > > handler determines if the PCIe controller was the cause of the abort and if > > > so, prints out diagnostic info. > > > > > > Example output: > > > brcm-pcie 8b20000.pcie: Error: Mem Acc: 32bit, Read, @0x38000000 > > > brcm-pcie 8b20000.pcie: Type: TO=0 Abt=0 UnspReq=1 AccDsble=0 BadAddr=0 > > > > What does this mean for all the other PCI core code that expects > > 0xffffffff data returns? Does it work? Does it break differently on > > STB than on other platforms? > Hi Bjorn, > > Our PCIe HW causes a CPU abort when this happens. Occasionally a > customer will have a fault handler try to fix up the abort and > continue on, but we recommend solving the root problem. This commit > just gives us a chance to glean info about the problem. Our newer > SOCs have a mode that doesn't abort and instead returns 0xffffffff. > > BTW, can you point me to example files where "PCI core code that > expects 0xffffffff data returns" [on bad accesses]? The most important case is during enumeration. A config read to a device that doesn't exist normally terminates as an Unsupported Request, and pci_bus_generic_read_dev_vendor_id() depends on reading 0xffffffff in that case. I assume this particular case does work that way for brcm-pcie, because I assume enumeration does work. pci_cfg_space_size_ext() is similar. I assume this also works for brcm-pcie for the same reason. pci_raw_set_power_state() looks for ~0, which it may see if it does a config read to a device in D3cold. pci_dev_wait(), dpc_irq(), pcie_pme_work_fn(), pcie_pme_irq() are all similar. Yes, this is ugly and we should check for these more consistently. The above are all for config reads. The PCI core doesn't do MMIO accesses except for a few cases like MSI-X. But drivers do, and if they check for PCIe errors on MMIO reads, they do it by looking for 0xffffffff, e.g., pci_mmio_enabled() (in hfi1), qib_pci_mmio_enabled(), bnx2x_get_hwinfo(), etc. Bjorn