The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Mateusz Polchlopek" <mateusz.polchlopek@intel.com>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Richard Cochran" <richardcochran@gmail.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org, "Mohamed Abuelfotoh,
	Hazem" <abuehaze@amazon.com>
Subject: Re: [PATCH net-next 0/4] ptp: vmclock: bugfixes and cleanups for error handling
Date: Fri, 07 Feb 2025 09:10:42 +0000	[thread overview]
Message-ID: <34d961bf2f40f054dd79cf7d8cf81a3eefd00a59.camel@infradead.org> (raw)
In-Reply-To: <e16551dd-3a84-49ba-b875-c11f77239984@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]

On Fri, 2025-02-07 at 08:13 +0100, Mateusz Polchlopek wrote:
> 
> 
> On 2/6/2025 6:45 PM, Thomas Weißschuh wrote:
> > Some error handling issues I noticed while looking at the code.
> > 
> > Only compile-tested.
> > 
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> > ---
> > Thomas Weißschuh (4):
> >        ptp: vmclock: Set driver data before its usage
> >        ptp: vmclock: Don't unregister misc device if it was not registered
> >        ptp: vmclock: Clean up miscdev and ptp clock through devres
> >        ptp: vmclock: Remove goto-based cleanup logic
> > 
> >   drivers/ptp/ptp_vmclock.c | 46 ++++++++++++++++++++--------------------------
> >   1 file changed, 20 insertions(+), 26 deletions(-)
> > ---
> > base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> > change-id: 20250206-vmclock-probe-57cbcb770925
> > 
> > Best regards,
> 
> As those all are fixes and cleanups then I think it should be tagged to
> net not net-next.

Agreed. Thanks, Thomas. For all four:

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>

I'm about to post a fifth which adds a .owner to vmclock_miscdev_fops.

Tested with the existing '-device vmclock' support in QEMU, plus this
hack to actually expose a PTP clock to the guest (which we haven't
worked out how to do *properly* from the timekeeping subsystem of a
Linux host yet; qv).

--- a/hw/acpi/vmclock.c
+++ b/hw/acpi/vmclock.c
@@ -151,6 +151,18 @@ static void vmclock_realize(DeviceState *dev,
Error **errp)
 
     qemu_register_reset(vmclock_handle_reset, vms);
 
+	vms->clk->time_type = VMCLOCK_TIME_TAI;
+    vms->clk->flags = VMCLOCK_FLAG_TAI_OFFSET_VALID;
+    vms->clk->tai_offset_sec = -3600;
+    vms->clk->clock_status = VMCLOCK_STATUS_SYNCHRONIZED;
+    vms->clk->counter_value = 0;
+    vms->clk->counter_id = VMCLOCK_COUNTER_X86_TSC;
+    vms->clk->time_sec = 1704067200;
+    vms->clk->time_frac_sec = 0x8000000000000000ULL;
+    vms->clk->counter_period_frac_sec = 0x1a6e39b3e0ULL;
+    vms->clk->counter_period_shift = 4;
+    //vms->clk->counter_period_frac_sec = 0x1934c67f9b2ce6ULL;
+
     vmclock_update_guest(vms);
 }
 


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]

  reply	other threads:[~2025-02-07  9:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 17:45 [PATCH net-next 0/4] ptp: vmclock: bugfixes and cleanups for error handling Thomas Weißschuh
2025-02-06 17:45 ` [PATCH net-next 1/4] ptp: vmclock: Set driver data before its usage Thomas Weißschuh
2025-02-07  7:07   ` Mateusz Polchlopek
2025-02-06 17:45 ` [PATCH net-next 2/4] ptp: vmclock: Don't unregister misc device if it was not registered Thomas Weißschuh
2025-02-06 17:45 ` [PATCH net-next 3/4] ptp: vmclock: Clean up miscdev and ptp clock through devres Thomas Weißschuh
2025-02-06 17:45 ` [PATCH net-next 4/4] ptp: vmclock: Remove goto-based cleanup logic Thomas Weißschuh
2025-02-07  5:43 ` [PATCH net-next 0/4] ptp: vmclock: bugfixes and cleanups for error handling Richard Cochran
2025-02-07  7:13 ` Mateusz Polchlopek
2025-02-07  9:10   ` David Woodhouse [this message]
2025-02-07  9:25     ` Thomas Weißschuh
2025-02-07  9:29       ` David Woodhouse
2025-02-07  9:13 ` [PATCH net-next 5/4] ptp: vmclock: Add .owner to vmclock_miscdev_fops David Woodhouse

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=34d961bf2f40f054dd79cf7d8cf81a3eefd00a59.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=abuehaze@amazon.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mateusz.polchlopek@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /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