lkml.org 
[lkml]   [2020]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/3] iommu/tegra-smmu: Rework tegra_smmu_probe_device()
From
Date
02.10.2020 21:01, Nicolin Chen пишет:
> On Fri, Oct 02, 2020 at 05:23:14PM +0300, Dmitry Osipenko wrote:
>> 02.10.2020 09:08, Nicolin Chen пишет:
>>> static struct iommu_device *tegra_smmu_probe_device(struct device *dev)
>>> {
>>> - struct device_node *np = dev->of_node;
>>> - struct tegra_smmu *smmu = NULL;
>>> - struct of_phandle_args args;
>>> - unsigned int index = 0;
>>> - int err;
>>> -
>>> - while (of_parse_phandle_with_args(np, "iommus", "#iommu-cells", index,
>>> - &args) == 0) {
>>> - smmu = tegra_smmu_find(args.np);
>>> - if (smmu) {
>>> - err = tegra_smmu_configure(smmu, dev, &args);
>>> - of_node_put(args.np);
>>> -
>>> - if (err < 0)
>>> - return ERR_PTR(err);
>>> -
>>> - /*
>>> - * Only a single IOMMU master interface is currently
>>> - * supported by the Linux kernel, so abort after the
>>> - * first match.
>>> - */
>>> - dev_iommu_priv_set(dev, smmu);
>>> -
>>> - break;
>>> - }
>>> -
>>> - of_node_put(args.np);
>>> - index++;
>>> - }
>>> + struct tegra_smmu *smmu = dev_iommu_priv_get(dev);
>>>
>>> if (!smmu)
>>> return ERR_PTR(-ENODEV);
>>
>> The !smmu can't ever be true now, isn't it? Then please remove it.
>
> How can you be so sure? Have you read my commit message? The whole
> point of removing the hack in tegra_smmu_probe() is to return the
> ERR_PTR(-ENODEV) here. The bus_set_iommu() will call this function
> when mc->smmu is not assigned it, as it's assigned after we return
> tegra_smmu_probe() while bus_set_iommu() is still in the middle of
> the tegra_smmu_probe().
>

My bad, I probably missed that was looking at the probe_device(), looks
good then.

\
 
 \ /
  Last update: 2020-10-02 20:21    [W:0.052 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site