From: "sricharan" <sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: 'Robin Murphy' <robin.murphy-5wv7dgnIgG8@public.gmane.org>,
'Jean-Philippe Brucker'
<jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>,
will.deacon-5wv7dgnIgG8@public.gmane.org,
joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org,
lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
tn-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org,
hanjun.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Subject: RE: [PATCH V8 01/11] iommu/of: Refactor of_iommu_configure() for error handling
Date: Thu, 9 Mar 2017 15:22:47 +0530 [thread overview]
Message-ID: <1cba01d298ba$ee931000$cbb93000$@codeaurora.org> (raw)
In-Reply-To: <76844d3e-ae7a-5113-1a76-18312e9f51ce-5wv7dgnIgG8@public.gmane.org>
Hi Robin,
>On 08/03/17 18:58, Jean-Philippe Brucker wrote:
>[...]
>>> static const struct iommu_ops
>>> -*of_pci_iommu_configure(struct pci_dev *pdev, struct device_node
>>> *bridge_np)
>>> +*of_pci_iommu_init(struct pci_dev *pdev, struct device_node
>>> +*bridge_np)
>>> {
>>> const struct iommu_ops *ops;
>>> struct of_phandle_args iommu_spec;
>>> + int err;
>>>
>>> /*
>>> * Start by tracing the RID alias down the PCI topology as @@
>>> -123,56 +146,56 @@ static int __get_pci_rid(struct pci_dev *pdev, u16
>alias, void *data)
>>> * bus into the system beyond, and which IOMMU it ends up at.
>>> */
>>> iommu_spec.np = NULL;
>>> - if (of_pci_map_rid(bridge_np, iommu_spec.args[0], "iommu-map",
>>> - "iommu-map-mask", &iommu_spec.np,
>iommu_spec.args))
>>> - return NULL;
>>> + err = of_pci_map_rid(bridge_np, iommu_spec.args[0], "iommu-map",
>>> + "iommu-map-mask", &iommu_spec.np,
>>> + iommu_spec.args);
>>> + if (err)
>>> + return ERR_PTR(err);
>>
>> This change doesn't work with of_pci_map_rid when the PCI RC isn't
>> behind an IOMMU:
>>
>> map = of_get_property(np, map_name, &map_len);
>> if (!map) {
>> if (target)
>> return -ENODEV;
>> /* Otherwise, no map implies no translation */
>> *id_out = rid;
>> return 0;
>> }
>>
>> Previously with no iommu-map, we returned -ENODEV but it was discarded
>> by of_pci_iommu_configure. Now it is propagated and the whole device
>> probing fails. Instead, maybe of_pci_map_rid should always return 0 if
>> no iommu-map, and the caller should check if *target is still NULL?
>
>Ah yes, Tomasz had found breakages with the "mmu-masters" binding
>before, and I'd already pushed out a fixup for this one[1], but I forgot
that
>that discussion was all off-list (out of diplomatic concern that the
breakage
>might have been intentional - it wasn't, honest!)
>
>Now that rc1 is out I should re-do that branch with v8 of this series plus
the
>fixups folded in, unless Sricharan beats me to it.
>
Right, I had this one [1] as V9 which had all your fixes that we discussed
offline as
well. I was about to post a V9 today on top of -rc1 today as well.
[1] https://github.com/sricharanaz/iommu/tree/pd_v9
Regards,
Sricharan
>Thanks for the reminder,
>Robin.
>
>[1]:http://www.linux-arm.org/git?p=linux-
>rm.git;a=commitdiff;h=0049a34e523506813995c05766f5e2c16d616354
>
>>
>> Thanks,
>> Jean-Philippe
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
>the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info
>at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-03-09 9:52 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 15:48 [PATCH V8 00/11] IOMMU probe deferral support Sricharan R
2017-02-03 15:48 ` [PATCH V8 07/11] iommu: of: Handle IOMMU lookup failure with deferred probing or error Sricharan R
2017-05-02 18:35 ` Geert Uytterhoeven
2017-05-03 9:54 ` Robin Murphy
[not found] ` <2bfd11dc-9f94-2b69-7b03-c640e53155e1-5wv7dgnIgG8@public.gmane.org>
2017-05-03 10:24 ` Sricharan R
[not found] ` <26defadf-6380-4af4-6323-b51198376bc1-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-05-03 11:13 ` Sricharan R
2017-05-05 13:23 ` Geert Uytterhoeven
2017-05-17 9:22 ` Magnus Damm
2017-05-17 10:28 ` Sricharan R
2017-05-15 14:22 ` Will Deacon
2017-05-16 2:26 ` sricharan
2017-05-15 20:37 ` Laurent Pinchart
2017-05-15 21:34 ` Laurent Pinchart
2017-05-16 2:23 ` sricharan
2017-05-16 7:17 ` Laurent Pinchart
2017-05-16 9:47 ` Sakari Ailus
2017-05-16 13:40 ` sricharan
2017-05-16 14:06 ` Laurent Pinchart
2017-05-16 14:04 ` Robin Murphy
2017-05-16 14:10 ` Laurent Pinchart
2017-05-16 14:29 ` sricharan-sgV2jX0FEOL9JmXXK+q4OQ
[not found] ` <4484f88d5ce342a3a27a00ef12869acc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-05-16 14:46 ` Laurent Pinchart
2017-05-16 14:52 ` Robin Murphy
2017-05-16 15:14 ` [PATCH] ARM: dma-mapping: Don't tear third-party mappings Laurent Pinchart
[not found] ` <20170516151434.18830-1-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2017-05-16 15:47 ` Robin Murphy
2017-05-16 16:44 ` Laurent Pinchart
2017-05-17 5:15 ` Sricharan R
[not found] ` <d27036e0-4be0-cfdd-f139-619c5adc05b0-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-05-17 11:36 ` sricharan-sgV2jX0FEOL9JmXXK+q4OQ
[not found] ` <1486136933-20328-1-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-03 15:48 ` [PATCH V8 01/11] iommu/of: Refactor of_iommu_configure() for error handling Sricharan R
[not found] ` <1486136933-20328-2-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-03-08 18:58 ` Jean-Philippe Brucker
[not found] ` <8701bfbe-e52e-0e26-2a71-f5f81684de70-5wv7dgnIgG8@public.gmane.org>
2017-03-08 19:28 ` Robin Murphy
[not found] ` <76844d3e-ae7a-5113-1a76-18312e9f51ce-5wv7dgnIgG8@public.gmane.org>
2017-03-09 9:52 ` sricharan [this message]
2017-03-09 11:21 ` Robin Murphy
2017-02-03 15:48 ` [PATCH V8 02/11] iommu/of: Prepare for deferred IOMMU configuration Sricharan R
2017-02-03 15:48 ` [PATCH V8 03/11] of: dma: Move range size workaround to of_dma_get_range() Sricharan R
2017-02-03 15:48 ` [PATCH V8 04/11] of: dma: Make of_dma_deconfigure() public Sricharan R
2017-02-03 15:48 ` [PATCH V8 05/11] ACPI/IORT: Add function to check SMMUs drivers presence Sricharan R
2017-02-03 15:48 ` [PATCH V8 06/11] of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices Sricharan R
2017-02-03 15:48 ` [PATCH V8 08/11] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error Sricharan R
2017-02-03 16:15 ` Sricharan
2017-02-03 17:39 ` Robin Murphy
2017-02-05 6:51 ` Sricharan
2017-02-03 15:48 ` [PATCH V8 09/11] arm64: dma-mapping: Remove the notifier trick to handle early setting of dma_ops Sricharan R
2017-02-03 15:48 ` [PATCH V8 10/11] iommu/arm-smmu: Clean up early-probing workarounds Sricharan R
2017-02-03 15:48 ` [PATCH V8 11/11] ACPI/IORT: Remove linker section for IORT entries probing Sricharan R
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='1cba01d298ba$ee931000$cbb93000$@codeaurora.org' \
--to=sricharan-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=hanjun.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org \
--cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
--cc=tn-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.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).