Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: OCTEON: Add semaphore to serialize bootbus accesses.

Some hardware blocks attached to the OCTEON bootbus run asynchronously
to accesses from the CPUs. These include MMC/SD host, CF(when using
DMA), and NAND controller. A bus error, or corrupt data may occur if
a CPU is trying to access a bootbus connected device at the same time
the bus is running asynchronous operations.

To work around these problems we add this semaphore that must be
acquired before initiating bootbus activity. Subsequent patches will
add users for this.

Signed-off-by: David Daney <david.daney@cavium.com>
[aleksey.makarov@auriga.com: combine the patches]
Signed-off-by: Aleksey Makarov <aleksey.makarov@auriga.com>
Signed-off-by: Chandrakala Chavva <cchavva@caviumnetworks.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9459/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
24d4e7f6 8945e37e

+5
+3
arch/mips/cavium-octeon/setup.c
··· 51 51 52 52 static unsigned long long MAX_MEMORY = 512ull << 20; 53 53 54 + DEFINE_SEMAPHORE(octeon_bootbus_sem); 55 + EXPORT_SYMBOL(octeon_bootbus_sem); 56 + 54 57 struct octeon_boot_descriptor *octeon_boot_desc_ptr; 55 58 56 59 struct cvmx_bootinfo *octeon_bootinfo;
+2
arch/mips/include/asm/octeon/octeon.h
··· 335 335 336 336 extern void octeon_fixup_irqs(void); 337 337 338 + extern struct semaphore octeon_bootbus_sem; 339 + 338 340 #endif /* __ASM_OCTEON_OCTEON_H */