OSDN Git Service

media: cx23885: Handle additional bufs on interrupt
authorBrad Love <brad@nextdimension.cc>
Tue, 8 May 2018 21:20:16 +0000 (17:20 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 11 May 2018 15:27:36 +0000 (11:27 -0400)
commit9a7dc2b064ef7477d4c3a477f4de0a44b3a40cbd
tree0d3c196657aa29e0e99a48682675b12dc9f65de9
parentacd14c181fc201a397aaff02af3b8c3f1dcf233f
media: cx23885: Handle additional bufs on interrupt

On Ryzen systems interrupts are occasionally missed:

cx23885: cx23885_wakeup: [ffff99b384b83c00/28] wakeup reg=5406 buf=5405
cx23885: cx23885_wakeup: [ffff99b40bf79400/31] wakeup reg=9537 buf=9536

This patch loops up to five times on wakeup, marking any buffers
found done.

Since the count register is u16, but the vb2 counter is u32, some modulo
arithmetic is used to accommodate wraparound and ensure current active
buffer is the buffer expected.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/pci/cx23885/cx23885-core.c