Unverified Commit 57846467 authored by Mark Brown's avatar Mark Brown
Browse files

spi: sun6i: fix RX data corruption in DMA mode

Merge series from Tobias Schramm <t.schramm@manjaro.org>:

This set of patches fixes two bugs in the sun6i SPI driver that result in
corruption of received data in DMA RX mode.

The first bug seems to be related to an incompatibility of the SPI RX FIFO
with wider than single byte read accesses during SPI transfers. I'm not
sure if this bug affects all types of SPI controllers found in Allwinner
SoCs supported by this driver. However reducing the access width should
always be safe. I've tested this change on a V3s SoC. Further testing to
narrow down the set of affected SoCs in the future would be welcome.

The second bug is a race between SPI RX DMA and FIFO drain logic for
interrupt-based SPI operation. This bug affects all SPI controllers
supported by this driver. Once again this change has been tested on the
Allwinner V3s SoC.
parents 60ea3db3 1f11f420
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -538,6 +538,8 @@ Shuah Khan <shuah@kernel.org> <shuah.kh@samsung.com>
Sibi Sankar <quic_sibis@quicinc.com> <sibis@codeaurora.org>
Sid Manning <quic_sidneym@quicinc.com> <sidneym@codeaurora.org>
Simon Arlott <simon@octiron.net> <simon@fire.lp0.eu>
Simon Horman <horms@kernel.org> <simon.horman@corigine.com>
Simon Horman <horms@kernel.org> <simon.horman@netronome.com>
Simon Kelley <simon@thekelleys.org.uk>
Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
Srinivas Ramana <quic_sramana@quicinc.com> <sramana@codeaurora.org>
+10 −10
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Description:
		Specifies the duration of the LED blink in milliseconds.
		Defaults to 50 ms.

		With hw_control ON, the interval value MUST be set to the
		When offloaded is true, the interval value MUST be set to the
		default value and cannot be changed.
		Trying to set any value in this specific mode will return
		an EINVAL error.
@@ -44,8 +44,8 @@ Description:
		If set to 1, the LED will blink for the milliseconds specified
		in interval to signal transmission.

		With hw_control ON, the blink interval is controlled by hardware
		and won't reflect the value set in interval.
		When offloaded is true, the blink interval is controlled by
		hardware and won't reflect the value set in interval.

What:		/sys/class/leds/<led>/rx
Date:		Dec 2017
@@ -59,21 +59,21 @@ Description:
		If set to 1, the LED will blink for the milliseconds specified
		in interval to signal reception.

		With hw_control ON, the blink interval is controlled by hardware
		and won't reflect the value set in interval.
		When offloaded is true, the blink interval is controlled by
		hardware and won't reflect the value set in interval.

What:		/sys/class/leds/<led>/hw_control
What:		/sys/class/leds/<led>/offloaded
Date:		Jun 2023
KernelVersion:	6.5
Contact:	linux-leds@vger.kernel.org
Description:
		Communicate whether the LED trigger modes are driven by hardware
		or software fallback is used.
		Communicate whether the LED trigger modes are offloaded to
		hardware or whether software fallback is used.

		If 0, the LED is using software fallback to blink.

		If 1, the LED is using hardware control to blink and signal the
		requested modes.
		If 1, the LED blinking in requested mode is offloaded to
		hardware.

What:		/sys/class/leds/<led>/link_10
Date:		Jun 2023
+2 −2
Original line number Diff line number Diff line
@@ -141,8 +141,8 @@ sequence.
To ensure the safety of this mitigation, the kernel must ensure that the
safe return sequence is itself free from attacker interference.  In Zen3
and Zen4, this is accomplished by creating a BTB alias between the
untraining function srso_untrain_ret_alias() and the safe return
function srso_safe_ret_alias() which results in evicting a potentially
untraining function srso_alias_untrain_ret() and the safe return
function srso_alias_safe_ret() which results in evicting a potentially
poisoned BTB entry and using that safe one for all function returns.

In older Zen1 and Zen2, this is accomplished using a reinterpretation
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ $defs:
                emac0_mdc, emac0_mdio, emac0_ptp_aux, emac0_ptp_pps, emac1_mcg0,
                emac1_mcg1, emac1_mcg2, emac1_mcg3, emac1_mdc, emac1_mdio,
                emac1_ptp_aux, emac1_ptp_pps, gcc_gp1, gcc_gp2, gcc_gp3,
                gcc_gp4, gcc_gp5, hs0_mi2s, hs1_mi2s, hs2_mi2s, ibi_i3c,
                gcc_gp4, gcc_gp5, gpio, hs0_mi2s, hs1_mi2s, hs2_mi2s, ibi_i3c,
                jitter_bist, mdp0_vsync0, mdp0_vsync1, mdp0_vsync2, mdp0_vsync3,
                mdp0_vsync4, mdp0_vsync5, mdp0_vsync6, mdp0_vsync7, mdp0_vsync8,
                mdp1_vsync0, mdp1_vsync1, mdp1_vsync2, mdp1_vsync3, mdp1_vsync4,
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ driver model device node, and its I2C address.
	},

	.id_table	= foo_idtable,
	.probe_new	= foo_probe,
	.probe		= foo_probe,
	.remove		= foo_remove,
	/* if device autodetection is needed: */
	.class		= I2C_CLASS_SOMETHING,
Loading