mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wen Gu <guwen@linux.alibaba.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: richardcochran@gmail.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, xuanzhuo@linux.alibaba.com,
	dust.li@linux.alibaba.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] ptp: add Alibaba CIPU PTP clock driver
Date: Mon, 30 Jun 2025 17:04:49 +0800	[thread overview]
Message-ID: <cf70f203-bb0e-4942-8f48-c34e269ce637@linux.alibaba.com> (raw)
In-Reply-To: <69ee8a60-3134-4b7a-8217-be9bbc79a8fa@lunn.ch>



On 2025/6/27 15:46, Andrew Lunn wrote:
>> +#define DRV_VER_MAJOR		1
>> +#define DRV_VER_MINOR		3
>> +#define DRV_VER_SUBMINOR	0
> 
>> +#define LINUX_UPSTREAM		0x1F
> 
>> +static int ptp_cipu_set_drv_version(struct ptp_cipu_ctx *ptp_ctx)
>> +{
>> +	struct ptp_cipu_regs *regs = &ptp_ctx->regs;
>> +	int version, patchlevel, sublevel;
>> +	u32 env_ver, drv_ver;
>> +	int rc;
>> +
>> +	if (sscanf(utsname()->release, "%u.%u.%u",
>> +		   &version, &patchlevel, &sublevel) != 3)
>> +		return -EINVAL;
>> +	sublevel = sublevel < 0xFF ? sublevel : 0xFF;
>> +
>> +	env_ver = (LINUX_UPSTREAM << 27) | (version << 16) |
>> +		  (patchlevel << 8) | sublevel;
>> +
>> +	rc = cipu_iowrite32_and_check(ptp_ctx->reg_addr +
>> +				      PTP_CIPU_REG(env_ver),
>> +				      env_ver, &regs->env_ver);
>> +	if (rc)
>> +		return rc;
>> +
>> +	drv_ver = (DRV_TYPE << 24) | (DRV_VER_MAJOR << 16) |
>> +		  (DRV_VER_MINOR << 8) | DRV_VER_SUBMINOR;
>> +
>> +	return cipu_iowrite32_and_check(ptp_ctx->reg_addr +
>> +					PTP_CIPU_REG(drv_ver), drv_ver,
>> +					&regs->drv_ver);
>> +}
> 
> Please could you explain what this is doing.
> 
> 	Andrew

Sure.

This provides informations to cloud ptp device, so that device
can decide whether to allow the initialization to continue.

It is expected to avoid loading a version that is found to have
serious defects after it is released.

Thanks,

  reply	other threads:[~2025-06-30  9:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27  7:29 Wen Gu
2025-06-27  7:46 ` Andrew Lunn
2025-06-30  9:04   ` Wen Gu [this message]
2025-06-27  7:57 ` Andrew Lunn
2025-06-27 10:59   ` Vadim Fedorenko
2025-06-30 11:23     ` Wen Gu
2025-06-30 13:42       ` Richard Cochran
2025-06-30 12:45   ` Wen Gu

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=cf70f203-bb0e-4942-8f48-c34e269ce637@linux.alibaba.com \
    --to=guwen@linux.alibaba.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=xuanzhuo@linux.alibaba.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

all inboxes | Powered by JetHome®