1 From 785c44fa278b7dd7a4b96c64321dc43fa2220f7d Mon Sep 17 00:00:00 2001
2 From: James Hughes <james.hughes@raspberrypi.org>
3 Date: Fri, 27 Apr 2018 10:13:35 +0100
4 Subject: [PATCH 285/454] Reduce log spam when mailbox call not implemented
6 This changes the logging message when a mailbox call
7 fails to the dev_dbg level. In addition, it fixes the
8 low voltage detection logging code so that if the
9 mailbox call doies fails, it logs at error level
10 and flags so the call is no longer attempted.
12 Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
14 drivers/firmware/raspberrypi.c | 23 ++++++++++++++++++-----
15 1 file changed, 18 insertions(+), 5 deletions(-)
17 --- a/drivers/firmware/raspberrypi.c
18 +++ b/drivers/firmware/raspberrypi.c
19 @@ -151,7 +151,7 @@ int rpi_firmware_property_list(struct rp
20 * error, if there were multiple tags in the request.
21 * But single-tag is the most common, so go with it.
23 - dev_err(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n",
24 + dev_dbg(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n",
28 @@ -204,6 +204,7 @@ EXPORT_SYMBOL_GPL(rpi_firmware_property)
30 static int rpi_firmware_get_throttled(struct rpi_firmware *fw, u32 *value)
32 + static int old_firmware;
33 static ktime_t old_timestamp;
35 u32 new_sticky, old_sticky, new_uv, old_uv;
36 @@ -214,6 +215,9 @@ static int rpi_firmware_get_throttled(st
44 * We can't run faster than the sticky shift (100ms) since we get
45 * flipping in the sticky bits that are cleared.
46 @@ -232,8 +236,17 @@ static int rpi_firmware_get_throttled(st
48 ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_THROTTLED,
49 value, sizeof(*value));
53 + /* If the mailbox call fails once, then it will continue to
54 + * fail in the future, so no point in continuing to call it
55 + * Usual failure reason is older firmware
58 + dev_err(fw->cl.dev, "Get Throttled mailbox call failed");
63 new_sticky = *value >> 16;
64 old_sticky = old_value >> 16;
65 @@ -270,10 +283,10 @@ static void get_throttled_poll(struct wo
68 ret = rpi_firmware_get_throttled(fw, &dummy);
70 - pr_debug("%s: Failed to read value (%d)", __func__, ret);
72 - schedule_delayed_work(&fw->get_throttled_poll_work, 2 * HZ);
73 + /* Only reschedule if we are getting valid responses */
75 + schedule_delayed_work(&fw->get_throttled_poll_work, 2 * HZ);
78 static ssize_t get_throttled_show(struct device *dev,