mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Rahul Pon <theflyingrahul@gmail.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: geni-se: don't fail ACPI probe on a missing SE clock
Date: Tue, 13 Oct 2026 12:48:05 +0200	[thread overview]
Message-ID: <389ce112-6a15-429b-a8d5-84149a6ee9c1@oss.qualcomm.com> (raw)
In-Reply-To: <20260930111627.1121-1-theflyingrahul@gmail.com>

On 9/30/26 1:16 PM, Rahul Pon wrote:
> geni_se_resources_init() tolerates a missing "se" clock for devices with an
> ACPI companion, whose firmware manages the serial-engine clocks, but then
> calls devm_pm_opp_set_clkname() for that same clock unconditionally. It
> fails, so ACPI GENI controllers such as the I2C IDs QCOM0220 and QCOM0411
> no longer probe. Before the OPP call, the error pointer left in se->clk
> would also have reached clk_get_rate().
> 
> Treat an absent ACPI SE clock as firmware-owned: store NULL, which the
> clock API accepts as a no-op (clk_get_rate() returns 0, so the I2C driver
> selects its 19.2 MHz timing table), and skip the OPP clock name. DT
> behaviour is unchanged.
> 
> Found by code review while bringing up an ACPI-booted Snapdragon X2
> laptop; compile-tested with arm64 defconfig plus ACPI and W=1.
> 
> Fixes: 5b8a39dcf909 ("soc: qcom: geni-se: Introduce helper API for resource initialization")
> Assisted-by: LLM
> Signed-off-by: Rahul Pon <theflyingrahul@gmail.com>
> ---

I think this fits better:

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index 5d524d9a7373..70a3bf64ffed 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -1350,6 +1350,12 @@ static const struct geni_i2c_desc geni_i2c = {
        .power_off = geni_se_resources_deactivate,
 };
 
+static const struct geni_i2c_desc geni_i2c = {
+       .set_rate = qcom_geni_i2c_conf,
+       .power_on = geni_se_resources_activate,
+       .power_off = geni_se_resources_deactivate,
+};
+
 static const struct geni_i2c_desc i2c_master_hub = {
        .no_dma_support = true,
        .tx_fifo_depth = 16,
@@ -1366,8 +1372,8 @@ static const struct geni_i2c_desc sa8255p_geni_i2c = {
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id geni_i2c_acpi_match[] = {
-       { "QCOM0220", (kernel_ulong_t)&geni_i2c},
-       { "QCOM0411", (kernel_ulong_t)&geni_i2c},
+       { "QCOM0220", (kernel_ulong_t)&geni_i2c_acpi},
+       { "QCOM0411", (kernel_ulong_t)&geni_i2c_acpi},
        { }
 };
 MODULE_DEVICE_TABLE(acpi, geni_i2c_acpi_match);

But I'm still a little unsure about how the clk_match logic plays with
lacking a clock. 

Konrad

      reply	other threads:[~2026-10-13 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 11:16 Rahul Pon
2026-10-13 10:48 ` Konrad Dybcio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=389ce112-6a15-429b-a8d5-84149a6ee9c1@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=theflyingrahul@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®