Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B50CCC433EF for ; Fri, 8 Jul 2022 09:57:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 679F91137A8; Fri, 8 Jul 2022 09:57:14 +0000 (UTC) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5892E1137A8 for ; Fri, 8 Jul 2022 09:57:13 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 2FCD732009CD; Fri, 8 Jul 2022 05:57:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 08 Jul 2022 05:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1657274231; x=1657360631; bh=/0 yRrWTSrRejQgP4eF0zDr5Zf8H9Cbhesbm/Gr09mGQ=; b=oxy1Xly6c+sLe/p/Uz feNQ/hYPa8sdMJiGHPCRAyvSXlDmaGjGiuHiW0Q1TsG2+cMRRneDNJm/rzmP8V0a zi7AcnYsj/DtvAY9Zekre1pjHmFEBhBKtgclSzsPG4DPa9rMEke7GOi40IusjyFi kRrF3Emldlc7m0Q5fujCGJS0YQHhT6bdgQATT0aaQF0Kc2FjMVoOMIO/+CPvwoRK yk3LL0aliW+HNQKplcU7hkyhka9Q3bEyIBeZbyfyk8qrrQjllpApcTmeKT0ClkMa dpESPb5HwTebfX5ZfH6xI7wK/rNZLdDOK5l+zvLED2YluMizYH7n4SRSWmWDKUfk uhbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1657274231; x=1657360631; bh=/0yRrWTSrRejQ gP4eF0zDr5Zf8H9Cbhesbm/Gr09mGQ=; b=sZljnhFFNyXv1S/KeJOye0gcKP+Xr JeQajiTwZHIVwN+DY1y3wX2gkVLbdVRMv/PiVk8BkoPdA+6QFGRs0cl7n7v68nDb 3VpaNNnJ4ROlfARP4ishyzKHvwgl/2pZ4ehixaBkMeoIHUMAP18nE8xLZwijUVTP SJPPM0y12RdKqwMKza+iA2kATfURB2EZrsFwMtCCps9axt/HtpQeyaNVgEdGbIHs 8w9MQJ6lX+Ld13LyBCaknTcf2+gNT6dJVJ2+qvRdBQsfa0ihH30u6Ppu25ZM1v7d ZCVsoeMKDIIiLYDHL6crBVw5OighnS5OY+JZVdEYQC+lIxSIp6s3eH5RA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeijedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeelkeefteduhfekjeeihfetudfguedvveekkeetteekhfekhfdtlefgfedu vdejhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Jul 2022 05:57:11 -0400 (EDT) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Subject: [PATCH v4 01/69] drm/mipi-dsi: Detach devices when removing the host Date: Fri, 8 Jul 2022 11:55:59 +0200 Message-Id: <20220708095707.257937-2-maxime@cerno.tech> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220708095707.257937-1-maxime@cerno.tech> References: <20220708095707.257937-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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; -- 2.36.1