Thread (37 messages) 37 messages, 4 authors, 2020-11-17

Re: [PATCH net-next v2 09/11] net: dsa: microchip: ksz9477: add hardware time stamping support

From: Richard Cochran <richardcochran@gmail.com>
Date: 2020-11-13 03:31:45
Also in: linux-devicetree, lkml

On Fri, Nov 13, 2020 at 04:40:20AM +0200, Vladimir Oltean wrote:
quoted
@@ -103,6 +108,10 @@ static int ksz9477_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
 	if (ret)
 		goto error_return;

+	spin_lock_irqsave(&dev->ptp_clock_lock, flags);
I believe that spin_lock_irqsave is unnecessary, since there is no code
that runs in hardirq context.
The .adjtime method is in a system call context.  If all of the code
that manipulates dev->ptp_clock_time can sleep, then you can use a
mutex.  Otherwise spin_lock_irqsave is the safe choice.

Thanks,
Richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help