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 1AA97C25B74 for ; Mon, 27 May 2024 13:24:53 +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=40gdozEH4wJYSb+2lJ2sMr9aCGf0i9uLbVwvAgw58mw=; b=CJPvp5gor1SN7E LLyLbmjx/48sbah3Enh9TTkt18Sbks+EAhyO4AoeSn5YCvJ/uM4UEKGZG4gcW5q5evpMyGjjAtBVX eLU8p0T7wcdLFW6nC9M1q/o9yA13F5jem/hcEupk9G92DswVYz4Tl/hrlMAslOdC6lrJA16f2ydVY jJtgyiaDiAg5eT+taAJXVumwFuD+/4hcp9JKzPTH+hN3+WzCQnoatwAfnE2j2VL4K04W2Q+MvhMb/ Fk++hJ0ohe1WIrklyHQ+oQ/eJ7SXmF5aOnPF0tPIDJjQ6x+Eh8JpaYUHcBY9H1JHR0zWWmvlYow6G GR+ts21l5CKBDpmTvpfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBaLI-0000000F4JJ-2r4E; Mon, 27 May 2024 13:24:48 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBaLG-0000000F4Ij-08EO for linux-riscv@lists.infradead.org; Mon, 27 May 2024 13:24:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=n1ipnm3Y455WZMPj6tDeABCvoBv8BPrn9gR9rhHmizM=; b=jz69g/WAk1zi5MWpS5PjDaExwf uCZ84JlHFB4CH01TKTRVdNHLxv16w42RpemLfu3aMB3CI7ZW7g9qYV6kmdKAOT0pmPPdPMG3SKIMC GOL4GD3F7ovWTPlZ1mkaV8LII52QiAXAOQJIFY1tlAAM8A9kDtcXSQVA6Y9vx+/BEsbo9FJb53wOi 0jbkyx6j9vOdahtbDwupatB+H3WApVG4/94vpCEQIsmR1QIKup4/6O+MgMtOWu5K7FWnv8CkpS53u wD5bWiN31mGgQlXukQovhHf+Cp+00ir8lJL4caLN7CA6E7r1QRpxq1dxW7ajg7ofUZxnSLVaczyUv C13xaDKQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:44934) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sBaL0-0003ZN-0N; Mon, 27 May 2024 14:24:30 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sBaL2-0002M3-CW; Mon, 27 May 2024 14:24:32 +0100 Date: Mon, 27 May 2024 14:24:32 +0100 From: "Russell King (Oracle)" To: Ron Economos Cc: Guenter Roeck , regressions@lists.linux.dev, linux-clk@vger.kernel.org, Linux Kernel Mailing List , linux-riscv Subject: Re: [PATCH] clkdev: report over-sized strings when creating clkdev Message-ID: References: <28114882-f8d7-21bf-4536-a186e8d7a22a@w6rz.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240527_062446_095523_16A9E7ED X-CRM114-Status: GOOD ( 35.49 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, May 27, 2024 at 02:18:23PM +0100, Russell King (Oracle) wrote: > On Mon, May 27, 2024 at 03:45:15AM -0700, Ron Economos wrote: > > On Fri, May 17, 2024 at 03:09:14PM -0700, Guenter Roeck wrote: > > > Hi, > > > > > > On Fri, Mar 15, 2024 at 11:47:55AM +0000, Russell King (Oracle) wrote: > > > > Report an error when an attempt to register a clkdev entry results = in a > > > > truncated string so the problem can be easily spotted. > > > > > > > > Reported by: Duanqiang Wen > > > > Signed-off-by: Russell King (Oracle) > > > > Reviewed-by: Stephen Boyd > > > > > > With this patch in the mainline kernel, I get > > > > > > 10000000.clock-controller:corepll: device ID is greater than 24 > > > sifive-clk-prci 10000000.clock-controller: Failed to register clkdev = for > > corepll: -12 > > > sifive-clk-prci 10000000.clock-controller: could not register clocks:= -12 > > > sifive-clk-prci 10000000.clock-controller: probe with driver > > sifive-clk-prci failed with error -12 > > > ... > > > platform 10060000.gpio: deferred probe pending: platform: supplier > > 10000000.clock-controller not ready > > > platform 10010000.serial: deferred probe pending: platform: supplier > > 10000000.clock-controller not ready > > > platform 10011000.serial: deferred probe pending: platform: supplier > > 10000000.clock-controller not ready > > > platform 10040000.spi: deferred probe pending: platform: supplier > > 10000000.clock-controller not ready > > > platform 10050000.spi: deferred probe pending: platform: supplier > > 10000000.clock-controller not ready > > > platform 10090000.ethernet: deferred probe pending: platform: supplier > > 10000000.clock-controller not ready > > > > > > when trying to boot sifive_u in qemu. > > > > > > Apparently, "10000000.clock-controller" is too long. Any suggestion on > > > how to solve the problem ? I guess using dev_name(dev) as dev_id para= meter > > > for clk_hw_register_clkdev() is not or no longer a good idea. > > > What else should be used instead ? > > = > > This issue causes a complete boot failure on real hardware (SiFive > > Unmatched). The boot only gets as far as "Starting kernel ..." with no = other > > indication of what's going on. > > = > > Guenter's suggested patch solves the issue. > > = > > diff --git a/drivers/clk/sifive/sifive-prci.c > > b/drivers/clk/sifive/sifive-prci.c > > index 25b8e1a80ddc..20cc8f42d9eb 100644 > > --- a/drivers/clk/sifive/sifive-prci.c > > +++ b/drivers/clk/sifive/sifive-prci.c > > @@ -537,7 +537,7 @@ static int __prci_register_clocks(struct device *de= v, > > struct __prci_data *pd, > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 return r; > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } > > = > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 r =3D clk_hw_register_clkde= v(&pic->hw, pic->name, > > dev_name(dev)); > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 r =3D clk_hw_register_clkde= v(&pic->hw, pic->name, "prci"); > = > How about just changing this to: > = > r =3D clk_hw_register(dev, &pic->hw); > = > ? > = > Since, if the device name is over-sized and thus truncated in the clk > lookup array that clkdev maintains, *nothing* will be able to match > the entry. Hence, I suspect all those clkdev registrations are > completely redundant for this driver (and do nothing other than > waste memory!) Note that I mentioned *exactly* this point in my first reply to the report of the regression in: https://lore.kernel.org/r/ZkfYqj+OcAxd9O2t@shell.armlinux.org.uk "We need to think about (a) whether your use of clk_hw_register_clkdev() is still appropriate, and (b) whether we need to increase the size of the strings." -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv