Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1228427lqo; Fri, 17 May 2024 15:23:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVY6S6tdeXr5xNsueAEg6k2Jwsl+CPGofzl4PdkN0TqJV0Wjpnq1XrvjwPwfXkvk3xSClgKfW/WB55bl7cdjnybcECA6B4OcPl7Np4I8Q== X-Google-Smtp-Source: AGHT+IGMIuBMZsL25NbHBxbGdvc+cD4LIzWNB/nARUtkKq7x+CLa8/8etB0mAxtqjncU/zXyVVmP X-Received: by 2002:a17:906:e95:b0:a59:ccc3:544 with SMTP id a640c23a62f3a-a5d58d52dfcmr27776666b.2.1715984601406; Fri, 17 May 2024 15:23:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715984601; cv=pass; d=google.com; s=arc-20160816; b=Pd9lq+KYA5FuAi30tX9cqOj47ilaVErPjDJy1H9vHYnDezEKSPcgRtOGO3BxEWQt8M 8O3Zsw7E8d6RiQLAKrui+6v0ySUGvR4kcWWNxoNL2UhM6DwWKj6b3sBTMauLo8P5dZf7 +YlHYKVGtWbxCrA5+mh39+GO4Qk/2nzlool5oVBOQyNCkTOInzGeFNhfxVxI386vD4gZ syLT8wFKzUfjIhupssF2S14lebAcWphb2fi86+FXJFn3khHEIGrhe4+F0PPBoRwbosnc Np7pIUW839z7d7TjmNQGuNmUrTb8pDwYAQwPe+csD4mEH7Vv+iOEy0+aDfJhml4FnQgG 3jMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=tTBGrkJ1ioYRSBA0o2UNnAh4eAeMiGN5vWW0cAPnXaE=; fh=oscnr9v2rxGptbaSUMr+Dau10xxcdYDmU/BTCEj2hpE=; b=SkvPJFt1VIE7xk/CoBmMJmXSGGztyjc2yHEgNT0ViBNQHHVgsykYQTSUZmyyJosJfj FFshBsHJZdI2JIRdH14v5ZWpuIf24q5XE2eKJ32CNcBQml8kJItF8TzdZyWufQzb/8se 9PIc5aUsmMtQEBPHzpHuMKpTvY/QcuxrOI8NHxiOdZLw9ea2tkOTeF/tg8WPrpiHre0B tg3Tc9Lpk86pf5euXJNeA8U4VdE3475FDdVuQfAJ1qpWI/wMx/xdHDX04gNTRsv4gUI4 uSdXNUia2Dkh/zO+rRRWBfTzFFUIAFLG4cAIbNURRLavsrvOZkOathqAsPldLE/9rC4J oZBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="nWTQ/HES"; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-182669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2bd5fsi1008353466b.919.2024.05.17.15.23.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 15:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="nWTQ/HES"; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-182669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1EFE71F22229 for ; Fri, 17 May 2024 22:23:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 425591411FE; Fri, 17 May 2024 22:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="nWTQ/HES" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8331A1A269; Fri, 17 May 2024 22:23:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715984592; cv=none; b=YGvmQSPJHE8GjpvkUkgWodB7R42e8URrPSLyObI3Kaf85wIyxpl2/6a9CceGzV5+IplMj+q4eScpgYcSAuRfWUJMtw+hHGwbMgeb+wlEt+xxFDNH2rkag07gOx90Ke9VnsCfBIvUB8icm2YAAT9kkcENmjyykLWL1q5llRelN4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715984592; c=relaxed/simple; bh=peOMcckPOuThrXKKoxXPtouBQ4FBuCyOXGedDzp0MeU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YZMi1D/fjDJwXqBqxFSyUJ2H4755olrhy7DgI/xJNq1iUYNXBQN8cL9UjUTaH+fs1EIOt2TYx2rFi9TDhzhOsyfCR9A+b9BSHx+5FXMotRgi0nIt8eSdMihrDs4gqgXLE/V5yDXDaFeiLrQQR6W6waJVb+tQvpIHEagk6Zje/qU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=nWTQ/HES; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7eda7621-0dde-4153-89e4-172e4c095d01@roeck-us.net> Sender: Russell King (Oracle) 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!