From patchwork Mon Oct 24 11:29:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9652 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp534296wru; Mon, 24 Oct 2022 09:10:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+LKf89isA5YURYn/BdQ9OVRgD3AP5Plhvw+haxubup6F2i/fNT2r938FTqd4gdOwt6mEv X-Received: by 2002:a05:6402:35cc:b0:45d:442:1765 with SMTP id z12-20020a05640235cc00b0045d04421765mr31678457edc.51.1666627854933; Mon, 24 Oct 2022 09:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627854; cv=none; d=google.com; s=arc-20160816; b=YWALcsFOspNU5SJjqto3YZWGI+0yIpNVpdfrgFlm4fG6uOLx5BpeLPpRcJqGuJX+0v L3VoUhTlPdufjeS4xVlK7VjhZnmlZE8jovmzPNg/HzXhPsa5FVdBeAzogq6qJxIUEtj4 ePDLlBhek394BEUoWmkO/MHLTLoCRhba59TxUOdJEeYnnF4XW6kpXddLyUZytHMfffO5 /rxr5c7aZs7rGqaGvMQiad8znZJf2YmwQqjZR9+QLZWAr3SmPodekUETtaVYLtbaX98D fXVQII3dLBlqBdZjStpfkMIcJJa6BOWWONpb2XQJur4p0RtGV4gATy5W/MjhPFme25Es ZHDA== 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=RAx6rLVJjn5BmqZ9cIXNrbm3R9fkMghF1ej2DK+Wt2U=; b=zUhXcfi+TXRWuMprYUoGjaECpW2kSlKUfiaqWaSCfG/jtv8LKVYe0/eGKsTDYnDCHA HHjbLvFr1dpOEEhU8M4jCNojYagKmIVAqYOukEALPa2/Fx9DyE6z4GXUFkDOqyNQsuby ZXpGDqDrij1rDpj36lPiOs507h/VDwrbHA7YpI+aa5qAF/4Bxvmkt4nNyJ0XbWZjyEUt 78Hv/s1+xAx1qe3ARFlDax8VuqcbrvuUmx6mH2x7wwnfcuii4gSFVA3KXQrHM22apIaU bl0uERMd9R+ehTg67v5wMuxlgXdFXf5v1OoC1PIsMkgfBaTbaKUV/klt/PB5LHmP9QgA 6PlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S5FeFbQn; 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 qw5-20020a1709066a0500b0078d9f02b452si102655ejc.861.2022.10.24.09.10.29; Mon, 24 Oct 2022 09:10:54 -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=S5FeFbQn; 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 S233430AbiJXQIP (ORCPT + 99 others); Mon, 24 Oct 2022 12:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233338AbiJXQE2 (ORCPT ); Mon, 24 Oct 2022 12:04:28 -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 83F032655E; Mon, 24 Oct 2022 07:57:10 -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 7808BB81620; Mon, 24 Oct 2022 12:22:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6358C433C1; Mon, 24 Oct 2022 12:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614132; bh=w37r33LIb9FKUf6H97lfeWvSi5XF2Tniw+6hjdytPr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S5FeFbQnw6KlFxsoRm9FHtII+Lsc418GE6m02vPVlDn8uNd1gJUR8XQsAdT44R8sS 0BMuYMNnF0IO0DXTxKuFQ6symKJqFaXFgk39GDCrm726KMRrxfIdvXsdI9CitGfSJO 7ygeLMr00PZwUU5DnY+Tx8rbJr+92Rd04kVngHas= 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.10 143/390] drm/mipi-dsi: Detach devices when removing the host Date: Mon, 24 Oct 2022 13:29:00 +0200 Message-Id: <20221024113028.765547276@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747585969558811378?= X-GMAIL-MSGID: =?utf-8?q?1747585969558811378?= 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 5dd475e82995..2c43d54766f3 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;