From: Simon Horman <simon.horman@corigine.com>
To: Alexandru Tachici <alexandru.tachici@analog.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com,
yangyingliang@huawei.com, weiyongjun1@huawei.com,
robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
devicetree@vger.kernel.org, lennart@lfdomain.com
Subject: Re: [net-next v2 1/3] net: ethernet: adi: adin1110: add PTP clock support
Date: Fri, 27 Jan 2023 16:14:48 +0100 [thread overview]
Message-ID: <Y9PqaJGwAUAZo2Rx@corigine.com> (raw)
In-Reply-To: <20230126133346.61097-2-alexandru.tachici@analog.com>
On Thu, Jan 26, 2023 at 03:33:44PM +0200, Alexandru Tachici wrote:
> Add control for the PHC inside the ADIN1110/2111.
> Device contains a syntonized counter driven by a 120 MHz
> clock with 8 ns resolution.
>
> Time is stored on two registers: a 32bit seconds register and
> a 32bit nanoseconds register.
>
> For adjusting the clock timing, device uses an addend register.
> Can generate an output signal on the TS_TIMER pin.
> For reading the timestamp the current tiem is saved by setting the
> TS_CAPT pin via gpio in order to snapshot both seconds and nanoseconds
> in different registers that the live ones.
>
> Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
...
> @@ -150,6 +188,11 @@ struct adin1110_port_priv {
> struct adin1110_priv {
> struct mutex lock; /* protect spi */
> spinlock_t state_lock; /* protect RX mode */
> + bool ts_rx_append;
> + struct ptp_clock_info ptp;
> + struct ptp_clock *ptp_clock;
> + struct gpio_desc *ts_capt;
> + struct ptp_pin_desc ptp_pins[ADIN_MAC_MAX_PTP_PINS];
> struct mii_bus *mii_bus;
> struct spi_device *spidev;
> bool append_crc;
nit: I'm unsure if this is important or not.
But (on x86_64) the arrangement above leads to a 7-byte hole in the
structure between ts_rx_append and ptp.
Probably there is much scope to make adin1110_priv more
cache-line friendly. But in this case an improvement may be
to locate ts_rx_append immediately before or after append_crc,
as there is also a 7-byte hole after append_crc.
Likewise, I think there may be room to improve on the cache-line
friendliness of the changes to this structure in patch 2/3.
next prev parent reply other threads:[~2023-01-27 15:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 13:33 [net-next v2 0/3] net: ethernet: adi: adin1110: add PTP support Alexandru Tachici
2023-01-26 13:33 ` [net-next v2 1/3] net: ethernet: adi: adin1110: add PTP clock support Alexandru Tachici
2023-01-27 15:14 ` Simon Horman [this message]
2023-01-26 13:33 ` [net-next v2 2/3] net: ethernet: adi: adin1110: add timestamping support Alexandru Tachici
2023-01-26 13:33 ` [net-next v2 3/3] dt-bindings: net: adin1110: Document ts-capt pin Alexandru Tachici
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=Y9PqaJGwAUAZo2Rx@corigine.com \
--to=simon.horman@corigine.com \
--cc=alexandru.tachici@analog.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=lennart@lfdomain.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh+dt@kernel.org \
--cc=weiyongjun1@huawei.com \
--cc=yangyingliang@huawei.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).