From: Robin Murphy <robin.murphy@arm.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Will Deacon <will@kernel.org>, Joerg Roedel <joro@8bytes.org>,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
devicetree@vger.kernel.org, Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@google.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Hanjun Guo <guohanjun@huawei.com>,
Sudeep Holla <sudeep.holla@arm.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Jean-Philippe Brucker <jean-philippe@linaro.org>
Subject: Re: [PATCH v2 3/4] OF: Simplify of_iommu_configure()
Date: Tue, 25 Jun 2024 19:44:04 +0100 [thread overview]
Message-ID: <4db1945e-ec8c-4e96-90fc-cd5386a9d6b4@arm.com> (raw)
In-Reply-To: <CAHp75VdnoOyKYbaNtr_UKn9NMSzXR1Syn9W7u0qtLgGuwYX6-Q@mail.gmail.com>
On 2024-06-22 11:23 pm, Andy Shevchenko wrote:
> On Fri, Jun 21, 2024 at 8:47 PM Robin Murphy <robin.murphy@arm.com> wrote:
>>
>> We no longer have a notion of partially-initialised fwspecs existing,
>> and we also no longer need to use an iommu_ops pointer to return status
>> to of_dma_configure(). Clean up the remains of those, which lends itself
>> to clarifying the logic around the dma_range_map allocation as well.
>
> ...
>
>> + if (!err && dev->bus)
>> + err = iommu_probe_device(dev);
>>
>> + if (err && err != -EPROBE_DEFER)
>> + dev_dbg(dev, "Adding to IOMMU failed: %d\n", err);
>
> Hmm... I'm wondering if dev_err_probe() can be used here.
It's still possible to have other errors here benignly [1] (however
questionable the underlying reason), and this has always been a
dev_dbg(), it's just getting shuffled around again. The aim here is to
carry on removing cruft to work towards getting rid of this
iommu_probe_device() call altogether since it's fundamentally wrong, so
I'm not inclined to add anything new or spend too much effort polishing
code I still want to delete.
>> return err;
>
> ...
>
>> + dev_dbg(dev, "device is%sbehind an iommu\n",
>> + !ret ? " " : " not ");
>
> Why not a positive test?
Again, mostly because that's how it was written in 2014, same reason I'm
not deduplicating the redundant space despite it still being the tiniest
bit irritating. If you make me think about it, though, I suppose when
both outcomes are otherwise equally weighted it does seems natural to
consider "success" before "failure", thus the condition tests for success.
Thanks,
Robin.
[1]
https://lore.kernel.org/linux-iommu/bbmhcoghrprmbdibnjum6lefix2eoquxrde7wyqeulm4xabmlm@b6jy32saugqh/
next prev parent reply other threads:[~2024-06-25 18:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 18:46 [PATCH v2 0/4] iommu: Remove iommu_fwspec ops Robin Murphy
2024-06-21 18:46 ` [PATCH v2 1/4] iommu: Resolve fwspec ops automatically Robin Murphy
2024-06-21 18:46 ` [PATCH v2 2/4] ACPI: Retire acpi_iommu_fwspec_ops() Robin Murphy
2024-06-21 18:46 ` [PATCH v2 3/4] OF: Simplify of_iommu_configure() Robin Murphy
2024-06-22 22:23 ` Andy Shevchenko
2024-06-25 18:44 ` Robin Murphy [this message]
2024-06-21 18:46 ` [PATCH v2 4/4] iommu: Remove iommu_fwspec ops Robin Murphy
2024-07-01 20:37 ` kernel test robot
2024-06-21 20:51 ` [PATCH v2 0/4] " Saravana Kannan
2024-07-02 12:23 ` Robin Murphy
2024-07-01 13:49 ` Jean-Philippe Brucker
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=4db1945e-ec8c-4e96-90fc-cd5386a9d6b4@arm.com \
--to=robin.murphy@arm.com \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=guohanjun@huawei.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe@linaro.org \
--cc=joro@8bytes.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=sudeep.holla@arm.com \
--cc=will@kernel.org \
/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).