Skip to content

Provide a serialisation mechanism for subdev ops

Sakari Ailus linux-media 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6v4l: subdev: Set sd->devnode before registering the subdevdrivers/media/v4l2-core/v4l2-device.c+2 -11 reply
2/6v4l: subdev: Provide a locking scheme for subdev operationsinclude/media/v4l2-subdev.h+17 -82 replies
3/6smiapp: Error handling cleanups and fixesdrivers/media/i2c/smiapp/smiapp-core.c+26 -220 replies
4/6smiapp: Rely on V4L2 sub-device framework to do the lockingdrivers/media/i2c/smiapp/smiapp-core.c+36 -1040 replies
5/6smiapp: Remove the active field from sensor's structdrivers/media/i2c/smiapp/smiapp-core.c drivers/media/i2c/smiapp/smiapp-regs.c drivers/media/i2c/smiapp/smiapp.h+0 -80 replies
6/6smiapp: Avoid fall-through in switchdrivers/media/i2c/smiapp/smiapp-core.c+5 -64 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchHans Verkuil
1/6R-b
2/6
3/6
4/6
5/6
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] Provide a serialisation mechanism for subdev ops

Hi folks,

While access to the V4L2 device nodes was conveniently serialised for devices the drivers of which used the V4L2 framework, this was no the case for sub-devices that also may be called from other drivers.

Instead acquire the lock to the v4l2_subdev_call macro.

This set adds the capability to the framework and makes smiapp use it.

This is a big change. I'm still not posting this as RFC as the feature is entirely optional. Albeit I'd expect new drivers to use it in the future:
quite a bit of code was removed from the smiapp driver as a result (there were other cleanups, too).

Generally drivers that handle multiple sub-devices need to take special care when making nested calls (hopefully as few as possible, but starting streaming comes to mind). We may need an unlocked variant of the macro as well.

Sakari Ailus (6):
v4l: subdev: Set sd->devnode before registering the subdev
v4l: subdev: Provide a locking scheme for subdev operations
smiapp: Error handling cleanups and fixes
smiapp: Rely on V4L2 sub-device framework to do the locking
smiapp: Remove the active field from sensor's struct
smiapp: Avoid fall-through in switch

 drivers/media/i2c/smiapp/smiapp-core.c | 203 ++++++++-----------------
 drivers/media/i2c/smiapp/smiapp-regs.c |   3 -
 drivers/media/i2c/smiapp/smiapp.h      |   1 -
 drivers/media/v4l2-core/v4l2-device.c  |   3 +-
 include/media/v4l2-subdev.h            |  25 ++-
 5 files changed, 86 insertions(+), 149 deletions(-)
Signature · 1 line
2.20.1