From patchwork Wed Oct 19 08:27:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4684 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp212978wrs; Wed, 19 Oct 2022 02:08:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5surA0M5t59gXXRvjCgOu9OtYTyTb/ZUt8OQSDs56bIYujm8TRDcrceXSWf6i6AB29CZLx X-Received: by 2002:a17:907:75dc:b0:783:9c71:5e20 with SMTP id jl28-20020a17090775dc00b007839c715e20mr5903683ejc.125.1666170530415; Wed, 19 Oct 2022 02:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170530; cv=none; d=google.com; s=arc-20160816; b=i0jjO3seVbaLxrsRHFShwpodSTijUPpgynrbCKpJ5KTbiCd7llKvf+IOAuJhzb/v4q bKjNw4IWqqCaaVApnZZQRfQUjOInxHkKf3tqwx74BjQdSzyoFAVvUiFTGxz2RIY1aKwY mQ1zstT16JVHcMe6Tlos7juyuNdmOTgpgAnecWCjgMjIxZw4UwhHRHoinboXFqxL/ER1 Jj5syXfW7ChSv7vxw7aEW1r4WQAlWJqYUxqd0q/wJny55/tJ6HX5M2El7VEOUwalbLex xyZn/66jQxdnQFjtyASHt7JKvG8lcWutde3LETYSMa85bfmFdZBTP9ZML4kg/bM/33RJ pG8w== 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=6SuWmLSUfcXoD0M8eeBEyhf4Y0NcQfMogjFvUOZaANY=; b=nYoQKqvepCK3WGjjgPAPxqTK9IYCVvOq8IYm7SYgrEOA60FZvskHMCNw39cSA8+hBZ zI5pzimvXnRHcFvrOdFhhR6Q14H14VzVY/t5CYc30C8OwyotopGaeUz2HpBgaQNYRJnV WKamvyAPAqlOgeTToXjkxvdzwiy8HZf4gdCy3ZEzKI2xBTRfmRs0qem4bI4ldPD3Iwsk L5I/dbEqViOvamKp+5s28ahheq7vEB6kLKsdM4vn+1fqUBnIxT4/uVjty4qS58ytVBxb oW96f1YO/cIXxLTnxHMyL4GkD4WafVGCnMXrfFw1+OSxEVJcN9r711TJ0ANVDlNTZOw2 2lPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fX0/fdnO"; 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 o19-20020a170906975300b00787b0b0a96esi5410313ejy.131.2022.10.19.02.08.10; Wed, 19 Oct 2022 02:08:50 -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="fX0/fdnO"; 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 S232184AbiJSJDG (ORCPT + 99 others); Wed, 19 Oct 2022 05:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232248AbiJSJB1 (ORCPT ); Wed, 19 Oct 2022 05:01:27 -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 87D0A6B145; Wed, 19 Oct 2022 01:55:30 -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 4C37E61868; Wed, 19 Oct 2022 08:53:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C81AC433D7; Wed, 19 Oct 2022 08:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169632; bh=XnpClHE9RQmHtFBJmFrb2Cl9NXJDMVz8DiOdTVUb21I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fX0/fdnOFdDPF9F3oQbTmiRPeqRJCtt+A3qYB/sndfUfcAY6Cvh2/NlkuwTJ2jpZ1 ZGE0ykDR5/OlgggLrefEoKwQemjC5MYVAmy4vlhGPdOensph+OyaZw6NGOZICZjcrv KPP0XQksb8k6qMLOBpouOoF8xk+igPYYM63bc0Lo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Zimmermann , Dave Stevenson , Maxime Ripard , Sasha Levin Subject: [PATCH 6.0 350/862] drm/vc4: drv: Call component_unbind_all() Date: Wed, 19 Oct 2022 10:27:17 +0200 Message-Id: <20221019083305.514238398@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?1747106430266135724?= X-GMAIL-MSGID: =?utf-8?q?1747106430266135724?= From: Maxime Ripard [ Upstream commit 6cf61bf49c9bdb9ba2d33be812d90dd406326c6c ] While we were using the component framework to deal with all the DRM subdevices, we were not calling component_unbind_all(). This leads to none of the subdevices freeing up their resources as part of their unbind() or device managed hooks. Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220711173939.1132294-13-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_drv.c | 14 ++++++++++++-- drivers/gpu/drm/vc4/vc4_drv.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 292d1b6a01b6..6b8dfa1e7650 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -267,6 +267,13 @@ static void vc4_match_add_drivers(struct device *dev, } } +static void vc4_component_unbind_all(void *ptr) +{ + struct vc4_dev *vc4 = ptr; + + component_unbind_all(vc4->dev, &vc4->base); +} + static const struct of_device_id vc4_dma_range_matches[] = { { .compatible = "brcm,bcm2711-hvs" }, { .compatible = "brcm,bcm2835-hvs" }, @@ -310,6 +317,7 @@ static int vc4_drm_bind(struct device *dev) if (IS_ERR(vc4)) return PTR_ERR(vc4); vc4->is_vc5 = is_vc5; + vc4->dev = dev; drm = &vc4->base; platform_set_drvdata(pdev, drm); @@ -360,6 +368,10 @@ static int vc4_drm_bind(struct device *dev) if (ret) return ret; + ret = devm_add_action_or_reset(dev, vc4_component_unbind_all, vc4); + if (ret) + return ret; + ret = vc4_plane_create_additional_planes(drm); if (ret) goto unbind_all; @@ -380,8 +392,6 @@ static int vc4_drm_bind(struct device *dev) return 0; unbind_all: - component_unbind_all(dev, drm); - return ret; } diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 1beb96b77b8c..950056b83843 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -76,6 +76,7 @@ struct vc4_perfmon { struct vc4_dev { struct drm_device base; + struct device *dev; bool is_vc5;