Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1246811ybp; Wed, 9 Oct 2019 11:00:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/RveqpE1zG35sMjM7Csb7CeZm+muP0Qr9JxRqA8sNzvf1p8uT0QHKHsjJBdRE39T/w0mN X-Received: by 2002:a05:6402:21c2:: with SMTP id bi2mr4218781edb.8.1570644051188; Wed, 09 Oct 2019 11:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570644051; cv=none; d=google.com; s=arc-20160816; b=qlfygklQdZP+/qMA+qbpqWGiGNi0OApWdg9z2vEb4P77cCVIGibjWGLhWOz1tccScE jBkIZ+p5maVMIkGK5sIdeadbjwOHJ+BvZKKO77bMhHxKw3yHERN5d0d2kNadrTKYgRJ4 pE/1OrHkKpGbI3+4tsoeoD8mTUaLdsb+ZFsutvsyWtL6SwCh9e8112qb9DSqduJKmMyI f5fqLfjJJZCYY/TQGuqAbpLo41Uo8ffd2iAIX2bsqcAEZOdl2fj/X77676ZcY2Gs18Xh B/x6nah+YNvRMuCuQSCPbtgq4AORqDgh3gonzK8gg3lIeKrGPCBaoaLwiCeH5sQxet7I PDKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YmeJKDAW2I1yruAY3lk0iKjTiIjTCk6xnz0bx6eLJkE=; b=cexOOhQ03+ngfBoIBeE5L9TfKH8v9759B80FlH5nBiJXhDkYRolsjx1tOWzGEnIxGe 80DIOJLJRYJmw+6m7I8DSZG02otM4G4MoJQMearFddkEH+yGSjFtPcrCLQbYtBWJDlIT pQPMW0VfIfNPvNhrjPUkKQPhV8RdK07wCdpPP+J7wRg/TZM2Q2K5n2YXbkuiyFiSuR5+ 9gS2daQbct+P5HGqYsXBkVtWOO5KJW4ofIso+cdiEggk1vExnm70Kg7zcuIGM7Wi8syT 6o56k6t+sMlHuVjrsQFV8Sb5e+zCZ0nPOb8vTAOWrqnEhNo9ZEg92zFQiTA8i7KDtdjw r4qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XMrdMa5P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8si1864549edz.299.2019.10.09.11.00.26; Wed, 09 Oct 2019 11:00:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XMrdMa5P; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731173AbfJISAM (ORCPT + 99 others); Wed, 9 Oct 2019 14:00:12 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42744 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730546AbfJISAM (ORCPT ); Wed, 9 Oct 2019 14:00:12 -0400 Received: by mail-lf1-f67.google.com with SMTP id c195so2324958lfg.9 for ; Wed, 09 Oct 2019 11:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YmeJKDAW2I1yruAY3lk0iKjTiIjTCk6xnz0bx6eLJkE=; b=XMrdMa5P0q1bpVT/YQRnvcSKOWRUN0f0eZRKmI7S0MK6/Uf2O8KITsEALxVxHVbbh8 WSVOOol/gviCdzpPsJeQZ9KYe4hJRDsZlXKOFRkUAnyHfVoTY9JKZbRSz68oJQxnIngB IFJB85PFJahGQ+uE43aCf5Huxucwr1DomVkeg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YmeJKDAW2I1yruAY3lk0iKjTiIjTCk6xnz0bx6eLJkE=; b=dfY7B46zolRZhrEBJpNl81ItkEEDng549sKCtYuZnTX194uyfP8UqE9LVR57agw6og 3b3ELJ2Hxy49goTL+rErDtYOtQhqnE/gxiuVJzlvM6hoN8S+iGPS0Cyoq6Tgyo8o3msA 8L1XSiHiNqEssPBzGxr8ws2MY2Ejlzu8rh83zhc/tlUpHTj0YbaUFbpcF3QO6suhwfou YupoZxspAra4sQ4TTG+iw2E7dZtkLHFdRErU9ge7m4TcpURmrA8knhKIuzmlpJH9hlKK fYioZYd0GIJGYjOU+9N54tvQA2vIpCNAEp/f6Z/tDrSPe1TJANIRtZyLYFRsHhoNO+BP 3KNQ== X-Gm-Message-State: APjAAAUzU5OKPgt/NtPKAbj2olFRT0uUjUZuV2xZoMUeseqbcp0JmmcY ZVjveMlOTmjD8DfEu0/Uc2eW0WPgMuU= X-Received: by 2002:ac2:4c99:: with SMTP id d25mr3102638lfl.112.1570644009117; Wed, 09 Oct 2019 11:00:09 -0700 (PDT) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id h5sm661250ljf.83.2019.10.09.11.00.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Oct 2019 11:00:08 -0700 (PDT) Received: by mail-lj1-f176.google.com with SMTP id m13so3389811ljj.11 for ; Wed, 09 Oct 2019 11:00:08 -0700 (PDT) X-Received: by 2002:a2e:584b:: with SMTP id x11mr3244996ljd.36.1570644007544; Wed, 09 Oct 2019 11:00:07 -0700 (PDT) MIME-Version: 1.0 References: <20191008234505.222991-1-swboyd@chromium.org> <20191008235504.GN63675@minitux> <5d9d3ed4.1c69fb81.5a936.2b18@mx.google.com> <20191009174622.GN6390@tuxbook-pro> In-Reply-To: <20191009174622.GN6390@tuxbook-pro> From: Evan Green Date: Wed, 9 Oct 2019 10:59:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] Avoid regmap debugfs collisions in qcom llcc driver To: Bjorn Andersson Cc: Stephen Boyd , Andy Gross , LKML , linux-arm-msm , Venkata Narendra Kumar Gutta Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 9, 2019 at 10:46 AM Bjorn Andersson wrote: > > On Wed 09 Oct 09:01 PDT 2019, Evan Green wrote: > > > On Tue, Oct 8, 2019 at 6:58 PM Stephen Boyd wrote: > > > > > > Quoting Bjorn Andersson (2019-10-08 16:55:04) > > > > On Tue 08 Oct 16:45 PDT 2019, Stephen Boyd wrote: > > > > > @@ drivers/soc/qcom/llcc-slice.c > > > > > > > > > > static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER; > > > > > > > > > > --static const struct regmap_config llcc_regmap_config = { > > > > > +-static struct regmap_config llcc_regmap_config = { > > > > > - .reg_bits = 32, > > > > > - .reg_stride = 4, > > > > > - .val_bits = 32, > > > > > @@ drivers/soc/qcom/llcc-slice.c: static struct regmap *qcom_llcc_init_mmio(struct > > > > > { > > > > > struct resource *res; > > > > > void __iomem *base; > > > > > -+ static struct regmap_config llcc_regmap_config = { > > > > > ++ struct regmap_config llcc_regmap_config = { > > > > > > > > Now that this isn't static I like the end result better. Not sure about > > > > the need for splitting it in two patches, but if Evan is happy I'll take > > > > it. > > > > > > > > > > Well I split it into bug fix and micro-optimization so backport choices > > > can be made. But yeah, I hope Evan is happy enough to provide a > > > reviewed-by tag! > > > > It's definitely better without the static local since it no longer has > > the cognitive trap, but I still don't really get why we're messing > > with the global v. local aspect of it. We're now inconsistent with > > every other caller of this function, and for what exactly? We've > > traded some data space for a call to memset() and some instructions. I > > would have thought anecdotally that memory was the cheaper thing (ie > > cpu speeds stopped increasing awhile ago, but memory is still getting > > cheaper). > > > > The reason for making the structure local is because it's being modified > per instance, meaning it would still work as long as > qcom_llcc_init_mmio() is never called concurrently for two llcc > instances. But the correctness outweighs the performance degradation of > setting it up on the stack in my view. > I hadn't considered the concurrency aspect of the change, since I had anchored myself on the static local. I'm convinced. Might be worth mentioning that in the commit message. For the series: Reviewed-by: Evan Green