Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp222498ybp; Tue, 8 Oct 2019 16:58:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqznxDJup2YUQ7pDXbWw+OgceNEPFVLhwtEn1R7Ma9mfbEW1PvsPw7tJuLk2nZAnPzcib2bb X-Received: by 2002:a17:906:c49:: with SMTP id t9mr280626ejf.267.1570579113652; Tue, 08 Oct 2019 16:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570579113; cv=none; d=google.com; s=arc-20160816; b=QWoKAeNTKdoKv1xmtwWafwgWwNOSPV/bG834f1qkADnxFnpTOmIaNxQQ8Iue/kDLtg jdaXjX3fo6nBOugZR2m5rFWFOqcqPyMx5UrtOqUt/aaibbkZ/0luxACkON2t8FuLY4oz tdzDnPrew550R0kreFdtuOOxD3ZEIxkqbkeHdG20YOcTi38QZ+Ps2fVqw2WmnDlQZhnG 4aEqrg4f8t0ZE8J/FuuqKVPXTw+9rfbTtbMT0FVDrL/sebnzRK/P2efUB/3e7GGX4NMO +WyVz1TOsHmHSYlKA45kX5LyN49ThDKOLq26i2HUN2mMHoRm8dVF5mAcGlvLpSBVJxTb w0+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2qXzeBiy41nMC6BcEC9DH4mNbWNmy0bhhN79nocj224=; b=VTCYXFdsGB+Ki0P3plTDHbLmHEOdOZr9l2O8YfNA7xAli17IqpecNTX6Gd92LceezJ zPdAHFnl//RgBSeEFtK2icdq4V47LD5z+Ghy+GIm0h0em2KjUuTQVHi5FlSi4AgsnVfP jG4exzCsB0F4Ds7b9vS0KdqtvGjZrmjRT2hAfv/R1Wzl6KMzBBuYBG2UrEAYs/M1PasW RJRSTC152tHcPYuiSl2zcAvOkHCkwOzmZ8TVh55YWWGciNZNTu9+RdWarOKUGnga7sep w2Bc5g8Yl8n+9BffcE0zYYUwrSCHlRJQVDJgGvsuKgDBIQL8SywHm/wiF2v1EPXHjpkF uTHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xcswi/ZQ"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si224408ejq.343.2019.10.08.16.58.09; Tue, 08 Oct 2019 16:58:33 -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=@linaro.org header.s=google header.b="Xcswi/ZQ"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729713AbfJHXzJ (ORCPT + 99 others); Tue, 8 Oct 2019 19:55:09 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44174 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbfJHXzJ (ORCPT ); Tue, 8 Oct 2019 19:55:09 -0400 Received: by mail-pg1-f194.google.com with SMTP id u12so184359pgb.11 for ; Tue, 08 Oct 2019 16:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2qXzeBiy41nMC6BcEC9DH4mNbWNmy0bhhN79nocj224=; b=Xcswi/ZQHoJgM4K6vQuEbWpRb2t3ivGAEJdBvZ6J0FwR7fBA7PhJud+8XTKHlDwEq6 OPtxpDYFnvgSt5/oP1srt4iULECQUR8PKCWtdLogu9O4eZB3Z7aMIKWcc8gHXcFjCLni iQ/3cgiG5VaBdVDBxFFQbx1SspbBXHtd/HY3e+glh68QFfFOlmTgWF+lsBwAgI7uMtkc brnIXFgndt9RcrcUZtYytJJMlrnUcK+UicbsraUJDFBfCfRJDCk5aNPopAnvaL0nmImI Q6yMRK1xSol4A/I3bjHi6J6tUVIlZEiqJrid+yRK+1SDmTPsi+OEaDNd6vFyGAT7eKeL lhhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2qXzeBiy41nMC6BcEC9DH4mNbWNmy0bhhN79nocj224=; b=N4DUfnL83Wv74fZ2mBgXJKWiWds+udASL83sbaWplRdIzgh5cme1ifHYy0r4xMBXIX 740oV9e/9VXkwrr/R+vHro7YpJU1hzLSIPndy+b+18a3Ysf6cGlYXNj+mahfyRSYobH5 RhW+UNvTpEE4xEXXY7u8XYTdQ5421CW8EFmq6sbJjPN5UGJ5kY6VMFkw/Bv8pBZ2PXBD zrxmIyJ28UB7M5hm/j3gKLkDSC/z2W41l69XWVrK07fW4KPDURiJew3/Ty4JH2XJe6Fo mwQRaj927PAiaH2tdVjFnm+8As1ctvS6OTLl0Fh+x3kmR1VC9BcdJzgIsw53S5/wzBCg jBtg== X-Gm-Message-State: APjAAAVd9iurjWKWojvaBK+3pU5k6Acr/k9G8CYCcqk1MOZ+6VAEc8s3 uiF+fEQzlgnC5gIiImx2PhdM+w== X-Received: by 2002:a63:c40e:: with SMTP id h14mr1150602pgd.254.1570578908113; Tue, 08 Oct 2019 16:55:08 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id 18sm223411pfp.100.2019.10.08.16.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2019 16:55:07 -0700 (PDT) Date: Tue, 8 Oct 2019 16:55:04 -0700 From: Bjorn Andersson To: Stephen Boyd Cc: Andy Gross , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Venkata Narendra Kumar Gutta , Evan Green Subject: Re: [PATCH v2 0/2] Avoid regmap debugfs collisions in qcom llcc driver Message-ID: <20191008235504.GN63675@minitux> References: <20191008234505.222991-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008234505.222991-1-swboyd@chromium.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 08 Oct 16:45 PDT 2019, Stephen Boyd wrote: > Now a two part series. These patches fix a debugfs name collision for > the llcc regmaps and moves the config to a local variable to save on > image size. > > Changes from v1 (https://lkml.kernel.org/r/20191004233132.194336-1-swboyd@chromium.org): > * New second patch > * Dropped static > * See range-diff below! > > Stephen Boyd (2): > soc: qcom: llcc: Name regmaps to avoid collisions > soc: qcom: llcc: Move regmap config to local variable > > drivers/soc/qcom/llcc-slice.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > Cc: Venkata Narendra Kumar Gutta > Cc: Evan Green > > Range-diff against v1: > -: ------------ > 1: 07bc0e8bdb6e soc: qcom: llcc: Name regmaps to avoid collisions > 1: 0c54fc8a7ed6 ! 2: 5c4446e36783 soc: qcom: llcc: Name regmaps to avoid collisions > @@ Metadata > Author: Stephen Boyd > > ## Commit message ## > - soc: qcom: llcc: Name regmaps to avoid collisions > + soc: qcom: llcc: Move regmap config to local variable > > - We'll end up with debugfs collisions if we don't give names to the > - regmaps created inside this driver. Copy the template config over into > - this function and give the regmap the same name as the resource name. > + This is now a global variable that we're modifying to fix the name. > + That isn't terribly thread safe and it's not necessary to be a global so > + let's just move this to a local variable instead. This saves space in > + the symtab and actually reduces kernel image size because the regmap > + config is large and we can replace the initialization of that structure > + with a memset and a few member assignments. > > - Fixes: 7f9c136216c7 ("soc: qcom: Add broadcast base for Last Level Cache Controller (LLCC)") > - Cc: Venkata Narendra Kumar Gutta > - Cc: Evan Green > Signed-off-by: Stephen Boyd > > ## drivers/soc/qcom/llcc-slice.c ## > @@ 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. Regards, Bjorn > + .reg_bits = 32, > + .reg_stride = 4, > + .val_bits = 32, > @@ drivers/soc/qcom/llcc-slice.c: static struct regmap *qcom_llcc_init_mmio(struct > > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); > if (!res) > -@@ drivers/soc/qcom/llcc-slice.c: static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, > - if (IS_ERR(base)) > - return ERR_CAST(base); > - > -+ llcc_regmap_config.name = name; > - return devm_regmap_init_mmio(&pdev->dev, base, &llcc_regmap_config); > - } > - > > base-commit: 8b0eed9f6e36a5488967b0acc51444d658dd711b > -- > Sent by a computer through tubes >