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 X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 601E1C433E0 for ; Mon, 27 Jul 2020 21:12:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28D3220786 for ; Mon, 27 Jul 2020 21:12:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AlqTMYQR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="wZllyO6h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28D3220786 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=vUPvMlDnHveMWGKXIMdVFzcGsvTR2oIO9rm8GvtA69Y=; b=AlqTMYQRhhG8LIakxVyZFXzrDV bvwFOXZBWoDwfxPCYgUJ3B7G21LXXwgfwqnESPkaMPnQmA83wts9uTQsEbQxIl5KsEWevxVCYRTte Ot1+zv2OyNPCQGrNigGDhyBRAy/r80UwgQkx/jeCAYBf95Pndknbwcj9y+KnWrdtmmOXkD46z9aYp +wA2nRSDtBZcby400wAdXqqt3yKFoYF8/CNDro2r1bn8nGNjGPg5P7/9Rhi5X+x74ClvbVtPJadJ4 BHSCMGHUhRdVnF0TVTRRUkt8Z8XZG5Q5gi383OB1B6iOIcEG7d2l9Jcg+2slCZBt560oROtztDdij HXc8lfAg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0AOu-0008Kp-TX; Mon, 27 Jul 2020 21:11:12 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0AOs-0008KR-7F for linux-arm-kernel@lists.infradead.org; Mon, 27 Jul 2020 21:11:11 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 06RLAL0p078832; Mon, 27 Jul 2020 16:10:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1595884221; bh=TZF0KLe8ZtYIhI+Y7RD9A3jUdGCFtjvjRXhA9sWCJC0=; h=From:To:CC:Subject:Date; b=wZllyO6hSWcWeGADNdU65VAmZ/hWgRb5LA0T8CcniqsOwNVZWzlQzvEUNP1TqKKFY GLKeXYxvqMyNQmN/8nfYh5rE6tGW5JDR1KD7h1NbjU41DJRuo8bSry/4AvdzByf/ug 7mIGV1NUoRbnqzfVkJcIhzm/weHyAlDOWsv7CAm8= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06RLAKES124003; Mon, 27 Jul 2020 16:10:21 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 27 Jul 2020 16:10:12 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 27 Jul 2020 16:10:12 -0500 Received: from lelv0597.itg.ti.com (lelv0597.itg.ti.com [10.181.64.32]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06RLACrN062741; Mon, 27 Jul 2020 16:10:12 -0500 Received: from localhost ([10.250.34.248]) by lelv0597.itg.ti.com (8.14.7/8.14.7) with ESMTP id 06RLAC26125049; Mon, 27 Jul 2020 16:10:12 -0500 From: Suman Anna To: Lee Jones , Arnd Bergmann Subject: [RESEND PATCH v2] mfd: syscon: Use a unique name with regmap_config Date: Mon, 27 Jul 2020 16:10:08 -0500 Message-ID: <20200727211008.24225-1-s-anna@ti.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_171110_411134_66A66FED X-CRM114-Status: GOOD ( 14.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Grzegorz Jaszczyk , David Lechner , Tony Lindgren , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Roger Quadros 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 The DT node full name is currently being used in regmap_config which in turn is used to create the regmap debugfs directories. This name however is not guaranteed to be unique and the regmap debugfs registration can fail in the cases where the syscon nodes have the same unit-address but are present in different DT node hierarchies. Replace this logic using the syscon reg resource address instead (inspired from logic used while creating platform devices) to ensure a unique name is given for each syscon. Signed-off-by: Suman Anna --- Hi Arnd, Lee is looking for your review on this patch. Can you please review and provide your comments. This is a resend of the patch that was posted previously, rebased now onto latest kernel. v2: https://patchwork.kernel.org/patch/11353355/ - Fix build warning reported by kbuild test bot v1: https://patchwork.kernel.org/patch/11346363/ drivers/mfd/syscon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index 3a97816d0cba..75859e492984 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -101,12 +101,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk) } } - syscon_config.name = of_node_full_name(np); + syscon_config.name = kasprintf(GFP_KERNEL, "%pOFn@%llx", np, + (u64)res.start); syscon_config.reg_stride = reg_io_width; syscon_config.val_bits = reg_io_width * 8; syscon_config.max_register = resource_size(&res) - reg_io_width; regmap = regmap_init_mmio(NULL, base, &syscon_config); + kfree(syscon_config.name); if (IS_ERR(regmap)) { pr_err("regmap init failed\n"); ret = PTR_ERR(regmap); -- 2.26.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel