Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-06 Thread Palmer Dabbelt
On Tue, 06 Jun 2017 01:54:23 PDT (-0700), Arnd Bergmann wrote: > On Tue, Jun 6, 2017 at 6:56 AM, Palmer Dabbelt wrote: >> On Thu, 01 Jun 2017 02:00:22 PDT (-0700), Arnd Bergmann wrote: >>> On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: On Tue,

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-06 Thread Palmer Dabbelt
On Tue, 06 Jun 2017 01:54:23 PDT (-0700), Arnd Bergmann wrote: > On Tue, Jun 6, 2017 at 6:56 AM, Palmer Dabbelt wrote: >> On Thu, 01 Jun 2017 02:00:22 PDT (-0700), Arnd Bergmann wrote: >>> On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-06 Thread Arnd Bergmann
On Tue, Jun 6, 2017 at 6:56 AM, Palmer Dabbelt wrote: > On Thu, 01 Jun 2017 02:00:22 PDT (-0700), Arnd Bergmann wrote: >> On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: >>> On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: On Tue,

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-06 Thread Arnd Bergmann
On Tue, Jun 6, 2017 at 6:56 AM, Palmer Dabbelt wrote: > On Thu, 01 Jun 2017 02:00:22 PDT (-0700), Arnd Bergmann wrote: >> On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: >>> On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-05 Thread Palmer Dabbelt
On Thu, 01 Jun 2017 02:00:22 PDT (-0700), Arnd Bergmann wrote: > On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: >> On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: >>> On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: > >

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-05 Thread Palmer Dabbelt
On Thu, 01 Jun 2017 02:00:22 PDT (-0700), Arnd Bergmann wrote: > On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: >> On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: >>> On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: > > +#ifndef _ASM_RISCV_CACHE_H +#define

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-02 Thread Palmer Dabbelt
On Tue, 23 May 2017 14:23:50 PDT (-0700), b...@kernel.crashing.org wrote: > On Tue, 2017-05-23 at 14:55 +0200, Arnd Bergmann wrote: >> > + >> > +#include >> >> I would recommend providing your own {read,write}{b,w,l,q}{,_relaxed} >> helpers using inline assembly, to prevent the compiler for

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-02 Thread Palmer Dabbelt
On Tue, 23 May 2017 14:23:50 PDT (-0700), b...@kernel.crashing.org wrote: > On Tue, 2017-05-23 at 14:55 +0200, Arnd Bergmann wrote: >> > + >> > +#include >> >> I would recommend providing your own {read,write}{b,w,l,q}{,_relaxed} >> helpers using inline assembly, to prevent the compiler for

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-01 Thread Arnd Bergmann
On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: > On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: >> On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: >>> +#ifndef _ASM_RISCV_CACHE_H >>> +#define _ASM_RISCV_CACHE_H >>> + >>>

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-06-01 Thread Arnd Bergmann
On Thu, Jun 1, 2017 at 2:56 AM, Palmer Dabbelt wrote: > On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: >> On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: >>> +#ifndef _ASM_RISCV_CACHE_H >>> +#define _ASM_RISCV_CACHE_H >>> + >>> +#define L1_CACHE_SHIFT 6 >>> + >>>

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-05-31 Thread Palmer Dabbelt
On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: > On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: >> +/** >> + * atomic_read - read atomic variable >> + * @v: pointer of type atomic_t >> + * >> + * Atomically reads the value of @v. >> + */ >> +static

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-05-31 Thread Palmer Dabbelt
On Tue, 23 May 2017 05:55:15 PDT (-0700), Arnd Bergmann wrote: > On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: >> +/** >> + * atomic_read - read atomic variable >> + * @v: pointer of type atomic_t >> + * >> + * Atomically reads the value of @v. >> + */ >> +static inline int

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-05-23 Thread Benjamin Herrenschmidt
On Tue, 2017-05-23 at 14:55 +0200, Arnd Bergmann wrote: > > + > > +#include > > I would recommend providing your own {read,write}{b,w,l,q}{,_relaxed} > helpers using inline assembly, to prevent the compiler for breaking > up accesses into byte accesses. > > Also, most architectures require to

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-05-23 Thread Benjamin Herrenschmidt
On Tue, 2017-05-23 at 14:55 +0200, Arnd Bergmann wrote: > > + > > +#include > > I would recommend providing your own {read,write}{b,w,l,q}{,_relaxed} > helpers using inline assembly, to prevent the compiler for breaking > up accesses into byte accesses. > > Also, most architectures require to

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-05-23 Thread Arnd Bergmann
On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: > +/** > + * atomic_read - read atomic variable > + * @v: pointer of type atomic_t > + * > + * Atomically reads the value of @v. > + */ > +static inline int atomic_read(const atomic_t *v) > +{ > + return *((volatile

Re: [PATCH 4/7] RISC-V: arch/riscv/include

2017-05-23 Thread Arnd Bergmann
On Tue, May 23, 2017 at 2:41 AM, Palmer Dabbelt wrote: > +/** > + * atomic_read - read atomic variable > + * @v: pointer of type atomic_t > + * > + * Atomically reads the value of @v. > + */ > +static inline int atomic_read(const atomic_t *v) > +{ > + return *((volatile int