From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH 1/5] iommu/tegra: smmu: Add DMA window parser, of_get_dma_window()
Date: Wed, 20 Jun 2012 11:11:51 -0600 [thread overview]
Message-ID: <4FE20457.8090307@wwwdotorg.org> (raw)
In-Reply-To: <1340176620-13012-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On 06/20/2012 01:16 AM, Hiroshi DOYU wrote:
> From: Hiroshi Doyu <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> This code was based on:
> "arch/microblaze/kernel/prom_parse.c"
> "arch/powerpc/kernel/prom_parse.c"
>
> Can be promoted as a global function for general use to replace
> "of_parse_dma_window()" in the above. This supports different formats
> flexibly. "prefix" can be configured if any. "busno" and "index" are
> optionally specified. Set NULL and 0 if not used.
>
> Signed-off-by: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
> Based on the discussion:
> http://marc.info/?l=linux-tegra&m=133732046606458&w=2
Hmmm. This function really should be in some common location and
available for all drivers to use. Can't we add it to that common
location from the start? What prevented the earlier patch that did this
from getting merged into 3.5?
One thing that might help here would be /not/ to add the common code to
drivers/of/of_dma.c as was done in the earlier revisions of this patch -
I believe that Grant has been trying to push subsystem-specific OF
functionality into files in those individual subsystems, so that
drivers/of can be kept for core support. Perhaps this patch should
create drivers/iommu/of_iommu.c or similar?
But I wonder: Is this function likely to be useful outside of
drivers/iommu/ - you mentioned that similar code already exists in the
two arch-specific prom_parse.c files; where are the existing users of
those functions. If not in drivers/iommu/, then probably drivers/iommu/
isn't a good place to put the new common function...
> diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
> +static int of_get_dma_window(struct device_node *dn,
> + const char *prefix, int index,
> + unsigned long *busno,
> + dma_addr_t *addr, size_t *size)
> + const char *s = "";
> + if (prefix)
> + s = prefix;
One minor nit, you could just do this and remove variable s:
if (!prefix)
prefix = "";
next prev parent reply other threads:[~2012-06-20 17:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 7:50 [PATCH 0/2] iommu/tegra: smmu: Add device tree support for SMMU Hiroshi DOYU
2012-05-10 7:50 ` [PATCH 1/2] " Hiroshi DOYU
2012-05-10 20:08 ` Stephen Warren
[not found] ` <4FAC2041.7030405-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-05-10 22:38 ` Grant Likely
2012-05-11 9:46 ` Joerg Roedel
[not found] ` <20120511094625.GA11750-5C7GfCeVMHo@public.gmane.org>
2012-05-11 18:04 ` Stephen Warren
[not found] ` <1336636221-31575-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-05-14 17:41 ` Stephen Warren
[not found] ` <4FB143C4.6030502-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-05-17 16:48 ` Stephen Warren
2012-05-18 5:50 ` Hiroshi Doyu
[not found] ` <20120518085051.4a0fca863c5ab37cf8d42cb1-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-05-18 6:43 ` [PATCH 1/1] iommu/tegra: smmu: Add DMA window parser Hiroshi DOYU
2012-05-18 15:15 ` Stephen Warren
[not found] ` <4FB66796.1030007-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-05-18 20:56 ` Hiroshi Doyu
[not found] ` <20120518.235619.175499431618565933.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-05-21 12:47 ` joerg.roedel-5C7GfCeVMHo
[not found] ` <20120521124707.GC2604-5C7GfCeVMHo@public.gmane.org>
2012-06-20 7:16 ` [PATCH 1/5] iommu/tegra: smmu: Add DMA window parser, of_get_dma_window() Hiroshi DOYU
[not found] ` <1340176620-13012-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-20 7:16 ` [PATCH 2/5] iommu/tegra: smmu: Add device tree support for SMMU Hiroshi DOYU
[not found] ` <1340176620-13012-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-21 8:31 ` [v2 " Hiroshi Doyu
2012-06-20 7:16 ` [PATCH 3/5] iommu/tegra: smmu: Simplify allocation at once Hiroshi DOYU
2012-06-20 7:16 ` [PATCH 4/5] iommu/tegra: smmu: Remove unnecessary cleanups with devm_*() Hiroshi DOYU
2012-06-20 7:17 ` [PATCH 5/5] iommu/tegra: smmu: Fix uninitialized var warning Hiroshi DOYU
2012-06-20 17:11 ` Stephen Warren [this message]
2012-06-21 6:46 ` [PATCH 1/5] iommu/tegra: smmu: Add DMA window parser, of_get_dma_window() Hiroshi Doyu
[not found] ` <20120621.094611.2108645748323641310.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-21 6:57 ` Stephen Warren
[not found] ` <4FE2C5F3.1010007-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-21 8:30 ` [v2 1/5] iommu: " Hiroshi Doyu
[not found] ` <20120621.113023.1324461719984328307.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-21 16:18 ` Stephen Warren
[not found] ` <4FE34973.1020400-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-25 5:15 ` Hiroshi Doyu
[not found] ` <20120625081543.bf25af1f74d7d1057d9cd216-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-25 10:42 ` joerg.roedel-5C7GfCeVMHo
2012-05-10 7:50 ` [PATCH 2/2] ARM: dt: tegra30.dtsi: Add SMMU node Hiroshi DOYU
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=4FE20457.8090307@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@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).