Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3552831imu; Mon, 10 Dec 2018 04:13:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VgeMzi04Dc/vSnX+o5FBSJMTlrhlvqP/YXhX0YGB+I+dp0OeOwH8Avi9GpoqDO3nm3OsIm X-Received: by 2002:a62:509b:: with SMTP id g27mr12267543pfj.48.1544444017592; Mon, 10 Dec 2018 04:13:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544444017; cv=none; d=google.com; s=arc-20160816; b=OxDWN9wHJWSb4oZW3mi7+w3cP7jeHtZIGZ80JvsNg08lZe83uTmnw/Jx67QczZ7YK7 QlRAyhDWvSfQSYyYtOT8ZvrrvMoxI0tNQe+k136hlHib3yB6PUoIN+dQjSRPXzHWZ7n/ WHf1jtvoRLJDWANvIvUM0N3YTOtGwJpuZrAOZ9d3bYK82zH6eRqdLE3susmn/+GK0bvt cEyij9899I2q6QQjxvQdEReY02mSf/ln7EnDHdcRzTAthnOHc/RikmV6kgJTp2W8ZTSc TXPyXTry5yhayOQnLfBATTHydd/h821NEIfSjYNTcf8h/sRVA9OipoVUtvtzE4FFTr39 NKFw== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=NAyoTtRLEgV/ZLu0j1afB7pOEypu3oJUgTQbmtuJru0=; b=fl/Ich9MULd6ajyiRXxY+1eKNhByBPpTKvNiIl7+aqiDc4or3yZu4371gIkg7Zh92i dk3xHx61vMH8B2ykuzdifnxNUHBBVE9p1XTToZo4TgzLnIhMpWKAemmIL4ecOSvdDMxC /0ta6qNWeI/f57eQyRwBBV+AFDDjeyovk+BVktJGhwP2m1FX+1xnJTzlnrrrc/Wdnu79 daGl3J+d0umY+HcLCLCzNXFt82ROWIhC0wOw7UsrBeCo5IAWNYpS7mrag0ubQbzFx/Z9 IvNzfGxDBkqkkmklNEyiW/Gqa77W7sHF3FWwIYuV9e6ZU811Iq+Fbl1fXTeU3kBv1FVd TiCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=COe6NzDr; 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 k38si8912688pgi.235.2018.12.10.04.13.22; Mon, 10 Dec 2018 04:13:37 -0800 (PST) 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=fail header.i=@ffwll.ch header.s=google header.b=COe6NzDr; 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 S1727009AbeLJKSh (ORCPT + 99 others); Mon, 10 Dec 2018 05:18:37 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41551 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbeLJKSh (ORCPT ); Mon, 10 Dec 2018 05:18:37 -0500 Received: by mail-ed1-f65.google.com with SMTP id z28so8968525edi.8 for ; Mon, 10 Dec 2018 02:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=NAyoTtRLEgV/ZLu0j1afB7pOEypu3oJUgTQbmtuJru0=; b=COe6NzDrrA/t2I/UCH4hq/awqlSSzs/7g0b2lq/KwCoczu9lwnG+T3X9mEJ/7EsRph pRRX2BXh1ocjoY76TBEFQeYiE5HJJRyCKdgEzeJEz0XvUDpeQeqQPKXmbQRn7+2EEKBN 9cG8u6IeD+lzVsp3WbZSijWOIt7WDf0Wp/f6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=NAyoTtRLEgV/ZLu0j1afB7pOEypu3oJUgTQbmtuJru0=; b=ect3aRn58k36QYAegvPTOgA0YqgA8m2AMJppgmzjIDpQ5sPRn7now5nBUum4qYxHoh f3ehWGVakhnIPlYzawt/h2wx25ChBf3IHHtnBDzomShiL0QuRzOdjghWTjxHYCq2dpyp 34/D8pP+rdHHDxNWXDpKDn50Jxox2hgqaWea6MKPYsh9DoR5wnACaeqe4Ky0txYTcvJ/ 3P+JFK5uSWgWO7OlDVnZWaK76ipHkXOv8Fp8ONT7G/9jrAyK6RZyjV5eQqCwjpWI/+iw NWJOU0AUfZiOO2erNUPBlQwL/cobASZoCh0s/8zmv9Wgx9szcCHbqBKPmmzbpDYaDTnU uJhw== X-Gm-Message-State: AA+aEWbkBTkYBWOC34rY2DG/wpQ5R3n51gLiVxcs2JTXXGYDHhvVVer6 wRutGZsYu6WIbr+O792O0OWyWg== X-Received: by 2002:a17:906:37da:: with SMTP id o26-v6mr9251480ejc.179.1544437115071; Mon, 10 Dec 2018 02:18:35 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id c11-v6sm1726157ejm.67.2018.12.10.02.18.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 02:18:34 -0800 (PST) Date: Mon, 10 Dec 2018 11:18:32 +0100 From: Daniel Vetter To: Greg Kroah-Hartman Cc: Daniel Vetter , LKML , DRI Development , Ramalingam C , "Rafael J. Wysocki" , Daniel Vetter Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind Message-ID: <20181210101832.GN21184@phenom.ffwll.local> Mail-Followup-To: Greg Kroah-Hartman , LKML , DRI Development , Ramalingam C , "Rafael J. Wysocki" , Daniel Vetter References: <20181210084653.7268-1-daniel.vetter@ffwll.ch> <20181210100634.GA8836@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181210100634.GA8836@kroah.com> X-Operating-System: Linux phenom 4.18.0-2-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 10, 2018 at 11:06:34AM +0100, Greg Kroah-Hartman wrote: > On Mon, Dec 10, 2018 at 09:46:53AM +0100, Daniel Vetter wrote: > > Drivers might want to remove some sysfs files, which needs the same > > locks and ends up angering lockdep. Relevant snippet of the stack > > trace: > > > > kernfs_remove_by_name_ns+0x3b/0x80 > > bus_remove_driver+0x92/0xa0 > > acpi_video_unregister+0x24/0x40 > > i915_driver_unload+0x42/0x130 [i915] > > i915_pci_remove+0x19/0x30 [i915] > > pci_device_remove+0x36/0xb0 > > device_release_driver_internal+0x185/0x250 > > unbind_store+0xaf/0x180 > > kernfs_fop_write+0x104/0x190 > > > > I've stumbled over this because some new patches by Ram connect the > > snd-hda-intel unload (where we do use sysfs unbind) with the locking > > chains in the i915 unload code (but without creating a new loop), > > which upset our CI. But the bug is already there and can be easily > > reproduced by unbind i915 directly. > > This is odd, why wouldn't any driver hit this issue? And why now since > you say this is triggerable today? The above backtrace is triggered by unbinding i915 on current upstream kernels. Note: Will crash later on rather badly in the fbdev/fbcon/vtconsole hell, but that's separate issue (which can be worked around by first unbinding fbcon manually through sysfs). > I know scsi was doing some strange things like trying to remove the > device itself from a sysfs callback on the device, which requires it to > just call a different kobject function created just for that type of > thing. Would that also make sense to do here instead of your workqueue? Note how we blow up on unregistering sw device instances supported by i915 in entirely different subsystems. I guess most drivers just have sysfs files for their own stuff, where this is done as you describe. The problem is that there's an awful lot of unrelated stuff hanging off i915. Or maybe acpi_video is busted, and should be using a different function. You haven't said which one, and I have no idea which one it is ... And in case the context wasn't clear: This is unbinding the i915 pci driver which triggers the above lockdep splat recursion. Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch