spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls
wuxu.wu authored
[ Upstream commit 19b61392 ]

dw_spi_irq() and dw_spi_transfer_one concurrent calls.

I find a panic in dw_writer(): txw = *(u8 *)(dws->tx), when dw->tx==null,
dw->len==4, and dw->tx_end==1.

When tpm driver's message overtime dw_spi_irq() and dw_spi_transfer_one
may concurrent visit dw_spi, so I think dw_spi structure lack of protection.

Otherwise dw_spi_transfer_one set dw rx/tx buffer and then open irq,
store dw rx/tx instructions and other cores handle irq load dw rx/tx
instructions may out of order.

	[ 1025.321302] Call trace:
	...
	[ 1025.321319]  __crash_kexec+0x98/0x148
	[ 1025.321323]  panic+0x17c/0x314
	[ 1025.321329]  die+0x29c/0x2e8
	[ 1025.321334]  die_kernel_fault+0x68/0x78
	[ 1025.321337]  __do_kernel_fault+0x90/0xb0
	[ 1025.321346]  do_page_fault+0x88/0x500
	[ 1025.321347]  do_translation_fault+0xa8/0xb8
	[ 1025.321349]  do_mem_abort+0x68/0x118
	[ 1025.321351]  el1_da+0x20/0x8c
	[ 1025....
b56f2a4a
Name Last commit Last update
Documentation Documentation: Document arm64 kpti control
arch arc: eznps: fix allmodconfig kconfig warning
block block: don't use bio->bi_vcnt to figure out segment number
certs Replace magic for trusting the secondary keyring with #define
crypto crypto: tgr192 - fix unaligned memory access
drivers spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls
firmware Fix built-in early-load Intel microcode alignment
fs do_last(): fetch directory ->i_mode and ->i_uid before it's too late
include USB: serial: ir-usb: fix link-speed handling
init fork: fix some -Wmissing-prototypes warnings
ipc ipc/mqueue.c: only perform resource calculation if user valid
kernel irqdomain: Add the missing assignment of domain->fwnode for named fwnode
lib bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free()
mm mm/huge_memory.c: thp: fix conflict of above-47bit hint address and PMD alignment
net net/x25: fix nonblocking connect
samples samples: bpf: fix syscall_tp due to unused syscall
scripts ARM: 8950/1: ftrace/recordmcount: filter relocation types
security keys: Timestamp new keys
sound ASoC: sun4i-i2s: RX and TX counter registers are swapped
tools selftests/ipc: Fix msgque compiler warnings
usr kbuild: clean compressed initramfs image
virt KVM: arm/arm64: vgic: Don't rely on the wrong pending table
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.