lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f9b28acabea8836b713cab2e0de53542@codeaurora.org>
Date:   Tue, 20 Apr 2021 12:06:40 +0530
From:   schowdhu@...eaurora.org
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Felipe Balbi <balbi@...nel.org>, Andy Gross <agross@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
        Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.org>,
        Sibi Sankar <sibis@...eaurora.org>,
        Rajendra Nayak <rnayak@...eaurora.org>, vkoul@...nel.org
Subject: Re: [PATCH V3 2/4] soc: qcom: dcc:Add driver support for Data Capture
 and Compare unit(DCC)

On 2021-04-19 20:02, Bjorn Andersson wrote:
> On Mon 19 Apr 05:32 CDT 2021, schowdhu@...eaurora.org wrote:
> 
>> On 2021-04-15 12:01, Felipe Balbi wrote:
>> > Hi,
>> >
>> > Souradeep Chowdhury <schowdhu@...eaurora.org> 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 <linux/bitfield.h>
>> > > +#include <linux/bitops.h>
>> > > +#include <linux/cdev.h>
>> > > +#include <linux/delay.h>
>> > > +#include <linux/fs.h>
>> > > +#include <linux/io.h>
>> > > +#include <linux/iopoll.h>
>> > > +#include <linux/module.h>
>> > > +#include <linux/of.h>
>> > > +#include <linux/of_device.h>
>> > > +#include <linux/platform_device.h>
>> > > +#include <linux/slab.h>
>> > > +#include <linux/uaccess.h>
>> > > +
>> > > +
>> >
>> > 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.

Ack. Will go for static inline here.

> 
> Regards,
> Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ