All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] media: si2168: request caching of firmware to make it available on resume
@ 2020-08-13 21:45 Lukas Middendorf
  2020-08-13 21:45 ` [PATCH 2/2] media: si2168: also cache Si2168 B40 fallback firmware Lukas Middendorf
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Lukas Middendorf @ 2020-08-13 21:45 UTC (permalink / raw)
  To: linux-media
  Cc: Antti Palosaari, Mauro Carvalho Chehab, Luis Chamberlain,
	Lukas Middendorf

even though request_firmware() is supposed to be safe to call during
resume, it might fail (or even hang the system) when the firmware
has not been loaded previously. Use firmware_request_cache() to
have it cached so it is available reliably on resume.

Signed-off-by: Lukas Middendorf <kernel@tuxforce.de>
---
 drivers/media/dvb-frontends/si2168.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 14b93a7d3358..ea4b2d91697e 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -757,6 +757,17 @@ static int si2168_probe(struct i2c_client *client,
 		 dev->version >> 24 & 0xff, dev->version >> 16 & 0xff,
 		 dev->version >> 8 & 0xff, dev->version >> 0 & 0xff);
 
+	/* request caching of the firmware so it is available on resume after suspend.
+	 * The actual caching of the firmware file only occurs during suspend
+	 * The return value does not show whether the firmware file exists
+	 */
+	ret = firmware_request_cache(&client->dev, dev->firmware_name);
+	if (ret) {
+		dev_err(&client->dev,
+				"firmware caching for '%s' failed\n",
+				dev->firmware_name);
+	}
+
 	return 0;
 err_kfree:
 	kfree(dev);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-04-09 22:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 21:45 [PATCH 1/2] media: si2168: request caching of firmware to make it available on resume Lukas Middendorf
2020-08-13 21:45 ` [PATCH 2/2] media: si2168: also cache Si2168 B40 fallback firmware Lukas Middendorf
2020-08-13 21:55   ` Luis Chamberlain
2021-04-01 14:46   ` Lukas Middendorf
2020-08-13 21:54 ` [PATCH 1/2] media: si2168: request caching of firmware to make it available on resume Luis Chamberlain
2021-04-01 14:42 ` Lukas Middendorf
2021-04-02 18:04   ` Luis Chamberlain
2021-04-09 11:29   ` Mauro Carvalho Chehab
2021-04-09 16:58     ` Luis Chamberlain
2021-04-09 22:02     ` Lukas Middendorf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.