From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5562AC433E1 for ; Sat, 25 Jul 2020 11:07:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A720206C1 for ; Sat, 25 Jul 2020 11:07:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726969AbgGYLHg (ORCPT ); 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