* [PATCH] drm/sun4i: Add a few formats
From: Chen-Yu Tsai @ 2016-10-25 0:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024144014.occkqw2v5c2ghx4w@lukather>
On Mon, Oct 24, 2016 at 10:40 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Fri, Oct 21, 2016 at 11:15:32AM +0800, Chen-Yu Tsai wrote:
>> On Tue, Oct 18, 2016 at 4:46 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > The planes can do more than what was previously exposed. Add support for
>> > them.
>> >
>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> > ---
>> > drivers/gpu/drm/sun4i/sun4i_backend.c | 20 ++++++++++++++++++++
>> > drivers/gpu/drm/sun4i/sun4i_layer.c | 6 ++++++
>> > 2 files changed, 26 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c
>> > index afb7ddf660ef..b184a476a480 100644
>> > --- a/drivers/gpu/drm/sun4i/sun4i_backend.c
>> > +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c
>> > @@ -96,6 +96,22 @@ static int sun4i_backend_drm_format_to_layer(struct drm_plane *plane,
>> > *mode = SUN4I_BACKEND_LAY_FBFMT_ARGB8888;
>> > break;
>> >
>> > + case DRM_FORMAT_ARGB4444:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_ARGB4444;
>> > + break;
>> > +
>> > + case DRM_FORMAT_ARGB1555:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_ARGB1555;
>> > + break;
>> > +
>> > + case DRM_FORMAT_RGBA5551:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_RGBA5551;
>> > + break;
>> > +
>> > + case DRM_FORMAT_RGBA4444:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_RGBA4444;
>>
>> The A20 manual only lists ARGB4444, not RGBA4444. There might be
>> some discrepancy here. We can deal with them
>
> Hmm, yes, that's weird. But I guess this would be part of porting it
> to the A20.
>
>> Also there are some more formats missing from the list, could you
>> add them as well?
>
> Which one do you refer to?
RGB556 and RGB655.
>
>> > + break;
>> > +
>> > case DRM_FORMAT_XRGB8888:
>> > *mode = SUN4I_BACKEND_LAY_FBFMT_XRGB8888;
>> > break;
>> > @@ -104,6 +120,10 @@ static int sun4i_backend_drm_format_to_layer(struct drm_plane *plane,
>> > *mode = SUN4I_BACKEND_LAY_FBFMT_RGB888;
>> > break;
>> >
>> > + case DRM_FORMAT_RGB565:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_RGB565;
>> > + break;
>> > +
>> > default:
>> > return -EINVAL;
>> > }
>> > diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
>> > index f0035bf5efea..5d53c977bca5 100644
>> > --- a/drivers/gpu/drm/sun4i/sun4i_layer.c
>> > +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
>> > @@ -73,12 +73,18 @@ static const struct drm_plane_funcs sun4i_backend_layer_funcs = {
>> > static const uint32_t sun4i_backend_layer_formats_primary[] = {
>> > DRM_FORMAT_ARGB8888,
>> > DRM_FORMAT_RGB888,
>> > + DRM_FORMAT_RGB565,
>> > DRM_FORMAT_XRGB8888,
>> > };
>> >
>> > static const uint32_t sun4i_backend_layer_formats_overlay[] = {
>> > DRM_FORMAT_ARGB8888,
>> > + DRM_FORMAT_ARGB4444,
>> > + DRM_FORMAT_ARGB1555,
>> > + DRM_FORMAT_RGBA5551,
>> > + DRM_FORMAT_RGBA4444,
>> > DRM_FORMAT_RGB888,
>> > + DRM_FORMAT_RGB565,
>> > DRM_FORMAT_XRGB8888,
>>
>> Could you explain in the commit log why these 2 aren't the same?
>
> Yep, I will.
Cool! Thanks.
ChenYu
>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
^ permalink raw reply
* [PATCH] of: Add vendor prefix for Aries Embedded GmbH
From: Marek Vasut @ 2016-10-25 0:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAL_JsqL4NUoonJ+Lw0tbhyKk0xM4ke65BNQ1VNndfUrqLZsgLw@mail.gmail.com>
On 10/25/2016 02:14 AM, Rob Herring wrote:
> On Mon, Oct 24, 2016 at 6:38 AM, Marek Vasut <marex@denx.de> wrote:
>> On 09/19/2016 11:38 PM, Marek Vasut wrote:
>>> Add vendor prefix for Aries Embedded GmbH
>>> http://www.aries-embedded.de/
>>>
>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>> Cc: Rob Herring <robh@kernel.org>
>>
>> Hi, bump ?
>
> Looks fine, but please resend to the DT list so that patchwork picks
> this up and it will be in my queue.
OK, done.
--
Best regards,
Marek Vasut
^ permalink raw reply
* [PATCH] asm-generic: Drop getrlimit and setrlimit syscalls from default list
From: Ley Foon Tan @ 2016-10-25 0:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024090931.GR7370@jhogan-linux.le.imgtec.org>
On Mon, Oct 24, 2016 at 5:09 PM, James Hogan <james.hogan@imgtec.com> wrote:
> On Sat, Oct 22, 2016 at 03:14:04PM +0300, Yury Norov wrote:
>> The newer prlimit64 syscall provides all the functionality provided by
>> the getrlimit and setrlimit syscalls and adds the pid of target process,
>> so future architectures won't need to include getrlimit and setrlimit.
>>
>> Therefore drop getrlimit and setrlimit syscalls from the generic syscall
>> list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's
>> unistd.h prior to including asm-generic/unistd.h, and adjust all
>> architectures using the generic syscall list to define it so that no
>> in-tree architectures are affected.
>>
>> Cc: Vineet Gupta <vgupta@synopsys.com>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Will Deacon <will.deacon@arm.com>
>> Cc: Mark Salter <msalter@redhat.com>
>> Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>> Cc: Richard Kuo <rkuo@codeaurora.org>
>> Cc: James Hogan <james.hogan@imgtec.com>
>> Cc: Ley Foon Tan <lftan@altera.com>
>> Cc: Jonas Bonn <jonas@southpole.se>
>> Cc: Chen Liqin <liqin.linux@gmail.com>
>> Cc: Lennox Wu <lennox.wu@gmail.com>
>> Cc: Chris Metcalf <cmetcalf@mellanox.com>
>> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Andrew Pinski <Andrew.Pinski@cavium.com>
>> Cc: linux-snps-arc at lists.infradead.org
>> Cc: linux-kernel at vger.kernel.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-c6x-dev at linux-c6x.org
>> Cc: uclinux-h8-devel at lists.sourceforge.jp
>> Cc: linux-hexagon at vger.kernel.org
>> Cc: linux-metag at vger.kernel.org
>> Cc: nios2-dev at lists.rocketboards.org
>> Cc: linux-arch at vger.kernel.or
>> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
>>
>> ---
>> arch/arc/include/uapi/asm/unistd.h | 1 +
>> arch/arm64/include/uapi/asm/unistd.h | 1 +
>> arch/c6x/include/uapi/asm/unistd.h | 1 +
>> arch/h8300/include/uapi/asm/unistd.h | 1 +
>> arch/hexagon/include/uapi/asm/unistd.h | 1 +
>> arch/metag/include/uapi/asm/unistd.h | 1 +
>
> Acked-by: James Hogan <james.hogan@imgtec.com> [metag]
>
> Cheers
> James
>
>> arch/nios2/include/uapi/asm/unistd.h | 1 +
Acked-by: Ley Foon Tan <lftan@altera.com> [nios2]
>> arch/openrisc/include/uapi/asm/unistd.h | 1 +
>> arch/score/include/uapi/asm/unistd.h | 1 +
>> arch/tile/include/uapi/asm/unistd.h | 1 +
>> arch/unicore32/include/uapi/asm/unistd.h | 1 +
>> include/uapi/asm-generic/unistd.h | 5 +++++
>> 12 files changed, 16 insertions(+)
>>
>> diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h
>> index 41fa2ec..928546d 100644
>> --- a/arch/arc/include/uapi/asm/unistd.h
>> +++ b/arch/arc/include/uapi/asm/unistd.h
>> @@ -16,6 +16,7 @@
>> #define _UAPI_ASM_ARC_UNISTD_H
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_EXECVE
>> #define __ARCH_WANT_SYS_CLONE
>> #define __ARCH_WANT_SYS_VFORK
>> diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
>> index 043d17a..48355a6 100644
>> --- a/arch/arm64/include/uapi/asm/unistd.h
>> +++ b/arch/arm64/include/uapi/asm/unistd.h
>> @@ -15,5 +15,6 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h
>> index 12d73d9..f676231 100644
>> --- a/arch/c6x/include/uapi/asm/unistd.h
>> +++ b/arch/c6x/include/uapi/asm/unistd.h
>> @@ -15,6 +15,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_CLONE
>>
>> /* Use the standard ABI for syscalls. */
>> diff --git a/arch/h8300/include/uapi/asm/unistd.h b/arch/h8300/include/uapi/asm/unistd.h
>> index 7dd20ef..2f98394 100644
>> --- a/arch/h8300/include/uapi/asm/unistd.h
>> +++ b/arch/h8300/include/uapi/asm/unistd.h
>> @@ -1,5 +1,6 @@
>> #define __ARCH_NOMMU
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h
>> index 2151760..52d585c 100644
>> --- a/arch/hexagon/include/uapi/asm/unistd.h
>> +++ b/arch/hexagon/include/uapi/asm/unistd.h
>> @@ -28,6 +28,7 @@
>>
>> #define sys_mmap2 sys_mmap_pgoff
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_EXECVE
>> #define __ARCH_WANT_SYS_CLONE
>> #define __ARCH_WANT_SYS_VFORK
>> diff --git a/arch/metag/include/uapi/asm/unistd.h b/arch/metag/include/uapi/asm/unistd.h
>> index 459b6ec..16b5cb3 100644
>> --- a/arch/metag/include/uapi/asm/unistd.h
>> +++ b/arch/metag/include/uapi/asm/unistd.h
>> @@ -8,6 +8,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> /* Use the standard ABI for syscalls. */
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
>> index 51a32c7..b0dda4d 100644
>> --- a/arch/nios2/include/uapi/asm/unistd.h
>> +++ b/arch/nios2/include/uapi/asm/unistd.h
>> @@ -18,6 +18,7 @@
>> #define sys_mmap2 sys_mmap_pgoff
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> /* Use the standard ABI for syscalls */
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/openrisc/include/uapi/asm/unistd.h b/arch/openrisc/include/uapi/asm/unistd.h
>> index 471905b..6812d81 100644
>> --- a/arch/openrisc/include/uapi/asm/unistd.h
>> +++ b/arch/openrisc/include/uapi/asm/unistd.h
>> @@ -21,6 +21,7 @@
>> #define sys_mmap2 sys_mmap_pgoff
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_FORK
>> #define __ARCH_WANT_SYS_CLONE
>>
>> diff --git a/arch/score/include/uapi/asm/unistd.h b/arch/score/include/uapi/asm/unistd.h
>> index d4008c3..7ad1bdc 100644
>> --- a/arch/score/include/uapi/asm/unistd.h
>> +++ b/arch/score/include/uapi/asm/unistd.h
>> @@ -1,6 +1,7 @@
>> #define __ARCH_HAVE_MMU
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYSCALL_NO_AT
>> #define __ARCH_WANT_SYSCALL_NO_FLAGS
>> #define __ARCH_WANT_SYSCALL_OFF_T
>> diff --git a/arch/tile/include/uapi/asm/unistd.h b/arch/tile/include/uapi/asm/unistd.h
>> index 24e9187..cf0505f 100644
>> --- a/arch/tile/include/uapi/asm/unistd.h
>> +++ b/arch/tile/include/uapi/asm/unistd.h
>> @@ -13,6 +13,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #if !defined(__LP64__) || defined(__SYSCALL_COMPAT)
>> /* Use the flavor of this syscall that matches the 32-bit API better. */
>> #define __ARCH_WANT_SYNC_FILE_RANGE2
>> diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h
>> index 1f63c47..ef25aec 100644
>> --- a/arch/unicore32/include/uapi/asm/unistd.h
>> +++ b/arch/unicore32/include/uapi/asm/unistd.h
>> @@ -11,6 +11,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> /* Use the standard ABI for syscalls. */
>> #include <asm-generic/unistd.h>
>> diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
>> index 9b1462e..bbaeac0 100644
>> --- a/include/uapi/asm-generic/unistd.h
>> +++ b/include/uapi/asm-generic/unistd.h
>> @@ -465,10 +465,15 @@ __SYSCALL(__NR_uname, sys_newuname)
>> __SYSCALL(__NR_sethostname, sys_sethostname)
>> #define __NR_setdomainname 162
>> __SYSCALL(__NR_setdomainname, sys_setdomainname)
>> +
>> +#ifdef __ARCH_WANT_SET_GET_RLIMIT
>> +/* getrlimit and setrlimit are superseded with prlimit64 */
>> #define __NR_getrlimit 163
>> __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
>> #define __NR_setrlimit 164
>> __SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)
>> +#endif
>> +
>> #define __NR_getrusage 165
>> __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
>> #define __NR_umask 166
>> --
>> 2.7.4
>>
^ permalink raw reply
* [PATCH/RFT v2 17/17] ARM: dts: da850: add usb device node
From: David Lechner @ 2016-10-25 0:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-18-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> This adds the usb (ohci) device node for the da850 soc.
> Also it enables it for the lcdk board
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
> arch/arm/boot/dts/da850-lcdk.dts | 8 ++++++++
> arch/arm/boot/dts/da850.dtsi | 8 ++++++++
> 2 files changed, 16 insertions(+)
>
> diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
> index 7b8ab21..fa91339 100644
> --- a/arch/arm/boot/dts/da850-lcdk.dts
> +++ b/arch/arm/boot/dts/da850-lcdk.dts
> @@ -86,6 +86,14 @@
> };
> };
>
> +&usb_phy {
> + status = "okay";
> +};
> +
> +&usb {
> + status = "okay";
Don't you need to specify a regulator here using the vbus-supply property?
> +};
> +
> &serial2 {
> pinctrl-names = "default";
> pinctrl-0 = <&serial2_rxtx_pins>;
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index 33fcdce..ec2cec3 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -381,6 +381,14 @@
> #phy-cells = <1>;
> status = "disabled";
> };
> + usb: usb at 0225000 {
Don't need the leading 0 on usb at 225000
The alias (usb:) might need to be more specific since there is a second
usb device that will be added later for musb. (The comments in the
previous review only referred to the "usb" in "usb@", not the alias.)
> + compatible = "ti,da830-ohci";
> + reg = <0x225000 0x1000>;
> + interrupts = <59>;
> + phys = <&usb_phy 1>;
> + phy-names = "usb-phy";
> + status = "disabled";
> + };
> gpio: gpio at 226000 {
> compatible = "ti,dm6441-gpio";
> gpio-controller;
>
^ permalink raw reply
* [PATCH v1] char: hw_random: atmel-rng: disable TRNG during suspend
From: Wenyou.Yang at microchip.com @ 2016-10-25 0:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <b0554c1e-e13a-9fe3-ebf4-5d8b0aa16b15@atmel.com>
> -----Original Message-----
> From: Nicolas Ferre [mailto:nicolas.ferre at atmel.com]
> Sent: 2016?10?24? 20:07
> To: Wenyou Yang - A41535 <Wenyou.Yang@microchip.com>; Herbert Xu
> <herbert@gondor.apana.org.au>; Matt Mackall <mpm@selenic.com>
> Cc: linux-crypto at vger.kernel.org; Wenyou Yang - A41535
> <Wenyou.Yang@microchip.com>; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH v1] char: hw_random: atmel-rng: disable TRNG during
> suspend
>
> Le 24/10/2016 ? 10:03, Wenyou Yang a ?crit :
> > To fix the over consumption on the VDDCore due to the TRNG enabled,
> > disable the TRNG during suspend, not only disable the user interface
> > clock (which is controlled by PMC). Because the user interface clock
> > is independent from any clock that may be used in the entropy source
> > logic circuitry.
> >
> > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> > ---
> >
> > drivers/char/hw_random/atmel-rng.c | 16 ++++++++++++++--
> > 1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/char/hw_random/atmel-rng.c
> > b/drivers/char/hw_random/atmel-rng.c
> > index 0fcc9e6..2e2d09a 100644
> > --- a/drivers/char/hw_random/atmel-rng.c
> > +++ b/drivers/char/hw_random/atmel-rng.c
> > @@ -48,6 +48,16 @@ static int atmel_trng_read(struct hwrng *rng, void *buf,
> size_t max,
> > return 0;
> > }
> >
> > +static void atmel_trng_enable(struct atmel_trng *trng) {
> > + writel(TRNG_KEY | 1, trng->base + TRNG_CR); }
> > +
> > +static void atmel_trng_disable(struct atmel_trng *trng) {
> > + writel(TRNG_KEY, trng->base + TRNG_CR); }
> > +
> > static int atmel_trng_probe(struct platform_device *pdev) {
> > struct atmel_trng *trng;
> > @@ -71,7 +81,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
> > if (ret)
> > return ret;
> >
> > - writel(TRNG_KEY | 1, trng->base + TRNG_CR);
> > + atmel_trng_enable(trng);
> > trng->rng.name = pdev->name;
> > trng->rng.read = atmel_trng_read;
> >
> > @@ -94,7 +104,7 @@ static int atmel_trng_remove(struct platform_device
> > *pdev)
> >
> > hwrng_unregister(&trng->rng);
> >
> > - writel(TRNG_KEY, trng->base + TRNG_CR);
> > + atmel_trng_disable(trng);
> > clk_disable_unprepare(trng->clk);
> >
> > return 0;
> > @@ -105,6 +115,7 @@ static int atmel_trng_suspend(struct device *dev)
> > {
> > struct atmel_trng *trng = dev_get_drvdata(dev);
> >
> > + atmel_trng_disable(trng);
> > clk_disable_unprepare(trng->clk);
> >
> > return 0;
> > @@ -114,6 +125,7 @@ static int atmel_trng_resume(struct device *dev)
> > {
> > struct atmel_trng *trng = dev_get_drvdata(dev);
> >
> > + atmel_trng_enable(trng);
> > return clk_prepare_enable(trng->clk);
>
> Isn't it the other way around:
> enable the user interface first, then enable the internal clock? like:
>
> clk_prepare_enable(trng->clk);
> atmel_trng_enable(trng);
Yes, I thought so.
But the datasheet said, "The user interface clock is independent from any clock that may be used in the entropy source logic circuitry.
The source of entropy can be enabled before enabling the user interface clock."
It seems the TRNG can be enabled before enabling the peripheral clock.
Best Regards,
Wenyou Yang
^ permalink raw reply
* [PATCH/RFT v2 16/17] USB: ohci-da8xx: Allow probing from DT
From: David Lechner @ 2016-10-25 0:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-17-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> This adds the compatible string to the ohci driver
> to be able to probe from DT
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
> drivers/usb/host/ohci-da8xx.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
> index bebc3f0..1a8db25 100644
> --- a/drivers/usb/host/ohci-da8xx.c
> +++ b/drivers/usb/host/ohci-da8xx.c
> @@ -273,6 +273,13 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
> }
>
> /*-------------------------------------------------------------------------*/
> +#ifdef CONFIG_OF
#ifdef CONFIG_OF is probably not needed here...
> +static const struct of_device_id da8xx_ohci_ids[] = {
> + { .compatible = "ti,da830-ohci" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, da8xx_ohci_ids);
> +#endif
>
> static int ohci_da8xx_probe(struct platform_device *pdev)
> {
> @@ -421,6 +428,7 @@ static int ohci_da8xx_resume(struct platform_device *dev)
> #endif
> .driver = {
> .name = "ohci",
> + .of_match_table = da8xx_ohci_ids,
...otherwise, da8xx_ohci_ids will not be defined here
> },
> };
>
>
^ permalink raw reply
* [PATCH v2] char: hw_random: atmel-rng: disable TRNG during suspend
From: Wenyou Yang @ 2016-10-25 0:56 UTC (permalink / raw)
To: linux-arm-kernel
To fix the over consumption on the VDDCore due to the TRNG enabled,
disable the TRNG during suspend, not only disable the user interface
clock (which is controlled by PMC). Because the user interface clock
is independent from any clock that may be used in the entropy source
logic circuitry.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
Changes in v2:
- Enable the user interface first, then enable the internal clock
when resume.
drivers/char/hw_random/atmel-rng.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 0fcc9e6..ae7cae5 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -48,6 +48,16 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max,
return 0;
}
+static void atmel_trng_enable(struct atmel_trng *trng)
+{
+ writel(TRNG_KEY | 1, trng->base + TRNG_CR);
+}
+
+static void atmel_trng_disable(struct atmel_trng *trng)
+{
+ writel(TRNG_KEY, trng->base + TRNG_CR);
+}
+
static int atmel_trng_probe(struct platform_device *pdev)
{
struct atmel_trng *trng;
@@ -71,7 +81,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
if (ret)
return ret;
- writel(TRNG_KEY | 1, trng->base + TRNG_CR);
+ atmel_trng_enable(trng);
trng->rng.name = pdev->name;
trng->rng.read = atmel_trng_read;
@@ -94,7 +104,7 @@ static int atmel_trng_remove(struct platform_device *pdev)
hwrng_unregister(&trng->rng);
- writel(TRNG_KEY, trng->base + TRNG_CR);
+ atmel_trng_disable(trng);
clk_disable_unprepare(trng->clk);
return 0;
@@ -105,6 +115,7 @@ static int atmel_trng_suspend(struct device *dev)
{
struct atmel_trng *trng = dev_get_drvdata(dev);
+ atmel_trng_disable(trng);
clk_disable_unprepare(trng->clk);
return 0;
@@ -113,8 +124,15 @@ static int atmel_trng_suspend(struct device *dev)
static int atmel_trng_resume(struct device *dev)
{
struct atmel_trng *trng = dev_get_drvdata(dev);
+ int ret;
+
+ ret = clk_prepare_enable(trng->clk);
+ if (ret)
+ return ret;
- return clk_prepare_enable(trng->clk);
+ atmel_trng_enable(trng);
+
+ return 0;
}
static const struct dev_pm_ops atmel_trng_pm_ops = {
--
2.7.4
^ permalink raw reply related
* [PATCH/RFT v2 15/17] usb: host: ohci-da8xx: Add devicetree bindings documentation
From: David Lechner @ 2016-10-25 1:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-16-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> This patch documents the device tree bindings required for
> the ohci controller found in TI da8xx family of SoC's
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
> .../devicetree/bindings/usb/ohci-da8xx.txt | 39 ++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/usb/ohci-da8xx.txt
>
> diff --git a/Documentation/devicetree/bindings/usb/ohci-da8xx.txt b/Documentation/devicetree/bindings/usb/ohci-da8xx.txt
> new file mode 100644
> index 0000000..4251c84
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/ohci-da8xx.txt
> @@ -0,0 +1,39 @@
> +DA8XX USB OHCI controller
> +
> +Required properties:
> +
> + - compatible: Should be "ti,da830-ohci"
> + - reg: Should contain one register range i.e. start and length
> + - interrupts: Description of the interrupt line
> + - phys: Phandle for the PHY device
> + - phy-names: Should be "usb-phy"
> +
> +Optional properties:
> + - vbus-supply: Regulator that controls vbus power
Isn't vbus-supply property required?
If it is really supposed to be optional, the ohci driver needs to use
devm_regulator_get_optional() and handle the case when there is no
regulator.
I don't see a problem with making it required though since one can just
use a dummy supply if there is not a real one.
> +
> +Example for omap138-lck:
> +
> +vbus_fixed: fixed-regulator-vbus {
> + compatible = "regulator-fixed";
> + gpio = <&gpio 109 0>;
> + oc-gpio = <&gpio 36 0>;
> + regulator-boot-on;
> + enable-active-high;
> + regulator-name = "vbus";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> +};
> +
> +usb_phy: usb-phy {
> + compatible = "ti,da830-usb-phy";
> + #phy-cells = <1>;
> + status = "disabled";
why disabled?
> +};
> +usb: usb at 0225000 {
> + compatible = "ti,da830-ohci";
> + reg = <0x225000 0x1000>;
> + interrupts = <59>;
> + phys = <&usb_phy 1>;
> + phy-names = "usb-phy";
missing vbus-supply property
> + status = "disabled";
why disabled?
> +};
>
^ permalink raw reply
* [PATCH/RFT v2 13/17] USB: da8xx: use ohci priv data instead of globals
From: David Lechner @ 2016-10-25 1:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-14-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
> > static const struct ohci_driver_overrides da8xx_overrides __initconst = {
> - .reset = ohci_da8xx_reset
> + .reset = ohci_da8xx_reset,
> + .extra_priv_size = sizeof(struct da8xx_ohci_hcd),
nit: since you are changing both lines anyway, you might as well make
the ='s line up.
> };
>
> /*
>
^ permalink raw reply
* [PATCH v5 02/23] of: device: Export of_device_{get_modalias, uvent_modalias} to modules
From: Peter Chen @ 2016-10-25 1:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <147733850401.29612.2343965740004706258@sboyd-linaro>
On Mon, Oct 24, 2016 at 12:48:24PM -0700, Stephen Boyd wrote:
> Quoting Chen-Yu Tsai (2016-10-24 05:19:05)
> > Hi,
> >
> > On Tue, Oct 18, 2016 at 9:56 AM, Stephen Boyd <stephen.boyd@linaro.org> wrote:
> > > The ULPI bus can be built as a module, and it will soon be
> > > calling these functions when it supports probing devices from DT.
> > > Export them so they can be used by the ULPI module.
> > >
> > > Acked-by: Rob Herring <robh@kernel.org>
> > > Cc: <devicetree@vger.kernel.org>
> > > Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
> > > ---
> > > drivers/of/device.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/of/device.c b/drivers/of/device.c
> > > index 8a22a253a830..6719ab35b62e 100644
> > > --- a/drivers/of/device.c
> > > +++ b/drivers/of/device.c
> > > @@ -225,6 +225,7 @@ ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len)
> > >
> > > return tsize;
> > > }
> > > +EXPORT_SYMBOL_GPL(of_device_get_modalias);
> > >
> > > int of_device_request_module(struct device *dev)
> > > {
> > > @@ -290,6 +291,7 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
> > > }
> > > mutex_unlock(&of_mutex);
> > > }
> > > +EXPORT_SYMBOL_GPL(of_device_uevent_modalias);
> >
> > This is trailing the wrong function.
> >
>
> Good catch. Must have been some bad rebase.
>
> Peter, can you fix it while applying or should I resend this patch?
>
But, this is device tree patch. I can only get chipidea part and other
USB patches if Greg agrees.
--
Best Regards,
Peter Chen
^ permalink raw reply
* [PATCH/RFT v2 12/17] USB: ochi-da8xx: Use a regulator for vbus/overcurrent
From: David Lechner @ 2016-10-25 1:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-13-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> Currently, the da8xx ohci driver uses a set of gpios and callbacks in
> board files to handle vbus and overcurrent irqs form the power supply.
> However, this does not play nice when moving to a DT based boot were
> we wont have board files.
>
> Instead of requesting and handling the gpio, use the regulator framework
> to take care of enabling and disabling vbus power.
> This has the benefit
> that we dont need to pass any more platform data to the driver:
>
> These will be handled by the regulator framework:
> set_power -> regulator_enable/regulator_disable
> get_power -> regulator_is_enabled
> get_oci -> regulator_get_mode
> ocic_notify -> regulator notification
>
> We can keep the default potpgt and use the regulator start delay instead:
> potpgt -> regulator startup delay time
>
> The hawk board does not have a GPIO/OVERCURRENT gpio to control vbus,
> (they should not have been decleared/reserved) so, just remove those
> definitions from the hwk board file.
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
How do you recover after an overcurrent event?
I have configured a fixed-regulator using device-tree, but similar to
the configuration in the board files here. However, when I shorted out
the VBUS and caused an overcurrent event, I see nothing in the kernel
log saying that there was an overcurrent event and after I remove the
short, the regulator is never turned back on.
> @@ -163,7 +198,6 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
> u16 wIndex, char *buf, u16 wLength)
> {
> struct device *dev = hcd->self.controller;
> - struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
nit: unnecessary whitespace change
> int temp;
>
> switch (typeReq) {
^ permalink raw reply
* [PATCH V3 1/2] powerpc/mpc85xx: Update TMU device tree node for T1040/T1042
From: Jia Hongtao @ 2016-10-25 2:15 UTC (permalink / raw)
To: linux-arm-kernel
From: Hongtao Jia <hongtao.jia@nxp.com>
Update #thermal-sensor-cells from 0 to 1 according to the new binding. The
sensor specifier added is the monitoring site ID, and represents the "n" in
TRITSRn and TRATSRn.
Signed-off-by: Jia Hongtao <hongtao.jia@nxp.com>
---
Changes for V3:
* Update the commit log to a better description.
Changes for V2:
* Rebase on latest linux-next tree (next-20161006).
arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 44e399b..145c7f4 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -526,7 +526,7 @@
0x00030000 0x00000012
0x00030001 0x0000001d>;
- #thermal-sensor-cells = <0>;
+ #thermal-sensor-cells = <1>;
};
thermal-zones {
@@ -534,7 +534,7 @@
polling-delay-passive = <1000>;
polling-delay = <5000>;
- thermal-sensors = <&tmu>;
+ thermal-sensors = <&tmu 2>;
trips {
cpu_alert: cpu-alert {
--
2.1.0.27.g96db324
^ permalink raw reply related
* [PATCH V3 2/2] powerpc/mpc85xx: Update TMU device tree node for T1023/T1024
From: Jia Hongtao @ 2016-10-25 2:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477361742-589-1-git-send-email-hongtao.jia@nxp.com>
From: Hongtao Jia <hongtao.jia@nxp.com>
Update #thermal-sensor-cells from 0 to 1 according to the new binding. The
sensor specifier added is the monitoring site ID, and represents the "n" in
TRITSRn and TRATSRn.
Signed-off-by: Jia Hongtao <hongtao.jia@nxp.com>
---
Changes for V3:
* Update the commit log to a better description.
Changes for V2:
* Rebase on latest linux-next tree (next-20161006).
arch/powerpc/boot/dts/fsl/t1023si-post.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
index 6e0b489..bce762a 100644
--- a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
@@ -321,7 +321,7 @@
0x00030001 0x0000000d
0x00030002 0x00000019
0x00030003 0x00000024>;
- #thermal-sensor-cells = <0>;
+ #thermal-sensor-cells = <1>;
};
thermal-zones {
@@ -329,7 +329,7 @@
polling-delay-passive = <1000>;
polling-delay = <5000>;
- thermal-sensors = <&tmu>;
+ thermal-sensors = <&tmu 0>;
trips {
cpu_alert: cpu-alert {
--
2.1.0.27.g96db324
^ permalink raw reply related
* [PATCH V2 1/5] powerpc/mpc85xx: Update TMU device tree node for T1040/T1042
From: Troy Jia @ 2016-10-25 2:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024083654.GB30578@tiger>
> -----Original Message-----
> From: Shawn Guo [mailto:shawnguo at kernel.org]
> Sent: Monday, October 24, 2016 4:37 PM
> To: Troy Jia <hongtao.jia@nxp.com>
> Cc: rui.zhang at intel.com; edubezval at gmail.com; robh+dt at kernel.org; Scott Wood
> <scott.wood@nxp.com>; devicetree at vger.kernel.org; linuxppc-
> dev at lists.ozlabs.org; linux-kernel at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH V2 1/5] powerpc/mpc85xx: Update TMU device tree node for
> T1040/T1042
>
> On Sun, Oct 09, 2016 at 02:47:02PM +0800, Jia Hongtao wrote:
> > From: Hongtao Jia <hongtao.jia@nxp.com>
> >
> > SoC compatible string and endianness property are added according to
> > the new bindings.
>
> The commit log doesn't seem to match the actual changes. Same for patch 2/5.
Right. I just revise the log and sent a new version. Please help to review.
Thanks.
-Hongtao.
>
> >
> > Signed-off-by: Jia Hongtao <hongtao.jia@nxp.com>
> > ---
> > Changes for V2:
> > * Rebase on latest linux-next tree (next-20161006).
> >
> > arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
> > b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
> > index 44e399b..145c7f4 100644
> > --- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
> > +++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
> > @@ -526,7 +526,7 @@
> >
> > 0x00030000 0x00000012
> > 0x00030001 0x0000001d>;
> > - #thermal-sensor-cells = <0>;
> > + #thermal-sensor-cells = <1>;
> > };
> >
> > thermal-zones {
> > @@ -534,7 +534,7 @@
> > polling-delay-passive = <1000>;
> > polling-delay = <5000>;
> >
> > - thermal-sensors = <&tmu>;
> > + thermal-sensors = <&tmu 2>;
> >
> > trips {
> > cpu_alert: cpu-alert {
> > --
> > 2.1.0.27.g96db324
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH V7 2/6] thermal: bcm2835: add thermal driver for bcm2835 soc
From: Zhang Rui @ 2016-10-25 2:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1190898538.120930.02d69662-0b1a-447d-9c29-782aec7a1189.open-xchange@email.1und1.de>
On Mon, 2016-10-24 at 20:25 +0200, Stefan Wahren wrote:
> >
> > Eric Anholt <eric@anholt.net> hat am 24. Oktober 2016 um 18:38
> > geschrieben:
> >
> >
> > Stefan Wahren <stefan.wahren@i2se.com> writes:
> >
> > >
> > > Hi Martin,
> > >
> > > Am 28.09.2016 um 23:10 schrieb Eric Anholt:
> > > >
> > > > kernel at martin.sperl.org writes:
> > > >
> > > > >
> > > > > From: Martin Sperl <kernel@martin.sperl.org>
> > > > >
> > > > > Add basic thermal driver for bcm2835 SOC.
> > > > >
> > > > > This driver currently relies on the firmware setting up the
> > > > > tsense HW block and does not set it up itself.
> > > > >
> > > > > Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
> > > > > Acked-by: Eric Anholt <eric@anholt.net>
> > > > > Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
> > > > What's the status of merging this one???I'd like to merge the
> > > > other
> > > > patches.
> > > i think it's necessary to rebase the whole series. Maybe we could
> > > get it
> > > into 4.10.
> > Why would it need to be rebased???The status, as far as I know, is
> > that
> > we're still waiting for the subsystem maintainer to respond.
> Since at least this patch won't apply anymore, but feedback from
> maintainer is
> still good :-)
>
> Sorry for this impatience, but i'm afraid that we possibly miss 4.10.
Eduardo,
any comments on this patchset?
thanks,
rui
^ permalink raw reply
* [PATCH/RFT v2 07/17] ARM: davinci: da8xx: Enable the usb20 "per" clk on phy_clk_enable
From: David Lechner @ 2016-10-25 2:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-8-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> While probing ochi phy with usb20 phy as a parent clock for usb11_phy,
> the usb20_phy clock enable would time out. This is because the usb20
> module clock needs to enabled while trying to lock the usb20_phy PLL.
>
> Call clk enable and get for the usb20 peripheral before trying to
> enable the phy PLL.
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
This patch can be combined with "ARM: davinci: da8xx: add usb phy
clocks" since that patch has not been merged yet.
If you like, I can resubmit my patches from this series along with the
changes from this patch.
^ permalink raw reply
* [PATCH 5/5] ARM: dts: Add LEGO MINDSTORTMS EV3 dts
From: David Lechner @ 2016-10-25 2:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1593441f-d147-4c91-8aab-8622dd8ced19@lechnology.com>
On 10/24/2016 10:50 AM, David Lechner wrote:
> On 10/24/2016 06:58 AM, Sekhar Nori wrote:
>> On Saturday 22 October 2016 12:06 AM, David Lechner wrote:
>>> +};
>>> +
>>> +&spi1 {
>>> + status = "okay";
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&spi1_pins>, <&spi1_cs0_pin>;
>>> +
>>> + /* TODO: LCD Display goes here */
>>
>> Add this node when you actually have display working.
>
> What if we set this up as a spidev node instead? This way the display
> could be used from userspace without a driver.
>
To answer my own question, it seems that specifying "spidev" in
devicetree is frowned upon since it does not "describe the hardware".
^ permalink raw reply
* [PATCH 0/2] to support memblock near alloc and memoryless on arm64
From: Zhen Lei @ 2016-10-25 2:59 UTC (permalink / raw)
To: linux-arm-kernel
If HAVE_MEMORYLESS_NODES is selected, and some memoryless numa nodes are
actually exist. The percpu variable areas and numa control blocks of that
memoryless numa nodes need to be allocated from the nearest available
node to improve performance.
In the beginning, I added a new function:
phys_addr_t __init memblock_alloc_near_nid(phys_addr_t size, phys_addr_t align, int nid);
But it can not replace memblock_virt_alloc_try_nid, because the latter can specify a min_addr,
it usually be assigned as __pa(MAX_DMA_ADDRESS), to prevent memory be allocated from DMA area.
It's bad to add another function, because the code will be duplicated in these two functions.
So I make memblock_alloc_near_nid to be called in the subfunctions of memblock_alloc_try_nid
and memblock_virt_alloc_try_nid. Add a macro node_distance_ready to distinguish different
situations:
1) By default, the value of node_distance_ready is zero, memblock_*_try_nid work as normal as before.
2) ARCH platforms set the value of node_distance_ready to be true when numa node distances are ready, (please refer patch 2)
memblock_*_try_nid allocate memory from the nearest node relative to the specified node.
Zhen Lei (2):
mm/memblock: prepare a capability to support memblock near alloc
arm64/numa: support HAVE_MEMORYLESS_NODES
arch/arm64/Kconfig | 4 +++
arch/arm64/include/asm/numa.h | 3 ++
arch/arm64/mm/numa.c | 6 +++-
mm/memblock.c | 76 ++++++++++++++++++++++++++++++++++++-------
4 files changed, 77 insertions(+), 12 deletions(-)
--
2.5.0
^ permalink raw reply
* [PATCH 1/2] mm/memblock: prepare a capability to support memblock near alloc
From: Zhen Lei @ 2016-10-25 2:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477364358-10620-1-git-send-email-thunder.leizhen@huawei.com>
If HAVE_MEMORYLESS_NODES is selected, and some memoryless numa nodes are
actually exist. The percpu variable areas and numa control blocks of that
memoryless numa nodes need to be allocated from the nearest available
node to improve performance.
Although memblock_alloc_try_nid and memblock_virt_alloc_try_nid try the
specified nid at the first time, but if that allocation failed it will
directly drop to use NUMA_NO_NODE. This mean any nodes maybe possible at
the second time.
To compatible the above old scene, I use a marco node_distance_ready to
control it. By default, the marco node_distance_ready is not defined in
any platforms, the above mentioned functions will work as normal as
before. Otherwise, they will try the nearest node first.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
mm/memblock.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 65 insertions(+), 11 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 7608bc3..556bbd2 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1213,9 +1213,71 @@ phys_addr_t __init memblock_alloc(phys_addr_t size, phys_addr_t align)
return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
}
+#ifndef node_distance_ready
+#define node_distance_ready() 0
+#endif
+
+static phys_addr_t __init memblock_alloc_near_nid(phys_addr_t size,
+ phys_addr_t align, phys_addr_t start,
+ phys_addr_t end, int nid, ulong flags,
+ int alloc_func_type)
+{
+ int nnid, round = 0;
+ u64 pa;
+ DECLARE_BITMAP(nodes_map, MAX_NUMNODES);
+
+ bitmap_zero(nodes_map, MAX_NUMNODES);
+
+again:
+ /*
+ * There are total 4 cases:
+ * <nid == NUMA_NO_NODE>
+ * 1)2) node_distance_ready || !node_distance_ready
+ * Round 1, nnid = nid = NUMA_NO_NODE;
+ * <nid != NUMA_NO_NODE>
+ * 3) !node_distance_ready
+ * Round 1, nnid = nid;
+ * ::Round 2, currently only applicable for alloc_func_type = <0>
+ * Round 2, nnid = NUMA_NO_NODE;
+ * 4) node_distance_ready
+ * Round 1, LOCAL_DISTANCE, nnid = nid;
+ * Round ?, nnid = nearest nid;
+ */
+ if (!node_distance_ready() || (nid == NUMA_NO_NODE)) {
+ nnid = (++round == 1) ? nid : NUMA_NO_NODE;
+ } else {
+ int i, distance = INT_MAX;
+
+ for_each_clear_bit(i, nodes_map, MAX_NUMNODES)
+ if (node_distance(nid, i) < distance) {
+ nnid = i;
+ distance = node_distance(nid, i);
+ }
+ }
+
+ switch (alloc_func_type) {
+ case 0:
+ pa = memblock_find_in_range_node(size, align, start, end, nnid, flags);
+ break;
+
+ case 1:
+ default:
+ pa = memblock_alloc_nid(size, align, nnid);
+ if (!node_distance_ready())
+ return pa;
+ }
+
+ if (!pa && (nnid != NUMA_NO_NODE)) {
+ bitmap_set(nodes_map, nnid, 1);
+ goto again;
+ }
+
+ return pa;
+}
+
phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid)
{
- phys_addr_t res = memblock_alloc_nid(size, align, nid);
+ phys_addr_t res = memblock_alloc_near_nid(size, align, 0, 0, nid, 0, 1);
if (res)
return res;
@@ -1276,19 +1338,11 @@ static void * __init memblock_virt_alloc_internal(
max_addr = memblock.current_limit;
again:
- alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
- nid, flags);
+ alloc = memblock_alloc_near_nid(size, align, min_addr, max_addr,
+ nid, flags, 0);
if (alloc)
goto done;
- if (nid != NUMA_NO_NODE) {
- alloc = memblock_find_in_range_node(size, align, min_addr,
- max_addr, NUMA_NO_NODE,
- flags);
- if (alloc)
- goto done;
- }
-
if (min_addr) {
min_addr = 0;
goto again;
--
2.5.0
^ permalink raw reply related
* [PATCH 2/2] arm64/numa: support HAVE_MEMORYLESS_NODES
From: Zhen Lei @ 2016-10-25 2:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477364358-10620-1-git-send-email-thunder.leizhen@huawei.com>
Some numa nodes may have no memory. For example:
1) a node has no memory bank plugged.
2) a node has no memory bank slots.
To ensure percpu variable areas and numa control blocks of the
memoryless numa nodes to be allocated from the nearest available node to
improve performance, defined node_distance_ready. And make its value to be
true immediately after node distances have been initialized.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
arch/arm64/Kconfig | 4 ++++
arch/arm64/include/asm/numa.h | 3 +++
arch/arm64/mm/numa.c | 6 +++++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 30398db..648dd13 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -609,6 +609,10 @@ config NEED_PER_CPU_EMBED_FIRST_CHUNK
def_bool y
depends on NUMA
+config HAVE_MEMORYLESS_NODES
+ def_bool y
+ depends on NUMA
+
source kernel/Kconfig.preempt
source kernel/Kconfig.hz
diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h
index 600887e..9d068bf 100644
--- a/arch/arm64/include/asm/numa.h
+++ b/arch/arm64/include/asm/numa.h
@@ -13,6 +13,9 @@
int __node_distance(int from, int to);
#define node_distance(a, b) __node_distance(a, b)
+extern int __initdata arch_node_distance_ready;
+#define node_distance_ready() arch_node_distance_ready
+
extern nodemask_t numa_nodes_parsed __initdata;
/* Mappings between node number and cpus on that node. */
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 9a71d06..5db9765 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -36,6 +36,7 @@ static int cpu_to_node_map[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE };
static int numa_distance_cnt;
static u8 *numa_distance;
static bool numa_off;
+int __initdata arch_node_distance_ready;
static __init int numa_parse_early_param(char *opt)
{
@@ -395,9 +396,12 @@ static int __init numa_init(int (*init_func)(void))
return -EINVAL;
}
+ arch_node_distance_ready = 1;
ret = numa_register_nodes();
- if (ret < 0)
+ if (ret < 0) {
+ arch_node_distance_ready = 0;
return ret;
+ }
setup_node_to_cpumask_map();
--
2.5.0
^ permalink raw reply related
* [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
From: Icenowy Zheng @ 2016-10-25 3:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024082802.ev72szwmuqba5ll4@lukather>
> On Mon, Oct 24, 2016 at 11:59:30AM +0800, Icenowy Zheng wrote:
>
>> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
>> The code that poke some unknown bit of PMU for H3/A64 didn't check
>> the PHY, and will cause kernel oops when PHY 0 is used.
>>
>> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
>>
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
>
> Cc'ing stable would be nice.
Yes... As it's also used by H3...
>
> Apart from that, Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
If I change it to check whether phy->pmu is null, will you keep the ACK?
>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
^ permalink raw reply
* [PATCH v2] hwrng: meson: Fix module autoload for OF registration
From: Herbert Xu @ 2016-10-25 3:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1476733877-20275-1-git-send-email-javier@osg.samsung.com>
On Mon, Oct 17, 2016 at 04:51:17PM -0300, Javier Martinez Canillas wrote:
> If the driver is built as a module, autoload won't work because the module
> alias information is not filled. So user-space can't match the registered
> device with the corresponding module.
>
> Export the module alias information using the MODULE_DEVICE_TABLE() macro.
>
> Before this patch:
>
> $ modinfo drivers/char/hw_random/meson-rng.ko | grep alias
> alias: platform:meson-rng
>
> After this patch:
>
> $ modinfo drivers/char/hw_random/meson-rng.ko | grep alias
> alias: platform:meson-rng
> alias: of:N*T*Camlogic,meson-rngC*
> alias: of:N*T*Camlogic,meson-rng
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* [PATCH] hwrng: meson: Remove unneeded platform MODULE_ALIAS
From: Herbert Xu @ 2016-10-25 3:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1476906618-14455-1-git-send-email-javier@osg.samsung.com>
On Wed, Oct 19, 2016 at 04:50:18PM -0300, Javier Martinez Canillas wrote:
> The Amlogic Meson is a DT-only platform, which means the devices are
> registered via OF and not using the legacy platform devices support.
>
> So there's no need to have a MODULE_ALIAS("platform:meson-rng") since
> the reported uevent MODALIAS to user-space will always be the OF one.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* [PATCH] ARM64: dts: bcm2835: Fix bcm2837 compatible string
From: Eric Anholt @ 2016-10-25 3:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477321791-7896-1-git-send-email-afaerber@suse.de>
e<#secure method=pgpmime mode=sign>
Andreas F?rber <afaerber@suse.de> writes:
> bcm2837-rpi-3-b.dts, its only in-tree user, was overriding it as
> "brcm,bcm2837" already.
Pulled to bcm2835-dt-64-next. Thanks!
^ permalink raw reply
* [PATCH 5/8] ARM: gr8: Add missing pwm channel 1 pin
From: Chen-Yu Tsai @ 2016-10-25 4:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161020170739.lgt2ywm346vm47zd@lukather>
On Fri, Oct 21, 2016 at 1:07 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Thu, Oct 20, 2016 at 10:10:03PM +0800, Chen-Yu Tsai wrote:
>> On Thu, Oct 20, 2016 at 4:12 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > The PWM controller has two different channels, but only the first pin was
>> > exposed in the DTSI. Add the other one.
>> >
>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>>
>> Acked-by: Chen-Yu Tsai <wens@csie.org>
>>
>> > ---
>> > arch/arm/boot/dts/ntc-gr8.dtsi | 7 +++++++
>> > 1 file changed, 7 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/arm/boot/dts/ntc-gr8.dtsi b/arch/arm/boot/dts/ntc-gr8.dtsi
>> > index 74aff795e723..fad7381630f3 100644
>> > --- a/arch/arm/boot/dts/ntc-gr8.dtsi
>> > +++ b/arch/arm/boot/dts/ntc-gr8.dtsi
>> > @@ -854,6 +854,13 @@
>> > allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
>> > };
>> >
>> > + pwm1_pins_a: pwm1 at 0 {
>>
>> Nit: really don't need "_a" and "@0" here.
>
> Fixed and applied.
Oops, you forgot to fix the label in the chip-pro dts:
DTC arch/arm/boot/dts/ntc-gr8-chip-pro.dtb
ERROR (phandle_references): Reference to non-existent node or label
"pwm1_pins_a"
ERROR: Input tree has errors, aborting (use -f to force output)
scripts/Makefile.lib:313: recipe for target
'arch/arm/boot/dts/ntc-gr8-chip-pro.dtb' failed
ChenYu
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox