From patchwork Wed Oct 19 08:27:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5288 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp281305wrs; Wed, 19 Oct 2022 05:01:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7H+5RWZ5ciOFHvaUFE7HOUZCVOQ7l56o6yWMl1ZZ8X8t4vPmdVqkN24eWRnErqGXZzwz/D X-Received: by 2002:a05:6402:26cf:b0:45d:48d7:928e with SMTP id x15-20020a05640226cf00b0045d48d7928emr6865196edd.275.1666180913168; Wed, 19 Oct 2022 05:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180913; cv=none; d=google.com; s=arc-20160816; b=T1/6w/C70UWNsUZgHB0YiQ9dznhy0bveWhZOOrPm+RhPoLLVLR4mdXEPbMqWwemvOE w+Hdc2mOfG5R+ZHKmsK7eaWaHVE+SrD3arwoC45HNjVbenxu33/Dgk0J7sQDloLQgC1H EQfX9+X39g6bysMoS+tuJTPCd9J+UL918oBs5+cF72Vu5rQ/Y55Q+k0/SahBAKUJFQVf 3SfxcEXbJoa96Spi2l+OBmIKq8QoS7bZpE/VxHlQbFmgg25b7pV0zUHi96/PlnvdR/VO r0SuARmj6KQhWP2ZV7mOytt+Y820nOG8qlwZofxhy1zPt6vxVQ1UJIoz380Z2TVO0KpS 7PUA== 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=wNRv+ZIyyRgM3KFmImxQ1puCoFO4Mg/Y1L4QIacHm90M3zvZ2rDGb2D3indjGJFFHJ tIzgsV/J+75Qt86ITvN1y/R0YCizdaHEGTABdnCeosRXwclYM76nS+GnC8JAClgZtj2D Qu6V/wTUCdOLwp8HXQFbRAWnEur/JbmE+zoXcoKM0F8qhyNXdeun8m0+5BdRjnlL12Lh eiHgD37hBb3z4CI6WhAabide5W1ROH8grkI+3fM5Oee/vToydFqHHR2Td1bjf2gle1OP WLidbxxSHKueJEenjFNgH8T0/rjx/6XcBwU2M5kPKjGAMGLjY6u3O0eDAE64tizCBP64 Sv/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pZrrTJgj; 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 e6-20020a50a686000000b0045cf1500ffesi13206467edc.275.2022.10.19.05.01.23; Wed, 19 Oct 2022 05:01:53 -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=pZrrTJgj; 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 S232096AbiJSL4l (ORCPT + 99 others); Wed, 19 Oct 2022 07:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231512AbiJSLzo (ORCPT ); Wed, 19 Oct 2022 07:55:44 -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 1FE8423E94; Wed, 19 Oct 2022 04:34:41 -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 32A38B823B9; Wed, 19 Oct 2022 08:53:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99B43C433D6; Wed, 19 Oct 2022 08:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169630; bh=QhYu81M8WtAo05jbsad99FIeUifFSmuabQ0GNCOz7wI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZrrTJgjFSvo6CRT8Qu87FCHPcHzS4fFPz+SVWRY//zoXQxIL00kB64cKBy0URuC/ vwsBcT9iq5qS0Sj+6J6uQfcFEsqHEoFUWDfpEkebRyG8uPyCgLady0M3dEU8EejUru xbcTNNW40s7j0LymleL82XJevpejdoM2jATjhYRw= 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 6.0 349/862] drm/mipi-dsi: Detach devices when removing the host Date: Wed, 19 Oct 2022 10:27:16 +0200 Message-Id: <20221019083305.464236614@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747117317690124004?= X-GMAIL-MSGID: =?utf-8?q?1747117317690124004?= 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;