remoteproc updates for v5.15
This moves the crash recovery worker to the freezable work queue to avoid interaction with other drivers during suspend & resume. It fixes a couple of typos in comments. It adds support for handling the audio DSP on SDM660 and it fixes a race between the Qualcomm wireless subsystem driver and the associated driver for the RF chip. -----BEGIN PGP SIGNATURE----- iQJPBAABCAA5FiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmE3cD4bHGJqb3JuLmFu ZGVyc3NvbkBsaW5hcm8ub3JnAAoJEAsfOT8Nma3FjdkQAKTm0N2mjd9mpKMmOhPx z9lsD/OcJnM7Rpo16jBzfMkJF90LFqSIjc0grUTaBXMMLtdSlA08QnkTqK1CLdQ8 haseuZ7zs6H9MycdoL9krCMAmSAcNttcbYW4/TBpilK4n6NNXZs1tgBkk3YUVRRx fym1n2mpWr9kMAy6rpY/HUoLR5s3zNPGJ4K02uEqVVpueYAr1ZK72oC9EO/e5m1e I6M4fhfT6Htypk8oCJUFcvvRqu1O03fpsJ7cwvbaE/L2+96ttje+Ux4P69x/9B08 oNfMA7sVVd68tblRcYO7hT9GN/W7FIhgLVWK8r3IPr5iDUTutUSNl2WBH1xXh7kT baifEKtbIBYEuw+1zHE2topBs2P5nhfv9uOWfvOtV38ahtPuncUUGjzmTlf02LgP hnxrJpaIsHktw/OgY9lq2apyGCvwTN/xpB9Ng0j5MaByhkatO+vpTIwAVi6OSoRN G95/IXHXdY1C6a6rtVvhIXNkHIwFApPDD2ZeveYJs2/WfL05h9pj979Q60h3S6od Ff8uQjZe10d7ogFH6R5NQdhCPdBV6BEtUFiQMrhpm1qrNk/TAX9dBnkMl9xSwfgy dRYiHwEgn2fGe3K3yExI77MRdzChvxrPDZYXTCar3nqaLrXPx8qM1rc/RbkF/PXE 3FKpUS9XTQUsLdMSkGh8bZ3L =EX0n -----END PGP SIGNATURE----- Merge tag 'rproc-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc Pull remoteproc updates from Bjorn Andersson: - move the crash recovery worker to the freezable work queue to avoid interaction with other drivers during suspend & resume - fix a couple of typos in comments - add support for handling the audio DSP on SDM660 - fix a race between the Qualcomm wireless subsystem driver and the associated driver for the RF chip * tag 'rproc-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: remoteproc: q6v5_pas: Add sdm660 ADSP PIL compatible dt-bindings: remoteproc: qcom: adsp: Add SDM660 ADSP remoteproc: use freezable workqueue for crash notifications remoteproc: fix kernel doc for struct rproc_ops remoteproc: fix an typo in fw_elf_get_class code comments remoteproc: qcom: wcnss: Fix race with iris probe
This commit is contained in:
commit
21f577b0f4
@ -28,6 +28,7 @@ properties:
|
||||
- qcom,sc8180x-adsp-pas
|
||||
- qcom,sc8180x-cdsp-pas
|
||||
- qcom,sc8180x-mpss-pas
|
||||
- qcom,sdm660-adsp-pas
|
||||
- qcom,sdm845-adsp-pas
|
||||
- qcom,sdm845-cdsp-pas
|
||||
- qcom,sdx55-mpss-pas
|
||||
|
@ -833,6 +833,7 @@ static const struct of_device_id adsp_of_match[] = {
|
||||
{ .compatible = "qcom,sc8180x-adsp-pas", .data = &sm8150_adsp_resource},
|
||||
{ .compatible = "qcom,sc8180x-cdsp-pas", .data = &sm8150_cdsp_resource},
|
||||
{ .compatible = "qcom,sc8180x-mpss-pas", .data = &sc8180x_mpss_resource},
|
||||
{ .compatible = "qcom,sdm660-adsp-pas", .data = &adsp_resource_init},
|
||||
{ .compatible = "qcom,sdm845-adsp-pas", .data = &adsp_resource_init},
|
||||
{ .compatible = "qcom,sdm845-cdsp-pas", .data = &cdsp_resource_init},
|
||||
{ .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource},
|
||||
|
@ -142,18 +142,6 @@ static const struct wcnss_data pronto_v2_data = {
|
||||
.num_vregs = 1,
|
||||
};
|
||||
|
||||
void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss,
|
||||
struct qcom_iris *iris,
|
||||
bool use_48mhz_xo)
|
||||
{
|
||||
mutex_lock(&wcnss->iris_lock);
|
||||
|
||||
wcnss->iris = iris;
|
||||
wcnss->use_48mhz_xo = use_48mhz_xo;
|
||||
|
||||
mutex_unlock(&wcnss->iris_lock);
|
||||
}
|
||||
|
||||
static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
|
||||
{
|
||||
struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv;
|
||||
@ -639,12 +627,20 @@ static int wcnss_probe(struct platform_device *pdev)
|
||||
goto detach_pds;
|
||||
}
|
||||
|
||||
wcnss->iris = qcom_iris_probe(&pdev->dev, &wcnss->use_48mhz_xo);
|
||||
if (IS_ERR(wcnss->iris)) {
|
||||
ret = PTR_ERR(wcnss->iris);
|
||||
goto detach_pds;
|
||||
}
|
||||
|
||||
ret = rproc_add(rproc);
|
||||
if (ret)
|
||||
goto detach_pds;
|
||||
goto remove_iris;
|
||||
|
||||
return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
|
||||
return 0;
|
||||
|
||||
remove_iris:
|
||||
qcom_iris_remove(wcnss->iris);
|
||||
detach_pds:
|
||||
wcnss_release_pds(wcnss);
|
||||
free_rproc:
|
||||
@ -657,7 +653,7 @@ static int wcnss_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_wcnss *wcnss = platform_get_drvdata(pdev);
|
||||
|
||||
of_platform_depopulate(&pdev->dev);
|
||||
qcom_iris_remove(wcnss->iris);
|
||||
|
||||
rproc_del(wcnss->rproc);
|
||||
|
||||
@ -686,28 +682,7 @@ static struct platform_driver wcnss_driver = {
|
||||
},
|
||||
};
|
||||
|
||||
static int __init wcnss_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = platform_driver_register(&wcnss_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = platform_driver_register(&qcom_iris_driver);
|
||||
if (ret)
|
||||
platform_driver_unregister(&wcnss_driver);
|
||||
|
||||
return ret;
|
||||
}
|
||||
module_init(wcnss_init);
|
||||
|
||||
static void __exit wcnss_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&qcom_iris_driver);
|
||||
platform_driver_unregister(&wcnss_driver);
|
||||
}
|
||||
module_exit(wcnss_exit);
|
||||
module_platform_driver(wcnss_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Qualcomm Peripheral Image Loader for Wireless Subsystem");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
@ -17,9 +17,9 @@ struct wcnss_vreg_info {
|
||||
bool super_turbo;
|
||||
};
|
||||
|
||||
struct qcom_iris *qcom_iris_probe(struct device *parent, bool *use_48mhz_xo);
|
||||
void qcom_iris_remove(struct qcom_iris *iris);
|
||||
int qcom_iris_enable(struct qcom_iris *iris);
|
||||
void qcom_iris_disable(struct qcom_iris *iris);
|
||||
|
||||
void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss, struct qcom_iris *iris, bool use_48mhz_xo);
|
||||
|
||||
#endif
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "qcom_wcnss.h"
|
||||
|
||||
struct qcom_iris {
|
||||
struct device *dev;
|
||||
struct device dev;
|
||||
|
||||
struct clk *xo_clk;
|
||||
|
||||
@ -75,7 +75,7 @@ int qcom_iris_enable(struct qcom_iris *iris)
|
||||
|
||||
ret = clk_prepare_enable(iris->xo_clk);
|
||||
if (ret) {
|
||||
dev_err(iris->dev, "failed to enable xo clk\n");
|
||||
dev_err(&iris->dev, "failed to enable xo clk\n");
|
||||
goto disable_regulators;
|
||||
}
|
||||
|
||||
@ -93,43 +93,90 @@ void qcom_iris_disable(struct qcom_iris *iris)
|
||||
regulator_bulk_disable(iris->num_vregs, iris->vregs);
|
||||
}
|
||||
|
||||
static int qcom_iris_probe(struct platform_device *pdev)
|
||||
static const struct of_device_id iris_of_match[] = {
|
||||
{ .compatible = "qcom,wcn3620", .data = &wcn3620_data },
|
||||
{ .compatible = "qcom,wcn3660", .data = &wcn3660_data },
|
||||
{ .compatible = "qcom,wcn3660b", .data = &wcn3680_data },
|
||||
{ .compatible = "qcom,wcn3680", .data = &wcn3680_data },
|
||||
{}
|
||||
};
|
||||
|
||||
static void qcom_iris_release(struct device *dev)
|
||||
{
|
||||
struct qcom_iris *iris = container_of(dev, struct qcom_iris, dev);
|
||||
|
||||
of_node_put(iris->dev.of_node);
|
||||
kfree(iris);
|
||||
}
|
||||
|
||||
struct qcom_iris *qcom_iris_probe(struct device *parent, bool *use_48mhz_xo)
|
||||
{
|
||||
const struct of_device_id *match;
|
||||
const struct iris_data *data;
|
||||
struct qcom_wcnss *wcnss;
|
||||
struct device_node *of_node;
|
||||
struct qcom_iris *iris;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
iris = devm_kzalloc(&pdev->dev, sizeof(struct qcom_iris), GFP_KERNEL);
|
||||
if (!iris)
|
||||
return -ENOMEM;
|
||||
of_node = of_get_child_by_name(parent->of_node, "iris");
|
||||
if (!of_node) {
|
||||
dev_err(parent, "No child node \"iris\" found\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
data = of_device_get_match_data(&pdev->dev);
|
||||
wcnss = dev_get_drvdata(pdev->dev.parent);
|
||||
iris = kzalloc(sizeof(*iris), GFP_KERNEL);
|
||||
if (!iris) {
|
||||
of_node_put(of_node);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
iris->xo_clk = devm_clk_get(&pdev->dev, "xo");
|
||||
device_initialize(&iris->dev);
|
||||
iris->dev.parent = parent;
|
||||
iris->dev.release = qcom_iris_release;
|
||||
iris->dev.of_node = of_node;
|
||||
|
||||
dev_set_name(&iris->dev, "%s.iris", dev_name(parent));
|
||||
|
||||
ret = device_add(&iris->dev);
|
||||
if (ret) {
|
||||
put_device(&iris->dev);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
match = of_match_device(iris_of_match, &iris->dev);
|
||||
if (!match) {
|
||||
dev_err(&iris->dev, "no matching compatible for iris\n");
|
||||
ret = -EINVAL;
|
||||
goto err_device_del;
|
||||
}
|
||||
|
||||
data = match->data;
|
||||
|
||||
iris->xo_clk = devm_clk_get(&iris->dev, "xo");
|
||||
if (IS_ERR(iris->xo_clk)) {
|
||||
if (PTR_ERR(iris->xo_clk) != -EPROBE_DEFER)
|
||||
dev_err(&pdev->dev, "failed to acquire xo clk\n");
|
||||
return PTR_ERR(iris->xo_clk);
|
||||
ret = PTR_ERR(iris->xo_clk);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(&iris->dev, "failed to acquire xo clk\n");
|
||||
goto err_device_del;
|
||||
}
|
||||
|
||||
iris->num_vregs = data->num_vregs;
|
||||
iris->vregs = devm_kcalloc(&pdev->dev,
|
||||
iris->vregs = devm_kcalloc(&iris->dev,
|
||||
iris->num_vregs,
|
||||
sizeof(struct regulator_bulk_data),
|
||||
GFP_KERNEL);
|
||||
if (!iris->vregs)
|
||||
return -ENOMEM;
|
||||
if (!iris->vregs) {
|
||||
ret = -ENOMEM;
|
||||
goto err_device_del;
|
||||
}
|
||||
|
||||
for (i = 0; i < iris->num_vregs; i++)
|
||||
iris->vregs[i].supply = data->vregs[i].name;
|
||||
|
||||
ret = devm_regulator_bulk_get(&pdev->dev, iris->num_vregs, iris->vregs);
|
||||
ret = devm_regulator_bulk_get(&iris->dev, iris->num_vregs, iris->vregs);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to get regulators\n");
|
||||
return ret;
|
||||
dev_err(&iris->dev, "failed to get regulators\n");
|
||||
goto err_device_del;
|
||||
}
|
||||
|
||||
for (i = 0; i < iris->num_vregs; i++) {
|
||||
@ -143,34 +190,17 @@ static int qcom_iris_probe(struct platform_device *pdev)
|
||||
data->vregs[i].load_uA);
|
||||
}
|
||||
|
||||
qcom_wcnss_assign_iris(wcnss, iris, data->use_48mhz_xo);
|
||||
*use_48mhz_xo = data->use_48mhz_xo;
|
||||
|
||||
return 0;
|
||||
return iris;
|
||||
|
||||
err_device_del:
|
||||
device_del(&iris->dev);
|
||||
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
static int qcom_iris_remove(struct platform_device *pdev)
|
||||
void qcom_iris_remove(struct qcom_iris *iris)
|
||||
{
|
||||
struct qcom_wcnss *wcnss = dev_get_drvdata(pdev->dev.parent);
|
||||
|
||||
qcom_wcnss_assign_iris(wcnss, NULL, false);
|
||||
|
||||
return 0;
|
||||
device_del(&iris->dev);
|
||||
}
|
||||
|
||||
static const struct of_device_id iris_of_match[] = {
|
||||
{ .compatible = "qcom,wcn3620", .data = &wcn3620_data },
|
||||
{ .compatible = "qcom,wcn3660", .data = &wcn3660_data },
|
||||
{ .compatible = "qcom,wcn3660b", .data = &wcn3680_data },
|
||||
{ .compatible = "qcom,wcn3680", .data = &wcn3680_data },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, iris_of_match);
|
||||
|
||||
struct platform_driver qcom_iris_driver = {
|
||||
.probe = qcom_iris_probe,
|
||||
.remove = qcom_iris_remove,
|
||||
.driver = {
|
||||
.name = "qcom-iris",
|
||||
.of_match_table = iris_of_match,
|
||||
},
|
||||
};
|
||||
|
@ -2750,8 +2750,8 @@ void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type)
|
||||
dev_err(&rproc->dev, "crash detected in %s: type %s\n",
|
||||
rproc->name, rproc_crash_to_string(type));
|
||||
|
||||
/* create a new task to handle the error */
|
||||
schedule_work(&rproc->crash_handler);
|
||||
/* Have a worker handle the error; ensure system is not suspended */
|
||||
queue_work(system_freezable_wq, &rproc->crash_handler);
|
||||
}
|
||||
EXPORT_SYMBOL(rproc_report_crash);
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* fw_elf_get_class - Get elf class
|
||||
* @fw: the ELF firmware image
|
||||
*
|
||||
* Note that we use and elf32_hdr to access the class since the start of the
|
||||
* Note that we use elf32_hdr to access the class since the start of the
|
||||
* struct is the same for both elf class
|
||||
*
|
||||
* Return: elf class of the firmware
|
||||
|
@ -369,9 +369,8 @@ enum rsc_handling_status {
|
||||
* @da_to_va: optional platform hook to perform address translations
|
||||
* @parse_fw: parse firmware to extract information (e.g. resource table)
|
||||
* @handle_rsc: optional platform hook to handle vendor resources. Should return
|
||||
* RSC_HANDLED if resource was handled, RSC_IGNORED if not handled and a
|
||||
* negative value on error
|
||||
* @load_rsc_table: load resource table from firmware image
|
||||
* RSC_HANDLED if resource was handled, RSC_IGNORED if not handled
|
||||
* and a negative value on error
|
||||
* @find_loaded_rsc_table: find the loaded resource table from firmware image
|
||||
* @get_loaded_rsc_table: get resource table installed in memory
|
||||
* by external entity
|
||||
|
Loading…
Reference in New Issue
Block a user