Merge branch 'android-4.19-stable' of https://android.googlesource.com/kernel/common into lineage-21
* 'android-4.19-stable' of https://android.googlesource.com/kernel/common: Revert "UPSTREAM: unicode: Don't special case ignorable code points" Reapply "UPSTREAM: unicode: Don't special case ignorable code points" Revert "UPSTREAM: unicode: Don't special case ignorable code points" Linux 4.19.325 sh: intc: Fix use-after-free bug in register_intc_controller() modpost: remove incorrect code in do_eisa_entry() 9p/xen: fix release of IRQ 9p/xen: fix init sequence block: return unsigned int from bdev_io_min jffs2: fix use of uninitialized variable ubi: fastmap: Fix duplicate slab cache names while attaching ubifs: Correct the total block count by deducting journal reservation rtc: check if __rtc_read_time was successful in rtc_timer_do_work() NFSv4.0: Fix a use-after-free problem in the asynchronous open() um: Fix the return value of elf_core_copy_task_fpregs rpmsg: glink: Propagate TX failures in intentless mode as well NFSD: Prevent a potential integer overflow lib: string_helpers: silence snprintf() output truncation warning usb: dwc3: gadget: Fix checking for number of TRBs left media: wl128x: Fix atomicity violation in fmc_send_cmd() HID: wacom: Interpret tilt data from Intuos Pro BT as signed values block: fix ordering between checking BLK_MQ_S_STOPPED request adding arm64: tls: Fix context-switching of tpidrro_el0 when kpti is enabled sh: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK um: vector: Do not use drvdata in release serial: 8250: omap: Move pm_runtime_get_sync um: net: Do not use drvdata in release um: ubd: Do not use drvdata in release ubi: wl: Put source PEB into correct list if trying locking LEB failed spi: Fix acpi deferred irq probe netfilter: ipset: add missing range check in bitmap_ip_uadt Revert "serial: sh-sci: Clean sci_ports[0] after at earlycon exit" serial: sh-sci: Clean sci_ports[0] after at earlycon exit Revert "usb: gadget: composite: fix OS descriptors w_value logic" ALSA: usb-audio: Fix potential out-of-bound accesses for Extigy and Mbox devices Bluetooth: Fix type of len in rfcomm_sock_getsockopt{,_old}() tty: ldsic: fix tty_ldisc_autoload sysctl's proc_handler PCI: Fix use-after-free of slot->bus on hot remove ASoC: codecs: Fix atomicity violation in snd_soc_component_get_drvdata() jfs: xattr: check invalid xattr size more strictly ext4: fix FS_IOC_GETFSMAP handling ext4: supress data-race warnings in ext4_free_inodes_{count,set}() usb: ehci-spear: fix call balance of sehci clk handling routines apparmor: fix 'Do simple duplicate message elimination' misc: apds990x: Fix missing pm_runtime_disable() USB: chaoskey: Fix possible deadlock chaoskey_list_lock USB: chaoskey: fail open after removal usb: using mutex lock and supporting O_NONBLOCK flag in iowarrior_read() net: stmmac: dwmac-socfpga: Set RX watchdog interrupt as broken marvell: pxa168_eth: fix call balance of pep->clk handling routines net: usb: lan78xx: Fix refcounting and autosuspend on invalid WoL configuration tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets net: usb: lan78xx: Fix memory leak on device unplug by freeing PHY device power: supply: core: Remove might_sleep() from power_supply_put() vfio/pci: Properly hide first-in-list PCIe extended capability NFSD: Cap the number of bytes copied by nfs4_reset_recoverydir() NFSD: Prevent NULL dereference in nfsd4_process_cb_update() rpmsg: glink: use only lower 16-bits of param2 for CMD_OPEN name length rpmsg: glink: Fix GLINK command prefix rpmsg: glink: Send READ_NOTIFY command in FIFO full case rpmsg: glink: Add TX_DATA_CONT command while sending m68k: coldfire/device.c: only build FEC when HW macros are defined m68k: mcfgpio: Fix incorrect register offset for CONFIG_M5441x PCI: cpqphp: Fix PCIBIOS_* return value confusion PCI: cpqphp: Use PCI_POSSIBLE_ERROR() to check config reads perf probe: Correct demangled symbols in C++ program clk: clk-axi-clkgen: make sure to enable the AXI bus clock clk: axi-clkgen: use devm_platform_ioremap_resource() short-hand dt-bindings: clock: axi-clkgen: include AXI clk dt-bindings: clock: adi,axi-clkgen: convert old binding to yaml format fbdev: sh7760fb: Fix a possible memory leak in sh7760fb_alloc_mem() fbdev/sh7760fb: Alloc DMA memory from hardware device powerpc/sstep: make emulate_vsx_load and emulate_vsx_store static ocfs2: fix uninitialized value in ocfs2_file_read_iter() scsi: qedi: Fix a possible memory leak in qedi_alloc_and_init_sb() scsi: fusion: Remove unused variable 'rc' scsi: bfa: Fix use-after-free in bfad_im_module_exit() mfd: rt5033: Fix missing regmap_del_irq_chip() RDMA/bnxt_re: Check cqe flags to know imm_data vs inv_irkey mtd: rawnand: atmel: Fix possible memory leak cpufreq: loongson2: Unregister platform_driver on failure mfd: da9052-spi: Change read-mask to write-mask powerpc/vdso: Flag VDSO64 entry points as functions trace/trace_event_perf: remove duplicate samples on the first tracepoint event netpoll: Use rcu_access_pointer() in netpoll_poll_lock ALSA: 6fire: Release resources at card release ALSA: caiaq: Use snd_card_free_when_closed() at disconnection ALSA: us122l: Use snd_card_free_when_closed() at disconnection net: rfkill: gpio: Add check for clk_enable() drm/etnaviv: hold GPU lock across perfmon sampling drm/etnaviv: fix power register offset on GC300 drm/etnaviv: dump: fix sparse warnings drm/etnaviv: consolidate hardware fence handling in etnaviv_gpu wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_config_scan() bpf: Fix the xdp_adjust_tail sample prog issue drm/omap: Fix locking in omap_gem_new_dmabuf() wifi: ath9k: add range check for conn_rsp_epid in htc_connect_service() drm/mm: Mark drm_mm_interval_tree*() functions with __maybe_unused firmware: arm_scpi: Check the DVFS OPP count returned by the firmware regmap: irq: Set lockdep class for hierarchical IRQ domains ARM: dts: cubieboard4: Fix DCDC5 regulator constraints mmc: mmc_spi: drop buggy snprintf() soc: qcom: geni-se: fix array underflow in geni_se_clk_tbl_get() time: Fix references to _msecs_to_jiffies() handling of values crypto: cavium - Fix an error handling path in cpt_ucode_load_fw() crypto: bcm - add error check in the ahash_hmac_init function crypto: cavium - Fix the if condition to exit loop after timeout crypto: pcrypt - Call crypto layer directly when padata_do_parallel() return -EBUSY EDAC/fsl_ddr: Fix bad bit shift operations hfsplus: don't query the device logical block size multiple times s390/syscalls: Avoid creation of arch/arch/ directory acpi/arm64: Adjust error handling procedure in gtdt_parse_timer_block() m68k: mvme147: Reinstate early console m68k: mvme16x: Add and use "mvme16x.h" m68k: mvme147: Fix SCSI controller IRQ numbers initramfs: avoid filename buffer overrun nvme: fix metadata handling in nvme-passthrough proc/softirqs: replace seq_printf with seq_put_decimal_ull_width net: usb: qmi_wwan: add Quectel RG650V x86/amd_nb: Fix compile-testing without CONFIG_AMD_NB selftests/watchdog-test: Fix system accidentally reset after watchdog-test mac80211: fix user-power when emulating chanctx ASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet mm: revert "mm: shmem: fix data-race in shmem_getattr()" kbuild: Use uname for LINUX_COMPILE_HOST detection media: dvbdev: fix the logic when DVB_DYNAMIC_MINORS is not set Revert "mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K" nilfs2: fix null-ptr-deref in block_dirty_buffer tracepoint ocfs2: fix UBSAN warning in ocfs2_verify_volume() nilfs2: fix null-ptr-deref in block_touch_buffer tracepoint ocfs2: uncache inode which has failed entering the group netlink: terminate outstanding dump on socket close Linux 4.19.324 9p: fix slab cache name creation for real net: usb: qmi_wwan: add Fibocom FG132 0x0112 composition fs: Fix uninitialized value issue in from_kuid and from_kgid powerpc/powernv: Free name on error in opal_event_init() sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML bpf: use kvzmalloc to allocate BPF verifier environment HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad 9p: Avoid creating multiple slab caches with the same name ALSA: usb-audio: Add endianness annotations vsock/virtio: Initialization of the dangling pointer occurring in vsk->trans hv_sock: Initializing vsk->trans to NULL to prevent a dangling pointer ALSA: usb-audio: Add quirks for Dell WD19 dock ALSA: usb-audio: Support jack detection on Dell dock ALSA: usb-audio: Add custom mixer status quirks for RME CC devices ALSA: pcm: Return 0 when size < start_threshold in capture ocfs2: remove entry once instead of null-ptr-dereference in ocfs2_xa_remove() irqchip/gic-v3: Force propagation of the active state with a read-back USB: serial: option: add Quectel RG650V USB: serial: option: add Fibocom FG132 0x0112 composition USB: serial: qcserial: add support for Sierra Wireless EM86xx USB: serial: io_edgeport: fix use after free in debug printk usb: musb: sunxi: Fix accessing an released usb phy fs/proc: fix compile warning about variable 'vmcore_mmap_ops' media: uvcvideo: Skip parsing frames of type UVC_VS_UNDEFINED in uvc_parse_format net: bridge: xmit: make sure we have at least eth header len bytes bonding (gcc13): synchronize bond_{a,t}lb_xmit() types btrfs: reinitialize delayed ref list after deleting it from the list nfs: Fix KMSAN warning in decode_getfattr_attrs() dm-unstriped: cast an operand to sector_t to prevent potential uint32_t overflow dm cache: fix potential out-of-bounds access on the first resume dm cache: optimize dirty bit checking with find_next_bit when resizing dm cache: fix out-of-bounds access to the dirty bitset when resizing dm cache: correct the number of origin blocks to match the target length drm/amdgpu: prevent NULL pointer dereference if ATIF is not supported drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read() media: v4l2-tpg: prevent the risk of a division by zero media: cx24116: prevent overflows on SNR calculus media: s5p-jpeg: prevent buffer overflows ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init() media: adv7604: prevent underflow condition when reporting colorspace media: dvb_frontend: don't play tricks with underflow values media: dvbdev: prevent the risk of out of memory access media: stb0899_algo: initialize cfr before using it net: hns3: fix kernel crash when uninstalling driver can: c_can: fix {rx,tx}_errors statistics sctp: properly validate chunk size in sctp_sf_ootb() security/keys: fix slab-out-of-bounds in key_task_permission HID: core: zero-initialize the report buffer ARM: dts: rockchip: Fix the realtek audio codec on rk3036-kylin ARM: dts: rockchip: drop grf reference from rk3036 hdmi ARM: dts: rockchip: fix rk3036 acodec node arm64: dts: rockchip: Fix rt5651 compatible value on rk3399-sapphire-excavator Linux 4.19.323 vt: prevent kernel-infoleak in con_font_get() mm: shmem: fix data-race in shmem_getattr() nilfs2: fix kernel bug due to missing clearing of checked flag ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow nilfs2: fix potential deadlock with newly created symlinks wifi: iwlegacy: Clear stale interrupts before resuming device wifi: ath10k: Fix memory leak in management tx wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower Revert "driver core: Fix uevent_show() vs driver detach race" xhci: Fix Link TRB DMA in command ring stopped completion event usb: phy: Fix API devm_usb_put_phy() can not release the phy usbip: tools: Fix detach_port() invalid port error path misc: sgi-gru: Don't disable preemption in GRU driver net: amd: mvme147: Fix probe banner message firmware: arm_sdei: Fix the input parameter of cpuhp_remove_state() netfilter: nft_payload: sanitize offset and length before calling skb_checksum() net: skip offload for NETIF_F_IPV6_CSUM if ipv6 header contains extension net: support ip generic csum processing in skb_csum_hwoffload_help bpf: Fix out-of-bounds write in trie_get_next_key() net/sched: stop qdisc_tree_reduce_backlog on TC_H_ROOT gtp: allow -1 to be specified as file description from userspace gtp: simplify error handling code in 'gtp_encap_enable()' wifi: mac80211: skip non-uploaded keys in ieee80211_iter_keys cgroup: Fix potential overflow issue when checking max_depth usb: dwc3: core: Stop processing of pending events if controller is halted usb: dwc3: Add splitdisable quirk for Hisilicon Kirin Soc usb: dwc3: remove generic PHY calibrate() calls xfrm: validate new SA's prefixlen using SA family when sel.family is unset arm64/uprobes: change the uprobe_opcode_t typedef to fix the sparse warning selinux: improve error checking in sel_write_load() hv_netvsc: Fix VF namespace also in synthetic NIC NETDEV_REGISTER event nilfs2: fix kernel bug due to missing clearing of buffer delay flag ACPI: button: Add DMI quirk for Samsung Galaxy Book2 to fix initial lid detection issue drm/amd: Guard against bad data for ATIF ACPI method ALSA: hda/realtek: Update default depop procedure posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime() net: usb: usbnet: fix name regression be2net: fix potential memory leak in be_xmit() net/sun3_82586: fix potential memory leak in sun3_82586_send_packet() jfs: Fix sanity check in dbMount udf: fix uninit-value use in udf_get_fileshortad KVM: s390: gaccess: Check if guest address is in memslot KVM: s390: gaccess: Cleanup access to guest pages KVM: s390: gaccess: Refactor access address range check KVM: s390: gaccess: Refactor gpa and length calculation arm64: probes: Fix uprobes for big-endian kernels arm64:uprobe fix the uprobe SWBP_INSN in big-endian Bluetooth: bnep: fix wild-memory-access in proto_unregister usb: typec: altmode should keep reference to parent net: systemport: fix potential memory leak in bcm_sysport_xmit() net: ethernet: aeroflex: fix potential memory leak in greth_start_xmit_gbit() macsec: don't increment counters for an unrelated SA drm/msm/dsi: fix 32-bit signed integer extension in pclk_rate calculation RDMA/bnxt_re: Return more meaningful error RDMA/cxgb4: Fix RDMA_CM_EVENT_UNREACHABLE error for iWARP RDMA/bnxt_re: Fix incorrect AVID type in WQE structure clk: Fix slab-out-of-bounds error in devm_clk_release() clk: Fix pointer casting to prevent oops in devm_clk_release() nilfs2: propagate directory read errors from nilfs_find_entry() x86/apic: Always explicitly disarm TSC-deadline timer parport: Proper fix for array out-of-bounds access USB: serial: option: add Telit FN920C04 MBIM compositions USB: serial: option: add support for Quectel EG916Q-GL xhci: Fix incorrect stream context type macro Bluetooth: btusb: Fix regression with fake CSR controllers 0a12:0001 Bluetooth: Remove debugfs directory on module init failure iio: light: opt3001: add missing full-scale range value iio: hid-sensors: Fix an error handling path in _hid_sensor_set_report_latency() iio: adc: ti-ads8688: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: dac: stm32-dac-core: add missing select REGMAP_MMIO in Kconfig drm/vmwgfx: Handle surface check failure correctly x86/cpufeatures: Define X86_FEATURE_AMD_IBPB_RET KVM: s390: Change virtual to physical address access in diag 0x258 handler s390/sclp_vt220: Convert newlines to CRLF instead of LFCR net: dsa: mv88e6xxx: Fix out-of-bound access KVM: Fix a data race on last_boosted_vcpu in kvm_vcpu_on_spin() fat: fix uninitialized variable PCI: Add function 0 DMA alias quirk for Glenfly Arise chip arm64: probes: Fix simulate_ldr*_literal() arm64: probes: Remove broken LDR (literal) uprobe support posix-clock: Fix missing timespec64 check in pc_clock_settime() net: Fix an unsafe loop on the list usb: storage: ignore bogus device raised by JieLi BR21 USB sound chip usb: xhci: Fix problem with xhci resume from suspend Revert "usb: yurex: Replace snprintf() with the safer scnprintf() variant" HID: plantronics: Workaround for an unexcepted opposite volume key CDC-NCM: avoid overflow in sanity checking net: ipv6: ensure we call ipv6_mc_down() at most once ppp: fix ppp_async_encode() illegal access net: ibm: emac: mal: fix wrong goto igb: Do not bring the device up after non-fatal error gpio: aspeed: Use devm_clk api to manage clock source clk: Provide new devm_clk helpers for prepared and enabled clocks clk: generalize devm_clk_get() a bit clk: Add (devm_)clk_get_optional() functions gpio: aspeed: Add the flush write to ensure the write complete. Bluetooth: RFCOMM: FIX possible deadlock in rfcomm_sk_state_change netfilter: br_netfilter: fix panic with metadata_dst skb tcp: fix tcp_enter_recovery() to zero retrans_stamp when it's safe SUNRPC: Fix integer overflow in decode_rc_list() NFS: Remove print_overflow_msg() fbdev: sisfb: Fix strbuf array overflow driver core: bus: Return -EIO instead of 0 when show/store invalid bus attribute tools/iio: Add memory allocation failure check for trigger_name usb: chipidea: udc: enable suspend interrupt after usb reset media: videobuf2-core: clear memory related fields in __vb2_plane_dmabuf_put() PCI: Mark Creative Labs EMU20k2 INTx masking as broken i2c: i801: Use a different adapter-name for IDF adapters clk: bcm: bcm53573: fix OF node leak in init ktest.pl: Avoid false positives with grub2 skip regex s390/cpum_sf: Remove WARN_ON_ONCE statements ext4: nested locking for xattr inode s390/mm: Add cond_resched() to cmm_alloc/free_pages() s390/facility: Disable compile time optimization for decompressor code bpf: Check percpu map value size first Input: synaptics-rmi4 - fix UAF of IRQ domain on driver removal virtio_console: fix misc probe bugs drm/crtc: fix uninitialized variable use even harder drm: Move drm_mode_setcrtc() local re-init to failure path tracing: Remove precision vsnprintf() check from print event net: ethernet: cortina: Drop TSO support ext4: fix inode tree inconsistency caused by ENOMEM ACPI: battery: Fix possible crash when unregistering a battery hook ACPI: battery: Simplify battery hook locking rtc: at91sam9: fix OF node leak in probe() error path rtc: at91sam9: drop platform_data support nfsd: fix delegation_blocked() to block correctly for at least 30 seconds nfsd: use ktime_get_seconds() for timestamps uprobes: fix kernel info leak via "[uprobes]" vma arm64: errata: Expand speculative SSBS workaround once more arm64: cputype: Add Neoverse-N3 definitions arm64: Add Cortex-715 CPU part definition ext4: update orig_path in ext4_find_extent() ext4: fix slab-use-after-free in ext4_split_extent_at() ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path gpio: davinci: fix lazy disable btrfs: wait for fixup workers before stopping cleaner kthread during umount Input: adp5589-keys - fix adp5589_gpio_get_value() tomoyo: fallback to realpath if symlink's pathname does not exist iio: magnetometer: ak8975: Fix reading for ak099xx sensors media: venus: fix use after free bug in venus_remove due to race condition media: uapi/linux/cec.h: cec_msg_set_reply_to: zero flags clk: rockchip: fix error for unknown clocks aoe: fix the potential use-after-free problem in more places riscv: define ILLEGAL_POINTER_VALUE for 64bit ocfs2: fix possible null-ptr-deref in ocfs2_set_buffer_uptodate ocfs2: fix null-ptr-deref when journal load failed. ocfs2: remove unreasonable unlock in ocfs2_read_blocks ocfs2: cancel dqi_sync_work before freeing oinfo ocfs2: reserve space for inline xattr before attaching reflink tree ocfs2: fix uninit-value in ocfs2_get_block() ocfs2: fix the la space leak when unmounting an ocfs2 volume jbd2: stop waiting for space when jbd2_cleanup_journal_tail() returns error of/irq: Support #msi-cells=<0> in of_msi_get_domain parisc: Fix 64-bit userspace syscall path ext4: fix incorrect tid assumption in ext4_wait_for_tail_page_commit() ext4: fix double brelse() the buffer of the extents path ext4: aovid use-after-free in ext4_ext_insert_extent() ext4: fix incorrect tid assumption in __jbd2_log_wait_for_space() ext4: propagate errors from ext4_find_extent() in ext4_insert_range() ext4: no need to continue when the number of entries is 1 ALSA: core: add isascii() check to card ID generator parisc: Fix itlb miss handler for 64-bit programs perf/core: Fix small negative period being ignored spi: bcm63xx: Fix module autoloading i2c: xiic: Wait for TX empty to avoid missed TX NAKs selftests: vDSO: fix vDSO symbols lookup for powerpc64 selftests: breakpoints: use remaining time to check if suspend succeed spi: s3c64xx: fix timeout counters in flush_fifo ext4: fix i_data_sem unlock order in ext4_ind_migrate() ext4: ext4_search_dir should return a proper error of/irq: Refer to actual buffer size in of_irq_parse_one() drm/radeon/r100: Handle unknown family in r100_cp_init_microcode() scsi: aacraid: Rearrange order of struct aac_srb_unit drm/printer: Allow NULL data in devcoredump printer drm/amd/display: Fix index out of bounds in degamma hardware format translation drm/amd/display: Check stream before comparing them jfs: Fix uninit-value access of new_ea in ea_buffer jfs: check if leafidx greater than num leaves per dmap tree jfs: Fix uaf in dbFreeBits jfs: UBSAN: shift-out-of-bounds in dbFindBits ata: sata_sil: Rename sil_blacklist to sil_quirks power: reset: brcmstb: Do not go into infinite loop if reset fails fbdev: pxafb: Fix possible use after free in pxafb_task() ALSA: hdsp: Break infinite MIDI input flush loop ALSA: asihpi: Fix potential OOB array access signal: Replace BUG_ON()s wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_cmd_802_11_scan_ext() ACPICA: iasl: handle empty connection_node tcp: avoid reusing FIN_WAIT2 when trying to find port in connect() process ipv4: Mask upper DSCP bits and ECN bits in NETLINK_FIB_LOOKUP family ipv4: Check !in_dev earlier for ioctl(SIOCSIFADDR). net: mvpp2: Increase size of queue_name buffer tipc: guard against string buffer overrun ACPICA: check null return of ACPI_ALLOCATE_ZEROED() in acpi_db_convert_to_package() ACPI: EC: Do not release locks during operation region accesses ACPICA: Fix memory leak if acpi_ps_get_next_field() fails ACPICA: Fix memory leak if acpi_ps_get_next_namepath() fails net: hisilicon: hns_mdio: fix OF node leak in probe() net: hisilicon: hns_dsaf_mac: fix OF node leak in hns_mac_get_info() net: hisilicon: hip04: fix OF node leak in probe() wifi: ath9k_htc: Use __skb_set_length() for resetting urb before resubmit wifi: ath9k: fix possible integer overflow in ath9k_get_et_stats() f2fs: Require FMODE_WRITE for atomic write ioctls ALSA: hda/conexant: Fix conflicting quirk for System76 Pangolin ALSA: hda/generic: Unconditionally prefer preferred_dacs pairs sctp: set sk_state back to CLOSED if autobind fails in sctp_listen_start ipv4: ip_gre: Fix drops of small packets in ipgre_xmit net: add more sanity checks to qdisc_pkt_len_init() net: avoid potential underflow in qdisc_pkt_len_init() with UFO net: ethernet: lantiq_etop: fix memory disclosure r8152: Factor out OOB link list waits netfilter: nf_tables: prevent nf_skb_duplicated corruption netfilter: uapi: NFTA_FLOWTABLE_HOOK is NLA_NESTED ceph: remove the incorrect Fw reference check when dirtying pages mailbox: bcm2835: Fix timeout during suspend mode mailbox: rockchip: fix a typo in module autoloading usb: yurex: Fix inconsistent locking bug in yurex_read() i2c: isch: Add missed 'else' i2c: aspeed: Update the stop sw state when the bus recovery occurs pps: add an error check in parport_attach pps: remove usage of the deprecated ida_simple_xx() API USB: misc: yurex: fix race between read and write usb: yurex: Replace snprintf() with the safer scnprintf() variant soc: versatile: realview: fix soc_dev leak during device remove soc: versatile: realview: fix memory leak during device remove PCI: xilinx-nwl: Fix off-by-one in INTx IRQ handler PCI: xilinx-nwl: Use irq_data_get_irq_chip_data() nfs: fix memory leak in error path of nfs4_do_reclaim fs: Fix file_set_fowner LSM hook inconsistencies vfs: fix race between evice_inodes() and find_inode()&iput() f2fs: avoid potential int overflow in sanity_check_area_boundary() f2fs: prevent possible int overflow in dir_block_index() ACPI: sysfs: validate return type of _STR method drbd: Add NULL check for net_conf to prevent dereference in state validation drbd: Fix atomicity violation in drbd_uuid_set_bm() tty: rp2: Fix reset with non forgiving PCIe host bridges firmware_loader: Block path traversal USB: misc: cypress_cy7c63: check for short transfer USB: appledisplay: close race between probe and completion handler soc: versatile: integrator: fix OF node leak in probe() error path Remove *.orig pattern from .gitignore crypto: aead,cipher - zeroize key buffer after use netfilter: ctnetlink: compile ctnetlink_label_size with CONFIG_NF_CONNTRACK_EVENTS net: qrtr: Update packets cloning when broadcasting tcp: check skb is non-NULL in tcp_rto_delta_us() tcp: introduce tcp_skb_timestamp_us() helper net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition netfilter: nf_reject_ipv6: fix nf_reject_ip6_tcphdr_put() coresight: tmc: sg: Do not leak sg_table f2fs: reduce expensive checkpoint trigger frequency f2fs: remove unneeded check condition in __f2fs_setxattr() f2fs: fix to update i_ctime in __f2fs_setxattr() f2fs: fix typo f2fs: enhance to update i_mode and acl atomically in f2fs_setattr() nfsd: call cache_put if xdr_reserve_space returns NULL ntb: intel: Fix the NULL vs IS_ERR() bug for debugfs_create_dir() RDMA/cxgb4: Added NULL check for lookup_atid pinctrl: mvebu: Fix devinit_dove_pinctrl_probe function clk: ti: dra7-atl: Fix leak of of_nodes pinctrl: single: fix missing error code in pcs_probe() RDMA/iwcm: Fix WARNING:at_kernel/workqueue.c:#check_flush_dependency PCI: xilinx-nwl: Fix register misspelling drivers: media: dvb-frontends/rtl2830: fix an out-of-bounds write error drivers: media: dvb-frontends/rtl2832: fix an out-of-bounds write error clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228 perf time-utils: Fix 32-bit nsec parsing perf sched timehist: Fixed timestamp error when unable to confirm event sched_in time perf sched timehist: Fix missing free of session in perf_sched__timehist() nilfs2: fix potential oob read in nilfs_btree_check_delete() nilfs2: determine empty node blocks as corrupted nilfs2: fix potential null-ptr-deref in nilfs_btree_insert() ext4: avoid OOB when system.data xattr changes underneath the filesystem ext4: return error on ext4_find_inline_entry ext4: avoid negative min_clusters in find_group_orlov() smackfs: Use rcu_assign_pointer() to ensure safe assignment in smk_set_cipso ext4: clear EXT4_GROUP_INFO_WAS_TRIMMED_BIT even mount with discard jbd2: introduce/export functions jbd2_journal_submit|finish_inode_data_buffers() kthread: fix task state in kthread worker if being frozen kthread: add kthread_work tracepoints xz: cleanup CRC32 edits from 2018 selftests/bpf: Fix error compiling test_lru_map.c xen/swiotlb: add alignment check for dma buffers xen/swiotlb: simplify range_straddles_page_boundary() xen: use correct end address of kernel for conflict checking drm/msm: fix %s null argument error ipmi: docs: don't advertise deprecated sysfs entries drm/msm/a5xx: fix races in preemption evaluation stage drm/msm/a5xx: properly clear preemption records on resume jfs: fix out-of-bounds in dbNextAG() and diAlloc() drm/radeon/evergreen_cs: fix int overflow errors in cs track offsets drm/rockchip: vop: Allow 4096px width scaling drm/radeon: properly handle vbios fake edid sizing drm/radeon: Replace one-element array with flexible-array member drm/amdgpu: properly handle vbios fake edid sizing drm/amdgpu: Replace one-element array with flexible-array member drm/amd: fix typo drm/stm: Fix an error handling path in stm_drm_platform_probe() fbdev: hpfb: Fix an error handling path in hpfb_dio_probe() power: supply: max17042_battery: Fix SOC threshold calc w/ no current sense hwmon: (ntc_thermistor) fix module autoloading mtd: slram: insert break after errors in parsing the map hwmon: (max16065) Fix overflows seen when writing limits clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init() reset: berlin: fix OF node leak in probe() error path ARM: versatile: fix OF node leak in CPUs prepare spi: ppc4xx: Avoid returning 0 when failed to parse and map IRQ spi: ppc4xx: handle irq_of_parse_and_map() errors block, bfq: don't break merge chain in bfq_split_bfqq() block, bfq: choose the last bfqq from merge chain in bfq_setup_cooperator() block, bfq: fix possible UAF for bfqq->bic with merge chain Bluetooth: btusb: Fix not handling ZPL/short-transfer can: bcm: Clear bo->bcm_proc_read after remove_proc_entry(). wifi: mac80211: use two-phase skb reclamation in ieee80211_do_stop() wifi: cfg80211: fix two more possible UBSAN-detected off-by-one errors wifi: cfg80211: fix UBSAN noise in cfg80211_wext_siwscan() netfilter: nf_tables: elements with timeout below CONFIG_HZ never expire wifi: ath9k: Remove error checks when creating debugfs entries wifi: ath9k: fix parameter check in ath9k_init_debug() ACPI: PMIC: Remove unneeded check in tps68470_pmic_opregion_probe() USB: serial: pl2303: add device id for Macrosilicon MS3020 gpio: prevent potential speculation leaks in gpio_device_get_desc() ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry() ocfs2: add bounds checking to ocfs2_xattr_find_entry() x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides frequency spi: bcm63xx: Enable module autoloading ASoC: tda7419: fix module autoloading wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead wifi: iwlwifi: mvm: fix iwl_mvm_max_scan_ie_fw_cmd_room() net: ftgmac100: Ensure tx descriptor updates are visible microblaze: don't treat zero reserved memory regions as error pinctrl: at91: make it work with current gpiolib ASoC: allow module autoloading for table db1200_pids selftests/kcmp: remove call to ksft_set_plan() selftests/vm: remove call to ksft_set_plan() soundwire: stream: Revert "soundwire: stream: fix programming slave ports for non-continous port maps" net: dpaa: Pad packets to ETH_ZLEN net: ftgmac100: Enable TX interrupt to avoid TX timeout net/mlx5: Update the list of the PCI supported devices arm64: dts: rockchip: override BIOS_DISABLE signal via GPIO hog on RK3399 Puma scripts: kconfig: merge_config: config files: add a trailing newline net: phy: vitesse: repair vsc73xx autonegotiation net: ethernet: use ip_hdrlen() instead of bit shift usbnet: ipheth: fix carrier detection in modes 1 and 4 staging: iio: frequency: ad9834: Validate frequency parameter value staging: iio: frequency: ad9833: Load clock using clock framework staging: iio: frequency: ad9833: Get frequency value statically Change-Id: Id96e4bf331d59a5f3f52791887390bc747dc31cb Signed-off-by: bengris32 <bengris32@protonmail.ch>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -114,7 +114,6 @@ GTAGS
|
||||
# id-utils files
|
||||
ID
|
||||
|
||||
*.orig
|
||||
*~
|
||||
\#*#
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ at module load time (for a module) with::
|
||||
[dbg_probe=1]
|
||||
|
||||
The addresses are normal I2C addresses. The adapter is the string
|
||||
name of the adapter, as shown in /sys/class/i2c-adapter/i2c-<n>/name.
|
||||
name of the adapter, as shown in /sys/bus/i2c/devices/i2c-<n>/name.
|
||||
It is *NOT* i2c-<n> itself. Also, the comparison is done ignoring
|
||||
spaces, so if the name is "This is an I2C chip" you can say
|
||||
adapter_name=ThisisanI2cchip. This is because it's hard to pass in
|
||||
|
||||
@@ -66,6 +66,7 @@ stable kernels.
|
||||
| ARM | Cortex-A78 | #3324344 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Cortex-A78C | #3324346,3324347| ARM64_ERRATUM_3194386 |
|
||||
| ARM | Cortex-A710 | #3324338 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Cortex-A715 | #3456084 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Cortex-X1 | #3324344 | ARM64_ERRATUM_3194386 |
|
||||
@@ -77,6 +78,7 @@ stable kernels.
|
||||
| ARM | Neoverse-N1 | #1542419 | ARM64_ERRATUM_1542419 |
|
||||
| ARM | Neoverse-N1 | #3324349 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Neoverse-N2 | #3324339 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Neoverse-N3 | #3456111 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 |
|
||||
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
|
||||
67
Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml
Normal file
67
Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml
Normal file
@@ -0,0 +1,67 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/clock/adi,axi-clkgen.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Binding for Analog Devices AXI clkgen pcore clock generator
|
||||
|
||||
maintainers:
|
||||
- Lars-Peter Clausen <lars@metafoo.de>
|
||||
- Michael Hennerich <michael.hennerich@analog.com>
|
||||
|
||||
description: |
|
||||
The axi_clkgen IP core is a software programmable clock generator,
|
||||
that can be synthesized on various FPGA platforms.
|
||||
|
||||
Link: https://wiki.analog.com/resources/fpga/docs/axi_clkgen
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- adi,axi-clkgen-2.00.a
|
||||
|
||||
clocks:
|
||||
description:
|
||||
Specifies the reference clock(s) from which the output frequency is
|
||||
derived. This must either reference one clock if only the first clock
|
||||
input is connected or two if both clock inputs are connected. The last
|
||||
clock is the AXI bus clock that needs to be enabled so we can access the
|
||||
core registers.
|
||||
minItems: 2
|
||||
maxItems: 3
|
||||
|
||||
clock-names:
|
||||
oneOf:
|
||||
- items:
|
||||
- const: clkin1
|
||||
- const: s_axi_aclk
|
||||
- items:
|
||||
- const: clkin1
|
||||
- const: clkin2
|
||||
- const: s_axi_aclk
|
||||
|
||||
'#clock-cells':
|
||||
const: 0
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
- clock-names
|
||||
- '#clock-cells'
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
clock-controller@ff000000 {
|
||||
compatible = "adi,axi-clkgen-2.00.a";
|
||||
#clock-cells = <0>;
|
||||
reg = <0xff000000 0x1000>;
|
||||
clocks = <&osc 1>, <&clkc 15>;
|
||||
clock-names = "clkin1", "s_axi_aclk";
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
Binding for the axi-clkgen clock generator
|
||||
|
||||
This binding uses the common clock binding[1].
|
||||
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
Required properties:
|
||||
- compatible : shall be "adi,axi-clkgen-1.00.a" or "adi,axi-clkgen-2.00.a".
|
||||
- #clock-cells : from common clock binding; Should always be set to 0.
|
||||
- reg : Address and length of the axi-clkgen register set.
|
||||
- clocks : Phandle and clock specifier for the parent clock(s). This must
|
||||
either reference one clock if only the first clock input is connected or two
|
||||
if both clock inputs are connected. For the later case the clock connected
|
||||
to the first input must be specified first.
|
||||
|
||||
Optional properties:
|
||||
- clock-output-names : From common clock binding.
|
||||
|
||||
Example:
|
||||
clock@ff000000 {
|
||||
compatible = "adi,axi-clkgen";
|
||||
#clock-cells = <0>;
|
||||
reg = <0xff000000 0x1000>;
|
||||
clocks = <&osc 1>;
|
||||
};
|
||||
@@ -235,6 +235,7 @@ certainly invest a bit more effort into libata core layer).
|
||||
|
||||
CLOCK
|
||||
devm_clk_get()
|
||||
devm_clk_get_optional()
|
||||
devm_clk_put()
|
||||
devm_clk_hw_register()
|
||||
devm_of_clk_add_hw_provider()
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 322
|
||||
SUBLEVEL = 325
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
|
||||
@@ -300,8 +300,8 @@
|
||||
&i2c2 {
|
||||
status = "okay";
|
||||
|
||||
rt5616: rt5616@1b {
|
||||
compatible = "rt5616";
|
||||
rt5616: audio-codec@1b {
|
||||
compatible = "realtek,rt5616";
|
||||
reg = <0x1b>;
|
||||
clocks = <&cru SCLK_I2S_OUT>;
|
||||
clock-names = "mclk";
|
||||
|
||||
@@ -316,12 +316,13 @@
|
||||
};
|
||||
};
|
||||
|
||||
acodec: acodec-ana@20030000 {
|
||||
compatible = "rk3036-codec";
|
||||
acodec: audio-codec@20030000 {
|
||||
compatible = "rockchip,rk3036-codec";
|
||||
reg = <0x20030000 0x4000>;
|
||||
rockchip,grf = <&grf>;
|
||||
clock-names = "acodec_pclk";
|
||||
clocks = <&cru PCLK_ACODEC>;
|
||||
rockchip,grf = <&grf>;
|
||||
#sound-dai-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -331,7 +332,6 @@
|
||||
interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&cru PCLK_HDMI>;
|
||||
clock-names = "pclk";
|
||||
rockchip,grf = <&grf>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hdmi_ctl>;
|
||||
status = "disabled";
|
||||
|
||||
@@ -253,8 +253,8 @@
|
||||
|
||||
reg_dcdc5: dcdc5 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1425000>;
|
||||
regulator-max-microvolt = <1575000>;
|
||||
regulator-min-microvolt = <1450000>;
|
||||
regulator-max-microvolt = <1550000>;
|
||||
regulator-name = "vcc-dram";
|
||||
};
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
|
||||
return;
|
||||
}
|
||||
map = syscon_node_to_regmap(np);
|
||||
of_node_put(np);
|
||||
if (IS_ERR(map)) {
|
||||
pr_err("PLATSMP: No syscon regmap\n");
|
||||
return;
|
||||
|
||||
@@ -552,6 +552,7 @@ config ARM64_ERRATUM_3194386
|
||||
* ARM Cortex-A78C erratum 3324346
|
||||
* ARM Cortex-A78C erratum 3324347
|
||||
* ARM Cortex-A710 erratam 3324338
|
||||
* ARM Cortex-A715 errartum 3456084
|
||||
* ARM Cortex-A720 erratum 3456091
|
||||
* ARM Cortex-A725 erratum 3456106
|
||||
* ARM Cortex-X1 erratum 3324344
|
||||
@@ -562,6 +563,7 @@ config ARM64_ERRATUM_3194386
|
||||
* ARM Cortex-X925 erratum 3324334
|
||||
* ARM Neoverse-N1 erratum 3324349
|
||||
* ARM Neoverse N2 erratum 3324339
|
||||
* ARM Neoverse-N3 erratum 3456111
|
||||
* ARM Neoverse-V1 erratum 3324341
|
||||
* ARM Neoverse V2 erratum 3324336
|
||||
* ARM Neoverse-V3 erratum 3312417
|
||||
|
||||
@@ -147,6 +147,22 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio3 {
|
||||
/*
|
||||
* The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
|
||||
* eMMC and SPI flash powered-down initially (in fact it keeps the
|
||||
* reset signal asserted). BIOS_DISABLE_OVERRIDE pin allows to override
|
||||
* that signal so that eMMC and SPI can be used regardless of the state
|
||||
* of the signal.
|
||||
*/
|
||||
bios-disable-override-hog {
|
||||
gpios = <RK_PD5 GPIO_ACTIVE_LOW>;
|
||||
gpio-hog;
|
||||
line-name = "bios_disable_override";
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
&gmac {
|
||||
assigned-clocks = <&cru SCLK_RMII_SRC>;
|
||||
assigned-clock-parents = <&clkin_gmac>;
|
||||
@@ -433,9 +449,14 @@
|
||||
|
||||
&pinctrl {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&q7_thermal_pin>;
|
||||
pinctrl-0 = <&q7_thermal_pin &bios_disable_override_hog_pin>;
|
||||
|
||||
gpios {
|
||||
bios_disable_override_hog_pin: bios-disable-override-hog-pin {
|
||||
rockchip,pins =
|
||||
<3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
|
||||
q7_thermal_pin: q7-thermal-pin {
|
||||
rockchip,pins =
|
||||
<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
status = "okay";
|
||||
|
||||
rt5651: rt5651@1a {
|
||||
compatible = "rockchip,rt5651";
|
||||
compatible = "realtek,rt5651";
|
||||
reg = <0x1a>;
|
||||
clocks = <&cru SCLK_I2S_8CH_OUT>;
|
||||
clock-names = "mclk";
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
#define ARM_CPU_PART_CORTEX_A78 0xD41
|
||||
#define ARM_CPU_PART_CORTEX_X1 0xD44
|
||||
#define ARM_CPU_PART_CORTEX_A710 0xD47
|
||||
#define ARM_CPU_PART_CORTEX_A715 0xD4D
|
||||
#define ARM_CPU_PART_CORTEX_X2 0xD48
|
||||
#define ARM_CPU_PART_NEOVERSE_N2 0xD49
|
||||
#define ARM_CPU_PART_CORTEX_A78C 0xD4B
|
||||
@@ -97,6 +98,7 @@
|
||||
#define ARM_CPU_PART_NEOVERSE_V3 0xD84
|
||||
#define ARM_CPU_PART_CORTEX_X925 0xD85
|
||||
#define ARM_CPU_PART_CORTEX_A725 0xD87
|
||||
#define ARM_CPU_PART_NEOVERSE_N3 0xD8E
|
||||
|
||||
#define APM_CPU_PART_POTENZA 0x000
|
||||
|
||||
@@ -130,6 +132,7 @@
|
||||
#define MIDR_CORTEX_A78 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78)
|
||||
#define MIDR_CORTEX_X1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1)
|
||||
#define MIDR_CORTEX_A710 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A710)
|
||||
#define MIDR_CORTEX_A715 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A715)
|
||||
#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)
|
||||
#define MIDR_NEOVERSE_N2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N2)
|
||||
#define MIDR_CORTEX_A78C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78C)
|
||||
@@ -141,6 +144,7 @@
|
||||
#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)
|
||||
#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)
|
||||
#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)
|
||||
#define MIDR_NEOVERSE_N3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N3)
|
||||
#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
|
||||
#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
|
||||
#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
|
||||
|
||||
@@ -13,21 +13,19 @@
|
||||
#include <asm/insn.h>
|
||||
#include <asm/probes.h>
|
||||
|
||||
#define MAX_UINSN_BYTES AARCH64_INSN_SIZE
|
||||
|
||||
#define UPROBE_SWBP_INSN BRK64_OPCODE_UPROBES
|
||||
#define UPROBE_SWBP_INSN cpu_to_le32(BRK64_OPCODE_UPROBES)
|
||||
#define UPROBE_SWBP_INSN_SIZE AARCH64_INSN_SIZE
|
||||
#define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
|
||||
#define UPROBE_XOL_SLOT_BYTES AARCH64_INSN_SIZE
|
||||
|
||||
typedef u32 uprobe_opcode_t;
|
||||
typedef __le32 uprobe_opcode_t;
|
||||
|
||||
struct arch_uprobe_task {
|
||||
};
|
||||
|
||||
struct arch_uprobe {
|
||||
union {
|
||||
u8 insn[MAX_UINSN_BYTES];
|
||||
u8 ixol[MAX_UINSN_BYTES];
|
||||
__le32 insn;
|
||||
__le32 ixol;
|
||||
};
|
||||
struct arch_probe_insn api;
|
||||
bool simulate;
|
||||
|
||||
@@ -713,6 +713,7 @@ static const struct midr_range erratum_spec_ssbs_list[] = {
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C),
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A710),
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A715),
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A720),
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_A725),
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_X1),
|
||||
@@ -723,6 +724,7 @@ static const struct midr_range erratum_spec_ssbs_list[] = {
|
||||
MIDR_ALL_VERSIONS(MIDR_CORTEX_X925),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N3),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
|
||||
|
||||
@@ -104,10 +104,6 @@ arm_probe_decode_insn(probe_opcode_t insn, struct arch_probe_insn *api)
|
||||
aarch64_insn_is_blr(insn) ||
|
||||
aarch64_insn_is_ret(insn)) {
|
||||
api->handler = simulate_br_blr_ret;
|
||||
} else if (aarch64_insn_is_ldr_lit(insn)) {
|
||||
api->handler = simulate_ldr_literal;
|
||||
} else if (aarch64_insn_is_ldrsw_lit(insn)) {
|
||||
api->handler = simulate_ldrsw_literal;
|
||||
} else {
|
||||
/*
|
||||
* Instruction cannot be stepped out-of-line and we don't
|
||||
@@ -145,6 +141,17 @@ arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi)
|
||||
probe_opcode_t insn = le32_to_cpu(*addr);
|
||||
probe_opcode_t *scan_end = NULL;
|
||||
unsigned long size = 0, offset = 0;
|
||||
struct arch_probe_insn *api = &asi->api;
|
||||
|
||||
if (aarch64_insn_is_ldr_lit(insn)) {
|
||||
api->handler = simulate_ldr_literal;
|
||||
decoded = INSN_GOOD_NO_SLOT;
|
||||
} else if (aarch64_insn_is_ldrsw_lit(insn)) {
|
||||
api->handler = simulate_ldrsw_literal;
|
||||
decoded = INSN_GOOD_NO_SLOT;
|
||||
} else {
|
||||
decoded = arm_probe_decode_insn(insn, &asi->api);
|
||||
}
|
||||
|
||||
/*
|
||||
* If there's a symbol defined in front of and near enough to
|
||||
@@ -162,7 +169,6 @@ arm_kprobe_decode_insn(kprobe_opcode_t *addr, struct arch_specific_insn *asi)
|
||||
else
|
||||
scan_end = addr - MAX_ATOMIC_CONTEXT_SIZE;
|
||||
}
|
||||
decoded = arm_probe_decode_insn(insn, &asi->api);
|
||||
|
||||
if (decoded != INSN_REJECTED && scan_end)
|
||||
if (is_probed_address_atomic(addr - 1, scan_end))
|
||||
|
||||
@@ -178,17 +178,15 @@ simulate_tbz_tbnz(u32 opcode, long addr, struct pt_regs *regs)
|
||||
void __kprobes
|
||||
simulate_ldr_literal(u32 opcode, long addr, struct pt_regs *regs)
|
||||
{
|
||||
u64 *load_addr;
|
||||
unsigned long load_addr;
|
||||
int xn = opcode & 0x1f;
|
||||
int disp;
|
||||
|
||||
disp = ldr_displacement(opcode);
|
||||
load_addr = (u64 *) (addr + disp);
|
||||
load_addr = addr + ldr_displacement(opcode);
|
||||
|
||||
if (opcode & (1 << 30)) /* x0-x30 */
|
||||
set_x_reg(regs, xn, *load_addr);
|
||||
set_x_reg(regs, xn, READ_ONCE(*(u64 *)load_addr));
|
||||
else /* w0-w30 */
|
||||
set_w_reg(regs, xn, *load_addr);
|
||||
set_w_reg(regs, xn, READ_ONCE(*(u32 *)load_addr));
|
||||
|
||||
instruction_pointer_set(regs, instruction_pointer(regs) + 4);
|
||||
}
|
||||
@@ -196,14 +194,12 @@ simulate_ldr_literal(u32 opcode, long addr, struct pt_regs *regs)
|
||||
void __kprobes
|
||||
simulate_ldrsw_literal(u32 opcode, long addr, struct pt_regs *regs)
|
||||
{
|
||||
s32 *load_addr;
|
||||
unsigned long load_addr;
|
||||
int xn = opcode & 0x1f;
|
||||
int disp;
|
||||
|
||||
disp = ldr_displacement(opcode);
|
||||
load_addr = (s32 *) (addr + disp);
|
||||
load_addr = addr + ldr_displacement(opcode);
|
||||
|
||||
set_x_reg(regs, xn, *load_addr);
|
||||
set_x_reg(regs, xn, READ_ONCE(*(s32 *)load_addr));
|
||||
|
||||
instruction_pointer_set(regs, instruction_pointer(regs) + 4);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
|
||||
else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE))
|
||||
return -EINVAL;
|
||||
|
||||
insn = *(probe_opcode_t *)(&auprobe->insn[0]);
|
||||
insn = le32_to_cpu(auprobe->insn);
|
||||
|
||||
switch (arm_probe_decode_insn(insn, &auprobe->api)) {
|
||||
case INSN_REJECTED:
|
||||
@@ -111,7 +111,7 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
|
||||
if (!auprobe->simulate)
|
||||
return false;
|
||||
|
||||
insn = *(probe_opcode_t *)(&auprobe->insn[0]);
|
||||
insn = le32_to_cpu(auprobe->insn);
|
||||
addr = instruction_pointer(regs);
|
||||
|
||||
if (auprobe->api.handler)
|
||||
|
||||
@@ -393,7 +393,7 @@ static void tls_thread_switch(struct task_struct *next)
|
||||
|
||||
if (is_compat_thread(task_thread_info(next)))
|
||||
write_sysreg(next->thread.uw.tp_value, tpidrro_el0);
|
||||
else if (!arm64_kernel_unmapped_at_el0())
|
||||
else
|
||||
write_sysreg(0, tpidrro_el0);
|
||||
|
||||
write_sysreg(*task_user_tls(next), tpidr_el0);
|
||||
|
||||
@@ -89,7 +89,7 @@ static struct platform_device mcf_uart = {
|
||||
.dev.platform_data = mcf_uart_platform_data,
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_FEC)
|
||||
#ifdef MCFFEC_BASE0
|
||||
|
||||
#ifdef CONFIG_M5441x
|
||||
#define FEC_NAME "enet-fec"
|
||||
@@ -141,6 +141,7 @@ static struct platform_device mcf_fec0 = {
|
||||
.platform_data = FEC_PDATA,
|
||||
}
|
||||
};
|
||||
#endif /* MCFFEC_BASE0 */
|
||||
|
||||
#ifdef MCFFEC_BASE1
|
||||
static struct resource mcf_fec1_resources[] = {
|
||||
@@ -178,7 +179,6 @@ static struct platform_device mcf_fec1 = {
|
||||
}
|
||||
};
|
||||
#endif /* MCFFEC_BASE1 */
|
||||
#endif /* CONFIG_FEC */
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
|
||||
/*
|
||||
@@ -478,12 +478,12 @@ static struct platform_device mcf_i2c5 = {
|
||||
|
||||
static struct platform_device *mcf_devices[] __initdata = {
|
||||
&mcf_uart,
|
||||
#if IS_ENABLED(CONFIG_FEC)
|
||||
#ifdef MCFFEC_BASE0
|
||||
&mcf_fec0,
|
||||
#endif
|
||||
#ifdef MCFFEC_BASE1
|
||||
&mcf_fec1,
|
||||
#endif
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
|
||||
&mcf_qspi,
|
||||
#endif
|
||||
|
||||
@@ -152,7 +152,7 @@ static inline void gpio_free(unsigned gpio)
|
||||
* read-modify-write as well as those controlled by the EPORT and GPIO modules.
|
||||
*/
|
||||
#define MCFGPIO_SCR_START 40
|
||||
#elif defined(CONFIGM5441x)
|
||||
#elif defined(CONFIG_M5441x)
|
||||
/* The m5441x EPORT doesn't have its own GPIO port, uses PORT C */
|
||||
#define MCFGPIO_SCR_START 0
|
||||
#else
|
||||
|
||||
@@ -90,8 +90,8 @@ struct pcc_regs {
|
||||
#define M147_SCC_B_ADDR 0xfffe3000
|
||||
#define M147_SCC_PCLK 5000000
|
||||
|
||||
#define MVME147_IRQ_SCSI_PORT (IRQ_USER+0x45)
|
||||
#define MVME147_IRQ_SCSI_DMA (IRQ_USER+0x46)
|
||||
#define MVME147_IRQ_SCSI_PORT (IRQ_USER + 5)
|
||||
#define MVME147_IRQ_SCSI_DMA (IRQ_USER + 6)
|
||||
|
||||
/* SCC interrupts, for MVME147 */
|
||||
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
#include <linux/string.h>
|
||||
#include <asm/setup.h>
|
||||
|
||||
extern void mvme16x_cons_write(struct console *co,
|
||||
const char *str, unsigned count);
|
||||
|
||||
#include "../mvme147/mvme147.h"
|
||||
#include "../mvme16x/mvme16x.h"
|
||||
|
||||
asmlinkage void __init debug_cons_nputs(const char *s, unsigned n);
|
||||
|
||||
@@ -22,7 +23,9 @@ static void __ref debug_cons_write(struct console *c,
|
||||
{
|
||||
#if !(defined(CONFIG_SUN3) || defined(CONFIG_M68000) || \
|
||||
defined(CONFIG_COLDFIRE))
|
||||
if (MACH_IS_MVME16x)
|
||||
if (MACH_IS_MVME147)
|
||||
mvme147_scc_write(c, s, n);
|
||||
else if (MACH_IS_MVME16x)
|
||||
mvme16x_cons_write(c, s, n);
|
||||
else
|
||||
debug_cons_nputs(s, n);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/mvme147hw.h>
|
||||
|
||||
#include "mvme147.h"
|
||||
|
||||
static void mvme147_get_model(char *model);
|
||||
extern void mvme147_sched_init(irq_handler_t handler);
|
||||
@@ -164,3 +165,32 @@ int mvme147_hwclk(int op, struct rtc_time *t)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void scc_delay(void)
|
||||
{
|
||||
__asm__ __volatile__ ("nop; nop;");
|
||||
}
|
||||
|
||||
static void scc_write(char ch)
|
||||
{
|
||||
do {
|
||||
scc_delay();
|
||||
} while (!(in_8(M147_SCC_A_ADDR) & BIT(2)));
|
||||
scc_delay();
|
||||
out_8(M147_SCC_A_ADDR, 8);
|
||||
scc_delay();
|
||||
out_8(M147_SCC_A_ADDR, ch);
|
||||
}
|
||||
|
||||
void mvme147_scc_write(struct console *co, const char *str, unsigned int count)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
while (count--) {
|
||||
if (*str == '\n')
|
||||
scc_write('\r');
|
||||
scc_write(*str++);
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
6
arch/m68k/mvme147/mvme147.h
Normal file
6
arch/m68k/mvme147/mvme147.h
Normal file
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
struct console;
|
||||
|
||||
/* config.c */
|
||||
void mvme147_scc_write(struct console *co, const char *str, unsigned int count);
|
||||
@@ -38,6 +38,8 @@
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/mvme16xhw.h>
|
||||
|
||||
#include "mvme16x.h"
|
||||
|
||||
extern t_bdid mvme_bdid;
|
||||
|
||||
static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE;
|
||||
|
||||
6
arch/m68k/mvme16x/mvme16x.h
Normal file
6
arch/m68k/mvme16x/mvme16x.h
Normal file
@@ -0,0 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
struct console;
|
||||
|
||||
/* config.c */
|
||||
void mvme16x_cons_write(struct console *co, const char *str, unsigned count);
|
||||
@@ -289,11 +289,6 @@ asmlinkage void __init mmu_init(void)
|
||||
{
|
||||
unsigned int kstart, ksize;
|
||||
|
||||
if (!memblock.reserved.cnt) {
|
||||
pr_emerg("Error memory count\n");
|
||||
machine_restart(NULL);
|
||||
}
|
||||
|
||||
if ((u32) memblock.memory.regions[0].size < 0x400000) {
|
||||
pr_emerg("Memory must be greater than 4MB\n");
|
||||
machine_restart(NULL);
|
||||
|
||||
@@ -1089,8 +1089,7 @@ ENTRY_CFI(intr_save) /* for os_hpmc */
|
||||
STREG %r16, PT_ISR(%r29)
|
||||
STREG %r17, PT_IOR(%r29)
|
||||
|
||||
#if 0 && defined(CONFIG_64BIT)
|
||||
/* Revisit when we have 64-bit code above 4Gb */
|
||||
#if defined(CONFIG_64BIT)
|
||||
b,n intr_save2
|
||||
|
||||
skip_save_ior:
|
||||
@@ -1098,8 +1097,7 @@ skip_save_ior:
|
||||
* need to adjust iasq/iaoq here in the same way we adjusted isr/ior
|
||||
* above.
|
||||
*/
|
||||
extrd,u,* %r8,PSW_W_BIT,1,%r1
|
||||
cmpib,COND(=),n 1,%r1,intr_save2
|
||||
bb,COND(>=),n %r8,PSW_W_BIT,intr_save2
|
||||
LDREG PT_IASQ0(%r29), %r16
|
||||
LDREG PT_IAOQ0(%r29), %r17
|
||||
/* adjust iasq/iaoq */
|
||||
|
||||
@@ -217,10 +217,10 @@ linux_gateway_entry:
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
ldil L%sys_call_table, %r1
|
||||
or,= %r2,%r2,%r2
|
||||
addil L%(sys_call_table64-sys_call_table), %r1
|
||||
or,ev %r2,%r2,%r2
|
||||
ldil L%sys_call_table64, %r1
|
||||
ldo R%sys_call_table(%r1), %r19
|
||||
or,= %r2,%r2,%r2
|
||||
or,ev %r2,%r2,%r2
|
||||
ldo R%sys_call_table64(%r1), %r19
|
||||
#else
|
||||
load32 sys_call_table, %r19
|
||||
@@ -355,10 +355,10 @@ tracesys_next:
|
||||
extrd,u %r19,63,1,%r2 /* W hidden in bottom bit */
|
||||
|
||||
ldil L%sys_call_table, %r1
|
||||
or,= %r2,%r2,%r2
|
||||
addil L%(sys_call_table64-sys_call_table), %r1
|
||||
or,ev %r2,%r2,%r2
|
||||
ldil L%sys_call_table64, %r1
|
||||
ldo R%sys_call_table(%r1), %r19
|
||||
or,= %r2,%r2,%r2
|
||||
or,ev %r2,%r2,%r2
|
||||
ldo R%sys_call_table64(%r1), %r19
|
||||
#else
|
||||
load32 sys_call_table, %r19
|
||||
@@ -930,6 +930,8 @@ ENTRY(sys_call_table)
|
||||
END(sys_call_table)
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
#undef __SYSCALL_WITH_COMPAT
|
||||
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
|
||||
.align 8
|
||||
ENTRY(sys_call_table64)
|
||||
#define SYSCALL_TABLE_64BIT
|
||||
|
||||
@@ -164,9 +164,4 @@ extern int emulate_step(struct pt_regs *regs, unsigned int instr);
|
||||
*/
|
||||
extern int emulate_loadstore(struct pt_regs *regs, struct instruction_op *op);
|
||||
|
||||
extern void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
|
||||
const void *mem, bool cross_endian);
|
||||
extern void emulate_vsx_store(struct instruction_op *op,
|
||||
const union vsx_reg *reg, void *mem,
|
||||
bool cross_endian);
|
||||
extern int emulate_dcbz(unsigned long ea, struct pt_regs *regs);
|
||||
|
||||
@@ -49,6 +49,7 @@ int vdso_getcpu_init(void);
|
||||
|
||||
#define V_FUNCTION_BEGIN(name) \
|
||||
.globl name; \
|
||||
.type name,@function; \
|
||||
name: \
|
||||
|
||||
#define V_FUNCTION_END(name) \
|
||||
|
||||
@@ -667,8 +667,8 @@ static nokprobe_inline int emulate_stq(struct pt_regs *regs, unsigned long ea,
|
||||
#endif /* __powerpc64 */
|
||||
|
||||
#ifdef CONFIG_VSX
|
||||
void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
|
||||
const void *mem, bool rev)
|
||||
static nokprobe_inline void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
|
||||
const void *mem, bool rev)
|
||||
{
|
||||
int size, read_size;
|
||||
int i, j;
|
||||
@@ -748,11 +748,9 @@ void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(emulate_vsx_load);
|
||||
NOKPROBE_SYMBOL(emulate_vsx_load);
|
||||
|
||||
void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
|
||||
void *mem, bool rev)
|
||||
static nokprobe_inline void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
|
||||
void *mem, bool rev)
|
||||
{
|
||||
int size, write_size;
|
||||
int i, j;
|
||||
@@ -824,8 +822,6 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(emulate_vsx_store);
|
||||
NOKPROBE_SYMBOL(emulate_vsx_store);
|
||||
|
||||
static nokprobe_inline int do_vsx_load(struct instruction_op *op,
|
||||
unsigned long ea, struct pt_regs *regs,
|
||||
|
||||
@@ -289,6 +289,7 @@ int __init opal_event_init(void)
|
||||
name, NULL);
|
||||
if (rc) {
|
||||
pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start);
|
||||
kfree(name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,11 @@ config GENERIC_CSUM
|
||||
config GENERIC_HWEIGHT
|
||||
def_bool y
|
||||
|
||||
config ILLEGAL_POINTER_VALUE
|
||||
hex
|
||||
default 0 if 32BIT
|
||||
default 0xdead000000000000 if 64BIT
|
||||
|
||||
config PGTABLE_LEVELS
|
||||
int
|
||||
default 3 if 64BIT
|
||||
|
||||
@@ -53,8 +53,10 @@ static inline int test_facility(unsigned long nr)
|
||||
unsigned long facilities_als[] = { FACILITIES_ALS };
|
||||
|
||||
if (__builtin_constant_p(nr) && nr < sizeof(facilities_als) * 8) {
|
||||
if (__test_facility(nr, &facilities_als))
|
||||
return 1;
|
||||
if (__test_facility(nr, &facilities_als)) {
|
||||
if (!__is_defined(__DECOMPRESSOR))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return __test_facility(nr, &S390_lowcore.stfle_fac_list);
|
||||
}
|
||||
|
||||
@@ -1360,7 +1360,7 @@ static int aux_output_begin(struct perf_output_handle *handle,
|
||||
unsigned long head, base, offset;
|
||||
struct hws_trailer_entry *te;
|
||||
|
||||
if (WARN_ON_ONCE(handle->head & ~PAGE_MASK))
|
||||
if (handle->head & ~PAGE_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
aux->head = handle->head >> PAGE_SHIFT;
|
||||
@@ -1528,7 +1528,7 @@ static void hw_collect_aux(struct cpu_hw_sf *cpuhw)
|
||||
unsigned long num_sdb;
|
||||
|
||||
aux = perf_get_aux(handle);
|
||||
if (WARN_ON_ONCE(!aux))
|
||||
if (!aux)
|
||||
return;
|
||||
|
||||
/* Inform user space new data arrived */
|
||||
@@ -1547,7 +1547,7 @@ static void hw_collect_aux(struct cpu_hw_sf *cpuhw)
|
||||
debug_sprintf_event(sfdbg, 1, "AUX buffer used up\n");
|
||||
break;
|
||||
}
|
||||
if (WARN_ON_ONCE(!aux))
|
||||
if (!aux)
|
||||
return;
|
||||
|
||||
/* Update head and alert_mark to new position */
|
||||
@@ -1746,12 +1746,8 @@ static void cpumsf_pmu_start(struct perf_event *event, int flags)
|
||||
{
|
||||
struct cpu_hw_sf *cpuhw = this_cpu_ptr(&cpu_hw_sf);
|
||||
|
||||
if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED)))
|
||||
if (!(event->hw.state & PERF_HES_STOPPED))
|
||||
return;
|
||||
|
||||
if (flags & PERF_EF_RELOAD)
|
||||
WARN_ON_ONCE(!(event->hw.state & PERF_HES_UPTODATE));
|
||||
|
||||
perf_pmu_disable(event->pmu);
|
||||
event->hw.state = 0;
|
||||
cpuhw->lsctl.cs = 1;
|
||||
|
||||
@@ -12,7 +12,7 @@ kapi-hdrs-y := $(kapi)/unistd_nr.h
|
||||
uapi-hdrs-y := $(uapi)/unistd_32.h
|
||||
uapi-hdrs-y += $(uapi)/unistd_64.h
|
||||
|
||||
targets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y))
|
||||
targets += $(addprefix ../../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y))
|
||||
|
||||
PHONY += kapi uapi
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ static int __diag_page_ref_service(struct kvm_vcpu *vcpu)
|
||||
vcpu->stat.diagnose_258++;
|
||||
if (vcpu->run->s.regs.gprs[rx] & 7)
|
||||
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
|
||||
rc = read_guest(vcpu, vcpu->run->s.regs.gprs[rx], rx, &parm, sizeof(parm));
|
||||
rc = read_guest_real(vcpu, vcpu->run->s.regs.gprs[rx], &parm, sizeof(parm));
|
||||
if (rc)
|
||||
return kvm_s390_inject_prog_cond(vcpu, rc);
|
||||
if (parm.parm_version != 2 || parm.parm_len < 5 || parm.code != 0x258)
|
||||
|
||||
@@ -794,46 +794,102 @@ static int low_address_protection_enabled(struct kvm_vcpu *vcpu,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int guest_page_range(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
|
||||
unsigned long *pages, unsigned long nr_pages,
|
||||
const union asce asce, enum gacc_mode mode)
|
||||
/**
|
||||
* guest_range_to_gpas() - Calculate guest physical addresses of page fragments
|
||||
* covering a logical range
|
||||
* @vcpu: virtual cpu
|
||||
* @ga: guest address, start of range
|
||||
* @ar: access register
|
||||
* @gpas: output argument, may be NULL
|
||||
* @len: length of range in bytes
|
||||
* @asce: address-space-control element to use for translation
|
||||
* @mode: access mode
|
||||
*
|
||||
* Translate a logical range to a series of guest absolute addresses,
|
||||
* such that the concatenation of page fragments starting at each gpa make up
|
||||
* the whole range.
|
||||
* The translation is performed as if done by the cpu for the given @asce, @ar,
|
||||
* @mode and state of the @vcpu.
|
||||
* If the translation causes an exception, its program interruption code is
|
||||
* returned and the &struct kvm_s390_pgm_info pgm member of @vcpu is modified
|
||||
* such that a subsequent call to kvm_s390_inject_prog_vcpu() will inject
|
||||
* a correct exception into the guest.
|
||||
* The resulting gpas are stored into @gpas, unless it is NULL.
|
||||
*
|
||||
* Note: All fragments except the first one start at the beginning of a page.
|
||||
* When deriving the boundaries of a fragment from a gpa, all but the last
|
||||
* fragment end at the end of the page.
|
||||
*
|
||||
* Return:
|
||||
* * 0 - success
|
||||
* * <0 - translation could not be performed, for example if guest
|
||||
* memory could not be accessed
|
||||
* * >0 - an access exception occurred. In this case the returned value
|
||||
* is the program interruption code and the contents of pgm may
|
||||
* be used to inject an exception into the guest.
|
||||
*/
|
||||
static int guest_range_to_gpas(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
|
||||
unsigned long *gpas, unsigned long len,
|
||||
const union asce asce, enum gacc_mode mode)
|
||||
{
|
||||
psw_t *psw = &vcpu->arch.sie_block->gpsw;
|
||||
unsigned int offset = offset_in_page(ga);
|
||||
unsigned int fragment_len;
|
||||
int lap_enabled, rc = 0;
|
||||
enum prot_type prot;
|
||||
unsigned long gpa;
|
||||
|
||||
lap_enabled = low_address_protection_enabled(vcpu, asce);
|
||||
while (nr_pages) {
|
||||
while (min(PAGE_SIZE - offset, len) > 0) {
|
||||
fragment_len = min(PAGE_SIZE - offset, len);
|
||||
ga = kvm_s390_logical_to_effective(vcpu, ga);
|
||||
if (mode == GACC_STORE && lap_enabled && is_low_address(ga))
|
||||
return trans_exc(vcpu, PGM_PROTECTION, ga, ar, mode,
|
||||
PROT_TYPE_LA);
|
||||
ga &= PAGE_MASK;
|
||||
if (psw_bits(*psw).dat) {
|
||||
rc = guest_translate(vcpu, ga, pages, asce, mode, &prot);
|
||||
rc = guest_translate(vcpu, ga, &gpa, asce, mode, &prot);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
} else {
|
||||
*pages = kvm_s390_real_to_abs(vcpu, ga);
|
||||
if (kvm_is_error_gpa(vcpu->kvm, *pages))
|
||||
gpa = kvm_s390_real_to_abs(vcpu, ga);
|
||||
if (kvm_is_error_gpa(vcpu->kvm, gpa))
|
||||
rc = PGM_ADDRESSING;
|
||||
}
|
||||
if (rc)
|
||||
return trans_exc(vcpu, rc, ga, ar, mode, prot);
|
||||
ga += PAGE_SIZE;
|
||||
pages++;
|
||||
nr_pages--;
|
||||
if (gpas)
|
||||
*gpas++ = gpa;
|
||||
offset = 0;
|
||||
ga += fragment_len;
|
||||
len -= fragment_len;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int access_guest_page(struct kvm *kvm, enum gacc_mode mode, gpa_t gpa,
|
||||
void *data, unsigned int len)
|
||||
{
|
||||
const unsigned int offset = offset_in_page(gpa);
|
||||
const gfn_t gfn = gpa_to_gfn(gpa);
|
||||
int rc;
|
||||
|
||||
if (!gfn_to_memslot(kvm, gfn))
|
||||
return PGM_ADDRESSING;
|
||||
if (mode == GACC_STORE)
|
||||
rc = kvm_write_guest_page(kvm, gfn, data, offset, len);
|
||||
else
|
||||
rc = kvm_read_guest_page(kvm, gfn, data, offset, len);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int access_guest(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar, void *data,
|
||||
unsigned long len, enum gacc_mode mode)
|
||||
{
|
||||
psw_t *psw = &vcpu->arch.sie_block->gpsw;
|
||||
unsigned long _len, nr_pages, gpa, idx;
|
||||
unsigned long pages_array[2];
|
||||
unsigned long *pages;
|
||||
unsigned long nr_pages, idx;
|
||||
unsigned long gpa_array[2];
|
||||
unsigned int fragment_len;
|
||||
unsigned long *gpas;
|
||||
int need_ipte_lock;
|
||||
union asce asce;
|
||||
int rc;
|
||||
@@ -845,50 +901,45 @@ int access_guest(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar, void *data,
|
||||
if (rc)
|
||||
return rc;
|
||||
nr_pages = (((ga & ~PAGE_MASK) + len - 1) >> PAGE_SHIFT) + 1;
|
||||
pages = pages_array;
|
||||
if (nr_pages > ARRAY_SIZE(pages_array))
|
||||
pages = vmalloc(array_size(nr_pages, sizeof(unsigned long)));
|
||||
if (!pages)
|
||||
gpas = gpa_array;
|
||||
if (nr_pages > ARRAY_SIZE(gpa_array))
|
||||
gpas = vmalloc(array_size(nr_pages, sizeof(unsigned long)));
|
||||
if (!gpas)
|
||||
return -ENOMEM;
|
||||
need_ipte_lock = psw_bits(*psw).dat && !asce.r;
|
||||
if (need_ipte_lock)
|
||||
ipte_lock(vcpu);
|
||||
rc = guest_page_range(vcpu, ga, ar, pages, nr_pages, asce, mode);
|
||||
rc = guest_range_to_gpas(vcpu, ga, ar, gpas, len, asce, mode);
|
||||
for (idx = 0; idx < nr_pages && !rc; idx++) {
|
||||
gpa = *(pages + idx) + (ga & ~PAGE_MASK);
|
||||
_len = min(PAGE_SIZE - (gpa & ~PAGE_MASK), len);
|
||||
if (mode == GACC_STORE)
|
||||
rc = kvm_write_guest(vcpu->kvm, gpa, data, _len);
|
||||
else
|
||||
rc = kvm_read_guest(vcpu->kvm, gpa, data, _len);
|
||||
len -= _len;
|
||||
ga += _len;
|
||||
data += _len;
|
||||
fragment_len = min(PAGE_SIZE - offset_in_page(gpas[idx]), len);
|
||||
rc = access_guest_page(vcpu->kvm, mode, gpas[idx], data, fragment_len);
|
||||
len -= fragment_len;
|
||||
data += fragment_len;
|
||||
}
|
||||
if (need_ipte_lock)
|
||||
ipte_unlock(vcpu);
|
||||
if (nr_pages > ARRAY_SIZE(pages_array))
|
||||
vfree(pages);
|
||||
if (nr_pages > ARRAY_SIZE(gpa_array))
|
||||
vfree(gpas);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int access_guest_real(struct kvm_vcpu *vcpu, unsigned long gra,
|
||||
void *data, unsigned long len, enum gacc_mode mode)
|
||||
{
|
||||
unsigned long _len, gpa;
|
||||
unsigned int fragment_len;
|
||||
unsigned long gpa;
|
||||
int rc = 0;
|
||||
|
||||
while (len && !rc) {
|
||||
gpa = kvm_s390_real_to_abs(vcpu, gra);
|
||||
_len = min(PAGE_SIZE - (gpa & ~PAGE_MASK), len);
|
||||
if (mode)
|
||||
rc = write_guest_abs(vcpu, gpa, data, _len);
|
||||
else
|
||||
rc = read_guest_abs(vcpu, gpa, data, _len);
|
||||
len -= _len;
|
||||
gra += _len;
|
||||
data += _len;
|
||||
fragment_len = min(PAGE_SIZE - offset_in_page(gpa), len);
|
||||
rc = access_guest_page(vcpu->kvm, mode, gpa, data, fragment_len);
|
||||
len -= fragment_len;
|
||||
gra += fragment_len;
|
||||
data += fragment_len;
|
||||
}
|
||||
if (rc > 0)
|
||||
vcpu->arch.pgm.code = rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -904,8 +955,6 @@ int access_guest_real(struct kvm_vcpu *vcpu, unsigned long gra,
|
||||
int guest_translate_address(struct kvm_vcpu *vcpu, unsigned long gva, u8 ar,
|
||||
unsigned long *gpa, enum gacc_mode mode)
|
||||
{
|
||||
psw_t *psw = &vcpu->arch.sie_block->gpsw;
|
||||
enum prot_type prot;
|
||||
union asce asce;
|
||||
int rc;
|
||||
|
||||
@@ -913,23 +962,7 @@ int guest_translate_address(struct kvm_vcpu *vcpu, unsigned long gva, u8 ar,
|
||||
rc = get_vcpu_asce(vcpu, &asce, gva, ar, mode);
|
||||
if (rc)
|
||||
return rc;
|
||||
if (is_low_address(gva) && low_address_protection_enabled(vcpu, asce)) {
|
||||
if (mode == GACC_STORE)
|
||||
return trans_exc(vcpu, PGM_PROTECTION, gva, 0,
|
||||
mode, PROT_TYPE_LA);
|
||||
}
|
||||
|
||||
if (psw_bits(*psw).dat && !asce.r) { /* Use DAT? */
|
||||
rc = guest_translate(vcpu, gva, gpa, asce, mode, &prot);
|
||||
if (rc > 0)
|
||||
return trans_exc(vcpu, rc, gva, 0, mode, prot);
|
||||
} else {
|
||||
*gpa = kvm_s390_real_to_abs(vcpu, gva);
|
||||
if (kvm_is_error_gpa(vcpu->kvm, *gpa))
|
||||
return trans_exc(vcpu, rc, gva, PGM_ADDRESSING, mode, 0);
|
||||
}
|
||||
|
||||
return rc;
|
||||
return guest_range_to_gpas(vcpu, gva, ar, gpa, 1, asce, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -938,17 +971,14 @@ int guest_translate_address(struct kvm_vcpu *vcpu, unsigned long gva, u8 ar,
|
||||
int check_gva_range(struct kvm_vcpu *vcpu, unsigned long gva, u8 ar,
|
||||
unsigned long length, enum gacc_mode mode)
|
||||
{
|
||||
unsigned long gpa;
|
||||
unsigned long currlen;
|
||||
union asce asce;
|
||||
int rc = 0;
|
||||
|
||||
rc = get_vcpu_asce(vcpu, &asce, gva, ar, mode);
|
||||
if (rc)
|
||||
return rc;
|
||||
ipte_lock(vcpu);
|
||||
while (length > 0 && !rc) {
|
||||
currlen = min(length, PAGE_SIZE - (gva % PAGE_SIZE));
|
||||
rc = guest_translate_address(vcpu, gva, ar, &gpa, mode);
|
||||
gva += currlen;
|
||||
length -= currlen;
|
||||
}
|
||||
rc = guest_range_to_gpas(vcpu, gva, ar, NULL, length, asce, mode);
|
||||
ipte_unlock(vcpu);
|
||||
|
||||
return rc;
|
||||
|
||||
@@ -344,11 +344,12 @@ int read_guest_abs(struct kvm_vcpu *vcpu, unsigned long gpa, void *data,
|
||||
* @len: number of bytes to copy
|
||||
*
|
||||
* Copy @len bytes from @data (kernel space) to @gra (guest real address).
|
||||
* It is up to the caller to ensure that the entire guest memory range is
|
||||
* valid memory before calling this function.
|
||||
* Guest low address and key protection are not checked.
|
||||
*
|
||||
* Returns zero on success or -EFAULT on error.
|
||||
* Returns zero on success, -EFAULT when copying from @data failed, or
|
||||
* PGM_ADRESSING in case @gra is outside a memslot. In this case, pgm check info
|
||||
* is also stored to allow injecting into the guest (if applicable) using
|
||||
* kvm_s390_inject_prog_cond().
|
||||
*
|
||||
* If an error occurs data may have been copied partially to guest memory.
|
||||
*/
|
||||
@@ -367,11 +368,12 @@ int write_guest_real(struct kvm_vcpu *vcpu, unsigned long gra, void *data,
|
||||
* @len: number of bytes to copy
|
||||
*
|
||||
* Copy @len bytes from @gra (guest real address) to @data (kernel space).
|
||||
* It is up to the caller to ensure that the entire guest memory range is
|
||||
* valid memory before calling this function.
|
||||
* Guest key protection is not checked.
|
||||
*
|
||||
* Returns zero on success or -EFAULT on error.
|
||||
* Returns zero on success, -EFAULT when copying to @data failed, or
|
||||
* PGM_ADRESSING in case @gra is outside a memslot. In this case, pgm check info
|
||||
* is also stored to allow injecting into the guest (if applicable) using
|
||||
* kvm_s390_inject_prog_cond().
|
||||
*
|
||||
* If an error occurs data may have been copied partially to kernel space.
|
||||
*/
|
||||
|
||||
@@ -98,11 +98,12 @@ static long cmm_alloc_pages(long nr, long *counter,
|
||||
(*counter)++;
|
||||
spin_unlock(&cmm_lock);
|
||||
nr--;
|
||||
cond_resched();
|
||||
}
|
||||
return nr;
|
||||
}
|
||||
|
||||
static long cmm_free_pages(long nr, long *counter, struct cmm_page_array **list)
|
||||
static long __cmm_free_pages(long nr, long *counter, struct cmm_page_array **list)
|
||||
{
|
||||
struct cmm_page_array *pa;
|
||||
unsigned long addr;
|
||||
@@ -126,6 +127,21 @@ static long cmm_free_pages(long nr, long *counter, struct cmm_page_array **list)
|
||||
return nr;
|
||||
}
|
||||
|
||||
static long cmm_free_pages(long nr, long *counter, struct cmm_page_array **list)
|
||||
{
|
||||
long inc = 0;
|
||||
|
||||
while (nr) {
|
||||
inc = min(256L, nr);
|
||||
nr -= inc;
|
||||
inc = __cmm_free_pages(inc, counter, list);
|
||||
if (inc)
|
||||
break;
|
||||
cond_resched();
|
||||
}
|
||||
return nr + inc;
|
||||
}
|
||||
|
||||
static int cmm_oom_notify(struct notifier_block *self,
|
||||
unsigned long dummy, void *parm)
|
||||
{
|
||||
|
||||
@@ -133,7 +133,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
||||
|
||||
static void *c_start(struct seq_file *m, loff_t *pos)
|
||||
{
|
||||
return *pos < NR_CPUS ? cpu_data + *pos : NULL;
|
||||
return *pos < nr_cpu_ids ? cpu_data + *pos : NULL;
|
||||
}
|
||||
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
|
||||
{
|
||||
|
||||
@@ -349,7 +349,7 @@ static struct platform_driver uml_net_driver = {
|
||||
|
||||
static void net_device_release(struct device *dev)
|
||||
{
|
||||
struct uml_net *device = dev_get_drvdata(dev);
|
||||
struct uml_net *device = container_of(dev, struct uml_net, pdev.dev);
|
||||
struct net_device *netdev = device->dev;
|
||||
struct uml_net_private *lp = netdev_priv(netdev);
|
||||
|
||||
|
||||
@@ -854,7 +854,7 @@ static int ubd_open_dev(struct ubd *ubd_dev)
|
||||
|
||||
static void ubd_device_release(struct device *dev)
|
||||
{
|
||||
struct ubd *ubd_dev = dev_get_drvdata(dev);
|
||||
struct ubd *ubd_dev = container_of(dev, struct ubd, pdev.dev);
|
||||
|
||||
blk_cleanup_queue(ubd_dev->queue);
|
||||
*ubd_dev = ((struct ubd) DEFAULT_UBD);
|
||||
|
||||
@@ -797,7 +797,8 @@ static struct platform_driver uml_net_driver = {
|
||||
|
||||
static void vector_device_release(struct device *dev)
|
||||
{
|
||||
struct vector_device *device = dev_get_drvdata(dev);
|
||||
struct vector_device *device =
|
||||
container_of(dev, struct vector_device, pdev.dev);
|
||||
struct net_device *netdev = device->dev;
|
||||
|
||||
list_del(&device->list);
|
||||
|
||||
@@ -396,6 +396,6 @@ int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu)
|
||||
{
|
||||
int cpu = current_thread_info()->cpu;
|
||||
|
||||
return save_i387_registers(userspace_pid[cpu], (unsigned long *) fpu);
|
||||
return save_i387_registers(userspace_pid[cpu], (unsigned long *) fpu) == 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,10 @@ static inline bool amd_gart_present(void)
|
||||
|
||||
#define amd_nb_num(x) 0
|
||||
#define amd_nb_has_feature(x) false
|
||||
#define node_to_amd_nb(x) NULL
|
||||
static inline struct amd_northbridge *node_to_amd_nb(int node)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#define amd_gart_present(x) false
|
||||
|
||||
#endif
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
#define X86_FEATURE_SPEC_STORE_BYPASS_DISABLE ( 7*32+23) /* "" Disable Speculative Store Bypass. */
|
||||
#define X86_FEATURE_LS_CFG_SSBD ( 7*32+24) /* "" AMD SSBD implementation via LS_CFG MSR */
|
||||
#define X86_FEATURE_IBRS ( 7*32+25) /* Indirect Branch Restricted Speculation */
|
||||
#define X86_FEATURE_IBPB ( 7*32+26) /* Indirect Branch Prediction Barrier */
|
||||
#define X86_FEATURE_IBPB ( 7*32+26) /* "ibpb" Indirect Branch Prediction Barrier without a guaranteed RSB flush */
|
||||
#define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */
|
||||
#define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */
|
||||
#define X86_FEATURE_L1TF_PTEINV ( 7*32+29) /* "" L1TF workaround PTE inversion */
|
||||
@@ -306,6 +306,7 @@
|
||||
#define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */
|
||||
#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */
|
||||
#define X86_FEATURE_BTC_NO (13*32+29) /* "" Not vulnerable to Branch Type Confusion */
|
||||
#define X86_FEATURE_AMD_IBPB_RET (13*32+30) /* "" IBPB clears return address predictor */
|
||||
|
||||
/* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
|
||||
#define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */
|
||||
|
||||
@@ -484,7 +484,19 @@ static int lapic_timer_shutdown(struct clock_event_device *evt)
|
||||
v = apic_read(APIC_LVTT);
|
||||
v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
|
||||
apic_write(APIC_LVTT, v);
|
||||
apic_write(APIC_TMICT, 0);
|
||||
|
||||
/*
|
||||
* Setting APIC_LVT_MASKED (above) should be enough to tell
|
||||
* the hardware that this timer will never fire. But AMD
|
||||
* erratum 411 and some Intel CPU behavior circa 2024 say
|
||||
* otherwise. Time for belt and suspenders programming: mask
|
||||
* the timer _and_ zero the counter registers:
|
||||
*/
|
||||
if (v & APIC_LVT_TIMER_TSCDEADLINE)
|
||||
wrmsrl(MSR_IA32_TSC_DEADLINE, 0);
|
||||
else
|
||||
apic_write(APIC_TMICT, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,6 +243,7 @@ static void __init ms_hyperv_init_platform(void)
|
||||
ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
|
||||
x86_platform.calibrate_tsc = hv_get_tsc_khz;
|
||||
x86_platform.calibrate_cpu = hv_get_tsc_khz;
|
||||
setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
|
||||
}
|
||||
|
||||
if (ms_hyperv.hints & HV_X64_ENLIGHTENED_VMCS_RECOMMENDED) {
|
||||
|
||||
@@ -862,7 +862,7 @@ char * __init xen_memory_setup(void)
|
||||
* to relocating (and even reusing) pages with kernel text or data.
|
||||
*/
|
||||
if (xen_is_e820_reserved(__pa_symbol(_text),
|
||||
__pa_symbol(__bss_stop) - __pa_symbol(_text))) {
|
||||
__pa_symbol(_end) - __pa_symbol(_text))) {
|
||||
xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
|
||||
BUG();
|
||||
}
|
||||
|
||||
@@ -2226,8 +2226,12 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
|
||||
struct bfq_queue *in_service_bfqq, *new_bfqq;
|
||||
|
||||
/* if a merge has already been setup, then proceed with that first */
|
||||
if (bfqq->new_bfqq)
|
||||
return bfqq->new_bfqq;
|
||||
new_bfqq = bfqq->new_bfqq;
|
||||
if (new_bfqq) {
|
||||
while (new_bfqq->new_bfqq)
|
||||
new_bfqq = new_bfqq->new_bfqq;
|
||||
return new_bfqq;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent bfqq from being merged if it has been created too
|
||||
@@ -5033,7 +5037,7 @@ bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq)
|
||||
{
|
||||
bfq_log_bfqq(bfqq->bfqd, bfqq, "splitting queue");
|
||||
|
||||
if (bfqq_process_refs(bfqq) == 1) {
|
||||
if (bfqq_process_refs(bfqq) == 1 && !bfqq->new_bfqq) {
|
||||
bfqq->pid = current->pid;
|
||||
bfq_clear_bfqq_coop(bfqq);
|
||||
bfq_clear_bfqq_split_coop(bfqq);
|
||||
@@ -5218,7 +5222,8 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
|
||||
* addition, if the queue has also just been split, we have to
|
||||
* resume its state.
|
||||
*/
|
||||
if (likely(bfqq != &bfqd->oom_bfqq) && bfqq_process_refs(bfqq) == 1) {
|
||||
if (likely(bfqq != &bfqd->oom_bfqq) && !bfqq->new_bfqq &&
|
||||
bfqq_process_refs(bfqq) == 1) {
|
||||
bfqq->bic = bic;
|
||||
if (split) {
|
||||
/*
|
||||
|
||||
@@ -1546,6 +1546,12 @@ void blk_mq_start_stopped_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
|
||||
return;
|
||||
|
||||
clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
|
||||
/*
|
||||
* Pairs with the smp_mb() in blk_mq_hctx_stopped() to order the
|
||||
* clearing of BLK_MQ_S_STOPPED above and the checking of dispatch
|
||||
* list in the subsequent routine.
|
||||
*/
|
||||
smp_mb__after_atomic();
|
||||
blk_mq_run_hw_queue(hctx, async);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_mq_start_stopped_hw_queue);
|
||||
|
||||
@@ -142,6 +142,19 @@ static inline struct blk_mq_tags *blk_mq_tags_from_data(struct blk_mq_alloc_data
|
||||
|
||||
static inline bool blk_mq_hctx_stopped(struct blk_mq_hw_ctx *hctx)
|
||||
{
|
||||
/* Fast path: hardware queue is not stopped most of the time. */
|
||||
if (likely(!test_bit(BLK_MQ_S_STOPPED, &hctx->state)))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* This barrier is used to order adding of dispatch list before and
|
||||
* the test of BLK_MQ_S_STOPPED below. Pairs with the memory barrier
|
||||
* in blk_mq_start_stopped_hw_queue() so that dispatch code could
|
||||
* either see BLK_MQ_S_STOPPED is cleared or dispatch list is not
|
||||
* empty to avoid missing dispatching requests.
|
||||
*/
|
||||
smp_mb();
|
||||
|
||||
return test_bit(BLK_MQ_S_STOPPED, &hctx->state);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,7 @@ static int setkey_unaligned(struct crypto_aead *tfm, const u8 *key,
|
||||
alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
|
||||
memcpy(alignbuffer, key, keylen);
|
||||
ret = crypto_aead_alg(tfm)->setkey(tfm, alignbuffer, keylen);
|
||||
memset(alignbuffer, 0, keylen);
|
||||
kfree(buffer);
|
||||
kzfree(buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@ static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key,
|
||||
alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
|
||||
memcpy(alignbuffer, key, keylen);
|
||||
ret = cia->cia_setkey(tfm, alignbuffer, keylen);
|
||||
memset(alignbuffer, 0, keylen);
|
||||
kfree(buffer);
|
||||
kzfree(buffer);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
@@ -174,8 +174,10 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
|
||||
err = pcrypt_do_parallel(padata, &ctx->cb_cpu, &pencrypt);
|
||||
if (!err)
|
||||
return -EINPROGRESS;
|
||||
if (err == -EBUSY)
|
||||
return -EAGAIN;
|
||||
if (err == -EBUSY) {
|
||||
/* try non-parallel mode */
|
||||
return crypto_aead_encrypt(creq);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -220,8 +222,10 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
|
||||
err = pcrypt_do_parallel(padata, &ctx->cb_cpu, &pdecrypt);
|
||||
if (!err)
|
||||
return -EINPROGRESS;
|
||||
if (err == -EBUSY)
|
||||
return -EAGAIN;
|
||||
if (err == -EBUSY) {
|
||||
/* try non-parallel mode */
|
||||
return crypto_aead_decrypt(creq);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -170,6 +170,8 @@ acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object)
|
||||
elements =
|
||||
ACPI_ALLOCATE_ZEROED(DB_DEFAULT_PKG_ELEMENTS *
|
||||
sizeof(union acpi_object));
|
||||
if (!elements)
|
||||
return (AE_NO_MEMORY);
|
||||
|
||||
this = string;
|
||||
for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++) {
|
||||
|
||||
@@ -437,6 +437,9 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
|
||||
|
||||
if (info->connection_node) {
|
||||
second_desc = info->connection_node->object;
|
||||
if (second_desc == NULL) {
|
||||
break;
|
||||
}
|
||||
if (!(second_desc->common.flags & AOPOBJ_DATA_VALID)) {
|
||||
status =
|
||||
acpi_ds_get_buffer_arguments(second_desc);
|
||||
|
||||
@@ -25,6 +25,8 @@ acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state);
|
||||
static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
|
||||
*parser_state);
|
||||
|
||||
static void acpi_ps_free_field_list(union acpi_parse_object *start);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_get_next_package_length
|
||||
@@ -683,6 +685,39 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
|
||||
return_PTR(field);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_free_field_list
|
||||
*
|
||||
* PARAMETERS: start - First Op in field list
|
||||
*
|
||||
* RETURN: None.
|
||||
*
|
||||
* DESCRIPTION: Free all Op objects inside a field list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void acpi_ps_free_field_list(union acpi_parse_object *start)
|
||||
{
|
||||
union acpi_parse_object *cur = start;
|
||||
union acpi_parse_object *next;
|
||||
union acpi_parse_object *arg;
|
||||
|
||||
while (cur) {
|
||||
next = cur->common.next;
|
||||
|
||||
/* AML_INT_CONNECTION_OP can have a single argument */
|
||||
|
||||
arg = acpi_ps_get_arg(cur, 0);
|
||||
if (arg) {
|
||||
acpi_ps_free_op(arg);
|
||||
}
|
||||
|
||||
acpi_ps_free_op(cur);
|
||||
cur = next;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_get_next_arg
|
||||
@@ -751,6 +786,10 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
|
||||
while (parser_state->aml < parser_state->pkg_end) {
|
||||
field = acpi_ps_get_next_field(parser_state);
|
||||
if (!field) {
|
||||
if (arg) {
|
||||
acpi_ps_free_field_list(arg);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
@@ -820,6 +859,10 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
|
||||
acpi_ps_get_next_namepath(walk_state, parser_state,
|
||||
arg,
|
||||
ACPI_NOT_METHOD_CALL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_ps_free_op(arg);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
} else {
|
||||
/* Single complex argument, nothing returned */
|
||||
|
||||
@@ -854,6 +897,10 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
|
||||
acpi_ps_get_next_namepath(walk_state, parser_state,
|
||||
arg,
|
||||
ACPI_POSSIBLE_METHOD_CALL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_ps_free_op(arg);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
if (arg->common.aml_opcode == AML_INT_METHODCALL_OP) {
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ error:
|
||||
if (frame->virt_irq > 0)
|
||||
acpi_unregister_gsi(gtdt_frame->virtual_timer_interrupt);
|
||||
frame->virt_irq = 0;
|
||||
} while (i-- >= 0 && gtdt_frame--);
|
||||
} while (i-- > 0 && gtdt_frame--);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -713,27 +713,34 @@ static LIST_HEAD(acpi_battery_list);
|
||||
static LIST_HEAD(battery_hook_list);
|
||||
static DEFINE_MUTEX(hook_mutex);
|
||||
|
||||
static void __battery_hook_unregister(struct acpi_battery_hook *hook, int lock)
|
||||
static void battery_hook_unregister_unlocked(struct acpi_battery_hook *hook)
|
||||
{
|
||||
struct acpi_battery *battery;
|
||||
|
||||
/*
|
||||
* In order to remove a hook, we first need to
|
||||
* de-register all the batteries that are registered.
|
||||
*/
|
||||
if (lock)
|
||||
mutex_lock(&hook_mutex);
|
||||
list_for_each_entry(battery, &acpi_battery_list, list) {
|
||||
hook->remove_battery(battery->bat);
|
||||
}
|
||||
list_del(&hook->list);
|
||||
if (lock)
|
||||
mutex_unlock(&hook_mutex);
|
||||
list_del_init(&hook->list);
|
||||
|
||||
pr_info("extension unregistered: %s\n", hook->name);
|
||||
}
|
||||
|
||||
void battery_hook_unregister(struct acpi_battery_hook *hook)
|
||||
{
|
||||
__battery_hook_unregister(hook, 1);
|
||||
mutex_lock(&hook_mutex);
|
||||
/*
|
||||
* Ignore already unregistered battery hooks. This might happen
|
||||
* if a battery hook was previously unloaded due to an error when
|
||||
* adding a new battery.
|
||||
*/
|
||||
if (!list_empty(&hook->list))
|
||||
battery_hook_unregister_unlocked(hook);
|
||||
|
||||
mutex_unlock(&hook_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(battery_hook_unregister);
|
||||
|
||||
@@ -742,7 +749,6 @@ void battery_hook_register(struct acpi_battery_hook *hook)
|
||||
struct acpi_battery *battery;
|
||||
|
||||
mutex_lock(&hook_mutex);
|
||||
INIT_LIST_HEAD(&hook->list);
|
||||
list_add(&hook->list, &battery_hook_list);
|
||||
/*
|
||||
* Now that the driver is registered, we need
|
||||
@@ -759,7 +765,7 @@ void battery_hook_register(struct acpi_battery_hook *hook)
|
||||
* hooks.
|
||||
*/
|
||||
pr_err("extension failed to load: %s", hook->name);
|
||||
__battery_hook_unregister(hook, 0);
|
||||
battery_hook_unregister_unlocked(hook);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -796,7 +802,7 @@ static void battery_hook_add_battery(struct acpi_battery *battery)
|
||||
*/
|
||||
pr_err("error in extension, unloading: %s",
|
||||
hook_node->name);
|
||||
__battery_hook_unregister(hook_node, 0);
|
||||
battery_hook_unregister_unlocked(hook_node);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&hook_mutex);
|
||||
@@ -829,7 +835,7 @@ static void __exit battery_hook_exit(void)
|
||||
* need to remove the hooks.
|
||||
*/
|
||||
list_for_each_entry_safe(hook, ptr, &battery_hook_list, list) {
|
||||
__battery_hook_unregister(hook, 1);
|
||||
battery_hook_unregister(hook);
|
||||
}
|
||||
mutex_destroy(&hook_mutex);
|
||||
}
|
||||
|
||||
@@ -124,6 +124,17 @@ static const struct dmi_system_id lid_blacklst[] = {
|
||||
},
|
||||
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Samsung galaxybook2 ,initial _LID device notification returns
|
||||
* lid closed.
|
||||
*/
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "750XED"),
|
||||
},
|
||||
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -539,8 +539,9 @@ int acpi_device_setup_files(struct acpi_device *dev)
|
||||
* If device has _STR, 'description' file is created
|
||||
*/
|
||||
if (acpi_has_method(dev->handle, "_STR")) {
|
||||
status = acpi_evaluate_object(dev->handle, "_STR",
|
||||
NULL, &buffer);
|
||||
status = acpi_evaluate_object_typed(dev->handle, "_STR",
|
||||
NULL, &buffer,
|
||||
ACPI_TYPE_BUFFER);
|
||||
if (ACPI_FAILURE(status))
|
||||
buffer.pointer = NULL;
|
||||
dev->pnp.str_obj = buffer.pointer;
|
||||
|
||||
@@ -807,6 +807,9 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
|
||||
unsigned long tmp;
|
||||
int ret = 0;
|
||||
|
||||
if (t->rdata)
|
||||
memset(t->rdata, 0, t->rlen);
|
||||
|
||||
/* start transaction */
|
||||
spin_lock_irqsave(&ec->lock, tmp);
|
||||
/* Enable GPE for command processing (IBF=0/OBF=1) */
|
||||
@@ -843,8 +846,6 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
|
||||
|
||||
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
|
||||
return -EINVAL;
|
||||
if (t->rdata)
|
||||
memset(t->rdata, 0, t->rlen);
|
||||
|
||||
mutex_lock(&ec->mutex);
|
||||
if (ec->global_lock) {
|
||||
@@ -871,7 +872,7 @@ static int acpi_ec_burst_enable(struct acpi_ec *ec)
|
||||
.wdata = NULL, .rdata = &d,
|
||||
.wlen = 0, .rlen = 1};
|
||||
|
||||
return acpi_ec_transaction(ec, &t);
|
||||
return acpi_ec_transaction_unlocked(ec, &t);
|
||||
}
|
||||
|
||||
static int acpi_ec_burst_disable(struct acpi_ec *ec)
|
||||
@@ -881,7 +882,7 @@ static int acpi_ec_burst_disable(struct acpi_ec *ec)
|
||||
.wlen = 0, .rlen = 0};
|
||||
|
||||
return (acpi_ec_read_status(ec) & ACPI_EC_FLAG_BURST) ?
|
||||
acpi_ec_transaction(ec, &t) : 0;
|
||||
acpi_ec_transaction_unlocked(ec, &t) : 0;
|
||||
}
|
||||
|
||||
static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 *data)
|
||||
@@ -897,6 +898,19 @@ static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 *data)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_ec_read_unlocked(struct acpi_ec *ec, u8 address, u8 *data)
|
||||
{
|
||||
int result;
|
||||
u8 d;
|
||||
struct transaction t = {.command = ACPI_EC_COMMAND_READ,
|
||||
.wdata = &address, .rdata = &d,
|
||||
.wlen = 1, .rlen = 1};
|
||||
|
||||
result = acpi_ec_transaction_unlocked(ec, &t);
|
||||
*data = d;
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
|
||||
{
|
||||
u8 wdata[2] = { address, data };
|
||||
@@ -907,6 +921,16 @@ static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
|
||||
return acpi_ec_transaction(ec, &t);
|
||||
}
|
||||
|
||||
static int acpi_ec_write_unlocked(struct acpi_ec *ec, u8 address, u8 data)
|
||||
{
|
||||
u8 wdata[2] = { address, data };
|
||||
struct transaction t = {.command = ACPI_EC_COMMAND_WRITE,
|
||||
.wdata = wdata, .rdata = NULL,
|
||||
.wlen = 2, .rlen = 0};
|
||||
|
||||
return acpi_ec_transaction_unlocked(ec, &t);
|
||||
}
|
||||
|
||||
int ec_read(u8 addr, u8 *val)
|
||||
{
|
||||
int err;
|
||||
@@ -1320,6 +1344,7 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
|
||||
struct acpi_ec *ec = handler_context;
|
||||
int result = 0, i, bytes = bits / 8;
|
||||
u8 *value = (u8 *)value64;
|
||||
u32 glk;
|
||||
|
||||
if ((address > 0xFF) || !value || !handler_context)
|
||||
return AE_BAD_PARAMETER;
|
||||
@@ -1327,13 +1352,25 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
|
||||
if (function != ACPI_READ && function != ACPI_WRITE)
|
||||
return AE_BAD_PARAMETER;
|
||||
|
||||
mutex_lock(&ec->mutex);
|
||||
|
||||
if (ec->global_lock) {
|
||||
acpi_status status;
|
||||
|
||||
status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
result = -ENODEV;
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
|
||||
if (ec->busy_polling || bits > 8)
|
||||
acpi_ec_burst_enable(ec);
|
||||
|
||||
for (i = 0; i < bytes; ++i, ++address, ++value) {
|
||||
result = (function == ACPI_READ) ?
|
||||
acpi_ec_read(ec, address, value) :
|
||||
acpi_ec_write(ec, address, *value);
|
||||
acpi_ec_read_unlocked(ec, address, value) :
|
||||
acpi_ec_write_unlocked(ec, address, *value);
|
||||
if (result < 0)
|
||||
break;
|
||||
}
|
||||
@@ -1341,6 +1378,12 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
|
||||
if (ec->busy_polling || bits > 8)
|
||||
acpi_ec_burst_disable(ec);
|
||||
|
||||
if (ec->global_lock)
|
||||
acpi_release_global_lock(glk);
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&ec->mutex);
|
||||
|
||||
switch (result) {
|
||||
case -EINVAL:
|
||||
return AE_BAD_PARAMETER;
|
||||
|
||||
@@ -376,10 +376,8 @@ static int tps68470_pmic_opregion_probe(struct platform_device *pdev)
|
||||
struct tps68470_pmic_opregion *opregion;
|
||||
acpi_status status;
|
||||
|
||||
if (!dev || !tps68470_regmap) {
|
||||
dev_warn(dev, "dev or regmap is NULL\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!tps68470_regmap)
|
||||
return dev_err_probe(dev, -EINVAL, "regmap is missing\n");
|
||||
|
||||
if (!handle) {
|
||||
dev_warn(dev, "acpi handle is NULL\n");
|
||||
|
||||
@@ -144,7 +144,7 @@ static const struct pci_device_id sil_pci_tbl[] = {
|
||||
static const struct sil_drivelist {
|
||||
const char *product;
|
||||
unsigned int quirk;
|
||||
} sil_blacklist [] = {
|
||||
} sil_quirks[] = {
|
||||
{ "ST320012AS", SIL_QUIRK_MOD15WRITE },
|
||||
{ "ST330013AS", SIL_QUIRK_MOD15WRITE },
|
||||
{ "ST340017AS", SIL_QUIRK_MOD15WRITE },
|
||||
@@ -617,8 +617,8 @@ static void sil_thaw(struct ata_port *ap)
|
||||
* list, and apply the fixups to only the specific
|
||||
* devices/hosts/firmwares that need it.
|
||||
*
|
||||
* 20040111 - Seagate drives affected by the Mod15Write bug are blacklisted
|
||||
* The Maxtor quirk is in the blacklist, but I'm keeping the original
|
||||
* 20040111 - Seagate drives affected by the Mod15Write bug are quirked
|
||||
* The Maxtor quirk is in sil_quirks, but I'm keeping the original
|
||||
* pessimistic fix for the following reasons...
|
||||
* - There seems to be less info on it, only one device gleaned off the
|
||||
* Windows driver, maybe only one is affected. More info would be greatly
|
||||
@@ -637,9 +637,9 @@ static void sil_dev_config(struct ata_device *dev)
|
||||
|
||||
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
|
||||
|
||||
for (n = 0; sil_blacklist[n].product; n++)
|
||||
if (!strcmp(sil_blacklist[n].product, model_num)) {
|
||||
quirks = sil_blacklist[n].quirk;
|
||||
for (n = 0; sil_quirks[n].product; n++)
|
||||
if (!strcmp(sil_quirks[n].product, model_num)) {
|
||||
quirks = sil_quirks[n].quirk;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,8 @@ static ssize_t bus_attr_show(struct kobject *kobj, struct attribute *attr,
|
||||
{
|
||||
struct bus_attribute *bus_attr = to_bus_attr(attr);
|
||||
struct subsys_private *subsys_priv = to_subsys_private(kobj);
|
||||
ssize_t ret = 0;
|
||||
/* return -EIO for reading a bus attribute without show() */
|
||||
ssize_t ret = -EIO;
|
||||
|
||||
if (bus_attr->show)
|
||||
ret = bus_attr->show(subsys_priv->bus, buf);
|
||||
@@ -115,7 +116,8 @@ static ssize_t bus_attr_store(struct kobject *kobj, struct attribute *attr,
|
||||
{
|
||||
struct bus_attribute *bus_attr = to_bus_attr(attr);
|
||||
struct subsys_private *subsys_priv = to_subsys_private(kobj);
|
||||
ssize_t ret = 0;
|
||||
/* return -EIO for writing a bus attribute without store() */
|
||||
ssize_t ret = -EIO;
|
||||
|
||||
if (bus_attr->store)
|
||||
ret = bus_attr->store(subsys_priv->bus, buf, count);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/sched/signal.h>
|
||||
#include <linux/sysfs.h>
|
||||
|
||||
@@ -1581,7 +1580,6 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
|
||||
struct kobj_uevent_env *env)
|
||||
{
|
||||
struct device *dev = kobj_to_dev(kobj);
|
||||
struct device_driver *driver;
|
||||
int retval = 0;
|
||||
|
||||
/* add device node properties if present */
|
||||
@@ -1610,12 +1608,8 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
|
||||
if (dev->type && dev->type->name)
|
||||
add_uevent_var(env, "DEVTYPE=%s", dev->type->name);
|
||||
|
||||
/* Synchronize with module_remove_driver() */
|
||||
rcu_read_lock();
|
||||
driver = READ_ONCE(dev->driver);
|
||||
if (driver)
|
||||
add_uevent_var(env, "DRIVER=%s", driver->name);
|
||||
rcu_read_unlock();
|
||||
if (dev->driver)
|
||||
add_uevent_var(env, "DRIVER=%s", dev->driver->name);
|
||||
|
||||
/* Add common DT information about the device */
|
||||
of_device_uevent(dev, env);
|
||||
@@ -1685,8 +1679,11 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr,
|
||||
if (!env)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Synchronize with really_probe() */
|
||||
device_lock(dev);
|
||||
/* let the kset specific function add its keys */
|
||||
retval = kset->uevent_ops->uevent(kset, &dev->kobj, env);
|
||||
device_unlock(dev);
|
||||
if (retval)
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -565,6 +565,26 @@ static void fw_abort_batch_reqs(struct firmware *fw)
|
||||
mutex_unlock(&fw_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reject firmware file names with ".." path components.
|
||||
* There are drivers that construct firmware file names from device-supplied
|
||||
* strings, and we don't want some device to be able to tell us "I would like to
|
||||
* be sent my firmware from ../../../etc/shadow, please".
|
||||
*
|
||||
* Search for ".." surrounded by either '/' or start/end of string.
|
||||
*
|
||||
* This intentionally only looks at the firmware name, not at the firmware base
|
||||
* directory or at symlink contents.
|
||||
*/
|
||||
static bool name_contains_dotdot(const char *name)
|
||||
{
|
||||
size_t name_len = strlen(name);
|
||||
|
||||
return strcmp(name, "..") == 0 || strncmp(name, "../", 3) == 0 ||
|
||||
strstr(name, "/../") != NULL ||
|
||||
(name_len >= 3 && strcmp(name+name_len-3, "/..") == 0);
|
||||
}
|
||||
|
||||
/* called from request_firmware() and request_firmware_work_func() */
|
||||
static int
|
||||
_request_firmware(const struct firmware **firmware_p, const char *name,
|
||||
@@ -582,6 +602,14 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (name_contains_dotdot(name)) {
|
||||
dev_warn(device,
|
||||
"Firmware load for '%s' refused, path contains '..' component\n",
|
||||
name);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = _request_firmware_prepare(&fw, name, device, buf, size,
|
||||
opt_flags);
|
||||
if (ret <= 0) /* error or already assigned */
|
||||
@@ -622,6 +650,8 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
|
||||
* @name will be used as $FIRMWARE in the uevent environment and
|
||||
* should be distinctive enough not to be confused with any other
|
||||
* firmware image for this or any other device.
|
||||
* It must not contain any ".." path components - "foo/bar..bin" is
|
||||
* allowed, but "foo/../bar.bin" is not.
|
||||
*
|
||||
* Caller must hold the reference count of @device.
|
||||
*
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/errno.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include "base.h"
|
||||
|
||||
static char *make_driver_name(struct device_driver *drv)
|
||||
@@ -78,9 +77,6 @@ void module_remove_driver(struct device_driver *drv)
|
||||
if (!drv)
|
||||
return;
|
||||
|
||||
/* Synchronize with dev_uevent() */
|
||||
synchronize_rcu();
|
||||
|
||||
sysfs_remove_link(&drv->p->kobj, "module");
|
||||
|
||||
if (drv->owner)
|
||||
|
||||
@@ -397,12 +397,16 @@ exit:
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
static struct lock_class_key regmap_irq_lock_class;
|
||||
static struct lock_class_key regmap_irq_request_class;
|
||||
|
||||
static int regmap_irq_map(struct irq_domain *h, unsigned int virq,
|
||||
irq_hw_number_t hw)
|
||||
{
|
||||
struct regmap_irq_chip_data *data = h->host_data;
|
||||
|
||||
irq_set_chip_data(virq, data);
|
||||
irq_set_lockdep_class(virq, ®map_irq_lock_class, ®map_irq_request_class);
|
||||
irq_set_chip(virq, &data->irq_chip);
|
||||
irq_set_nested_thread(virq, 1);
|
||||
irq_set_parent(virq, data->irq);
|
||||
|
||||
@@ -362,6 +362,7 @@ ata_rw_frameinit(struct frame *f)
|
||||
}
|
||||
|
||||
ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit;
|
||||
dev_hold(t->ifp->nd);
|
||||
skb->dev = t->ifp->nd;
|
||||
}
|
||||
|
||||
@@ -402,6 +403,8 @@ aoecmd_ata_rw(struct aoedev *d)
|
||||
__skb_queue_head_init(&queue);
|
||||
__skb_queue_tail(&queue, skb);
|
||||
aoenet_xmit(&queue);
|
||||
} else {
|
||||
dev_put(f->t->ifp->nd);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -484,10 +487,13 @@ resend(struct aoedev *d, struct frame *f)
|
||||
memcpy(h->dst, t->addr, sizeof h->dst);
|
||||
memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src);
|
||||
|
||||
dev_hold(t->ifp->nd);
|
||||
skb->dev = t->ifp->nd;
|
||||
skb = skb_clone(skb, GFP_ATOMIC);
|
||||
if (skb == NULL)
|
||||
if (skb == NULL) {
|
||||
dev_put(t->ifp->nd);
|
||||
return;
|
||||
}
|
||||
f->sent = ktime_get();
|
||||
__skb_queue_head_init(&queue);
|
||||
__skb_queue_tail(&queue, skb);
|
||||
@@ -618,6 +624,8 @@ probe(struct aoetgt *t)
|
||||
__skb_queue_head_init(&queue);
|
||||
__skb_queue_tail(&queue, skb);
|
||||
aoenet_xmit(&queue);
|
||||
} else {
|
||||
dev_put(f->t->ifp->nd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1407,6 +1415,7 @@ aoecmd_ata_id(struct aoedev *d)
|
||||
ah->cmdstat = ATA_CMD_ID_ATA;
|
||||
ah->lba3 = 0xa0;
|
||||
|
||||
dev_hold(t->ifp->nd);
|
||||
skb->dev = t->ifp->nd;
|
||||
|
||||
d->rttavg = RTTAVG_INIT;
|
||||
@@ -1416,6 +1425,8 @@ aoecmd_ata_id(struct aoedev *d)
|
||||
skb = skb_clone(skb, GFP_ATOMIC);
|
||||
if (skb)
|
||||
f->sent = ktime_get();
|
||||
else
|
||||
dev_put(t->ifp->nd);
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
||||
@@ -3499,10 +3499,12 @@ void drbd_uuid_new_current(struct drbd_device *device) __must_hold(local)
|
||||
void drbd_uuid_set_bm(struct drbd_device *device, u64 val) __must_hold(local)
|
||||
{
|
||||
unsigned long flags;
|
||||
if (device->ldev->md.uuid[UI_BITMAP] == 0 && val == 0)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&device->ldev->md.uuid_lock, flags);
|
||||
if (device->ldev->md.uuid[UI_BITMAP] == 0 && val == 0) {
|
||||
spin_unlock_irqrestore(&device->ldev->md.uuid_lock, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
if (val == 0) {
|
||||
drbd_uuid_move_history(device);
|
||||
device->ldev->md.uuid[UI_HISTORY_START] = device->ldev->md.uuid[UI_BITMAP];
|
||||
|
||||
@@ -888,7 +888,7 @@ is_valid_state(struct drbd_device *device, union drbd_state ns)
|
||||
ns.disk == D_OUTDATED)
|
||||
rv = SS_CONNECTED_OUTDATES;
|
||||
|
||||
else if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) &&
|
||||
else if (nc && (ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) &&
|
||||
(nc->verify_alg[0] == 0))
|
||||
rv = SS_NO_VERIFY_ALG;
|
||||
|
||||
|
||||
@@ -743,7 +743,15 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
|
||||
if (!urb)
|
||||
return -ENOMEM;
|
||||
|
||||
size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
|
||||
if (le16_to_cpu(data->udev->descriptor.idVendor) == 0x0a12 &&
|
||||
le16_to_cpu(data->udev->descriptor.idProduct) == 0x0001)
|
||||
/* Fake CSR devices don't seem to support sort-transter */
|
||||
size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
|
||||
else
|
||||
/* Use maximum HCI Event size so the USB stack handles
|
||||
* ZPL/short-transfer automatically.
|
||||
*/
|
||||
size = HCI_MAX_EVENT_SIZE;
|
||||
|
||||
buf = kmalloc(size, mem_flags);
|
||||
if (!buf) {
|
||||
|
||||
@@ -2075,25 +2075,27 @@ static int virtcons_probe(struct virtio_device *vdev)
|
||||
multiport = true;
|
||||
}
|
||||
|
||||
err = init_vqs(portdev);
|
||||
if (err < 0) {
|
||||
dev_err(&vdev->dev, "Error %d initializing vqs\n", err);
|
||||
goto free_chrdev;
|
||||
}
|
||||
|
||||
spin_lock_init(&portdev->ports_lock);
|
||||
INIT_LIST_HEAD(&portdev->ports);
|
||||
INIT_LIST_HEAD(&portdev->list);
|
||||
|
||||
virtio_device_ready(portdev->vdev);
|
||||
|
||||
INIT_WORK(&portdev->config_work, &config_work_handler);
|
||||
INIT_WORK(&portdev->control_work, &control_work_handler);
|
||||
|
||||
if (multiport) {
|
||||
spin_lock_init(&portdev->c_ivq_lock);
|
||||
spin_lock_init(&portdev->c_ovq_lock);
|
||||
}
|
||||
|
||||
err = init_vqs(portdev);
|
||||
if (err < 0) {
|
||||
dev_err(&vdev->dev, "Error %d initializing vqs\n", err);
|
||||
goto free_chrdev;
|
||||
}
|
||||
|
||||
virtio_device_ready(portdev->vdev);
|
||||
|
||||
if (multiport) {
|
||||
err = fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
|
||||
if (err < 0) {
|
||||
dev_err(&vdev->dev,
|
||||
|
||||
@@ -115,7 +115,7 @@ static void bcm53573_ilp_init(struct device_node *np)
|
||||
goto err_free_ilp;
|
||||
}
|
||||
|
||||
ilp->regmap = syscon_node_to_regmap(of_get_parent(np));
|
||||
ilp->regmap = syscon_node_to_regmap(np->parent);
|
||||
if (IS_ERR(ilp->regmap)) {
|
||||
err = PTR_ERR(ilp->regmap);
|
||||
goto err_free_ilp;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/io.h>
|
||||
@@ -414,7 +415,7 @@ static int axi_clkgen_probe(struct platform_device *pdev)
|
||||
struct clk_init_data init = {};
|
||||
const char *parent_names[2];
|
||||
const char *clk_name;
|
||||
struct resource *mem;
|
||||
struct clk *axi_clk;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
@@ -429,14 +430,29 @@ static int axi_clkgen_probe(struct platform_device *pdev)
|
||||
if (!axi_clkgen)
|
||||
return -ENOMEM;
|
||||
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
axi_clkgen->base = devm_ioremap_resource(&pdev->dev, mem);
|
||||
axi_clkgen->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(axi_clkgen->base))
|
||||
return PTR_ERR(axi_clkgen->base);
|
||||
|
||||
init.num_parents = of_clk_get_parent_count(pdev->dev.of_node);
|
||||
if (init.num_parents < 1 || init.num_parents > 2)
|
||||
return -EINVAL;
|
||||
|
||||
axi_clk = devm_clk_get_enabled(&pdev->dev, "s_axi_aclk");
|
||||
if (!IS_ERR(axi_clk)) {
|
||||
if (init.num_parents < 2 || init.num_parents > 3)
|
||||
return -EINVAL;
|
||||
|
||||
init.num_parents -= 1;
|
||||
} else {
|
||||
/*
|
||||
* Legacy... So that old DTs which do not have clock-names still
|
||||
* work. In this case we don't explicitly enable the AXI bus
|
||||
* clock.
|
||||
*/
|
||||
if (PTR_ERR(axi_clk) != -ENOENT)
|
||||
return PTR_ERR(axi_clk);
|
||||
if (init.num_parents < 1 || init.num_parents > 2)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < init.num_parents; i++) {
|
||||
parent_names[i] = of_clk_get_parent_name(pdev->dev.of_node, i);
|
||||
|
||||
@@ -9,31 +9,101 @@
|
||||
#include <linux/export.h>
|
||||
#include <linux/gfp.h>
|
||||
|
||||
struct devm_clk_state {
|
||||
struct clk *clk;
|
||||
void (*exit)(struct clk *clk);
|
||||
};
|
||||
|
||||
static void devm_clk_release(struct device *dev, void *res)
|
||||
{
|
||||
clk_put(*(struct clk **)res);
|
||||
struct devm_clk_state *state = res;
|
||||
|
||||
if (state->exit)
|
||||
state->exit(state->clk);
|
||||
|
||||
clk_put(state->clk);
|
||||
}
|
||||
|
||||
static struct clk *__devm_clk_get(struct device *dev, const char *id,
|
||||
struct clk *(*get)(struct device *dev, const char *id),
|
||||
int (*init)(struct clk *clk),
|
||||
void (*exit)(struct clk *clk))
|
||||
{
|
||||
struct devm_clk_state *state;
|
||||
struct clk *clk;
|
||||
int ret;
|
||||
|
||||
state = devres_alloc(devm_clk_release, sizeof(*state), GFP_KERNEL);
|
||||
if (!state)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
clk = get(dev, id);
|
||||
if (IS_ERR(clk)) {
|
||||
ret = PTR_ERR(clk);
|
||||
goto err_clk_get;
|
||||
}
|
||||
|
||||
if (init) {
|
||||
ret = init(clk);
|
||||
if (ret)
|
||||
goto err_clk_init;
|
||||
}
|
||||
|
||||
state->clk = clk;
|
||||
state->exit = exit;
|
||||
|
||||
devres_add(dev, state);
|
||||
|
||||
return clk;
|
||||
|
||||
err_clk_init:
|
||||
|
||||
clk_put(clk);
|
||||
err_clk_get:
|
||||
|
||||
devres_free(state);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
struct clk *devm_clk_get(struct device *dev, const char *id)
|
||||
{
|
||||
struct clk **ptr, *clk;
|
||||
|
||||
ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL);
|
||||
if (!ptr)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
clk = clk_get(dev, id);
|
||||
if (!IS_ERR(clk)) {
|
||||
*ptr = clk;
|
||||
devres_add(dev, ptr);
|
||||
} else {
|
||||
devres_free(ptr);
|
||||
}
|
||||
|
||||
return clk;
|
||||
return __devm_clk_get(dev, id, clk_get, NULL, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(devm_clk_get);
|
||||
|
||||
struct clk *devm_clk_get_prepared(struct device *dev, const char *id)
|
||||
{
|
||||
return __devm_clk_get(dev, id, clk_get, clk_prepare, clk_unprepare);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_clk_get_prepared);
|
||||
|
||||
struct clk *devm_clk_get_enabled(struct device *dev, const char *id)
|
||||
{
|
||||
return __devm_clk_get(dev, id, clk_get,
|
||||
clk_prepare_enable, clk_disable_unprepare);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_clk_get_enabled);
|
||||
|
||||
struct clk *devm_clk_get_optional(struct device *dev, const char *id)
|
||||
{
|
||||
return __devm_clk_get(dev, id, clk_get_optional, NULL, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(devm_clk_get_optional);
|
||||
|
||||
struct clk *devm_clk_get_optional_prepared(struct device *dev, const char *id)
|
||||
{
|
||||
return __devm_clk_get(dev, id, clk_get_optional,
|
||||
clk_prepare, clk_unprepare);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_clk_get_optional_prepared);
|
||||
|
||||
struct clk *devm_clk_get_optional_enabled(struct device *dev, const char *id)
|
||||
{
|
||||
return __devm_clk_get(dev, id, clk_get_optional,
|
||||
clk_prepare_enable, clk_disable_unprepare);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_clk_get_optional_enabled);
|
||||
|
||||
struct clk_bulk_devres {
|
||||
struct clk_bulk_data *clks;
|
||||
int num_clks;
|
||||
@@ -93,18 +163,19 @@ EXPORT_SYMBOL(devm_clk_put);
|
||||
struct clk *devm_get_clk_from_child(struct device *dev,
|
||||
struct device_node *np, const char *con_id)
|
||||
{
|
||||
struct clk **ptr, *clk;
|
||||
struct devm_clk_state *state;
|
||||
struct clk *clk;
|
||||
|
||||
ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL);
|
||||
if (!ptr)
|
||||
state = devres_alloc(devm_clk_release, sizeof(*state), GFP_KERNEL);
|
||||
if (!state)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
clk = of_clk_get_by_name(np, con_id);
|
||||
if (!IS_ERR(clk)) {
|
||||
*ptr = clk;
|
||||
devres_add(dev, ptr);
|
||||
state->clk = clk;
|
||||
devres_add(dev, state);
|
||||
} else {
|
||||
devres_free(ptr);
|
||||
devres_free(state);
|
||||
}
|
||||
|
||||
return clk;
|
||||
|
||||
@@ -415,7 +415,7 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
|
||||
RK2928_CLKSEL_CON(29), 0, 3, DFLAGS),
|
||||
DIV(0, "sclk_vop_pre", "sclk_vop_src", 0,
|
||||
RK2928_CLKSEL_CON(27), 8, 8, DFLAGS),
|
||||
MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, 0,
|
||||
MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
||||
RK2928_CLKSEL_CON(27), 1, 1, MFLAGS),
|
||||
|
||||
FACTOR(0, "xin12m", "xin24m", 0, 1, 2),
|
||||
|
||||
@@ -444,12 +444,13 @@ void __init rockchip_clk_register_branches(
|
||||
struct rockchip_clk_branch *list,
|
||||
unsigned int nr_clk)
|
||||
{
|
||||
struct clk *clk = NULL;
|
||||
struct clk *clk;
|
||||
unsigned int idx;
|
||||
unsigned long flags;
|
||||
|
||||
for (idx = 0; idx < nr_clk; idx++, list++) {
|
||||
flags = list->flags;
|
||||
clk = NULL;
|
||||
|
||||
/* catch simple muxes */
|
||||
switch (list->branch_type) {
|
||||
|
||||
@@ -257,6 +257,7 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
clk = of_clk_get_from_provider(&clkspec);
|
||||
of_node_put(clkspec.np);
|
||||
if (IS_ERR(clk)) {
|
||||
pr_err("%s: failed to get atl clock %d from provider\n",
|
||||
__func__, i);
|
||||
|
||||
@@ -242,6 +242,7 @@ static int __init msm_dt_timer_init(struct device_node *np)
|
||||
}
|
||||
|
||||
if (of_property_read_u32(np, "clock-frequency", &freq)) {
|
||||
iounmap(cpu0_base);
|
||||
pr_err("Unknown frequency\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -252,7 +253,11 @@ static int __init msm_dt_timer_init(struct device_node *np)
|
||||
freq /= 4;
|
||||
writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL);
|
||||
|
||||
return msm_timer_init(freq, 32, irq, !!percpu_offset);
|
||||
ret = msm_timer_init(freq, 32, irq, !!percpu_offset);
|
||||
if (ret)
|
||||
iounmap(cpu0_base);
|
||||
|
||||
return ret;
|
||||
}
|
||||
TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
|
||||
TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
|
||||
|
||||
@@ -166,7 +166,9 @@ static int __init cpufreq_init(void)
|
||||
|
||||
ret = cpufreq_register_driver(&loongson2_cpufreq_driver);
|
||||
|
||||
if (!ret && !nowait) {
|
||||
if (ret) {
|
||||
platform_driver_unregister(&platform_driver);
|
||||
} else if (!nowait) {
|
||||
saved_cpu_wait = cpu_wait;
|
||||
cpu_wait = loongson2_cpu_wait;
|
||||
}
|
||||
|
||||
@@ -2510,6 +2510,7 @@ static int ahash_hmac_setkey(struct crypto_ahash *ahash, const u8 *key,
|
||||
|
||||
static int ahash_hmac_init(struct ahash_request *req)
|
||||
{
|
||||
int ret;
|
||||
struct iproc_reqctx_s *rctx = ahash_request_ctx(req);
|
||||
struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
|
||||
struct iproc_ctx_s *ctx = crypto_ahash_ctx(tfm);
|
||||
@@ -2519,7 +2520,9 @@ static int ahash_hmac_init(struct ahash_request *req)
|
||||
flow_log("ahash_hmac_init()\n");
|
||||
|
||||
/* init the context as a hash */
|
||||
ahash_init(req);
|
||||
ret = ahash_init(req);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!spu_no_incr_hash(ctx)) {
|
||||
/* SPU-M can do incr hashing but needs sw for outer HMAC */
|
||||
|
||||
@@ -48,7 +48,7 @@ static void cpt_disable_cores(struct cpt_device *cpt, u64 coremask,
|
||||
dev_err(dev, "Cores still busy %llx", coremask);
|
||||
grp = cpt_read_csr64(cpt->reg_base,
|
||||
CPTX_PF_EXEC_BUSY(0));
|
||||
if (timeout--)
|
||||
if (!timeout--)
|
||||
break;
|
||||
|
||||
udelay(CSR_DELAY);
|
||||
@@ -306,6 +306,8 @@ static int cpt_ucode_load_fw(struct cpt_device *cpt, const u8 *fw, bool is_ae)
|
||||
|
||||
ret = do_cpt_init(cpt, mcode);
|
||||
if (ret) {
|
||||
dma_free_coherent(&cpt->pdev->dev, mcode->code_size,
|
||||
mcode->code, mcode->phys_base);
|
||||
dev_err(dev, "do_cpt_init failed with ret: %d\n", ret);
|
||||
goto fw_release;
|
||||
}
|
||||
@@ -398,7 +400,7 @@ static void cpt_disable_all_cores(struct cpt_device *cpt)
|
||||
dev_err(dev, "Cores still busy");
|
||||
grp = cpt_read_csr64(cpt->reg_base,
|
||||
CPTX_PF_EXEC_BUSY(0));
|
||||
if (timeout--)
|
||||
if (!timeout--)
|
||||
break;
|
||||
|
||||
udelay(CSR_DELAY);
|
||||
|
||||
@@ -327,21 +327,25 @@ static void fsl_mc_check(struct mem_ctl_info *mci)
|
||||
* TODO: Add support for 32-bit wide buses
|
||||
*/
|
||||
if ((err_detect & DDR_EDE_SBE) && (bus_width == 64)) {
|
||||
u64 cap = (u64)cap_high << 32 | cap_low;
|
||||
u32 s = syndrome;
|
||||
|
||||
sbe_ecc_decode(cap_high, cap_low, syndrome,
|
||||
&bad_data_bit, &bad_ecc_bit);
|
||||
|
||||
if (bad_data_bit != -1)
|
||||
fsl_mc_printk(mci, KERN_ERR,
|
||||
"Faulty Data bit: %d\n", bad_data_bit);
|
||||
if (bad_ecc_bit != -1)
|
||||
fsl_mc_printk(mci, KERN_ERR,
|
||||
"Faulty ECC bit: %d\n", bad_ecc_bit);
|
||||
if (bad_data_bit >= 0) {
|
||||
fsl_mc_printk(mci, KERN_ERR, "Faulty Data bit: %d\n", bad_data_bit);
|
||||
cap ^= 1ULL << bad_data_bit;
|
||||
}
|
||||
|
||||
if (bad_ecc_bit >= 0) {
|
||||
fsl_mc_printk(mci, KERN_ERR, "Faulty ECC bit: %d\n", bad_ecc_bit);
|
||||
s ^= 1 << bad_ecc_bit;
|
||||
}
|
||||
|
||||
fsl_mc_printk(mci, KERN_ERR,
|
||||
"Expected Data / ECC:\t%#8.8x_%08x / %#2.2x\n",
|
||||
cap_high ^ (1 << (bad_data_bit - 32)),
|
||||
cap_low ^ (1 << bad_data_bit),
|
||||
syndrome ^ (1 << bad_ecc_bit));
|
||||
upper_32_bits(cap), lower_32_bits(cap), s);
|
||||
}
|
||||
|
||||
fsl_mc_printk(mci, KERN_ERR,
|
||||
|
||||
@@ -638,6 +638,9 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
|
||||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
if (!buf.opp_count)
|
||||
return ERR_PTR(-ENOENT);
|
||||
|
||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||
if (!info)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -800,7 +800,7 @@ static int sdei_device_freeze(struct device *dev)
|
||||
int err;
|
||||
|
||||
/* unregister private events */
|
||||
cpuhp_remove_state(sdei_entry_point);
|
||||
cpuhp_remove_state(sdei_hp_state);
|
||||
|
||||
err = sdei_unregister_shared();
|
||||
if (err)
|
||||
|
||||
@@ -407,6 +407,8 @@ static void __aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset,
|
||||
gpio->dcache[GPIO_BANK(offset)] = reg;
|
||||
|
||||
iowrite32(reg, addr);
|
||||
/* Flush write */
|
||||
ioread32(addr);
|
||||
}
|
||||
|
||||
static void aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset,
|
||||
@@ -1174,7 +1176,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
|
||||
if (!gpio_id)
|
||||
return -EINVAL;
|
||||
|
||||
gpio->clk = of_clk_get(pdev->dev.of_node, 0);
|
||||
gpio->clk = devm_clk_get_enabled(&pdev->dev, NULL);
|
||||
if (IS_ERR(gpio->clk)) {
|
||||
dev_warn(&pdev->dev,
|
||||
"Failed to get clock from devicetree, debouncing disabled\n");
|
||||
|
||||
@@ -294,7 +294,7 @@ err:
|
||||
* serve as EDMA event triggers.
|
||||
*/
|
||||
|
||||
static void gpio_irq_disable(struct irq_data *d)
|
||||
static void gpio_irq_mask(struct irq_data *d)
|
||||
{
|
||||
struct davinci_gpio_regs __iomem *g = irq2regs(d);
|
||||
u32 mask = (u32) irq_data_get_irq_handler_data(d);
|
||||
@@ -303,7 +303,7 @@ static void gpio_irq_disable(struct irq_data *d)
|
||||
writel_relaxed(mask, &g->clr_rising);
|
||||
}
|
||||
|
||||
static void gpio_irq_enable(struct irq_data *d)
|
||||
static void gpio_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
struct davinci_gpio_regs __iomem *g = irq2regs(d);
|
||||
u32 mask = (u32) irq_data_get_irq_handler_data(d);
|
||||
@@ -329,8 +329,8 @@ static int gpio_irq_type(struct irq_data *d, unsigned trigger)
|
||||
|
||||
static struct irq_chip gpio_irqchip = {
|
||||
.name = "GPIO",
|
||||
.irq_enable = gpio_irq_enable,
|
||||
.irq_disable = gpio_irq_disable,
|
||||
.irq_unmask = gpio_irq_unmask,
|
||||
.irq_mask = gpio_irq_mask,
|
||||
.irq_set_type = gpio_irq_type,
|
||||
.flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE,
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/nospec.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/device.h>
|
||||
@@ -144,7 +145,7 @@ struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip,
|
||||
if (hwnum >= gdev->ngpio)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
return &gdev->descs[hwnum];
|
||||
return &gdev->descs[array_index_nospec(hwnum, gdev->ngpio)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -90,6 +90,7 @@ static union acpi_object *amdgpu_atif_call(struct amdgpu_atif *atif,
|
||||
struct acpi_buffer *params)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_object *obj;
|
||||
union acpi_object atif_arg_elements[2];
|
||||
struct acpi_object_list atif_arg;
|
||||
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
|
||||
@@ -112,16 +113,24 @@ static union acpi_object *amdgpu_atif_call(struct amdgpu_atif *atif,
|
||||
|
||||
status = acpi_evaluate_object(atif->handle, NULL, &atif_arg,
|
||||
&buffer);
|
||||
obj = (union acpi_object *)buffer.pointer;
|
||||
|
||||
/* Fail only if calling the method fails and ATIF is supported */
|
||||
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
|
||||
/* Fail if calling the method fails */
|
||||
if (ACPI_FAILURE(status)) {
|
||||
DRM_DEBUG_DRIVER("failed to evaluate ATIF got %s\n",
|
||||
acpi_format_exception(status));
|
||||
kfree(buffer.pointer);
|
||||
kfree(obj);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return buffer.pointer;
|
||||
if (obj->type != ACPI_TYPE_BUFFER) {
|
||||
DRM_DEBUG_DRIVER("bad object returned from ATIF: %d\n",
|
||||
obj->type);
|
||||
kfree(obj);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -394,7 +394,7 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
|
||||
if (!adev->smc_rreg)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (size & 0x3 || *pos & 0x3)
|
||||
if (size > 4096 || size & 0x3 || *pos & 0x3)
|
||||
return -EINVAL;
|
||||
|
||||
while (size) {
|
||||
|
||||
@@ -2095,23 +2095,29 @@ amdgpu_atombios_encoder_get_lcd_info(struct amdgpu_encoder *encoder)
|
||||
fake_edid_record = (ATOM_FAKE_EDID_PATCH_RECORD *)record;
|
||||
if (fake_edid_record->ucFakeEDIDLength) {
|
||||
struct edid *edid;
|
||||
int edid_size =
|
||||
max((int)EDID_LENGTH, (int)fake_edid_record->ucFakeEDIDLength);
|
||||
edid = kmalloc(edid_size, GFP_KERNEL);
|
||||
if (edid) {
|
||||
memcpy((u8 *)edid, (u8 *)&fake_edid_record->ucFakeEDIDString[0],
|
||||
fake_edid_record->ucFakeEDIDLength);
|
||||
int edid_size;
|
||||
|
||||
if (fake_edid_record->ucFakeEDIDLength == 128)
|
||||
edid_size = fake_edid_record->ucFakeEDIDLength;
|
||||
else
|
||||
edid_size = fake_edid_record->ucFakeEDIDLength * 128;
|
||||
edid = kmemdup(&fake_edid_record->ucFakeEDIDString[0],
|
||||
edid_size, GFP_KERNEL);
|
||||
if (edid) {
|
||||
if (drm_edid_is_valid(edid)) {
|
||||
adev->mode_info.bios_hardcoded_edid = edid;
|
||||
adev->mode_info.bios_hardcoded_edid_size = edid_size;
|
||||
} else
|
||||
} else {
|
||||
kfree(edid);
|
||||
}
|
||||
}
|
||||
record += struct_size(fake_edid_record,
|
||||
ucFakeEDIDString,
|
||||
edid_size);
|
||||
} else {
|
||||
/* empty fake edid record must be 3 bytes long */
|
||||
record += sizeof(ATOM_FAKE_EDID_PATCH_RECORD) + 1;
|
||||
}
|
||||
record += fake_edid_record->ucFakeEDIDLength ?
|
||||
fake_edid_record->ucFakeEDIDLength + 2 :
|
||||
sizeof(ATOM_FAKE_EDID_PATCH_RECORD);
|
||||
break;
|
||||
case LCD_PANEL_RESOLUTION_RECORD_TYPE:
|
||||
panel_res_record = (ATOM_PANEL_RESOLUTION_PATCH_RECORD *)record;
|
||||
|
||||
@@ -1569,6 +1569,8 @@ static bool are_stream_backends_same(
|
||||
bool dc_is_stream_unchanged(
|
||||
struct dc_stream_state *old_stream, struct dc_stream_state *stream)
|
||||
{
|
||||
if (!old_stream || !stream)
|
||||
return false;
|
||||
|
||||
if (!are_stream_backends_same(old_stream, stream))
|
||||
return false;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user