mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
Merge branches 'for-next/ffa/fixes' and 'for-next/scmi/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux
* 'for-next/ffa/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Tear down driver during shutdown * 'for-next/scmi/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Fix typo "upto" in comment clk: scpi: use PLATFORM_DEVID_NONE for scpi-cpufreq clk: scpi: register scpi-cpufreq once and clear on failure clk: scpi: bound-check DVFS index in scpi_dvfs_recalc_rate firmware: arm_scpi: reject DVFS OPP count above MAX_DVFS_OPPS firmware: arm_scpi: fix device_node leak in scpi_dev_domain_id
This commit is contained in:
commit
8544e0da1a
|
|
@ -73,7 +73,7 @@ static unsigned long scpi_dvfs_recalc_rate(struct clk_hw *hw,
|
|||
int idx = clk->scpi_ops->dvfs_get_idx(clk->id);
|
||||
const struct scpi_opp *opp;
|
||||
|
||||
if (idx < 0)
|
||||
if (idx < 0 || idx >= clk->info->count)
|
||||
return 0;
|
||||
|
||||
opp = clk->info->opps + idx;
|
||||
|
|
@ -272,10 +272,15 @@ static int scpi_clocks_probe(struct platform_device *pdev)
|
|||
if (match->data != &scpi_dvfs_ops)
|
||||
continue;
|
||||
/* Add the virtual cpufreq device if it's DVFS clock provider */
|
||||
if (cpufreq_dev)
|
||||
continue;
|
||||
cpufreq_dev = platform_device_register_simple("scpi-cpufreq",
|
||||
-1, NULL, 0);
|
||||
if (IS_ERR(cpufreq_dev))
|
||||
PLATFORM_DEVID_NONE,
|
||||
NULL, 0);
|
||||
if (IS_ERR(cpufreq_dev)) {
|
||||
pr_warn("unable to register cpufreq device");
|
||||
cpufreq_dev = NULL;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2225,6 +2225,7 @@ static void ffa_remove(struct platform_device *pdev)
|
|||
static struct platform_driver ffa_driver = {
|
||||
.probe = ffa_probe,
|
||||
.remove = ffa_remove,
|
||||
.shutdown = ffa_remove,
|
||||
.driver = {
|
||||
.name = FFA_PLATFORM_NAME,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ void *scmi_notification_instance_data_get(const struct scmi_handle *handle)
|
|||
* - exactly 'next_token' may be NOT available so pick xfer_id >= next_token
|
||||
* using find_next_zero_bit() starting from candidate next_token bit
|
||||
*
|
||||
* - all tokens ahead upto (MSG_TOKEN_ID_MASK - 1) are used in-flight but we
|
||||
* - all tokens ahead up to (MSG_TOKEN_ID_MASK - 1) are used in-flight but we
|
||||
* are plenty of free tokens at start, so try a second pass using
|
||||
* find_next_zero_bit() and starting from 0.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -631,8 +631,8 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
|
|||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
if (!buf.opp_count)
|
||||
return ERR_PTR(-ENOENT);
|
||||
if (!buf.opp_count || buf.opp_count > MAX_DVFS_OPPS)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
info = kmalloc_obj(*info);
|
||||
if (!info)
|
||||
|
|
@ -661,12 +661,15 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
|
|||
static int scpi_dev_domain_id(struct device *dev)
|
||||
{
|
||||
struct of_phandle_args clkspec;
|
||||
int domain;
|
||||
|
||||
if (of_parse_phandle_with_args(dev->of_node, "clocks", "#clock-cells",
|
||||
0, &clkspec))
|
||||
return -EINVAL;
|
||||
|
||||
return clkspec.args[0];
|
||||
domain = clkspec.args[0];
|
||||
of_node_put(clkspec.np);
|
||||
return domain;
|
||||
}
|
||||
|
||||
static struct scpi_dvfs_info *scpi_dvfs_info(struct device *dev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user