From 9107ee6a50b81180f29a9f6588b21917dde2abdd Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 27 Nov 2017 12:57:14 +0100 Subject: firmware: raspberrypi: print time using time64_t The firmware timestamp is an unsigned 32-bit value, but we copy it into a signed 32-bit variable, so we can theoretically get an overflow in the calculation when the timestamp is between 2038 and 2106. This changes the temporary variable to time64_t and changes the deprecated time_to_tm() over to time64_to_tm() accordingly. There is still an overflow in y2106, but that is a limitation of the firmware interface, not a kernel problem. Signed-off-by: Arnd Bergmann Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt --- drivers/firmware/raspberrypi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c index dd506cd3a5b8..6692888f04cf 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c @@ -174,7 +174,7 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) if (ret == 0) { struct tm tm; - time_to_tm(packet, 0, &tm); + time64_to_tm(packet, 0, &tm); dev_info(fw->cl.dev, "Attached to firmware from %04ld-%02d-%02d %02d:%02d\n", -- cgit From bd0fa74e7ced89580428365515f3d370cd2810d8 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Sat, 16 Dec 2017 14:41:33 -0800 Subject: firmware: ti_sci: Use %zu for size_t print format mbox_msg->len is of type size_t and %d is incorrect format. Instead use %zu for handling size_t correctly. Reviewed-by: Lokesh Vutla Signed-off-by: Nishanth Menon Signed-off-by: Santosh Shilimkar --- drivers/firmware/ti_sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 23b12d99ddfe..5229036dcfbf 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -287,13 +287,13 @@ static void ti_sci_rx_callback(struct mbox_client *cl, void *m) /* Is the message of valid length? */ if (mbox_msg->len > info->desc->max_msg_size) { - dev_err(dev, "Unable to handle %d xfer(max %d)\n", + dev_err(dev, "Unable to handle %zu xfer(max %d)\n", mbox_msg->len, info->desc->max_msg_size); ti_sci_dump_header_dbg(dev, hdr); return; } if (mbox_msg->len < xfer->rx_len) { - dev_err(dev, "Recv xfer %d < expected %d length\n", + dev_err(dev, "Recv xfer %zu < expected %d length\n", mbox_msg->len, xfer->rx_len); ti_sci_dump_header_dbg(dev, hdr); return; -- cgit From 12aeb917a54729c1324e28421a023f2f54aebf30 Mon Sep 17 00:00:00 2001 From: Sudeep Holla Date: Thu, 28 Sep 2017 11:46:00 +0100 Subject: firmware: qcom_scm: drop redandant of_platform_populate Now that of_platform_default_populate_init() takes care of populating all the devices under the /firmware/ node, this patch removes the redandant call to of_platform_populate here. Cc: Andy Gross Cc: David Brown Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Sudeep Holla Signed-off-by: Andy Gross --- drivers/firmware/qcom_scm.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index af4c75217ea6..5a7d693009ef 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -622,30 +622,6 @@ static struct platform_driver qcom_scm_driver = { static int __init qcom_scm_init(void) { - struct device_node *np, *fw_np; - int ret; - - fw_np = of_find_node_by_name(NULL, "firmware"); - - if (!fw_np) - return -ENODEV; - - np = of_find_matching_node(fw_np, qcom_scm_dt_match); - - if (!np) { - of_node_put(fw_np); - return -ENODEV; - } - - of_node_put(np); - - ret = of_platform_populate(fw_np, qcom_scm_dt_match, NULL, NULL); - - of_node_put(fw_np); - - if (ret) - return ret; - return platform_driver_register(&qcom_scm_driver); } subsys_initcall(qcom_scm_init); -- cgit From 95140ed16db560ef86ab4ebe1a4e9b748d098669 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 31 Jul 2017 10:55:00 +0200 Subject: psci: add CPU_IDLE dependency I ran into a build error for the psci_checker: drivers/firmware/psci_checker.o: In function `psci_checker': psci_checker.c:(.init.text+0x528): undefined reference to `cpuidle_devices' As far as I can tell, this is simply a very rare combination of options, but the problem has existed since the code was initially added. Adding a Kconfig dependency makes it build properly. Fixes: ea8b1c4a6019 ("drivers: psci: PSCI checker module") Acked-by: Kevin Brodsky Reviewed-by: Nishanth Menon Reviewed-by: Jean Delvare Signed-off-by: Arnd Bergmann --- drivers/firmware/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index fa87a055905e..7db73c833d28 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -10,7 +10,7 @@ config ARM_PSCI_FW config ARM_PSCI_CHECKER bool "ARM PSCI checker" - depends on ARM_PSCI_FW && HOTPLUG_CPU && !TORTURE_TEST + depends on ARM_PSCI_FW && HOTPLUG_CPU && CPU_IDLE && !TORTURE_TEST help Run the PSCI checker during startup. This checks that hotplug and suspend operations work correctly when using PSCI. -- cgit