linux-stable/drivers
Frieder Schrempf fa927284cb spi: spi-imx: Fix spi_bus_clk if requested clock is higher than input clock
commit db2d2dc9a0 upstream.

In case the requested bus clock is higher than the input clock, the correct
dividers (pre = 0, post = 0) are returned from mx51_ecspi_clkdiv(), but
*fres is left uninitialized and therefore contains an arbitrary value.

This causes trouble for the recently introduced PIO polling feature as the
value in spi_imx->spi_bus_clk is used there to calculate for which
transfers to enable PIO polling.

Fix this by setting *fres even if no clock dividers are in use.

This issue was observed on Kontron BL i.MX8MM with an SPI peripheral clock set
to 50 MHz by default and a requested SPI bus clock of 80 MHz for the SPI NOR
flash.

With the fix applied the debug message from mx51_ecspi_clkdiv() now prints the
following:

spi_imx 30820000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 50000000,
post: 0, pre: 0

Fixes: 6fd8b8503a ("spi: spi-imx: Fix out-of-order CS/SCLK operation at low speeds")
Fixes: 07e7593877 ("spi: spi-imx: add PIO polling support")
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: David Jander <david@protonic.nl>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Marek Vasut <marex@denx.de>
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20221115181002.2068270-1-frieder@fris.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-02 17:43:11 +01:00
..
accessibility speakup: replace utils' u_char with unsigned char 2022-11-26 09:27:45 +01:00
acpi ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 2022-12-02 17:43:00 +01:00
amba
android binder: validate alloc->mm in ->mmap() handler 2022-12-02 17:42:59 +01:00
ata ata: libata-core: do not issue non-internal commands once EH is pending 2022-11-26 09:27:33 +01:00
atm
auxdisplay
base PM: domains: Fix handling of unavailable/disabled idle states 2022-11-04 00:00:32 +09:00
bcma
block drbd: use after free in drbd_create_device() 2022-11-26 09:27:37 +01:00
bluetooth Bluetooth: virtio_bt: Use skb_put to set length 2022-11-10 18:17:21 +01:00
bus bus: ixp4xx: Don't touch bit 7 on IXP42x 2022-12-02 17:43:11 +01:00
cdrom
char hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax() 2022-11-10 18:17:24 +01:00
clk clk: renesas: r8a779g0: Add SASYNCPER clocks 2022-11-10 18:17:30 +01:00
clocksource
comedi
connector
counter counter: 104-quad-8: Fix race getting function mode and direction 2022-11-04 00:00:23 +09:00
cpufreq cpufreq: amd-pstate: cpufreq: amd-pstate: reset MSR_AMD_PERF_CTL register at init 2022-12-02 17:43:11 +01:00
cpuidle
crypto
cxl cxl/pmem: Use size_add() against integer overflow 2022-11-26 09:27:21 +01:00
dax
dca
devfreq
dio
dma dmaengine: at_hdmac: Check return code of dma_async_device_register 2022-11-16 10:04:14 +01:00
dma-buf dma-buf: Use dma_fence_unwrap_for_each when importing fences 2022-12-02 17:43:10 +01:00
edac
eisa
extcon
firewire
firmware firmware: coreboot: Register bus in module init 2022-11-26 09:27:50 +01:00
fpga
fsi
gnss
gpio
gpu drm/i915: Fix warn in intel_display_power_*_domain() functions 2022-12-02 17:43:05 +01:00
greybus
hid HID: hyperv: fix possible memory leak in mousevsc_probe() 2022-11-16 10:03:52 +01:00
hsi
hte
hv Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:43:06 +01:00
hwmon
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 10:03:50 +01:00
hwtracing coresight: cti: Fix hang in cti_disable_hw() 2022-11-04 00:00:22 +09:00
i2c i2c: i801: add lis3lv02d's I2C address for Vostro 5568 2022-11-26 09:27:19 +01:00
i3c
idle
iio iio: accel: bma400: Fix memory leak in bma400_get_steps_reg() 2022-12-02 17:43:10 +01:00
infiniband RDMA/efa: Add EFA 0xefa2 PCI ID 2022-11-26 09:27:18 +01:00
input Input: i8042 - fix leaking of platform device on module removal 2022-11-26 09:27:54 +01:00
interconnect
iommu iommu/vt-d: Set SRE bit only when hardware has SRS cap 2022-11-26 09:27:50 +01:00
ipack
irqchip
isdn mISDN: fix misuse of put_device() in mISDN_register_device() 2022-11-26 09:27:35 +01:00
leds
macintosh
mailbox
mcb
md dm ioctl: fix misbehavior if list_versions races with module loading 2022-11-26 09:27:48 +01:00
media media: platform: cros-ec: Add Kuldax to the match table 2022-11-10 18:17:23 +01:00
memory
memstick
message
mfd
misc misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() 2022-11-26 09:27:51 +01:00
mmc mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() 2022-11-26 09:27:50 +01:00
most
mtd mtd: onenand: omap2: add dependency on GPMC 2022-11-26 09:27:28 +01:00
mux
net can: gs_usb: remove dma allocations 2022-12-02 17:43:09 +01:00
nfc nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION 2022-12-02 17:43:09 +01:00
ntb
nubus
nvdimm
nvme nvmet: fix memory leak in nvmet_subsys_attr_model_store_locked 2022-12-02 17:43:01 +01:00
nvmem
of
opp
parisc parisc: Export iosapic_serial_irq() symbol for serial port driver 2022-11-10 18:17:35 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-26 09:27:30 +01:00
pci PCI: hv: Only reuse existing IRTE allocation for Multi-MSI 2022-12-02 17:43:03 +01:00
pcmcia
peci
perf
phy phy: qcom-qmp-combo: fix NULL-deref on runtime resume 2022-11-16 10:04:09 +01:00
pinctrl pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map 2022-11-26 09:27:31 +01:00
platform platform/x86/intel/hid: Add some ACPI device IDs 2022-12-02 17:43:00 +01:00
pnp
power power: supply: ab8500: Defer thermal zone probe 2022-12-02 17:43:02 +01:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: twl6030: re-add TWL6032_SUBCLASS 2022-12-02 17:43:07 +01:00
remoteproc
reset
rpmsg
rtc
s390 s390/dasd: fix no record found for raw_track_access 2022-12-02 17:43:08 +01:00
sbus
scsi scsi: storvsc: Fix handling of srb_status and capacity change events 2022-12-02 17:43:02 +01:00
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-26 09:27:30 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-26 09:27:45 +01:00
soc soc: imx8m: Enable OCOTP clock before reading the register 2022-11-26 09:27:34 +01:00
soundwire soundwire: qcom: check for outanding writes before doing a read 2022-11-16 10:03:50 +01:00
spi spi: spi-imx: Fix spi_bus_clk if requested clock is higher than input clock 2022-12-02 17:43:11 +01:00
spmi
ssb
staging media: hantro: HEVC: Fix chroma offset computation 2022-11-10 18:17:24 +01:00
target scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-26 09:27:53 +01:00
tc
tee tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:43:03 +01:00
thermal
thunderbolt thunderbolt: Add DP OUT resource when DP tunnel is discovered 2022-11-16 10:03:48 +01:00
tty serial: 8250_lpss: Use 16B DMA burst with Elkhart Lake 2022-11-26 09:27:48 +01:00
ufs
uio
usb usb: cdnsp: fix issue with ZLP - added TD_SIZE = 1 2022-12-02 17:43:10 +01:00
vdpa
vfio vfio: Split the register_device ops call into functions 2022-11-26 09:27:52 +01:00
vhost
video fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() 2022-11-04 00:00:24 +09:00
virt virt/sev-guest: Prevent IV reuse in the SNP guest driver 2022-12-02 17:43:10 +01:00
virtio
vlynq
w1
watchdog
xen xen/pcpu: fix possible memory leak in register_pcpu() 2022-11-26 09:27:36 +01:00
zorro
Kconfig
Makefile