Skip to content

media: fully initialize si2168 on resume only when necessary

Lukas Middendorf linux-media 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2media dvb_frontend: add suspend and resume callbacks to dvb_frontend_opsdrivers/media/dvb-core/dvb_frontend.c include/media/dvb_frontend.h+17 -40 replies
2/2media si2168: fully initialize si2168 on resume only when necessarydrivers/media/dvb-frontends/si2168.c drivers/media/dvb-frontends/si2168_priv.h+25 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] media: fully initialize si2168 on resume only when necessary

For the si2168, the firmware file is loaded in si2168_init(). This function is called at the beginning of actual device usage and on resume. si2168_probe() does not include firmware loading and full device initialization. In case the device is not used before suspend, the call on resume can be the first time the firmware file is read. This is can lead to a system stall and is unreliable. If the firmware has been loaded before suspend, the kernel firmware loader sets up automatic caching which allows firmware loads to succeed on later resumes.

It is not useful to fully initialize the device on resume if it has not been initialized previously. The device is not in active use and is not expected to be in an initialized state. Therefore initialization should be skipped in this case.

This patch series adds a separate resume callback to si2168 to skip init in case the device has not been initialized previously. To allow this, separate suspend and resume callback pointers have to be added to dvb_frontend_ops. The new callbacks are only used if they are implemented in a driver, otherwise the old sleep and init callback is used instead.

Similar dedicated init callback likely also have to be implemented for some other dvb frontend drivers to prevent first-time firmware loading on resume.

This patch series replaces my earlier patch which calls firmware_request_cache instead to explicitly set up firmware caching.

Lukas Middendorf (2):
media dvb_frontend: add suspend and resume callbacks to
dvb_frontend_ops
media si2168: fully initialize si2168 on resume only when necessary

 drivers/media/dvb-core/dvb_frontend.c     |  8 ++++++--
 drivers/media/dvb-frontends/si2168.c      | 24 +++++++++++++++++++++++
 drivers/media/dvb-frontends/si2168_priv.h |  1 +
 include/media/dvb_frontend.h              | 13 ++++++++++--
 4 files changed, 42 insertions(+), 4 deletions(-)
Signature · 1 line
2.31.1