kernel_samsung_a53x/drivers
Adrian Hunter 94e1fafb53 mmc: sdhci: Do not invert write-protect twice
commit fbd64f902b93fe9658b855b9892ae59ef6ea22b9 upstream.

mmc_of_parse() reads device property "wp-inverted" and sets
MMC_CAP2_RO_ACTIVE_HIGH if it is true. MMC_CAP2_RO_ACTIVE_HIGH is used
to invert a write-protect (AKA read-only) GPIO value.

sdhci_get_property() also reads "wp-inverted" and sets
SDHCI_QUIRK_INVERTED_WRITE_PROTECT which is used to invert the
write-protect value as well but also acts upon a value read out from the
SDHCI_PRESENT_STATE register.

Many drivers call both mmc_of_parse() and sdhci_get_property(),
so that both MMC_CAP2_RO_ACTIVE_HIGH and
SDHCI_QUIRK_INVERTED_WRITE_PROTECT will be set if the controller has
device property "wp-inverted".

Amend the logic in sdhci_check_ro() to allow for that possibility,
so that the write-protect value is not inverted twice.

Also do not invert the value if it is a negative error value. Note that
callers treat an error the same as not-write-protected, so the result is
functionally the same in that case.

Also do not invert the value if sdhci host operation ->get_ro() is used.
None of the users of that callback set SDHCI_QUIRK_INVERTED_WRITE_PROTECT
directly or indirectly, but two do call mmc_gpio_get_ro(), so leave it to
them to deal with that if they ever set SDHCI_QUIRK_INVERTED_WRITE_PROTECT
in the future.

Fixes: 6d5cd068ee59 ("mmc: sdhci: use WP GPIO in sdhci_check_ro()")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240614080051.4005-2-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 14:19:33 +01:00
..
accessibility speakup: Fix sizeof() vs ARRAY_SIZE() bug 2024-11-19 12:26:51 +01:00
acpi ACPI: x86: Force StorageD3Enable on more products 2024-11-19 14:19:30 +01:00
amba Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
android binder: check offset alignment in binder_get_object() 2024-11-19 11:32:22 +01:00
ata ata: pata_legacy: make legacy_exit() work again 2024-11-19 12:27:13 +01:00
atm
auxdisplay Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
base drivers: core: synchronize really_probe() and dev_uevent() 2024-11-19 14:19:04 +01:00
battery
bcma
block null_blk: Print correct max open zones limit in null_init_zoned_dev() 2024-11-19 14:19:00 +01:00
bluetooth Bluetooth: ath3k: Fix multiple issues reported by checkpatch.pl 2024-11-19 14:19:06 +01:00
bts Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bus
cdrom Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
char ppdev: Add an error check in register_device 2024-11-19 12:27:04 +01:00
clk clk: qcom: mmcc-msm8998: fix venus clock issue 2024-11-19 12:26:59 +01:00
clocksource
connector Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
counter
cpufreq cpufreq: exit() callback is optional 2024-11-19 12:26:54 +01:00
cpuidle Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak 2024-11-19 12:27:18 +01:00
dax
dca Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
devfreq
dio
dma dmaengine: ioatdma: Fix missing kmem_cache_destroy() 2024-11-19 14:19:09 +01:00
dma-buf dma-buf/sw-sync: don't enable IRQ from sync_print_obj() 2024-11-19 12:27:10 +01:00
edac
eisa
extcon extcon: max8997: select IRQ_DOMAIN instead of depending on it 2024-11-19 12:27:04 +01:00
fingerprint
firewire
firmware firmware: dmi-id: add a release callback function 2024-11-19 12:27:01 +01:00
fpga fpga: region: add owner module and take its refcount 2024-11-19 12:27:04 +01:00
fsi
gnss Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gpio gpiolib: cdev: Disallow reconfiguration without direction (uAPI v1) 2024-11-19 14:19:33 +01:00
gpu drm/panel: simple: Add missing display timing flags for KOE TX26D202VM0BWA 2024-11-19 14:19:32 +01:00
greybus greybus: Fix use-after-free bug in gb_interface_release due to race condition. 2024-11-19 14:19:05 +01:00
gud Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hid HID: Add quirk for Logitech Casa touchpad 2024-11-19 14:19:06 +01:00
hsi
hv
hwmon hwmon: (shtc1) Fix property misspelling 2024-11-19 12:27:11 +01:00
hwspinlock Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hwtracing intel_th: pci: Add Lunar Lake support 2024-11-19 14:19:05 +01:00
i2c i2c: ocores: set IACK bit after core is enabled 2024-11-19 14:19:10 +01:00
i3c
ide
idle
ifconn Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iio iio: imu: inv_icm42600: delete unneeded update watermark call 2024-11-19 14:19:04 +01:00
infiniband RDMA/mlx5: Add check for srq max_sge attribute 2024-11-19 14:19:09 +01:00
input Input: ili210x - fix ili251x_read_touch_data() return value 2024-11-19 14:19:30 +01:00
interconnect interconnect: Treat xlate() returning NULL node as an error 2024-11-18 12:12:00 +01:00
iommu iommu/arm-smmu-v3: Free MSIs in case of ENOMEM 2024-11-19 14:19:07 +01:00
ipack Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irqchip irqchip/loongson-pch-msi: Fix off-by-one on allocation error path 2024-11-19 12:26:54 +01:00
isdn
kperfmon Kperfmon: add xyunbound version 2024-06-15 16:28:49 -03:00
kq/mesh
leds
lightnvm
macintosh macintosh/via-macii: Fix "BUG: sleeping function called from invalid context" 2024-11-19 12:26:55 +01:00
mailbox mailbox: imx: fix suspend failue 2024-11-19 11:32:20 +01:00
mcb mcb: fix error handling for different scenarios when parsing 2024-11-18 11:43:25 +01:00
md bcache: fix variable length array abuse in btree_iter 2024-11-19 14:19:29 +01:00
media media: dvbdev: Initialize sbuf 2024-11-19 14:19:32 +01:00
memory
memstick Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
message Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mfd
misc vmci: prevent speculation leaks by sanitizing event in event_deliver() 2024-11-19 14:19:04 +01:00
mmc mmc: sdhci: Do not invert write-protect twice 2024-11-19 14:19:33 +01:00
most
mtd mtd: partitions: redboot: Added conversion of operands to a larger type 2024-11-19 14:19:32 +01:00
muic
mux Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
net net/dpaa2: Avoid explicit cpumask var allocation on stack 2024-11-19 14:19:32 +01:00
nfc
ntb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nubus
nvdimm
nvme nvmet: fix ns enable/disable possible hang 2024-11-19 12:27:10 +01:00
nvmem
of of: dynamic: Synchronize of_changeset_destroy() with the devlink removals 2024-11-19 09:23:10 +01:00
opp
oprofile
parisc
parport parport: parport_serial: Add Brainboxes device IDs and geometry 2024-11-18 12:12:19 +01:00
pci PCI/PM: Avoid D3cold for HP Pavilion 17 PC/1972 PCIe Ports 2024-11-19 14:19:07 +01:00
pcmcia
perf
phy
pinctrl pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set 2024-11-19 14:19:31 +01:00
platform
pnp PNP: ACPI: fix fortify warning 2024-11-18 12:13:09 +01:00
power power: supply: cros_usbpd: provide ID table for avoiding fallback match 2024-11-19 14:19:07 +01:00
powercap Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pps Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ps3 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ptp ptp: Fix error message on failed pin verification 2024-11-19 14:19:01 +01:00
pwm
rapidio
ras Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
regulator regulator: core: Fix modpost error "regulator_get_regmap" undefined 2024-11-19 14:19:09 +01:00
remoteproc remoteproc: k3-r5: Jump to error handling labels in start/stop errors 2024-11-19 14:19:05 +01:00
reset reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning 2024-11-18 12:12:16 +01:00
rpmsg rpmsg: virtio: Free driver_override when rpmsg_remove() 2024-11-18 12:12:56 +01:00
rtc rtc: mt6397: select IRQ_DOMAIN instead of depending on it 2024-11-19 08:44:58 +01:00
s390 s390/ap: Fix crash in AP internal function modify_bitmap() 2024-11-19 12:27:19 +01:00
samsung
sbus Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scsi scsi: qedi: Fix crash while reading debugfs attribute 2024-11-19 14:19:06 +01:00
sensorhub
sensors
sfi
sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
siox
slimbus
soc soc: ti: wkup_m3_ipc: Send NULL dummy message instead of pointer message 2024-11-19 14:19:32 +01:00
soundwire soundwire: cadence: fix invalid PDI offset 2024-11-19 12:27:00 +01:00
spi spi: stm32: Don't warn about spurious interrupts 2024-11-19 12:27:10 +01:00
spmi
spu_verify
ssb
staging spmi: hisi-spmi-controller: Do not override device identifier 2024-11-19 14:19:29 +01:00
sti Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target
tc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tee
thermal
thunderbolt
tty serial: exar: adding missing CTI and Exar PCI ids 2024-11-19 14:19:07 +01:00
uh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uio
usb usb: misc: uss720: check for incompatible versions of the Belkin F5U002 2024-11-19 14:19:07 +01:00
vdpa
vfio vfio/fsl-mc: Block calling interrupt handler without trigger 2024-11-19 09:22:45 +01:00
vhost
vibrator
video fbdev: savage: Handle err return when savagefb_check_var failed 2024-11-19 12:27:18 +01:00
virt
virtio virtio: delete vq in vp_find_vqs_msix() when request_irq() fails 2024-11-19 12:27:09 +01:00
vision Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vision3 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
visorbus
vlynq Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vme Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
w1
watchdog watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate a safety margin 2024-11-19 12:27:18 +01:00
xen
zorro Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig drivers: add stub kperfmon 2024-06-15 16:28:49 -03:00
Kconfig.variant1
Makefile
Makefile.variant1