From patchwork Mon Oct 24 11:29:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8919 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp434439wru; Mon, 24 Oct 2022 05:52:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6TNt7ESR4haet8zjyAXz8oJ8SJl9ZdHL7MYg8W1InVuxe5FyRXoXm5o2ovM1iCJr5AwTvn X-Received: by 2002:a17:907:6e28:b0:7a0:b6b5:5103 with SMTP id sd40-20020a1709076e2800b007a0b6b55103mr10538413ejc.300.1666615934844; Mon, 24 Oct 2022 05:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615934; cv=none; d=google.com; s=arc-20160816; b=Gt9+RXgKc+tzjsiu8gceX7nzuCcDQuS7NRdSNR3w6sdHXqNIdqrEgWkHvHU3JxHz/P aL8EvI/a9me3PRO9PG3Ol+wtYSrz7+UIOtMkN/1FNeQz/5jw+S9/KlZ2MUMS8TfWDptz K5PQT3qVsVDcnKuqWCeQow0gGI9pmK1s9/AAIB2gDbs0uwLOFPUxuEgLNAIbEg83xpWx juU0XVC6fqm9nbM38jwtJEKC+FLzxTJL/iSSKuUnNTL6Owe+BLObBOKXdv1u5QiijKQV t42K54X7oe25SnMJMArmVBJNpsFm1QF3XjNUhuSePDUlgwUI9815opyfOcUSxCf3CQri WuzA== 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=kAQb9ekc3d8UMEQYMykHkGtIWui57GxV1zTxt9g336k=; b=r/o+CxeBOBvUhB8X+Ripr9sCbaD+blHMdfnXpsuqQEc5L1wHhSruRoofI25FHKA0zM 2TTmerTwUsUCnFozZp3vLoNJH3NtNLkOxihCtFK3jRRrBlBWaOkr1dLn38CYksdcd5C9 iMWPLbzikFk3Zhg6BmpNnvS7QqTRsRTgEY6eQd4EPo8yC82N1nVxRRw3fHnf/Kwoe3P1 H2WepGzt6TJCqv9ZD/QD4iRDPR8JkErzOTlQswyPK6djGx0CjVXHb/VnD44m8fZ8SQas /CLp5OdAfMdDKYIsOB02teDN1Bn7WHC9pLqjingVga87Dz/rsJGKRHwQuN+ILxsErvtK a3Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qs3fhHrd; 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 qw22-20020a1709066a1600b0078dcf11ccf7si27152071ejc.802.2022.10.24.05.51.48; Mon, 24 Oct 2022 05:52:14 -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=Qs3fhHrd; 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 S234377AbiJXMum (ORCPT + 99 others); Mon, 24 Oct 2022 08:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234627AbiJXMpW (ORCPT ); Mon, 24 Oct 2022 08:45:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7768E31DEA; Mon, 24 Oct 2022 05:09:57 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 37E4361218; Mon, 24 Oct 2022 12:09:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A721C433D6; Mon, 24 Oct 2022 12:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613358; bh=ne2UJ6vabJsh3Q1TxGPkJc9EVVF+3J1pryip5BHrUoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qs3fhHrdrGU0Dxe57ORM65fSntl19kX264q3ijLzYiTyufiq8YWlTEQeRzciK2Omi ZA6zhgjyW+wfXFT/DOr+tmL/PwePINz+UzYNH6/DL3scB4oq24a06v61gsI0h+ANCE xNuxCOkcoDmLLeCwCPm8Gn4xlRKRtZYul4aftNk8= 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 5.4 089/255] drm/mipi-dsi: Detach devices when removing the host Date: Mon, 24 Oct 2022 13:29:59 +0200 Message-Id: <20221024113005.468986382@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747573470326974270?= X-GMAIL-MSGID: =?utf-8?q?1747573470326974270?= 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 b99f96dcc6f1..bb7f72ade628 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -300,6 +300,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;