From patchwork Mon Apr 17 07:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 84027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1945589vqo; Mon, 17 Apr 2023 00:42:42 -0700 (PDT) X-Google-Smtp-Source: AKy350aXZJ/vtrW0K0RwWtBn57GKalCwp4y7bcX6deTFN1/dSbHR9mKQ3GdO6mpR6YY561tqOLiF X-Received: by 2002:a17:90a:c402:b0:23f:3539:d326 with SMTP id i2-20020a17090ac40200b0023f3539d326mr14675975pjt.0.1681717362482; Mon, 17 Apr 2023 00:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681717362; cv=none; d=google.com; s=arc-20160816; b=b33qx2O/lC4Az74fOUmr/wl8N5P07x4Kz9RXTv6Oc3BpGg7sTOqV6gOg/6IkpkVz45 bYvqZdUb8zgi8D/I0BjgsiBW0AhTJnSnzB3ov+xjY0Lhod3Mm2ugJ/4TjVX3bjjsZo/1 F8nUP7w+6fZUZlOZQcWOBH5oYttDTT/r/shr386D5tGwEtWIngrWsXase5u/869R68oo Vqhb4P2ZpEwBfL483Shi4fZ5VMX+3K5urwSZD8YiWLlCAHVDfuD6rv7VI90T5/oGabrh sBg9OvxyQCnTM9Y/L3GQx62jlx4To2AepvLqUrd0zy+9PSVnmlcWEztWL5weNBRu/VS2 Zp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=wdge6a4JDiruNd3imU9/L1NhlUICcC+6sBqY7kaO9So=; b=JnCgwcshpK7OXNzPEGWITUGd1DTj/ZSFyMVo4p2hdK9HvjD0Wxey7y2rsBGkMIKfEh u+TP22+wCyqCzEIqLjRIrZb5qN4gbFnZGa0JOR9Lz90evgEXi7x0NgKUp89Osky9XtBj watdLUVyzF5z05DUNS+Aqncrjrap1104sJhf7qnRSzX1OrOVnRORqPh6eDwEMSKXVhNA 8JHWL1xcKslehLsnGFTut0FunutxwKsdpCyheo83QRNUl02uuQgMZNGEh4ADyF9hlZnH nLIq3W9uMLVSZ5pg13986ekcjal8m4JkVxBnp7pzwmnrBnJ3eieTzZ57e4x6TaBdNRde iO/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HX0MRrzX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw17-20020a17090b4d1100b00246d776cbdcsi15387819pjb.57.2023.04.17.00.42.28; Mon, 17 Apr 2023 00:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HX0MRrzX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbjDQHgw (ORCPT + 99 others); Mon, 17 Apr 2023 03:36:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230436AbjDQHgQ (ORCPT ); Mon, 17 Apr 2023 03:36:16 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FBBF3C3B for ; Mon, 17 Apr 2023 00:35:03 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2a8baeac4d1so9393771fa.1 for ; Mon, 17 Apr 2023 00:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681716898; x=1684308898; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wdge6a4JDiruNd3imU9/L1NhlUICcC+6sBqY7kaO9So=; b=HX0MRrzXW5+rVaVp5wEvJKoBYQvR68Nxdvm6JOa1KPUy/RokGXGhIue8OrU4WeOEu2 B2Zj57kf1qlkAkw2nvrZmIwICnRsl8wOnsD2K6qLkrIOLdRzfNtSLcClPS+hfTqP3UvK yccxgVGnFJEEk1lK+GNACHlGt+CidiHgTkuRPP1T/+BZ4Y6cyWNarWkHYqLRwgNYr1gI iKtMqIHQh483gwrmROQZn4whIXWvG0fJsRTi+zCE5NWAcwkbZbYuvJkhPZFZGDox/rYP nsYN/XXFFwXHZjt7NzcSTovNe+0FDmclYhZL3fxo0YSZjAsqu8aqXM6lip42HyJGd1F6 aM4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681716898; x=1684308898; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wdge6a4JDiruNd3imU9/L1NhlUICcC+6sBqY7kaO9So=; b=ZAD78RaqSNiPcDdzSmtEYT/VdXebTH2XFFpEQZUtzojSW8x8ZIGpAHhbRQZbsF3CMq 6Zicws6UTQhVlYSp1DXfZOyfiK2B9oRLjiXc1YIhlRdd3iD4qCDMpXM3RQNY5bn4g0C6 uoUTTsN0Z/lhVd7KHNU5GA8HAbZ6fpV8iO9vIVhwVXrazFn2DhF8bgAHxCWN7QScXIpE miXo7kssxUTbkn7WLSuvfcRQqW5jmg4NjnegQghx3NzMqfsmVn1oSwGfJ8Dc1pnpWT6Y qBucyVid9qT3B3LlzdY1bTAPyJLon213uNAAklz3v36Qz5Nl5D79VNybw673k0eSCBWO 0YGA== X-Gm-Message-State: AAQBX9di4tW9GaPKcy0RSe/Pil6qk09K7kVnXiT4wqmpCVUUZx3i9X/+ v+D2o+wEamVWERglOPsCKWT9Wg== X-Received: by 2002:ac2:4a89:0:b0:4dd:9a38:fcc with SMTP id l9-20020ac24a89000000b004dd9a380fccmr2015468lfp.63.1681716898793; Mon, 17 Apr 2023 00:34:58 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id w15-20020a056512098f00b004eb2f35045bsm1956275lft.269.2023.04.17.00.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 00:34:58 -0700 (PDT) From: Linus Walleij Date: Mon, 17 Apr 2023 09:34:56 +0200 Subject: [PATCH 1/2] dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM MIME-Version: 1.0 Message-Id: <20230417-ux500-sram-v1-1-5924988bb835@linaro.org> References: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> In-Reply-To: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763408464913395858?= X-GMAIL-MSGID: =?utf-8?q?1763408464913395858?= This adds an SoC-specific binding for the banks of eSRAM available in the ST-Ericsson U8500. Signed-off-by: Linus Walleij Acked-by: Rob Herring --- Documentation/devicetree/bindings/sram/sram.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml index 993430be355b..0922d1f71ba8 100644 --- a/Documentation/devicetree/bindings/sram/sram.yaml +++ b/Documentation/devicetree/bindings/sram/sram.yaml @@ -94,6 +94,7 @@ patternProperties: - samsung,exynos4210-sysram - samsung,exynos4210-sysram-ns - socionext,milbeaut-smp-sram + - stericsson,u8500-esram reg: description: From patchwork Mon Apr 17 07:34:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 84028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1947964vqo; Mon, 17 Apr 2023 00:49:20 -0700 (PDT) X-Google-Smtp-Source: AKy350Y3uSGTcM0LUbEWgKSw/wVd3BNJXFdAq7uzuzTAbvPljdYuRg2A8+AKFtFgaxd1cykUgbn2 X-Received: by 2002:a17:90b:1090:b0:247:944d:b75e with SMTP id gj16-20020a17090b109000b00247944db75emr2620826pjb.12.1681717759754; Mon, 17 Apr 2023 00:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681717759; cv=none; d=google.com; s=arc-20160816; b=mOT63g7TAILga8qzU0/VrNthSuC4rbNr4awszqFWxClKc2K4oWrtMVlGweFOH4Cn2G zU4kThe7d63tQNKyLAL9qnkTM1mJAMZD6zuA+21LD41qP/K3A8kWjWAV8aqQkvPoN8VN hgtf0x/n2yQhc2nQICebStdHZAUV00bzJqkHX2uPfEnZUis6nRJaH/uhVEbMjmc8w2G8 wR9l6TnrUGWFeqvJl2Euu2+9uO9KPBbAYL1ZsZ7e0kjvx+n83FgAnBCqxGjOdFlJRQIk /+eKz/FtVLeICOoRKcJKMtdp4pSnTrJV36ye6FKPZ5S1Dkpoa+HycWPn8FKkmp4kY26/ 5iag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=n47v9+PzhQgXr23TTNhsK7isjIIKM72ZIjxtKH7ks7Q=; b=nC1pDs17KOzigBra3BXW40ZEZbkVW1c1jiBUWFHoEaEFm/Tdza9Aj+inWbSuzv5dNL V6UG6KdEFrM6IowDBfgOvFCnRLdMAe3IG5OI5jBxbp+l5uHaaHYuV1Mx/S6EYGFqshGR 1i1syllfCoE2bX9veioxM97/li9Lx27GqXoSTX0OaCsZLTjCW4l5rvlvVkjXEzCncC5D BiiOfnb+fz5pKhHR6M7FYkFuZH+65t6JMTk7Nov3qZdEE6PgghtIEMrjPVfqGk1/GarY mv017bPZVpdYeeH1Bi3bE7dDR0QKB9OzGGUrXM8WY2YMAR8K5Gjoe9tHSYUON0eWeU5H ziUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q5yMGpOV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h189-20020a6383c6000000b0051e011fcd73si1891683pge.237.2023.04.17.00.49.04; Mon, 17 Apr 2023 00:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q5yMGpOV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbjDQHg5 (ORCPT + 99 others); Mon, 17 Apr 2023 03:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbjDQHgS (ORCPT ); Mon, 17 Apr 2023 03:36:18 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21542468D for ; Mon, 17 Apr 2023 00:35:04 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4ec8da7aaf8so1241996e87.2 for ; Mon, 17 Apr 2023 00:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681716899; x=1684308899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=n47v9+PzhQgXr23TTNhsK7isjIIKM72ZIjxtKH7ks7Q=; b=q5yMGpOVyeyFCk+S0Ffj+uDLwQX1UOOr4uKsV6Wz3P69P9eIzxL57eahmDFLtoDCr1 9spzByynB6vOIJTvgD7o6auKxzc2fYDstW89N7lKOyWaiY0NSOUN07Ex2YGqUndJFVZH CtdBourk1Fb4eUKGsqmtvcb+tEvXtOgqVeWpYpBuOye580U/kPK7DAwVs/vfgpGNEhRa KkmmtCCvYs7xHeMWe/2gEvzOSfMU/4aHSDTXUYdVCBuzie7kNpu2y3DPT8x4GkMP3Kd8 dJRSXuYdOkz7x7DCcOyg6oMFtGMldgtB900Fv1ysiJkIYjsrJxiZA4FO1hfhotwxS93A o1Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681716899; x=1684308899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n47v9+PzhQgXr23TTNhsK7isjIIKM72ZIjxtKH7ks7Q=; b=hBgVNhzRXSMsr7GFFZKADvTBBu9TUY+pb9ZBihYSmab5GOpgUQyIY6IFsnkjUII6ml 2jl0GNGZsYokCF9MxS/E26i5KQAzN5gSaoTpT0w57Spqr8hYhKoT4NWcSXP+Sf0df5LG G7guPe1ws3xKUa5J369Dxg4Y/puH4LUYNASWdZQ54KoEBOA0LYbmyqGBNGmMe3Y37orv rAO95IeJG2BxoPlq0SigarlyWvT/ltPfpJ2JqQYqW3eGJSoVD9gxTWSAmpbmQdIqYLU8 3TPq0O6JqABur+hW73vxM58+6Zyz2aL4sWEbg//nCF7iDJT55yZw8B1gQbw+TsjarEej SA/g== X-Gm-Message-State: AAQBX9cf6cYelxRHgtC1rbALtHJAWF3ZTcElDWQjREcf7cO3abGciuxv ue2ST0sm7jYGV+ZkJv9Wu2sF+w== X-Received: by 2002:ac2:4848:0:b0:4db:28ce:e5ef with SMTP id 8-20020ac24848000000b004db28cee5efmr1635960lfy.0.1681716899646; Mon, 17 Apr 2023 00:34:59 -0700 (PDT) Received: from [192.168.1.2] (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id w15-20020a056512098f00b004eb2f35045bsm1956275lft.269.2023.04.17.00.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 00:34:59 -0700 (PDT) From: Linus Walleij Date: Mon, 17 Apr 2023 09:34:57 +0200 Subject: [PATCH 2/2] misc: sram: Generate unique names for subpools MIME-Version: 1.0 Message-Id: <20230417-ux500-sram-v1-2-5924988bb835@linaro.org> References: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> In-Reply-To: <20230417-ux500-sram-v1-0-5924988bb835@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Greg Kroah-Hartman Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763408881584182673?= X-GMAIL-MSGID: =?utf-8?q?1763408881584182673?= The current code will, if we do not specify unique labels for the SRAM subnodes, fail to register several nodes named the same. Example: sram@40020000 { (...) sram@0 { (...) }; sram@1000 { (...) }; }; Since the child->name in both cases will be "sram" the gen_pool_create() will fail because the name is not unique. So let's use of_full_node_name() instead of child->name so the name is "sram@0" and "sram@1000" respectively. However if there are two or more SRAMs on the system with subnodes named the same (that exists on the U8500) then this again will not work. So catenate the top node name and the subnode full name to form a string that will always be unique. Signed-off-by: Linus Walleij --- drivers/misc/sram.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index f0e7f02605eb..84d4e090678b 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -240,10 +240,12 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) goto err_chunks; } if (!label) - label = child->name; - - block->label = devm_kstrdup(sram->dev, - label, GFP_KERNEL); + block->label = devm_kasprintf(sram->dev, GFP_KERNEL, + "%s-%s", dev_name(sram->dev), + of_node_full_name(child)); + else + block->label = devm_kstrdup(sram->dev, + label, GFP_KERNEL); if (!block->label) { ret = -ENOMEM; goto err_chunks;