3cf9365660
This is the merge of 5.10.189 into the android12-5.10 branch. It contains the following commits: *f50fa8d8ceMerge 5.10.189 into android12-5.10-lts |\ | *de5f63612dLinux 5.10.189 | *2ae9a73819x86: fix backwards merge of GDS/SRSO bit | *f9167a2d6bxen/netback: Fix buffer overrun triggered by unusual packet | *8457fb5740x86/srso: Tie SBPB bit setting to microcode patch detection | *4873939c0ex86/srso: Fix return thunks in generated code | *384d41bea9x86/srso: Add IBPB on VMEXIT | *4acaea47e3x86/srso: Add IBPB | *e47af0c255x86/srso: Add SRSO_NO support | *df76a59febx86/srso: Add IBPB_BRTYPE support | *3f9b7101bex86/srso: Add a Speculative RAS Overflow mitigation | *34f23ba8a3x86/cpu, kvm: Add support for CPUID_80000021_EAX | *073a28a9b5x86/bugs: Increase the x86 bugs vector size to two u32s | *9b7fe7c6fbtools headers cpufeatures: Sync with the kernel sources | *437fa179f2x86/cpufeatures: Assign dedicated feature word for CPUID_0x8000001F[EAX] | *baf6d6c39ex86/cpu: Add VM page flush MSR availablility as a CPUID feature | *6750468784Documentation/x86: Fix backwards on/off logic about YMM support | *79972c2b95x86/mm: Initialize text poking earlier | *1ff14defdfmm: Move mm_cachep initialization to mm_init() | *6ee042fd24x86/mm: Use mm_alloc() in poking_init() | *f076d08178x86/mm: fix poking_init() for Xen PV guests | *583016037ax86/xen: Fix secondary processors' FPU initialization | *eb13cce488KVM: Add GDS_NO support to KVM | *7db4ddcb8dx86/speculation: Add Kconfig option for GDS | *363c98f9cfx86/speculation: Add force option to GDS mitigation | *288a2f6bc1x86/speculation: Add Gather Data Sampling mitigation | *4ae1cbb730x86/fpu: Move FPU initialization into arch_cpu_finalize_init() | *2462bc3ef0x86/fpu: Mark init functions __init | *7a2f42bce9x86/fpu: Remove cpuinfo argument from init functions | *18fcd72da1init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init() | *09658b81d1init: Invoke arch_cpu_finalize_init() earlier | *bf2fa3a9d0init: Remove check_bugs() leftovers | *b05031c2bcum/cpu: Switch to arch_cpu_finalize_init() | *2edb3b39casparc/cpu: Switch to arch_cpu_finalize_init() | *3c45134b38sh/cpu: Switch to arch_cpu_finalize_init() | *75bb54c951mips/cpu: Switch to arch_cpu_finalize_init() | *1cd3fc18ebm68k/cpu: Switch to arch_cpu_finalize_init() | *12d93c6c98ia64/cpu: Switch to arch_cpu_finalize_init() | *c0fff20d4eARM: cpu: Switch to arch_cpu_finalize_init() | *e5eb18e164x86/cpu: Switch to arch_cpu_finalize_init() | *6e606e6818init: Provide arch_cpu_finalize_init() * |49c25af89cRevert "bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE" * |117f73f9a7Revert "sctp: add bpf_bypass_getsockopt proto callback" * |64414277daRevert "net: Introduce net.ipv4.tcp_migrate_req." * |2afed824a4Revert "tcp: Fix data-races around sysctl_tcp_syn(ack)?_retries." * |08315eedaaRevert "tcp: annotate data-races around icsk->icsk_syn_retries" * |938b8658b9Revert "posix-timers: Ensure timer ID search-loop limit is valid" * |986fd89af0Revert "Revert "8250: add support for ASIX devices with a FIFO bug"" * |477f5e6b9eMerge 5.10.188 into android12-5.10-lts |\| | *3602dbc57bLinux 5.10.188 | *edce5fba78ftrace: Fix possible warning on checking all pages used in ftrace_process_locs() | *115b19f893ftrace: Store the order of pages allocated in ftrace_page | *1a1e793e02tracing: Fix memory leak of iter->temp when reading trace_pipe | *43e786aa51tracing/histograms: Return an error if we fail to add histogram to hist_vars list | *e3da59f428net: phy: prevent stale pointer dereference in phy_init() | *e0ac63e194tcp: annotate data-races around fastopenq.max_qlen | *d01afbfc2ftcp: annotate data-races around icsk->icsk_user_timeout | *3cf0a0f11dtcp: annotate data-races around tp->notsent_lowat | *9c786d5faftcp: annotate data-races around rskq_defer_accept | *f891375ebatcp: annotate data-races around tp->linger2 | *9168bd8f54tcp: annotate data-races around icsk->icsk_syn_retries | *7b0084918ctcp: Fix data-races around sysctl_tcp_syn(ack)?_retries. | *cf6c06ac74net: Introduce net.ipv4.tcp_migrate_req. | *a5c30a5187tcp: annotate data-races around tp->keepalive_probes | *93715448f1tcp: annotate data-races around tp->keepalive_intvl | *7b52a78a91tcp: annotate data-races around tp->keepalive_time | *1d4f2c4be1tcp: annotate data-races around tp->tcp_tx_delay | *30e5460d69netfilter: nf_tables: skip bound chain on rule flush | *94c10c0fa5netfilter: nf_tables: skip bound chain in netns release path | *3a91099ecdnetfilter: nft_set_pipapo: fix improper element removal | *9c2df17e3cnetfilter: nf_tables: can't schedule in nft_chain_validate | *533193a239netfilter: nf_tables: fix spurious set element insertion failure | *a6f1988780llc: Don't drop packet from non-root netns. | *49e435ca02fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe | *bc9d4d432fRevert "tcp: avoid the lookup process failing to get sk in ehash table" | *d06fc7b391net:ipv6: check return value of pskb_trim() | *1a478ad129net: ipv4: Use kfree_sensitive instead of kfree | *937105d2b0tcp: annotate data-races around tcp_rsk(req)->ts_recent | *41b0023869octeontx2-pf: Dont allocate BPIDs for LBK interfaces | *5bc78ba889security: keys: Modify mismatched function name | *b92defe4e8iavf: Fix out-of-bounds when setting channels on remove | *a4635f190fiavf: Fix use-after-free in free_netdev | *b37bc3b07ebridge: Add extack warning when enabling STP in netns. | *f6d311b953net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field() | *54aa4c0386pinctrl: amd: Use amd_pinconf_set() for all config options | *7041605e85fbdev: imxfb: warn about invalid left/right margin | *6e88cc510fspi: bcm63xx: fix max prepend length | *994c2ceb70igb: Fix igb_down hung on surprise removal | *a956c3af70wifi: iwlwifi: mvm: avoid baid size integer overflow | *85cf0d5f45wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point() | *2864cc9a1fdevlink: report devlink_port_type_warn source device | *b6d9a4062cbpf: Address KCSAN report on bpf_lru_list | *532f8bac60wifi: ath11k: fix registration of 6Ghz-only phy without the full channel range | *6b0c79aa33sched/fair: Don't balance task to its current running CPU | *32020fc2a8arm64: mm: fix VA-range sanity check | *c71d6934c6arm64: set __exception_irq_entry with __irq_entry as a default | *71e3f23540ACPI: video: Add backlight=native DMI quirk for Lenovo ThinkPad X131e (3371 AMD version) | *776a72f612ACPI: video: Add backlight=native DMI quirk for Apple iMac11,3 | *e090f70ae4ACPI: button: Add lid disable DMI quirk for Nextbook Ares 8A | *ae51eb90bcbtrfs: add xxhash to fast checksum implementations | *322377cc90posix-timers: Ensure timer ID search-loop limit is valid | *634daf6b2cmd/raid10: prevent soft lockup while flush writes | *b02939413emd: fix data corruption for raid456 when reshape restart while grow up | *4a2c62c8d6nbd: Add the maximum limit of allocated index in nbd_dev_add | *5f84a34b64debugobjects: Recheck debug_objects_enabled before reporting | *5d5aa5b648ext4: correct inline offset when handling xattrs in inode body | *48aa539375ASoC: fsl_sai: Disable bit clock with transmitter | *5f2a12f643drm/client: Fix memory leak in drm_client_modeset_probe | *105275879adrm/client: Fix memory leak in drm_client_target_cloned | *cf254b4f68can: bcm: Fix UAF in bcm_proc_show() | *3e412b6e2bregmap: Account for register length in SMBus I/O limits | *8b3dd8d23fregmap: Drop initial version of maximum transfer length fixes | *4935761daaselftests: tc: add 'ct' action kconfig dep | *1ab5aa1846selftests: tc: set timeout to 15 minutes | *dad97c205afuse: revalidate: don't invalidate if interrupted | *d2c667cc18btrfs: fix warning when putting transaction with qgroups enabled after abort | *4410f4a938perf probe: Add test for regression introduced by switch to die_get_decl_file() | *0a6b0ca586keys: Fix linking a duplicate key to a keyring's assoc_array | *a26208e184ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxx | *ce2a7e7b50ALSA: hda/realtek - remove 3k pull low procedure | *f09c0ac142drm/atomic: Fix potential use-after-free in nonblocking commits | *9a085fa9b7RDMA/cma: Ensure rdma_addr_cancel() happens before issuing more requests | *73e72a5380net/sched: sch_qfq: reintroduce lmax bound check for MTU | *0b1ce92fabscsi: qla2xxx: Remove unused nvme_ls_waitq wait queue | *5addd62586scsi: qla2xxx: Pointer may be dereferenced | *e8de73238dscsi: qla2xxx: Correct the index of array | *921d684462scsi: qla2xxx: Check valid rport returned by fc_bsg_to_rport() | *2bea9c1c98scsi: qla2xxx: Fix potential NULL pointer dereference | *eecb8a491cscsi: qla2xxx: Fix buffer overrun | *bcd773969ascsi: qla2xxx: Array index may go out of bound | *a9fe97fb7bscsi: qla2xxx: Wait for io return on terminate rport | *6ea2a408d3tracing/probes: Fix not to count error code to total length | *7060e5aac6tracing: Fix null pointer dereference in tracing_err_log_open() | *81fb8a58d4xtensa: ISS: fix call to split_if_spec | *5e68f1f3a2ring-buffer: Fix deadloop issue on reading trace_pipe | *1e760b2d18net: ena: fix shift-out-of-bounds in exponential backoff | *1f2a8f0835samples: ftrace: Save required argument registers in sample trampolines | *1576f0df7btracing/histograms: Add histograms to hist_vars if they have referenced variables | *07edd294b1s390/decompressor: fix misaligned symbol build error | *5f4a1111adRevert "8250: add support for ASIX devices with a FIFO bug" | *7f2f0e6ec5meson saradc: fix clock divider mask length | *790e4e82c5xhci: Show ZHAOXIN xHCI root hub speed correctly | *c52e04c58dxhci: Fix TRB prefetch issue of ZHAOXIN hosts | *b56a07c2a5xhci: Fix resume issue of some ZHAOXIN hosts | *8e807eadf0ceph: don't let check_caps skip sending responses for revoke msgs | *c04ed61ebffirmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool() | *1962717c46tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() when iterating clk | *a49e5a0512tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() in case of error | *08673739edserial: atmel: don't enable IRQs prematurely | *4016d36fecdrm/amd/display: Correct `DMUB_FW_VERSION` macro | *d89bd2ecd3drm/rockchip: vop: Leave vblank enabled in self-refresh | *b9ec9372a4drm/atomic: Allow vblank-enabled + self-refresh "disable" | *23d5004ee7fs: dlm: return positive pid value for F_GETLK | *5e9aff5b10md/raid0: add discard support for the 'original' layout | *8e3c777640misc: pci_endpoint_test: Re-init completion for every test | *cdf9a7e2cdmisc: pci_endpoint_test: Free IRQs before removing the device | *8c90c466e3PCI: rockchip: Set address alignment for endpoint mode | *f1986416cfPCI: rockchip: Use u32 variable to access 32-bit registers | *36eb130312PCI: rockchip: Fix legacy IRQ generation for RK3399 PCIe endpoint core | *c417a4c7dePCI: rockchip: Add poll and timeout to wait for PHY PLLs to be locked | *ddda61419aPCI: rockchip: Write PCI Device ID to correct register | *bec3e0f7f2PCI: rockchip: Assert PCI Configuration Enable bit after probe | *48e11e7c81PCI: qcom: Disable write access to read only registers for IP v2.3.3 | *aca71b004aPCI: Add function 1 DMA alias quirk for Marvell 88SE9235 | *d3bab5de91PCI/PM: Avoid putting EloPOS E2/S2/H2 PCIe Ports in D3cold | *5a89a5cc81hwrng: imx-rngc - fix the timeout for init and self check | *47b7eaae08jfs: jfs_dmap: Validate db_l2nbperpage while mounting | *84293af545ext4: only update i_reserved_data_blocks on successful block allocation | *0a5d12e710ext4: fix wrong unit use in ext4_mb_new_blocks | *514220246aext4: get block from bh in ext4_free_blocks for fast commit replay | *d054422eb6ext4: fix wrong unit use in ext4_mb_clear_bb | *be99faf0c4ext4: Fix reusing stale buffer heads from last failed mounting | *8fbe951d65MIPS: Loongson: Fix cpu_probe_loongson() again | *8c723eef98erofs: fix compact 4B support for 16k block size | *3bd4d316b1misc: fastrpc: Create fastrpc scalar with correct buffer count | *3d1d037f27powerpc: Fail build if using recordmcount with binutils v2.37 | *fe1ae1fb50net: bcmgenet: Ensure MDIO unregistration has clocks enabled | *21d5d3eb36mtd: rawnand: meson: fix unaligned DMA buffers handling | *9ff7fcb3a2tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation | *59490249c2pinctrl: amd: Only use special debounce behavior for GPIO 0 | *4f77a87ce9pinctrl: amd: Detect internal GPIO0 debounce handling | *3674b9c056pinctrl: amd: Fix mistake in handling clearing pins at startup | *b39ef5b52ff2fs: fix to avoid NULL pointer dereference f2fs_write_end_io() | *f4ff379812nvme-pci: fix DMA direction of unmapping integrity data | *8359ee85fdnet/sched: sch_qfq: account for stab overhead in qfq_enqueue | *5bef780e06net/sched: sch_qfq: refactor parsing of netlink parameters | *1d7ae38daanet/sched: make psched_mtu() RTNL-less safe | *d5ca61b764netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() | *9b69cdb6e5net/sched: flower: Ensure both minimum and maximum ports are specified | *934c85b8ecwifi: airo: avoid uninitialized warning in airo_get_rate() | *4511499138erofs: avoid infinite loop in z_erofs_do_read_page() when reading beyond EOF | *bbc500ff3friscv, bpf: Fix inconsistent JIT image generation | *a976adc3bcbpf, riscv: Support riscv jit to provide bpf_line_info | *eb3d1d84f3riscv: bpf: Avoid breaking W^X | *7c61643798riscv: bpf: Move bpf_jit_alloc_exec() and bpf_jit_free_exec() to core | *83579a6261igc: Fix inserting of empty frame for launchtime | *c48e8ee81aigc: Fix launchtime before start of cycle | *cdf5b9af92platform/x86: wmi: Break possible infinite loop when parsing GUID | *7157ee0de5platform/x86: wmi: move variables | *4bb2bb69bdplatform/x86: wmi: use guid_t and guid_equal() | *88dfb592d2platform/x86: wmi: remove unnecessary argument | *2ad31ce40eipv6/addrconf: fix a potential refcount underflow for idev | *8271145523NTB: ntb_tool: Add check for devm_kcalloc | *41c6d8ff71NTB: ntb_transport: fix possible memory leak while device_register() fails | *03cfa06534ntb: intel: Fix error handling in intel_ntb_pci_driver_init() | *23e09f0a86NTB: amd: Fix error handling in amd_ntb_pci_driver_init() | *0bb2683b0cntb: idt: Fix error handling in idt_pci_driver_init() | *3e8fed805cudp6: fix udp6_ehashfn() typo | *d30ddd7ff1icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev(). | *bc3ab5d2abnet: prevent skb corruption on frag list segmentation | *cddd04f341net: bgmac: postpone turning IRQs off to avoid SoC hangs | *f8cc4fd99aionic: remove WARN_ON to prevent panic_on_warn | *9085429821gve: Set default duplex configuration to full | *80e0e8d5f5net/sched: cls_fw: Fix improper refcount update leads to use-after-free | *d341f24612net: mvneta: fix txq_map in case of txq_number==1 | *c175603d84scsi: qla2xxx: Fix error code in qla2x00_start_sp() | *b687b78361igc: set TP bit in 'supported' and 'advertising' fields of ethtool_link_ksettings | *30c281a77fnet/mlx5e: Check for NOT_READY flag state after locking | *de6e6b0797net/mlx5e: fix double free in mlx5e_destroy_flow_table | *3d4bba694aigc: Remove delay during TX ring configuration | *2a587b71c5drm/panel: simple: Add Powertip PH800480T013 drm_display_mode flags | *547ab8ea86drm/panel: simple: Add connector_type for innolux_at043tn24 | *13c353dc5cworkqueue: clean up WORK_* constant types, clarify masking | *fc359e5b45net: lan743x: Don't sleep in atomic context | *dc4a25fa75io_uring: add reschedule point to handle_tw_list() | *297883bbcaio_uring: Use io_schedule* in cqring wait | *bb2f7e4bfeblock/partition: fix signedness issue for Amiga partitions | *4f91de9a81rcu-tasks: Simplify trc_read_check_handler() atomic operations | *3a64cd01cdrcu-tasks: Mark ->trc_reader_special.b.need_qs data races | *058f077d09rcu-tasks: Mark ->trc_reader_nesting data races | *83be9fd784tty: serial: fsl_lpuart: add earlycon for imx8ulp platform | *999f3b6104wireguard: netlink: send staged packets when setting initial private key | *1b71070405wireguard: queueing: use saner cpu selection wrapping | *ea21392224netfilter: nf_tables: prevent OOB access in nft_byteorder_eval | *4ae2e50133netfilter: nf_tables: do not ignore genmask when looking up chain by id | *8289d422f5netfilter: conntrack: Avoid nf_ct_helper_hash uses after free | *be6478f5ccnetfilter: nf_tables: fix scheduling-while-atomic splat | *a07e415be3netfilter: nf_tables: unbind non-anonymous set if rule construction fails | *a136b7942anetfilter: nf_tables: drop map element references from preparation phase | *21cf0d66efnetfilter: nftables: rename set element data activation/deactivation functions | *237f37f7b9netfilter: nf_tables: reject unbound chain set before commit phase | *0205dd16ednetfilter: nf_tables: reject unbound anonymous set before commit phase | *34d09fe49fnetfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain | *d53c295c1fnetfilter: nf_tables: fix chain binding transaction logic | *8180fc2fadnetfilter: nf_tables: incorrect error path handling with NFT_MSG_NEWRULE | *e546e6ebb1netfilter: nf_tables: add rescheduling points during loop detection walks | *3f51f1157fnetfilter: nf_tables: use net_generic infra for transaction data | *01248dd651sh: pgtable-3level: Fix cast to pointer from integer of different size | *87410743b5block: add overflow checks for Amiga partition support | *f0aec6c403selftests/bpf: Add verifier test for PTR_TO_MEM spill | *88bffb61bctpm, tpm_tis: Claim locality in interrupt handler | *5bf73af8b3fanotify: disallow mount/sb marks on kernel internal pseudo fs | *5cb46b80ecfs: no need to check source | *66a0647cdcleds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename | *5d6fbb6245ARM: orion5x: fix d2net gpio initialization | *9b0f7940e2ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path | *1dac8584beASoC: mediatek: mt8173: Fix irq error path | *6819bb0b85btrfs: fix race when deleting quota root from the dirty cow roots list | *a3fbd156bdbtrfs: add handling for RAID1C23/DUP to btrfs_reduce_alloc_profile | *59efb86711fs: Lock moved directories | *c5b5e72df1fs: Establish locking order for unrelated directories | *4b03f503b7Revert "f2fs: fix potential corruption when moving a directory" | *2b563acd2dext4: Remove ext4 locking of moved directory | *5e7d18a52cfs: avoid empty option when generating legacy mount string | *988a5d7911jffs2: reduce stack usage in jffs2_build_xattr_subsystem() | *5fada37511shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs | *79bef379d5autofs: use flexible array in ioctl structure | *8bf91a8d48integrity: Fix possible multiple allocation in integrity_inode_get() | *9658a03f80um: Use HOST_DIR for mrproper | *a4405f6ee0bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent | *db9439cef0bcache: Remove unnecessary NULL point check in node allocations | *bcb295778abcache: fixup btree_cache_wait list damage | *dc3287206ammc: sdhci: fix DMA configure compatibility issue when 64bit DMA mode is used. | *191628e2d9mmc: mmci: Set PROBE_PREFER_ASYNCHRONOUS | *02c8c2b5f6mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M | *6f9708e5c1mmc: core: disable TRIM on Kingston EMMC04G-M627 | *28e649dc99io_uring: wait interruptibly for request completions on exit | *8482ac2e5aNFSD: add encoding of op_recall flag for write delegation | *8d36cb6d1ai2c: qup: Add missing unwind goto in qup_i2c_probe() | *e41a8e4615ALSA: jack: Fix mutex call in snd_jack_report() | *e71714ad24i2c: xiic: Don't try to handle more interrupt events after error | *b6eefa7a27i2c: xiic: Defer xiic_wakeup() and __xiic_start_xfer() in xiic_process() | *023bd9dc41apparmor: fix missing error check for rhashtable_insert_fast | *d1c946552ash: dma: Fix DMA channel offset calculation | *37750131d2s390/qeth: Fix vipa deletion | *9f5548e421net: dsa: tag_sja1105: fix MAC DA patching from meta frames | *2758fb81bbpptp: Fix fib lookup calls. | *0b08ff091fnet/sched: act_pedit: Add size check for TCA_PEDIT_PARMS_EX | *2434a6715fxsk: Honor SO_BINDTODEVICE on bind | *b785ba0acctcp: annotate data races in __tcp_oow_rate_limited() | *73f512bedfnet: bridge: keep ports without IFF_UNICAST_FLT in BR_PROMISC mode | *9a9d468fdcpowerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y | *f970b05c9bocteontx2-af: Fix mapping for NIX block from CGX connection | *5ded9e8aa5f2fs: fix error path handling in truncate_dnode() | *358145cc37mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 | *32b9c8f789spi: bcm-qspi: return error if neither hif_mspi nor mspi is available | *1f3643f9cfnet: dsa: vsc73xx: fix MTU configuration | *c377451012Add MODULE_FIRMWARE() for FIRMWARE_TG357766. | *6d2243ab78sctp: fix potential deadlock on &net->sctp.addr_wq_lock | *620993d5eemedia: cec: i2c: ch7322: also select REGMAP | *f733a7bfe8rtc: st-lpc: Release some resources in st_rtc_probe() in case of error | *aa70e5dd72pwm: sysfs: Do not apply state to already disabled PWMs | *8a0413be8apwm: imx-tpm: force 'real_period' to be zero in suspend | *e4845cdea7phy: tegra: xusb: check return value of devm_kzalloc() | *442e1a98bdmfd: stmpe: Only disable the regulators if they are enabled | *724448d602KVM: s390: vsie: fix the length of APCB bitmap | *c5e2f6f2bbmfd: stmfx: Nullify stmfx->vdd in case of error | *30ead8b9bfmfd: stmfx: Fix error path in stmfx_chip_init | *4d24051473test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation | *5b31ac1d6dserial: 8250_omap: Use force_suspend and resume for system suspend | *8e00ae25a3Revert "usb: common: usb-conn-gpio: Set last role to unknown before initial detection" | *a81e1f22e1mfd: intel-lpss: Add missing check for platform_get_resource | *1dc07edc01usb: dwc3-meson-g12a: Fix an error handling path in dwc3_meson_g12a_probe() | *7ade555ac5usb: common: usb-conn-gpio: Set last role to unknown before initial detection | *0e9e127835usb: dwc3: qcom: Fix an error handling path in dwc3_qcom_probe() | *a617145208usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove() | *96898fb476KVM: s390: fix KVM_S390_GET_CMMA_BITS for GFNs in memslot holes | *4e8e838fcemedia: atomisp: gmin_platform: fix out_len in gmin_get_config_dsm_var() | *b754ea60e6media: venus: helpers: Fix ALIGN() of non power of two | *02b2266023mfd: rt5033: Drop rt5033-battery sub-device | *e52019c095coresight: Fix loss of connection info when a module is unloaded | *018eddcb6bkernfs: fix missing kernfs_idr_lock to remove an ID from the IDR | *a59f64a835serial: 8250: lock port for UART_IER access in omap8250_irq() | *8d65d0a2bfserial: 8250: lock port for stop_rx() in omap8250_irq() | *d66ddb61fausb: hide unused usbfs_notify_suspend/resume functions | *56901de563usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe() | *6538e5d9f7extcon: Fix kernel doc of property capability fields to avoid warnings | *dac7d7efcbextcon: Fix kernel doc of property fields to avoid warnings | *2788a3553fusb: gadget: u_serial: Add null pointer check in gserial_suspend | *74f8606ddfusb: dwc3: qcom: Fix potential memory leak | *bdce16c1e6clk: qcom: ipq6018: fix networking resets | *ee3f494cfcclk: qcom: reset: support resetting multiple bits | *35fd1a213fclk: qcom: reset: Allow specifying custom reset delay | *d87ef4e857media: usb: siano: Fix warning due to null work_func_t function pointer | *300388887cmedia: videodev2.h: Fix struct v4l2_input tuner index comment | *5f3f4aa673media: usb: Check az6007_read() return value | *32809afb60clk: qcom: gcc-ipq6018: Use floor ops for sdcc clocks | *bb81ca33acserial: 8250: omap: Fix freeing of resources on failed register | *ed68e8e22esh: j2: Use ioremap() to translate device tree address into kernel memory | *a7890637b3w1: fix loop in w1_fini() | *a27aeae714w1: w1_therm: fix locking behavior in convert_t | *cd5ec3ee52SUNRPC: Fix UAF in svc_tcp_listen_data_ready() | *e4a9b3333eblock: change all __u32 annotations to __be32 in affs_hardblocks.h | *54da6c4c14block: fix signed int overflow in Amiga partition support | *b6a107c520phy: tegra: xusb: Clear the driver reference in usb-phy dev | *fac7be49f1usb: dwc3: gadget: Propagate core init errors to UDC during pullup | *8b0a55b592USB: serial: option: add LARA-R6 01B PIDs | *810e401b34io_uring: ensure IOPOLL locks around deferred work | *cd5837564fhwrng: st - keep clock enabled while hwrng is registered | *557e528255dax: Introduce alloc_dev_dax_id() | *94a85474f5dax: Fix dax_mapping_release() use after free | *7c9f5a14d9NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION | *bab0bf5677ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard | *cb0cdca5c9modpost: fix off by one in is_executable_section() | *f0350516b9crypto: marvell/cesa - Fix type mismatch warning | *b540694455modpost: fix section mismatch message for R_ARM_{PC24,CALL,JUMP24} | *88978ef7fdmodpost: fix section mismatch message for R_ARM_ABS32 | *31195ee328crypto: nx - fix build warnings when DEBUG_FS is not enabled | *77471e4912hwrng: virtio - Fix race on data_avail and actual data | *e8f51401d6hwrng: virtio - always add a pending request | *ffc5ce9c27hwrng: virtio - don't waste entropy | *d13ea82bfehwrng: virtio - don't wait on cleanup | *5f23dae018hwrng: virtio - add an internal buffer | *aba192bb31powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary | *7afd0de0ccpowerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo | *7289ca7a51mm: rename p4d_page_vaddr to p4d_pgtable and make it return pud_t * | *bfad110188mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t * | *07c19c0ad4powerpc/powernv/sriov: perform null check on iov before dereferencing iov | *f3c7b95c99pinctrl: at91-pio4: check return value of devm_kasprintf() | *b7a38fc3f3perf dwarf-aux: Fix off-by-one in die_get_varname() | *75a3cb1e23perf script: Fix allocation of evsel->priv related to per-event dump files | *647c6d35ccperf script: Fixup 'struct evsel_script' method prefix | *958acb479ekcsan: Don't expect 64 bits atomic builtins from 32 bits architectures | *5533f0eb0apinctrl: cherryview: Return correct value if pin in push-pull mode | *4b63caf86eperf bench: Add missing setlocale() call to allow usage of %'d style formatting | *345ee85216perf bench: Use unbuffered output when pipe/tee'ing to a file | *f0d2310f6bPCI: Add pci_clear_master() stub for non-CONFIG_PCI | *b65fe59b2dPCI: ftpci100: Release the clock resources | *cb389e8edfPCI: pciehp: Cancel bringup sequence if card is not present | *b9895a4c95scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe() | *7badf4d6f4PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free | *d27238fc83pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors | *ac64019e4dscsi: qedf: Fix NULL dereference in error handling | *8e9907e921PCI: cadence: Fix Gen2 Link Retraining process | *07be8e60f2ASoC: imx-audmix: check return value of devm_kasprintf() | *714ba10a6dovl: update of dentry revalidate flags after copy up | *47f4d875aadrivers: meson: secure-pwrc: always enable DMA domain | *5f149d0538clk: ti: clkctrl: check return value of kasprintf() | *fd9324fa4dclk: keystone: sci-clk: check return value of kasprintf() | *0b754f9cfdclk: si5341: free unused memory on probe failure | *dc8d0178d5clk: si5341: check return value of {devm_}kasprintf() | *dc3eef6480clk: si5341: return error if one synth clock registration fails | *0401139800clk: si5341: Add sysfs properties to allow checking/resetting device faults | *fc813d0573clk: si5341: Allow different output VDD_SEL values | *f64fcd3acfclk: cdce925: check return value of kasprintf() | *866d4340c6clk: vc5: check memory returned by kasprintf() | *c67a55f7ccdrm/msm/dp: Free resources after unregistering them | *c3b63584d8drm/msm/dpu: do not enable color-management if DSPPs are not available | *f923a58221ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer | *404e9f741aclk: tegra: tegra124-emc: Fix potential memory leak | *cb047c13bbclk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe() | *294321349bclk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe | *e749bc5a90RDMA/bnxt_re: Avoid calling wake_up threads from spin_lock context | *9341501e2fRDMA/bnxt_re: wraparound mbox producer index | *968e27fd03amdgpu: validate offset_in_bo of drm_amdgpu_gem_va | *e070120e6ddrm/radeon: fix possible division-by-zero errors | *a77b80825bdrm/amdkfd: Fix potential deallocation of previously deallocated memory. | *245aa7c023ARM: dts: BCM5301X: fix duplex-full => full-duplex | *7e2edb84fehwmon: (pmbus/adm1275) Fix problems with temperature monitoring on ADM1272 | *580e9b987bhwmon: (adm1275) Allow setting sample averaging | *a3c5d148b7hwmon: (adm1275) enable adm1272 temperature reporting | *4610efa404hwmon: (gsc-hwmon) fix fan pwm temperature scaling | *6e12311dceARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx | *badeb7fe24ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2 | *17cd31487darm64: dts: ti: k3-j7200: Fix physical address of pin | *ce6e0434e5fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe() | *34e1e2f3cfarm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1 | *6817914c67ARM: dts: iwg20d-q7-common: Fix backlight pwm specifier | *220f86cc19RDMA/hns: Fix hns_roce_table_get return value | *9196f44239RDMA/hns: Clean the hardware related code for HEM | *aa495b927fRDMA/hns: Use refcount_t APIs for HEM | *de1049dd18RDMA/hns: Fix coding style issues | *cc1b04b699RDMA: Remove uverbs_ex_cmd_mask values that are linked to functions | *7dcb9ea3eeIB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate | *6cf8f3d690IB/hfi1: Fix sdma.h tx->num_descs off-by-one errors | *2d38866a99IB/hfi1: Use bitmap_zalloc() when applicable | *42b6865bf5soc/fsl/qe: fix usb.c build errors | *9c14d14066ARM: dts: meson8: correct uart_B and uart_C clock references | *684a2f180eASoC: es8316: Do not set rate constraints for unsupported MCLKs | *d883e16c7fASoC: es8316: Increment max value for ALC Capture Target Volume control | *105af71974memory: brcmstb_dpfe: fix testing array offset after use | *ddc74d6ea3ARM: dts: stm32: Shorten the AV96 HDMI sound card name | *392ee3cc99arm64: dts: qcom: apq8096: fix fixed regulator name property | *c85a076215ARM: omap2: fix missing tick_broadcast() prototype | *aec18da741ARM: ep93xx: fix missing-prototype warnings | *b574cd7e4ddrm/panel: simple: fix active size for Ampire AM-480272H3TMQW-T01H | *02d8b008ffarm64: dts: qcom: msm8996: correct camss unit address | *6d103b1cc1arm64: dts: qcom: msm8994: correct SPMI unit address | *160ac75a5aarm64: dts: qcom: msm8916: correct camss unit address | *e8b131d216ARM: dts: gta04: Move model property out of pinctrl node | *b0b180a712RDMA/bnxt_re: Fix to remove an unnecessary log | *446092f136RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid | *b54b26ac50RDMA/bnxt_re: Use unique names while registering interrupts | *11bd3882c3RDMA/bnxt_re: Fix to remove unnecessary return labels | *7080ef46adRDMA/bnxt_re: Disable/kill tasklet only if it is enabled | *2a9895df80arm64: dts: microchip: sparx5: do not use PSCI on reference boards | *726fdf47c1bus: ti-sysc: Fix dispc quirk masking bool variables | *8ee24ddf45ARM: dts: stm32: Move ethernet MAC EEPROM from SoM to carrier boards | *617a4da09ddrm/panel: sharp-ls043t1le01: adjust mode settings | *3c87c98225drm: sun4i_tcon: use devm_clk_get_enabled in `sun4i_tcon_init_clocks` | *39305592dcInput: adxl34x - do not hardcode interrupt trigger type | *e629efc6d6ARM: dts: meson8b: correct uart_B and uart_C clock references | *bd46ade714ARM: dts: BCM5301X: Drop "clock-names" from the SPI node | *20ecae1af5drm/vram-helper: fix function names in vram helper doc | *46a34e1459drm/bridge: tc358768: fix THS_TRAILCNT computation | *f2f7d0a4a2drm/bridge: tc358768: fix TXTAGOCNT computation | *8e47328fe0drm/bridge: tc358768: fix THS_ZEROCNT computation | *6b9450723bdrm/bridge: tc358768: fix TCLK_TRAILCNT computation | *33abcfbb17drm/bridge: tc358768: Add atomic_get_input_bus_fmts() implementation | *43b2d11ccfdrm/bridge: tc358768: fix TCLK_ZEROCNT computation | *46b7417189drm/bridge: tc358768: fix PLL target frequency | *825b00c685drm/bridge: tc358768: fix PLL parameters computation | *1b4f23fdf2drm/bridge: tc358768: always enable HS video mode | *4e0fd4f54bInput: drv260x - sleep between polling GO bit | *2780d58448drm/amd/display: Explicitly specify update type per plane info change | *b2213fc60bradeon: avoid double free in ci_dpm_init() | *472a615e66netlink: Add __sock_i_ino() for __netlink_diag_dump(). | *d10b380369ipvlan: Fix return value of ipvlan_queue_xmit() | *5215c00968netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value. | *9bdcda7abanetfilter: conntrack: dccp: copy entire header to stack buffer, not just basic one | *36e07e8acflib/ts_bm: reset initial match offset for every block of text | *96f2c6f272net: nfc: Fix use-after-free caused by nfc_llcp_find_local | *a3a1550c4dnfc: llcp: simplify llcp_sock_connect() error paths | *cb1aa7cc56sfc: fix crash when reading stats while NIC is resetting | *6ccfec84f0net: axienet: Move reset before 64-bit DMA detection | *bccc7ace12gtp: Fix use-after-free in __gtp_encap_destroy(). | *4d9cd4b330selftests: rtnetlink: remove netdevsim device after ipsec offload test | *44db85c6e1netlink: do not hard code device address lenth in fdb dumps | *cde7b90e05netlink: fix potential deadlock in netlink_set_err() | *0c9e48428fnet: stmmac: fix double serdes powerdown | *1ba91ffa1aigc: Fix race condition in PTP tx code | *660d4e73efwifi: ath9k: convert msecs to jiffies where needed | *150ca0768bwifi: cfg80211: rewrite merging of inherited elements | *4e321c18efwifi: iwlwifi: pull from TXQs with softirqs disabled | *2715617c2artnetlink: extend RTEXT_FILTER_SKIP_STATS to IFLA_VF_INFO | *581401cd3cwifi: ath9k: Fix possible stall on ath9k_txq_list_has_key() | *6b22c2c649memstick r592: make memstick_debug_get_tpc_name() static | *6cb477e722kexec: fix a memory leak in crash_shrink_memory() | *fdb07728d8watchdog/perf: more properly prevent false positives with turbo modes | *ac23d7f414watchdog/perf: define dummy watchdog_update_hrtimer_threshold() on correct config | *22da8363e3wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown | *b2aeb97fd4wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled | *1044187e72wifi: ath9k: don't allow to overwrite ENDPOINT0 attributes | *c10c6ea9b3wifi: ray_cs: Fix an error handling path in ray_probe() | *8825991838wifi: ray_cs: Drop useless status variable in parse_addr() | *a66e3fd380wifi: ray_cs: Utilize strnlen() in parse_addr() | *18d71562f7wifi: wl3501_cs: Fix an error handling path in wl3501_probe() | *b6f793de61wl3501_cs: use eth_hw_addr_set() | *cbd44a9e1cnet: create netdev->dev_addr assignment helpers | *13cf0e3894wl3501_cs: Fix misspelling and provide missing documentation | *5512db9bd4wifi: atmel: Fix an error handling path in atmel_probe() | *86ebbcbdc7wifi: orinoco: Fix an error handling path in orinoco_cs_probe() | *fb7d78feb5wifi: orinoco: Fix an error handling path in spectrum_cs_probe() | *8782dc2504regulator: core: Streamline debugfs operations | *92bcd84941regulator: core: Fix more error checking for debugfs_create_dir() | *78f390aa0ebpftool: JIT limited misreported as negative value on aarch64 | *107e849f3cnfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect() | *0be9de2ea0nfc: constify several pointers to u8, char and sk_buff | *ef7fe1b5c4libbpf: fix offsetof() and container_of() to work with CO-RE | *b190ced50asctp: add bpf_bypass_getsockopt proto callback | *08f61a3491bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE | *c62e2ac02ewifi: mwifiex: Fix the size of a memory allocation in mwifiex_ret_802_11_scan() | *3ae910a375wifi: wilc1000: fix for absent RSN capabilities WFA testcase | *795ef55030spi: spi-geni-qcom: Correct CS_TOGGLE bit in SPI_TRANS_CFG | *bd3e880dcesamples/bpf: Fix buffer overflow in tcp_basertt | *250efb4d3fwifi: ath9k: avoid referencing uninit memory in ath9k_wmi_ctrl_rx | *0f3f41b475wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation | *cbd0f41a53igc: Enable and fix RX hash usage by netstack | *a14cb30726pstore/ram: Add check for kstrdup | *628709a057ima: Fix build warnings | *16ec59c03aevm: Complete description of evm_inode_setattr() | *cba85e1cb7x86/mm: Fix __swp_entry_to_pte() for Xen PV guests | *365f546de5perf/ibs: Fix interface via core pmu events | *604d6a5ff7rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale | *d414e24d15rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup() | *ecc5e6dbc2rcuscale: Move shutdown from wait_event() to wait_event_idle() | *b62c816bdbrcuscale: Always log error message | *8cd9917c13rcuscale: Console output claims too few grace periods | *456f783b83thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe() | *bacc49b2d5cpufreq: intel_pstate: Fix energy_performance_preference for passive | *a8bfe52755ARM: 9303/1: kprobes: avoid missing-declaration warnings | *a50b75c13dpowercap: RAPL: Fix CONFIG_IOSF_MBI dependency | *23f6efd226perf/arm-cmn: Fix DTC reset | *b69868d50dPM: domains: fix integer overflow issues in genpd_parse_state() | *ebdff09865clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe | *a2f83a4c7ctracing/timer: Add missing hrtimer modes to decode_hrtimer_mode(). | *f1be1ed32dposix-timers: Prevent RT livelock in itimer_delete() | *b315d57da4irqchip/jcore-aic: Fix missing allocation of IRQ descriptors | *495cee0e14irqchip/jcore-aic: Kill use of irq_create_strict_mappings() | *9d1cccdad0md/raid10: fix io loss while replacement replace rdev | *2990e2ece1md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request | *b1d8f38310md/raid10: fix wrong setting of max_corr_read_errors | *b3a0bc4a01md/raid10: fix overflow of md/safe_mode_delay | *39fa14e824md/raid10: check slab-out-of-bounds in md_bitmap_get_counter | *8563b58a43blk-iocost: use spin_lock_irqsave in adjust_inuse_and_calc_cost | *3db97cc79bx86/resctrl: Only show tasks' pid in current pid namespace | *1a82005f3ffs: pipe: reveal missing function protoypes | *f70407e8e0nubus: Partially revert proc_create_single_data() conversion | *0336c8f072drm/amdgpu: Validate VM ioctl flags. | *c484b65f93scripts/tags.sh: Resolve gtags empty index generation | *649104c834Revert "thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe" | *02a4c4e225HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651. | *9598a647ecHID: wacom: Use ktime_t rather than int when dealing with timestamps | *2bf70b88ccfbdev: imsttfb: Fix use after free bug in imsttfb_probe | *5b813734a0video: imsttfb: check for ioremap() failures | *02fbf62df9can: isotp: isotp_sendmsg(): fix return error fix on TX path | *8667f71131x86/smp: Use dedicated cache-line for mwait_play_dead() | *1d0fe3fb5dmedia: atomisp: fix "variable dereferenced before check 'asd'" * |9710ae86efMerge branch 'android12-5.10' into branch 'android12-5.10-lts' * |db023c4bb0Merge 5.10.187 into android12-5.10-lts |\| | *140d69b4e4Linux 5.10.187 | *93df00f9d4x86/cpu/amd: Add a Zenbleed fix | *191b8f9b0ex86/cpu/amd: Move the errata checking functionality up | *113ce5ed59x86/microcode/AMD: Load late on both threads too * |44da38b39cANDROID: GKI: fix up sysctl_vals ABI change. * |c9606079a5Revert "gpio: Allow per-parent interrupt data" * |fc3985cbeeRevert "gpiolib: Fix GPIO chip IRQ initialization restriction" * |02a1b32243Merge 5.10.186 into android12-5.10-lts |/ *381518b4a9Linux 5.10.186 *29917a20bebpf/btf: Accept function names that contain dots *8b7454dd98netfilter: nf_tables: hold mutex on netns pre_exit path *9e8d927cfanetfilter: nf_tables: validate registers coming from userspace. *f19a4818a9netfilter: nftables: statify nft_parse_register() *42997367cbi2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycle *5a257f3553x86/apic: Fix kernel panic when booting with intremap=off and x2apic_phys *d8efc77f23drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl *485fe16508drm/exynos: fix race condition UAF in exynos_g2d_exec_ioctl *0b0fdc43b2drm/exynos: vidi: fix a wrong error return *32134e7a0fARM: dts: Fix erroneous ADS touchscreen polarities *79cf5657bes390/purgatory: disable branch profiling *a819de62ecASoC: nau8824: Add quirk to active-high jack-detect *fa08753c2dASoC: simple-card: Add missing of_node_put() in case of error *9138ed7e2bspi: lpspi: disable lpspi module irq in DMA mode *97b6c4c1d1s390/cio: unregister device when the only path is gone *fe949c1662Input: soc_button_array - add invalid acpi_index DMI quirk handling *eaf1fa9452usb: gadget: udc: fix NULL dereference in remove() *7d1a0733a5nfcsim.c: Fix error checking for debugfs_create_dir *dc357c0787media: cec: core: don't set last_initiator if tx in progress *c13573032barm64: Add missing Set/Way CMO encodings *49a2b18f49HID: wacom: Add error check to wacom_parse_and_register() *2b43198de0scsi: target: iscsi: Prevent login threads from racing between each other *75aa3f255cgpiolib: Fix GPIO chip IRQ initialization restriction *304802e5b0gpio: Allow per-parent interrupt data *bc75968b49sch_netem: acquire qdisc lock in netem_change() *caddeadd0dRevert "net: phy: dp83867: perform soft reset and retain established link" *5702afa2c3netfilter: nfnetlink_osf: fix module autoload *3d5c09c782netfilter: nf_tables: disallow element updates of bound anonymous sets *2a90da8e0dnetfilter: nft_set_pipapo: .walk does not deal with generations *792bfe26a6be2net: Extend xmit workaround to BE3 chip *cebb5cee09net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch *7a1ae00005ipvs: align inner_mac_header for encapsulation *f2547bc716mmc: usdhi60rol0: fix deferred probing *4a99e35c5ammc: sh_mmcif: fix deferred probing *c2278de138mmc: sdhci-acpi: fix deferred probing *f6e176ef89mmc: owl: fix deferred probing *f29d0ab0e6mmc: omap_hsmmc: fix deferred probing *65d9318e3dmmc: omap: fix deferred probing *9ad3c21fb6mmc: mvsdio: fix deferred probing *9b0417fd40mmc: mtk-sd: fix deferred probing *ced13bc50enet: qca_spi: Avoid high load if QCA7000 is not available *b1b9c81e29xfrm: Linearize the skb after offloading if needed. *31cd0d4a44selftests: net: fcnal-test: check if FIPS mode is enabled *2af75a36afselftests: net: vrf-xfrm-tests: change authentication and encryption algos *07fbbddae5xfrm: fix inbound ipv4/udp/esp packets to UDPv6 dualstack sockets *562800447fbpf: Fix verifier id tracking of scalars on spill *3b0a96db67bpf: track immediate values written to stack by BPF_ST instruction *bff7824db6xfrm: Ensure policies always checked on XFRM-I input path *01af67ed83xfrm: interface: rename xfrm_interface.c to xfrm_interface_core.c *cdaa6e1105xfrm: Treat already-verified secpath entries as optional *47be2931c4ieee802154: hwsim: Fix possible memory leaks *051d642133memfd: check for non-NULL file_seals in memfd_create() syscall *1ac6e9ee84sysctl: move some boundary constants from sysctl.c to sysctl_vals *e1aa3fe3e2mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30% *ad10dd2113x86/mm: Avoid using set_pgd() outside of real PGD pages *4de2093674nilfs2: prevent general protection fault in nilfs_clear_dirty_page() *3845c38417io_uring/net: disable partial retries for recvmsg with cmsg *826ee9fa36io_uring/net: clear msg_controllen on partial sendmsg retry *5fdea4468fio_uring/net: save msghdr->msg_control for retries *5a7101d8fawriteback: fix dereferencing NULL mapping->host on writeback_page_template *f00cd687c2regmap: spi-avmm: Fix regmap_bus max_raw_write *bc35f93e4bregulator: pca9450: Fix LDO3OUT and LDO4OUT MASK *5938470f9cip_tunnels: allow VXLAN/GENEVE to inherit TOS/TTL from VLAN *2e454015cammc: mmci: stm32: fix max busy timeout calculation *1be288fd3bmmc: meson-gx: remove redundant mmc_request_done() call from irq context *1b97630cd9mmc: sdhci-msm: Disable broken 64-bit DMA on MSM8916 *63608437a8cgroup: Do not corrupt task iteration when rebinding subsystem *988d06f5ebPCI: hv: Fix a race condition in hv_irq_unmask() that can cause panic *8f2d5ebdfePCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev *8b74846769Revert "PCI: hv: Fix a timing issue which causes kdump to fail occasionally" *79ceb758e3PCI: hv: Fix a race condition bug in hv_pci_query_relations() *8b8c9812c0Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs *b435298349nilfs2: fix buffer corruption due to concurrent device reads *524a2c0bcfselftests: mptcp: join: skip check if MIB counter not supported *e508d9cef8selftests: mptcp: pm nl: remove hardcoded default limits *4c4ca42418selftests: mptcp: lib: skip if not below kernel version *6d20cfbc57selftests: mptcp: lib: skip if missing symbol *3cc7935d32tick/common: Align tick period during sched_timer setup *db4ab0c97atracing: Add tracing_reset_all_online_cpus_unlocked() function *9ced730490net/sched: Refactor qdisc_graft() for ingress and clsact Qdiscs *b1b42fff8adrm/amd/display: fix the system hang while disable PSR Change-Id: I0c8675eb9b259cf7631e968dd66c31d3e16d31e9 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by: Todd Kjos <tkjos@google.com>
616 lines
15 KiB
C
616 lines
15 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2012 Google, Inc.
|
|
*/
|
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/err.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/init.h>
|
|
#include <linux/io.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/list.h>
|
|
#include <linux/memblock.h>
|
|
#include <linux/pstore_ram.h>
|
|
#include <linux/rslib.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/uaccess.h>
|
|
#include <linux/vmalloc.h>
|
|
#include <asm/page.h>
|
|
|
|
/**
|
|
* struct persistent_ram_buffer - persistent circular RAM buffer
|
|
*
|
|
* @sig:
|
|
* signature to indicate header (PERSISTENT_RAM_SIG xor PRZ-type value)
|
|
* @start:
|
|
* offset into @data where the beginning of the stored bytes begin
|
|
* @size:
|
|
* number of valid bytes stored in @data
|
|
*/
|
|
struct persistent_ram_buffer {
|
|
uint32_t sig;
|
|
atomic_t start;
|
|
atomic_t size;
|
|
uint8_t data[];
|
|
};
|
|
|
|
#define PERSISTENT_RAM_SIG (0x43474244) /* DBGC */
|
|
|
|
static inline size_t buffer_size(struct persistent_ram_zone *prz)
|
|
{
|
|
return atomic_read(&prz->buffer->size);
|
|
}
|
|
|
|
static inline size_t buffer_start(struct persistent_ram_zone *prz)
|
|
{
|
|
return atomic_read(&prz->buffer->start);
|
|
}
|
|
|
|
/* increase and wrap the start pointer, returning the old value */
|
|
static size_t buffer_start_add(struct persistent_ram_zone *prz, size_t a)
|
|
{
|
|
int old;
|
|
int new;
|
|
unsigned long flags = 0;
|
|
|
|
if (!(prz->flags & PRZ_FLAG_NO_LOCK))
|
|
raw_spin_lock_irqsave(&prz->buffer_lock, flags);
|
|
|
|
old = atomic_read(&prz->buffer->start);
|
|
new = old + a;
|
|
while (unlikely(new >= prz->buffer_size))
|
|
new -= prz->buffer_size;
|
|
atomic_set(&prz->buffer->start, new);
|
|
|
|
if (!(prz->flags & PRZ_FLAG_NO_LOCK))
|
|
raw_spin_unlock_irqrestore(&prz->buffer_lock, flags);
|
|
|
|
return old;
|
|
}
|
|
|
|
/* increase the size counter until it hits the max size */
|
|
static void buffer_size_add(struct persistent_ram_zone *prz, size_t a)
|
|
{
|
|
size_t old;
|
|
size_t new;
|
|
unsigned long flags = 0;
|
|
|
|
if (!(prz->flags & PRZ_FLAG_NO_LOCK))
|
|
raw_spin_lock_irqsave(&prz->buffer_lock, flags);
|
|
|
|
old = atomic_read(&prz->buffer->size);
|
|
if (old == prz->buffer_size)
|
|
goto exit;
|
|
|
|
new = old + a;
|
|
if (new > prz->buffer_size)
|
|
new = prz->buffer_size;
|
|
atomic_set(&prz->buffer->size, new);
|
|
|
|
exit:
|
|
if (!(prz->flags & PRZ_FLAG_NO_LOCK))
|
|
raw_spin_unlock_irqrestore(&prz->buffer_lock, flags);
|
|
}
|
|
|
|
static void notrace persistent_ram_encode_rs8(struct persistent_ram_zone *prz,
|
|
uint8_t *data, size_t len, uint8_t *ecc)
|
|
{
|
|
int i;
|
|
|
|
/* Initialize the parity buffer */
|
|
memset(prz->ecc_info.par, 0,
|
|
prz->ecc_info.ecc_size * sizeof(prz->ecc_info.par[0]));
|
|
encode_rs8(prz->rs_decoder, data, len, prz->ecc_info.par, 0);
|
|
for (i = 0; i < prz->ecc_info.ecc_size; i++)
|
|
ecc[i] = prz->ecc_info.par[i];
|
|
}
|
|
|
|
static int persistent_ram_decode_rs8(struct persistent_ram_zone *prz,
|
|
void *data, size_t len, uint8_t *ecc)
|
|
{
|
|
int i;
|
|
|
|
for (i = 0; i < prz->ecc_info.ecc_size; i++)
|
|
prz->ecc_info.par[i] = ecc[i];
|
|
return decode_rs8(prz->rs_decoder, data, prz->ecc_info.par, len,
|
|
NULL, 0, NULL, 0, NULL);
|
|
}
|
|
|
|
static void notrace persistent_ram_update_ecc(struct persistent_ram_zone *prz,
|
|
unsigned int start, unsigned int count)
|
|
{
|
|
struct persistent_ram_buffer *buffer = prz->buffer;
|
|
uint8_t *buffer_end = buffer->data + prz->buffer_size;
|
|
uint8_t *block;
|
|
uint8_t *par;
|
|
int ecc_block_size = prz->ecc_info.block_size;
|
|
int ecc_size = prz->ecc_info.ecc_size;
|
|
int size = ecc_block_size;
|
|
|
|
if (!ecc_size)
|
|
return;
|
|
|
|
block = buffer->data + (start & ~(ecc_block_size - 1));
|
|
par = prz->par_buffer + (start / ecc_block_size) * ecc_size;
|
|
|
|
do {
|
|
if (block + ecc_block_size > buffer_end)
|
|
size = buffer_end - block;
|
|
persistent_ram_encode_rs8(prz, block, size, par);
|
|
block += ecc_block_size;
|
|
par += ecc_size;
|
|
} while (block < buffer->data + start + count);
|
|
}
|
|
|
|
static void persistent_ram_update_header_ecc(struct persistent_ram_zone *prz)
|
|
{
|
|
struct persistent_ram_buffer *buffer = prz->buffer;
|
|
|
|
if (!prz->ecc_info.ecc_size)
|
|
return;
|
|
|
|
persistent_ram_encode_rs8(prz, (uint8_t *)buffer, sizeof(*buffer),
|
|
prz->par_header);
|
|
}
|
|
|
|
static void persistent_ram_ecc_old(struct persistent_ram_zone *prz)
|
|
{
|
|
struct persistent_ram_buffer *buffer = prz->buffer;
|
|
uint8_t *block;
|
|
uint8_t *par;
|
|
|
|
if (!prz->ecc_info.ecc_size)
|
|
return;
|
|
|
|
block = buffer->data;
|
|
par = prz->par_buffer;
|
|
while (block < buffer->data + buffer_size(prz)) {
|
|
int numerr;
|
|
int size = prz->ecc_info.block_size;
|
|
if (block + size > buffer->data + prz->buffer_size)
|
|
size = buffer->data + prz->buffer_size - block;
|
|
numerr = persistent_ram_decode_rs8(prz, block, size, par);
|
|
if (numerr > 0) {
|
|
pr_devel("error in block %p, %d\n", block, numerr);
|
|
prz->corrected_bytes += numerr;
|
|
} else if (numerr < 0) {
|
|
pr_devel("uncorrectable error in block %p\n", block);
|
|
prz->bad_blocks++;
|
|
}
|
|
block += prz->ecc_info.block_size;
|
|
par += prz->ecc_info.ecc_size;
|
|
}
|
|
}
|
|
|
|
static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
|
|
struct persistent_ram_ecc_info *ecc_info)
|
|
{
|
|
int numerr;
|
|
struct persistent_ram_buffer *buffer = prz->buffer;
|
|
int ecc_blocks;
|
|
size_t ecc_total;
|
|
|
|
if (!ecc_info || !ecc_info->ecc_size)
|
|
return 0;
|
|
|
|
prz->ecc_info.block_size = ecc_info->block_size ?: 128;
|
|
prz->ecc_info.ecc_size = ecc_info->ecc_size ?: 16;
|
|
prz->ecc_info.symsize = ecc_info->symsize ?: 8;
|
|
prz->ecc_info.poly = ecc_info->poly ?: 0x11d;
|
|
|
|
ecc_blocks = DIV_ROUND_UP(prz->buffer_size - prz->ecc_info.ecc_size,
|
|
prz->ecc_info.block_size +
|
|
prz->ecc_info.ecc_size);
|
|
ecc_total = (ecc_blocks + 1) * prz->ecc_info.ecc_size;
|
|
if (ecc_total >= prz->buffer_size) {
|
|
pr_err("%s: invalid ecc_size %u (total %zu, buffer size %zu)\n",
|
|
__func__, prz->ecc_info.ecc_size,
|
|
ecc_total, prz->buffer_size);
|
|
return -EINVAL;
|
|
}
|
|
|
|
prz->buffer_size -= ecc_total;
|
|
prz->par_buffer = buffer->data + prz->buffer_size;
|
|
prz->par_header = prz->par_buffer +
|
|
ecc_blocks * prz->ecc_info.ecc_size;
|
|
|
|
/*
|
|
* first consecutive root is 0
|
|
* primitive element to generate roots = 1
|
|
*/
|
|
prz->rs_decoder = init_rs(prz->ecc_info.symsize, prz->ecc_info.poly,
|
|
0, 1, prz->ecc_info.ecc_size);
|
|
if (prz->rs_decoder == NULL) {
|
|
pr_info("init_rs failed\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
/* allocate workspace instead of using stack VLA */
|
|
prz->ecc_info.par = kmalloc_array(prz->ecc_info.ecc_size,
|
|
sizeof(*prz->ecc_info.par),
|
|
GFP_KERNEL);
|
|
if (!prz->ecc_info.par) {
|
|
pr_err("cannot allocate ECC parity workspace\n");
|
|
return -ENOMEM;
|
|
}
|
|
|
|
prz->corrected_bytes = 0;
|
|
prz->bad_blocks = 0;
|
|
|
|
numerr = persistent_ram_decode_rs8(prz, buffer, sizeof(*buffer),
|
|
prz->par_header);
|
|
if (numerr > 0) {
|
|
pr_info("error in header, %d\n", numerr);
|
|
prz->corrected_bytes += numerr;
|
|
} else if (numerr < 0) {
|
|
pr_info("uncorrectable error in header\n");
|
|
prz->bad_blocks++;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
ssize_t persistent_ram_ecc_string(struct persistent_ram_zone *prz,
|
|
char *str, size_t len)
|
|
{
|
|
ssize_t ret;
|
|
|
|
if (!prz->ecc_info.ecc_size)
|
|
return 0;
|
|
|
|
if (prz->corrected_bytes || prz->bad_blocks)
|
|
ret = snprintf(str, len, ""
|
|
"\n%d Corrected bytes, %d unrecoverable blocks\n",
|
|
prz->corrected_bytes, prz->bad_blocks);
|
|
else
|
|
ret = snprintf(str, len, "\nNo errors detected\n");
|
|
|
|
return ret;
|
|
}
|
|
|
|
static void notrace persistent_ram_update(struct persistent_ram_zone *prz,
|
|
const void *s, unsigned int start, unsigned int count)
|
|
{
|
|
struct persistent_ram_buffer *buffer = prz->buffer;
|
|
memcpy_toio(buffer->data + start, s, count);
|
|
persistent_ram_update_ecc(prz, start, count);
|
|
}
|
|
|
|
static int notrace persistent_ram_update_user(struct persistent_ram_zone *prz,
|
|
const void __user *s, unsigned int start, unsigned int count)
|
|
{
|
|
struct persistent_ram_buffer *buffer = prz->buffer;
|
|
int ret = unlikely(copy_from_user(buffer->data + start, s, count)) ?
|
|
-EFAULT : 0;
|
|
persistent_ram_update_ecc(prz, start, count);
|
|
return ret;
|
|
}
|
|
|
|
void persistent_ram_save_old(struct persistent_ram_zone *prz)
|
|
{
|
|
struct persistent_ram_buffer *buffer = prz->buffer;
|
|
size_t size = buffer_size(prz);
|
|
size_t start = buffer_start(prz);
|
|
|
|
if (!size)
|
|
return;
|
|
|
|
if (!prz->old_log) {
|
|
persistent_ram_ecc_old(prz);
|
|
prz->old_log = kmalloc(size, GFP_KERNEL);
|
|
}
|
|
if (!prz->old_log) {
|
|
pr_err("failed to allocate buffer\n");
|
|
return;
|
|
}
|
|
|
|
prz->old_log_size = size;
|
|
memcpy_fromio(prz->old_log, &buffer->data[start], size - start);
|
|
memcpy_fromio(prz->old_log + size - start, &buffer->data[0], start);
|
|
}
|
|
|
|
int notrace persistent_ram_write(struct persistent_ram_zone *prz,
|
|
const void *s, unsigned int count)
|
|
{
|
|
int rem;
|
|
int c = count;
|
|
size_t start;
|
|
|
|
if (unlikely(c > prz->buffer_size)) {
|
|
s += c - prz->buffer_size;
|
|
c = prz->buffer_size;
|
|
}
|
|
|
|
buffer_size_add(prz, c);
|
|
|
|
start = buffer_start_add(prz, c);
|
|
|
|
rem = prz->buffer_size - start;
|
|
if (unlikely(rem < c)) {
|
|
persistent_ram_update(prz, s, start, rem);
|
|
s += rem;
|
|
c -= rem;
|
|
start = 0;
|
|
}
|
|
persistent_ram_update(prz, s, start, c);
|
|
|
|
persistent_ram_update_header_ecc(prz);
|
|
|
|
return count;
|
|
}
|
|
|
|
int notrace persistent_ram_write_user(struct persistent_ram_zone *prz,
|
|
const void __user *s, unsigned int count)
|
|
{
|
|
int rem, ret = 0, c = count;
|
|
size_t start;
|
|
|
|
if (unlikely(c > prz->buffer_size)) {
|
|
s += c - prz->buffer_size;
|
|
c = prz->buffer_size;
|
|
}
|
|
|
|
buffer_size_add(prz, c);
|
|
|
|
start = buffer_start_add(prz, c);
|
|
|
|
rem = prz->buffer_size - start;
|
|
if (unlikely(rem < c)) {
|
|
ret = persistent_ram_update_user(prz, s, start, rem);
|
|
s += rem;
|
|
c -= rem;
|
|
start = 0;
|
|
}
|
|
if (likely(!ret))
|
|
ret = persistent_ram_update_user(prz, s, start, c);
|
|
|
|
persistent_ram_update_header_ecc(prz);
|
|
|
|
return unlikely(ret) ? ret : count;
|
|
}
|
|
|
|
size_t persistent_ram_old_size(struct persistent_ram_zone *prz)
|
|
{
|
|
return prz->old_log_size;
|
|
}
|
|
|
|
void *persistent_ram_old(struct persistent_ram_zone *prz)
|
|
{
|
|
return prz->old_log;
|
|
}
|
|
|
|
void persistent_ram_free_old(struct persistent_ram_zone *prz)
|
|
{
|
|
kfree(prz->old_log);
|
|
prz->old_log = NULL;
|
|
prz->old_log_size = 0;
|
|
}
|
|
|
|
void persistent_ram_zap(struct persistent_ram_zone *prz)
|
|
{
|
|
atomic_set(&prz->buffer->start, 0);
|
|
atomic_set(&prz->buffer->size, 0);
|
|
persistent_ram_update_header_ecc(prz);
|
|
}
|
|
|
|
#define MEM_TYPE_WCOMBINE 0
|
|
#define MEM_TYPE_NONCACHED 1
|
|
#define MEM_TYPE_NORMAL 2
|
|
|
|
static void *persistent_ram_vmap(phys_addr_t start, size_t size,
|
|
unsigned int memtype)
|
|
{
|
|
struct page **pages;
|
|
phys_addr_t page_start;
|
|
unsigned int page_count;
|
|
pgprot_t prot;
|
|
unsigned int i;
|
|
void *vaddr;
|
|
|
|
page_start = start - offset_in_page(start);
|
|
page_count = DIV_ROUND_UP(size + offset_in_page(start), PAGE_SIZE);
|
|
|
|
switch (memtype) {
|
|
case MEM_TYPE_NORMAL:
|
|
prot = PAGE_KERNEL;
|
|
break;
|
|
case MEM_TYPE_NONCACHED:
|
|
prot = pgprot_noncached(PAGE_KERNEL);
|
|
break;
|
|
case MEM_TYPE_WCOMBINE:
|
|
prot = pgprot_writecombine(PAGE_KERNEL);
|
|
break;
|
|
default:
|
|
pr_err("invalid mem_type=%d\n", memtype);
|
|
return NULL;
|
|
}
|
|
|
|
pages = kmalloc_array(page_count, sizeof(struct page *), GFP_KERNEL);
|
|
if (!pages) {
|
|
pr_err("%s: Failed to allocate array for %u pages\n",
|
|
__func__, page_count);
|
|
return NULL;
|
|
}
|
|
|
|
for (i = 0; i < page_count; i++) {
|
|
phys_addr_t addr = page_start + i * PAGE_SIZE;
|
|
pages[i] = pfn_to_page(addr >> PAGE_SHIFT);
|
|
}
|
|
/*
|
|
* VM_IOREMAP used here to bypass this region during vread()
|
|
* and kmap_atomic() (i.e. kcore) to avoid __va() failures.
|
|
*/
|
|
vaddr = vmap(pages, page_count, VM_MAP | VM_IOREMAP, prot);
|
|
kfree(pages);
|
|
|
|
/*
|
|
* Since vmap() uses page granularity, we must add the offset
|
|
* into the page here, to get the byte granularity address
|
|
* into the mapping to represent the actual "start" location.
|
|
*/
|
|
return vaddr + offset_in_page(start);
|
|
}
|
|
|
|
static void *persistent_ram_iomap(phys_addr_t start, size_t size,
|
|
unsigned int memtype, char *label)
|
|
{
|
|
void *va;
|
|
|
|
if (!request_mem_region(start, size, label ?: "ramoops")) {
|
|
pr_err("request mem region (%s 0x%llx@0x%llx) failed\n",
|
|
label ?: "ramoops",
|
|
(unsigned long long)size, (unsigned long long)start);
|
|
return NULL;
|
|
}
|
|
|
|
if (memtype)
|
|
va = ioremap(start, size);
|
|
else
|
|
va = ioremap_wc(start, size);
|
|
|
|
/*
|
|
* Since request_mem_region() and ioremap() are byte-granularity
|
|
* there is no need handle anything special like we do when the
|
|
* vmap() case in persistent_ram_vmap() above.
|
|
*/
|
|
return va;
|
|
}
|
|
|
|
static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size,
|
|
struct persistent_ram_zone *prz, int memtype)
|
|
{
|
|
prz->paddr = start;
|
|
prz->size = size;
|
|
|
|
if (pfn_valid(start >> PAGE_SHIFT))
|
|
prz->vaddr = persistent_ram_vmap(start, size, memtype);
|
|
else
|
|
prz->vaddr = persistent_ram_iomap(start, size, memtype,
|
|
prz->label);
|
|
|
|
if (!prz->vaddr) {
|
|
pr_err("%s: Failed to map 0x%llx pages at 0x%llx\n", __func__,
|
|
(unsigned long long)size, (unsigned long long)start);
|
|
return -ENOMEM;
|
|
}
|
|
|
|
prz->buffer = prz->vaddr;
|
|
prz->buffer_size = size - sizeof(struct persistent_ram_buffer);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
|
|
struct persistent_ram_ecc_info *ecc_info)
|
|
{
|
|
int ret;
|
|
bool zap = !!(prz->flags & PRZ_FLAG_ZAP_OLD);
|
|
|
|
ret = persistent_ram_init_ecc(prz, ecc_info);
|
|
if (ret) {
|
|
pr_warn("ECC failed %s\n", prz->label);
|
|
return ret;
|
|
}
|
|
|
|
sig ^= PERSISTENT_RAM_SIG;
|
|
|
|
if (prz->buffer->sig == sig) {
|
|
if (buffer_size(prz) == 0 && buffer_start(prz) == 0) {
|
|
pr_debug("found existing empty buffer\n");
|
|
return 0;
|
|
}
|
|
|
|
if (buffer_size(prz) > prz->buffer_size ||
|
|
buffer_start(prz) > buffer_size(prz)) {
|
|
pr_info("found existing invalid buffer, size %zu, start %zu\n",
|
|
buffer_size(prz), buffer_start(prz));
|
|
zap = true;
|
|
} else {
|
|
pr_debug("found existing buffer, size %zu, start %zu\n",
|
|
buffer_size(prz), buffer_start(prz));
|
|
persistent_ram_save_old(prz);
|
|
}
|
|
} else {
|
|
pr_debug("no valid data in buffer (sig = 0x%08x)\n",
|
|
prz->buffer->sig);
|
|
prz->buffer->sig = sig;
|
|
zap = true;
|
|
}
|
|
|
|
/* Reset missing, invalid, or single-use memory area. */
|
|
if (zap)
|
|
persistent_ram_zap(prz);
|
|
|
|
return 0;
|
|
}
|
|
|
|
void persistent_ram_free(struct persistent_ram_zone *prz)
|
|
{
|
|
if (!prz)
|
|
return;
|
|
|
|
if (prz->vaddr) {
|
|
if (pfn_valid(prz->paddr >> PAGE_SHIFT)) {
|
|
/* We must vunmap() at page-granularity. */
|
|
vunmap(prz->vaddr - offset_in_page(prz->paddr));
|
|
} else {
|
|
iounmap(prz->vaddr);
|
|
release_mem_region(prz->paddr, prz->size);
|
|
}
|
|
prz->vaddr = NULL;
|
|
}
|
|
if (prz->rs_decoder) {
|
|
free_rs(prz->rs_decoder);
|
|
prz->rs_decoder = NULL;
|
|
}
|
|
kfree(prz->ecc_info.par);
|
|
prz->ecc_info.par = NULL;
|
|
|
|
persistent_ram_free_old(prz);
|
|
kfree(prz->label);
|
|
kfree(prz);
|
|
}
|
|
|
|
struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
|
|
u32 sig, struct persistent_ram_ecc_info *ecc_info,
|
|
unsigned int memtype, u32 flags, char *label)
|
|
{
|
|
struct persistent_ram_zone *prz;
|
|
int ret = -ENOMEM;
|
|
|
|
prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL);
|
|
if (!prz) {
|
|
pr_err("failed to allocate persistent ram zone\n");
|
|
goto err;
|
|
}
|
|
|
|
/* Initialize general buffer state. */
|
|
raw_spin_lock_init(&prz->buffer_lock);
|
|
prz->flags = flags;
|
|
prz->label = kstrdup(label, GFP_KERNEL);
|
|
if (!prz->label)
|
|
goto err;
|
|
|
|
ret = persistent_ram_buffer_map(start, size, prz, memtype);
|
|
if (ret)
|
|
goto err;
|
|
|
|
ret = persistent_ram_post_init(prz, sig, ecc_info);
|
|
if (ret)
|
|
goto err;
|
|
|
|
pr_debug("attached %s 0x%zx@0x%llx: %zu header, %zu data, %zu ecc (%d/%d)\n",
|
|
prz->label, prz->size, (unsigned long long)prz->paddr,
|
|
sizeof(*prz->buffer), prz->buffer_size,
|
|
prz->size - sizeof(*prz->buffer) - prz->buffer_size,
|
|
prz->ecc_info.ecc_size, prz->ecc_info.block_size);
|
|
|
|
return prz;
|
|
err:
|
|
persistent_ram_free(prz);
|
|
return ERR_PTR(ret);
|
|
}
|