From patchwork Fri Feb 23 16:35:16 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: 13569528 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 B20BAC5478C for ; Fri, 23 Feb 2024 16:36: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: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=07ehPznQMuc+ZNHI2qbei9ElJeeqIAsJHtTAYHZHjqQ=; b=aopfy0TTnda4EL 12cIMXtFdtrzRaa1ULDN0bGyndG4MNFep/PLbgmE5PUxUwrmJEfpDv+MMEufcza6WA84la8tVbZ83 e9QI+ortorZGSYDhim29JxJeb0j/xNYBvlfB8ubTNv8zyVMHryA6phHKUzugUbb1TpFuc3oDUdMk5 OhhbAwaVh07HS1q2QAVpa6MB6JuQ5UPlN8iwWcPiAnzAfxgix6YVi19CYi91ddfzKq553DJkOu3qx Abi2vAFrtt9fNuxn2Xmptos9yhmqC04YWonnjHc4/y1HpjoYFTUMQ4IDQMRJoe0XaaGznTOjYLLsl GESMrZlChZ2loMPFHMIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdYXA-0000000AH4A-0H9f; Fri, 23 Feb 2024 16:36:24 +0000 Received: from mgamail.intel.com ([192.198.163.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdYWG-0000000AGqt-3KCQ for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 16:35:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708706129; x=1740242129; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=N+xBnxQ1ExC9SLflSQYfvZ+wQb7LNsdhHsn3A2kmeH4=; b=CskHzyT47/EtjuIDG5kojeR+stfzD6pvVRj4FggiddIFFPG1cCg5I8+f DmagLR95AgNiYTmnHFdGxlD0wMAgixQ3ClktIFTZqSIk59Dk59EXb0Mnw YNAstAQJ5CB6uPusOJ9VHheCv5jaPH1piXLWCmVoeKGH99tsLo1uR4jDo ppAE5BegaLclfGVf94pbptPAsY74wb8ufJyUDU8aDN1iCU4DrMnIfn7c7 e3gCPfhv+XmgNIcZmY9QAwUDjskswHveiqZfMjf0U+skhRlnF0iOewfnx ftpTgRVR07UaG0DmRl8zUrxaV1abmXvGaXJArIpjTa3ZbqByaRpKM2nz8 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10993"; a="3189534" X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="3189534" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 08:35:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="6168351" Received: from awvttdev-05.aw.intel.com ([10.228.212.156]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 08:35:23 -0800 From: "Michael J. Ruhl" To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andriy.shevchenko@linux.intel.com Cc: "Michael J. Ruhl" Subject: [PATCH v2] clkdev: Update clkdev id usage to allow for longer names Date: Fri, 23 Feb 2024 11:35:16 -0500 Message-ID: <20240223163516.796606-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_083534_439660_BA483E0A X-CRM114-Status: GOOD ( 12.47 ) 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. v2: Removed CON_ID update and added example to commit Signed-off-by: Michael J. Ruhl Reviewed-by: Russell King (Oracle) --- 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 {