]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: ethernet: ti: cpts: fix fifo read in cpts_find_ts
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 28 Jul 2017 22:30:05 +0000 (17:30 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Aug 2017 22:22:55 +0000 (15:22 -0700)
Now the call chain
 cpts_find_ts()
  |- cpts_fifo_read(cpts, CPTS_EV_PUSH)

will stop reading CPTS FIFO if PUSH event is found. But this is not
expected and CPTS FIFI should be completely drained here. This is most
probably copy-paste error and it has no negative impact as CPTS_EV_PUSH
should not be present in FIFO without TS_PUSH request and
cpts_systim_read() and cpts_find_ts() synchronized by spin_lock.

Correct above by calling cpts_fifo_read() with -1 parameter, so it will
read all CPTS event from FIFO.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpts.c

index 95a0076773b3ec53214900041c0d45a60bad9281..c2121d214f089eb1fe59af4ceb4b2b358abb8f0c 100644 (file)
@@ -364,7 +364,7 @@ static u64 cpts_find_ts(struct cpts *cpts, struct sk_buff *skb, int ev_type)
                return 0;
 
        spin_lock_irqsave(&cpts->lock, flags);
-       cpts_fifo_read(cpts, CPTS_EV_PUSH);
+       cpts_fifo_read(cpts, -1);
        list_for_each_safe(this, next, &cpts->events) {
                event = list_entry(this, struct cpts_event, list);
                if (event_expired(event)) {