public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Maciek Machnikowski <maciek@machnikowski.net>
Cc: netdev@vger.kernel.org, richardcochran@gmail.com,
	milena.olech@intel.com, willemdebruijn.kernel@gmail.com,
	andrew@lunn.ch, vadim.fedorenko@linux.dev
Subject: Re: [PATCH v2 net-next 1/3] ptp_mock: Expose ptp_clock_info to external drivers
Date: Mon, 23 Feb 2026 08:36:43 -0800	[thread overview]
Message-ID: <20260223083643.0b322f7e@kernel.org> (raw)
In-Reply-To: <20260222094110.127927-2-maciek@machnikowski.net>

On Sun, 22 Feb 2026 10:41:08 +0100 Maciek Machnikowski wrote:
> -	spin_lock(&phc->lock);
> +	spin_lock_bh(&phc->lock);
>  	timecounter_read(&phc->tc);
>  	phc->cc.mult = MOCK_PHC_CC_MULT + adj;
> -	spin_unlock(&phc->lock);
> +	spin_unlock_bh(&phc->lock);

Sorry if I told you _bh, the locks need the be taken _irqsave()
because of netpoll/netconsole. Running netconsole tests
(netcons_basic.sh):


[  698.451639][T12749] WARNING: kernel/softirq.c:430 at __local_bh_enable_ip+0xc0/0x140, CPU#3: pr/netcon0/12749
[  698.451959][T12749] Modules linked in: netconsole netdevsim geneve vxlan ip6_udp_tunnel udp_tunnel [last unloaded: netdevsim]
[  698.452408][T12749] CPU: 3 UID: 0 PID: 12749 Comm: pr/netcon0 Not tainted 6.19.0-virtme #1 PREEMPT(full) 
[  698.452683][T12749] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[  698.452872][T12749] RIP: 0010:__local_bh_enable_ip+0xc0/0x140
[  698.453071][T12749] Code: 00 00 00 e8 12 15 0a 00 e8 3d 7c 3c 00 fb 65 8b 05 05 72 40 04 85 c0 74 64 48 83 c4 10 c3 65 8b 05 11 b6 40 04 85 c0 75 a2 90 <0f> 0b 90 eb 9c 89 74 24 0c 4c 89 04 24 e8 ce 7f 3c 00 8b 74 24 0c
[  698.453612][T12749] RSP: 0018:ffa0000000657900 EFLAGS: 00010046
[  698.453825][T12749] RAX: 0000000000000000 RBX: 00000000b30e1132 RCX: 1ffffffff7c4ca80
[  698.454046][T12749] RDX: 0000000000000001 RSI: 0000000000000201 RDI: ffffffffbc0657ff
[  698.454262][T12749] RBP: ffa0000000657930 R08: ffffffffbc0657ff R09: ffe21c0000480d23
[  698.454486][T12749] R10: ffe21c0000480d24 R11: ff11000002406914 R12: ffa00000006579d8
[  698.454720][T12749] R13: ff1100000ea7f000 R14: ff1100000c54a000 R15: ff11000013e5ad00
[  698.454953][T12749] FS:  0000000000000000(0000) GS:ff11000070c0b000(0000) knlGS:0000000000000000
[  698.455229][T12749] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  698.455412][T12749] CR2: 00007fe32fcac000 CR3: 000000003753b004 CR4: 0000000000771ef0
[  698.455636][T12749] PKRU: 55555554
[  698.455748][T12749] Call Trace:
[  698.455862][T12749]  <TASK>
[  698.455940][T12749]  ? _raw_spin_unlock_bh+0x23/0x40
[  698.456097][T12749]  mock_phc_gettime64+0x3f/0x80
[  698.456245][T12749]  nsim_start_xmit+0x3be/0x10d0 [netdevsim]
[  698.456437][T12749]  ? __lock_acquire+0x577/0xc10
[  698.456601][T12749]  ? nsim_poll+0x500/0x500 [netdevsim]
[  698.456758][T12749]  ? lock_acquire.part.0+0xbc/0x260
[  698.456912][T12749]  ? rcu_is_watching+0x15/0xd0
[  698.457065][T12749]  ? netif_skb_features+0x27c/0xce0
[  698.457219][T12749]  netpoll_start_xmit+0x18e/0x2e0
[  698.457369][T12749]  __netpoll_send_skb+0x66b/0x800
[  698.457519][T12749]  netpoll_send_skb+0x22/0x90
[  698.457667][T12749]  netconsole_write+0x249/0x2c0 [netconsole]
[  698.457859][T12749]  nbcon_emit_next_record+0x79b/0x930
[  698.458013][T12749]  ? nbcon_can_proceed+0x120/0x120
[  698.458162][T12749]  ? nbcon_context_try_acquire+0x26a/0x5b0
[  698.458346][T12749]  nbcon_emit_one+0x158/0x220
[  698.458490][T12749]  ? nbcon_emit_next_record+0x930/0x930
[  698.458636][T12749]  nbcon_kthread_func+0x3d9/0x570
[  698.458800][T12749]  ? __nbcon_atomic_flush_pending+0x3d0/0x3d0
[  698.458989][T12749]  ? __lock_release.isra.0+0x59/0x170
[  698.459140][T12749]  ? __nbcon_atomic_flush_pending+0x3d0/0x3d0
[  698.459320][T12749]  ? __kthread_parkme+0xb3/0x200
[  698.459476][T12749]  ? __nbcon_atomic_flush_pending+0x3d0/0x3d0
[  698.459664][T12749]  kthread+0x30f/0x3f0
[  698.459777][T12749]  ? trace_irq_enable.constprop.0+0x13c/0x190
[  698.459964][T12749]  ? kthread_affine_node+0x150/0x150
[  698.460118][T12749]  ret_from_fork+0x472/0x6b0
[  698.460266][T12749]  ? arch_exit_to_user_mode_prepare.isra.0+0x140/0x140
[  698.460452][T12749]  ? __switch_to+0x538/0xcf0
[  698.460603][T12749]  ? kthread_affine_node+0x150/0x150
[  698.460748][T12749]  ret_from_fork_asm+0x11/0x20
[  698.460902][T12749]  </TASK>
[  698.461017][T12749] irq event stamp: 73
[  698.461129][T12749] hardirqs last  enabled at (71): [<ffffffffba847c2f>] finish_task_switch.isra.0+0x15f/0x6a0
[  698.461424][T12749] hardirqs last disabled at (72): [<ffffffffbcb45260>] _raw_spin_lock_irqsave+0x50/0x60
[  698.461685][T12749] softirqs last  enabled at (0): [<ffffffffba76c723>] copy_process+0x1673/0x5700
[  698.461947][T12749] softirqs last disabled at (73): [<ffffffffbc0657e4>] mock_phc_gettime64+0x24/0x80
[  698.462214][T12749] ---[ end trace 0000000000000000 ]---
-- 
pw-bot: cr

  reply	other threads:[~2026-02-23 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-22  9:41 [PATCH v2 net-next 0/3] Implement PTP support in netdevsim Maciek Machnikowski
2026-02-22  9:41 ` [PATCH v2 net-next 1/3] ptp_mock: Expose ptp_clock_info to external drivers Maciek Machnikowski
2026-02-23 16:36   ` Jakub Kicinski [this message]
2026-02-22  9:41 ` [PATCH v2 net-next 2/3] netdevsim: Implement basic ptp support Maciek Machnikowski
2026-02-22  9:41 ` [PATCH v2 net-next 3/3] selftests:net: Implement ptp4l sync test using netdevsim Maciek Machnikowski
2026-02-24 10:54   ` Simon Horman
2026-02-25 10:08     ` Maciek Machnikowski

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=20260223083643.0b322f7e@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=maciek@machnikowski.net \
    --cc=milena.olech@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=willemdebruijn.kernel@gmail.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