From patchwork Fri Feb 23 20:25:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael J. Ruhl" X-Patchwork-Id: 13569941 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 3BD0AC5478C for ; Fri, 23 Feb 2024 20:26:22 +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:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dM5v6pHzBBVqsHlvtVjmFktrwE+DbSf94wG4wQoFRZY=; b=jWdssxQ6JQyXuq 5bVVfzcoshjFbBHcM+QRQ1d9CWQ9Yu7TgKkaO/p78sZkJqL0nDtY+bLlU4dTEk4+dHdo/6U86vr9l eQzDqOG6dWmftckZdmEpiuAoH9zjHPrpqtQjtK+j8cy8mrhHXL2U+INHEh2ZhkK0Dmtofi9NnwYiP A2ODnYSUPrqo17VjYapttK+O5ij/A5Q2Dh5IBlJBcwUiR2OZDVcEJBEjl21PD0c67AEpTL5PcbiWT VAPky+/JhBpKfyFF6DLf+BNx1Ni9fc+qREWsaIAy6weLFM14lvqoXAQDEpDWUY43/yvbCayerUIoU UfmscXCo9yebMwsB5pBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdc7Y-0000000BAG6-0fy4; Fri, 23 Feb 2024 20:26:12 +0000 Received: from mgamail.intel.com ([198.175.65.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdc7V-0000000BA8z-02YU for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 20:26:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708719970; x=1740255970; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=otrj2HG0uwGiWEAyJmF5JytS/AtQRVWKEWaHEN3Z8Sk=; b=JO/aX6HmGCTk31l8F/ix35K//1gME0ByOyfJ95+s+D4n1sokvyLrR+y/ Ps7AmUpr+6Ds9VSkUDaYzqA9nhWFf8x1fuKM0j7Cm5rndlLnLsSAtXxxR b0mz+bRaXCwHIMVDegpnSDsGeRpLutk6Kq0QZCPpL0FqMbDbg3BeJQ/YK zrUVZpghobcZrIzNVF5VCVfEs5IJZBbEV/eZmVs62GPDAhJHvqxhB/JgU thREOPwUEUtAyUCBAM0Gx2JpBcfqhlSuPozhi5z875LKQ7sVhaI3PfqWp TV9OAeqgluWMyP2NsMChi89pJW6YBhCLSigL43JH5RhwHqWJ9vv1Vgxmc Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10993"; a="14487208" X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="14487208" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 12:26:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="10713422" Received: from awvttdev-05.aw.intel.com ([10.228.212.156]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 12:26:03 -0800 From: "Michael J. Ruhl" To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Russell King , Michael Turquette , Stephen Boyd , andriy.shevchenko@linux.intel.com, "Michael J. Ruhl" , Russell King Subject: [PATCH v3] clkdev: Update clkdev id usage to allow for longer names Date: Fri, 23 Feb 2024 15:25:56 -0500 Message-ID: <20240223202556.2194021-1-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240223_122609_120503_A233F541 X-CRM114-Status: GOOD ( 13.00 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org clkdev DEV ID information is limited to an array of 20 bytes (MAX_DEV_ID). It is possible that the ID could be longer than that. If so, the lookup will fail because the "real ID" will not match the copied value. For instance, generating a device name for the I2C Designware module using the PCI ID can result in a name of: i2c_designware.39424 clkdev_create() will store: i2c_designware.3942 The stored name is one off and will not match correctly during probe. Increase the size of the ID to allow for a longer name. Reviewed-by: Russell King (Oracle) Signed-off-by: Michael J. Ruhl Reviewed-by: Andy Shevchenko --- v2: Removed CON_ID update and added example to commit V3: Add r-b and move version info drivers/clk/clkdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index ee37d0be6877..9cd80522ca2d 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -144,7 +144,7 @@ void clkdev_add_table(struct clk_lookup *cl, size_t num) mutex_unlock(&clocks_mutex); } -#define MAX_DEV_ID 20 +#define MAX_DEV_ID 24 #define MAX_CON_ID 16 struct clk_lookup_alloc {