From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796206911; b=HcelqnC0sm8YKwQthfpHwMRvMX3jXTRaWps95KwJowI37dRFYS07EtkBVSr3CaqOxa7Y Qv2ZdbumGWHgmMl0mmpQDpMrJbf2yq2Y9IYWGmHrh6JA5Y+og6fDzUQ4YY2NXuGsSiaS/ K3rE29e84e6s/n3Wic0eWjOdwKuY9j3KOOng5S/9r2F3ZktHvSieHb3i5x3x6eDYO7C0q K2pzsLHjvMYZYRgF4IAMhFVsyhYZWCTiS5GIVa+iFYSoqgNF8hfVQPd23oyTxCOrzfc8Y h+uU+6vxMuxLLZcCcYZAigLUsVZIXAgMK36nf+Ux5cNWAqK/v3Bd4NZcpwWdFFjzZyg== 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=2/vkVlLw9WxnuEjVGPxxzMlIoDn/qKzFT+NObfSQZSe3NsNXR01hUP+mDWDPFzA1B5+F Uwqsn6mVdHFSDKmDeegrVy3vbQ18piG4GLD8Hlc+SfaFkVNLPtoWqQ35GS99sfEzReKzN /J7azuWpGB4TTO0rsG9X7+awyPaHNUkdThTQwRsBfNq4INZoGq3scCNlMFTSrMRwAHR8Z zYZ1q2aZOYY6bjyD3PE9yP2gK22dV2ZSx1QVrpih9+L9xhY4JL26BEk/KXPxslh1GJgqU JvKHZajQJhUGy9pH/e0smNsiUrGA6swZpX2CcegZ1JteTLBl0uF81N78CxuYBwLu3Gw== 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.47 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 7EDFC606A339 for ; Wed, 2 Dec 2026 10:21:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7EDFC606A339 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-f47.google.com with SMTP id 5b1f17b1804b1-4bbcb9bccf6so18847525e9.1 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=DRsdpL1kSwPQhxjqD/Sn+sRT5tqpmCQoUddmF6/kYEGYwbeSU5qHFfn/QiRFqPbjst gkwHJhkJvflTbb3Ff51C34RU7lGZJZiU+qjaSShQM0HQXeWUWC42rOnStGMkoXahjgNV 7mInAlOuN/f/xxyz1ByvzEgnZjaoDrYhdBwEMtU6+Ez36TYeN8gFJxtgtpazGSXgNj26 i7mYQgVYqdw19P6sE3arh0fwZHSp8cJ89wvJi0Rr5XsFDD8iwo6oNB5IVlx5ozwjKxmK +k23gbfvtiFTgVPdmGndY48U3v/akb2z5PyEGXNc8MimoYTJV6+0nmpKteKikJAjAwDl Fl6Q== X-Forwarded-Encrypted: i=1; AL+hErH9/yUE570aOMUrll/fGNun/ggKZNKdp0sLfqmNcWt2q1Z27u1tp1iaRely6UyHz02Vv5Qbao+eGE41@vger.kernel.org X-Gm-Message-State: APuU4Z8+QDLdMRlCaU6CFX0CBnuvDFsuLIW8fRjy/Kz15eErIlR5VO9W yvru7ASKeVgiSDTmvJSPFWUXfaW3jqGArnqzdwqj9UvEidmrOQEBLp/OBlJAFt3x8ik= X-Gm-Gg: AZFdTZcJTK6LQDEXS4QUXd5AFDG/G7Th2goAUdWjJJoN0cyQ49HLZytSZBtmuyMIFF2 6fFtGl/v2V9JeXgy1+VEt1D6rJ82YA+CmOSBxd51FqixNSs0tgW9EkAOsBIMZ8qZ+ZhkP9d0KIL AXr7m3W+mX1rQEF3t1OtyYDmh5WwMCd97NvyIvzj4xA5hzUcrHyt4o3ma3soD3qPhucQqAERCdf 2yD4dKogkcO1wsgGKdkBPpebLmPAFQNvWET8MopRn7J1UxtG9Frfhjw8QPGadlUB6RspkwTJqQ1 FF0SXXfdwxeCXBJBp50iz9B3huc3LxI6te10r4psBAf8sOJBiDrwlbiciynLlJe1gXoW3eHzuq5 Au78YR/QufFpMs+mv9LyrnshZ1HzLNRO5jS4vsx4NXHC4mY22EPqocF5qFQISUwqvDLsUgTxrEC vNRdlErVhmbSHeOb0lPPAXcwNsp+yXe/yeoFjHRM+C7/OME3qnj+DDfJL8C26UKxuz8cWOsZkeK dGO8ypMP9hI9sIMdW0HnQDhog9qhuU91fiT7P551IBTyymNz3K02RMK4bMaAbOL9lnp0vc1UCGH XmUJCfdTEwWTk6gP/7dpuVMYeW7PLqW0vQHS1+6ikfvDhzQQcevxn+9k 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: devicetree@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