cpufreq: brcmstb-avs-cpufreq: Couple fixes
Subsystems (3)
cover cpufreq: brcmstb-avs-cpufreq: Couple fixes
Hi Rafael, Viresh,
These patch series contains two minor fixes for the brcmstb-avs-cpufreq driver.
Florian Fainelli (2):
cpufreq: brcmstb-avs-cpufreq: Fix initial command check
cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequency
drivers/cpufreq/brcmstb-avs-cpufreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 cpufreq: brcmstb-avs-cpufreq: Fix initial command check
There is a logical error in brcm_avs_is_firmware_loaded() whereby if the firmware returns -EINVAL, we will be reporting this as an error. The comment is correct, the code was not.
--- drivers/cpufreq/brcmstb-avs-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +2 -2
@@ -446,8 +446,8 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv) rc =brcm_avs_get_pmap (priv,NULL ); magic =readl (priv->base +AVS_MBOX_MAGIC ); -return (magic ==AVS_FIRMWARE_MAGIC ) && (rc != -ENOTSUPP ) && - (rc != -EINVAL ); +return (magic ==AVS_FIRMWARE_MAGIC ) && ((rc != -ENOTSUPP ) || + (rc != -EINVAL )); }static unsigned int brcm_avs_cpufreq_get (unsigned int cpu)
Signature · 1 line
2.17.1
PATCH 2/2 cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequency
In reply to Florian FainelliWhat we read back from the register is going to be capped at 32-bits, and cpufreq_freq_table.frequency is an unsigned int. Avoid any possible value truncation by using the appropriate return value.
--- drivers/cpufreq/brcmstb-avs-cpufreq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +4 -4
@@ -384,12 +384,12 @@ static int brcm_avs_set_pstate(struct private_data *priv, unsigned int pstate)return __issue_avs_command (priv,AVS_CMD_SET_PSTATE , true, args); } -static unsigned long brcm_avs_get_voltage (void __iomem *base) +static u32 brcm_avs_get_voltage (void __iomem *base) {return readl (base +AVS_MBOX_VOLTAGE1 ); } -static unsigned long brcm_avs_get_frequency (void __iomem *base) +static u32 brcm_avs_get_frequency (void __iomem *base) {return readl (base +AVS_MBOX_FREQUENCY ) *1000 ;/* in kHz */ }
@@ -653,14 +653,14 @@ static ssize_t show_brcm_avs_voltage(struct cpufreq_policy *policy, char *buf) {struct private_data *priv = policy->driver_data; -return sprintf (buf,"0x%08lx\n" ,brcm_avs_get_voltage (priv->base)); +return sprintf (buf,"0x%08x\n" ,brcm_avs_get_voltage (priv->base)); }static ssize_t show_brcm_avs_frequency (struct cpufreq_policy *policy,char *buf) {struct private_data *priv = policy->driver_data; -return sprintf (buf,"0x%08lx\n" ,brcm_avs_get_frequency (priv->base)); +return sprintf (buf,"0x%08x\n" ,brcm_avs_get_frequency (priv->base)); }cpufreq_freq_attr_ro (brcm_avs_pstate);
Signature · 1 line
2.17.1
Quoted 11 lines · CEST Florian Fainelli
Hi Rafael, Viresh,
These patch series contains two minor fixes for the brcmstb-avs-cpufreq driver.
Florian Fainelli (2):
cpufreq: brcmstb-avs-cpufreq: Fix initial command check
cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequencydrivers/cpufreq/brcmstb-avs-cpufreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
These look straightforward enough to me, but it would be good to get an ACK from the driver maintainer for them.
Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines · CEST Florian Fainelli
Hi Rafael, Viresh,
These patch series contains two minor fixes for the brcmstb-avs-cpufreq driver.
Florian Fainelli (2):
cpufreq: brcmstb-avs-cpufreq: Fix initial command check
cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequency
Quoted 5 lines
Quoted 2 lines
drivers/cpufreq/brcmstb-avs-cpufreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)These look straightforward enough to me, but it would be good to get an ACK from the driver maintainer for them.
Adding Markus' other email address.
Quoted 3 lines
Signature · 1 line
Florian
Quoted 11 lines · Florian Fainelli
Quoted 9 lines · Rafael J. Wysocki
Quoted 8 lines · CEST Florian Fainelli
Hi Rafael, Viresh,
These patch series contains two minor fixes for the brcmstb-avs-cpufreq driver.
Florian Fainelli (2):
cpufreq: brcmstb-avs-cpufreq: Fix initial command check
cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequency
To both of these
My apologies for the delay.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
drivers/cpufreq/brcmstb-avs-cpufreq.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)These look straightforward enough to me, but it would be good to get an ACK from the driver maintainer for them.
Adding Markus' other email address.
--
Florian
Quoted 9 lines · Markus Mayer
Quoted 8 lines · Florian Fainelli
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · CEST Florian Fainelli
Hi Rafael, Viresh,
These patch series contains two minor fixes for the brcmstb-avs-cpufreq driver.
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Florian Fainelli (2):
cpufreq: brcmstb-avs-cpufreq: Fix initial command check
cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequencyTo both of these
Acked-by Markus Mayer <[email protected]>
Applied. Thanks.
Signature · 1 line
viresh