From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934934AbdBQSq4 (ORCPT ); Fri, 17 Feb 2017 13:46:56 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:57251 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934699AbdBQSqz (ORCPT ); Fri, 17 Feb 2017 13:46:55 -0500 Message-ID: <1487357213.13536.60.camel@pengutronix.de> Subject: Re: [PATCH] driver core: unbind consumers before locking parent on device unbind From: Lucas Stach To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, patchwork-lst@pengutronix.de, kernel@pengutronix.de Date: Fri, 17 Feb 2017 19:46:53 +0100 In-Reply-To: <20170217184242.GA11935@kroah.com> References: <20170217183629.3628-1-l.stach@pengutronix.de> <20170217184242.GA11935@kroah.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:fa0f:41ff:fe58:4010 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Freitag, den 17.02.2017, 10:42 -0800 schrieb Greg Kroah-Hartman: > On Fri, Feb 17, 2017 at 07:36:29PM +0100, Lucas Stach wrote: > > On forced unbind the parent lock is taken, as the device might be a USB > > device. The device to be unbound might have active consumers, which > > must be unbound before calling device_release_driver(), otherwise this > > function might deadlock when trying to take the parent lock during > > consumer unbind. > > Really? What type of device does this fail on today? Regular devices on a MMIO bus. __device_release_driver() will take the parent lock unconditionally when it unbinds consumer devices. So if the forced unbound device is on the same bus as the consumer we will deadlock right there. Regards, Lucas