lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E3ACF3F.4040106@freescale.com>
Date:	Thu, 4 Aug 2011 11:56:31 -0500
From:	Scott Wood <scottwood@...escale.com>
To:	David Brown <davidb@...eaurora.org>
CC:	Grant Likely <grant.likely@...retlab.ca>,
	<devicetree-discuss@...ts.ozlabs.org>,
	<linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH v2] of/address: Add of_iomap_nocache

On 08/04/2011 05:36 AM, David Brown wrote:
> Add uncached mappings from devicetree nodes similar to regular io
> mappings.
>
> SPARC is coherent, so there this call is the same as regular of_iomap.
>
> Cc: David Miller<davem@...emloft.net>
> Signed-off-by: David Brown<davidb@...eaurora.org>
> ---
> v2 - Add implementation for SPARC
>
>   drivers/of/address.c       |   19 +++++++++++++++++++
>   include/linux/of_address.h |   10 ++++++++++
>   2 files changed, 29 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index 72c33fb..9bee7f8 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
> @@ -613,3 +613,22 @@ void __iomem *of_iomap(struct device_node *np, int index)
>   	return ioremap(res.start, resource_size(&res));
>   }
>   EXPORT_SYMBOL(of_iomap);
> +
> +/**
> + * of_iomap_nocache - Maps the memory mapped IO for a given
> + *                    device_node, using ioremap_nocache.
> + * @device:	the device whose io range will be mapped
> + * @index:	index of the io range
> + *
> + * Returns a pointer to the mapped memory
> + */
> +void __iomem *of_iomap_nocache(struct device_node *np, int index)
> +{
> +	struct resource res;
> +
> +	if (of_address_to_resource(np, index,&res))
> +		return NULL;
> +
> +	return ioremap_nocache(res.start, 1 + res.end - res.start);
> +}

resource_size()?

> +EXPORT_SYMBOL(of_iomap_nocache);
> diff --git a/include/linux/of_address.h b/include/linux/of_address.h
> index 3118623..0e4734b 100644
> --- a/include/linux/of_address.h
> +++ b/include/linux/of_address.h
> @@ -13,6 +13,16 @@ extern struct device_node *of_find_matching_node_by_address(
>   					u64 base_address);
>   extern void __iomem *of_iomap(struct device_node *device, int index);
>
> +#ifndef SPARC
> +extern void __iomem *of_iomap_nocache(struct device_node *device, int index);
> +#else
> +static inline void __iomem *of_iomap_nocache(struct device_node *device,
> +		int index)
> +{
> +	return of_iomap(device, index);
> +}
> +#endif

Why is sparc special?  It looks like it defines ioremap_nocache() as 
ioremap() just like powerpc and some others, so shouldn't the normal 
of_iomap_nocache just work?

-Scott

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ