devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Md Danish Anwar <a0501179@ti.com>, Andrew Davis <afd@ti.com>,
	MD Danish Anwar <danishanwar@ti.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Simon Horman <simon.horman@corigine.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Richard Cochran <richardcochran@gmail.com>,
	Conor Dooley <conor+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: nm@ti.com, srk@ti.com, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, netdev@vger.kernel.org,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 3/5] net: ti: icss-iep: Add IEP driver
Date: Thu, 10 Aug 2023 15:05:36 +0300	[thread overview]
Message-ID: <1b05b4ae-00e7-0f90-9c63-7da8797bdb6a@kernel.org> (raw)
In-Reply-To: <c7ddb12d-ae18-5fc2-9729-c88ea73b21d7@ti.com>



On 10/08/2023 14:50, Md Danish Anwar wrote:
> Hi Andrew,
> 
> On 09/08/23 8:30 pm, Andrew Davis wrote:
>> On 8/9/23 6:49 AM, MD Danish Anwar wrote:
>>> From: Roger Quadros <rogerq@ti.com>
>>>
>>> Add a driver for Industrial Ethernet Peripheral (IEP) block of PRUSS to
>>> support timestamping of ethernet packets and thus support PTP and PPS
>>> for PRU ethernet ports.
>>>
>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>>> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
>>> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
>>> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
>>> ---
>>>   drivers/net/ethernet/ti/Kconfig          |  12 +
>>>   drivers/net/ethernet/ti/Makefile         |   1 +
>>>   drivers/net/ethernet/ti/icssg/icss_iep.c | 935 +++++++++++++++++++++++
>>>   drivers/net/ethernet/ti/icssg/icss_iep.h |  38 +
>>>   4 files changed, 986 insertions(+)
>>>   create mode 100644 drivers/net/ethernet/ti/icssg/icss_iep.c
>>>   create mode 100644 drivers/net/ethernet/ti/icssg/icss_iep.h
>>>
>>> diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
>>> index 63e510b6860f..88b5b1b47779 100644
>>> --- a/drivers/net/ethernet/ti/Kconfig
>>> +++ b/drivers/net/ethernet/ti/Kconfig
>>> @@ -186,6 +186,7 @@ config CPMAC
>>>   config TI_ICSSG_PRUETH
>>>       tristate "TI Gigabit PRU Ethernet driver"
>>>       select PHYLIB
>>> +    select TI_ICSS_IEP
>>
>> Why not save selecting this until you add its use in the ICSSG_PRUETH driver in
>> the next patch.
>>
> 
> The next patch is only adding changes to icssg-prueth .c /.h files. This patch
> is adding changes to Kconfig and the Makefile. To keep it that way selecting
> this is added in this patch. No worries, I will move this to next patch.
> 
>> [...]
>>
>>> +
>>> +static u32 icss_iep_readl(struct icss_iep *iep, int reg)
>>> +{
>>> +    return readl(iep->base + iep->plat_data->reg_offs[reg]);
>>> +}
>>
>> Do these one line functions really add anything? Actually why
>> not use the regmap you have here.
> 
> These one line functions are not really adding anything but they are acting as
> a wrapper around readl /writel and providing some sort of encapsulation as
> directly calling readl will result in a little complicated code.
> 
> /* WIth One line function */
> ts_lo = icss_iep_readl(iep, ICSS_IEP_COUNT_REG0);
> 
> /* Without one line function */
> ts_lo = readl(iep->base, iep->plat_data->reg_offs[ICSS_IEP_COUNT_REG0]);
> 
> Previously regmap was used in this driver. But in older commit [1] in
> 5.10-ti-linux-kernel (Before I picked the driver for upstream) it got changed
> to readl / writel stating that regmap_read / write is too slow. IEP is time
> sensitive and needs faster read and write, probably because of this they
> changed it.

This is true. Can you please pick the exact reasoning mentioned there
and put it as a comment where you use read/writel() instead of regmap()
so we don't forget this and accidentally switch it back to regmap()
in the future.

I think this is only required for read/write to the IEP count register and
SYNC_CTRL_REG when doing gettime/settime.

-- 
cheers,
-roger

  reply	other threads:[~2023-08-10 12:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 11:49 [PATCH v3 0/5] Introduce IEP driver and packet timestamping support MD Danish Anwar
2023-08-09 11:49 ` [PATCH v3 1/5] dt-bindings: net: Add ICSS IEP MD Danish Anwar
2023-08-09 21:37   ` Conor Dooley
2023-08-10  9:53     ` [EXTERNAL] " Md Danish Anwar
2023-08-10 12:52       ` Conor Dooley
2023-08-10 12:57         ` Md Danish Anwar
2023-08-10 13:05           ` Conor Dooley
2023-08-09 11:49 ` [PATCH v3 2/5] dt-bindings: net: Add IEP property in ICSSG DT binding MD Danish Anwar
2023-08-09 11:49 ` [PATCH v3 3/5] net: ti: icss-iep: Add IEP driver MD Danish Anwar
2023-08-09 15:00   ` Andrew Davis
2023-08-10 11:50     ` Md Danish Anwar
2023-08-10 12:05       ` Roger Quadros [this message]
2023-08-10 12:11         ` Md Danish Anwar
2023-08-11 15:24       ` Andrew Davis
2023-08-14  7:32         ` Md Danish Anwar
2023-08-09 11:49 ` [PATCH v3 4/5] net: ti: icssg-prueth: add packet timestamping and ptp support MD Danish Anwar
2023-08-09 11:49 ` [PATCH v3 5/5] net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support MD Danish Anwar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b05b4ae-00e7-0f90-9c63-7da8797bdb6a@kernel.org \
    --to=rogerq@kernel.org \
    --cc=a0501179@ti.com \
    --cc=afd@ti.com \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=simon.horman@corigine.com \
    --cc=srk@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).