Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2870027ybh; Sat, 25 Jul 2020 04:10:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWM4VluXec6oNbUY3Q7n3FN7hOyamm0qJGN3x4mYditcPpvxn4mkt6ZGnG7MWr4Qve4fIa X-Received: by 2002:a17:906:d78f:: with SMTP id pj15mr13695580ejb.283.1595675454140; Sat, 25 Jul 2020 04:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595675454; cv=none; d=google.com; s=arc-20160816; b=IAG5y8jekp/UiCwElM5UKxc5Bdxjz/IqxBsTBdjhpDs+vQ+OIEnYMDloE4tl6L9wwv Ru23zM6kxUIzlTCINjuwwrEH8mgpdXoE/ShlGOMpzCd+7bpz5kMbBTmpsvd6A+O6KzQg K2hAhbgxWW9WbdweVDIJQhxm4K5iuYYix3gmJ0rbbQFh1x3wNStmlkJG+WW3bzovOl0P rfMEQiq2frxUif/l96PROh+tWZtcOqLTM3DLJxxO8PlaNMNfmtvXsUhdtmMF695p7Xah 5M8IFsBIhQ2lLRajgtM3FWVeqN+vtP1Lk5mFsO1ArvtcDV1Vs7UKmzVk1e58Og+DhE/w SPnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=t+pmNIO3d6wzd/9C0HdiEBq0mqXfv7k8ZLr3g2Cl9rE=; b=z1g0Rzszyfe6+2dahVHWC6s9BGW782Gi9nJZO08dIbJA3v7phkjuEL2w5tacph1Iod TA/MjnzY0g+/TX3Jk+KBNIMcecwAWT9ottcQJM5tqnPK16VHho0KmmYn//DgAERjrJnH OPfZJ7wwiHNMysygK+3++WA+p53jL/nfqPHOR64CN59gQLPFsIn8dt1WZEZ9b4Xjsqff IdZH6wHeXKuhdrDC6Bz36XBjYcBbqtTNzl9Xt8pO7oWpvfe9nJ+6ABkGszLJfP5Y+nda +PCtBLy+czvb10dxDEjm11JZZFvfjaJP7K+/FtKJ0DNMevo6lxc0C5ekBiyzuZjbBLr5 VXlw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj11si2141732edb.279.2020.07.25.04.10.30; Sat, 25 Jul 2020 04:10:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726951AbgGYLHg (ORCPT + 99 others); Sat, 25 Jul 2020 07:07:36 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:52761 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgGYLHg (ORCPT ); Sat, 25 Jul 2020 07:07:36 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 327BC30000D16; Sat, 25 Jul 2020 13:07:34 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id EE7682CCD1; Sat, 25 Jul 2020 13:07:33 +0200 (CEST) Date: Sat, 25 Jul 2020 13:07:33 +0200 From: Lukas Wunner To: kernel test robot Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Dan Williams , Geert Uytterhoeven , Pantelis Antoniou , Alexander Duyck , Mark Brown , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, 0day robot , lkp@lists.01.org Subject: Re: [driver core] e3b1cb5c89: WARNING:possible_recursive_locking_detected Message-ID: <20200725110733.u6hi2tz3rmvpcy6s@wunner.de> References: <20200724142950.GG1850@shao2-debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200724142950.GG1850@shao2-debian> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 24, 2020 at 10:29:50PM +0800, kernel test robot wrote: > commit: e3b1cb5c896ba748d8f848238c8ea1f89520bde3 ("[PATCH 3/3] driver core: Avoid adding children below a dead parent") [...] > [ 1.392584] WARNING: possible recursive locking detected > [ 1.393350] 5.8.0-rc3-00011-ge3b1cb5c896ba7 #1 Not tainted > [ 1.393350] -------------------------------------------- > [ 1.393350] swapper/0/1 is trying to acquire lock: > [ 1.393350] ffff88841fc6ff70 (&dev->p->dead_sem){.+.+}-{3:3}, at: __device_attach+0x51/0x1a0 > [ 1.393350] > [ 1.393350] but task is already holding lock: > [ 1.393350] ffff888107f42770 (&dev->p->dead_sem){.+.+}-{3:3}, at: device_add+0xf8/0x890 False positive: __device_attach() takes a device's dead_sem whereas device_add() takes the *parent's* dead_sem. But lockdep thinks they're the same because they're in the same lock class. We would normally see the same lockdep splat for device_lock() but commit 1704f47b50b5 silenced it by assigning device_lock() to the novalidate class. I could silence this lockdep splat by assigning dead_sem to the novalidate class as well. But I also have an idea how we could fix it properly by introducing a per-device class for bus_types that need it and by putting the device_lock, dead_sem etc in separate subclasses within that per-device class. Any preference as to which solution I should pursue? Any thoughts on this series in general? Does the newly introduced dead_sem evoke approval or rejection? Anyone? Thanks, Lukas