Merge 6.12.5 into android16-6.12
GKI (arm64) relevant 129 out of 468 changes, affecting 180 files +1843/-980e0964a5778ptp: Add error handling for adjfine callback in ptp_clock_adjtime [1 file, +2/-1]a007f8895fnet/sched: tbf: correct backlog statistic for GSO packets [1 file, +12/-6]9545011e7bnet: Fix icmp host relookup triggering ip_rt_bug [1 file, +3/-0]01f95357e4ipv6: avoid possible NULL deref in modify_prefix_route() [1 file, +7/-6]8b591bd522net/ipv6: release expired exception dst cached in socket [1 file, +3/-3]e48b211c4ctipc: Fix use-after-free of kernel socket in cleanup_bearer(). [1 file, +1/-1]da5cc778e7netfilter: nft_inner: incorrect percpu area handling under softirq [2 files, +46/-12]a36a6d7037Revert "udp: avoid calling sock_def_readable() if possible" [1 file, +3/-11]22074dc1d4ethtool: Fix wrong mod state in case of verbose and no_mask bitset [1 file, +44/-4]316183d583net: avoid potential UAF in default_operstate() [1 file, +6/-1]c00372e41bmmc: sd: SDUC Support Recognition [7 files, +27/-15]19e22f1e68mmc: core: Adjust ACMD22 to SDUC [1 file, +18/-6]42311846d3mmc: core: Use GFP_NOIO in ACMD22 [1 file, +4/-0]4e51552bc5zram: do not mark idle slots that cannot be idle [1 file, +18/-7]0ab037634bzram: clear IDLE flag in mark_idle() [1 file, +2/-0]405b6d5f90ntp: Remove invalid cast in time offset math [1 file, +1/-1]6358df316df2fs: clean up w/ F2FS_{BLK_TO_BYTES,BTYES_TO_BLK} [1 file, +29/-39]e6a91ed4b9f2fs: fix to adjust appropriate length for fiemap [2 files, +4/-3]8e9fec7f79f2fs: fix to requery extent which cross boundary of inquiry [1 file, +15/-5]815d8f0e52i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS [2 files, +5/-3]c3806cf647i3c: master: Extend address status bit to 4 and add I3C_ADDR_SLOT_EXT_DESIRED [2 files, +59/-13]1117462773i3c: master: Fix dynamic address leak when 'assigned-address' is present [1 file, +5/-10]7d4e5e33eascsi: ufs: core: Always initialize the UIC done completion [1 file, +4/-7]3ad69f2f08scsi: ufs: core: Add ufshcd_send_bsg_uic_cmd() for UFS BSG [3 files, +38/-1]47f4ad956bbpf, vsock: Fix poll() missing a queue [1 file, +3/-0]a222e48feabpf, vsock: Invoke proto::close on close() [1 file, +40/-27]dabaf26846xsk: always clear DMA mapping information when unmapping the pool [1 file, +2/-3]5c9e3bb43atcp_bpf: Fix the sk_mem_uncharge logic in tcp_bpf_sendmsg [1 file, +4/-7]7bc37dd9eaALSA: usb-audio: Notify xrun for low-latency mode [1 file, +11/-3]a78af11806pmdomain: core: Add missing put_device() [1 file, +1/-0]913a3f1c06pmdomain: core: Fix error path in pm_genpd_init() when ida alloc fails [1 file, +19/-17]5548887987nvme: don't apply NVME_QUIRK_DEALLOCATE_ZEROES when DSM is not supported [1 file, +2/-1]bdbf87486dbpf: Ensure reg is PTR_TO_STACK in process_iter_arg [2 files, +7/-2]2459a0b149drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails [1 file, +1/-5]0da7d4b7cabpf: Don't mark STACK_INVALID as STACK_MISC in mark_stack_slot_misc [1 file, +6/-3]f9f2a2739ebpf: Fix narrow scalar spill onto 64-bit spilled scalar slots [1 file, +1/-0]845cc4ee8envme-fabrics: handle zero MAXCMD without closing the connection [1 file, +3/-2]c2277e2859scatterlist: fix incorrect func name in kernel-doc [1 file, +1/-1]81ec3c6cebbpf: Handle BPF_EXIST and BPF_NOEXIST for LPM trie [1 file, +20/-3]6dc076a257bpf: Remove unnecessary kfree(im_node) in lpm_trie_update_elem [1 file, +1/-3]7218e441adbpf: Handle in-place update for full LPM trie correctly [1 file, +21/-23]412bf01fd5bpf: Fix exact match conditions in trie_get_next_key() [1 file, +2/-2]e689bc6697HID: wacom: fix when get product name maybe null pointer [1 file, +2/-1]3b0c5bb437can: dev: can_set_termination(): allow sleeping GPIOs [1 file, +1/-1]ba0ee489cdtracing: Fix cmp_entries_dup() to respect sort() comparison rules [1 file, +1/-5]ec643064abarm64: mm: Fix zone_dma_limit calculation [1 file, +8/-9]34b6197867arm64: Ensure bits ASID[15:8] are masked out when the kernel uses 8-bit ASIDs [1 file, +2/-2]abd614bbfcarm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL [1 file, +5/-1]8ab73c34e3arm64: ptrace: fix partial SETREGSET for NT_ARM_FPMR [1 file, +2/-0]4105dd76bcarm64: ptrace: fix partial SETREGSET for NT_ARM_POE [1 file, +2/-0]7f1292f8d4ALSA: usb-audio: Fix a DMA to stack memory bug [1 file, +27/-15]39c5d89b56ALSA: usb-audio: Add extra PID for RME Digiface USB [3 files, +176/-168]9c191055c7scsi: ufs: core: sysfs: Prevent div by zero [1 file, +6/-0]2e7a3bb033scsi: ufs: core: Cancel RTC work during ufshcd_remove() [1 file, +1/-0]5a717f43c2scsi: ufs: core: Add missing post notify for power mode change [2 files, +10/-7]793e560a6bio_uring: Change res2 parameter type in io_uring_cmd_done [2 files, +3/-3]85351e4941Revert "readahead: properly shorten readahead when falling back to do_page_cache_ra()" [1 file, +2/-3]95e197354ecacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU [1 file, +8/-6]bc031095d1modpost: Add .irqentry.text to OTHER_SECTIONS [1 file, +1/-1]178e31df1fbpf: fix OOB devmap writes when deleting elements [1 file, +3/-3]3dcc20418edma-buf: fix dma_fence_array_signaled v4 [1 file, +27/-1]f3dbb097d6dma-fence: Fix reference leak on fence merge failure path [1 file, +2/-0]4715555964dma-fence: Use kernel's sort for merging fences [1 file, +61/-67]d486b5741dxsk: fix OOB map writes when deleting elements [1 file, +1/-1]14258211d6regmap: detach regmap from dev on regmap_exit [1 file, +12/-0]d562b457e1mmc: core: Further prevent card detect during shutdown [2 files, +5/-0]9bfeeeff2cstackdepot: fix stack_depot_save_flags() in NMI context [2 files, +12/-4]a71ddd5b87sched/numa: fix memory leak due to the overwritten vma->numab_state [1 file, +9/-3]835ca042dfkasan: make report_lock a raw spinlock [1 file, +3/-3]69d319450dmm/gup: handle NULL pages in unpin_user_pages() [1 file, +10/-1]1dde3fde62mm: open-code PageTail in folio_flags() and const_folio_flags() [1 file, +2/-2]bd4d2333a3mm: open-code page_folio() in dump_page() [1 file, +5/-2]536ffb4014mm: fix vrealloc()'s KASAN poisoning logic [1 file, +2/-1]fe1a34e92amm: respect mmap hint address when aligning for THP [1 file, +1/-0]5c63e24b1bscsi: ufs: pltfrm: Drop PM runtime reference count after ufshcd_remove() [6 files, +2/-5]2cec2d916amemblock: allow zero threshold in validate_numa_converage() [1 file, +2/-2]d222934627epoll: annotate racy check [2 files, +5/-3]493326c4f1block: RCU protect disk->conv_zones_bitmap [2 files, +32/-13]b6ce2dbe98ext4: partial zero eof block on unaligned inode size extension [2 files, +42/-16]ff599ad2d2cleanup: Adjust scoped_guard() macros to avoid potential warning [1 file, +42/-10]3946e07552gpio: free irqs that are still requested when the chip is being removed [1 file, +41/-0]ea74e9675bHID: add per device quirk to force bind to hid-generic [3 files, +8/-2]17db6ed5a3media: uvcvideo: RealSense D421 Depth module metadata [1 file, +9/-0]0c20fadfd0media: uvcvideo: Add a quirk for the Kaiweets KTI-W02 infrared camera [1 file, +11/-0]3cc5228d5bmedia: uvcvideo: Force UVC version to 1.0a for 0408:4033 [1 file, +11/-0]4150f22342drm: panel-orientation-quirks: Add quirk for AYA NEO 2 model [1 file, +6/-0]5d7f35ed5fdrm: panel-orientation-quirks: Add quirk for AYA NEO Founder edition [1 file, +6/-0]187d5ff497drm: panel-orientation-quirks: Add quirk for AYA NEO GEEK [1 file, +6/-0]fd09880b16af_packet: avoid erroring out after sock_init_data() in packet_create() [1 file, +6/-6]61686abc2fBluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create() [1 file, +1/-0]32df687e12Bluetooth: RFCOMM: avoid leaving dangling sk pointer in rfcomm_sock_alloc() [1 file, +5/-5]8df832e6b9net: af_can: do not leave a dangling sk pointer in can_create() [1 file, +1/-0]03caa9bfb9net: ieee802154: do not leave a dangling sk pointer in ieee802154_create() [1 file, +7/-5]691d6d816fnet: inet: do not leave a dangling sk pointer in inet_create() [1 file, +10/-12]f44fceb71dnet: inet6: do not leave a dangling sk pointer in inet6_create() [1 file, +10/-12]987aa730babpf: Prevent tailcall infinite loop caused by freplace [5 files, +81/-17]051f49d517net/tcp: Add missing lockdep annotations for TCP-AO hlist traversals [4 files, +29/-23]920159e1bfALSA: usb-audio: Make mic volume workarounds globally applicable [3 files, +45/-48]a50b4aa300bpf: Call free_htab_elem() after htab_unlock_bucket() [1 file, +39/-17]da561d5fb6Bluetooth: hci_conn: Reduce hci_conn_drop() calls in two functions [1 file, +3/-10]c55a4c5a04Bluetooth: hci_conn: Use disable_delayed_work_sync [1 file, +3/-3]93a6160dc1Bluetooth: hci_core: Fix not checking skb length on hci_acldata_packet [1 file, +9/-4]b04b4fb91dBluetooth: Add new quirks for ATS2851 [2 files, +20/-4]359fc41e3cBluetooth: Support new quirks for ATS2851 [2 files, +15/-1]166cf43070net/neighbor: clear error in case strict check is not set [1 file, +1/-0]f63a1caae9tracing/ftrace: disable preemption in syscall probe [2 files, +44/-4]d1133dd57etracing: Use atomic64_inc_return() in trace_clock_counter() [1 file, +1/-1]09c083fbearing-buffer: Limit time with disabled interrupts in rb_check_pages() [1 file, +72/-26]c11e2ec9a7pinmux: Use sequential access to access desc->pinmux data [3 files, +100/-77]b865d4e569scsi: ufs: core: Make DMA mask configuration more flexible [3 files, +13/-9]2fcb921c27bpf: put bpf_link's program when link is safe to be deallocated [1 file, +17/-5]bb4a6236a4leds: class: Protect brightness_show() with led_cdev->led_access mutex [2 files, +12/-4]7214d3a64etracing: Fix function name for trampoline [3 files, +36/-8]9e28513fd2f2fs: fix f2fs_bug_on when uninstalling filesystem call f2fs_evict_inode. [1 file, +3/-1]b51aa6a07ePCI: qcom: Add support for IPQ9574 [1 file, +1/-0]617bd1e6c3PCI: Add ACS quirk for Wangxun FF5xxx NICs [1 file, +9/-6]1f51ae217di3c: Use i3cdev->desc->info instead of calling i3c_device_get_info() to avoid deadlock [1 file, +2/-1]6d41a2d5c1f2fs: print message if fscorrupted was found in f2fs_new_node_page() [1 file, +6/-1]924f7dd1e8f2fs: fix to shrink read extent node in batches [1 file, +41/-28]1648c7000fserial: 8250_dw: Add Sophgo SG2044 quirk [1 file, +3/-2]950210c9c7Revert "nvme: make keep-alive synchronous operation" [1 file, +10/-7]d5b2ddf1f9io_uring/tctx: work around xa_store() allocation error issue [1 file, +12/-1]cd188519d2scsi: ufs: pltfrm: Dellocate HBA during ufshcd_pltfrm_remove() [1 file, +1/-0]a39ad4f507sched/core: Remove the unnecessary need_resched() check in nohz_csd_func() [1 file, +1/-1]f9e144a544sched/fair: Check idle_cpu() before need_resched() to detect ilb CPU turning busy [1 file, +1/-1]b4ec68868csched/core: Prevent wakeup of ksoftirqd during idle load balance [1 file, +1/-1]364dc8070btracing/eprobe: Fix to release eprobe when failed to add dyn_event [1 file, +5/-0]1a678f6829clocksource: Make negative motion detection more robust [4 files, +20/-7]6aeef0214dsoftirq: Allow raising SCHED_SOFTIRQ from SMP-call-function on RT kernel [1 file, +11/-4] Changes in 6.12.5 iTCO_wdt: mask NMI_NOW bit for update_no_reboot_bit() call watchdog: xilinx_wwdt: Calculate max_hw_heartbeat_ms using clock frequency watchdog: apple: Actually flush writes after requesting watchdog restart watchdog: mediatek: Make sure system reset gets asserted in mtk_wdt_restart() can: gs_usb: add usb endpoint address detection at driver probe step can: c_can: c_can_handle_bus_err(): update statistics if skb allocation fails can: sun4i_can: sun4i_can_err(): call can_change_state() even if cf is NULL can: hi311x: hi3110_can_ist(): fix potential use-after-free can: m_can: m_can_handle_lec_err(): fix {rx,tx}_errors statistics can: ifi_canfd: ifi_canfd_handle_lec_err(): fix {rx,tx}_errors statistics can: hi311x: hi3110_can_ist(): fix {rx,tx}_errors statistics can: sja1000: sja1000_err(): fix {rx,tx}_errors statistics can: sun4i_can: sun4i_can_err(): fix {rx,tx}_errors statistics can: ems_usb: ems_usb_rx_err(): fix {rx,tx}_errors statistics can: f81604: f81604_handle_can_bus_errors(): fix {rx,tx}_errors statistics ipvs: fix UB due to uninitialized stack access in ip_vs_protocol_init() netfilter: x_tables: fix LED ID check in led_tg_check() netfilter: nft_socket: remove WARN_ON_ONCE on maximum cgroup level selftests: hid: fix typo and exit code net: enetc: Do not configure preemptible TCs if SIs do not support ptp: Add error handling for adjfine callback in ptp_clock_adjtime net/sched: tbf: correct backlog statistic for GSO packets net: hsr: avoid potential out-of-bound access in fill_frame_info() bnxt_en: ethtool: Supply ntuple rss context action net: Fix icmp host relookup triggering ip_rt_bug ipv6: avoid possible NULL deref in modify_prefix_route() can: j1939: j1939_session_new(): fix skb reference counting platform/x86: asus-wmi: Ignore return value when writing thermal policy net: phy: microchip: Reset LAN88xx PHY to ensure clean link state on LAN7800/7850 net/ipv6: release expired exception dst cached in socket dccp: Fix memory leak in dccp_feat_change_recv tipc: Fix use-after-free of kernel socket in cleanup_bearer(). net/smc: initialize close_work early to avoid warning net/smc: fix LGR and link use-after-free issue net/qed: allow old cards not supporting "num_images" to work net: hsr: must allocate more bytes for RedBox support ice: fix PHY Clock Recovery availability check ice: fix PHY timestamp extraction for ETH56G ice: Fix VLAN pruning in switchdev mode idpf: set completion tag for "empty" bufs associated with a packet ixgbevf: stop attempting IPSEC offload on Mailbox API 1.5 ixgbe: downgrade logging of unsupported VF API version to debug ixgbe: Correct BASE-BX10 compliance code igb: Fix potential invalid memory access in igb_init_module() netfilter: nft_inner: incorrect percpu area handling under softirq Revert "udp: avoid calling sock_def_readable() if possible" net: sched: fix erspan_opt settings in cls_flower netfilter: ipset: Hold module reference while requesting a module netfilter: nft_set_hash: skip duplicated elements pending gc run ethtool: Fix wrong mod state in case of verbose and no_mask bitset mlxsw: spectrum_acl_flex_keys: Constify struct mlxsw_afk_element_inst mlxsw: spectrum_acl_flex_keys: Use correct key block on Spectrum-4 geneve: do not assume mac header is set in geneve_xmit_skb() net/mlx5: HWS: Fix memory leak in mlx5hws_definer_calc_layout net/mlx5: HWS: Properly set bwc queue locks lock classes net/mlx5e: SD, Use correct mdev to build channel param net/mlx5e: Remove workaround to avoid syndrome for internal port vsock/test: fix failures due to wrong SO_RCVLOWAT parameter vsock/test: fix parameter types in SO_VM_SOCKETS_* calls net: avoid potential UAF in default_operstate() gpio: grgpio: use a helper variable to store the address of ofdev->dev gpio: grgpio: Add NULL check in grgpio_probe mmc: mtk-sd: use devm_mmc_alloc_host mmc: mtk-sd: Fix error handle of probe function mmc: mtk-sd: fix devm_clk_get_optional usage mmc: mtk-sd: Fix MMC_CAP2_CRYPTO flag setting mmc: sd: SDUC Support Recognition mmc: core: Adjust ACMD22 to SDUC mmc: core: Use GFP_NOIO in ACMD22 zram: do not mark idle slots that cannot be idle zram: clear IDLE flag in mark_idle() ntp: Remove invalid cast in time offset math f2fs: clean up w/ F2FS_{BLK_TO_BYTES,BTYES_TO_BLK} f2fs: fix to adjust appropriate length for fiemap f2fs: fix to requery extent which cross boundary of inquiry i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_STATUS_BITS i3c: master: Extend address status bit to 4 and add I3C_ADDR_SLOT_EXT_DESIRED i3c: master: Fix dynamic address leak when 'assigned-address' is present drm/amd/display: calculate final viewport before TAP optimization drm/amd/display: Ignore scalar validation failure if pipe is phantom scsi: ufs: core: Always initialize the UIC done completion scsi: ufs: core: Add ufshcd_send_bsg_uic_cmd() for UFS BSG bpf, vsock: Fix poll() missing a queue bpf, vsock: Invoke proto::close on close() xsk: always clear DMA mapping information when unmapping the pool bpftool: fix potential NULL pointer dereferencing in prog_dump() drm/sti: Add __iomem for mixer_dbg_mxn's parameter tcp_bpf: Fix the sk_mem_uncharge logic in tcp_bpf_sendmsg ALSA: seq: ump: Fix seq port updates per FB info notify ALSA: usb-audio: Notify xrun for low-latency mode tools: Override makefile ARCH variable if defined, but empty spi: mpc52xx: Add cancel_work_sync before module remove ASoC: SOF: ipc3-topology: Convert the topology pin index to ALH dai index ASoC: SOF: ipc3-topology: fix resource leaks in sof_ipc3_widget_setup_comp_dai() pmdomain: core: Add missing put_device() pmdomain: core: Fix error path in pm_genpd_init() when ida alloc fails nvme: don't apply NVME_QUIRK_DEALLOCATE_ZEROES when DSM is not supported x86/pkeys: Change caller of update_pkru_in_sigframe() x86/pkeys: Ensure updated PKRU value is XRSTOR'd bpf: Ensure reg is PTR_TO_STACK in process_iter_arg irqchip/stm32mp-exti: CONFIG_STM32MP_EXTI should not default to y when compile-testing drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails bpf: Don't mark STACK_INVALID as STACK_MISC in mark_stack_slot_misc bpf: Fix narrow scalar spill onto 64-bit spilled scalar slots nvme-fabrics: handle zero MAXCMD without closing the connection nvme-tcp: fix the memleak while create new ctrl failed nvme-rdma: unquiesce admin_q before destroy it scsi: sg: Fix slab-use-after-free read in sg_release() scsi: scsi_debug: Fix hrtimer support for ndelay ASoC: mediatek: mt8188-mt6359: Remove hardcoded dmic codec drm/v3d: Enable Performance Counters before clearing them ocfs2: free inode when ocfs2_get_init_inode() fails scatterlist: fix incorrect func name in kernel-doc iio: magnetometer: yas530: use signed integer type for clamp limits smb: client: fix potential race in cifs_put_tcon() bpf: Handle BPF_EXIST and BPF_NOEXIST for LPM trie bpf: Remove unnecessary kfree(im_node) in lpm_trie_update_elem bpf: Handle in-place update for full LPM trie correctly bpf: Fix exact match conditions in trie_get_next_key() x86/CPU/AMD: WARN when setting EFER.AUTOIBRS if and only if the WRMSR fails rust: allow `clippy::needless_lifetimes` HID: i2c-hid: Revert to using power commands to wake on resume HID: wacom: fix when get product name maybe null pointer LoongArch: Add architecture specific huge_pte_clear() LoongArch: KVM: Protect kvm_check_requests() with SRCU ksmbd: fix Out-of-Bounds Read in ksmbd_vfs_stream_read ksmbd: fix Out-of-Bounds Write in ksmbd_vfs_stream_write watchdog: rti: of: honor timeout-sec property can: dev: can_set_termination(): allow sleeping GPIOs can: mcp251xfd: mcp251xfd_get_tef_len(): work around erratum DS80000789E 6. tracing: Fix cmp_entries_dup() to respect sort() comparison rules net :mana :Request a V2 response version for MANA_QUERY_GF_STAT iommufd: Fix out_fput in iommufd_fault_alloc() arm64: mm: Fix zone_dma_limit calculation arm64: Ensure bits ASID[15:8] are masked out when the kernel uses 8-bit ASIDs arm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL arm64: ptrace: fix partial SETREGSET for NT_ARM_FPMR arm64: ptrace: fix partial SETREGSET for NT_ARM_POE ALSA: usb-audio: Fix a DMA to stack memory bug ALSA: usb-audio: Add extra PID for RME Digiface USB ALSA: hda/realtek: fix micmute LEDs don't work on HP Laptops ALSA: usb-audio: add mixer mapping for Corsair HS80 ALSA: hda/realtek: Enable mute and micmute LED on HP ProBook 430 G8 ALSA: hda/realtek: Add support for Samsung Galaxy Book3 360 (NP730QFG) scsi: qla2xxx: Fix abort in bsg timeout scsi: qla2xxx: Fix NVMe and NPIV connect issue scsi: qla2xxx: Supported speed displayed incorrectly for VPorts scsi: qla2xxx: Fix use after free on unload scsi: qla2xxx: Remove check req_sg_cnt should be equal to rsp_sg_cnt scsi: ufs: core: sysfs: Prevent div by zero scsi: ufs: core: Cancel RTC work during ufshcd_remove() scsi: ufs: qcom: Only free platform MSIs when ESI is enabled scsi: ufs: pltfrm: Disable runtime PM during removal of glue drivers scsi: ufs: core: Add missing post notify for power mode change nilfs2: fix potential out-of-bounds memory access in nilfs_find_entry() fs/smb/client: avoid querying SMB2_OP_QUERY_WSL_EA for SMB3 POSIX fs/smb/client: Implement new SMB3 POSIX type fs/smb/client: cifs_prime_dcache() for SMB3 POSIX reparse points smb3.1.1: fix posix mounts to older servers io_uring: Change res2 parameter type in io_uring_cmd_done bcache: revert replacing IS_ERR_OR_NULL with IS_ERR again Revert "readahead: properly shorten readahead when falling back to do_page_cache_ra()" pmdomain: imx: gpcv2: Adjust delay after power up handshake selftests/damon: add _damon_sysfs.py to TEST_FILES selftest: hugetlb_dio: fix test naming cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU x86/cacheinfo: Delete global num_cache_leaves drm/amdkfd: hard-code cacheline for gc943,gc944 drm/dp_mst: Fix MST sideband message body length check drm/amdkfd: add MEC version that supports no PCIe atomics for GFX12 drm/amd/pm: fix and simplify workload handling drm/dp_mst: Verify request type in the corresponding down message reply drm/dp_mst: Fix resetting msg rx state after topology removal drm/amd/display: Correct prefetch calculation drm/amd/display: Limit VTotal range to max hw cap minus fp drm/amd/display: Add a left edge pixel if in YCbCr422 or YCbCr420 and odm drm/amdgpu/hdp6.0: do a posting read when flushing HDP drm/amdgpu/hdp4.0: do a posting read when flushing HDP drm/amdgpu/hdp5.0: do a posting read when flushing HDP drm/amdgpu/hdp7.0: do a posting read when flushing HDP drm/amdgpu/hdp5.2: do a posting read when flushing HDP modpost: Add .irqentry.text to OTHER_SECTIONS x86/kexec: Restore GDT on return from ::preserve_context kexec bpf: fix OOB devmap writes when deleting elements dma-buf: fix dma_fence_array_signaled v4 dma-fence: Fix reference leak on fence merge failure path dma-fence: Use kernel's sort for merging fences xsk: fix OOB map writes when deleting elements regmap: detach regmap from dev on regmap_exit arch_numa: Restore nid checks before registering a memblock with a node mmc: sdhci-pci: Add DMI quirk for missing CD GPIO on Vexia Edu Atla 10 tablet mmc: core: Further prevent card detect during shutdown x86/cpu: Add Lunar Lake to list of CPUs with a broken MONITOR implementation ocfs2: update seq_file index in ocfs2_dlm_seq_next stackdepot: fix stack_depot_save_flags() in NMI context lib: stackinit: hide never-taken branch from compiler sched/numa: fix memory leak due to the overwritten vma->numab_state kasan: make report_lock a raw spinlock mm/gup: handle NULL pages in unpin_user_pages() mm/mempolicy: fix migrate_to_node() assuming there is at least one VMA in a MM x86/cpu/topology: Remove limit of CPUs due to disabled IO/APIC x86/mm: Add _PAGE_NOPTISHADOW bit to avoid updating userspace page tables mm/damon: fix order of arguments in damos_before_apply tracepoint mm: memcg: declare do_memsw_account inline mm: open-code PageTail in folio_flags() and const_folio_flags() mm: open-code page_folio() in dump_page() mm: fix vrealloc()'s KASAN poisoning logic mm: respect mmap hint address when aligning for THP scsi: ufs: pltfrm: Drop PM runtime reference count after ufshcd_remove() memblock: allow zero threshold in validate_numa_converage() rust: enable arbitrary_self_types and remove `Receiver` s390/pci: Sort PCI functions prior to creating virtual busses s390/pci: Use topology ID for multi-function devices s390/pci: Ignore RID for isolated VFs epoll: annotate racy check kselftest/arm64: Log fp-stress child startup errors to stdout s390/cpum_sf: Handle CPU hotplug remove during sampling block: RCU protect disk->conv_zones_bitmap btrfs: don't take dev_replace rwsem on task already holding it btrfs: avoid unnecessary device path update for the same device btrfs: canonicalize the device path before adding it btrfs: do not clear read-only when adding sprout device kselftest/arm64: Don't leak pipe fds in pac.exec_sign_all() ext4: partial zero eof block on unaligned inode size extension crypto: ecdsa - Avoid signed integer overflow on signature decoding kcsan: Turn report_filterlist_lock into a raw_spinlock hwmon: (nct6775) Add 665-ACE/600M-CL to ASUS WMI monitoring list ACPI: x86: Make UART skip quirks work on PCI UARTs without an UID ACPI: x86: Add adev NULL check to acpi_quirk_skip_serdev_enumeration() ACPI: video: force native for Apple MacbookPro11,2 and Air7,2 perf/x86/amd: Warn only on new bits set cleanup: Adjust scoped_guard() macros to avoid potential warning iio: magnetometer: fix if () scoped_guard() formatting timekeeping: Always check for negative motion gpio: free irqs that are still requested when the chip is being removed spi: spi-fsl-lpspi: Adjust type of scldiv soc: qcom: llcc: Use designated initializers for LLC settings HID: add per device quirk to force bind to hid-generic firmware: qcom: scm: Allow QSEECOM on Lenovo Yoga Slim 7x soc: qcom: pd-mapper: Add QCM6490 PD maps media: uvcvideo: RealSense D421 Depth module metadata media: uvcvideo: Add a quirk for the Kaiweets KTI-W02 infrared camera media: uvcvideo: Force UVC version to 1.0a for 0408:4033 media: cx231xx: Add support for Dexatek USB Video Grabber 1d19:6108 mmc: core: Add SD card quirk for broken poweroff notification mmc: sdhci-esdhc-imx: enable quirks SDHCI_QUIRK_NO_LED firmware: qcom: scm: Allow QSEECOM on Dell XPS 13 9345 soc: imx8m: Probe the SoC driver as platform driver regmap: maple: Provide lockdep (sub)class for maple tree's internal lock selftests/resctrl: Protect against array overflow when reading strings sched_ext: add a missing rcu_read_lock/unlock pair at scx_select_cpu_dfl() HID: magicmouse: Apple Magic Trackpad 2 USB-C driver support drm/xe/pciids: separate RPL-U and RPL-P PCI IDs drm/xe/pciids: separate ARL and MTL PCI IDs drm/vc4: hdmi: Avoid log spam for audio start failure drm/vc4: hvs: Set AXI panic modes for the HVS drm/xe/pciids: Add PVC's PCI device ID macros wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb drm/xe/pciid: Add new PCI id for ARL drm: panel-orientation-quirks: Add quirk for AYA NEO 2 model drm: panel-orientation-quirks: Add quirk for AYA NEO Founder edition drm: panel-orientation-quirks: Add quirk for AYA NEO GEEK drm/bridge: it6505: Enable module autoloading drm/mcde: Enable module autoloading wifi: rtw89: check return value of ieee80211_probereq_get() for RNR drm/amd/display: Fix out-of-bounds access in 'dcn21_link_encoder_create' drm/radeon/r600_cs: Fix possible int overflow in r600_packet3_check() ASoC: Intel: sof_rt5682: Add HDMI-In capture with rt5682 support for MTL. dlm: fix possible lkb_resource null dereference drm/amd/display: skip disable CRTC in seemless bootup case drm/amd/display: Fix garbage or black screen when resetting otg drm/amd/display: disable SG displays on cyan skillfish drm/xe/ptl: L3bank mask is not available on the media GT drm/xe/xe3: Add initial set of workarounds drm/display: Fix building with GCC 15 ALSA: hda: Use own quirk lookup helper ALSA: hda/conexant: Use the new codec SSID matching ALSA: hda/realtek: Use codec SSID matching for Lenovo devices r8169: don't apply UDP padding quirk on RTL8126A samples/bpf: Fix a resource leak wifi: ath12k: fix atomic calls in ath12k_mac_op_set_bitrate_mask() accel/qaic: Add AIC080 support drm/amd/display: Full exit out of IPS2 when all allow signals have been cleared net: fec_mpc52xx_phy: Use %pa to format resource_size_t net: ethernet: fs_enet: Use %pa to format resource_size_t net/sched: cbs: Fix integer overflow in cbs_set_port_rate() af_packet: avoid erroring out after sock_init_data() in packet_create() Bluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create() Bluetooth: RFCOMM: avoid leaving dangling sk pointer in rfcomm_sock_alloc() net: af_can: do not leave a dangling sk pointer in can_create() net: ieee802154: do not leave a dangling sk pointer in ieee802154_create() net: inet: do not leave a dangling sk pointer in inet_create() net: inet6: do not leave a dangling sk pointer in inet6_create() wifi: ath10k: avoid NULL pointer error during sdio remove wifi: ath5k: add PCI ID for SX76X wifi: ath5k: add PCI ID for Arcadyan devices fanotify: allow reporting errors on failure to open fd bpf: Prevent tailcall infinite loop caused by freplace ASoC: sdw_utils: Add support for exclusion DAI quirks ASoC: sdw_utils: Add a quirk to allow the cs42l43 mic DAI to be ignored ASoC: Intel: sof_sdw: Add quirk for cs42l43 system using host DMICs ASoC: Intel: sof_sdw: Add quirks for some new Lenovo laptops drm/xe/guc/ct: Flush g2h worker in case of g2h response timeout drm/panel: simple: Add Microchip AC69T88A LVDS Display panel net: sfp: change quirks for Alcatel Lucent G-010S-P net: stmmac: Programming sequence for VLAN packets with split header drm/sched: memset() 'job' in drm_sched_job_init() drm/amd/display: Adding array index check to prevent memory corruption drm/amdgpu/gfx9: Add cleaner shader for GFX9.4.2 drm/amdgpu: clear RB_OVERFLOW bit when enabling interrupts for vega20_ih drm/amdgpu: Dereference the ATCS ACPI buffer netlink: specs: Add missing bitset attrs to ethtool spec drm/amdgpu: refine error handling in amdgpu_ttm_tt_pin_userptr ASoC: sdw_utils: Add quirk to exclude amplifier function ASoC: Intel: soc-acpi-intel-arl-match: Add rt722 and rt1320 support drm/amd/display: Fix underflow when playing 8K video in full screen mode mptcp: annotate data-races around subflow->fully_established dma-debug: fix a possible deadlock on radix_lock jfs: array-index-out-of-bounds fix in dtReadFirst jfs: fix shift-out-of-bounds in dbSplit jfs: fix array-index-out-of-bounds in jfs_readdir jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree fsl/fman: Validate cell-index value obtained from Device Tree net/tcp: Add missing lockdep annotations for TCP-AO hlist traversals drm/panic: Add ABGR2101010 support drm/amd/display: Remove hw w/a toggle if on DP2/HPO drm/amd/display: parse umc_info or vram_info based on ASIC drm/amd/display: Prune Invalid Modes For HDMI Output drm/amdgpu: skip amdgpu_device_cache_pci_state under sriov virtio-net: fix overflow inside virtnet_rq_alloc ALSA: usb-audio: Make mic volume workarounds globally applicable drm/amdgpu: set the right AMDGPU sg segment limitation wifi: ipw2x00: libipw_rx_any(): fix bad alignment wifi: brcmfmac: Fix oops due to NULL pointer dereference in brcmf_sdiod_sglist_rw() bpf: Call free_htab_elem() after htab_unlock_bucket() mptcp: fix possible integer overflow in mptcp_reset_tout_timer dsa: qca8k: Use nested lock to avoid splat i2c: i801: Add support for Intel Panther Lake Bluetooth: hci_conn: Reduce hci_conn_drop() calls in two functions Bluetooth: btusb: Add RTL8852BE device 0489:e123 to device tables Bluetooth: btusb: Add USB HW IDs for MT7920/MT7925 Bluetooth: hci_conn: Use disable_delayed_work_sync Bluetooth: hci_core: Fix not checking skb length on hci_acldata_packet Bluetooth: Add new quirks for ATS2851 Bluetooth: Support new quirks for ATS2851 Bluetooth: Set quirks for ATS2851 Bluetooth: btusb: Add new VID/PID 0489/e111 for MT7925 Bluetooth: btusb: Add new VID/PID 0489/e124 for MT7925 Bluetooth: btusb: Add 3 HWIDs for MT7925 ASoC: hdmi-codec: reorder channel allocation list rocker: fix link status detection in rocker_carrier_init() net/neighbor: clear error in case strict check is not set netpoll: Use rcu_access_pointer() in __netpoll_setup pinctrl: freescale: fix COMPILE_TEST error with PINCTRL_IMX_SCU rtla: Fix consistency in getopt_long for timerlat_hist tracing/ftrace: disable preemption in syscall probe tracing: Use atomic64_inc_return() in trace_clock_counter() tools/rtla: fix collision with glibc sched_attr/sched_set_attr rtla/timerlat: Make timerlat_top_cpu->*_count unsigned long long rtla/timerlat: Make timerlat_hist_cpu->*_count unsigned long long scsi: hisi_sas: Add cond_resched() for no forced preemption model scsi: hisi_sas: Create all dump files during debugfs initialization ring-buffer: Limit time with disabled interrupts in rb_check_pages() pinmux: Use sequential access to access desc->pinmux data scsi: ufs: core: Make DMA mask configuration more flexible iommu/amd: Fix corruption when mapping large pages from 0 bpf: put bpf_link's program when link is safe to be deallocated scsi: lpfc: Call lpfc_sli4_queue_unset() in restart and rmmod paths scsi: lpfc: Check SLI_ACTIVE flag in FDMI cmpl before submitting follow up FDMI scsi: lpfc: Prevent NDLP reference count underflow in dev_loss_tmo callback clk: qcom: rcg2: add clk_rcg2_shared_floor_ops clk: qcom: rpmh: add support for SAR2130P clk: qcom: tcsrcc-sm8550: add SAR2130P support clk: qcom: dispcc-sm8550: enable support for SAR2130P clk: qcom: clk-alpha-pll: Add NSS HUAYRA ALPHA PLL support for ipq9574 leds: class: Protect brightness_show() with led_cdev->led_access mutex scsi: st: Don't modify unknown block number in MTIOCGET scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset pinctrl: qcom-pmic-gpio: add support for PM8937 pinctrl: qcom: spmi-mpp: Add PM8937 compatible thermal/drivers/qcom/tsens-v1: Add support for MSM8937 tsens nvdimm: rectify the illogical code within nd_dax_probe() smb: client: memcpy() with surrounding object base address tracing: Fix function name for trampoline tools/rtla: Enhance argument parsing in timerlat_load.py verification/dot2: Improve dot parser robustness mailbox: pcc: Check before sending MCTP PCC response ACK f2fs: fix f2fs_bug_on when uninstalling filesystem call f2fs_evict_inode. KMSAN: uninit-value in inode_go_dump (5) i3c: mipi-i3c-hci: Mask ring interrupts before ring stop request PCI: qcom: Add support for IPQ9574 PCI: vmd: Add DID 8086:B06F and 8086:B60B for Intel client SKUs PCI: vmd: Set devices to D0 before enabling PM L1 Substates PCI: Detect and trust built-in Thunderbolt chips PCI: starfive: Enable controller runtime PM before probing host bridge PCI: Add 'reset_subordinate' to reset hierarchy below bridge PCI: Add ACS quirk for Wangxun FF5xxx NICs remoteproc: qcom: pas: enable SAR2130P audio DSP support i3c: Use i3cdev->desc->info instead of calling i3c_device_get_info() to avoid deadlock f2fs: print message if fscorrupted was found in f2fs_new_node_page() f2fs: fix to shrink read extent node in batches f2fs: add a sysfs node to limit max read extent count per-inode ACPI: x86: Add skip i2c clients quirk for Acer Iconia One 8 A1-840 ACPI: x86: Clean up Asus entries in acpi_quirk_skip_dmi_ids[] LoongArch: Fix sleeping in atomic context for PREEMPT_RT fs/ntfs3: Fix warning in ni_fiemap fs/ntfs3: Fix case when unmarked clusters intersect with zone regulator: qcom-rpmh: Update ranges for FTSMPS525 usb: chipidea: add CI_HDRC_HAS_SHORT_PKT_LIMIT flag usb: chipidea: udc: limit usb request length to max 16KB usb: chipidea: udc: create bounce buffer for problem sglist entries if possible usb: chipidea: udc: handle USB Error Interrupt if IOC not set usb: typec: ucsi: Do not call ACPI _DSM method for UCSI read operations iio: adc: ad7192: properly check spi_get_device_match_data() iio: light: ltr501: Add LTER0303 to the supported devices usb: typec: ucsi: glink: be more precise on orientation-aware ports ASoC: amd: yc: fix internal mic on Redmi G 2022 drm/amdgpu/vcn: reset fw_shared when VCPU buffers corrupted on vcn v4.0.3 MIPS: Loongson64: DTS: Really fix PCIe port nodes for ls7a ASoC: amd: yc: Add quirk for microphone on Lenovo Thinkpad T14s Gen 6 21M1CTO1WW powerpc/prom_init: Fixup missing powermac #size-cells misc: eeprom: eeprom_93cx6: Add quirk for extra read clock cycle rtc: cmos: avoid taking rtc_lock for extended period of time serial: 8250_dw: Add Sophgo SG2044 quirk Revert "nvme: make keep-alive synchronous operation" irqchip/gicv3-its: Add workaround for hip09 ITS erratum 162100801 smb: client: don't try following DFS links in cifs_tree_connect() setlocalversion: work around "git describe" performance io_uring/tctx: work around xa_store() allocation error issue scsi: ufs: pltfrm: Dellocate HBA during ufshcd_pltfrm_remove() drm/xe/devcoredump: Use drm_puts and already cached local variables drm/xe/devcoredump: Improve section headings and add tile info drm/xe/devcoredump: Add ASCII85 dump helper function drm/xe/guc: Copy GuC log prior to dumping drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain() drm/xe/devcoredump: Update handling of xe_force_wake_get return drm/amd/display: Add option to retrieve detile buffer size sched: fix warning in sched_setaffinity sched/core: Remove the unnecessary need_resched() check in nohz_csd_func() sched/fair: Check idle_cpu() before need_resched() to detect ilb CPU turning busy sched/core: Prevent wakeup of ksoftirqd during idle load balance sched/deadline: Fix warning in migrate_enable for boosted tasks btrfs: drop unused parameter options from open_ctree() btrfs: drop unused parameter data from btrfs_fill_super() btrfs: fix mount failure due to remount races btrfs: fix missing snapshot drew unlock when root is dead during swap activation clk: en7523: Initialize num before accessing hws in en7523_register_clocks() tracing/eprobe: Fix to release eprobe when failed to add dyn_event x86: Fix build regression with CONFIG_KEXEC_JUMP enabled Revert "unicode: Don't special case ignorable code points" vfio/mlx5: Align the page tracking max message size with the device capability selftests/ftrace: adjust offset for kprobe syntax error test KVM: x86/mmu: Ensure that kvm_release_pfn_clean() takes exact pfn from kvm_faultin_pfn() jffs2: Prevent rtime decompress memory corruption jffs2: Fix rtime decompressor media: ipu6: use the IPU6 DMA mapping APIs to do mapping ocfs2: Revert "ocfs2: fix the la space leak when unmounting an ocfs2 volume" net/mlx5: unique names for per device caches ASoC: Intel: avs: Fix return status of avs_pcm_hw_constraints_init() drm/amdgpu: rework resume handling for display (v2) ALSA: hda: Fix build error without CONFIG_SND_DEBUG Revert "drm/amd/display: parse umc_info or vram_info based on ASIC" s390/pci: Fix leak of struct zpci_dev when zpci_add_device() fails ALSA: hda/realtek: Fix spelling mistake "Firelfy" -> "Firefly" timekeeping: Remove CONFIG_DEBUG_TIMEKEEPING clocksource: Make negative motion detection more robust softirq: Allow raising SCHED_SOFTIRQ from SMP-call-function on RT kernel Linux 6.12.5 Change-Id: If1b834954ed2ee1a16886f9a9909c6ca62d93b6c Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include <linux/mmc/sd.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/unaligned.h>
|
||||
|
||||
#include "queue.h"
|
||||
#include "block.h"
|
||||
@@ -993,11 +994,12 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)
|
||||
int err;
|
||||
u32 result;
|
||||
__be32 *blocks;
|
||||
u8 resp_sz = mmc_card_ult_capacity(card) ? 8 : 4;
|
||||
unsigned int noio_flag;
|
||||
|
||||
struct mmc_request mrq = {};
|
||||
struct mmc_command cmd = {};
|
||||
struct mmc_data data = {};
|
||||
|
||||
struct scatterlist sg;
|
||||
|
||||
err = mmc_app_cmd(card->host, card);
|
||||
@@ -1008,7 +1010,7 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)
|
||||
cmd.arg = 0;
|
||||
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
|
||||
|
||||
data.blksz = 4;
|
||||
data.blksz = resp_sz;
|
||||
data.blocks = 1;
|
||||
data.flags = MMC_DATA_READ;
|
||||
data.sg = &sg;
|
||||
@@ -1018,15 +1020,29 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)
|
||||
mrq.cmd = &cmd;
|
||||
mrq.data = &data;
|
||||
|
||||
blocks = kmalloc(4, GFP_KERNEL);
|
||||
noio_flag = memalloc_noio_save();
|
||||
blocks = kmalloc(resp_sz, GFP_KERNEL);
|
||||
memalloc_noio_restore(noio_flag);
|
||||
if (!blocks)
|
||||
return -ENOMEM;
|
||||
|
||||
sg_init_one(&sg, blocks, 4);
|
||||
sg_init_one(&sg, blocks, resp_sz);
|
||||
|
||||
mmc_wait_for_req(card->host, &mrq);
|
||||
|
||||
result = ntohl(*blocks);
|
||||
if (mmc_card_ult_capacity(card)) {
|
||||
/*
|
||||
* Normally, ACMD22 returns the number of written sectors as
|
||||
* u32. SDUC, however, returns it as u64. This is not a
|
||||
* superfluous requirement, because SDUC writes may exceed 2TB.
|
||||
* For Linux mmc however, the previously write operation could
|
||||
* not be more than the block layer limits, thus just make room
|
||||
* for a u64 and cast the response back to u32.
|
||||
*/
|
||||
result = clamp_val(get_unaligned_be64(blocks), 0, UINT_MAX);
|
||||
} else {
|
||||
result = ntohl(*blocks);
|
||||
}
|
||||
kfree(blocks);
|
||||
|
||||
if (cmd.error || data.error)
|
||||
|
||||
@@ -149,6 +149,8 @@ static void mmc_bus_shutdown(struct device *dev)
|
||||
if (dev->driver && drv->shutdown)
|
||||
drv->shutdown(card);
|
||||
|
||||
__mmc_stop_host(host);
|
||||
|
||||
if (host->bus_ops->shutdown) {
|
||||
ret = host->bus_ops->shutdown(host);
|
||||
if (ret)
|
||||
@@ -321,7 +323,9 @@ int mmc_add_card(struct mmc_card *card)
|
||||
case MMC_TYPE_SD:
|
||||
type = "SD";
|
||||
if (mmc_card_blockaddr(card)) {
|
||||
if (mmc_card_ext_capacity(card))
|
||||
if (mmc_card_ult_capacity(card))
|
||||
type = "SDUC";
|
||||
else if (mmc_card_ext_capacity(card))
|
||||
type = "SDXC";
|
||||
else
|
||||
type = "SDHC";
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define MMC_CARD_SDXC (1<<3) /* card is SDXC */
|
||||
#define MMC_CARD_REMOVED (1<<4) /* card has been removed */
|
||||
#define MMC_STATE_SUSPENDED (1<<5) /* card is suspended */
|
||||
#define MMC_CARD_SDUC (1<<6) /* card is SDUC */
|
||||
|
||||
#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
|
||||
#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
|
||||
@@ -30,11 +31,13 @@
|
||||
#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
|
||||
#define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED))
|
||||
#define mmc_card_suspended(c) ((c)->state & MMC_STATE_SUSPENDED)
|
||||
#define mmc_card_ult_capacity(c) ((c)->state & MMC_CARD_SDUC)
|
||||
|
||||
#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
|
||||
#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
|
||||
#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
|
||||
#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
|
||||
#define mmc_card_set_ult_capacity(c) ((c)->state |= MMC_CARD_SDUC)
|
||||
#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
|
||||
#define mmc_card_set_suspended(c) ((c)->state |= MMC_STATE_SUSPENDED)
|
||||
#define mmc_card_clr_suspended(c) ((c)->state &= ~MMC_STATE_SUSPENDED)
|
||||
@@ -82,6 +85,7 @@ struct mmc_fixup {
|
||||
#define CID_MANFID_SANDISK_SD 0x3
|
||||
#define CID_MANFID_ATP 0x9
|
||||
#define CID_MANFID_TOSHIBA 0x11
|
||||
#define CID_MANFID_GIGASTONE 0x12
|
||||
#define CID_MANFID_MICRON 0x13
|
||||
#define CID_MANFID_SAMSUNG 0x15
|
||||
#define CID_MANFID_APACER 0x27
|
||||
@@ -284,4 +288,10 @@ static inline int mmc_card_broken_cache_flush(const struct mmc_card *c)
|
||||
{
|
||||
return c->quirks & MMC_QUIRK_BROKEN_CACHE_FLUSH;
|
||||
}
|
||||
|
||||
static inline int mmc_card_broken_sd_poweroff_notify(const struct mmc_card *c)
|
||||
{
|
||||
return c->quirks & MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2296,6 +2296,9 @@ void mmc_start_host(struct mmc_host *host)
|
||||
|
||||
void __mmc_stop_host(struct mmc_host *host)
|
||||
{
|
||||
if (host->rescan_disable)
|
||||
return;
|
||||
|
||||
if (host->slot.cd_irq >= 0) {
|
||||
mmc_gpio_set_cd_wake(host, false);
|
||||
disable_irq(host->slot.cd_irq);
|
||||
|
||||
@@ -25,6 +25,15 @@ static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
|
||||
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
|
||||
MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),
|
||||
|
||||
/*
|
||||
* GIGASTONE Gaming Plus microSD cards manufactured on 02/2022 never
|
||||
* clear Flush Cache bit and set Poweroff Notification Ready bit.
|
||||
*/
|
||||
_FIXUP_EXT("ASTC", CID_MANFID_GIGASTONE, 0x3456, 2022, 2,
|
||||
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
|
||||
MMC_QUIRK_BROKEN_SD_CACHE | MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY,
|
||||
EXT_CSD_REV_ANY),
|
||||
|
||||
END_FIXUP
|
||||
};
|
||||
|
||||
|
||||
+18
-12
@@ -100,7 +100,7 @@ void mmc_decode_cid(struct mmc_card *card)
|
||||
/*
|
||||
* Given a 128-bit response, decode to our card CSD structure.
|
||||
*/
|
||||
static int mmc_decode_csd(struct mmc_card *card)
|
||||
static int mmc_decode_csd(struct mmc_card *card, bool is_sduc)
|
||||
{
|
||||
struct mmc_csd *csd = &card->csd;
|
||||
unsigned int e, m, csd_struct;
|
||||
@@ -144,9 +144,10 @@ static int mmc_decode_csd(struct mmc_card *card)
|
||||
mmc_card_set_readonly(card);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
/*
|
||||
* This is a block-addressed SDHC or SDXC card. Most
|
||||
* interesting fields are unused and have fixed
|
||||
* This is a block-addressed SDHC, SDXC or SDUC card.
|
||||
* Most interesting fields are unused and have fixed
|
||||
* values. To avoid getting tripped by buggy cards,
|
||||
* we assume those fixed values ourselves.
|
||||
*/
|
||||
@@ -159,14 +160,19 @@ static int mmc_decode_csd(struct mmc_card *card)
|
||||
e = unstuff_bits(resp, 96, 3);
|
||||
csd->max_dtr = tran_exp[e] * tran_mant[m];
|
||||
csd->cmdclass = unstuff_bits(resp, 84, 12);
|
||||
csd->c_size = unstuff_bits(resp, 48, 22);
|
||||
|
||||
/* SDXC cards have a minimum C_SIZE of 0x00FFFF */
|
||||
if (csd->c_size >= 0xFFFF)
|
||||
if (csd_struct == 1)
|
||||
m = unstuff_bits(resp, 48, 22);
|
||||
else
|
||||
m = unstuff_bits(resp, 48, 28);
|
||||
csd->c_size = m;
|
||||
|
||||
if (csd->c_size >= 0x400000 && is_sduc)
|
||||
mmc_card_set_ult_capacity(card);
|
||||
else if (csd->c_size >= 0xFFFF)
|
||||
mmc_card_set_ext_capacity(card);
|
||||
|
||||
m = unstuff_bits(resp, 48, 22);
|
||||
csd->capacity = (1 + m) << 10;
|
||||
csd->capacity = (1 + (typeof(sector_t))m) << 10;
|
||||
|
||||
csd->read_blkbits = 9;
|
||||
csd->read_partial = 0;
|
||||
@@ -876,7 +882,7 @@ try_again:
|
||||
return err;
|
||||
}
|
||||
|
||||
int mmc_sd_get_csd(struct mmc_card *card)
|
||||
int mmc_sd_get_csd(struct mmc_card *card, bool is_sduc)
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -887,7 +893,7 @@ int mmc_sd_get_csd(struct mmc_card *card)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = mmc_decode_csd(card);
|
||||
err = mmc_decode_csd(card, is_sduc);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1107,7 +1113,7 @@ static int sd_parse_ext_reg_power(struct mmc_card *card, u8 fno, u8 page,
|
||||
card->ext_power.rev = reg_buf[0] & 0xf;
|
||||
|
||||
/* Power Off Notification support at bit 4. */
|
||||
if (reg_buf[1] & BIT(4))
|
||||
if ((reg_buf[1] & BIT(4)) && !mmc_card_broken_sd_poweroff_notify(card))
|
||||
card->ext_power.feature_support |= SD_EXT_POWER_OFF_NOTIFY;
|
||||
|
||||
/* Power Sustenance support at bit 5. */
|
||||
@@ -1442,7 +1448,7 @@ retry:
|
||||
}
|
||||
|
||||
if (!oldcard) {
|
||||
err = mmc_sd_get_csd(card);
|
||||
err = mmc_sd_get_csd(card, false);
|
||||
if (err)
|
||||
goto free_card;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ struct mmc_host;
|
||||
struct mmc_card;
|
||||
|
||||
int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr);
|
||||
int mmc_sd_get_csd(struct mmc_card *card);
|
||||
int mmc_sd_get_csd(struct mmc_card *card, bool is_sduc);
|
||||
void mmc_decode_cid(struct mmc_card *card);
|
||||
int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card,
|
||||
bool reinit);
|
||||
|
||||
@@ -769,7 +769,7 @@ try_again:
|
||||
* Read CSD, before selecting the card
|
||||
*/
|
||||
if (!oldcard && mmc_card_sd_combo(card)) {
|
||||
err = mmc_sd_get_csd(card);
|
||||
err = mmc_sd_get_csd(card, false);
|
||||
if (err)
|
||||
goto remove;
|
||||
|
||||
|
||||
+25
-39
@@ -2736,20 +2736,18 @@ static int msdc_drv_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* Allocate MMC host for this device */
|
||||
mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev);
|
||||
mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(struct msdc_host));
|
||||
if (!mmc)
|
||||
return -ENOMEM;
|
||||
|
||||
host = mmc_priv(mmc);
|
||||
ret = mmc_of_parse(mmc);
|
||||
if (ret)
|
||||
goto host_free;
|
||||
return ret;
|
||||
|
||||
host->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(host->base)) {
|
||||
ret = PTR_ERR(host->base);
|
||||
goto host_free;
|
||||
}
|
||||
if (IS_ERR(host->base))
|
||||
return PTR_ERR(host->base);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||
if (res) {
|
||||
@@ -2760,53 +2758,45 @@ static int msdc_drv_probe(struct platform_device *pdev)
|
||||
|
||||
ret = mmc_regulator_get_supply(mmc);
|
||||
if (ret)
|
||||
goto host_free;
|
||||
return ret;
|
||||
|
||||
ret = msdc_of_clock_parse(pdev, host);
|
||||
if (ret)
|
||||
goto host_free;
|
||||
return ret;
|
||||
|
||||
host->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
|
||||
"hrst");
|
||||
if (IS_ERR(host->reset)) {
|
||||
ret = PTR_ERR(host->reset);
|
||||
goto host_free;
|
||||
}
|
||||
if (IS_ERR(host->reset))
|
||||
return PTR_ERR(host->reset);
|
||||
|
||||
/* only eMMC has crypto property */
|
||||
if (!(mmc->caps2 & MMC_CAP2_NO_MMC)) {
|
||||
host->crypto_clk = devm_clk_get_optional(&pdev->dev, "crypto");
|
||||
if (IS_ERR(host->crypto_clk))
|
||||
host->crypto_clk = NULL;
|
||||
else
|
||||
return PTR_ERR(host->crypto_clk);
|
||||
else if (host->crypto_clk)
|
||||
mmc->caps2 |= MMC_CAP2_CRYPTO;
|
||||
}
|
||||
|
||||
host->irq = platform_get_irq(pdev, 0);
|
||||
if (host->irq < 0) {
|
||||
ret = host->irq;
|
||||
goto host_free;
|
||||
}
|
||||
if (host->irq < 0)
|
||||
return host->irq;
|
||||
|
||||
host->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||
if (IS_ERR(host->pinctrl)) {
|
||||
ret = PTR_ERR(host->pinctrl);
|
||||
dev_err(&pdev->dev, "Cannot find pinctrl!\n");
|
||||
goto host_free;
|
||||
}
|
||||
if (IS_ERR(host->pinctrl))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(host->pinctrl),
|
||||
"Cannot find pinctrl");
|
||||
|
||||
host->pins_default = pinctrl_lookup_state(host->pinctrl, "default");
|
||||
if (IS_ERR(host->pins_default)) {
|
||||
ret = PTR_ERR(host->pins_default);
|
||||
dev_err(&pdev->dev, "Cannot find pinctrl default!\n");
|
||||
goto host_free;
|
||||
return PTR_ERR(host->pins_default);
|
||||
}
|
||||
|
||||
host->pins_uhs = pinctrl_lookup_state(host->pinctrl, "state_uhs");
|
||||
if (IS_ERR(host->pins_uhs)) {
|
||||
ret = PTR_ERR(host->pins_uhs);
|
||||
dev_err(&pdev->dev, "Cannot find pinctrl uhs!\n");
|
||||
goto host_free;
|
||||
return PTR_ERR(host->pins_uhs);
|
||||
}
|
||||
|
||||
/* Support for SDIO eint irq ? */
|
||||
@@ -2885,7 +2875,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
|
||||
ret = msdc_ungate_clock(host);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Cannot ungate clocks!\n");
|
||||
goto release_mem;
|
||||
goto release_clk;
|
||||
}
|
||||
msdc_init_hw(host);
|
||||
|
||||
@@ -2895,14 +2885,14 @@ static int msdc_drv_probe(struct platform_device *pdev)
|
||||
GFP_KERNEL);
|
||||
if (!host->cq_host) {
|
||||
ret = -ENOMEM;
|
||||
goto host_free;
|
||||
goto release;
|
||||
}
|
||||
host->cq_host->caps |= CQHCI_TASK_DESC_SZ_128;
|
||||
host->cq_host->mmio = host->base + 0x800;
|
||||
host->cq_host->ops = &msdc_cmdq_ops;
|
||||
ret = cqhci_init(host->cq_host, mmc, true);
|
||||
if (ret)
|
||||
goto host_free;
|
||||
goto release;
|
||||
mmc->max_segs = 128;
|
||||
/* cqhci 16bit length */
|
||||
/* 0 size, means 65536 so we don't have to -1 here */
|
||||
@@ -2929,9 +2919,10 @@ static int msdc_drv_probe(struct platform_device *pdev)
|
||||
end:
|
||||
pm_runtime_disable(host->dev);
|
||||
release:
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
msdc_deinit_hw(host);
|
||||
release_clk:
|
||||
msdc_gate_clock(host);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
release_mem:
|
||||
if (host->dma.gpd)
|
||||
dma_free_coherent(&pdev->dev,
|
||||
@@ -2939,11 +2930,8 @@ release_mem:
|
||||
host->dma.gpd, host->dma.gpd_addr);
|
||||
if (host->dma.bd)
|
||||
dma_free_coherent(&pdev->dev,
|
||||
MAX_BD_NUM * sizeof(struct mt_bdma_desc),
|
||||
host->dma.bd, host->dma.bd_addr);
|
||||
host_free:
|
||||
mmc_free_host(mmc);
|
||||
|
||||
MAX_BD_NUM * sizeof(struct mt_bdma_desc),
|
||||
host->dma.bd, host->dma.bd_addr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2968,9 +2956,7 @@ static void msdc_drv_remove(struct platform_device *pdev)
|
||||
2 * sizeof(struct mt_gpdma_desc),
|
||||
host->dma.gpd, host->dma.gpd_addr);
|
||||
dma_free_coherent(&pdev->dev, MAX_BD_NUM * sizeof(struct mt_bdma_desc),
|
||||
host->dma.bd, host->dma.bd_addr);
|
||||
|
||||
mmc_free_host(mmc);
|
||||
host->dma.bd, host->dma.bd_addr);
|
||||
}
|
||||
|
||||
static void msdc_save_reg(struct msdc_host *host)
|
||||
|
||||
@@ -238,6 +238,7 @@ struct esdhc_platform_data {
|
||||
|
||||
struct esdhc_soc_data {
|
||||
u32 flags;
|
||||
u32 quirks;
|
||||
};
|
||||
|
||||
static const struct esdhc_soc_data esdhc_imx25_data = {
|
||||
@@ -309,10 +310,12 @@ static struct esdhc_soc_data usdhc_imx7ulp_data = {
|
||||
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
|
||||
| ESDHC_FLAG_PMQOS | ESDHC_FLAG_HS400
|
||||
| ESDHC_FLAG_STATE_LOST_IN_LPMODE,
|
||||
.quirks = SDHCI_QUIRK_NO_LED,
|
||||
};
|
||||
static struct esdhc_soc_data usdhc_imxrt1050_data = {
|
||||
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
|
||||
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200,
|
||||
.quirks = SDHCI_QUIRK_NO_LED,
|
||||
};
|
||||
|
||||
static struct esdhc_soc_data usdhc_imx8qxp_data = {
|
||||
@@ -321,6 +324,7 @@ static struct esdhc_soc_data usdhc_imx8qxp_data = {
|
||||
| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
|
||||
| ESDHC_FLAG_STATE_LOST_IN_LPMODE
|
||||
| ESDHC_FLAG_CLK_RATE_LOST_IN_PM_RUNTIME,
|
||||
.quirks = SDHCI_QUIRK_NO_LED,
|
||||
};
|
||||
|
||||
static struct esdhc_soc_data usdhc_imx8mm_data = {
|
||||
@@ -328,6 +332,7 @@ static struct esdhc_soc_data usdhc_imx8mm_data = {
|
||||
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
|
||||
| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
|
||||
| ESDHC_FLAG_STATE_LOST_IN_LPMODE,
|
||||
.quirks = SDHCI_QUIRK_NO_LED,
|
||||
};
|
||||
|
||||
struct pltfm_imx_data {
|
||||
@@ -1687,6 +1692,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
|
||||
|
||||
imx_data->socdata = device_get_match_data(&pdev->dev);
|
||||
|
||||
host->quirks |= imx_data->socdata->quirks;
|
||||
if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
|
||||
cpu_latency_qos_add_request(&imx_data->pm_qos_req, 0);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/machine.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/pm_qos.h>
|
||||
#include <linux/debugfs.h>
|
||||
@@ -1235,6 +1236,29 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = {
|
||||
.priv_size = sizeof(struct intel_host),
|
||||
};
|
||||
|
||||
/* DMI quirks for devices with missing or broken CD GPIO info */
|
||||
static const struct gpiod_lookup_table vexia_edu_atla10_cd_gpios = {
|
||||
.dev_id = "0000:00:12.0",
|
||||
.table = {
|
||||
GPIO_LOOKUP("INT33FC:00", 38, "cd", GPIO_ACTIVE_HIGH),
|
||||
{ }
|
||||
},
|
||||
};
|
||||
|
||||
static const struct dmi_system_id sdhci_intel_byt_cd_gpio_override[] = {
|
||||
{
|
||||
/* Vexia Edu Atla 10 tablet 9V version */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
|
||||
/* Above strings are too generic, also match on BIOS date */
|
||||
DMI_MATCH(DMI_BIOS_DATE, "08/25/2014"),
|
||||
},
|
||||
.driver_data = (void *)&vexia_edu_atla10_cd_gpios,
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
.resume = byt_resume,
|
||||
@@ -1253,6 +1277,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
|
||||
.add_host = byt_add_host,
|
||||
.remove_slot = byt_remove_slot,
|
||||
.ops = &sdhci_intel_byt_ops,
|
||||
.cd_gpio_override = sdhci_intel_byt_cd_gpio_override,
|
||||
.priv_size = sizeof(struct intel_host),
|
||||
};
|
||||
|
||||
@@ -2054,6 +2079,42 @@ static const struct dev_pm_ops sdhci_pci_pm_ops = {
|
||||
* *
|
||||
\*****************************************************************************/
|
||||
|
||||
static struct gpiod_lookup_table *sdhci_pci_add_gpio_lookup_table(
|
||||
struct sdhci_pci_chip *chip)
|
||||
{
|
||||
struct gpiod_lookup_table *cd_gpio_lookup_table;
|
||||
const struct dmi_system_id *dmi_id = NULL;
|
||||
size_t count;
|
||||
|
||||
if (chip->fixes && chip->fixes->cd_gpio_override)
|
||||
dmi_id = dmi_first_match(chip->fixes->cd_gpio_override);
|
||||
|
||||
if (!dmi_id)
|
||||
return NULL;
|
||||
|
||||
cd_gpio_lookup_table = dmi_id->driver_data;
|
||||
for (count = 0; cd_gpio_lookup_table->table[count].key; count++)
|
||||
;
|
||||
|
||||
cd_gpio_lookup_table = kmemdup(dmi_id->driver_data,
|
||||
/* count + 1 terminating entry */
|
||||
struct_size(cd_gpio_lookup_table, table, count + 1),
|
||||
GFP_KERNEL);
|
||||
if (!cd_gpio_lookup_table)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
gpiod_add_lookup_table(cd_gpio_lookup_table);
|
||||
return cd_gpio_lookup_table;
|
||||
}
|
||||
|
||||
static void sdhci_pci_remove_gpio_lookup_table(struct gpiod_lookup_table *lookup_table)
|
||||
{
|
||||
if (lookup_table) {
|
||||
gpiod_remove_lookup_table(lookup_table);
|
||||
kfree(lookup_table);
|
||||
}
|
||||
}
|
||||
|
||||
static struct sdhci_pci_slot *sdhci_pci_probe_slot(
|
||||
struct pci_dev *pdev, struct sdhci_pci_chip *chip, int first_bar,
|
||||
int slotno)
|
||||
@@ -2129,8 +2190,19 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
|
||||
device_init_wakeup(&pdev->dev, true);
|
||||
|
||||
if (slot->cd_idx >= 0) {
|
||||
struct gpiod_lookup_table *cd_gpio_lookup_table;
|
||||
|
||||
cd_gpio_lookup_table = sdhci_pci_add_gpio_lookup_table(chip);
|
||||
if (IS_ERR(cd_gpio_lookup_table)) {
|
||||
ret = PTR_ERR(cd_gpio_lookup_table);
|
||||
goto remove;
|
||||
}
|
||||
|
||||
ret = mmc_gpiod_request_cd(host->mmc, "cd", slot->cd_idx,
|
||||
slot->cd_override_level, 0);
|
||||
|
||||
sdhci_pci_remove_gpio_lookup_table(cd_gpio_lookup_table);
|
||||
|
||||
if (ret && ret != -EPROBE_DEFER)
|
||||
ret = mmc_gpiod_request_cd(host->mmc, NULL,
|
||||
slot->cd_idx,
|
||||
|
||||
@@ -156,6 +156,7 @@ struct sdhci_pci_fixes {
|
||||
#endif
|
||||
|
||||
const struct sdhci_ops *ops;
|
||||
const struct dmi_system_id *cd_gpio_override;
|
||||
size_t priv_size;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user