pstore/ram: avoid atomic accesses for ioremapped regions
authorRob Herring <rob.herring@calxeda.com>
Tue, 9 Apr 2013 01:23:33 +0000 (20:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Feb 2015 06:35:40 +0000 (22:35 -0800)
commit681f57171b9614a11695facba99ed299f7f33dc7
tree5693329d094f2d84b4cfacc8ec30fe4d4fc375d3
parent979d65e705225f8780c09ceb9b4cbc2cbdc36c6e
pstore/ram: avoid atomic accesses for ioremapped regions

commit 0405a5cec3406f19e69da07c8111a6bf1088ac29 upstream.

For persistent RAM outside of main memory, the memory may have limitations
on supported accesses. For internal RAM on highbank platform exclusive
accesses are not supported and will hang the system. So atomic_cmpxchg
cannot be used. This commit uses spinlock protection for buffer size and
start updates on ioremapped regions instead.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
[hkp: Backported to 3.10: adjust context]
Signed-off-by: HuKeping <hukeping@huawei.com>
fs/pstore/ram_core.c