Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp629601pxb; Thu, 21 Jan 2021 16:08:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJybhETe7qekHUqf9Ahy+1jGCUD1CJuA4ttv8wXhSSJkE+S/siMi6RnJqMaBV4tom8772iz0 X-Received: by 2002:a17:906:f759:: with SMTP id jp25mr1205329ejb.207.1611274119340; Thu, 21 Jan 2021 16:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611274119; cv=none; d=google.com; s=arc-20160816; b=woJbj3/v3t0kkO7V6kSkGAY3WjI0ju0FZ9DtkU2IltdkJrsCVgKmiHx4r4hNHYy++9 DpTiOTDpAUx1Pp15V25lg8+Yq3Fw8O8UK8+wFDKaN5Ba4fbNX8LhbUgII8zhnf1z62/G PAzft9SDQiMpbWQZpAtW6nghb4lUYZc8vnqWS2B/YQtY1ooJ4O+5MdksxFuFjEDbCEdc MX78pk06TE3yVajT4v57CbyCj32t8X/hew1DwsNJ40/+VnnzN2wzVUeaN6e0kYU1DGkW XnGbK/suTsiZyCPHfsZVqybZxEYup5SaMCMecqxExiJykZACxxYDbU5L6RS0khrS20Je XY7Q== 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-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=Ub21FDi9PWSdfzohSYGgMecMW30tp0rs+JwjJAYXTbo=; b=UHsrqCSmZyUhVpsh7ukHaBIsqGdvbVH3lJHBjewo6hLqDBRuXd9blkIwH3uGsmTsPY Dp6C/XQD6ZrAxWkTXYHSeWfoCmtVjy7hmI+2miNCpdp6ZLQpS8Z1DdcH+wCI9EqrSEL2 DzSQz5zbT3hqWZbQFh2moJhFvQewA5GMTiBwy8dCbGbkWZooWiQdmlX+jrH2vF72+wWx E3siiDnrGihh04/VAFctowpd9506dJbam952KN8sDEwS1o9uNekGEnWI93K97o8j6FtY 8yTsFDE0RtHqozYQeq8IdcYk31Dw/tR51IUST9V5YO6bxhLWum+BKjWLrqiOEH+3aizB 2/aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m4bvqs+0; 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 y21si2380978ejf.161.2021.01.21.16.08.13; Thu, 21 Jan 2021 16:08:39 -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=m4bvqs+0; 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 S1726175AbhAUX4f (ORCPT + 99 others); Thu, 21 Jan 2021 18:56:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:58860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbhAUX4b (ORCPT ); Thu, 21 Jan 2021 18:56:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91CBD20717; Thu, 21 Jan 2021 23:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611273350; bh=8QjqGxP5A6Zb7kZN/Tv3TiVVxYWmPX8SjmAedowBJDA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=m4bvqs+0i3f4ox47gYfFnDN2U326T9Dz6O4YEwqVKhHZHdmU+kBIv1NVixkddaprp g/X0epRNxLZf1txzHhyC8LtzAs8qA7ttbHLVfdTVl3DaeB502YUT1P2XHW/fAcu2QW /E2ITwi/SasMeNVGUIuILrXDHuxgj1vVkx9Ad69aYkw4NRt6EfN26mCzLwkdrumuoj pdmDzHz/+aSlAj/hcxUnMRVPZZ4CPDTCAyGjS4JE1qmlgfId6u5K7wyYOAW3S9jiH6 0QNCUNFjOd5HUckqtZ29kN8mpvmArgyphsyro2bx9Jl/QpA2V8xsodToh+exGz8Z2H Fjio1iJ6G9k5A== Date: Thu, 21 Jan 2021 17:55:47 -0600 From: Bjorn Helgaas To: Antti =?iso-8859-1?Q?J=E4rvinen?= Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Williamson , Murali Karicheri , Kishon Vijay Abraham I Subject: Re: [PATCH] PCI: quirk for preventing bus reset on TI C667X Message-ID: <20210121235547.GA2705432@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210112153643.17930-1-antti.jarvinen@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Alex, Murali, Kishon] On Tue, Jan 12, 2021 at 03:36:43PM +0000, Antti J?rvinen wrote: > TI C667X does not support bus/hot reset. > See https://e2e.ti.com/support/processors/f/791/t/954382 You can cite the URL as the source, but the URL will eventually become stale, so let's include the relevant details here directly. From the forum, it looks like the device doesn't respond after a reset (config accesses return ~0). It seems somewhat surprising that something as basic as a reset would be completely broken. I wonder if we're not doing the reset correctly. It looks like we would probably be trying a Secondary Bus Reset using the bridge leading to the C667X. Can you confirm? Wonder if you could try doing what pci_reset_secondary_bus() does by hand: # BRIDGE=... # PCI address, e.g., 00:1c.0 # C667X=... # setpci -s$C667X VENDOR_ID.w # setpci -s$BRIDGE BRIDGE_CONTROL.w # prints "val" # setpci -s$BRIDGE BRIDGE_CONTROL.w= # val | 0x40 (set SBR) # sleep 1 # setpci -s$BRIDGE BRIDGE_CONTROL.w= # val (clear SBR) # sleep 1 # setpci -s$C667X VENDOR_ID.w=0 # setpci -s$C667X VENDOR_ID.w If we use this quirk and avoid the reset, I assume that means assigning the device to VMs with VFIO will leak state between VMs? > Signed-off-by: Antti J?rvinen > --- > drivers/pci/quirks.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index 653660e3ba9e..c8fcf24c5bd0 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -3578,6 +3578,12 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0034, quirk_no_bus_reset); > */ > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CAVIUM, 0xa100, quirk_no_bus_reset); > > +/* > + * Some TI keystone C667X devices do no support bus/hot reset. > + * https://e2e.ti.com/support/processors/f/791/t/954382 > + */ > +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0xb005, quirk_no_bus_reset); > + > static void quirk_no_pm_reset(struct pci_dev *dev) > { > /* > -- > 2.17.1 >