Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1463787
| From | Guenter Roeck <groeck@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: Problem with atomic accesses in pstore on some ARM CPUs |
| Date | 2016-08-16 15:30 +0200 |
| Message-ID | <s6MBj-3Dm-17@gated-at.bofh.it> (permalink) |
| References | <s6zkJ-3DX-1@gated-at.bofh.it> <s6JWN-1Uo-7@gated-at.bofh.it> <s6K6u-1XD-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Aug 16, 2016 at 3:45 AM, Will Deacon <will.deacon@arm.com> wrote:
> On Tue, Aug 16, 2016 at 11:32:04AM +0100, Robin Murphy wrote:
>> On 16/08/16 00:19, Guenter Roeck wrote:
>> > we are having a problem with atomic accesses in pstore on some ARM
>> > CPUs (specifically rk3288 and rk3399). With those chips, atomic
>> > accesses fail with both pgprot_noncached and pgprot_writecombine
>> > memory. Atomic accesses do work when selecting PAGE_KERNEL protection.
>>
>> What's the pstore backed by? I'm guessing it's not normal DRAM.
>
> Regardless, pgprot_noncached and pgprot_writecombine map to Device-nGnRnE
> and Normal-non-cacheable respectively, and so it's IMP DEP whether or not
> exclusives will work there.
>
>> > Debugging on rk3399 shows the following crash.
>> >
>> > [ 0.912669] Bad mode in Error handler detected, code 0xbf000002 -- SError
>> > [ 0.920140] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 4.4.14 #389
>> > [ 0.926838] Hardware name: Google Kevin (DT)
>> > [ 0.931533] task: ffffffc0edfe0000 ti: ffffffc0edf7c000 task.ti:
>> > ffffffc0edf 7c000
>> > [ 0.939780] PC is at __ll_sc___cmpxchg_case_mb_4+0x2c/0x5c
>> > [ 0.945811] LR is at 0x1
>> >
>> > The "solution" for this problem in various Chrome OS releases is to
>> > disable atomic accesses in pstore entirely, which seems to be a bit
>> > brute-force. Question is what a proper upstream-acceptable solution
>
> Why do you require atomics to the pstore? If you need to serialise updates
> from coherent observers (e.g. CPUs), is it acceptable to use a lock in
> normal memory instead?
>
Sure, this is just how pstore works today, and I would prefer not
having to hack upstream code. This is normal DRAM. The initialization
code does the following.
if (pfn_valid(start >> PAGE_SHIFT))
prz->vaddr = persistent_ram_vmap(start, size, memtype);
else
prz->vaddr = persistent_ram_iomap(start, size, memtype);
persistent_ram_vmap() uses atomics, persistent_ram_iomap() uses
spinlocks. For normal DRAM, pfn_valid() returns true.
Thanks,
Guenter
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Problem with atomic accesses in pstore on some ARM CPUs Guenter Roeck <groeck@google.com> - 2016-08-16 01:20 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Robin Murphy <robin.murphy@arm.com> - 2016-08-16 12:40 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Will Deacon <will.deacon@arm.com> - 2016-08-16 12:50 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Guenter Roeck <groeck@google.com> - 2016-08-16 15:30 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Guenter Roeck <groeck@google.com> - 2016-08-16 15:20 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Will Deacon <will.deacon@arm.com> - 2016-08-16 15:30 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Guenter Roeck <groeck@google.com> - 2016-08-16 17:20 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Mark Rutland <mark.rutland@arm.com> - 2016-08-16 19:30 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Colin Cross <ccross@android.com> - 2016-08-16 19:50 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Guenter Roeck <groeck@google.com> - 2016-08-16 22:30 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Kees Cook <keescook@chromium.org> - 2016-08-16 23:00 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Guenter Roeck <groeck@google.com> - 2016-08-17 02:30 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-08-19 11:40 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Guenter Roeck <groeck@google.com> - 2016-08-19 14:50 +0200
Re: Problem with atomic accesses in pstore on some ARM CPUs Arnd Bergmann <arnd@arndb.de> - 2016-08-22 23:10 +0200
csiph-web