Skip to content

Commit

Permalink
staging: mmal-vchiq: Reset buffers_with_vpu on port_enable
Browse files Browse the repository at this point in the history
Should we go through the timeout failure case with port_disable
not returning all buffers for whatever reason, the
buffers_with_vpu counter gets left at a non-zero value, which
will cause reference counting issues should the instance be
reused.

Reset the count when the port is enabled again, but before
any buffers have been sent to the VPU.

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 committed Sep 21, 2021
1 parent dd45e75 commit ffa4802
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,8 @@ static int port_enable(struct vchiq_mmal_instance *instance,

port->enabled = 1;

atomic_set(&port->buffers_with_vpu, 0);

if (port->buffer_cb) {
/* send buffer headers to videocore */
hdr_count = 1;
Expand Down

0 comments on commit ffa4802

Please sign in to comment.