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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 9969CC433ED for ; Mon, 19 Apr 2021 14:32:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79F8C611CE for ; Mon, 19 Apr 2021 14:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239947AbhDSOdA (ORCPT ); Mon, 19 Apr 2021 10:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232302AbhDSOc6 (ORCPT ); Mon, 19 Apr 2021 10:32:58 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55EF1C061763 for ; Mon, 19 Apr 2021 07:32:29 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id u80so2036524oia.0 for ; Mon, 19 Apr 2021 07:32:29 -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; bh=4nWRWEmvjlM65gvpUkZGPybpr9Usfroi21CGmSCGgnQ=; b=dKL+8Di3Vh6QSg4UqSIU/ueXxsqOGsn3aeAhCMqzWv41AGVzSLAx1Ybl794pFYHlfG 3TUX1OT/sBVmuDWRZOG8OqLuCv0p08RsLlCGp5JmsYmuOLPShTe2tXYNpIVo1mXY4nPg 8W94VxamJxc4H91RpnHe8FbFMEXdkhnkEbNv5G3SHB+Pl7IZDP8DwwLKVe0VITYW7Z6O hVIKKJzfjEB0Zxd0+uM9b/b76cwX63K/kOrrVNR++7bhgj90+LQIuCzqmjUhKKf0IQiO fuCn9ZmD3+G8qXxepR7uHqrVcdxpjY8KisVw5KC7qdNTn9x8SioiKjV/nTVbgTFw1TGR C7OQ== 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; bh=4nWRWEmvjlM65gvpUkZGPybpr9Usfroi21CGmSCGgnQ=; b=cgRtu7n5qfXzxkKf+S1Vy/eqPzmmL2RFRrv4SnJJJ7RWeMTVO5vJOIN8/uUlW+H0YF bsqOFarcXugCSg/Wzv5tKUAgPJkpNn/CodD2h6UsKFldXjN5sPbxXQkXQLFj51SnrKno 4XFti+gp/ygOpOwUGj/X5w7/EUeYxrBJTR9FReYNHJDi/S60YzwlnMTjtwpRzNmDyXvq UrkC0+UwF2oo7zmTEdry3vJSgRglRetpVT2mbJW2JHpXIuC3WgYSFr7gwey/VY3QNNOx viVVqUAB8Gi8j5E6RCzLIaJgBijgwlLImRKrXmEx15CUUhoGOu4OzWJsdwLJCXkn3BES fvlA== X-Gm-Message-State: AOAM530jmkkspvbNmyLVluIxbcZnCxPg6ZzIFH5HfIDBuwOQLrOyLuXk 2sg4hS4NQ2Yz8Ma5aEJpzonW6g== X-Google-Smtp-Source: ABdhPJy3ipgPHZ4m9cveqEO3UoOQ3lZDcUGjgRZW0c3MiRNf9Yn6lUjxnt5tD4qel7g8ZRGUhgynJA== X-Received: by 2002:aca:408b:: with SMTP id n133mr13137273oia.13.1618842748685; Mon, 19 Apr 2021 07:32:28 -0700 (PDT) Received: from yoga (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id g26sm3567915otr.73.2021.04.19.07.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:32:28 -0700 (PDT) Date: Mon, 19 Apr 2021 09:32:25 -0500 From: Bjorn Andersson To: schowdhu@codeaurora.org Cc: Felipe Balbi , Andy Gross , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Sai Prakash Ranjan , Sibi Sankar , Rajendra Nayak , vkoul@kernel.org Subject: Re: [PATCH V3 2/4] soc: qcom: dcc:Add driver support for Data Capture and Compare unit(DCC) Message-ID: <20210419143225.GO1538589@yoga> References: <59b2e83d5d0f435112f6ae266612ff91c85b120f.1618387606.git.schowdhu@codeaurora.org> <87k0p4njni.fsf@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 19 Apr 05:32 CDT 2021, schowdhu@codeaurora.org wrote: > On 2021-04-15 12:01, Felipe Balbi wrote: > > Hi, > > > > Souradeep Chowdhury writes: > > > diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile > > > index ad675a6..e7f0ccb 100644 > > > --- a/drivers/soc/qcom/Makefile > > > +++ b/drivers/soc/qcom/Makefile > > > @@ -1,19 +1,22 @@ > > > # SPDX-License-Identifier: GPL-2.0 > > > CFLAGS_rpmh-rsc.o := -I$(src) > > > obj-$(CONFIG_QCOM_AOSS_QMP) += qcom_aoss.o > > > -obj-$(CONFIG_QCOM_GENI_SE) += qcom-geni-se.o > > > +obj-$(CONFIG_QCOM_APR) += apr.o > > > obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o > > > obj-$(CONFIG_QCOM_CPR) += cpr.o > > > +obj-$(CONFIG_QCOM_DCC) += dcc.o > > > +obj-$(CONFIG_QCOM_GENI_SE) += qcom-geni-se.o > > > obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o > > > +obj-$(CONFIG_QCOM_KRYO_L2_ACCESSORS) += kryo-l2-accessors.o > > > +obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o > > > obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o > > > obj-$(CONFIG_QCOM_OCMEM) += ocmem.o > > > obj-$(CONFIG_QCOM_PDR_HELPERS) += pdr_interface.o > > > obj-$(CONFIG_QCOM_QMI_HELPERS) += qmi_helpers.o > > > -qmi_helpers-y += qmi_encdec.o qmi_interface.o > > > obj-$(CONFIG_QCOM_RMTFS_MEM) += rmtfs_mem.o > > > obj-$(CONFIG_QCOM_RPMH) += qcom_rpmh.o > > > -qcom_rpmh-y += rpmh-rsc.o > > > -qcom_rpmh-y += rpmh.o > > > +obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o > > > +obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o > > > obj-$(CONFIG_QCOM_SMD_RPM) += smd-rpm.o > > > obj-$(CONFIG_QCOM_SMEM) += smem.o > > > obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o > > > @@ -21,8 +24,6 @@ obj-$(CONFIG_QCOM_SMP2P) += smp2p.o > > > obj-$(CONFIG_QCOM_SMSM) += smsm.o > > > obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o > > > obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o > > > -obj-$(CONFIG_QCOM_APR) += apr.o > > > -obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o > > > -obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o > > > -obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o > > > -obj-$(CONFIG_QCOM_KRYO_L2_ACCESSORS) += kryo-l2-accessors.o > > > +qmi_helpers-y += qmi_encdec.o qmi_interface.o > > > +qcom_rpmh-y += rpmh-rsc.o > > > +qcom_rpmh-y += rpmh.o > > > > why so many changes? > > This has been accidentally sorted based on the config names. Will be fixing > this in next version of the patch. > > > > > > diff --git a/drivers/soc/qcom/dcc.c b/drivers/soc/qcom/dcc.c > > > new file mode 100644 > > > index 0000000..fcd5580 > > > --- /dev/null > > > +++ b/drivers/soc/qcom/dcc.c > > > @@ -0,0 +1,1539 @@ > > > +// SPDX-License-Identifier: GPL-2.0-only > > > +/* > > > + * Copyright (c) 2015-2021, The Linux Foundation. All rights > > > reserved. > > > + */ > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > + > > > > one blank line is enough > > Ack > > > > > > +#define TIMEOUT_US 100 > > > + > > > +#define dcc_writel(drvdata, val, off) \ > > > + writel((val), drvdata->base + dcc_offset_conv(drvdata, off)) > > > +#define dcc_readl(drvdata, off) \ > > > + readl(drvdata->base + dcc_offset_conv(drvdata, off)) > > > + > > > +#define dcc_sram_readl(drvdata, off) \ > > > + readl(drvdata->ram_base + off) > > > > this would be probably be better as static inlines. > > These are simple read and write operations used in the driver > which just calls the generic writel and readl function. > That's why macros have been used here to lesson the overhead > of an extra function call. The compiler will realize that your static dcc_sram_readl() is cheaper to inline than call and do so for you. So you can expect that there's no difference in the output from the compiler, and if there is then the compiler knows something that you're overlooking. Regards, Bjorn