From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B36FD424D62 for ; Thu, 16 Jul 2026 13:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784208220; cv=none; b=NtJqgK/ldV4DeX/tijxzs3edg+eGW8Q+LRo/KPBsOKWnTxsvsPS30o3fPwnUN0PoOL0SwSxgKaA0SUKcIEV7YDnuv8bMCnPtCAXDwUdnZ33Yv3dp+Ri5e7h0DKf5V0/OoF694lojAphcQePSa+3OaQGRaVlBqRCDiIKjS8ZJc5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784208220; c=relaxed/simple; bh=xLr9YCaNXO1/uD7EftTyXdiUgTcI0CrT7UBgc0dcILw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Uzt9Zy2Nm/5IlhHsu9dBAXizQK7br8MfkHsulDF9yFxD4i1kAQNGyRcSEWIcvjm3Na3C/65LdQxAsIPA4YuwufbtyP6bRmETY9XdK2XdYpB64a8QdhVm6FkmG0p6i4liYOH1qI88RiPjokkM/xp0UCROi5hcES6ZPzz/Pa6rMRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IowfboUh; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IowfboUh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47F7A1F00A3E; Thu, 16 Jul 2026 13:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784208218; bh=DQd5hmt1V3Fks8f3fFFJfaBxLsLUIIZKU1MWSoqMvKE=; h=From:To:Cc:Subject:Date; b=IowfboUhr8P42HNe1BpcpBM9FTRvF92Ti3r4QpbhkopVRDoCg/nR0M7X4HVOq1uBT KhxlmBxfMskfqXpa08SyIyGuh4CWIhbtAjmtaLPREUgfqwZ3Y/J4bC/gMwybLlVNAy PYn7XWg0/nt8j3NN7srCJAizVG4tR8e7uBWDe2wquCr0o976ldo9p+T5pE5ulkP4u4 aoif53t1l4X9rDaI5yor1cfIOR1/oiSuMpestD4LOr95HpNKrmsO3fLCodW0dy5aL+ cDxC4ESEZAVuK1yNWlXQGy31q5Ten4EDSrKGujkpW3rEYeidfUmIR31mRRzfk0kfxj XT6gnwUe7Knuw== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wkM3s-00000006ZBB-0gn1; Thu, 16 Jul 2026 15:23:36 +0200 From: Johan Hovold To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH] drm/panel-simple: take i2c adapter module reference Date: Thu, 16 Jul 2026 15:23:34 +0200 Message-ID: <20260716132334.1565183-1-johan@kernel.org> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The i2c subsystem currently blocks during adapter deregistration whenever there are consumers holding a reference. Switch to using of_get_i2c_adapter_by_node() which also takes a reference to the adapter module so that an attempt to unload the module while in use fails gracefully instead of blocking uninterruptibly. Signed-off-by: Johan Hovold --- drivers/gpu/drm/panel/panel-simple.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index c09bf3db5e78..f58e83aa4ebe 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -701,7 +701,7 @@ static struct panel_simple *panel_simple_probe(struct device *dev) ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0); if (ddc) { - panel->ddc = of_find_i2c_adapter_by_node(ddc); + panel->ddc = of_get_i2c_adapter_by_node(ddc); of_node_put(ddc); if (!panel->ddc) @@ -746,7 +746,7 @@ static struct panel_simple *panel_simple_probe(struct device *dev) pm_runtime_disable(dev); free_ddc: if (panel->ddc) - put_device(&panel->ddc->dev); + i2c_put_adapter(panel->ddc); return ERR_PTR(err); } @@ -791,7 +791,7 @@ static void panel_simple_remove(struct device *dev) pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); if (panel->ddc) - put_device(&panel->ddc->dev); + i2c_put_adapter(panel->ddc); } static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = { -- 2.54.0