From patchwork Thu Jun 19 19:15:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 898241 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93E0A221F2D for ; Thu, 19 Jun 2025 19:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750360670; cv=none; b=F/VZOuBlFyQrqmUzOe0q2sKd8Al1XA6POujjdFmsjuAu/v78AMsFFXPxYGulh+SYW0yQ8PSeBdzC5ajM5h78+ML7Nr3mtc7mayWvkOY6+Hc6y24LxXkvweA6k1H4KWgqaXPYZ5K9vNDgksVWMCTO/Xso4HU11Yk0nL1EpCC2i7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750360670; c=relaxed/simple; bh=gduD5wUHpyegnOzCbwQD/ohEcVXwZ6Qjsy8tHoT5140=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QDBZIzjv1wkEv7AYRcfuOUzDHkElWaFKzUGd8gW8I7xAFLqU/sf+zDBkBSKd+hnsWT44NRFnZyJc4yQuk/IuqUCGnx3YieigR2zV9oU/Wrv4V24PfUyaTcqSnUSyJFsp/4dQTUazIyaTjAKbfrfFeizODNeUkArLaSUsPmR4L2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=WwgZgCRh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WwgZgCRh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750360667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IUZoRGl8XKKMcHwculHbrWtrVRY+BTfu98QTVEXtSWA=; b=WwgZgCRh1cDw5ppJNvIWO09V+d0IqpCgdyweiNPTfCUBbmFco5rr0xM+6TZukR+LQXWS9J KP73/osVuP5YCM8CgXC8OO3boTbVHUHICQsdpK52iB3jq9BCo/M9G006LxODBWCIxa/zSX Wss0VRM3H7nJ9ugie/ZgWmhtgqOfIFE= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-451-f2y4jO45Nymi3edFtLyl6w-1; Thu, 19 Jun 2025 15:17:43 -0400 X-MC-Unique: f2y4jO45Nymi3edFtLyl6w-1 X-Mimecast-MFC-AGG-ID: f2y4jO45Nymi3edFtLyl6w_1750360658 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 22B8F19560B2; Thu, 19 Jun 2025 19:17:37 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.132]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A25BB19560B2; Thu, 19 Jun 2025 19:17:26 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 19 Jun 2025 14:15:53 -0500 Subject: [PATCH v2 01/16] drm/panel: get/put panel reference in drm_panel_add/remove() Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250619-b4-of_drm_find_panel_part1-v2-1-0df94aecc43d@redhat.com> References: <20250619-b4-of_drm_find_panel_part1-v2-0-0df94aecc43d@redhat.com> In-Reply-To: <20250619-b4-of_drm_find_panel_part1-v2-0-0df94aecc43d@redhat.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Inki Dae , Jagan Teki , Marek Szyprowski , Andrzej Hajda , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Chen-Yu Tsai , Samuel Holland , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Biju Das , Tomi Valkeinen , Alain Volmat , Raphael Gallais-Pou , Stefan Agner , Alison Wang , Linus Walleij , Thierry Reding , Mikko Perttunen , Jonathan Hunter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-samsung-soc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, Anusha Srivatsa , Luca Ceresoli X-Developer-Signature: v=1; a=ed25519-sha256; t=1750360565; l=1124; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=gduD5wUHpyegnOzCbwQD/ohEcVXwZ6Qjsy8tHoT5140=; b=Oc8qrV8Xj2Q/G9/VWGYSxA7a4bUjy007RPXT1RvRMyIzkygFnbR0TsmFakVD8oLlQuIsxGR7A XCtuG3cA2XIBC25fKaqmKD56QVrKK84HAg1Zy9PbKqqUleSQ2f/gc6A X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Take the panel reference and put it back as required. drm_panel_add() and drm_panel_remove() add a panel to the global registry and removes a panel respectively. Use get() and put() helpers to keep up with refcounting. Reviewed-by: Luca Ceresoli Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/drm_panel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 805b4151ccefd8ec0107951162c3b71446102ffb..ced6b08923b2150ebda6e1d9001517103895def1 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -80,6 +80,7 @@ EXPORT_SYMBOL(drm_panel_init); */ void drm_panel_add(struct drm_panel *panel) { + drm_panel_get(panel); mutex_lock(&panel_lock); list_add_tail(&panel->list, &panel_list); mutex_unlock(&panel_lock); @@ -97,6 +98,7 @@ void drm_panel_remove(struct drm_panel *panel) mutex_lock(&panel_lock); list_del_init(&panel->list); mutex_unlock(&panel_lock); + drm_panel_put(panel); } EXPORT_SYMBOL(drm_panel_remove);