From patchwork Sat Oct 22 07:22:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106287wrr; Sat, 22 Oct 2022 01:37:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5M15HsUifwa1sN2b4aeoOMW8cgDfnJOZHYojHdk/RUfHppASmfORzusHlLhF8l5lZeSWCq X-Received: by 2002:a17:903:186:b0:182:ecf9:6227 with SMTP id z6-20020a170903018600b00182ecf96227mr23637512plg.70.1666427845323; Sat, 22 Oct 2022 01:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427845; cv=none; d=google.com; s=arc-20160816; b=az3e2sS+xfNeaHVeaXl4WwL9BM1Ou5hIOxNCcODzxjYBk/Me62jTTNPNtP5m3ijnJh 6O+3Iahl8Wsy8oIjrZucFBogtLy6zI1JiFFCiV3EXPnbOb6rfWr0zluhpJVOUzS98YVL gYV+qwNEK2BqJRipUBg8ZRg4gxt0DxPyKY6ncQGuvsxo5o/puXtNn6yILm0sq00PteoI LxCysvByN59UkFqj0P79TI3nCwfHxgScxACcL0A6hQDQBhcqmntw2z+iytPpodd6q2z6 5p2wwJqFJsqLTGlOSKXsGpKju4+KXhNrXSamo0oEBMMjICj+o57/BgOmcHSNba3HbOTq tc3Q== 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=pYwhLFZiUeP2h3tEcszipLvkPOELhk0OpaIfhgBrjww=; b=VZyUYNdOQTdNUi3mst0/7dbG/DhUXmlCGzKWpPXQcnH4xeaxMrlVJPI4R/oSUp7Ijh XjGopaX4LJXpk+IDYvWHHyRPb8uwJxB+Q23ertRs7+nRfyc3oyLY1JOfdmYF5OwohdUz UsQ8Ai2j1nK6rNlvmyhOmj7cz6FmpMdNLbP6RY+QLHRubkDMIlCjlOuM2uZhls9meQsC 4UQT91Ge61DH6ovhlvT11v0Kt2sUuStgXsN5cBY9IXs+CZxTM0I3lYcG38fZUysiC6yQ k2OMH0KA2Ak8ILAuF0BXh/YXnmO24QnJlSY2v+taROm/uoaJeT9atkVY/nyCSnB6pooY JB3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vvZ8vyPD; 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 c134-20020a63358c000000b00439cc644c03si27583190pga.228.2022.10.22.01.37.08; Sat, 22 Oct 2022 01:37:25 -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=vvZ8vyPD; 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 S230062AbiJVIcs (ORCPT + 99 others); Sat, 22 Oct 2022 04:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234070AbiJVI3b (ORCPT ); Sat, 22 Oct 2022 04:29:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B43862E32C8; Sat, 22 Oct 2022 01:02:03 -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 66AE7B82DFC; Sat, 22 Oct 2022 07:48:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2FE1C433C1; Sat, 22 Oct 2022 07:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424925; bh=QhYu81M8WtAo05jbsad99FIeUifFSmuabQ0GNCOz7wI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vvZ8vyPDSY0WYLnikL/ahwL1htyv2K4oXkpUO57fbYRMf6bWhnN6l/s2mDNQEzvtU UjGw9kuAeEE2J0ha+CX+oFy6siW7jo9rkOmK+Tj0v8QJIoobvF/P4g4VLJ6w5Um4AY dfuv2byvEmcuLA0g1OPMdJ7P9/C1J8lPyyoCbwc0= 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.19 298/717] drm/mipi-dsi: Detach devices when removing the host Date: Sat, 22 Oct 2022 09:22:57 +0200 Message-Id: <20221022072505.704974634@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376244547528292?= X-GMAIL-MSGID: =?utf-8?q?1747376244547528292?= 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 c40bde96cfdf..c317ee9fa445 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -346,6 +346,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;