From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4DE3A1125876 for ; Wed, 11 Mar 2026 19:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YBScIMJyOk2WBcKrQj29qxxNRMBQoHKZVaJbMUD6B/Q=; b=mSZDAHgowB8XJx 4BuriHgoMJcaiGCvJMou5BpA6C/az70Gm786eQny6BMcGPHPnOLb3ZqFzkIuNSRDWKHQgDgR/Eq4T RIlg+ivHTpbhbFTtNCCKe7mp/faKhHKaxpPltOeZ7emXj2nTJCUXHurtLv9+fAlJXovM8/kZ24V6z M4ixaMTVy3yKSV1GhzHMnerV7dk9bRPFcg3HmUQfVKwH7jlVhmL+32IyBsw3GMO2AjmnQRUCte+6I 1s+SyEpYdjCSCkr+xdTMBJTiZJanhR3YR+4nKUrZQ0O2Ty7VwuH5WLYfV9TTRx+GU9qHebaRCsvNE uEWq+rsRghv6GD2Sd24Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0PUN-0000000CO8W-38P5; Wed, 11 Mar 2026 19:45:03 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0PUK-0000000CO64-1YVc for linux-phy@lists.infradead.org; Wed, 11 Mar 2026 19:45:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773258299; 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=GoMDbJU2xDFYUQd1hXlmSs8yylpms2iEAMhOVCgJXGI=; b=fB4ugZKSpwUpx45R1na9WzcJG03r/q3fzjvtYxP4Xp7BMFKrqYOYcfWZN1igzbhOeFmoHz A3f2gTaZXOzk7xP0hR+dmy9WvhluRUQb15h2l+qrpYXXnEPgaCm2QoHgMZo3YIbilmFX6x erD4uiXW1jvC5lWswjUr9ktZqH9sCQU= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-Xm3rRZmWOHWOdTud0DA9hQ-1; Wed, 11 Mar 2026 15:44:56 -0400 X-MC-Unique: Xm3rRZmWOHWOdTud0DA9hQ-1 X-Mimecast-MFC-AGG-ID: Xm3rRZmWOHWOdTud0DA9hQ_1773258295 Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-66308f16ea1so2669027eaf.2 for ; Wed, 11 Mar 2026 12:44:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773258295; x=1773863095; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GoMDbJU2xDFYUQd1hXlmSs8yylpms2iEAMhOVCgJXGI=; b=qntfbQ13wxllzJtv4fTP5gdajqIwrwKwJpWkW5P5hbw3gAQj0cn4c4wDf2Gmy2AlGv +PVEbM74XBBkSQgCH27auClHIFdE+zS3qQbrh8k99szQVdRnNUbqnJ7HC0Sl0ly3AJCM 9hmhX7dLWzCSWYkZDFg5RuA8WzsrJk95J45b8FoWIFku0KfNE8w1hTTy11+0kbhNfyl3 oawInvkpZRtPQPyHKcXcA5m5IYqp3UzMZea7+HyPerN4XEclqwhZ7QHi0le35Qp8nPNd Yam9uI0XW1//Q8Vg7cxuoME9XXvYYfbDizywKhUjWEUL0Wg48T7Aiz+j670EyP3a4Dlg u+BQ== X-Forwarded-Encrypted: i=1; AJvYcCWMttmQEEUKxV1C2Cxjcf2bGarWUGpttqFy1kru3b7Mpd3FPUL0DXpoRa66m9oaiANNi1knR2JPVsU=@lists.infradead.org X-Gm-Message-State: AOJu0YxCUX0Y1z2iVgJJy0isFLPnU9kGjTCfCGX9PZjN02m97TKqm1PJ BC/yy31qGVxQ12I4o5l58g6stbz6npnJ8LhH716xuAinVv6pRI640WxhiYtZEf9pDHcnMSOgh4w ecrBfQhWC3IVmS5EICJUSyAKtpFqMiuKshw3j8EXcKVIxxOJIFN8MChIygbE2FYOSZtk= X-Gm-Gg: ATEYQzzySh/63aym8RpIso+7OYRWvi9990e7Sax5UEh9VUQuBTGZHi/6OTgTEUgGpG3 5aYOzjmsPglRxBTpL+MVQ1V9zX/DYfw/zpynOhEhM69d4bBRUQc4AyCUIzL8BbCn1wnb3yDT9Td J2INxoKVqeI0Pi6mV1GLPXBdwcCCf4V/Oia02KeJM/vCDeWaEqj/faRKiFhOF2ZKR1Y8r49e24R fqR0+nXOzUSOhFqP5tZaeE8oH+IThbqX2s+d/4xb60M4vQkaYs+Jks3b5ZFQ6YzcaL5N3gWiJb/ jiIOdt6awCDQ8D7T7cMIvpeaHc6ibt06qvxKnxlEbb9BRKmGqYNV9IlZGKaaAaMXzvUlTFmnbzJ Usv+Dp5M/9dfPTiIhZcx3 X-Received: by 2002:a05:6820:468b:b0:67a:47b:5a1a with SMTP id 006d021491bc7-67bc8a92d45mr2060504eaf.65.1773258295381; Wed, 11 Mar 2026 12:44:55 -0700 (PDT) X-Received: by 2002:a05:6820:468b:b0:67a:47b:5a1a with SMTP id 006d021491bc7-67bc8a92d45mr2060493eaf.65.1773258294899; Wed, 11 Mar 2026 12:44:54 -0700 (PDT) Received: from redhat.com ([2600:382:7704:370d:c6a3:6b0f:aa31:6ca2]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-67bc8efb85esm1894481eaf.1.2026.03.11.12.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 12:44:54 -0700 (PDT) Date: Wed, 11 Mar 2026 15:44:50 -0400 From: Brian Masney To: Caleb James DeLisle Cc: linux-mips@vger.kernel.org, naseefkm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, ryder.lee@mediatek.com, jianjun.wang@mediatek.com, lpieralisi@kernel.org, kwilczynski@kernel.org, mani@kernel.org, bhelgaas@google.com, vkoul@kernel.org, neil.armstrong@linaro.org, p.zabel@pengutronix.de, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, nbd@nbd.name, ansuelsmth@gmail.com, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 2/8] clk: airoha: Add econet EN751221 clock/reset support to en7523-scu Message-ID: References: <20260309131818.74467-1-cjd@cjdns.fr> <20260309131818.74467-3-cjd@cjdns.fr> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.14 (2025-02-20) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: y1xijVyWOBlLjYXg58YhZbISisnsmwcif4gfJtFGveM_1773258295 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260311_124500_823515_1F528BE7 X-CRM114-Status: GOOD ( 33.18 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Wed, Mar 11, 2026 at 06:12:59PM +0100, Caleb James DeLisle wrote: > Hello Brian, > = > Thank you for taking the time! > = > = > On 11/03/2026 15:39, Brian Masney wrote: > > Hi Caleb, > > = > > On Mon, Mar 09, 2026 at 01:18:12PM +0000, Caleb James DeLisle wrote: > > > EcoNet EN751221 clock/reset driver is significantly similar to the > > > EN7523 / EN7581, however the EN751221 does not have a neat batch of c= lock > > > divider registers so there are fewer known clocks, and the frequency = of > > > each clock is derived differently. This clock driver will probably wo= rk > > > correctly on EN751627, EN7528, and EN7580. > > > = > > > Signed-off-by: Caleb James DeLisle > > > --- > > > static u32 en7523_get_base_rate(const struct en_clk_desc *desc, u32= val) > > > { > > > @@ -604,7 +703,8 @@ static int en7523_clk_hw_init(struct platform_dev= ice *pdev, > > > en7523_register_clocks(&pdev->dev, clk_data, base, np_base); > > > return en7581_reset_register(&pdev->dev, np_base, en7523_rst_map, > > > - ARRAY_SIZE(en7523_rst_map)); > > > + ARRAY_SIZE(en7523_rst_map), > > > + en7581_rst_ofs); > > I assume the mix of en7523 and en7581 is ok here? > = > = > Correct, en7581 came first, then when en7523 was added they reused the > function. I'm only changing the offsets to be passed in because en751221 = has > more reset registers so different offset table than the others. Sounds good. I just wanted to confirm. > > > + else > > > + clk_data->hws[key] =3D hw; > > Should the error code be returned here? I know the function has try in > > it's name, however if this fails, then it still registers it. > = > = > This function follows the general pattern of en7581_register_clocks(). If= a > clock can't be registered, leave clk_data->hws[key] as NULL, log, and > continue. There's=A0only two possible reasons for failing, if > clk_hw_register_fixed_rate() fails then it's not registered because it > failed. If key >=3D EN751221_MAX_CLKS, it does register but I'll fix this= so > it's checking that before=A0clk_hw_register_fixed_rate(). I see that Stephen picked up this driver in 2022 with that behavior. I'm fine with it if he is. > > > + /* BUS */ > > > + rate =3D FIELD_GET(EN751221_REG_BUS_MASK, > > > + readl(np_base + EN751221_REG_BUS)); > > > + rate *=3D 1000000; > > > + en751221_try_register_clk(dev, EN751221_CLK_BUS, clk_data, "bus", > > > + rate); > > > + > > > + /* CPU */ > > > + en751221_try_register_clk(dev, EN751221_CLK_CPU, clk_data, "cpu", > > > + rate * 4); > > > + > > > + /* HPT */ > > > + switch (hid) { > > > + case HIR_EN751221: > > > + case HIR_EN751627: > > > + case HIR_EN7526C: > > > + case HIR_EN7580: > > > + case HIR_EN7528: > > > + rate =3D 200000000; > > > + break; > > > + case HIR_MT7505: > > > + rate =3D 100000000; > > > + break; > > > + case HIR_MT751020: > > > + rate =3D 800000000 / 3; > > > + break; > > > + default: > > > + rate =3D 250000000; > > Should a warning be logged here or in get_hw_id() above? hid can be set > > to HIR_UNKNOWN here. > = > Now that I'm looking at this again, I'm starting to think it might be bet= ter > to just remove it and use a fixed-clock in the DT. I wrote it aiming for > completeness, but this particular clock has so much code supporting it, I= 'm > feeling like it just doesn't make any sense. > = > Let me know if you have a feeling on this because I'm swaying in the > direction of just re-sending with it removed. That makes sense to me. Brian -- = linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy