mirror of
https://github.com/torvalds/linux.git
synced 2026-06-12 16:57:59 +02:00
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl4u6tsACgkQONu9yGCS aT693A//TExeDRnNnf+2v4TJorylyRr17BMxk/Ie2L5E6d2n/RWodsrOThAPU9tx 5alNUkXCT8Jd31BUVnUoPoAQ4zSymSVi++XEf05wDeO0tQ982IESGaLmu9EC1uMF nnM5y4IdRYmFI1Zji4h5vRJckoYUlB6Mdg4BgMr4Q1KX7RkZYfe6bjs7DwM/uyMx jVXdFaQBD1H6F5W6A+GmgUZ36g9uNqzcBxxWwv5URj+q816NdI4bsxIJMF0v0WC+ S54fmpS07QWIYKKsQBUepeSgEF4ECESOE2VoF1ICcnfakdPnDBmNgyPJPSrLmVf+ itRUxoH1MewaOvoJrv+xsGBPmM29LcKH2oBmj5DR2Xstp7ACPs+OtXJEU9dUTDN4 NhaSts5fIp0f4Y5mMn508pDUwYDAWDt99ZJWdx6aK/TRyUsHBgpxBQDt37BE3U5W PCBnObNe2b2KDAsVXLjX5iDYoA0+usFreveMo8uEP+ohfh0ANvJlRkzedYw7NquI ZCcT+I1P9q8aa0528tR332VLrQeYg+kG6LVi2kAabmRA/VtEsT0w90MY/eo2vuTU WlPmbs2yerv2HTm050e6MOgBZfPh7wP/FpbjsSXufj7EDywlfxF+1hXdwfrpPJeN fN3g0kepeUp7+kLzO40FLam/z5ndjAUhyN2SBaPzGsXjMkZdETk= =zvlh -----END PGP SIGNATURE----- Merge 4.19.99 into android-4.19 Changes in 4.19.99 Revert "efi: Fix debugobjects warning on 'efi_rts_work'" xfs: Sanity check flags of Q_XQUOTARM call i2c: stm32f7: rework slave_id allocation i2c: i2c-stm32f7: fix 10-bits check in slave free id search loop mfd: intel-lpss: Add default I2C device properties for Gemini Lake SUNRPC: Fix svcauth_gss_proxy_init() powerpc/pseries: Enable support for ibm,drc-info property powerpc/archrandom: fix arch_get_random_seed_int() tipc: update mon's self addr when node addr generated tipc: fix wrong timeout input for tipc_wait_for_cond() mt7601u: fix bbp version check in mt7601u_wait_bbp_ready crypto: sun4i-ss - fix big endian issues perf map: No need to adjust the long name of modules soc: aspeed: Fix snoop_file_poll()'s return type watchdog: sprd: Fix the incorrect pointer getting from driver data ipmi: Fix memory leak in __ipmi_bmc_register drm/sti: do not remove the drm_bridge that was never added ARM: dts: at91: nattis: set the PRLUD and HIPOW signals low ARM: dts: at91: nattis: make the SD-card slot work ixgbe: don't clear IPsec sa counters on HW clearing drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset() iio: fix position relative kernel version apparmor: Fix network performance issue in aa_label_sk_perm ALSA: hda: fix unused variable warning apparmor: don't try to replace stale label in ptrace access check ARM: qcom_defconfig: Enable MAILBOX firmware: coreboot: Let OF core populate platform device PCI: iproc: Remove PAXC slot check to allow VF support bridge: br_arp_nd_proxy: set icmp6_router if neigh has NTF_ROUTER drm/hisilicon: hibmc: Don't overwrite fb helper surface depth signal/ia64: Use the generic force_sigsegv in setup_frame signal/ia64: Use the force_sig(SIGSEGV,...) in ia64_rt_sigreturn ASoC: wm9712: fix unused variable warning mailbox: mediatek: Add check for possible failure of kzalloc IB/rxe: replace kvfree with vfree IB/hfi1: Add mtu check for operational data VLs genirq/debugfs: Reinstate full OF path for domain name usb: dwc3: add EXTCON dependency for qcom usb: gadget: fsl_udc_core: check allocation return value and cleanup on failure cfg80211: regulatory: make initialization more robust mei: replace POLL* with EPOLL* for write queues. drm/msm: fix unsigned comparison with less than zero of: Fix property name in of_node_get_device_type ALSA: usb-audio: update quirk for B&W PX to remove microphone iwlwifi: nvm: get num of hw addresses from firmware staging: comedi: ni_mio_common: protect register write overflow netfilter: nft_osf: usage from output path is not valid pwm: lpss: Release runtime-pm reference from the driver's remove callback powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index rtlwifi: rtl8821ae: replace _rtl8821ae_mrate_idx_to_arfr_id with generic version RDMA/bnxt_re: Add missing spin lock initialization netfilter: nf_flow_table: do not remove offload when other netns's interface is down powerpc/kgdb: add kgdb_arch_set/remove_breakpoint() tipc: eliminate message disordering during binding table update net: socionext: Add dummy PHY register read in phy_write() drm/sun4i: hdmi: Fix double flag assignation net: hns3: add error handler for hns3_nic_init_vector_data() mlxsw: reg: QEEC: Add minimum shaper fields mlxsw: spectrum: Set minimum shaper on MC TCs NTB: ntb_hw_idt: replace IS_ERR_OR_NULL with regular NULL checks ASoC: wm97xx: fix uninitialized regmap pointer problem ARM: dts: bcm283x: Correct mailbox register sizes pcrypt: use format specifier in kobject_add ASoC: sun8i-codec: add missing route for ADC pinctrl: meson-gxl: remove invalid GPIOX tsin_a pins bus: ti-sysc: Add mcasp optional clocks flag exportfs: fix 'passing zero to ERR_PTR()' warning drm: rcar-du: Fix the return value in case of error in 'rcar_du_crtc_set_crc_source()' drm: rcar-du: Fix vblank initialization net: always initialize pagedlen drm/dp_mst: Skip validating ports during destruction, just ref arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply arm64: dts: renesas: r8a7795-es1: Add missing power domains to IPMMU nodes net: phy: Fix not to call phy_resume() if PHY is not attached IB/hfi1: Correctly process FECN and BECN in packets OPP: Fix missing debugfs supply directory for OPPs IB/rxe: Fix incorrect cache cleanup in error flow mailbox: ti-msgmgr: Off by one in ti_msgmgr_of_xlate() staging: bcm2835-camera: Abort probe if there is no camera staging: bcm2835-camera: fix module autoloading switchtec: Remove immediate status check after submitting MRPC command ipv6: add missing tx timestamping on IPPROTO_RAW pinctrl: sh-pfc: r8a7740: Add missing REF125CK pin to gether_gmii group pinctrl: sh-pfc: r8a7740: Add missing LCD0 marks to lcd0_data24_1 group pinctrl: sh-pfc: r8a7791: Remove bogus ctrl marks from qspi_data4_b group pinctrl: sh-pfc: r8a7791: Remove bogus marks from vin1_b_data18 group pinctrl: sh-pfc: sh73a0: Add missing TO pin to tpu4_to3 group pinctrl: sh-pfc: r8a7794: Remove bogus IPSR9 field pinctrl: sh-pfc: r8a77970: Add missing MOD_SEL0 field pinctrl: sh-pfc: r8a77980: Add missing MOD_SEL0 field pinctrl: sh-pfc: sh7734: Add missing IPSR11 field pinctrl: sh-pfc: r8a77995: Remove bogus SEL_PWM[0-3]_3 configurations pinctrl: sh-pfc: sh7269: Add missing PCIOR0 field pinctrl: sh-pfc: sh7734: Remove bogus IPSR10 value net: hns3: fix error handling int the hns3_get_vector_ring_chain vxlan: changelink: Fix handling of default remotes Input: nomadik-ske-keypad - fix a loop timeout test fork,memcg: fix crash in free_thread_stack on memcg charge fail clk: highbank: fix refcount leak in hb_clk_init() clk: qoriq: fix refcount leak in clockgen_init() clk: ti: fix refcount leak in ti_dt_clocks_register() clk: socfpga: fix refcount leak clk: samsung: exynos4: fix refcount leak in exynos4_get_xom() clk: imx6q: fix refcount leak in imx6q_clocks_init() clk: imx6sx: fix refcount leak in imx6sx_clocks_init() clk: imx7d: fix refcount leak in imx7d_clocks_init() clk: vf610: fix refcount leak in vf610_clocks_init() clk: armada-370: fix refcount leak in a370_clk_init() clk: kirkwood: fix refcount leak in kirkwood_clk_init() clk: armada-xp: fix refcount leak in axp_clk_init() clk: mv98dx3236: fix refcount leak in mv98dx3236_clk_init() clk: dove: fix refcount leak in dove_clk_init() MIPS: BCM63XX: drop unused and broken DSP platform device arm64: defconfig: Re-enable bcm2835-thermal driver remoteproc: qcom: q6v5-mss: Add missing clocks for MSM8996 remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 drm: Fix error handling in drm_legacy_addctx ARM: dts: r8a7743: Remove generic compatible string from iic3 drm/etnaviv: fix some off by one bugs drm/fb-helper: generic: Fix setup error path fork, memcg: fix cached_stacks case IB/usnic: Fix out of bounds index check in query pkey RDMA/ocrdma: Fix out of bounds index check in query pkey RDMA/qedr: Fix out of bounds index check in query pkey drm/shmob: Fix return value check in shmob_drm_probe arm64: dts: apq8016-sbc: Increase load on l11 for SDCARD spi: cadence: Correct initialisation of runtime PM RDMA/iw_cxgb4: Fix the unchecked ep dereference net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ9031 memory: tegra: Don't invoke Tegra30+ specific memory timing setup on Tegra20 drm/etnaviv: NULL vs IS_ERR() buf in etnaviv_core_dump() media: s5p-jpeg: Correct step and max values for V4L2_CID_JPEG_RESTART_INTERVAL kbuild: mark prepare0 as PHONY to fix external module build crypto: brcm - Fix some set-but-not-used warning crypto: tgr192 - fix unaligned memory access ASoC: imx-sgtl5000: put of nodes if finding codec fails IB/iser: Pass the correct number of entries for dma mapped SGL net: hns3: fix wrong combined count returned by ethtool -l media: tw9910: Unregister subdevice with v4l2-async IB/mlx5: Don't override existing ip_protocol rtc: cmos: ignore bogus century byte spi/topcliff_pch: Fix potential NULL dereference on allocation error net: hns3: fix bug of ethtool_ops.get_channels for VF ARM: dts: sun8i-a23-a33: Move NAND controller device node to sort by address clk: sunxi-ng: sun8i-a23: Enable PLL-MIPI LDOs when ungating it iwlwifi: mvm: avoid possible access out of array. net/mlx5: Take lock with IRQs disabled to avoid deadlock ip_tunnel: Fix route fl4 init in ip_md_tunnel_xmit arm64: dts: allwinner: h6: Move GIC device node fix base address ordering iwlwifi: mvm: fix A-MPDU reference assignment bus: ti-sysc: Fix timer handling with drop pm_runtime_irq_safe() tty: ipwireless: Fix potential NULL pointer dereference driver: uio: fix possible memory leak in __uio_register_device driver: uio: fix possible use-after-free in __uio_register_device crypto: crypto4xx - Fix wrong ppc4xx_trng_probe()/ppc4xx_trng_remove() arguments driver core: Fix DL_FLAG_AUTOREMOVE_SUPPLIER device link flag handling driver core: Avoid careless re-use of existing device links driver core: Do not resume suppliers under device_links_write_lock() driver core: Fix handling of runtime PM flags in device_link_add() driver core: Do not call rpm_put_suppliers() in pm_runtime_drop_link() ARM: dts: lpc32xx: add required clocks property to keypad device node ARM: dts: lpc32xx: reparent keypad controller to SIC1 ARM: dts: lpc32xx: fix ARM PrimeCell LCD controller variant ARM: dts: lpc32xx: fix ARM PrimeCell LCD controller clocks property ARM: dts: lpc32xx: phy3250: fix SD card regulator voltage drm/xen-front: Fix mmap attributes for display buffers iwlwifi: mvm: fix RSS config command staging: most: cdev: add missing check for cdev_add failure clk: ingenic: jz4740: Fix gating of UDC clock rtc: ds1672: fix unintended sign extension thermal: mediatek: fix register index error arm64: dts: msm8916: remove bogus argument to the cpu clock ath10k: fix dma unmap direction for management frames net: phy: fixed_phy: Fix fixed_phy not checking GPIO rtc: ds1307: rx8130: Fix alarm handling net/smc: original socket family in inet_sock_diag rtc: 88pm860x: fix unintended sign extension rtc: 88pm80x: fix unintended sign extension rtc: pm8xxx: fix unintended sign extension fbdev: chipsfb: remove set but not used variable 'size' iw_cxgb4: use tos when importing the endpoint iw_cxgb4: use tos when finding ipv6 routes ipmi: kcs_bmc: handle devm_kasprintf() failure case xsk: add missing smp_rmb() in xsk_mmap drm/etnaviv: potential NULL dereference ntb_hw_switchtec: debug print 64bit aligned crosslink BAR Numbers ntb_hw_switchtec: NT req id mapping table register entry number should be 512 pinctrl: sh-pfc: emev2: Add missing pinmux functions pinctrl: sh-pfc: r8a7791: Fix scifb2_data_c pin group pinctrl: sh-pfc: r8a7792: Fix vin1_data18_b pin group pinctrl: sh-pfc: sh73a0: Fix fsic_spdif pin groups RDMA/mlx5: Fix memory leak in case we fail to add an IB device driver core: Fix possible supplier PM-usage counter imbalance PCI: endpoint: functions: Use memcpy_fromio()/memcpy_toio() usb: phy: twl6030-usb: fix possible use-after-free on remove block: don't use bio->bi_vcnt to figure out segment number keys: Timestamp new keys net: dsa: b53: Fix default VLAN ID net: dsa: b53: Properly account for VLAN filtering net: dsa: b53: Do not program CPU port's PVID mt76: usb: fix possible memory leak in mt76u_buf_free media: sh: migor: Include missing dma-mapping header vfio_pci: Enable memory accesses before calling pci_map_rom hwmon: (pmbus/tps53679) Fix driver info initialization in probe routine mdio_bus: Fix PTR_ERR() usage after initialization to constant KVM: PPC: Release all hardware TCE tables attached to a group staging: r8822be: check kzalloc return or bail dmaengine: mv_xor: Use correct device for DMA API cdc-wdm: pass return value of recover_from_urb_loss brcmfmac: create debugfs files for bus-specific layer regulator: pv88060: Fix array out-of-bounds access regulator: pv88080: Fix array out-of-bounds access regulator: pv88090: Fix array out-of-bounds access net: dsa: qca8k: Enable delay for RGMII_ID mode net/mlx5: Delete unused FPGA QPN variable drm/nouveau/bios/ramcfg: fix missing parentheses when calculating RON drm/nouveau/pmu: don't print reply values if exec is false drm/nouveau: fix missing break in switch statement driver core: Fix PM-runtime for links added during consumer probe ASoC: qcom: Fix of-node refcount unbalance in apq8016_sbc_parse_of() net: dsa: fix unintended change of bridge interface STP state fs/nfs: Fix nfs_parse_devname to not modify it's argument staging: rtlwifi: Use proper enum for return in halmac_parse_psd_data_88xx powerpc/64s: Fix logic when handling unknown CPU features NFS: Fix a soft lockup in the delegation recovery code perf: Copy parent's address filter offsets on clone perf, pt, coresight: Fix address filters for vmas with non-zero offset clocksource/drivers/sun5i: Fail gracefully when clock rate is unavailable clocksource/drivers/exynos_mct: Fix error path in timer resources initialization platform/x86: wmi: fix potential null pointer dereference NFS/pnfs: Bulk destroy of layouts needs to be safe w.r.t. umount mmc: sdhci-brcmstb: handle mmc_of_parse() errors during probe iommu: Fix IOMMU debugfs fallout ARM: 8847/1: pm: fix HYP/SVC mode mismatch when MCPM is used ARM: 8848/1: virt: Align GIC version check with arm64 counterpart ARM: 8849/1: NOMMU: Fix encodings for PMSAv8's PRBAR4/PRLAR4 regulator: wm831x-dcdc: Fix list of wm831x_dcdc_ilim from mA to uA ath10k: Fix length of wmi tlv command for protected mgmt frames netfilter: nft_set_hash: fix lookups with fixed size hash on big endian netfilter: nft_set_hash: bogus element self comparison from deactivation path net: sched: act_csum: Fix csum calc for tagged packets hwrng: bcm2835 - fix probe as platform device iommu/vt-d: Fix NULL pointer reference in intel_svm_bind_mm() NFS: Add missing encode / decode sequence_maxsz to v4.2 operations NFSv4/flexfiles: Fix invalid deref in FF_LAYOUT_DEVID_NODE() net: aquantia: fixed instack structure overflow powerpc/mm: Check secondary hash page table media: dvb/earth-pt1: fix wrong initialization for demod blocks rbd: clear ->xferred on error from rbd_obj_issue_copyup() PCI: Fix "try" semantics of bus and slot reset nios2: ksyms: Add missing symbol exports x86/mm: Remove unused variable 'cpu' scsi: megaraid_sas: reduce module load time nfp: fix simple vNIC mailbox length drivers/rapidio/rio_cm.c: fix potential oops in riocm_ch_listen() xen, cpu_hotplug: Prevent an out of bounds access net/mlx5: Fix multiple updates of steering rules in parallel net/mlx5e: IPoIB, Fix RX checksum statistics update net: sh_eth: fix a missing check of of_get_phy_mode regulator: lp87565: Fix missing register for LP87565_BUCK_0 soc: amlogic: gx-socinfo: Add mask for each SoC packages media: ivtv: update *pos correctly in ivtv_read_pos() media: cx18: update *pos correctly in cx18_read_pos() media: wl128x: Fix an error code in fm_download_firmware() media: cx23885: check allocation return regulator: tps65086: Fix tps65086_ldoa1_ranges for selector 0xB crypto: ccree - reduce kernel stack usage with clang jfs: fix bogus variable self-initialization tipc: tipc clang warning m68k: mac: Fix VIA timer counter accesses ARM: dts: sun8i: a33: Reintroduce default pinctrl muxing arm64: dts: allwinner: a64: Add missing PIO clocks ARM: dts: sun9i: optimus: Fix fixed-regulators net: phy: don't clear BMCR in genphy_soft_reset ARM: OMAP2+: Fix potentially uninitialized return value for _setup_reset() net: dsa: Avoid null pointer when failing to connect to PHY soc: qcom: cmd-db: Fix an error code in cmd_db_dev_probe() media: davinci-isif: avoid uninitialized variable use media: tw5864: Fix possible NULL pointer dereference in tw5864_handle_frame spi: tegra114: clear packed bit for unpacked mode spi: tegra114: fix for unpacked mode transfers spi: tegra114: terminate dma and reset on transfer timeout spi: tegra114: flush fifos spi: tegra114: configure dma burst size to fifo trig level bus: ti-sysc: Fix sysc_unprepare() when no clocks have been allocated soc/fsl/qe: Fix an error code in qe_pin_request() spi: bcm2835aux: fix driver to not allow 65535 (=-1) cs-gpios drm/fb-helper: generic: Call drm_client_add() after setup is done arm64/vdso: don't leak kernel addresses rtc: Fix timestamp value for RTC_TIMESTAMP_BEGIN_1900 rtc: mt6397: Don't call irq_dispose_mapping. ehea: Fix a copy-paste err in ehea_init_port_res bpf: Add missed newline in verifier verbose log drm/vmwgfx: Remove set but not used variable 'restart' scsi: qla2xxx: Unregister chrdev if module initialization fails of: use correct function prototype for of_overlay_fdt_apply() net/sched: cbs: fix port_rate miscalculation clk: qcom: Skip halt checks on gcc_pcie_0_pipe_clk for 8998 ACPI: button: reinitialize button state upon resume firmware: arm_scmi: fix of_node leak in scmi_mailbox_check rxrpc: Fix detection of out of order acks scsi: target/core: Fix a race condition in the LUN lookup code brcmfmac: fix leak of mypkt on error return path ARM: pxa: ssp: Fix "WARNING: invalid free of devm_ allocated data" PCI: rockchip: Fix rockchip_pcie_ep_assert_intx() bitwise operations net: hns3: fix for vport->bw_limit overflow problem hwmon: (w83627hf) Use request_muxed_region for Super-IO accesses perf/core: Fix the address filtering fix staging: android: vsoc: fix copy_from_user overrun PCI: dwc: Fix dw_pcie_ep_find_capability() to return correct capability offset soc: amlogic: meson-gx-pwrc-vpu: Fix power on/off register bitmask platform/x86: alienware-wmi: fix kfree on potentially uninitialized pointer tipc: set sysctl_tipc_rmem and named_timeout right range usb: typec: tcpm: Notify the tcpc to start connection-detection for SRPs selftests/ipc: Fix msgque compiler warnings net: hns3: fix loop condition of hns3_get_tx_timeo_queue_info() powerpc: vdso: Make vdso32 installation conditional in vdso_install ARM: dts: ls1021: Fix SGMII PCS link remaining down after PHY disconnect media: ov2659: fix unbalanced mutex_lock/unlock 6lowpan: Off by one handling ->nexthdr dmaengine: axi-dmac: Don't check the number of frames for alignment ALSA: usb-audio: Handle the error from snd_usb_mixer_apply_create_quirk() afs: Fix AFS file locking to allow fine grained locks afs: Further fix file locking NFS: Don't interrupt file writeout due to fatal errors coresight: catu: fix clang build warning s390/kexec_file: Fix potential segment overlap in ELF loader irqchip/gic-v3-its: fix some definitions of inner cacheability attributes scsi: qla2xxx: Fix a format specifier scsi: qla2xxx: Fix error handling in qlt_alloc_qfull_cmd() scsi: qla2xxx: Avoid that qlt_send_resp_ctio() corrupts memory KVM: PPC: Book3S HV: Fix lockdep warning when entering the guest netfilter: nft_flow_offload: add entry to flowtable after confirmation PCI: iproc: Enable iProc config read for PAXBv2 ARM: dts: logicpd-som-lv: Fix MMC1 card detect packet: in recvmsg msg_name return at least sizeof sockaddr_ll ASoC: fix valid stream condition usb: gadget: fsl: fix link error against usb-gadget module dwc2: gadget: Fix completed transfer size calculation in DDMA IB/mlx5: Add missing XRC options to QP optional params mask RDMA/rxe: Consider skb reserve space based on netdev of GID iommu/vt-d: Make kernel parameter igfx_off work with vIOMMU net: ena: fix swapped parameters when calling ena_com_indirect_table_fill_entry net: ena: fix: Free napi resources when ena_up() fails net: ena: fix incorrect test of supported hash function net: ena: fix ena_com_fill_hash_function() implementation dmaengine: tegra210-adma: restore channel status watchdog: rtd119x_wdt: Fix remove function mmc: core: fix possible use after free of host lightnvm: pblk: fix lock order in pblk_rb_tear_down_check ath10k: Fix encoding for protected management frames afs: Fix the afs.cell and afs.volume xattr handlers vfio/mdev: Avoid release parent reference during error path vfio/mdev: Follow correct remove sequence vfio/mdev: Fix aborting mdev child device removal if one fails l2tp: Fix possible NULL pointer dereference ALSA: aica: Fix a long-time build breakage media: omap_vout: potential buffer overflow in vidioc_dqbuf() media: davinci/vpbe: array underflow in vpbe_enum_outputs() platform/x86: alienware-wmi: printing the wrong error code crypto: caam - fix caam_dump_sg that iterates through scatterlist netfilter: ebtables: CONFIG_COMPAT: reject trailing data after last rule pwm: meson: Consider 128 a valid pre-divider pwm: meson: Don't disable PWM when setting duty repeatedly ARM: riscpc: fix lack of keyboard interrupts after irq conversion nfp: bpf: fix static check error through tightening shift amount adjustment kdb: do a sanity check on the cpu in kdb_per_cpu() netfilter: nf_tables: correct NFT_LOGLEVEL_MAX value backlight: lm3630a: Return 0 on success in update_status functions thermal: rcar_gen3_thermal: fix interrupt type thermal: cpu_cooling: Actually trace CPU load in thermal_power_cpu_get_power EDAC/mc: Fix edac_mc_find() in case no device is found afs: Fix key leak in afs_release() and afs_evict_inode() afs: Don't invalidate callback if AFS_VNODE_DIR_VALID not set afs: Fix lock-wait/callback-break double locking afs: Fix double inc of vnode->cb_break ARM: dts: sun8i-h3: Fix wifi in Beelink X2 DT clk: meson: gxbb: no spread spectrum on mpll0 clk: meson: axg: spread spectrum is on mpll2 dmaengine: tegra210-adma: Fix crash during probe arm64: dts: meson: libretech-cc: set eMMC as removable RDMA/qedr: Fix incorrect device rate. spi: spi-fsl-spi: call spi_finalize_current_message() at the end crypto: ccp - fix AES CFB error exposed by new test vectors crypto: ccp - Fix 3DES complaint from ccp-crypto module serial: stm32: fix word length configuration serial: stm32: fix rx error handling serial: stm32: fix rx data length when parity enabled serial: stm32: fix transmit_chars when tx is stopped serial: stm32: Add support of TC bit status check serial: stm32: fix wakeup source initialization misc: sgi-xp: Properly initialize buf in xpc_get_rsvd_page_pa iommu: Add missing new line for dma type iommu: Use right function to get group for device signal/bpfilter: Fix bpfilter_kernl to use send_sig not force_sig signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig inet: frags: call inet_frags_fini() after unregister_pernet_subsys() net: hns3: fix a memory leak issue for hclge_map_unmap_ring_to_vf_vector crypto: talitos - fix AEAD processing. netvsc: unshare skb in VF rx handler net: core: support XDP generic on stacked devices. RDMA/uverbs: check for allocation failure in uapi_add_elm() net: don't clear sock->sk early to avoid trouble in strparser phy: qcom-qusb2: fix missing assignment of ret when calling clk_prepare_enable cpufreq: brcmstb-avs-cpufreq: Fix initial command check cpufreq: brcmstb-avs-cpufreq: Fix types for voltage/frequency clk: sunxi-ng: sun50i-h6-r: Fix incorrect W1 clock gate register media: vivid: fix incorrect assignment operation when setting video mode crypto: inside-secure - fix zeroing of the request in ahash_exit_inv crypto: inside-secure - fix queued len computation arm64: dts: renesas: ebisu: Remove renesas, no-ether-link property mpls: fix warning with multi-label encap serial: stm32: fix a recursive locking in stm32_config_rs485 arm64: dts: meson-gxm-khadas-vim2: fix gpio-keys-polled node arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support iommu/vt-d: Duplicate iommu_resv_region objects per device list phy: usb: phy-brcm-usb: Remove sysfs attributes upon driver removal firmware: arm_scmi: fix bitfield definitions for SENSOR_DESC attributes firmware: arm_scmi: update rate_discrete in clock_describe_rates_get ntb_hw_switchtec: potential shift wrapping bug in switchtec_ntb_init_sndev() ASoC: meson: axg-tdmin: right_j is not supported ASoC: meson: axg-tdmout: right_j is not supported qed: iWARP - Use READ_ONCE and smp_store_release to access ep->state qed: iWARP - fix uninitialized callback powerpc/cacheinfo: add cacheinfo_teardown, cacheinfo_rebuild powerpc/pseries/mobility: rebuild cacheinfo hierarchy post-migration bpf: fix the check that forwarding is enabled in bpf_ipv6_fib_lookup IB/hfi1: Handle port down properly in pio drm/msm/mdp5: Fix mdp5_cfg_init error return net: netem: fix backlog accounting for corrupted GSO frames net/udp_gso: Allow TX timestamp with UDP GSO net/af_iucv: build proper skbs for HiperTransport net/af_iucv: always register net_device notifier ASoC: ti: davinci-mcasp: Fix slot mask settings when using multiple AXRs rtc: pcf8563: Fix interrupt trigger method rtc: pcf8563: Clear event flags and disable interrupts before requesting irq ARM: dts: iwg20d-q7-common: Fix SDHI1 VccQ regularor net/sched: cbs: Fix error path of cbs_module_init arm64: dts: allwinner: h6: Pine H64: Add interrupt line for RTC drm/msm/a3xx: remove TPL1 regs from snapshot ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1() perf/ioctl: Add check for the sample_period value dmaengine: hsu: Revert "set HSU_CH_MTSR to memory width" clk: qcom: Fix -Wunused-const-variable nvmem: imx-ocotp: Ensure WAIT bits are preserved when setting timing nvmem: imx-ocotp: Change TIMING calculation to u-boot algorithm tools: bpftool: use correct argument in cgroup errors backlight: pwm_bl: Fix heuristic to determine number of brightness levels fork,memcg: alloc_thread_stack_node needs to set tsk->stack bnxt_en: Fix ethtool selftest crash under error conditions. bnxt_en: Suppress error messages when querying DSCP DCB capabilities. iommu/amd: Make iommu_disable safer mfd: intel-lpss: Release IDA resources rxrpc: Fix uninitialized error code in rxrpc_send_data_packet() xprtrdma: Fix use-after-free in rpcrdma_post_recvs um: Fix IRQ controller regression on console read PM: ACPI/PCI: Resume all devices during hibernation ACPI: PM: Simplify and fix PM domain hibernation callbacks ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS fsi/core: Fix error paths on CFAM init devres: allow const resource arguments fsi: sbefifo: Don't fail operations when in SBE IPL state RDMA/hns: Fixs hw access invalid dma memory error PCI: mobiveil: Remove the flag MSI_FLAG_MULTI_PCI_MSI PCI: mobiveil: Fix devfn check in mobiveil_pcie_valid_device() PCI: mobiveil: Fix the valid check for inbound and outbound windows ceph: fix "ceph.dir.rctime" vxattr value net: pasemi: fix an use-after-free in pasemi_mac_phy_init() net/tls: fix socket wmem accounting on fallback with netem x86/pgtable/32: Fix LOWMEM_PAGES constant xdp: fix possible cq entry leak ARM: stm32: use "depends on" instead of "if" after prompt scsi: libfc: fix null pointer dereference on a null lport xfrm interface: ifname may be wrong in logs drm/panel: make drm_panel.h self-contained clk: sunxi-ng: v3s: add the missing PLL_DDR1 PM: sleep: Fix possible overflow in pm_system_cancel_wakeup() libertas_tf: Use correct channel range in lbtf_geo_init qed: reduce maximum stack frame size usb: host: xhci-hub: fix extra endianness conversion media: rcar-vin: Clean up correct notifier in error path mic: avoid statically declaring a 'struct device'. x86/kgbd: Use NMI_VECTOR not APIC_DM_NMI crypto: ccp - Reduce maximum stack usage ALSA: aoa: onyx: always initialize register read value arm64: dts: renesas: r8a77995: Fix register range of display node tipc: reduce risk of wakeup queue starvation ARM: dts: stm32: add missing vdda-supply to adc on stm32h743i-eval net/mlx5: Fix mlx5_ifc_query_lag_out_bits cifs: fix rmmod regression in cifs.ko caused by force_sig changes iio: tsl2772: Use devm_add_action_or_reset for tsl2772_chip_off net: fix bpf_xdp_adjust_head regression for generic-XDP spi: bcm-qspi: Fix BSPI QUAD and DUAL mode support when using flex mode cxgb4: smt: Add lock for atomic_dec_and_test crypto: caam - free resources in case caam_rng registration failed ext4: set error return correctly when ext4_htree_store_dirent fails RDMA/hns: Bugfix for slab-out-of-bounds when unloading hip08 driver RDMA/hns: bugfix for slab-out-of-bounds when loading hip08 driver ASoC: es8328: Fix copy-paste error in es8328_right_line_controls ASoC: cs4349: Use PM ops 'cs4349_runtime_pm' ASoC: wm8737: Fix copy-paste error in wm8737_snd_controls net/rds: Add a few missing rds_stat_names entries tools: bpftool: fix arguments for p_err() in do_event_pipe() tools: bpftool: fix format strings and arguments for jsonw_printf() drm: rcar-du: lvds: Fix bridge_to_rcar_lvds bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd fails signal: Allow cifs and drbd to receive their terminating signals powerpc/64s/radix: Fix memory hot-unplug page table split ASoC: sun4i-i2s: RX and TX counter registers are swapped dmaengine: dw: platform: Switch to acpi_dma_controller_register() rtc: rv3029: revert error handling patch to rv3029_eeprom_write() mac80211: minstrel_ht: fix per-group max throughput rate initialization i40e: reduce stack usage in i40e_set_fc media: atmel: atmel-isi: fix timeout value for stop streaming ARM: 8896/1: VDSO: Don't leak kernel addresses rtc: pcf2127: bugfix: read rtc disables watchdog mips: avoid explicit UB in assignment of mips_io_port_base media: em28xx: Fix exception handling in em28xx_alloc_urbs() iommu/mediatek: Fix iova_to_phys PA start for 4GB mode ahci: Do not export local variable ahci_em_messages rxrpc: Fix lack of conn cleanup when local endpoint is cleaned up [ver #2] Partially revert "kfifo: fix kfifo_alloc() and kfifo_init()" hwmon: (lm75) Fix write operations for negative temperatures net/sched: cbs: Set default link speed to 10 Mbps in cbs_set_port_rate power: supply: Init device wakeup after device_add() x86, perf: Fix the dependency of the x86 insn decoder selftest staging: greybus: light: fix a couple double frees irqdomain: Add the missing assignment of domain->fwnode for named fwnode bcma: fix incorrect update of BCMA_CORE_PCI_MDIO_DATA usb: typec: tps6598x: Fix build error without CONFIG_REGMAP_I2C bcache: Fix an error code in bch_dump_read() iio: dac: ad5380: fix incorrect assignment to val netfilter: ctnetlink: honor IPS_OFFLOAD flag ath9k: dynack: fix possible deadlock in ath_dynack_node_{de}init wcn36xx: use dynamic allocation for large variables tty: serial: fsl_lpuart: Use appropriate lpuart32_* I/O funcs ARM: dts: aspeed-g5: Fixe gpio-ranges upper limit xsk: avoid store-tearing when assigning queues xsk: avoid store-tearing when assigning umem led: triggers: Fix dereferencing of null pointer net: sonic: return NETDEV_TX_OK if failed to map buffer net: hns3: fix error VF index when setting VLAN offload rtlwifi: Fix file release memory leak ARM: dts: logicpd-som-lv: Fix i2c2 and i2c3 Pin mux f2fs: fix wrong error injection path in inc_valid_block_count() f2fs: fix error path of f2fs_convert_inline_page() scsi: fnic: fix msix interrupt allocation Btrfs: fix hang when loading existing inode cache off disk Btrfs: fix inode cache waiters hanging on failure to start caching thread Btrfs: fix inode cache waiters hanging on path allocation failure btrfs: use correct count in btrfs_file_write_iter() ixgbe: sync the first fragment unconditionally hwmon: (shtc1) fix shtc1 and shtw1 id mask net: sonic: replace dev_kfree_skb in sonic_send_packet pinctrl: iproc-gpio: Fix incorrect pinconf configurations gpio/aspeed: Fix incorrect number of banks ath10k: adjust skb length in ath10k_sdio_mbox_rx_packet RDMA/cma: Fix false error message net/rds: Fix 'ib_evt_handler_call' element in 'rds_ib_stat_names' um: Fix off by one error in IRQ enumeration bnxt_en: Increase timeout for HWRM_DBG_COREDUMP_XX commands f2fs: fix to avoid accessing uninitialized field of inode page in is_alive() mailbox: qcom-apcs: fix max_register value clk: actions: Fix factor clk struct member access powerpc/mm/mce: Keep irqs disabled during lockless page table walk bpf: fix BTF limits crypto: hisilicon - Matching the dma address for dma_pool_free() iommu/amd: Wait for completion of IOTLB flush in attach_device net: aquantia: Fix aq_vec_isr_legacy() return value cxgb4: Signedness bug in init_one() net: hisilicon: Fix signedness bug in hix5hd2_dev_probe() net: broadcom/bcmsysport: Fix signedness in bcm_sysport_probe() net: netsec: Fix signedness bug in netsec_probe() net: socionext: Fix a signedness bug in ave_probe() net: stmmac: dwmac-meson8b: Fix signedness bug in probe net: axienet: fix a signedness bug in probe of: mdio: Fix a signedness bug in of_phy_get_and_connect() net: nixge: Fix a signedness bug in nixge_probe() net: ethernet: stmmac: Fix signedness bug in ipq806x_gmac_of_parse() net: sched: cbs: Avoid division by zero when calculating the port rate nvme: retain split access workaround for capability reads net: stmmac: gmac4+: Not all Unicast addresses may be available rxrpc: Fix trace-after-put looking at the put connection record mac80211: accept deauth frames in IBSS mode llc: fix another potential sk_buff leak in llc_ui_sendmsg() llc: fix sk_buff refcounting in llc_conn_state_process() ip6erspan: remove the incorrect mtu limit for ip6erspan net: stmmac: fix length of PTP clock's name string net: stmmac: fix disabling flexible PPS output sctp: add chunks to sk_backlog when the newsk sk_socket is not set s390/qeth: Fix error handling during VNICC initialization s390/qeth: Fix initialization of vnicc cmd masks during set online act_mirred: Fix mirred_init_module error handling net: avoid possible false sharing in sk_leave_memory_pressure() net: add {READ|WRITE}_ONCE() annotations on ->rskq_accept_head tcp: annotate lockless access to tcp_memory_pressure net/smc: receive returns without data net/smc: receive pending data after RCV_SHUTDOWN drm/msm/dsi: Implement reset correctly vhost/test: stop device before reset dmaengine: imx-sdma: fix size check for sdma script_number firmware: dmi: Fix unlikely out-of-bounds read in save_mem_devices arm64: hibernate: check pgd table allocation net: netem: fix error path for corrupted GSO frames net: netem: correct the parent's backlog when corrupted packet was dropped xsk: Fix registration of Rx-only sockets bpf, offload: Unlock on error in bpf_offload_dev_create() afs: Fix missing timeout reset net: qca_spi: Move reset_count to struct qcaspi hv_netvsc: Fix offset usage in netvsc_send_table() hv_netvsc: Fix send_table offset in case of a host bug afs: Fix large file support drm: panel-lvds: Potential Oops in probe error handling hwrng: omap3-rom - Fix missing clock by probing with device tree dpaa_eth: perform DMA unmapping before read dpaa_eth: avoid timestamp read on error paths MIPS: Loongson: Fix return value of loongson_hwmon_init hv_netvsc: flag software created hash value net: neigh: use long type to store jiffies delta packet: fix data-race in fanout_flow_is_huge() i2c: stm32f7: report dma error during probe mmc: sdio: fix wl1251 vendor id mmc: core: fix wl1251 sdio quirks affs: fix a memory leak in affs_remount afs: Remove set but not used variables 'before', 'after' dmaengine: ti: edma: fix missed failure handling drm/radeon: fix bad DMA from INTERRUPT_CNTL2 arm64: dts: juno: Fix UART frequency samples/bpf: Fix broken xdp_rxq_info due to map order assumptions usb: dwc3: Allow building USB_DWC3_QCOM without EXTCON IB/iser: Fix dma_nents type definition serial: stm32: fix clearing interrupt error flags arm64: dts: meson-gxm-khadas-vim2: fix uart_A bluetooth node m68k: Call timer_interrupt() with interrupts disabled Linux 4.19.99 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ieabeab79ea5c8cb4b6b1552702fa5d6100cea5db
853 lines
22 KiB
C
853 lines
22 KiB
C
/*
|
|
* Generic OPP OF helpers
|
|
*
|
|
* Copyright (C) 2009-2010 Texas Instruments Incorporated.
|
|
* Nishanth Menon
|
|
* Romit Dasgupta
|
|
* Kevin Hilman
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
#include <linux/cpu.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/device.h>
|
|
#include <linux/of_device.h>
|
|
#include <linux/pm_domain.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/export.h>
|
|
|
|
#include "opp.h"
|
|
|
|
static struct opp_table *_managed_opp(const struct device_node *np)
|
|
{
|
|
struct opp_table *opp_table, *managed_table = NULL;
|
|
|
|
mutex_lock(&opp_table_lock);
|
|
|
|
list_for_each_entry(opp_table, &opp_tables, node) {
|
|
if (opp_table->np == np) {
|
|
/*
|
|
* Multiple devices can point to the same OPP table and
|
|
* so will have same node-pointer, np.
|
|
*
|
|
* But the OPPs will be considered as shared only if the
|
|
* OPP table contains a "opp-shared" property.
|
|
*/
|
|
if (opp_table->shared_opp == OPP_TABLE_ACCESS_SHARED) {
|
|
_get_opp_table_kref(opp_table);
|
|
managed_table = opp_table;
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
mutex_unlock(&opp_table_lock);
|
|
|
|
return managed_table;
|
|
}
|
|
|
|
void _of_init_opp_table(struct opp_table *opp_table, struct device *dev)
|
|
{
|
|
struct device_node *np;
|
|
|
|
/*
|
|
* Only required for backward compatibility with v1 bindings, but isn't
|
|
* harmful for other cases. And so we do it unconditionally.
|
|
*/
|
|
np = of_node_get(dev->of_node);
|
|
if (np) {
|
|
u32 val;
|
|
|
|
if (!of_property_read_u32(np, "clock-latency", &val))
|
|
opp_table->clock_latency_ns_max = val;
|
|
of_property_read_u32(np, "voltage-tolerance",
|
|
&opp_table->voltage_tolerance_v1);
|
|
of_node_put(np);
|
|
}
|
|
}
|
|
|
|
static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table,
|
|
struct device_node *np)
|
|
{
|
|
unsigned int count = opp_table->supported_hw_count;
|
|
u32 version;
|
|
int ret;
|
|
|
|
if (!opp_table->supported_hw) {
|
|
/*
|
|
* In the case that no supported_hw has been set by the
|
|
* platform but there is an opp-supported-hw value set for
|
|
* an OPP then the OPP should not be enabled as there is
|
|
* no way to see if the hardware supports it.
|
|
*/
|
|
if (of_find_property(np, "opp-supported-hw", NULL))
|
|
return false;
|
|
else
|
|
return true;
|
|
}
|
|
|
|
while (count--) {
|
|
ret = of_property_read_u32_index(np, "opp-supported-hw", count,
|
|
&version);
|
|
if (ret) {
|
|
dev_warn(dev, "%s: failed to read opp-supported-hw property at index %d: %d\n",
|
|
__func__, count, ret);
|
|
return false;
|
|
}
|
|
|
|
/* Both of these are bitwise masks of the versions */
|
|
if (!(version & opp_table->supported_hw[count]))
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
|
|
struct opp_table *opp_table)
|
|
{
|
|
u32 *microvolt, *microamp = NULL;
|
|
int supplies = opp_table->regulator_count, vcount, icount, ret, i, j;
|
|
struct property *prop = NULL;
|
|
char name[NAME_MAX];
|
|
|
|
/* Search for "opp-microvolt-<name>" */
|
|
if (opp_table->prop_name) {
|
|
snprintf(name, sizeof(name), "opp-microvolt-%s",
|
|
opp_table->prop_name);
|
|
prop = of_find_property(opp->np, name, NULL);
|
|
}
|
|
|
|
if (!prop) {
|
|
/* Search for "opp-microvolt" */
|
|
sprintf(name, "opp-microvolt");
|
|
prop = of_find_property(opp->np, name, NULL);
|
|
|
|
/* Missing property isn't a problem, but an invalid entry is */
|
|
if (!prop) {
|
|
if (unlikely(supplies == -1)) {
|
|
/* Initialize regulator_count */
|
|
opp_table->regulator_count = 0;
|
|
return 0;
|
|
}
|
|
|
|
if (!supplies)
|
|
return 0;
|
|
|
|
dev_err(dev, "%s: opp-microvolt missing although OPP managing regulators\n",
|
|
__func__);
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
if (unlikely(supplies == -1)) {
|
|
/* Initialize regulator_count */
|
|
supplies = opp_table->regulator_count = 1;
|
|
} else if (unlikely(!supplies)) {
|
|
dev_err(dev, "%s: opp-microvolt wasn't expected\n", __func__);
|
|
return -EINVAL;
|
|
}
|
|
|
|
vcount = of_property_count_u32_elems(opp->np, name);
|
|
if (vcount < 0) {
|
|
dev_err(dev, "%s: Invalid %s property (%d)\n",
|
|
__func__, name, vcount);
|
|
return vcount;
|
|
}
|
|
|
|
/* There can be one or three elements per supply */
|
|
if (vcount != supplies && vcount != supplies * 3) {
|
|
dev_err(dev, "%s: Invalid number of elements in %s property (%d) with supplies (%d)\n",
|
|
__func__, name, vcount, supplies);
|
|
return -EINVAL;
|
|
}
|
|
|
|
microvolt = kmalloc_array(vcount, sizeof(*microvolt), GFP_KERNEL);
|
|
if (!microvolt)
|
|
return -ENOMEM;
|
|
|
|
ret = of_property_read_u32_array(opp->np, name, microvolt, vcount);
|
|
if (ret) {
|
|
dev_err(dev, "%s: error parsing %s: %d\n", __func__, name, ret);
|
|
ret = -EINVAL;
|
|
goto free_microvolt;
|
|
}
|
|
|
|
/* Search for "opp-microamp-<name>" */
|
|
prop = NULL;
|
|
if (opp_table->prop_name) {
|
|
snprintf(name, sizeof(name), "opp-microamp-%s",
|
|
opp_table->prop_name);
|
|
prop = of_find_property(opp->np, name, NULL);
|
|
}
|
|
|
|
if (!prop) {
|
|
/* Search for "opp-microamp" */
|
|
sprintf(name, "opp-microamp");
|
|
prop = of_find_property(opp->np, name, NULL);
|
|
}
|
|
|
|
if (prop) {
|
|
icount = of_property_count_u32_elems(opp->np, name);
|
|
if (icount < 0) {
|
|
dev_err(dev, "%s: Invalid %s property (%d)\n", __func__,
|
|
name, icount);
|
|
ret = icount;
|
|
goto free_microvolt;
|
|
}
|
|
|
|
if (icount != supplies) {
|
|
dev_err(dev, "%s: Invalid number of elements in %s property (%d) with supplies (%d)\n",
|
|
__func__, name, icount, supplies);
|
|
ret = -EINVAL;
|
|
goto free_microvolt;
|
|
}
|
|
|
|
microamp = kmalloc_array(icount, sizeof(*microamp), GFP_KERNEL);
|
|
if (!microamp) {
|
|
ret = -EINVAL;
|
|
goto free_microvolt;
|
|
}
|
|
|
|
ret = of_property_read_u32_array(opp->np, name, microamp,
|
|
icount);
|
|
if (ret) {
|
|
dev_err(dev, "%s: error parsing %s: %d\n", __func__,
|
|
name, ret);
|
|
ret = -EINVAL;
|
|
goto free_microamp;
|
|
}
|
|
}
|
|
|
|
for (i = 0, j = 0; i < supplies; i++) {
|
|
opp->supplies[i].u_volt = microvolt[j++];
|
|
|
|
if (vcount == supplies) {
|
|
opp->supplies[i].u_volt_min = opp->supplies[i].u_volt;
|
|
opp->supplies[i].u_volt_max = opp->supplies[i].u_volt;
|
|
} else {
|
|
opp->supplies[i].u_volt_min = microvolt[j++];
|
|
opp->supplies[i].u_volt_max = microvolt[j++];
|
|
}
|
|
|
|
if (microamp)
|
|
opp->supplies[i].u_amp = microamp[i];
|
|
}
|
|
|
|
free_microamp:
|
|
kfree(microamp);
|
|
free_microvolt:
|
|
kfree(microvolt);
|
|
|
|
return ret;
|
|
}
|
|
|
|
/**
|
|
* dev_pm_opp_of_remove_table() - Free OPP table entries created from static DT
|
|
* entries
|
|
* @dev: device pointer used to lookup OPP table.
|
|
*
|
|
* Free OPPs created using static entries present in DT.
|
|
*/
|
|
void dev_pm_opp_of_remove_table(struct device *dev)
|
|
{
|
|
_dev_pm_opp_find_and_remove_table(dev, false);
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table);
|
|
|
|
/* Returns opp descriptor node for a device node, caller must
|
|
* do of_node_put() */
|
|
static struct device_node *_opp_of_get_opp_desc_node(struct device_node *np,
|
|
int index)
|
|
{
|
|
/* "operating-points-v2" can be an array for power domain providers */
|
|
return of_parse_phandle(np, "operating-points-v2", index);
|
|
}
|
|
|
|
/* Returns opp descriptor node for a device, caller must do of_node_put() */
|
|
struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev)
|
|
{
|
|
return _opp_of_get_opp_desc_node(dev->of_node, 0);
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_of_get_opp_desc_node);
|
|
|
|
/**
|
|
* _opp_add_static_v2() - Allocate static OPPs (As per 'v2' DT bindings)
|
|
* @opp_table: OPP table
|
|
* @dev: device for which we do this operation
|
|
* @np: device node
|
|
*
|
|
* This function adds an opp definition to the opp table and returns status. The
|
|
* opp can be controlled using dev_pm_opp_enable/disable functions and may be
|
|
* removed by dev_pm_opp_remove.
|
|
*
|
|
* Return:
|
|
* 0 On success OR
|
|
* Duplicate OPPs (both freq and volt are same) and opp->available
|
|
* -EEXIST Freq are same and volt are different OR
|
|
* Duplicate OPPs (both freq and volt are same) and !opp->available
|
|
* -ENOMEM Memory allocation failure
|
|
* -EINVAL Failed parsing the OPP node
|
|
*/
|
|
static int _opp_add_static_v2(struct opp_table *opp_table, struct device *dev,
|
|
struct device_node *np)
|
|
{
|
|
struct dev_pm_opp *new_opp;
|
|
u64 rate = 0;
|
|
u32 val;
|
|
int ret;
|
|
bool rate_not_available = false;
|
|
|
|
new_opp = _opp_allocate(opp_table);
|
|
if (!new_opp)
|
|
return -ENOMEM;
|
|
|
|
ret = of_property_read_u64(np, "opp-hz", &rate);
|
|
if (ret < 0) {
|
|
/* "opp-hz" is optional for devices like power domains. */
|
|
if (!of_find_property(dev->of_node, "#power-domain-cells",
|
|
NULL)) {
|
|
dev_err(dev, "%s: opp-hz not found\n", __func__);
|
|
goto free_opp;
|
|
}
|
|
|
|
rate_not_available = true;
|
|
} else {
|
|
/*
|
|
* Rate is defined as an unsigned long in clk API, and so
|
|
* casting explicitly to its type. Must be fixed once rate is 64
|
|
* bit guaranteed in clk API.
|
|
*/
|
|
new_opp->rate = (unsigned long)rate;
|
|
}
|
|
|
|
/* Check if the OPP supports hardware's hierarchy of versions or not */
|
|
if (!_opp_is_supported(dev, opp_table, np)) {
|
|
dev_dbg(dev, "OPP not supported by hardware: %llu\n", rate);
|
|
goto free_opp;
|
|
}
|
|
|
|
new_opp->turbo = of_property_read_bool(np, "turbo-mode");
|
|
|
|
new_opp->np = np;
|
|
new_opp->dynamic = false;
|
|
new_opp->available = true;
|
|
|
|
if (!of_property_read_u32(np, "clock-latency-ns", &val))
|
|
new_opp->clock_latency_ns = val;
|
|
|
|
new_opp->pstate = of_genpd_opp_to_performance_state(dev, np);
|
|
|
|
ret = opp_parse_supplies(new_opp, dev, opp_table);
|
|
if (ret)
|
|
goto free_opp;
|
|
|
|
ret = _opp_add(dev, new_opp, opp_table, rate_not_available);
|
|
if (ret) {
|
|
/* Don't return error for duplicate OPPs */
|
|
if (ret == -EBUSY)
|
|
ret = 0;
|
|
goto free_opp;
|
|
}
|
|
|
|
/* OPP to select on device suspend */
|
|
if (of_property_read_bool(np, "opp-suspend")) {
|
|
if (opp_table->suspend_opp) {
|
|
dev_warn(dev, "%s: Multiple suspend OPPs found (%lu %lu)\n",
|
|
__func__, opp_table->suspend_opp->rate,
|
|
new_opp->rate);
|
|
} else {
|
|
new_opp->suspend = true;
|
|
opp_table->suspend_opp = new_opp;
|
|
}
|
|
}
|
|
|
|
if (new_opp->clock_latency_ns > opp_table->clock_latency_ns_max)
|
|
opp_table->clock_latency_ns_max = new_opp->clock_latency_ns;
|
|
|
|
pr_debug("%s: turbo:%d rate:%lu uv:%lu uvmin:%lu uvmax:%lu latency:%lu\n",
|
|
__func__, new_opp->turbo, new_opp->rate,
|
|
new_opp->supplies[0].u_volt, new_opp->supplies[0].u_volt_min,
|
|
new_opp->supplies[0].u_volt_max, new_opp->clock_latency_ns);
|
|
|
|
/*
|
|
* Notify the changes in the availability of the operable
|
|
* frequency/voltage list.
|
|
*/
|
|
blocking_notifier_call_chain(&opp_table->head, OPP_EVENT_ADD, new_opp);
|
|
return 0;
|
|
|
|
free_opp:
|
|
_opp_free(new_opp);
|
|
|
|
return ret;
|
|
}
|
|
|
|
/* Initializes OPP tables based on new bindings */
|
|
static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np)
|
|
{
|
|
struct device_node *np;
|
|
struct opp_table *opp_table;
|
|
int ret = 0, count = 0, pstate_count = 0;
|
|
struct dev_pm_opp *opp;
|
|
|
|
opp_table = _managed_opp(opp_np);
|
|
if (opp_table) {
|
|
/* OPPs are already managed */
|
|
if (!_add_opp_dev(dev, opp_table))
|
|
ret = -ENOMEM;
|
|
goto put_opp_table;
|
|
}
|
|
|
|
opp_table = dev_pm_opp_get_opp_table(dev);
|
|
if (!opp_table)
|
|
return -ENOMEM;
|
|
|
|
/* We have opp-table node now, iterate over it and add OPPs */
|
|
for_each_available_child_of_node(opp_np, np) {
|
|
count++;
|
|
|
|
ret = _opp_add_static_v2(opp_table, dev, np);
|
|
if (ret) {
|
|
dev_err(dev, "%s: Failed to add OPP, %d\n", __func__,
|
|
ret);
|
|
_dev_pm_opp_remove_table(opp_table, dev, false);
|
|
of_node_put(np);
|
|
goto put_opp_table;
|
|
}
|
|
}
|
|
|
|
/* There should be one of more OPP defined */
|
|
if (WARN_ON(!count)) {
|
|
ret = -ENOENT;
|
|
goto put_opp_table;
|
|
}
|
|
|
|
list_for_each_entry(opp, &opp_table->opp_list, node)
|
|
pstate_count += !!opp->pstate;
|
|
|
|
/* Either all or none of the nodes shall have performance state set */
|
|
if (pstate_count && pstate_count != count) {
|
|
dev_err(dev, "Not all nodes have performance state set (%d: %d)\n",
|
|
count, pstate_count);
|
|
ret = -ENOENT;
|
|
_dev_pm_opp_remove_table(opp_table, dev, false);
|
|
goto put_opp_table;
|
|
}
|
|
|
|
if (pstate_count)
|
|
opp_table->genpd_performance_state = true;
|
|
|
|
opp_table->np = opp_np;
|
|
if (of_property_read_bool(opp_np, "opp-shared"))
|
|
opp_table->shared_opp = OPP_TABLE_ACCESS_SHARED;
|
|
else
|
|
opp_table->shared_opp = OPP_TABLE_ACCESS_EXCLUSIVE;
|
|
|
|
put_opp_table:
|
|
dev_pm_opp_put_opp_table(opp_table);
|
|
|
|
return ret;
|
|
}
|
|
|
|
/* Initializes OPP tables based on old-deprecated bindings */
|
|
static int _of_add_opp_table_v1(struct device *dev)
|
|
{
|
|
struct opp_table *opp_table;
|
|
const struct property *prop;
|
|
const __be32 *val;
|
|
int nr, ret = 0;
|
|
|
|
prop = of_find_property(dev->of_node, "operating-points", NULL);
|
|
if (!prop)
|
|
return -ENODEV;
|
|
if (!prop->value)
|
|
return -ENODATA;
|
|
|
|
/*
|
|
* Each OPP is a set of tuples consisting of frequency and
|
|
* voltage like <freq-kHz vol-uV>.
|
|
*/
|
|
nr = prop->length / sizeof(u32);
|
|
if (nr % 2) {
|
|
dev_err(dev, "%s: Invalid OPP table\n", __func__);
|
|
return -EINVAL;
|
|
}
|
|
|
|
opp_table = dev_pm_opp_get_opp_table(dev);
|
|
if (!opp_table)
|
|
return -ENOMEM;
|
|
|
|
val = prop->value;
|
|
while (nr) {
|
|
unsigned long freq = be32_to_cpup(val++) * 1000;
|
|
unsigned long volt = be32_to_cpup(val++);
|
|
|
|
ret = _opp_add_v1(opp_table, dev, freq, volt, false);
|
|
if (ret) {
|
|
dev_err(dev, "%s: Failed to add OPP %ld (%d)\n",
|
|
__func__, freq, ret);
|
|
_dev_pm_opp_remove_table(opp_table, dev, false);
|
|
break;
|
|
}
|
|
nr -= 2;
|
|
}
|
|
|
|
dev_pm_opp_put_opp_table(opp_table);
|
|
return ret;
|
|
}
|
|
|
|
/**
|
|
* dev_pm_opp_of_add_table() - Initialize opp table from device tree
|
|
* @dev: device pointer used to lookup OPP table.
|
|
*
|
|
* Register the initial OPP table with the OPP library for given device.
|
|
*
|
|
* Return:
|
|
* 0 On success OR
|
|
* Duplicate OPPs (both freq and volt are same) and opp->available
|
|
* -EEXIST Freq are same and volt are different OR
|
|
* Duplicate OPPs (both freq and volt are same) and !opp->available
|
|
* -ENOMEM Memory allocation failure
|
|
* -ENODEV when 'operating-points' property is not found or is invalid data
|
|
* in device node.
|
|
* -ENODATA when empty 'operating-points' property is found
|
|
* -EINVAL when invalid entries are found in opp-v2 table
|
|
*/
|
|
int dev_pm_opp_of_add_table(struct device *dev)
|
|
{
|
|
struct device_node *opp_np;
|
|
int ret;
|
|
|
|
/*
|
|
* OPPs have two version of bindings now. The older one is deprecated,
|
|
* try for the new binding first.
|
|
*/
|
|
opp_np = dev_pm_opp_of_get_opp_desc_node(dev);
|
|
if (!opp_np) {
|
|
/*
|
|
* Try old-deprecated bindings for backward compatibility with
|
|
* older dtbs.
|
|
*/
|
|
return _of_add_opp_table_v1(dev);
|
|
}
|
|
|
|
ret = _of_add_opp_table_v2(dev, opp_np);
|
|
of_node_put(opp_np);
|
|
|
|
return ret;
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table);
|
|
|
|
/**
|
|
* dev_pm_opp_of_add_table_indexed() - Initialize indexed opp table from device tree
|
|
* @dev: device pointer used to lookup OPP table.
|
|
* @index: Index number.
|
|
*
|
|
* Register the initial OPP table with the OPP library for given device only
|
|
* using the "operating-points-v2" property.
|
|
*
|
|
* Return:
|
|
* 0 On success OR
|
|
* Duplicate OPPs (both freq and volt are same) and opp->available
|
|
* -EEXIST Freq are same and volt are different OR
|
|
* Duplicate OPPs (both freq and volt are same) and !opp->available
|
|
* -ENOMEM Memory allocation failure
|
|
* -ENODEV when 'operating-points' property is not found or is invalid data
|
|
* in device node.
|
|
* -ENODATA when empty 'operating-points' property is found
|
|
* -EINVAL when invalid entries are found in opp-v2 table
|
|
*/
|
|
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
|
|
{
|
|
struct device_node *opp_np;
|
|
int ret, count;
|
|
|
|
again:
|
|
opp_np = _opp_of_get_opp_desc_node(dev->of_node, index);
|
|
if (!opp_np) {
|
|
/*
|
|
* If only one phandle is present, then the same OPP table
|
|
* applies for all index requests.
|
|
*/
|
|
count = of_count_phandle_with_args(dev->of_node,
|
|
"operating-points-v2", NULL);
|
|
if (count == 1 && index) {
|
|
index = 0;
|
|
goto again;
|
|
}
|
|
|
|
return -ENODEV;
|
|
}
|
|
|
|
ret = _of_add_opp_table_v2(dev, opp_np);
|
|
of_node_put(opp_np);
|
|
|
|
return ret;
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table_indexed);
|
|
|
|
/* CPU device specific helpers */
|
|
|
|
/**
|
|
* dev_pm_opp_of_cpumask_remove_table() - Removes OPP table for @cpumask
|
|
* @cpumask: cpumask for which OPP table needs to be removed
|
|
*
|
|
* This removes the OPP tables for CPUs present in the @cpumask.
|
|
* This should be used only to remove static entries created from DT.
|
|
*/
|
|
void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask)
|
|
{
|
|
_dev_pm_opp_cpumask_remove_table(cpumask, true);
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_remove_table);
|
|
|
|
/**
|
|
* dev_pm_opp_of_cpumask_add_table() - Adds OPP table for @cpumask
|
|
* @cpumask: cpumask for which OPP table needs to be added.
|
|
*
|
|
* This adds the OPP tables for CPUs present in the @cpumask.
|
|
*/
|
|
int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask)
|
|
{
|
|
struct device *cpu_dev;
|
|
int cpu, ret = 0;
|
|
|
|
WARN_ON(cpumask_empty(cpumask));
|
|
|
|
for_each_cpu(cpu, cpumask) {
|
|
cpu_dev = get_cpu_device(cpu);
|
|
if (!cpu_dev) {
|
|
pr_err("%s: failed to get cpu%d device\n", __func__,
|
|
cpu);
|
|
continue;
|
|
}
|
|
|
|
ret = dev_pm_opp_of_add_table(cpu_dev);
|
|
if (ret) {
|
|
/*
|
|
* OPP may get registered dynamically, don't print error
|
|
* message here.
|
|
*/
|
|
pr_debug("%s: couldn't find opp table for cpu:%d, %d\n",
|
|
__func__, cpu, ret);
|
|
|
|
/* Free all other OPPs */
|
|
dev_pm_opp_of_cpumask_remove_table(cpumask);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_add_table);
|
|
|
|
/*
|
|
* Works only for OPP v2 bindings.
|
|
*
|
|
* Returns -ENOENT if operating-points-v2 bindings aren't supported.
|
|
*/
|
|
/**
|
|
* dev_pm_opp_of_get_sharing_cpus() - Get cpumask of CPUs sharing OPPs with
|
|
* @cpu_dev using operating-points-v2
|
|
* bindings.
|
|
*
|
|
* @cpu_dev: CPU device for which we do this operation
|
|
* @cpumask: cpumask to update with information of sharing CPUs
|
|
*
|
|
* This updates the @cpumask with CPUs that are sharing OPPs with @cpu_dev.
|
|
*
|
|
* Returns -ENOENT if operating-points-v2 isn't present for @cpu_dev.
|
|
*/
|
|
int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
|
|
struct cpumask *cpumask)
|
|
{
|
|
struct device_node *np, *tmp_np, *cpu_np;
|
|
int cpu, ret = 0;
|
|
|
|
/* Get OPP descriptor node */
|
|
np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
|
|
if (!np) {
|
|
dev_dbg(cpu_dev, "%s: Couldn't find opp node.\n", __func__);
|
|
return -ENOENT;
|
|
}
|
|
|
|
cpumask_set_cpu(cpu_dev->id, cpumask);
|
|
|
|
/* OPPs are shared ? */
|
|
if (!of_property_read_bool(np, "opp-shared"))
|
|
goto put_cpu_node;
|
|
|
|
for_each_possible_cpu(cpu) {
|
|
if (cpu == cpu_dev->id)
|
|
continue;
|
|
|
|
cpu_np = of_cpu_device_node_get(cpu);
|
|
if (!cpu_np) {
|
|
dev_err(cpu_dev, "%s: failed to get cpu%d node\n",
|
|
__func__, cpu);
|
|
ret = -ENOENT;
|
|
goto put_cpu_node;
|
|
}
|
|
|
|
/* Get OPP descriptor node */
|
|
tmp_np = _opp_of_get_opp_desc_node(cpu_np, 0);
|
|
of_node_put(cpu_np);
|
|
if (!tmp_np) {
|
|
pr_err("%pOF: Couldn't find opp node\n", cpu_np);
|
|
ret = -ENOENT;
|
|
goto put_cpu_node;
|
|
}
|
|
|
|
/* CPUs are sharing opp node */
|
|
if (np == tmp_np)
|
|
cpumask_set_cpu(cpu, cpumask);
|
|
|
|
of_node_put(tmp_np);
|
|
}
|
|
|
|
put_cpu_node:
|
|
of_node_put(np);
|
|
return ret;
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_of_get_sharing_cpus);
|
|
|
|
/**
|
|
* of_dev_pm_opp_find_required_opp() - Search for required OPP.
|
|
* @dev: The device whose OPP node is referenced by the 'np' DT node.
|
|
* @np: Node that contains the "required-opps" property.
|
|
*
|
|
* Returns the OPP of the device 'dev', whose phandle is present in the "np"
|
|
* node. Although the "required-opps" property supports having multiple
|
|
* phandles, this helper routine only parses the very first phandle in the list.
|
|
*
|
|
* Return: Matching opp, else returns ERR_PTR in case of error and should be
|
|
* handled using IS_ERR.
|
|
*
|
|
* The callers are required to call dev_pm_opp_put() for the returned OPP after
|
|
* use.
|
|
*/
|
|
struct dev_pm_opp *of_dev_pm_opp_find_required_opp(struct device *dev,
|
|
struct device_node *np)
|
|
{
|
|
struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ENODEV);
|
|
struct device_node *required_np;
|
|
struct opp_table *opp_table;
|
|
|
|
opp_table = _find_opp_table(dev);
|
|
if (IS_ERR(opp_table))
|
|
return ERR_CAST(opp_table);
|
|
|
|
required_np = of_parse_phandle(np, "required-opps", 0);
|
|
if (unlikely(!required_np)) {
|
|
dev_err(dev, "Unable to parse required-opps\n");
|
|
goto put_opp_table;
|
|
}
|
|
|
|
mutex_lock(&opp_table->lock);
|
|
|
|
list_for_each_entry(temp_opp, &opp_table->opp_list, node) {
|
|
if (temp_opp->available && temp_opp->np == required_np) {
|
|
opp = temp_opp;
|
|
|
|
/* Increment the reference count of OPP */
|
|
dev_pm_opp_get(opp);
|
|
break;
|
|
}
|
|
}
|
|
|
|
mutex_unlock(&opp_table->lock);
|
|
|
|
of_node_put(required_np);
|
|
put_opp_table:
|
|
dev_pm_opp_put_opp_table(opp_table);
|
|
|
|
return opp;
|
|
}
|
|
EXPORT_SYMBOL_GPL(of_dev_pm_opp_find_required_opp);
|
|
|
|
/**
|
|
* dev_pm_opp_get_of_node() - Gets the DT node corresponding to an opp
|
|
* @opp: opp for which DT node has to be returned for
|
|
*
|
|
* Return: DT node corresponding to the opp, else 0 on success.
|
|
*
|
|
* The caller needs to put the node with of_node_put() after using it.
|
|
*/
|
|
struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp)
|
|
{
|
|
if (IS_ERR_OR_NULL(opp)) {
|
|
pr_err("%s: Invalid parameters\n", __func__);
|
|
return NULL;
|
|
}
|
|
|
|
return of_node_get(opp->np);
|
|
}
|
|
EXPORT_SYMBOL_GPL(dev_pm_opp_get_of_node);
|
|
|
|
/**
|
|
* of_dev_pm_opp_get_cpu_power() - Estimates the power of a CPU
|
|
* @mW: pointer to the power estimate in milli-watts
|
|
* @KHz: pointer to the OPP's frequency, in kilo-hertz
|
|
* @cpu: CPU for which power needs to be estimated
|
|
*
|
|
* Computes the power estimated by @CPU at the first OPP above @KHz (ceil),
|
|
* and updates @KHz and @mW accordingly.
|
|
*
|
|
* The power is estimated as P = C * V^2 * f, with C the CPU's capacitance
|
|
* (read from the 'dynamic-power-coefficient' devicetree binding) and V and f
|
|
* respectively the voltage and frequency of the OPP.
|
|
*
|
|
* Return: -ENODEV if the CPU device cannot be found, -EINVAL if the power
|
|
* calculation failed because of missing parameters, 0 otherwise.
|
|
*/
|
|
int of_dev_pm_opp_get_cpu_power(unsigned long *mW, unsigned long *KHz, int cpu)
|
|
{
|
|
unsigned long mV, Hz, MHz;
|
|
struct device *cpu_dev;
|
|
struct dev_pm_opp *opp;
|
|
struct device_node *np;
|
|
u32 cap;
|
|
u64 tmp;
|
|
int ret;
|
|
|
|
cpu_dev = get_cpu_device(cpu);
|
|
if (!cpu_dev)
|
|
return -ENODEV;
|
|
|
|
np = of_node_get(cpu_dev->of_node);
|
|
if (!np)
|
|
return -EINVAL;
|
|
|
|
ret = of_property_read_u32(np, "dynamic-power-coefficient", &cap);
|
|
of_node_put(np);
|
|
if (ret)
|
|
return -EINVAL;
|
|
|
|
Hz = *KHz * 1000;
|
|
opp = dev_pm_opp_find_freq_ceil(cpu_dev, &Hz);
|
|
if (IS_ERR(opp))
|
|
return -EINVAL;
|
|
|
|
mV = dev_pm_opp_get_voltage(opp) / 1000;
|
|
dev_pm_opp_put(opp);
|
|
if (!mV)
|
|
return -EINVAL;
|
|
|
|
MHz = Hz / 1000000;
|
|
tmp = (u64)cap * mV * mV * MHz;
|
|
do_div(tmp, 1000000000);
|
|
|
|
*mW = (unsigned long)tmp;
|
|
*KHz = Hz / 1000;
|
|
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL_GPL(of_dev_pm_opp_get_cpu_power);
|