From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796206911; b=VmrN9wgNZBQt/Q93RbBH4killhjbls1WDUozCDjuLFQzat6t+K5GU+nCh+9T+Jc38P6Q P19v7jy+FnAiQOU/PNVtBZ5oKUM1wiq5gUPsDPK8c2hJU1X5Gj1XhCEtkq5EGg0cCceN0 +89sjAduThGDl9mv5h2zuWwpdmigS4QTShiY168YLB/JLHzxiPYaPfvPK03AurGn5D6qq KUK8omE00m6CgVyPVfWhXQN2jmla2LcFrhhROKb8VQ1gD5ggqgJtGKDCtmwXTrsZszt7P EvUegzIl3O7//lsmGmebt3Q6fpKv/fqZw0qYWTH4oxYDMDRoDYS5W8/XRrFBnhK5eqA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796206911; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=MsZAqv8++J/gUsHpUybuu45lSpPUaNInQcKwOZnsMEk=; b=LkMT6bnVjMFqVFKhNDHkMfsMGji+qfKHhleC6YVN+nd5b3Nz0MNjRFpLSULetmDqQKj3 Ojrbfq90qAHAwDW/ngOunwuUNxaepAkUv6FTCaKK6HtOKrL8Jv6I9X1zNJvnlzRAhEq0/ 3DCwVPvZfXlPp9ng8CSPjBcKsI4mdYq1BgPVadruSog7Yyw1r4E6Ir9/WMwZGQGGlBeWo /Mn7IY3QTAfb8cUahLjeVNtzhzVlyWq/UzJvyRM7rkqSLwM+V/jaXw7VfI0rvyTBpSKMO SWuWhW8kzCZyhjS6P0t1fv3lmu7uj+cRrTYDaf/jXzo8XOYpjV82jVvt6j1WAnspbdA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass header.d=tuxon.dev header.i=@tuxon.dev header.a=rsa-sha256 header.s=google header.b=MDC2Ubn8; arc=none smtp.remote-ip=209.85.128.48 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B874606A327 for ; Wed, 2 Dec 2026 10:21:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B874606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.a=rsa-sha256 header.s=google header.b=MDC2Ubn8 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4bb55cda775so77821185e9.0 for ; Wed, 02 Dec 2026 02:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1796206909; x=1796811709; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=MsZAqv8++J/gUsHpUybuu45lSpPUaNInQcKwOZnsMEk=; b=MDC2Ubn8RHEuxUwMOrYO5kg633q+Vhh/f3zHAA3DnMAy4HrVhp8wuPrcCwq7Uix83T 2dOR3Ieebhd8fp7oXU/vIVGTZJI8tHEweuBpeop6GOTKQq7CKxj8asdbVpG7d6ixMrv3 lwo23fu1FCps5R/5OZH4/SoHOlPbn/o6hw+ESC4+fFHTKzEDZaO3q8Dud+5F3nLiI3sc s9th7bOAP7vd6Ihs7B7+P/Wv76REIJcZWRbApwEpuxQEy74+UiYoj5ACQzMU+TzvPle7 f6799IIjm+aKldvuJeFgLq06OLXzlFh3VienjH2rNZ/Crea55YZpaNTWdBhJKIQWaljx sMwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796206909; x=1796811709; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=MsZAqv8++J/gUsHpUybuu45lSpPUaNInQcKwOZnsMEk=; b=MJxigJ4rKgtAV30pUwyX/FJCNDGTyWKcHoU/5u0S5l/cmm2FEGyrnP+HTzXn1uuN8S /aJLKVDrQye+GzDlVz3ddFxn7uOkEC9yDqb+tIp6FeumM27OUDuMyM6o3SvF882ohtLu 3mQvWRrVlnjvneoB6NUGUzFPM4rHbqnXOLsrBpacb8Z637jyRKsXdQtUx0x1Ij5NxT/g wrmvcq5r8oeVOxeBNTvnpkaorwEFZfdcpPv/MVqIrC08n2CHnX4cRklay9jrxLBjZcvS NPiL635hVdduvqPOYoMoqb7NvhEpwx4LiZ7Zp/dzpQ7XgsiztHOZCPE6gvBRTWtVEtU3 g6EA== X-Forwarded-Encrypted: i=1; AL+hErHsneqR8YQNwmZzFcs3Ss3bc5SwHJDeXfUELFiWCIhu3QKF2h0PvKn23D3LmcQuIO88Y++/Zo1QQPqyKrg=@vger.kernel.org X-Gm-Message-State: APuU4Z8VL/ajzX8flUX1dRjKMjF1JFLLUjMRFln0kwK9Wl4ZPZlw3Q6C C9MFuxxwaguGQ+S050vRY4h+Ij1XhYkccxj27fl9EEUf8IW2AVKDAVifWx4m7IGKMY0= X-Gm-Gg: AZFdTZeJptE29ts6NcQZKJHxjaWGWoapEKibYtuCOCeXjG0jp9ZbjlDkKfLgmG+vj/e pzi7oNCW0CEy6EMG/ch0iZX5uVOLhE5Wd0B8bEaZDxqvMgH4m4l3Oi/pLCHntmKyl+5uIsCuH3y gfhBzNUC/rHtyHlci0BqNbI8XCfL/1oRhRy7nYAObMQ9V15zqzHp+N6plJgIrvDaYLr6gNtljSg nRFWgh10phYkYsxcQVErhvaOiaNeajpsjMacAXmUQDxIBvE0Vsz0kCfhZKEgauiHSHfxppTENh/ 8eQX0OvQOX5ZyCefRMajWbIdnwhuqeUPwHPmstIO7xA2UHbOAY9zCEWHiuky62G56Kq1S8UJsHQ OUEP96zi/78P13FeodsivjofxrC67jugyn5RPn0jXWcRehLGofUJxIA+yFKZGJci1Yxqd9doytz tQ+2mlohL3yfS/Xnwzti2jGB5xIFZQw2LICVf5VBikNe4n3OqT08/j8BclhU0PSSHMvWztMSSsf vCHnvLzrFnEbBX6e4SOisc6e77YOcDHYjKR0ul+5uZrzwXVuDUmsvzTaD92GudgxqH8E+Ktuq6u CAtyuLwog1I8JtfeVO4nXI/P04Arh5zNSqVk8W3WRW8kuE0X8/aPdZ+m X-Received: by 2002:a05:600c:6749:b0:4bb:5d38:259f with SMTP id 5b1f17b1804b1-4bb8881099cmr748768165e9.12.1796206908678; Wed, 02 Dec 2026 02:21:48 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.114]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884ab091sm1470472875e9.11.2026.12.02.02.21.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 02:21:48 -0800 (PST) Message-ID: <5b0fdcb1-aaf1-4b1a-a774-99fc9d403b5a@tuxon.dev> Date: Wed, 2 Dec 2026 12:21:46 +0200 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/7] i3c: renesas: Fix zero I2C SCL rate on pure I3C buses To: Diogo Ivo , Wolfram Sang , Tommaso Merciai , Alexandre Belloni , Frank Li , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Stephen Boyd , Brian Masney , Jerome Brunet , Linus Walleij Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, stable@vger.kernel.org References: <20261026-divo-ssgrlpcsrc-2966-i3c-v2-0-2e76b87209bb@renesas.com> <20261026-divo-ssgrlpcsrc-2966-i3c-v2-1-2e76b87209bb@renesas.com> Content-Language: en-US From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Diogo, On 11/27/26 15:51, Diogo Ivo wrote: > On 11/27/2026 10:12 AM, claudiu beznea wrote: >> Hi, Diogo, >> >> On 10/26/26 13:35, Diogo Ivo wrote: >>> On a pure I3C bus there are no I2C devices, so the I3C core leaves >>> bus->scl_rate.i2c at zero if i2c-scl-hz is not specified in DT. >>> Deriving i2c_total_ticks from that zero rate programs a zero-width >>> open-drain SCL into the STDBR open-drain fields, which are still used >>> in pure I3C mode for example in DAA. >>> >>> Fall back to the 1 MHz FM+ limit instead, the fastest rate an I2C >>> device could have, so that a sane open-drain timing is programmed. >>> >>> Fixes: d028219a9f14 ("i3c: master: Add basic driver for the Renesas I3C >>> controller") >>> Cc: stable@vger.kernel.org >>> Reviewed-by: Wolfram Sang >>> Signed-off-by: Diogo Ivo >>> --- >>> Changes in v2: >>>   - Substituted if/else with ternary operator >>>   - Picked up R-b from Wolfram Sang >>> --- >>>   drivers/i3c/master/renesas-i3c.c | 10 +++++++++- >>>   1 file changed, 9 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/ renesas- >>> i3c.c >>> index 8b264f72e55c..78d0a2c4a19e 100644 >>> --- a/drivers/i3c/master/renesas-i3c.c >>> +++ b/drivers/i3c/master/renesas-i3c.c >>> @@ -579,7 +579,15 @@ static int renesas_i3c_bus_init(struct >>> i3c_master_controller *m) >>>       if (!i3c->rate) >>>           return -EINVAL; >>> -    i2c_total_ticks = DIV_ROUND_UP(i3c->rate, bus->scl_rate.i2c); >>> +    /* >>> +     * A pure I3C bus has no I2C devices, so the I3C core leaves >>> +     * scl_rate.i2c at zero if not explicitly defined in DT. The >>> +     * open-drain SCL fields of STDBR, which are used for the DAA >>> +     * pending read, are derived from it though, so fall back to >>> +     * the 1 MHz FM+ limit instead of programming a zero-width clock. >>> +     */ >>> +    i2c_total_ticks = DIV_ROUND_UP(i3c->rate, >>> +                       bus->scl_rate.i2c ?: I3C_BUS_I2C_FM_PLUS_SCL_MAX_RATE); >> >> The manual (at lest the RZ/G3S, Rev.1.30) mentions on the documentation of >> BFCTL.FMPE bit: >> >> Set this bit to 1 when using the transmission rate within a range up to 1 Mbps >> (Fast-mode Plus [Fm+]) of the I3C-bus specification. Set this bit to 0 when >> using the transmission rate at other rates (up to 100 kbps [Sm], up to 400 kbps >> [Fm]). >> >> In case the i2c_total_ticks = I3C_BUS_I2C_FM_PLUS_SCL_MAX_RATE should the >> BFCTL.FMPE bit also be set for the operation you mentioned? If so, maybe set >> the default to I3C_BUS_I2C_FM_SCL_MAX_RATE to avoid any further changes? > > I checked the RZ/G3L manual Rev 1.00 and this same block about FMPE is there. > However, in that case shouldn't this be applied to the whole driver? For example > on a pure I3C bus with a bus speed of 12.5 MHz what > this section says is that the bit should be enabled. I checked the driver and > neither the BFCTL register nor the FMPE bit in the register > are defined, so if I understand this correctly the FMPE bit seems like > something that should be addressed for the entire driver on a separate > patch and here we can keep this speed, but please correct me if I am wrong. You're right, it should be applied to the entire driver. I overlooked it. Sorry for the noise. Reviewed-by: Claudiu Beznea