Message ID | 20230622074520.3058027-1-linus.walleij@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4901985vqr; Thu, 22 Jun 2023 01:08:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hS61ly1xaR5vFGmVcjkBv7K+z9A9CCcM9/78eV4LB7+wn5AeQdh+s+R+hZ1cv3xbNUJz0 X-Received: by 2002:a17:902:e5c5:b0:1b6:b024:b072 with SMTP id u5-20020a170902e5c500b001b6b024b072mr924262plf.38.1687421338329; Thu, 22 Jun 2023 01:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687421338; cv=none; d=google.com; s=arc-20160816; b=nTJjCJ8uOA0Ve4y/Dqy3eQz/Pm/YFV5Bl/8bOBEMLYxezZ9m92xVUc7g4l/Nbufm0L 8w5rcYebg4droP3dSeuU4kc1wsDF4U6t6xVgJUHW/Rs08FED3uiRAJ0THHq3bUriBEBZ yLbtJWm7Zz0ASl7BdFl6YgMgd7U2CoyU1xy+D1+TNJYfIxI8jT4JqYu+jA0p2z0c5ZYw 7lIlR3eaP0Z4GYUzjNbZ4pjTBuQ20ZHVGdxN1xgMS28DvrRP33IRL2Y1UhG/SWDe9c+v 7iYDJ5AZIqIfe+JMuhipt0SU79Nm7epU1nUMh4m4OL2GRKuvEjLL879aIy+NxtqXrGb/ uPNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=e2G6Ue8V4mRrKRwqehC5x19V+QhPz8CK/6cX5tEJLKo=; b=pH79c6A7u5GTA2sKTumLy6FqNQgSmkr7UctOF8BTx/xejz6Op93bncYx3++EdUuTYz QCvNG4GE1V5ogDKmLTnRZ4eE4aZEmDLoKgYAgu4RYZgU3CgO/eJOMBryjejGzYDfp9lH uvLvJwIKzL86/zUpZaTbJaEoCHrsvEZ3d0uxC8E8GV0Ee45jc0a7Duofxe8TR5yiYa+p utr34kNeiU6Gw2vqJQKpbLtoTeKR0SuNQj6VRdAN9Hz8cAfXUQhIy8raPHPSD4LgFPjm nhUDJ/mZ0DwNju4VZE9z5VtS1EdYVDgbch1blFD15PwPUuK5VVylj/dgNpzMZCfnsPuJ EktA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZcFyvFSc; 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 i1-20020a170902c94100b001b5561a5ca6si4003399pla.379.2023.06.22.01.08.38; Thu, 22 Jun 2023 01:08:58 -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=ZcFyvFSc; 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 S230147AbjFVHp3 (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Thu, 22 Jun 2023 03:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjFVHp1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Jun 2023 03:45:27 -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 6EFE3199E for <linux-kernel@vger.kernel.org>; Thu, 22 Jun 2023 00:45:26 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f6283d0d84so9463161e87.1 for <linux-kernel@vger.kernel.org>; Thu, 22 Jun 2023 00:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687419924; x=1690011924; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=e2G6Ue8V4mRrKRwqehC5x19V+QhPz8CK/6cX5tEJLKo=; b=ZcFyvFScRGUXITKWgPViPmDQicGubfs1vxVvXMns5+Qyf3/shHpYw6yqxPCjZ+/ydW ou1m8UB4FFNDasObzLBEKJOI26e4ZQi2mrkJX/5+93OaiP/c9ESejqjBEaxJS5Wdas+J 4XvYDKGYGz95XYRjcI9t0b7o9TGB77rduZQOZ43hVO8EXmmNFSxvGbXq7DDgLtmqZsAm UuiQ1WDKHtEP9sMaXbr7DIZ/VYr+zsxhTZ492jx7SQlc7vOfPSsn6fKq7/durcWKePGU vqhXpWCxtxp0DgJmB/pSuiSy+x8WmLp3pLWjMNPCnJ1DYY62T48UL6StjId2uNDTCS+h /twA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687419924; x=1690011924; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e2G6Ue8V4mRrKRwqehC5x19V+QhPz8CK/6cX5tEJLKo=; b=ibnjhEdxcfKYWSIK+BWf2xj7Rf69QxeNfB4OVFUURMT+uPCES1PUDw2JdkmyBgSbzI YAhaZurxcMG5pZUbL5sv3BUJLqw7gEFNAlCxE/uKGPbe90rmqduvDIUwZFm2PQkOov2E R9nmxDLKp9rHSb9Lf2duE8dfZi6kKTjfhvPItnHq67jmQIuOoeQRZso0Gotp89SProKn OPvCGUSPcE+RDENocKt4pKL+bz/+BH4pAaLng7LiPz/3DB1FVGee/2jH+Tv2+DQUXKnb 4kZNo0O0RW5PmfhcISXEsyhBdRd+z6pthr1Qvtr1UpdeeTtyBYdSSqpsgV2D8e6tk7ZP 3Bfw== X-Gm-Message-State: AC+VfDy0fhsm8slAXgh18rSLEMFeBHKqbh9QqufkPvTJ424aNirIuBcb 9NZSQH+QuDn1kdFvco0rGA7/fMCIACpj1Qb6mbo= X-Received: by 2002:a05:6512:32af:b0:4f8:6e1a:b552 with SMTP id q15-20020a05651232af00b004f86e1ab552mr7966033lfe.28.1687419924420; Thu, 22 Jun 2023 00:45:24 -0700 (PDT) Received: from Fecusia.lan (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id y11-20020a19750b000000b004f4cabba7desm1037465lfe.74.2023.06.22.00.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 00:45:24 -0700 (PDT) From: Linus Walleij <linus.walleij@linaro.org> To: linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Arnd Bergmann <arnd@arndb.de> Cc: Linus Walleij <linus.walleij@linaro.org>, Dmitry Osipenko <digetx@gmail.com> Subject: [PATCH] misc/genalloc: Name subpools by of_node_full_name() Date: Thu, 22 Jun 2023 09:45:20 +0200 Message-Id: <20230622074520.3058027-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769389517467935700?= X-GMAIL-MSGID: =?utf-8?q?1769389517467935700?= |
Series |
misc/genalloc: Name subpools by of_node_full_name()
|
|
Commit Message
Linus Walleij
June 22, 2023, 7:45 a.m. UTC
A previous commit tried to come up with more generic subpool
names, but this isn't quite working: the node name was used
elsewhere to match pools to consumers which regressed the
nVidia Tegra 2/3 video decoder.
Revert back to an earlier approach using of_node_full_name()
instead of just the name to make sure the pool name is more
unique, and change both sites using this in the kernel.
It is not perfect since two SRAM nodes could have the same
subpool name but it makes the situation better than before.
Reported-by: Dmitry Osipenko <digetx@gmail.com>
Fixes: 21e5a2d10c8f ("misc: sram: Generate unique names for subpools")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/misc/sram.c | 2 +-
lib/genalloc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
22.06.2023 10:45, Linus Walleij пишет: > A previous commit tried to come up with more generic subpool > names, but this isn't quite working: the node name was used > elsewhere to match pools to consumers which regressed the > nVidia Tegra 2/3 video decoder. > > Revert back to an earlier approach using of_node_full_name() > instead of just the name to make sure the pool name is more > unique, and change both sites using this in the kernel. > > It is not perfect since two SRAM nodes could have the same > subpool name but it makes the situation better than before. > > Reported-by: Dmitry Osipenko <digetx@gmail.com> > Fixes: 21e5a2d10c8f ("misc: sram: Generate unique names for subpools") > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > --- > drivers/misc/sram.c | 2 +- > lib/genalloc.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c > index 5757adf418b1..61209739dc43 100644 > --- a/drivers/misc/sram.c > +++ b/drivers/misc/sram.c > @@ -236,7 +236,7 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) > } > if (!label) > block->label = devm_kasprintf(sram->dev, GFP_KERNEL, > - "%s", dev_name(sram->dev)); > + "%s", of_node_full_name(child)); > else > block->label = devm_kstrdup(sram->dev, > label, GFP_KERNEL); > diff --git a/lib/genalloc.c b/lib/genalloc.c > index 0c883d6fbd44..6c644f954bc5 100644 > --- a/lib/genalloc.c > +++ b/lib/genalloc.c > @@ -895,7 +895,7 @@ struct gen_pool *of_gen_pool_get(struct device_node *np, > > of_property_read_string(np_pool, "label", &name); > if (!name) > - name = np_pool->name; > + name = of_node_full_name(np_pool); > } > if (pdev) > pool = gen_pool_get(&pdev->dev, name); Works great, thanks! Tested-by: Dmitry Osipenko <digetx@gmail.com>
Greg, could you apply this patch for fixes? Thanks! On Thu, Jun 22, 2023 at 9:45 AM Linus Walleij <linus.walleij@linaro.org> wrote: > A previous commit tried to come up with more generic subpool > names, but this isn't quite working: the node name was used > elsewhere to match pools to consumers which regressed the > nVidia Tegra 2/3 video decoder. > > Revert back to an earlier approach using of_node_full_name() > instead of just the name to make sure the pool name is more > unique, and change both sites using this in the kernel. > > It is not perfect since two SRAM nodes could have the same > subpool name but it makes the situation better than before. > > Reported-by: Dmitry Osipenko <digetx@gmail.com> > Fixes: 21e5a2d10c8f ("misc: sram: Generate unique names for subpools") > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
On Sun, Jul 16, 2023 at 09:44:39AM +0200, Linus Walleij wrote: > Greg, could you apply this patch for fixes? > > Thanks! > > On Thu, Jun 22, 2023 at 9:45 AM Linus Walleij <linus.walleij@linaro.org> wrote: > > > A previous commit tried to come up with more generic subpool > > names, but this isn't quite working: the node name was used > > elsewhere to match pools to consumers which regressed the > > nVidia Tegra 2/3 video decoder. > > > > Revert back to an earlier approach using of_node_full_name() > > instead of just the name to make sure the pool name is more > > unique, and change both sites using this in the kernel. > > > > It is not perfect since two SRAM nodes could have the same > > subpool name but it makes the situation better than before. > > > > Reported-by: Dmitry Osipenko <digetx@gmail.com> > > Fixes: 21e5a2d10c8f ("misc: sram: Generate unique names for subpools") > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Let me catch up with emails over the next week or so, I'll queue it up then, thanks. greg k-h
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 5757adf418b1..61209739dc43 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -236,7 +236,7 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) } if (!label) block->label = devm_kasprintf(sram->dev, GFP_KERNEL, - "%s", dev_name(sram->dev)); + "%s", of_node_full_name(child)); else block->label = devm_kstrdup(sram->dev, label, GFP_KERNEL); diff --git a/lib/genalloc.c b/lib/genalloc.c index 0c883d6fbd44..6c644f954bc5 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c @@ -895,7 +895,7 @@ struct gen_pool *of_gen_pool_get(struct device_node *np, of_property_read_string(np_pool, "label", &name); if (!name) - name = np_pool->name; + name = of_node_full_name(np_pool); } if (pdev) pool = gen_pool_get(&pdev->dev, name);