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: 205512 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp700593dyb; Fri, 23 Feb 2024 08:38:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXVii5e2dkpEQhATY2Cn7L1bYlyJuyq6WT0ZJ/HNGgunYyU0xO6nyIe5cSqACjhJWkZXKfO5P8DwoBgoARGX2RG4Ojn4w== X-Google-Smtp-Source: AGHT+IFZAy5Mr9BLgx75qm5ht2myiyrWMqDFOm85WPKHLxSBtD/Fzp9hSsuplfkfKZF1TBWl+4Zy X-Received: by 2002:a17:902:cec1:b0:1d9:f31c:d2f3 with SMTP id d1-20020a170902cec100b001d9f31cd2f3mr433430plg.51.1708706302191; Fri, 23 Feb 2024 08:38:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708706302; cv=pass; d=google.com; s=arc-20160816; b=dXQY8Rnb+59yeQnkT+r79I6GFiyHKPZEcEC0abwK5RM1zAoJOq1CsY7/ozZNzyiSRq pMXGB7Kw8TQfHI9YBxmm+jS+cc56aW2p2GGdouS/1O0a1ch85/iuHS3Z/K/ycyPyT6JQ ugdwWaeMoTErYL/S+AlVSqAHKxMilxhZzjbVaYioJEQNBT2iDmFe2CBv1ioH6GFfLeCK T3M5JIjbWfBvtljmB5zwd0BJRKmbSJZ97SO1NhpGoyfjKVBtgYuz8W4fgjiBt+1LlMXi Z/yqlBlKISY/gI9yV/qpdHMJ3oO9L0czNfQIjuJADcIWJ62aIVJt5V2F4Vcx7YBUpskw f63A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=S5EJOGrgAm8aquG/Ab1nE0MaxS6rH0LCI6ijpwSDUSo=; fh=DeZ+4TrSaJ2WQ12PGxX9DEGARaHR24EoqAjUm1KSpqE=; b=pEd8kVZwnNQuMwT9nXb60eoAnXWOB5lagZQqDLeZ7ZuNPMlpbLeTfuHHLxx8eoyJX6 5OrpwgAINozBcE6LtN1+TtCsPqWaxWobfsKe2gVKYr/iKN5mRv7Jg/3xBxmoNDumt0QN swANlDWCfO9t3rXngxMCyszvj9v+FBgKmkyr7qb7cIzppvfCUL9qpbVacZD5pTKv95mC gotEAkI/KnYMBu3ximMzTQuOKA9bz34mqMJaJd2I3f6leDPouoyBUqgR7zBicg1FgbY1 PF+jI2E4JGZQSG1vToh9Xs8qahP7pQNP+ljlfOEEPQiU7sMVk27T7gkxlNKP68xLWAVD 2IFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UL1yHmJr; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-78735-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78735-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m7-20020a170902db0700b001db4e1c8efcsi12686739plx.88.2024.02.23.08.38.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:38:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78735-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UL1yHmJr; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-78735-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78735-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C0BB9285425 for ; Fri, 23 Feb 2024 16:35:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89BE484A43; Fri, 23 Feb 2024 16:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UL1yHmJr" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 F41E25B1E0 for ; Fri, 23 Feb 2024 16:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706126; cv=none; b=a0aZT5ZW+MM+oCaseRs+WrwkgNu0f8Knk1FY9Z/ZsTLadzeEkeHFipXHDpnrlPHvVP/fjPXkDXUKbWg5g3lmsQubGBSHxVRzqBWj0MCq0lLEYFGWQivM0ONowtu4iLbeMvubcytWx/xERmjqH+9+rVk0dlB7FRMmiZcn8P/I/eM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708706126; c=relaxed/simple; bh=N+xBnxQ1ExC9SLflSQYfvZ+wQb7LNsdhHsn3A2kmeH4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Eje+ElIZEJtPERYrSJJ5T0X5KNhpPPZFGqcnF5MGxSEiibs8AojQh7vfjHJG0ysVhaV42F+3wuT9SuRYm/EqVKqeOq8SqLuwFkhxv0himVqwdCyQvzr+8Fp9Sl2I8kaEMVjfsi15G+UtrJZlPPMNFYk0gtxV5Xcf+6iu0IODrlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UL1yHmJr; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708706125; x=1740242125; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=N+xBnxQ1ExC9SLflSQYfvZ+wQb7LNsdhHsn3A2kmeH4=; b=UL1yHmJrnqyf98Sw1S+5kMUlW3k4HOxnQA8TKUmqq0k+LbEs2EnxZsWh q58JV8KHfcmXLRyFFL2eQChvgcf1h0bJbE2mYDwiF6xvyQxAnPvcwnFZU 1ywJvP257yTU+kzdtwSTQFVyV+0bLCGpuqDJHQV6mjy9AXhnl3trtWvwG /n9qojuA/fAx1cN2q311mvzkjKttxHHIxfuXww7TfZwrbfen5HETXZcT0 pWsDhFTUdhj+1xDrMDBrsUSFzsIG1qvucqY2QbjIGDErjSixiL6uo74j0 SmQByJUOvxqdNvc32mRUq9eEasj1wcRDpmHxnYrhAoSXUTnmM4e7WsFYc A==; X-IronPort-AV: E=McAfee;i="6600,9927,10993"; a="3189535" X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="3189535" 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791708419287190590 X-GMAIL-MSGID: 1791708419287190590 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 {