armbian-build/patch/kernel/meson64-default/linux-4.14.y-le-amlogic-gx-scpi-1003-cpufreq-scpi-avoid_failed_to_change_cpu_frequency.patch

35 lines
1.1 KiB
Diff

--- a/drivers/firmware/arm_scpi.c 2018-04-22 02:13:36.694055358 -0400
+++ b/drivers/firmware/arm_scpi.c 2018-04-22 19:27:58.671389066 -0400
@@ -88,7 +88,8 @@
#define FW_REV_MINOR(x) (((x) & FW_REV_MINOR_MASK) >> FW_REV_MINOR_BITS)
#define FW_REV_PATCH(x) ((x) & FW_REV_PATCH_MASK)
-#define MAX_RX_TIMEOUT (msecs_to_jiffies(30))
+#define MAX_TX_TIMEOUT 60
+#define MAX_RX_TIMEOUT (msecs_to_jiffies(90))
enum scpi_error_codes {
SCPI_SUCCESS = 0, /* Success */
@@ -523,6 +524,12 @@
chan = atomic_inc_return(&scpi_info->next_chan) %
scpi_info->num_chans;
scpi_chan = scpi_info->channels + chan;
+ scpi_chan->cl.tx_tout = MAX_TX_TIMEOUT;
+
+ if ((idx == CMD_GET_DVFS) || (idx == CMD_SET_DVFS))
+ scpi_chan->cl.tx_tout = 400;
+ else if (idx == CMD_SENSOR_VALUE)
+ scpi_chan->cl.tx_tout = 100;
msg = get_scpi_xfer(scpi_chan);
if (!msg)
@@ -999,7 +1006,7 @@
cl->rx_callback = scpi_handle_remote_msg;
cl->tx_prepare = scpi_tx_prepare;
cl->tx_block = true;
- cl->tx_tout = 20;
+ cl->tx_tout = MAX_TX_TIMEOUT;
cl->knows_txdone = false; /* controller can't ack */
INIT_LIST_HEAD(&pchan->rx_pending);