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=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 780A3C32771 for ; Tue, 28 Jan 2020 00:28:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A33B2467F for ; Tue, 28 Jan 2020 00:28:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="SKfoxij3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbgA1A2L (ORCPT ); Mon, 27 Jan 2020 19:28:11 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56222 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgA1A2L (ORCPT ); Mon, 27 Jan 2020 19:28:11 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 00S0RJvu059947; Mon, 27 Jan 2020 18:27:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1580171239; bh=W1EB64W45tmk/zMPnKEvQZ3k2ekG2mBDdjgBaVTmooE=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=SKfoxij3czRX498JAimlSsNcBJ2eS7JtvSDxNfs9A0J+Uu0U8D9aLr8WU/r5imFnn I1j/F/CkTj/hTfSIITRpfJSQYfuk3Epr/3mq/1Kwmh61FQrOKMj0LfWBnLdvaf3s70 Sk5uWeTQb6W9LKodHGBdeGPDQBgkWJ6bdZWKhWAE= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 00S0RJOt018928 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 Jan 2020 18:27:19 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 27 Jan 2020 18:27:19 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 27 Jan 2020 18:27:19 -0600 Received: from [128.247.58.153] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 00S0RJUJ089082; Mon, 27 Jan 2020 18:27:19 -0600 Subject: Re: [PATCH v2] mfd: syscon: Use a unique name with regmap_config To: David Lechner , Lee Jones CC: Arnd Bergmann , Tony Lindgren , Roger Quadros , , , References: <20200127231208.1443-1-s-anna@ti.com> <217993e5-5e1d-79a1-7684-c6bb964379f0@lechnology.com> From: Suman Anna Message-ID: <448eeb87-9945-8a93-9231-6e2a22aa8342@ti.com> Date: Mon, 27 Jan 2020 18:27:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <217993e5-5e1d-79a1-7684-c6bb964379f0@lechnology.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On 1/27/20 5:40 PM, David Lechner wrote: > On 1/27/20 5:12 PM, Suman Anna wrote: >> 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 >> --- >> v2: 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 e22197c832e8..f0815d8e6e95 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); > > Would it make sense to also include the node name along with the > pointer address so that the name is still easily identifiable? I haven't dropped the node name, it is still there, the pOFn part. I am only replacing the DT unit-address with the bus address, I haven't changed the name style either. regards Suman > >>       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); >> >