Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp601490pxk; Wed, 9 Sep 2020 13:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy55UxpZwLNd1IsWklNTTENtOBktTjOL/ePcPvLVvm8c0tMiBbXb+xvp03WWBRQl316bCAx X-Received: by 2002:a05:6402:48a:: with SMTP id k10mr6175358edv.22.1599684139150; Wed, 09 Sep 2020 13:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599684139; cv=none; d=google.com; s=arc-20160816; b=uJfyWuSpPj4mXnOsZwB9lYQQ65/sGvW59NYrQuDaRnZQIep0aeW+ASzzoTS9YR6oKR VNkk/XsEnwc0t3rAdXYdfv77q2sexIawQfMkyOdsLegUeukl37hRPUpO51yzgjfz0Ynx ataD1ptBLS/Up+Sn7A7z/vqhF02vWnHOSzdV0ejR+7ljAiNe/e0Ek7pmj6XoTvU5QPwL /tD6azfxy6UhHbtD4s2VoKoFrPQ8xJ8LpK1OqKqNsMQR1auZYPA7rkYZ03RQNAvTeDVN X+2BKYcXGlxHi+jRianQeZJPbr0MregNR+VRV2J8U28AuFWjMrLEUAbMCvS0inGqrvsT SSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=28D9YwgefWU0/LdWapoH03SgxD5c5C4WTGrjPR40mtU=; b=X/xg/FDMBGgkYLcwkG2LlTR0zm3nXHAXKwFgTlq5kJaTXm/DLgsxNOz05GD3SUuGTT li+hX3nVLJxocBr+V5qH4N0DqDgVI771ZPpwSwdCRsoX49Tt2MZ6dwlUh5WzWYTsBYoh t9IkkA7Db6Jk/ZbnRRgF2HUYLWQCZ7dKRm/WJZsa0DR6awPgGWZrYn27yk+JUAPlUQpV i6JtZY8D8omUAmA6OFUligLwYv+iR5t5WAs59nY/jNmoIiwS0AS5oei0wwoFt1OgCDYA l9HtWVKmnj88UO3bOeTrmvNCdTnYLCzxcIPpRtjmmlUEB+nN5kurkhyoAhEcWjg9GPY/ wJmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=doAj1CwR; 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 bx10si2158725edb.383.2020.09.09.13.41.56; Wed, 09 Sep 2020 13:42:19 -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=@kernel.org header.s=default header.b=doAj1CwR; 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 S1729738AbgIIUlA (ORCPT + 99 others); Wed, 9 Sep 2020 16:41:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:54012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbgIIUlA (ORCPT ); Wed, 9 Sep 2020 16:41:00 -0400 Received: from localhost (52.sub-72-107-123.myvzw.com [72.107.123.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5C4B2064B; Wed, 9 Sep 2020 20:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599684059; bh=XYTJIX+UX5+9hkTZ1JmQGWBSE1wnXfxEBbc2SLTvbLI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=doAj1CwRVbRE50VuDa0NRPzX3puwcNhH10PkIoMJlZ7VDX3J9Cpv7+Xu8Str2rpMp Duyf5ETzvgvpOayzw8I6cdDNzZUgfA5LXZHANt1OAYXDMuRtnJeoYx6BVRCwrzTwl+ +gjVdbDN5g3o6OLchOJSLhiZ4czH+k8PKVD1rqk0= Date: Wed, 9 Sep 2020 15:40:57 -0500 From: Bjorn Helgaas To: Lukas Wunner , Rick Farrington Cc: kernel test robot , Bjorn Helgaas , Alex Williamson , Boris Ostrovsky , Juergen Gross , Michael Haeuptle , Ian May , Keith Busch , linux-pci@vger.kernel.org, Cornelia Huck , kvm@vger.kernel.org, Derek Chickles , Satanand Burla , Felix Manlunas , Stefano Stabellini , xen-devel@lists.xenproject.org, Govinda Tatti , Konrad Rzeszutek Wilk , LKML , lkp@lists.01.org Subject: Re: [PCI] 3233e41d3e: WARNING:at_drivers/pci/pci.c:#pci_reset_hotplug_slot Message-ID: <20200909204057.GA724236@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200723095152.nf3fmfzrjlpoi35h@wunner.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 23, 2020 at 11:51:52AM +0200, Lukas Wunner wrote: > On Thu, Jul 23, 2020 at 05:13:06PM +0800, kernel test robot wrote: > > FYI, we noticed the following commit (built with gcc-9): > [...] > > commit: 3233e41d3e8ebcd44e92da47ffed97fd49b84278 ("[PATCH] PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock") > [...] > > caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace): > > [ 0.971752] WARNING: CPU: 0 PID: 1 at drivers/pci/pci.c:4905 pci_reset_hotplug_slot+0x70/0x80 > > Thank you, trusty robot. > > I botched the call to lockdep_assert_held_write(), it should have been > conditional on "if (probe)". > > Happy to respin the patch, but I'd like to hear opinions on the locking > issues surrounding xen and octeon (and the patch in general). I wish liquidio/octeon weren't a special case. Why should that driver reset the device when unbinding when no other drivers do? Looks like this was added by 70535350e26f ("liquidio: with embedded f/w, don't reload f/w, issue pf flr at exit"). Maybe Rick will chime in. > In particular, would a solution be entertained wherein the pci_dev is > reset by the PCI core after driver unbinding, contingent on a flag which > is set by a PCI driver to indicate that the pci_dev is returned to the > core in an unclean state? How would we do this? The PCI core isn't called after unbinding, is it? So I guess we'd have to have a queue and a worker thread to process it? Device removal also has nasty locking issues, and a queue might help solve those, too. Might also help in the problematic case of 40f11adc7cd9 ("PCI: Avoid race while enabling upstream bridges"), which we had to revert. > Also, why does xen require a device reset on bind? > > Thanks! > > Lukas