MIPS: c-r4k: Fix Loongson-3's vcache/scache waysize calculation
authorHuacai Chen <chenhc@lemote.com>
Thu, 16 Mar 2017 13:00:29 +0000 (21:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:41:15 +0000 (12:41 +0200)
commitbe56f92cc0a9868c2eab776250abeba5b5c21d77
treeb8745b3f402997910d1b22bf0945716e55cba9ff
parent59b8725f2b1e7e3c5529b0995d0201026f47de2d
MIPS: c-r4k: Fix Loongson-3's vcache/scache waysize calculation

commit 0be032c190abcdcfa948082b6a1e0d461184ba4d upstream.

If scache.waysize is 0, r4k___flush_cache_all() will do nothing and
then cause bugs. BTW, though vcache.waysize isn't being used by now,
we also fix its calculation.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15756/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/mm/c-r4k.c