Message ID | 1593186236-12760-1-git-send-email-sumitg@nvidia.com |
---|---|
Headers | show |
Series | Add cpufreq driver for Tegra194 | expand |
On 26-06-20, 21:13, Sumit Gupta wrote: > +static int tegra194_cpufreq_probe(struct platform_device *pdev) > +{ > + struct tegra194_cpufreq_data *data; > + struct tegra_bpmp *bpmp; > + int err, i; > + > + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); > + if (!data) > + return -ENOMEM; > + > + data->num_clusters = MAX_CLUSTERS; > + data->tables = devm_kcalloc(&pdev->dev, data->num_clusters, > + sizeof(*data->tables), GFP_KERNEL); > + if (!data->tables) > + return -ENOMEM; > + > + platform_set_drvdata(pdev, data); > + > + bpmp = tegra_bpmp_get(&pdev->dev); > + if (IS_ERR(bpmp)) > + return PTR_ERR(bpmp); > + > + read_counters_wq = alloc_workqueue("read_counters_wq", __WQ_LEGACY, 1); > + if (!read_counters_wq) { > + dev_err(&pdev->dev, "fail to create_workqueue\n"); > + err = -EINVAL; > + goto put_bpmp; This will call destroy_workqueue() eventually and it will crash your kernel. Apart from this, this stuff looks okay. Don't resend the patch just yet (and if required, send only this patch using --in-reply-to flag for git send email). Lets wait for an Ack from Rob for the first two patches. > + } > +
On 26-06-20, 21:13, Sumit Gupta wrote: > Enable Tegra194 CPU frequency scaling support by default. > > Signed-off-by: Sumit Gupta <sumitg@nvidia.com> > --- > arch/arm64/configs/defconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig > index f9d378d..385bd35 100644 > --- a/arch/arm64/configs/defconfig > +++ b/arch/arm64/configs/defconfig > @@ -91,6 +91,7 @@ CONFIG_ARM_QCOM_CPUFREQ_NVMEM=y > CONFIG_ARM_QCOM_CPUFREQ_HW=y > CONFIG_ARM_RASPBERRYPI_CPUFREQ=m > CONFIG_ARM_TEGRA186_CPUFREQ=y > +CONFIG_ARM_TEGRA194_CPUFREQ=y > CONFIG_QORIQ_CPUFREQ=y > CONFIG_ARM_SCPI_PROTOCOL=y > CONFIG_RASPBERRYPI_FIRMWARE=y Instead of this, maybe you can rather add a default y thing in the Kconfig itself as this is a single platform driver.
> > On 26-06-20, 21:13, Sumit Gupta wrote: >> +static int tegra194_cpufreq_probe(struct platform_device *pdev) >> +{ >> + struct tegra194_cpufreq_data *data; >> + struct tegra_bpmp *bpmp; >> + int err, i; >> + >> + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); >> + if (!data) >> + return -ENOMEM; >> + >> + data->num_clusters = MAX_CLUSTERS; >> + data->tables = devm_kcalloc(&pdev->dev, data->num_clusters, >> + sizeof(*data->tables), GFP_KERNEL); >> + if (!data->tables) >> + return -ENOMEM; >> + >> + platform_set_drvdata(pdev, data); >> + >> + bpmp = tegra_bpmp_get(&pdev->dev); >> + if (IS_ERR(bpmp)) >> + return PTR_ERR(bpmp); >> + >> + read_counters_wq = alloc_workqueue("read_counters_wq", __WQ_LEGACY, 1); >> + if (!read_counters_wq) { >> + dev_err(&pdev->dev, "fail to create_workqueue\n"); >> + err = -EINVAL; >> + goto put_bpmp; > > This will call destroy_workqueue() eventually and it will crash your > kernel. > > Apart from this, this stuff looks okay. Don't resend the patch just > yet (and if required, send only this patch using --in-reply-to flag > for git send email). Lets wait for an Ack from Rob for the first two > patches. > Sorry for the delayed response as i was on PTO. Thank you for the feedback. Have posted a v5 based on v4 patch set. >> + } >> + > > -- > viresh >