linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: thierry.reding@gmail.com, joro@8bytes.org, vdumpa@nvidia.com,
	jonathanh@nvidia.com, linux-tegra@vger.kernel.org,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/3] iommu/tegra-smmu: Rework tegra_smmu_probe_device()
Date: Sun, 4 Oct 2020 14:57:31 -0700	[thread overview]
Message-ID: <20201004215731.GA21420@Asurada-Nvidia> (raw)
In-Reply-To: <4a5a5b1c-080a-327a-1e2f-dc087948e1a1@gmail.com>

On Sat, Oct 03, 2020 at 05:06:42PM +0300, Dmitry Osipenko wrote:
> 03.10.2020 09:59, Nicolin Chen пишет:
> >  static int tegra_smmu_of_xlate(struct device *dev,
> >  			       struct of_phandle_args *args)
> >  {
> > +	struct platform_device *iommu_pdev = of_find_device_by_node(args->np);
> > +	struct tegra_mc *mc = platform_get_drvdata(iommu_pdev);
> >  	u32 id = args->args[0];
> >  
> > +	put_device(&iommu_pdev->dev);
> > +
> > +	if (!mc || !mc->smmu)
> > +		return -EPROBE_DEFER;
> 
> I'm not very excited by seeing code in the patches that can't be
> explained by the patch authors and will appreciate if you could provide
> a detailed explanation about why this NULL checking is needed because I
> think it is unneeded, especially given that other IOMMU drivers don't
> have such check.

This function could be called from of_iommu_configure(), which is
a part of other driver's probe(). So I think it's safer to have a
check. Yet, given mc driver is added to the "arch_initcall" stage,
you are probably right that there's no really need at this moment
because all clients should be called after mc/smmu are inited. So
I'll resend a v6, if that makes you happy.

> I'm asking this question second time now, please don't ignore review
> comments next time.

I think I missed your reply or misunderstood it.

  reply	other threads:[~2020-10-04 22:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03  6:59 [PATCH v5 0/3] iommu/tegra-smmu: Add PCI support Nicolin Chen
2020-10-03  6:59 ` [PATCH v5 1/3] iommu/tegra-smmu: Use fwspec in tegra_smmu_(de)attach_dev Nicolin Chen
2020-10-03 14:14   ` Dmitry Osipenko
2020-10-03  6:59 ` [PATCH v5 2/3] iommu/tegra-smmu: Rework tegra_smmu_probe_device() Nicolin Chen
2020-10-03 14:05   ` Dmitry Osipenko
2020-10-04 22:04     ` Nicolin Chen
2020-10-03 14:06   ` Dmitry Osipenko
2020-10-04 21:57     ` Nicolin Chen [this message]
2020-10-05  8:41       ` Dmitry Osipenko
2020-10-05 10:56         ` Thierry Reding
2020-10-06  1:14           ` Nicolin Chen
2020-10-03 14:19   ` Dmitry Osipenko
2020-10-03  6:59 ` [PATCH v5 3/3] iommu/tegra-smmu: Add PCI support Nicolin Chen
2020-10-03 14:16   ` Dmitry Osipenko
2020-10-04 22:08     ` Nicolin Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201004215731.GA21420@Asurada-Nvidia \
    --to=nicoleotsuka@gmail.com \
    --cc=digetx@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).