From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 11/18] iommu: exynos: remove useless device_add/remove callbacks
Date: Sun, 25 Jan 2015 17:38:22 +0200 [thread overview]
Message-ID: <2829552.kzfCU5HyxQ@avalon> (raw)
In-Reply-To: <1422028288-891-12-git-send-email-m.szyprowski@samsung.com>
Hi Marek,
Thank you for the patch.
On Friday 23 January 2015 16:51:21 Marek Szyprowski wrote:
> The driver doesn't need to do anything important in device add/remove
> callbacks, because initialization will be done from device-tree specific
> callbacks added later. IOMMU groups created by current code were never
> used.
IOMMU groups still seem a bit unclear to me. Will Deacon has nicely explained
what they represent in http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/310816.html. The IOMMU core doesn't make groups
mandatory, but requires them in some code paths.
For example the coldplug device add function add_iommu_group() called for all
devices already registered when bus_set_iommu() is called will try to warn of
devices added multiple times with a WARN_ON(dev->iommu_group). Another example
is the iommu_bus_notifier() function which will call the remove_device()
operation only when dev->iommu_group isn't NULL.
I'm thus unsure whether groups should be made mandatory, or whether the IOMMU
core should be fixed to make them really optional (or, third option, whether
there's something I haven't understood properly).
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/iommu/exynos-iommu.c | 28 ----------------------------
> 1 file changed, 28 deletions(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index e62cb96..e40e699 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -1055,32 +1055,6 @@ static phys_addr_t exynos_iommu_iova_to_phys(struct
> iommu_domain *domain, return phys;
> }
>
> -static int exynos_iommu_add_device(struct device *dev)
> -{
> - struct iommu_group *group;
> - int ret;
> -
> - group = iommu_group_get(dev);
> -
> - if (!group) {
> - group = iommu_group_alloc();
> - if (IS_ERR(group)) {
> - dev_err(dev, "Failed to allocate IOMMU group\n");
> - return PTR_ERR(group);
> - }
> - }
> -
> - ret = iommu_group_add_device(group, dev);
> - iommu_group_put(group);
> -
> - return ret;
> -}
> -
> -static void exynos_iommu_remove_device(struct device *dev)
> -{
> - iommu_group_remove_device(dev);
> -}
> -
> static const struct iommu_ops exynos_iommu_ops = {
> .domain_init = exynos_iommu_domain_init,
> .domain_destroy = exynos_iommu_domain_destroy,
> @@ -1090,8 +1064,6 @@ static const struct iommu_ops exynos_iommu_ops = {
> .unmap = exynos_iommu_unmap,
> .map_sg = default_iommu_map_sg,
> .iova_to_phys = exynos_iommu_iova_to_phys,
> - .add_device = exynos_iommu_add_device,
> - .remove_device = exynos_iommu_remove_device,
> .pgsize_bitmap = SECT_SIZE | LPAGE_SIZE | SPAGE_SIZE,
> };
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-01-25 15:38 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 15:51 [PATCH v5 00/18] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 01/18] drm: exynos: detach from default dma-mapping domain on init Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 02/18] arm: exynos: pm_domains: add support for devices registered before arch_initcall Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 03/18] ARM: dts: exynos4: add sysmmu nodes Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 04/18] ARM: dts: exynos5250: " Marek Szyprowski
2015-01-27 6:25 ` Hongbo Zhang
2015-02-22 17:58 ` Andreas Färber
2015-01-23 15:51 ` [PATCH v5 05/18] ARM: dts: exynos5420: " Marek Szyprowski
2015-02-22 18:00 ` Andreas Färber
2015-01-23 15:51 ` [PATCH v5 06/18] iommu: exynos: don't read version register on every tlb operation Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 07/18] iommu: exynos: remove unused functions Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 08/18] iommu: exynos: remove useless spinlock Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 09/18] iommu: exynos: refactor function parameters to simplify code Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 10/18] iommu: exynos: remove unused functions, part 2 Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 11/18] iommu: exynos: remove useless device_add/remove callbacks Marek Szyprowski
2015-01-25 15:38 ` Laurent Pinchart [this message]
2015-01-26 11:00 ` Joerg Roedel
2015-01-26 11:09 ` Will Deacon
2015-01-26 12:06 ` Marek Szyprowski
2015-01-26 13:03 ` Laurent Pinchart
2015-01-26 13:47 ` Joerg Roedel
2015-01-23 15:51 ` [PATCH v5 12/18] iommu: exynos: add support for binding more than one sysmmu to master device Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 13/18] iommu: exynos: add support for runtime_pm Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 14/18] iommu: exynos: rename variables to reflect their purpose Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 15/18] iommu: exynos: document internal structures Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 16/18] iommu: exynos: remove excessive includes and sort others alphabetically Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 17/18] iommu: exynos: init from dt-specific callback instead of initcall Marek Szyprowski
2015-01-23 15:51 ` [PATCH v5 18/18] iommu: exynos: add callback for initializing devices from device tree Marek Szyprowski
2015-02-04 9:53 ` [PATCH v5 00/18] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem Hongbo Zhang
2015-02-04 13:54 ` Marek Szyprowski
2015-02-04 14:21 ` Joerg Roedel
2015-04-17 14:33 ` Javier Martinez Canillas
2015-04-17 14:48 ` Marek Szyprowski
2015-04-17 16:15 ` Javier Martinez Canillas
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=2829552.kzfCU5HyxQ@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.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).