From patchwork Tue Oct 2 21:52:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10624115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB548174E for ; Tue, 2 Oct 2018 21:53:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0C202842E for ; Tue, 2 Oct 2018 21:53:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4E97284CE; Tue, 2 Oct 2018 21:53:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A27F284BD for ; Tue, 2 Oct 2018 21:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727645AbeJCEic (ORCPT ); Wed, 3 Oct 2018 00:38:32 -0400 Received: from com-out001.mailprotect.be ([83.217.72.83]:42019 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727120AbeJCEic (ORCPT ); Wed, 3 Oct 2018 00:38:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=tPtP90mAvqTXNilJ+IY9oaoanPkb5+qff4CcAN6UAYw=; b=u9yEku0riM/R RPsbuSGvv7uHcuacrCdkOi8mjcPLwl2OwKa0gYLYAa2s+NcFP85yjl+h6MNVJi4e4ckQcNPvnQBmO RhPNtyYqYreNcWWw9ZjcRORvQcZSL//VH8RIE1cM0G/iHM1qHuxqfLLRbxhnWX75ZqRk8ojQ+h5rN dWEDHhJ6BiCS/ZC9gvoLNovroKfGjKNXD7mE0GHgenFhJ2DZ5pYKit7r2DEILI/D2YAVH9mYlp2HY G/VQhfpJv/XerLAhscKmcDi9uwgcdi6MVJpe6IcNZJiXHdhmzv7iii1aYPHWJPHfXpLnFQ6w/FcqC j2HTpIYr46HwstkC5xkFng==; Received: from smtp-auth.mailprotect.be ([178.208.39.159]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1g7SbA-0005sS-SL; Tue, 02 Oct 2018 23:52:57 +0200 Received: from desktop-bart.svl.corp.google.com (unknown [104.133.8.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id CF50CC0993; Tue, 2 Oct 2018 23:52:42 +0200 (CEST) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: Greg Kroah-Hartman , linux-scsi@vger.kernel.org, Bart Van Assche , Dmitry Torokhov , Lee Duncan , Hannes Reinecke , "Luis R . Rodriguez" , Johannes Thumshirn , Christoph Hellwig Subject: [PATCH 3/3] __device_release_driver(): Do not wait for asynchronous probing Date: Tue, 2 Oct 2018 14:52:23 -0700 Message-Id: <20181002215223.20453-4-bvanassche@acm.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181002215223.20453-1-bvanassche@acm.org> References: <20181002215223.20453-1-bvanassche@acm.org> MIME-Version: 1.0 X-Originating-IP: 178.208.39.159 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.10) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5v+dIcaiJjxNz7zPmthHez9602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1tLifGj39bI0bcPyaJsYTaCQjdSsHpHMseLvUQlcpDDrIqJ/wLUx19wF/fxIORoJewh lZEvvn2u39DR6ZeNzaenSaG7VHjC82dfVIjfDwsu7F0C+NK/wP6emrQEJ4mnBHoBGkq9ZeygGIuq EWWFe6nouI7dxbuZk8vLuXoJeaU5/5KzUg+Sn2tF6yHMTQ3Cr381QvhbKVRCA7YJ/hutEh+eA1Rh ERa/RcGunIiZlUN5kwI4edySG+m3KfoEca33dWlvcl2FIgemOOES4PyD4YuOeINNvrqnumqdNL2j 8R2D6C0HENvu68rf9YWInWopYX8Cjtc/AM8Z2WBeJ4coXf5DOFwoskLzFowa7AUCGN/ZhIMtzuO3 O+FDnkg1vDC9jSTg127TqHZDxA/kZB41Rh+Y+jJ/epVKdcq5/jWq4wImcHohaDSdj88G1xD/5DwD ws2wWVbjHO/cpJpsYlvFhM88EEtin807fzyYSqzUT6AES8KWaecotq4zBypQ19eU2Ok4y6YDwTij uwPHJVDAZbVwEIQwpWnmd/Rv5auZkQm+GfRMt75iNz3/C8o9KhT3TCI//y6jO2DOGTu2o2VRUt6B k1gABXukuKLgxSuEH5ByPKqpjSsBOnMcoZ+a02xhOvhKYNn9sZbzFkJFGzpkPbgbNE9dFPkOdyDT LZ+/0cd3HX+vFtCJx//m0zCjZt/DB/Hkx5RhBiSYf/dDZx/qjNL22iM6OMIRw3JvhQ64u5fjKTjE Cb0PwpN4olPuA0AI90OUvPEZQSa0gxqHMi4keVUAoMMKBawL6fapf4z9fCjg7id0jk32JS/0VmWF 1IOrybyB3DBQoMdi9px0D4XNJOkrRpAwEh9tW1/OBrKjsFbYsC1Z9dw/UzpEuOsNmdOzL7dfmvow GnVnOL32nUz4qsqO65IPZufpEn5cU7JmBdUxA5lreQNG2aEZo8nURcWzPRmok11u89pTKgJ27pjs IdJuW1mwt9WjK+0BDexEqT40Hd/EA17matbkn+37ntACNv0a2ybDhkpebUyHJSBRX3b7MEP8gFgZ ENc7n8aQLzXjH2FPvgALNPBaSRFiTTtxz36m+UeFXprlCOm3BAEbJtAoNkzW5nRJkb05zVTmb0z1 jJ5x8X57VkM6Cv9mqpjneuTaEZWACCgDSxAx25jBV2JhD/iWD0V++qD0gbQQTy2MWvdekRpcWklT +39WHn3k1EiAZoPn2tuUxPLKnYUFY2O1M5lTrLO1ml98jiusZ8069jihx+Za/cV70jOJzN2r4A== X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since __device_release_driver() is called with the device lock held and since the same device lock is obtained by the functions that perform asynchronous probing (driver_attach_async() and __device_attach_async_helper()), asynchronous probing is already serialized against __device_release_driver(). Remove the async_synchronize_full() call from __device_release_driver() to avoid that a deadlock is triggered. See also commit 765230b5f084 ("driver-core: add asynchronous probing support for drivers"). Signed-off-by: Bart Van Assche Cc: Dmitry Torokhov Cc: Lee Duncan Cc: Hannes Reinecke Cc: Luis R. Rodriguez Cc: Johannes Thumshirn Cc: Christoph Hellwig Cc: Greg Kroah-Hartman Acked-by: Dmitry Torokhov --- drivers/base/dd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index edfc9f0b1180..d6520de659bd 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -926,9 +926,6 @@ static void __device_release_driver(struct device *dev, struct device *parent) drv = dev->driver; if (drv) { - if (driver_allows_async_probing(drv)) - async_synchronize_full(); - while (device_links_busy(dev)) { device_unlock(dev); if (parent)