Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3812569ybi; Mon, 29 Jul 2019 13:06:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXJ61xAAeqmo+WDmVBzj2yCyE72Gp8NHqrvviMUVZtxLcHqXzzGGsKCm84SbpwnqdtElQo X-Received: by 2002:a63:6901:: with SMTP id e1mr75016021pgc.390.1564430817505; Mon, 29 Jul 2019 13:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430817; cv=none; d=google.com; s=arc-20160816; b=f0gmBACs7QpENw8JhLMXpW2fp1oc53h+btOiqZEzRqrb17AIr7YjcOOniOPNwimhVC A3oQh8BQWVQ0GM4mQyVB2UnZIPP+4RlrXIym2hkdchZF3U7yGs9PCcLQQHu0Wx1PLHo5 zZ0dRHaiINE96JozjUifA5pJYMsL/wKHMNsloBqFZYrwUDbz/A0jyu/05apGNw354+d1 7WE8EjSkvXMPDSL1ZkFYHCNtTmz0BR7cI+cpgJ7R1iAx30jGTOmEQKb8y0hyFu6iBVtg iiV2LVitXa8Ps+0FEPwZhziPoPS1mE1R7n/vNdZIXi9zT6STSKFAyg0Fz4S++MygPp5u lw9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SH7hTdGa6a1QQVknCubOLtroaDOjO0AYUx2WFTeqAOo=; b=GUU5PfEfpJhDkSiPrCl3Xz9SXGa2bSAnrbChcyoVMt7xSLsDRMPpvIk2CUnV7Pbb4+ iiV+MU9plc8/EoI8uJMAng93oTuHk35ibvSVUycuKaApZ8/1G0PaGxXVsyQJHl6hptCm CHJEkMxPaZ8iNHxdv59BHPU2qz3h5OWG4V14G5zsUim3q6eYptjy0tqnF8WB//kVtphY klabeuzTlfV0rWN5K79bhOyLDq27+k1G2XDc6JEkQQP49ujGn2MkCwqfZiHHpK1xUxOW f9TmIqD91f8f7Eq9Cb/X+F3xkL4xqTPnDk7SoghvlWTKMrTyqk6UaUPdb+n7maJws17z vjhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aQ1AJwWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si26659070pfr.8.2019.07.29.13.06.42; Mon, 29 Jul 2019 13:06:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aQ1AJwWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390182AbfG2UFg (ORCPT + 99 others); Mon, 29 Jul 2019 16:05:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:58926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388748AbfG2Tmy (ORCPT ); Mon, 29 Jul 2019 15:42:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 627F821655; Mon, 29 Jul 2019 19:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429373; bh=OJZZhcQqhVrtKpqeXpW6+ZqFpBpsNjwmQZbhkkcxWKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aQ1AJwWOUTD52Ud+8PpbwoMqHAI2a9Z88jEOxlDqqoR7hexJuut2qUPb29nyycrat xJO+Y+Ll1hfKHG0UR0KbMMaTZeJL3x41Jxgc1JapCJdSf6C3uggp092tVDc+QlK4Tr BOzzYF6o0Sb5FNWVDdn3mlw6nXLn8+rrLk2soFQQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Vasut , Bjorn Helgaas , Geert Uytterhoeven , Phil Edworthy , Simon Horman , Tejun Heo , Wolfram Sang , Sasha Levin Subject: [PATCH 4.19 039/113] PCI: sysfs: Ignore lockdep for remove attribute Date: Mon, 29 Jul 2019 21:22:06 +0200 Message-Id: <20190729190705.053523194@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit dc6b698a86fe40a50525433eb8e92a267847f6f9 ] With CONFIG_PROVE_LOCKING=y, using sysfs to remove a bridge with a device below it causes a lockdep warning, e.g., # echo 1 > /sys/class/pci_bus/0000:00/device/0000:00:00.0/remove ============================================ WARNING: possible recursive locking detected ... pci_bus 0000:01: busn_res: [bus 01] is released The remove recursively removes the subtree below the bridge. Each call uses a different lock so there's no deadlock, but the locks were all created with the same lockdep key so the lockdep checker can't tell them apart. Mark the "remove" sysfs attribute with __ATTR_IGNORE_LOCKDEP() as it is safe to ignore the lockdep check between different "remove" kernfs instances. There's discussion about a similar issue in USB at [1], which resulted in 356c05d58af0 ("sysfs: get rid of some lockdep false positives") and e9b526fe7048 ("i2c: suppress lockdep warning on delete_device"), which do basically the same thing for USB "remove" and i2c "delete_device" files. [1] https://lore.kernel.org/r/Pine.LNX.4.44L0.1204251436140.1206-100000@iolanthe.rowland.org Link: https://lore.kernel.org/r/20190526225151.3865-1-marek.vasut@gmail.com Signed-off-by: Marek Vasut [bhelgaas: trim commit log, details at above links] Signed-off-by: Bjorn Helgaas Cc: Geert Uytterhoeven Cc: Phil Edworthy Cc: Simon Horman Cc: Tejun Heo Cc: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/pci/pci-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 9ecfe13157c0..1edf5a1836ea 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -478,7 +478,7 @@ static ssize_t remove_store(struct device *dev, struct device_attribute *attr, pci_stop_and_remove_bus_device_locked(to_pci_dev(dev)); return count; } -static struct device_attribute dev_remove_attr = __ATTR(remove, +static struct device_attribute dev_remove_attr = __ATTR_IGNORE_LOCKDEP(remove, (S_IWUSR|S_IWGRP), NULL, remove_store); -- 2.20.1