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 19656C04FFE for ; Fri, 17 May 2024 22:23:19 +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=0shazT9zJ8J+eUs94aW74zZmcZCrygfK7FlDvH88zSQ=; b=GtgOmkYF2NmDz2 mh7Mt0jpreYQTbuYqJM0tYFOJU1t//8aopL6cg7Xe7G2UWOG9ZzUyEGpR5jxjY9PSMIBaAXQ/n6yC qXyOuv4mv6KFSwYeuHo0g/Rw+DcNL40p2HVUt4iq/n+wIDSI/0GkfyyuP8VedX5HnilGTnCcR+0tD WFyoro7kNDjbCtJAfpKF1pMt7OzdLqJ9cHwvYboTd/G1VVyA0NrZ9IE2WW/tg5YFYQrh/Bqmkp2om jlknB4/0Ly8un86Q1/SV0qD7vmzDNwJWC7I7Qbkap1JVrI35bIEI7ilywpaR3LjbJqX6e11tyZzDw A3hQrBBgBkpYqSFErp7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s85yj-000000097li-1UgP; Fri, 17 May 2024 22:23:05 +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 1s85yc-000000097kY-2vxe for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2024 22:23:01 +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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=tTBGrkJ1ioYRSBA0o2UNnAh4eAeMiGN5vWW0cAPnXaE=; b=nWTQ/HESmyK28sfHDl55URQNjI av4rF4wI1uudX6/xNWG5M8NYzHQFNlyielMtVKsWWOJvd5EBaoGT+oPkoPprbO4v1FfM/ZyNM+4I+ n01PprvjZN6Jn95y0cWz7v/RJeVJd22kHJhwMev5SFUoOrK/LyXBvqUFy7TRLicXQUD2LBJfTU6Du 1nJF1nea62bLgJV/sWLcPkc0Dd/3G++VrU4J3nlzEUdCAODddaJBtRjWdGGK61UQ/jHxjKbllHoNj aQSLrVOh4v4H5vBIMepaKt+0Mf1Qi2npNXK19du1HRqOHQcxYpirAVFVLSr+a42h9E2PSz0ForgY2 CJpeKhRA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45664) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1s85yI-00071b-1u; Fri, 17 May 2024 23:22:38 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1s85yE-0001tQ-IB; Fri, 17 May 2024 23:22:34 +0100 Date: Fri, 17 May 2024 23:22:34 +0100 From: "Russell King (Oracle)" To: Guenter Roeck Cc: linux-arm-kernel@lists.infradead.org, Duanqiang Wen , mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] clkdev: report over-sized strings when creating clkdev entries Message-ID: References: <7eda7621-0dde-4153-89e4-172e4c095d01@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7eda7621-0dde-4153-89e4-172e4c095d01@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240517_152259_240023_2D79955E X-CRM114-Status: GOOD ( 18.87 ) X-BeenThere: linux-arm-kernel@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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 17, 2024 at 03:09:12PM -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 parameter > for clk_hw_register_clkdev() is not or no longer a good idea. > What else should be used instead ? It was *never* a good idea. clkdev uses a fixed buffer size of 20 characters including the NUL character, and "10000000.clock-controller" would have been silently truncated to "10000000.clock-cont", and thus if (!dev_id || strcmp(p->dev_id, dev_id)) would never have matched. 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-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel