android_kernel_sony_sdm845/drivers
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hans de Goede e8b8ac3bc0 ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses
[ Upstream commit 009a789443fe4c8e6b1ecb7c16b4865c026184cd ]

The handling of PMIC register reads through writing 0 to address 4
of the OpRegion is wrong. Instead of returning the read value
through the value64, which is a no-op for function == ACPI_WRITE calls,
store the value and then on a subsequent function == ACPI_READ with
address == 3 (the address for the value field of the OpRegion)
return the stored value.

This has been tested on a Xiaomi Mi Pad 2 and makes the ACPI battery dev
there mostly functional (unfortunately there are still other issues).

Here are the SET() / GET() functions of the PMIC ACPI device,
which use this OpRegion, which clearly show the new behavior to
be correct:

OperationRegion (REGS, 0x8F, Zero, 0x50)
Field (REGS, ByteAcc, NoLock, Preserve)
{
    CLNT,   8,
    SA,     8,
    OFF,    8,
    VAL,    8,
    RWM,    8
}

Method (GET, 3, Serialized)
{
    If ((AVBE == One))
    {
        CLNT = Arg0
        SA = Arg1
        OFF = Arg2
        RWM = Zero
        If ((AVBG == One))
        {
            GPRW = Zero
        }
    }

    Return (VAL) /* \_SB_.PCI0.I2C7.PMI5.VAL_ */
}

Method (SET, 4, Serialized)
{
    If ((AVBE == One))
    {
        CLNT = Arg0
        SA = Arg1
        OFF = Arg2
        VAL = Arg3
        RWM = One
        If ((AVBG == One))
        {
            GPRW = One
        }
    }
}

Fixes: 0afa877a56 ("ACPI / PMIC: intel: add REGS operation region support")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-26 11:48:39 +01:00
..
accessibility
acpi ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses 2021-11-26 11:48:39 +01:00
amba ARM: 9120/1: Revert "amba: make use of -1 IRQs warn" 2021-11-12 13:18:01 +01:00
android binder: use cred instead of task for selinux checks 2021-11-26 11:48:17 +01:00
ata libata: fix read log timeout value 2021-11-26 11:48:18 +01:00
atm atm: nicstar: register the interrupt handler in the right place 2021-07-20 16:21:08 +02:00
auxdisplay auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty string 2021-11-26 11:48:38 +01:00
base regmap: Fix possible double-free in regcache_rbtree_exit() 2021-11-02 17:39:23 +01:00
bcma bcma: Fix memory leak for internally-handled cores 2021-09-22 11:43:02 +02:00
block cryptoloop: add a deprecation warning 2021-09-22 11:42:55 +02:00
bluetooth Bluetooth: btusb: fix bt fiwmare downloading failure issue for qca btsoc. 2021-07-20 16:21:08 +02:00
bus bus: qcom: Put child node before return 2021-05-22 10:40:23 +02:00
cdrom cdrom: gdrom: initialize global variable at init time 2021-05-26 11:29:07 +02:00
char virtio_console: Assure used length from device is limited 2021-07-20 16:21:14 +02:00
clk clk: kirkwood: Fix a clocking boot regression 2021-09-22 11:43:02 +02:00
clocksource clocksource/drivers/mxs_timer: Add missing semicolon when DEBUG is defined 2021-03-03 17:44:37 +01:00
connector
cpufreq cpufreq: schedutil: Destroy mutex before kobject_put() frees the memory 2021-10-06 10:23:41 +02:00
cpuidle cpuidle: Fix kobject memory leaks in error paths 2021-11-26 11:48:33 +01:00
crypto crypto: qat - disregard spurious PFVF interrupts 2021-11-26 11:48:33 +01:00
dax
dca
devfreq PM / devfreq: tegra30: Fix integer overflow on CPU's freq max out 2020-10-01 20:40:02 +02:00
dio
dma dmaengine: dmaengine_desc_callback_valid(): Check for callback_result 2021-11-26 11:48:38 +01:00
dma-buf
edac EDAC/sb_edac: Fix top-of-high-memory value for Broadwell/Haswell 2021-11-26 11:48:22 +01:00
eisa
extcon extcon: max8997: Add missing modalias string 2021-07-20 16:21:05 +02:00
firewire firewire: nosy: Fix a use-after-free bug in nosy_ioctl() 2021-04-07 12:05:40 +02:00
firmware efi: Change down_interruptible() in virt_efi_reset_system() to down_trylock() 2021-10-27 09:33:57 +02:00
fmc
fpga
gpio gpio: zynq: Check return value of pm_runtime_get_sync 2021-07-20 16:21:12 +02:00
gpu drm/plane-helper: fix uninitialized variable reference 2021-11-26 11:48:37 +01:00
hid HID: apple: Fix logical maximum and usage maximum of Magic Keyboard JIS 2021-10-17 10:05:40 +02:00
hsi HSI: core: fix resource leaks in hsi_add_client_from_dt() 2021-05-22 10:40:26 +02:00
hv hyperv/vmbus: include linux/bitops.h 2021-11-26 11:48:20 +01:00
hwmon hwmon: Fix possible memleak in __hwmon_device_register() 2021-11-26 11:48:34 +01:00
hwspinlock
hwtracing intel_th: Consistency and off-by-one fix 2021-05-22 10:40:16 +02:00
i2c i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()' 2021-11-26 11:48:38 +01:00
ide block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h> 2020-09-12 11:47:36 +02:00
idle
iio iio: dac: ad5446: Fix ad5622_write() return value 2021-11-26 11:48:26 +01:00
infiniband RDMA/mlx4: Return missed an error if device doesn't support steering 2021-11-26 11:48:37 +01:00
input Input: i8042 - Add quirk for Fujitsu Lifebook T725 2021-11-26 11:48:17 +01:00
iommu iommu/amd: Fix backport of 140456f994195b568ecd7fc2287a34eadffef3ca 2021-08-04 11:58:01 +02:00
ipack ipack: ipoctal: fix module reference leak 2021-10-06 10:23:42 +02:00
irqchip ARM: s3c: irq-s3c24xx: Fix return value check for s3c24xx_init_intc() 2021-11-26 11:48:36 +01:00
isdn isdn: mISDN: Fix sleeping function called from invalid context 2021-10-27 09:34:00 +02:00
leds leds: ktd2692: Fix an error handling path 2021-07-20 16:21:05 +02:00
lguest
lightnvm
macintosh drivers/macintosh: Fix memleak in windfarm_pm112 driver 2020-06-20 10:24:21 +02:00
mailbox
mcb mcb: fix error handling in mcb_alloc_bus() 2021-10-06 10:23:39 +02:00
md dm btree remove: assign new_root only when removal succeeds 2021-07-20 16:21:10 +02:00
media media: si470x: Avoid card name truncation 2021-11-26 11:48:33 +01:00
memory memory: fsl_ifc: fix leak of irq and nand_irq in fsl_ifc_ctrl_probe 2021-11-26 11:48:37 +01:00
memstick memstick: jmb38x_ms: use appropriate free function in jmb38x_ms_alloc_host() 2021-11-26 11:48:34 +01:00
message scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove() 2020-11-10 10:23:57 +01:00
mfd mfd: Don't use irq_create_mapping() to resolve a mapping 2021-09-22 11:43:10 +02:00
misc cb710: avoid NULL pointer subtraction 2021-10-27 09:33:57 +02:00
mmc mmc: mxs-mmc: disable regulator on error and in the remove function 2021-11-26 11:48:35 +01:00
mtd mtd: spi-nor: hisi-sfc: Remove excessive clk_disable_unprepare() 2021-11-26 11:48:38 +01:00
net net: davinci_emac: Fix interrupt pacing disable 2021-11-26 11:48:39 +01:00
nfc nfc: port100: fix using -ERRNO as command type mask 2021-11-02 17:39:23 +01:00
ntb NTB: hw: amd: fix an issue about leak system resources 2020-10-29 09:05:41 +01:00
nubus
nvdimm libnvdimm/dimm: Avoid race between probe and available_slots_show() 2021-03-03 17:44:44 +01:00
nvme nvme-pci: Fix an error handling path in 'nvme_probe()' 2021-09-22 11:42:57 +02:00
nvmem nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells 2021-10-27 09:33:58 +02:00
of of: Fix truncation of memory sizes on 32-bit platforms 2021-07-20 16:21:05 +02:00
oprofile
parisc parisc: Move pci_dev_is_behind_card_dino to where it is used 2021-09-26 13:36:18 +02:00
parport parport: remove non-zero check on count 2021-09-22 11:43:07 +02:00
pci PCI: aardvark: Don't spam about PIO Response Status 2021-11-26 11:48:38 +01:00
pcmcia pcmcia: i82092: fix a null pointer dereference bug 2021-08-15 13:01:03 +02:00
perf
phy phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe() 2021-07-20 16:21:05 +02:00
pinctrl pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry() 2021-09-22 11:43:04 +02:00
platform platform/x86: thinkpad_acpi: Fix bitwise vs. logical warning 2021-11-26 11:48:35 +01:00
pnp
power power: supply: bq27xxx: Fix kernel crash on IRQ handler register error 2021-11-26 11:48:37 +01:00
powercap powercap: restrict energy meter to root access 2020-11-10 21:04:57 +01:00
pps
ps3 powerpc/ps3: use dma_mapping_error() 2020-12-29 13:45:00 +01:00
ptp ptp_pch: Load module automatically if ID matches 2021-10-17 10:05:39 +02:00
pwm pwm: lpc32xx: Don't modify HW state in .probe() after the PWM chip was registered 2021-09-26 13:36:18 +02:00
rapidio rapidio: handle create_workqueue() failure 2021-05-26 11:29:06 +02:00
ras
regulator regulator: s5m8767: do not use reset value as DVS voltage if GPIO DVS is disabled 2021-11-26 11:48:22 +01:00
remoteproc remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load 2021-02-23 13:59:14 +01:00
reset reset: ti-syscon: fix to_ti_syscon_reset_data macro 2021-07-28 09:14:24 +02:00
rpmsg
rtc rtc: tps65910: Correct driver module alias 2021-09-22 11:43:02 +02:00
s390 s390/sclp_vt220: fix console name to match device 2021-07-20 16:21:11 +02:00
sbus
scsi scsi: qla2xxx: Turn off target reset during issue_lip 2021-11-26 11:48:38 +01:00
sfi
sh
sn
soc soc/tegra: Fix an error handling path in tegra_powergate_power_up() 2021-11-26 11:48:37 +01:00
spi spi: bcm-qspi: Fix missing clk_disable_unprepare() on error in bcm_qspi_probe() 2021-11-26 11:48:32 +01:00
spmi
ssb ssb: sdio: Don't overwrite const buffer if block_write fails 2021-07-20 16:20:57 +02:00
staging staging: rtl8192u: fix control-message timeouts 2021-11-12 13:18:02 +01:00
target scsi: target: Fix protect handling in WRITE SAME(32) 2021-07-28 09:14:27 +02:00
tc
thermal thermal/drivers/exynos: Fix an error code in exynos_tmu_probe() 2021-09-26 13:36:18 +02:00
thunderbolt
tty serial: xilinx_uartps: Fix race condition causing stuck TX 2021-11-26 11:48:37 +01:00
uio uio_pdrv_genirq: fix use without device tree and no interrupt 2020-07-22 09:10:53 +02:00
usb usb: gadget: hid: fix error code in do_config() 2021-11-26 11:48:37 +01:00
uwb
vfio vfio: Use config not menuconfig for VFIO_NOIOMMU 2021-09-22 11:43:04 +02:00
vhost vringh: Use wiov->used to check for read/write desc order 2021-09-03 09:44:40 +02:00
video video: fbdev: chipsfb: use memset_io() instead of memset() 2021-11-26 11:48:37 +01:00
virt drivers/virt/fsl_hypervisor: Fix error handling path 2020-10-29 09:05:35 +01:00
virtio virtio: Improve vq->broken access to avoid any compiler optimization 2021-09-03 09:44:40 +02:00
vlynq
vme
w1 w1: mxc_w1: Fix timeout resolution problem leading to bus error 2020-11-10 10:23:57 +01:00
watchdog watchdog: f71808e_wdt: fix inaccurate report in WDIOC_GETTIMEOUT 2021-11-26 11:48:38 +01:00
xen xen-pciback: Fix return in pm_ctrl_init() 2021-11-26 11:48:38 +01:00
zorro
Kconfig
Makefile