From patchwork Mon Oct 24 11:30:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8586 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419196wru; Mon, 24 Oct 2022 05:15:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7me92omFyamBW4dqE4S6tS1nK3oXwIiEOSci8yQvO7kO/alvMbpB8sXTAk1tfx3Vk++C27 X-Received: by 2002:a17:906:99c5:b0:73d:70c5:1a4f with SMTP id s5-20020a17090699c500b0073d70c51a4fmr26324228ejn.302.1666613752525; Mon, 24 Oct 2022 05:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613752; cv=none; d=google.com; s=arc-20160816; b=MPgiTyEPinatUyt/Iu8mcGhHHu9K3k+TX30qeZ2C9Q84yoXHChkRZNvrAztJtZ1BO2 VWsA1+mmgz5zJECYGKw7Tbu8mJiXeD9C00FZdqYAjbDNj1vEEuY48xLjdcx6OHnBX2w4 pbawax11UvkH16RDnJqK7ZOhIvJK+LdrLMIHut/Eil7SuhyXtlsHXTNJ6Z/ktzqzqSo9 z7HPp2ddCtVuJth2W61YLVI0/hvL4FsLGrO5p8TY5pMORMI6kXxa00oBBieVBm+JFHYB WOoLOe8v0FoSLBkVSm20dHjb9tr9uvJ+VzNiN+MSXWnpexbZxeWmnTAcoSitWR01ZxLX 23YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fbMf3FLv7CSe7zyIpP7eOzvzi9YJVZzD2R6rOmlM7z8=; b=uBqO8HLi6PjlVjDMxbH/3szNX9sUAL5bqUJYIKNBn9Yu6D/MitPXXLhhhXNf74D0uP jSeALNBehY2L1Bbesinh3cPUnuPLzyjTDz0rzWC0c64vMGM+IUrHf8drDofwilKW/aaG UtX8X2g7S2hxmRMfBSwU4e/1mc5cNkdy7XbjyOI942pILRADWqfJUzqV/kREHHEoUR5a BPsA6x/6Nz6HbnWW78999YVPqaNRajzRbefk7RBTqmvZVkDzMIIyvrMFqGP037whqDJn heKpw+kv+SxEr83g2ljM+kljIZQUahcXl6gEj6ismqkICM8vxofuyTLCR3bTREXYk6tu ek2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NAAkafaP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga29-20020a1709070c1d00b0078d43ae07e1si30134920ejc.649.2022.10.24.05.15.27; Mon, 24 Oct 2022 05:15:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NAAkafaP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232706AbiJXMG4 (ORCPT + 99 others); Mon, 24 Oct 2022 08:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232911AbiJXMEh (ORCPT ); Mon, 24 Oct 2022 08:04:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D51C73BC68; Mon, 24 Oct 2022 04:50:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 41C5BB811B9; Mon, 24 Oct 2022 11:49:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9692AC433C1; Mon, 24 Oct 2022 11:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612178; bh=SrzuHoasVKSFypBy+GmTnPzmZkciHvpxXHdO6la55H4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NAAkafaPdgkfmGTjnB+bujeeB73vyZEyG08GQf4fg8GemyabFtwm3U+2W/74Rv/QX dZ+iW6aARZbYj8f4sSFMlfKEcjCYoVP0prAG1v3mmP1tG7e0E7/joQv8pP0IabWEXo e6+YhRdoxkAA70dVyqQOXyVavfszJavSPtFFezXk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Zimmermann , Maxime Ripard , Sasha Levin Subject: [PATCH 4.14 098/210] drm/mipi-dsi: Detach devices when removing the host Date: Mon, 24 Oct 2022 13:30:15 +0200 Message-Id: <20221024113000.206122481@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747571182401683405?= X-GMAIL-MSGID: =?utf-8?q?1747571182401683405?= From: Maxime Ripard [ Upstream commit 668a8f17b5290d04ef7343636a5588a0692731a1 ] Whenever the MIPI-DSI host is unregistered, the code of mipi_dsi_host_unregister() loops over every device currently found on that bus and will unregister it. However, it doesn't detach it from the bus first, which leads to all kind of resource leaks if the host wants to perform some clean up whenever a device is detached. Fixes: 068a00233969 ("drm: Add MIPI DSI bus support") Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-2-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_mipi_dsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 6f0de951b75d..bd5e8661f826 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -305,6 +305,7 @@ static int mipi_dsi_remove_device_fn(struct device *dev, void *priv) { struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); + mipi_dsi_detach(dsi); mipi_dsi_device_unregister(dsi); return 0;