Skip to content

Commit f5f0390

Browse files
committed
Merge pull request torvalds#196 in PROCESSOR-SDK/processor-sdk-linux from plsdk-3125 to processor-sdk-linux-4.19.y
* commit 'bcada72bd7ebad1ff5ef724f55af614fcc1c682a': ptp: cleanup timestamp event queue when extts is disabled
2 parents 106aec4 + bcada72 commit f5f0390

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/ptp/ptp_chardev.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,15 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
162162
req.type = PTP_CLK_REQ_EXTTS;
163163
enable = req.extts.flags & PTP_ENABLE_FEATURE ? 1 : 0;
164164
err = ops->enable(ops, &req, enable);
165+
if (!enable && !err && queue_cnt(&ptp->tsevq)) {
166+
struct timestamp_event_queue *queue = &ptp->tsevq;
167+
unsigned long flags;
168+
169+
spin_lock_irqsave(&queue->lock, flags);
170+
queue->head = 0;
171+
queue->tail = 0;
172+
spin_unlock_irqrestore(&queue->lock, flags);
173+
}
165174
break;
166175

167176
case PTP_PEROUT_REQUEST:

0 commit comments

Comments
 (0)