From nobody Fri Dec 19 20:55:40 2025 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 923751E521E for ; Thu, 5 Jun 2025 03:46:39 +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=1749095201; cv=none; b=KIQVnluUQjaHpaJ4XOjTEmVbXBy6N4PcbVGUbPM7yMJYAwmo2GdhBiikeuZnVJGtMIxm1deme3CDu5UwFo7lSEBkpuIqGsAlfCxL4RcpAM99cLib8DATzhBi+Dc0Kr91A/lcx/v0AktaPlVCmVys9D4nSsYAh0ClCiC1pQ5nQNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749095201; c=relaxed/simple; bh=9zlGo30GCNSbMrsJ6h0xg1RV+1gEkhPqt5tGuwTBh00=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZpK63nt9uGE6/B+5sbN4c5GRSa5MxUdFAaKs+ZHMoiq+Az+9XU0Fonm8MM1yeSM38vDqpO4btRB9Je8xosgcSxU/ZoDpaS3/1EX1gLlZH+0GgDFyU3n2iVo4r3VZi1OiJAjyLNFl3UL/YVjkxinMCxTr0qmEuNiikS5ECQHGpHk= 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=IhUP9KHd; 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="IhUP9KHd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749095198; 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=ZXHAO2+jY1bXsxo50PiVK4q6TUh1IfN7fKlHU0JYCOM=; b=IhUP9KHd/bES8nXrHG62MrrWJ7BquO2Vtq59usoU7UZq5zaMqwM1/iLdAm6bQEEHIj4/xW E+xuSyD1lVcemiKse1IlOXXAPKfwV3l/f0OvtcGS3bRKbfBCgWPaUjFtNyVRV6m6FoHQcK O7Pu6Ovcld4TTrADrTbA2jt/+5ZIk6I= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-WRIv9wjSOb2byFW1NMyImQ-1; Wed, 04 Jun 2025 23:46:35 -0400 X-MC-Unique: WRIv9wjSOb2byFW1NMyImQ-1 X-Mimecast-MFC-AGG-ID: WRIv9wjSOb2byFW1NMyImQ_1749095192 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1ED9D180035E; Thu, 5 Jun 2025 03:46:31 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.229]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 284E630002C3; Thu, 5 Jun 2025 03:46:24 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 04 Jun 2025 22:45:10 -0500 Subject: [PATCH 1/4] drm/panel: get/put panel reference in drm_panel_add/remove() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250604-of_drm_find_panel_part1-v1-1-c632e12e131d@redhat.com> References: <20250604-of_drm_find_panel_part1-v1-0-c632e12e131d@redhat.com> In-Reply-To: <20250604-of_drm_find_panel_part1-v1-0-c632e12e131d@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 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, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1749095111; l=1068; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=9zlGo30GCNSbMrsJ6h0xg1RV+1gEkhPqt5tGuwTBh00=; b=PwnWFuSL2mOqVpmilI7vyag4kWY0qQx64BLJk5k/blISrap7GAOY6KekL8K+39wUERLlVUEzo r6A1ALUIQJVAHBbQoY9hPNQ3uFgAdg+lUDedlFvVmd78a7utw8mk4A0 X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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. 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 fee65dc65979d6c03753967cefa6d5c4e597277d..ffa3428b5f52c599b53b1fdc0d0= a9181a47c91d4 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); =20 --=20 2.48.1