From bc79c673fa4f8aec6f5a43452fb43975ff5fa3cb Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 22 Mar 2024 12:53:54 -0400 Subject: [PATCH] Fixes for 6.8 Signed-off-by: Sasha Levin --- ...-amd-cppc-v2-support-for-family-17h-.patch | 47 + ...-register-of-memory-node-for-generic.patch | 62 + ...dle-fix-memory-leak-in-acpi_processo.patch | 61 + ...d-maibenben-x577-to-irq1_edge_low_fo.patch | 49 + ...-irq-override-on-lunnen-ground-lapto.patch | 51 + ...x-device-check-notification-handling.patch | 57 + ...-data-race-of-gc_in_progress-in-wait.patch | 39 + .../afs-don-t-cache-preferred-address.patch | 81 + ...al-rmdir-then-vnovnode-with-generic-.patch | 104 + ...ide-silly-rename-files-from-userspac.patch | 55 + ...-set-channel-index-correctly-when-sy.patch | 69 + ...-fix-alc285-issues-on-hp-envy-x360-l.patch | 147 + ...a-tas2781-add-lock-to-system_suspend.patch | 41 + ...-do-not-call-pm_runtime_force_-in-sy.patch | 64 + ...-do-not-reset-cur_-values-in-runtime.patch | 53 + ...-restore-power-state-after-system_re.patch | 84 + ...tas2781-use-dev_dbg-in-system_resume.patch | 39 + ...ix-scarlett-4th-gen-4i4-low-voltage-.patch | 75 + ...ix-scarlett-4th-gen-autogain-status-.patch | 127 + ...ix-scarlett-4th-gen-input-gain-range.patch | 58 + ...rlett-4th-gen-input-gain-range.patch-21200 | 62 + .../alsa-seq-fix-function-cast-warnings.patch | 95 + ...top-parsing-channels-bits-when-all-c.patch | 43 + ...ntial-use-after-free-problem-in-aoec.patch | 88 + ...emove-linux-fb.h-from-backlight-code.patch | 98 + ...view-fix-development-chip-rom-compat.patch | 43 + ...app4-fix-typo-in-the-qca-switch-regi.patch | 42 + ...app4-move-the-internal-switch-phys-u.patch | 98 + ...com-msm8974-correct-qfprom-node-size.patch | 46 + ...r8a73a4-fix-external-clocks-and-cloc.patch | 82 + ...nner-h6-add-rx-dma-channel-for-spdif.patch | 83 + ...-kontron-disable-pull-resistors-for-.patch | 80 + ...on-disable-pull-resistors-for-.patch-27736 | 80 + ...-kontron-disable-pullups-for-i2c-sig.patch | 56 + ...on-disable-pullups-for-i2c-sig.patch-24016 | 56 + ...-kontron-disable-pullups-for-onboard.patch | 58 + ...ron-disable-pullups-for-onboard.patch-1464 | 58 + ...-kontron-fix-interrupt-for-rtc-on-os.patch | 36 + ...mx8mm-venice-gw71xx-fix-usb-otg-vbus.patch | 85 + ...rm64-dts-imx8mp-evk-fix-hdmi-3d-node.patch | 119 + ...-set-spi-nor-to-max-40-mhz-on-data-m.patch | 38 + ...-align-edma3-power-domains-resources.patch | 48 + ...-correct-edma3-power-domains-and-int.patch | 65 + ...l-reorder-crypto-interrupts-on-armad.patch | 88 + ...ek-mt7622-add-missing-device_type-to.patch | 57 + ...ek-mt7986-add-reset-cells-to-infracf.patch | 47 + ...tek-mt7986-drop-clock-cells-from-pwm.patch | 45 + ...ek-mt7986-drop-crypto-s-unneeded-inv.patch | 46 + ...ek-mt7986-fix-reference-to-pwm-in-fa.patch | 44 + ...ek-mt7986-fix-spi-bus-width-properti.patch | 63 + ...dts-mediatek-mt7986-fix-spi-nodename.patch | 61 + ...ek-mt8186-add-missing-clocks-to-ssus.patch | 64 + ...ek-mt8186-add-missing-xhci-clock-to-.patch | 74 + ...ek-mt8186-fix-venc-power-domain-cloc.patch | 38 + ...ek-mt8192-asurada-remove-crosec-base.patch | 49 + ...iatek-mt8192-fix-vencoder-clock-name.patch | 40 + ...-move-crosec-base-detection-node-to-.patch | 106 + ...-cherry-tomato-change-watchdog-reset.patch | 66 + ...sm8996-define-ufs-unipro-clock-limit.patch | 42 + ...-dts-qcom-msm8996-fix-ufs-phy-clocks.patch | 42 + ...sm8998-declare-vls-clamp-register-fo.patch | 53 + ...-dts-qcom-msm8998-fix-ufs-phy-clocks.patch | 51 + ...cm2290-declare-vls-clamp-register-fo.patch | 51 + ...cm6490-fairphone-fp5-add-missing-res.patch | 43 + ...cm6490-idp-correct-the-voltage-setti.patch | 41 + ...cs6490-rb3gen2-correct-the-voltage-s.patch | 41 + ...m64-dts-qcom-rename-pm2250-to-pm4125.patch | 345 ++ ...a8540p-drop-gfx.lvl-as-power-domain-.patch | 41 + ...c7280-add-static-properties-to-crypt.patch | 43 + ...sc8180x-add-missing-cpu-mdp_cfg-path.patch | 47 + ...om-sc8180x-add-missing-cpu-off-state.patch | 54 + ...c8180x-don-t-hold-mdp-core-clock-at-.patch | 40 + ...om-sc8180x-fix-edp-phy-power-domains.patch | 37 + ...c8180x-fix-up-big-cpu-idle-state-ent.patch | 37 + ...c8180x-hook-up-vdd_cx-as-gcc-parent-.patch | 36 + ...c8180x-require-low_svs-vote-for-mmcx.patch | 37 + ...c8180x-shrink-aoss_qmp-register-spac.patch | 37 + ...dts-qcom-sc8280xp-fix-ufs-phy-clocks.patch | 63 + ...dm845-db845c-correct-pcie-wake-gpios.patch | 40 + ...4-dts-qcom-sdm845-fix-ufs-phy-clocks.patch | 51 + ...dm845-oneplus-common-improve-dai-nod.patch | 54 + ...dm845-use-the-low-power-island-cx-mx.patch | 39 + ...m6115-declare-vls-clamp-register-for.patch | 51 + ...com-sm6115-drop-pipe-clock-selection.patch | 57 + ...4-dts-qcom-sm6115-fix-ufs-phy-clocks.patch | 47 + ...4-dts-qcom-sm6125-fix-ufs-phy-clocks.patch | 48 + ...4-dts-qcom-sm6350-fix-ufs-phy-clocks.patch | 51 + ...-qcom-sm8150-correct-pcie-wake-gpios.patch | 40 + ...4-dts-qcom-sm8150-fix-ufs-phy-clocks.patch | 51 + ...4-dts-qcom-sm8250-fix-ufs-phy-clocks.patch | 51 + ...4-dts-qcom-sm8350-fix-ufs-phy-clocks.patch | 51 + ...m8450-add-missing-interconnects-to-s.patch | 59 + ...s-qcom-sm8550-fix-spmi-channels-size.patch | 44 + ...4-dts-qcom-sm8550-fix-ufs-phy-clocks.patch | 49 + ...s-qcom-sm8650-fix-spmi-channels-size.patch | 44 + ...4-dts-qcom-sm8650-fix-ufs-phy-clocks.patch | 48 + ...ts-qcom-x1e80100-drop-qcom-drv-count.patch | 37 + ...1e80100-qcp-fix-supplies-for-ldos-3e.patch | 46 + ...as-r8a779a0-correct-avb-01-reg-sizes.patch | 48 + ...nesas-r8a779g0-add-missing-scif_clk2.patch | 67 + ...as-r8a779g0-correct-avb-01-reg-sizes.patch | 48 + ...-renesas-r8a779g0-restore-sort-order.patch | 126 + ...s-r9a08g045-add-missing-interrupts-t.patch | 52 + ...s-rzg2l-add-missing-interrupts-to-ir.patch | 131 + ...s-rzg3s-smarc-som-guard-ethernet-irq.patch | 64 + ...ip-add-missing-interrupt-names-for-r.patch | 40 + ...ip-drop-rockchip-trcm-sync-tx-only-f.patch | 55 + ...ip-fix-reset-names-for-rk356x-i2s2-c.patch | 48 + ...-common1-register-space-for-am62x-so.patch | 44 + ...-common1-register-space-for-am65x-so.patch | 44 + ...5x-fix-dtbs_install-for-rocktech-old.patch | 37 + ...-dts-ti-k3-am62-main-disable-usb-lpm.patch | 65 + ...-k3-am62p-fix-memory-ranges-for-dmss.patch | 39 + ...am62p-mcu-wakeup-disable-mcu-and-wak.patch | 62 + ...i-k3-am62p5-sk-enable-cpsw-mdio-node.patch | 44 + ...am64-main-fix-itap-otap-values-for-m.patch | 59 + ...k3-am69-sk-fix-pmic-interrupt-number.patch | 43 + ...am69-sk-remove-assigned-clock-parent.patch | 55 + ...j7200-common-proc-board-modify-pinmu.patch | 64 + ...j7200-common-proc-board-remove-clock.patch | 38 + ...-j721e-fix-mux-reg-masks-in-hbmc_mux.patch | 44 + ...3-j721e-sk-fix-pmic-interrupt-number.patch | 54 + ...j721s2-common-proc-board-remove-pinm.patch | 40 + ...j721s2-fix-power-domain-for-vtm-node.patch | 38 + ...j784s4-evm-remove-pinmux-for-cts-and.patch | 40 + ...j784s4-fix-power-domain-for-vtm-node.patch | 38 + ...j784s4-main-fix-mux-reg-masks-in-ser.patch | 49 + ...-t-forbid-call_ops-cc_optimize_for_s.patch | 52 + ...d-missing-error-handling-in-sof-mach.patch | 54 + ...ommon-add-stub-for-sof_ssp_get_codec.patch | 49 + ...u-fix-function-pointer-type-mismatch.patch | 85 + ...dm-interface-add-frame-rate-constrai.patch | 86 + ...dm-interface-fix-mclk-setup-without-.patch | 49 + ...5-fix-function-pointer-type-mismatch.patch | 83 + ...oc-sh-rz-ssi-fix-error-message-print.patch | 39 + ...ome-bounds-checking-to-firmware-data.patch | 39 + ...-compute-file-paths-on-firmware-load.patch | 141 + ...fix-memory-leak-in-amd_sof_acp_probe.patch | 70 + ...kip-firmware-test-for-custom-loaders.patch | 103 + ...-fully-initialize-backlight_properti.patch | 37 + ...-fix-potential-null-pointer-derefere.patch | 48 + ...6-correct-the-check-for-of_property_.patch | 53 + ...a-don-t-set-bl-props.brightness-in-g.patch | 77 + ...a-initialize-backlight_properties-on.patch | 37 + ...-fully-initialize-backlight_properti.patch | 37 + ...-fully-initialize-backlight_properti.patch | 37 + ...ck-between-bd_link_disk_holder-and-p.patch | 113 + .../bluetooth-af_bluetooth-fix-deadlock.patch | 90 + ...trtl-fix-out-of-bounds-memory-access.patch | 125 + .../bluetooth-btusb-fix-memory-leak.patch | 68 + queue-6.8/bluetooth-fix-eir-name-length.patch | 106 + ...e-after-free-in-accessing-skb-after-.patch | 61 + ...re-cancel-request-on-command-timeout.patch | 245 ++ ...ci_core-fix-possible-buffer-overflow.patch | 36 + ...ent-fix-not-indicating-new-connectio.patch | 115 + ...-add-ability-to-allocate-memory-for-.patch | 104 + ...a-don-t-use-is_err_or_null-with-gpio.patch | 59 + ...ync-fix-overwriting-request-callback.patch | 257 ++ ...emove-leftover-queuing-of-power_off-.patch | 78 + .../bluetooth-msft-fix-memory-leak.patch | 42 + queue-6.8/bluetooth-remove-bt_hs.patch | 3573 +++++++++++++++++ ...uetooth-remove-hci_power_off_timeout.patch | 39 + ...-superfluous-call-to-hci_conn_check_.patch | 62 + ...arnings-intended-for-global-subprogs.patch | 60 + ...ptr_to_ctx-for-programs-with-unnamed.patch | 97 + ...hash-overflow-check-on-32-bit-arches.patch | 66 + ...htab-overflow-check-on-32-bit-arches.patch | 65 + ...kmap-overflow-check-on-32-bit-arches.patch | 61 + ..._prog_pack_size-to-2mb-num_possible_.patch | 53 + ...alar-args-don-t-accept-__arg_nonnull.patch | 53 + ...n_-lock-unlock-helpers-with-notrace-.patch | 133 + ...-fix-wrong-free-call-in-do_show_link.patch | 39 + ...l-silence-build-warning-about-calloc.patch | 54 + ...hen-detecting-delalloc-ranges-during.patch | 511 +++ ...nect-update-dependency-to-arch_tegra.patch | 47 + ...cancel-polling-timer-together-with-i.patch | 82 + .../cifs-fix-writeback-data-corruption.patch | 510 +++ ...lk-fix-clk_core_get-null-dereference.patch | 56 + ...3519-release-the-correct-number-of-g.patch | 39 + ...-hi3559a-fix-an-erroneous-devm_kfree.patch | 42 + ...x-imx8mp-fix-sai_mclk_sel-definition.patch | 62 + ...622-apmixedsys-fix-an-error-handling.patch | 41 + ...981-topckgen-flag-sgm_reg_sel-as-cri.patch | 44 + ...135-fix-an-error-handling-path-in-cl.patch | 48 + ...183-correct-parent-of-clk_infra_sspm.patch | 42 + ...dd-missing-clocks-to-axg_clk_regmaps.patch | 83 + ...sdm845-adjust-internal-gdsc-wait-tim.patch | 38 + ...5018-fix-enable_reg-offset-of-gcc_gm.patch | 56 + ...5018-fix-halt_reg-offset-of-gcc_pcie.patch | 70 + ...5018-fix-register-offset-for-gcc_ubi.patch | 47 + ...et-commonize-the-de-assert-functions.patch | 69 + ...nsure-write-completion-on-reset-de-a.patch | 45 + ...a779f0-correct-pfc-gpio-parent-clock.patch | 43 + ...779g0-correct-pfc-gpio-parent-clocks.patch | 78 + ...renesas-r8a779g0-fix-pcie-clock-name.patch | 36 + ...7g04-34-use-sel_sdhi1_sts-status-con.patch | 53 + ...os850-propagate-spi-ipclk-rate-chang.patch | 173 + ...-null-pointer-dereference-caused-by-.patch | 74 + ...avs-cpufreq-add-check-for-cpufreq_cp.patch | 39 + ...-hw-don-t-error-out-if-supply-is-not.patch | 48 + ...-hw-wait-for-cpu-supplies-before-pro.patch | 72 + ...-hw-add-config_common_clk-dependency.patch | 47 + ...o-arm-sha-fix-function-cast-warnings.patch | 115 + ...-discarding-errors-in-psp_send_platf.patch | 56 + ...r-fix-crypto_jitterentropy-help-text.patch | 51 + .../crypto-qat-avoid-division-by-zero.patch | 45 + ...to-qat-avoid-memcpy-overflow-warning.patch | 56 + ...ring-to-service-map-for-dcc-in-420xx.patch | 56 + ...-ring-to-service-map-for-dcc-in-4xxx.patch | 56 + ...emove-double-initialization-of-value.patch | 56 + ...move-unused-macros-in-qat_comp_alg.c.patch | 71 + ...oved-unused-macro-in-adf_cnv_dbgfs.c.patch | 41 + ...ilinx-call-finalize-with-bh-disabled.patch | 72 + ...rrect-assignment-of-sslbis-entry-poi.patch | 112 + ...nk-fix-length-of-eswitch-inline-mode.patch | 58 + ...he-resume-method-on-internal-suspend.patch | 123 + ...e-positive-for-requeue-needed-during.patch | 46 + ...10-adma-update-dependency-to-arch_te.patch | 60 + ...andle-use-kzalloc-to-fix-kernel-info.patch | 72 + ..._ref_-_del-for-multiple-registration.patch | 63 + ...oper-enum-for-pin-capabilities-attri.patch | 48 + ...ct-video-to-provide-cmdline-function.patch | 52 + ...add-replay-null-check-in-edp_set_rep.patch | 62 + ...fix-a-potential-buffer-overflow-in-d.patch | 46 + ...fix-null-checks-for-adev-dm.dc-in-am.patch | 62 + ...fix-potential-null-pointer-dereferen.patch | 57 + ...x-esm-reg-mask-use-to-get-pcie-speed.patch | 74 + ...issing-break-in-atom_arg_imm-case-of.patch | 48 + ...otential-out-of-bounds-access-in-amd.patch | 64 + ...dv7511-fix-crash-on-irq-during-probe.patch | 83 + ...ci-use-clk_ignore_unused-for-apq8016.patch | 49 + ...-t-treat-0-as-1-in-drm_fixp2int_ceil.patch | 41 + ...ima-fix-a-memleak-in-lima_heap_alloc.patch | 72 + ...-fix-dsi-rgb666-formats-and-definiti.patch | 78 + ...-a-null-pointer-crash-in-mtk_drm_crt.patch | 81 + ...-a6xx-specify-ubwc-config-for-sc7180.patch | 52 + queue-6.8/drm-msm-a7xx-fix-llc-typo.patch | 36 + ...division-of-drm_display_mode-s-hskew.patch | 49 + ...allow-certain-formats-for-cdm-for-dp.patch | 44 + ...msm-dpu-finalise-global-state-object.patch | 50 + ...the-programming-of-intf_cfg2_data_hc.patch | 130 + ...-enable-dsc_mode_multiplex-if-dsc_me.patch | 46 + ...101wum-nl6-make-use-of-prepare_prev_.patch | 42 + ...-panel-edp-use-put_sync-in-unprepare.patch | 44 + ...x-wrong-firmware-size-logging-in-ni_.patch | 39 + ...-rockchip-inno_hdmi-fix-video-timing.patch | 51 + ...hip-lvds-do-not-overwrite-error-code.patch | 38 + ...s-do-not-print-scary-message-when-pr.patch | 41 + ...fix-pm-disable-depth-imbalance-in-te.patch | 77 + ...d-missing-check-for-of_find_device_b.patch | 41 + ...x-missing-pm_runtime_disable-in-the-.patch | 37 + ...x-some-error-handling-paths-in-tegra.patch | 116 + ...ix-some-error-handling-paths-in-tegr.patch | 85 + ...-fix-missing-i2c_put_adapter-in-the-.patch | 75 + ...m_gem_object-ref-on-error-in-tegra_f.patch | 40 + ...x-missing-clk_put-in-the-error-handl.patch | 50 + ...x-some-error-handling-paths-in-tegra.patch | 81 + ...valid-printf-format-specifiers-in-ku.patch | 130 + ...lpers-include-missing-drm_drv-header.patch | 44 + ...-tidss-fix-initial-plane-zpos-values.patch | 56 + ...ix-sync-lost-issue-with-two-displays.patch | 64 + ...-vkms-avoid-reading-beyond-lut-array.patch | 66 + ...-a-memleak-in-vmw_gmrid_man_get_node.patch | 41 + ...mw_du_get_cursor_mob-fencing-of-newl.patch | 57 + ...-fix-ref-counting-leak-on-page-fault.patch | 44 + ...rouped-target-in-makefile-with-patte.patch | 43 + ...-printf-format-specifiers-in-xe_migr.patch | 65 + ...smmu-fix-sm8-45-50-gpu-smmu-if-condi.patch | 58 + ...qcom-mdss-include-ommited-fam-b-comp.patch | 37 + ...p-false-positives-on-initializing-er.patch | 215 + ...umber-of-blocks-in-a-current-section.patch | 67 + ...x-reserve_cblocks-counting-error-whe.patch | 132 + ...x-to-avoid-inconsistence-bewteen-i_b.patch | 146 + ...x-to-check-compress-flag-w-.i_sem-lo.patch | 53 + ...x-to-check-unreleased-compressed-clu.patch | 56 + ...x-to-check-zstd-compress-level-corre.patch | 60 + ...x-to-cover-f2fs_disable_compressed_f.patch | 63 + ...x-to-cover-normal-cluster-write-with.patch | 125 + ...x-to-guarantee-persisting-compressed.patch | 148 + ...locate-some-judgments-in-f2fs_reserv.patch | 63 + ...inter-dereference-in-f2fs_submit_pag.patch | 77 + ...void-potential-panic-during-recovery.patch | 109 + ...d-use-after-free-issue-in-f2fs_filem.patch | 77 + ...te-selinux-label-during-whiteout-ini.patch | 142 + ...ve-unnecessary-f2fs_bug_on-to-avoid-.patch | 41 + ...to-truncate-meta-inode-pages-forcely.patch | 140 + ...correct-segment-type-in-f2fs_allocat.patch | 44 + ...-fix-to-avoid-caching-unaligned-exte.patch | 130 + ...-remove-pow2-check-condition-for-zon.patch | 42 + ...-wait-completion-of-last-bio-in-zone.patch | 47 + ...hange-loglevel-when-the-power-domain.patch | 42 + ...i-fix-double-free-in-smc-transport-c.patch | 99 + queue-6.8/fs-fix-rw_hint-validation.patch | 67 + ...s-hfsplus-use-better-opf-description.patch | 42 + ...work-stack-allocation-hack-for-clang.patch | 67 + ...omadik-fix-offset-bug-in-nmk_pmx_set.patch | 57 + ...610-allow-disabling-the-vf610-driver.patch | 43 + ...sumer-device-through-to-core-in-devm.patch | 97 + ...md_sfh-avoid-disabling-the-interrupt.patch | 103 + ...update-hpd-sensor-structure-elements.patch | 44 + ...iddleclick_workaround-sysfs-knob-for.patch | 134 + ...bi-irq-depends-on-hot-join-and-sir-e.patch | 41 + ...eing-updated-by-way-too-large-values.patch | 90 + .../igb-fix-missing-time-sync-events.patch | 94 + .../igc-fix-missing-time-sync-events.patch | 108 + ...te-data-races-around-inet_diag_table.patch | 58 + ...d-support-for-iqs7222d-v1.1-and-v1.2.patch | 147 + ...ing-net-correct-the-type-of-variable.patch | 37 + ...-overflow-check-in-io_recvmsg_mshot_.patch | 54 + ...e-receive-multishot-out-of-the-gener.patch | 274 ++ ...fy-how-recvmsg-and-sendmsg-copy-in-t.patch | 330 ++ ...looping-around-handling-traditional-.patch | 126 + ...unconditional-looping-in-local-task_.patch | 165 + ...per-folio-dirty-bits-on-all-writebac.patch | 71 + ...-add-static-iommu_ops-release_domain.patch | 94 + .../iommu-amd-mark-interrupt-as-managed.patch | 69 + ...3-check-that-the-rid-domain-is-s1-in.patch | 61 + ...mpilation-without-config_iommu_intel.patch | 68 + ...-issue-ats-invalidation-request-when.patch | 203 + ...-d-fix-null-domain-on-device-release.patch | 190 + ...ve-ite-fault-handling-if-target-devi.patch | 82 + ...device-rbtree-in-iopf-reporting-path.patch | 128 + ...rbtree-to-track-iommu-probed-devices.patch | 213 + ...ct-parameter-validation-in-the-ip_mr.patch | 45 + ...flush-route-cache-when-rule-is-chang.patch | 55 + ...e-one-synchronize_net-barrier-in-ipv.patch | 43 + ...-setup-dma-masks-on-the-kunit-device.patch | 60 + ...he-correct-filter-string-in-executor.patch | 44 + ...ct-parameter-validation-in-the-pppol.patch | 47 + ...13-unlock-mutex-before-destroying-it.patch | 37 + ...-missing-timer-cleanup-and-flash-gpi.patch | 41 + ...an-invalid-format-specifier-in-an-as.patch | 43 + ...-fix-an-invalid-format-specifier-in-.patch | 51 + ...ot-fix-first-entry-having-a-0-handle.patch | 204 + ...epot-off-by-one-in-depot_fetch_stack.patch | 45 + .../libbpf-add-bpf_token_create-api.patch | 95 + ...new_split-api-that-was-declared-but-.patch | 64 + ...bpf-add-missed-btf_ext__raw_data-api.patch | 81 + ...ng-libbpf_api-annotation-to-libbpf_s.patch | 40 + ..._set_def_max_entries-for-inner_maps-.patch | 54 + ..._ctx-type-enforcement-for-perf_event.patch | 74 + ...ibbpf-fix-faccessat-usage-on-android.patch | 56 + ...n-value-for-perf_event-__arg_ctx-typ.patch | 50 + ...-use-opts_set-macro-in-bpf_xdp_query.patch | 52 + ...d_closing-when-the-raid-is-about-to-.patch | 73 + .../md-fix-kmemleak-of-rdev-serial.patch | 57 + ...ctor-out-helpers-to-add-rdev-to-conf.patch | 171 + ...fix-choose-next-idle-in-read_balance.patch | 148 + ...nonrot-rdevs-while-adding-removing-r.patch | 139 + ...i2rx-use-match-fwnode-for-media-link.patch | 40 + ...-h265-fix-configuring-bitstream-size.patch | 72 + ...s-techwell-tw9900-fix-port-schema-re.patch | 37 + ...nds-avoid-stack-overflow-warnings-wi.patch | 95 + ...dia-edia-dvbdev-fix-a-use-after-free.patch | 84 + ...otate-unchecked-call-to-media_device.patch | 42 + ...-check-of-return-value-of-go7007_rea.patch | 40 + ...fix-a-memleak-in-go7007_load_encoder.patch | 57 + .../media-i2c-imx290-fix-imx920-typo.patch | 68 + ...aler-fix-v4l2_ctrl_handler-memory-le.patch | 35 + ...a-ivsc-csi-swap-sink-and-source-pads.patch | 48 + ...codec-avoid-wcast-function-type-stri.patch | 93 + ...rusb2-fix-pvr2_stream_callback-casts.patch | 115 + ...2-fix-uaf-in-pvr2_context_set_notify.patch | 75 + ...-pvrusb2-remove-redundant-null-check.patch | 41 + ...i-di-fix-chroma-difference-threshold.patch | 36 + ...edia-sun8i-di-fix-coefficient-writes.patch | 102 + ...-sun8i-di-fix-power-on-off-sequences.patch | 88 + ...egister-v4l2-async-device-only-after.patch | 51 + ...fix-two-memleaks-in-budget_av_attach.patch | 52 + ...ve-useless-locks-in-usbtv_video_free.patch | 55 + ...ia-v4l2-cci-print-leading-0-on-error.patch | 47 + ...em-fix-a-memleak-in-v4l2_m2m_registe.patch | 48 + ...2-tpg-fix-some-memleaks-in-tpg_alloc.patch | 112 + ...add-missing-doc-comment-for-waiting_.patch | 76 + ...emory-tegra-correct-dla-client-names.patch | 107 + ...r-call-of_node_put-only-when-of_pars.patch | 42 + ...wrong-gpio_fn_sel-and-spi_clk_config.patch | 48 + ...-cs42l43-fix-wrong-register-defaults.patch | 111 + ...of_node_put-only-when-of_parse_phand.patch | 42 + ...__mips_cm_l2sync_phys_base-to-weak-f.patch | 90 + ...move-an-incorrect-release_mem_region.patch | 50 + .../modules-wait-do_free_init-correctly.patch | 125 + ...-core-fix-flash-size-larger-than-32-.patch | 39 + ...uflash-declare-uflash_devinit-static.patch | 43 + ...nand-exec_op-helper-functions-return.patch | 72 + ...pc32xx_mlc-fix-irq-handler-prototype.patch | 52 + ...d-spinand-esmt-extend-ids-to-5-bytes.patch | 68 + .../nbd-null-check-for-nla_nest_start.patch | 43 + ...v-fix-build-warning-for-ethh-set-but.patch | 49 + ...p-make-sure-drive-strength-configura.patch | 67 + .../net-ena-remove-ena_select_queue.patch | 66 + ...nel-crash-when-1588-is-received-on-h.patch | 84 + ...t-duplex-configure-error-in-imp-rese.patch | 44 + ...3-fix-wrong-judgment-condition-issue.patch | 36 + ...ke-sure-to-pull-inner-header-in-ip_t.patch | 125 + ...rrect-parameter-validation-in-the-kc.patch | 45 + ...p-copy-skb-ext-data-when-fragmenting.patch | 62 + ...822-fix-rgmii-tx-delay-configuration.patch | 91 + ...get_internal_delay-accessing-an-empt.patch | 48 + ...-an-off-by-one-in-rpc_sockaddr2uaddr.patch | 42 + ...ntf-format-specifier-in-skb_segment-.patch | 43 + ...rrect-parameter-validation-in-the-x2.patch | 47 + ...ndle-acti_netdevs-allocation-failure.patch | 45 + ...fs-fix-an-off-by-one-in-root_nfs_cat.patch | 42 + ...s_issue_read-xarray-locking-for-writ.patch | 157 + ...when-nfs4_ff_layout_prepare_ds-fails.patch | 96 + ...fsv4.1-pnfs-fix-nfs-with-tls-in-pnfs.patch | 112 + ...ix-listxattr-maximum-xdr-buffer-size.patch | 60 + ..._listxattr-kernel-bug-at-mm-usercopy.patch | 99 + ...ble-name-leak-in-ntb_register_device.patch | 85 + ...uble-free-of-struct-nvme_id_ns-in-ns.patch | 52 + ...nd_hint_-save-restore-across-basic-b.patch | 54 + .../octeontx2-af-fix-devlink-params.patch | 72 + ...ugfs-fix-warning-around-icc_get_name.patch | 50 + ...t-mounting-over-case-insensitive-dir.patch | 98 + ...ovl-relax-warn_on-in-ovl_verify_area.patch | 47 + ...rootport-attribute-paths-in-abi-docs.patch | 52 + ...-broken-brcm_pcie_mdio_write-polling.patch | 44 + ...-all-tlp-prefixes-not-just-the-first.patch | 45 + ..._is_disconnected-helper-public-for-o.patch | 67 + ...650se-root-port-extended-tags-as-bro.patch | 56 + ...-sleeping-issue-in-a-rcu-read-sectio.patch | 38 + ...x-an-error-handling-path-in-switchte.patch | 51 + ...an-up-the-generated-copied-vmlinux.h.patch | 46 + ...uplicate-initialization-of-data-id-i.patch | 38 + ...s_event-function-for-metric-style-ev.patch | 62 + ...etric-don-t-remove-scale-from-counts.patch | 51 + ...otential-memory-leak-in-perf_pmu__lo.patch | 46 + ...rf-pmu-treat-the-msr-pmu-as-software.patch | 90 + ...s-make-is_event_supported-more-robus.patch | 154 + ...k-conflict-between-timestamp-filenam.patch | 103 + ...possible-incorrect-free-in-record__s.patch | 40 + ...-srcline-add-missed-addr2line-closes.patch | 46 + .../perf-stat-avoid-metric-only-segv.patch | 43 + ...free-strlist-on-normal-path-in-threa.patch | 45 + ...ts-amd-fix-zen-4-cache-latency-event.patch | 231 ++ ...e-avoid-register-reset-when-cpu-is-d.patch | 42 + ...-qcom-qmp-usb-split-usb-c-phy-driver.patch | 1454 +++++++ ...c-add-support-for-the-type-c-handlin.patch | 205 + ...c-handle-clamp-register-in-a-correct.patch | 157 + ...-drop-bogus-slew-rate-register-range.patch | 40 + ...bogus-slew-rate-register-range.patch-14189 | 40 + ...allow-the-compiler-to-optimize-away-.patch | 53 + ...r8a779g0-add-missing-scif_clk2-pin-g.patch | 69 + ...rzg2l-fix-locking-in-rzg2l_dt_subnod.patch | 74 + ...-pmf-do-not-use-readl-for-policy-buf.patch | 46 + ...6-intel-pmc-arl-put-gna-device-in-d3.patch | 52 + ...6-intel-pmc-lnl-remove-ssram-support.patch | 105 + ...ain-qcom-rpmhpd-drop-sa8540p-gfx.lvl.patch | 39 + ...ly-mm8013-fix-not-charging-detection.patch | 78 + ...u-fix-error-check-against-freq_qos_a.patch | 41 + ...erpc-32-fix-adb_cuda-kconfig-warning.patch | 45 + ...4xx-fix-warp_gpio_leds-build-failure.patch | 43 + ...6xx-fix-no-previous-prototype-for-av.patch | 53 + ...lining-of-arch_vmap_p-u-m-d_supporte.patch | 65 + ...fix-the-h_get_perf_counter_info-hcal.patch | 118 + ...lv1-hcall-assembly-for-elfv2-calling.patch | 99 + ...fix-potential-memleak-in-papr_get_at.patch | 44 + queue-6.8/printk-add-this_cpu_in_panic.patch | 102 + ...assing-console-lock-owner-completely.patch | 116 + ...intk-nbcon-relocate-32bit-seq-macros.patch | 156 + ...ingbuffer-cleanup-reader-terminology.patch | 80 + ...r-do-not-skip-non-finalized-records-.patch | 319 ++ ...r-skip-non-finalized-records-in-pani.patch | 79 + ...r-all-reserved-records-with-pr_flush.patch | 178 + ...re-inode-only-d_invalidate-is-needed.patch | 70 + ...fix-clock-imbalance-related-to-suspe.patch | 41 + .../pwm-dwc-use-pm_sleep_ptr-macro.patch | 42 + ...ure-for-st-pwm-num-chan-st-capture-n.patch | 62 + ...x-potential-null-pointer-dereference.patch | 278 ++ ...-annotations-of-inode-dquot-pointers.patch | 253 ++ ...y-annotate-i_dquot-arrays-with-__rcu.patch | 247 ++ ...nown-device-for-choose_configuration.patch | 39 + ...expedited-parallel-grace-period-kwor.patch | 46 + ...cu-expedited-grace-period-kworker-al.patch | 128 + ...a-race-between-mad_client-and-cm_cli.patch | 133 + ...-modifying-default-congestion-contro.patch | 134 + ...ma-irdma-remove-duplicate-assignment.patch | 47 + ...b-fix-bug-in-creation-of-dma-regions.patch | 36 + ...roduce-mana_ib_get_netdev-helper-fun.patch | 273 ++ ...roduce-mana_ib_install_cq_cb-helper-.patch | 137 + ...introduce-mdev_to_gc-helper-function.patch | 294 ++ ...-virtual-address-in-dma-regions-for-.patch | 216 + ...eck-strnlen-return-len-in-sysfs-mpat.patch | 41 + ...-register-event-handler-until-srpt-d.patch | 61 + ...ace-consumer-add-module-device-table.patch | 39 + ...orward-seed-csr-access-to-user-space.patch | 61 + ...starfive-jh7100-fix-root-clock-names.patch | 61 + ...tc-test-fix-invalid-format-specifier.patch | 41 + ...e-prevent-rebuild-of-shared_cpu_list.patch | 49 + ...fix-double-module-refcount-decrement.patch | 58 + ...asd-use-dev_-for-device-log-messages.patch | 172 + ...r_event_free-upper-limit-for-pai-dev.patch | 58 + .../s390-vdso-drop-fpic-from-ldflags.patch | 66 + ...the-scheduling-domain-into-account-i.patch | 87 + ...heduling-domain-into-account-i.patch-30615 | 55 + ...ction-pointer-type-mismatch-for-hcb_.patch | 152 + ...siostor-avoid-function-pointer-casts.patch | 135 + ...x-a-deadlock-issue-related-to-automa.patch | 125 + ...-map_in_maps-with-bpf_map_type_perf_.patch | 98 + ...f-disable-ipv6-for-lwt_redirect-test.patch | 131 + ...x-potential-premature-unload-in-bpf_.patch | 62 + ...fix-the-flaky-tc_redirect_dtime-test.patch | 96 + ...ace_helpers.c-do-not-use-poisoned-ty.patch | 43 + ...it-for-the-netstamp_needed_key-stati.patch | 186 + ...orwarding-add-missing-config-entries.patch | 83 + ...ding-add-missing-multicast-routing-c.patch | 46 + queue-6.8/series | 619 +++ ...eck-return-value-on-broadcast_or-reg.patch | 41 + ...qcom-socinfo-rename-pm2250-to-pm4125.patch | 54 + ...te-data-races-around-sock_diag_handl.patch | 74 + ...m-add-missing-const-to-documentation.patch | 44 + ...parc32-do-not-select-generic_isa_dma.patch | 49 + ...x-section-mismatch-in-leon_pci_grpci.patch | 62 + ...-use-generic-cmpdi2-ucmpdi2-variants.patch | 133 + .../spi-consolidate-setting-message-spi.patch | 72 + ...ve-split-xfers-for-cs_word-emulation.patch | 119 + ...0-add-check-for-usbnet_get_endpoints.patch | 40 + ...arfive-set-16-bpp-for-capture_raw-de.patch | 60 + ...x-a-memleak-in-gss_import_v2_context.patch | 59 + ...me-memleaks-in-gssx_dec_option_array.patch | 86 + ...t-parameter-validation-in-the-do_tcp.patch | 47 + ...-test-fix-incorrect-format-specifier.patch | 40 + ...cross-timestamp-interpolation-corner.patch | 114 + ...cross-timestamp-interpolation-for-no.patch | 58 + ...cross-timestamp-interpolation-on-cou.patch | 43 + ...fids-fix-cross-compilation-to-non-ho.patch | 121 + ...fids-refactor-set-sorting-with-types.patch | 145 + ...dc-fix-passing-incompatible-pointer-.patch | 51 + ...t-parameter-validation-in-the-udp_li.patch | 47 + ...e-check-pm_runtime_enabled-before-de.patch | 51 + ...tm32_iwdg-initialize-default-timeout.patch | 59 + ...null-pointer-dereference-in-ath10k_w.patch | 42 + ...support-to-select-6-ghz-regulatory-t.patch | 160 + ...ge-to-move-wmi_vdev_param_set_hemu_m.patch | 98 + ...a-possible-dead-lock-caused-by-ab-ba.patch | 75 + ...ialize-rx_mcs_80-and-rx_mcs_160-befo.patch | 71 + ...e-cur_regulatory_info-for-each-radio.patch | 467 +++ ...k-fix-fetching-mcbc-flag-for-qcn9274.patch | 62 + ...incorrect-logic-of-calculating-vdev_.patch | 49 + ...2k-fix-issues-in-channel-list-update.patch | 101 + ...-all-of-ath9k_wmi_event_tasklet-unti.patch | 124 + .../wifi-b43-disable-qos-for-bcm4331.patch | 68 + ...rrect-queue-in-dma-worker-when-qos-i.patch | 66 + ...ke-correct-queue-in-dma-tx-path-when.patch | 167 + ...ke-correct-queue-in-pio-tx-path-when.patch | 59 + ...211-handle-pmk_op-allocation-failure.patch | 44 + ...rcmsmac-avoid-function-pointer-casts.patch | 81 + ...dd-rnr-with-reporting-ap-information.patch | 300 ++ ...t-correct-param-change-count-in-ml-e.patch | 105 + .../wifi-iwlwifi-acpi-fix-wpfc-reading.patch | 73 + ...ifi-iwlwifi-always-have-uats_enabled.patch | 42 + ...i-change-link-id-in-time-event-to-s8.patch | 80 + ...lwifi-dbg-tlv-ensure-nul-termination.patch | 43 + ...wlwifi-fix-ewrd-table-validity-check.patch | 44 + ...fi-iwlwifi-mvm-d3-fix-ipn-byte-order.patch | 57 + ...vm-don-t-set-replay-counters-to-0xff.patch | 52 + ...m-don-t-set-the-mfp-flag-for-the-gtk.patch | 74 + ...i-mvm-fix-erroneous-queue-index-mask.patch | 68 + ...vm-fix-the-listener-mac-filter-flags.patch | 37 + ...vm-fix-the-tlc-command-after-add_sta.patch | 54 + ...i-mvm-initialize-rates-in-fw-earlier.patch | 56 + ...vm-report-beacon-protection-failures.patch | 105 + ...ifi-properly-check-if-link-is-active.patch | 43 + ...ead-bios-pnvm-only-for-non-intel-sku.patch | 70 + .../wifi-iwlwifi-support-eht-for-wh.patch | 37 + ...x-some-memleaks-in-lbs_allocate_cmd_.patch | 57 + ...e-deflink-and-fix-typo-in-link-id-ch.patch | 44 + ...e-issue-of-missing-txpwr-settings-fr.patch | 38 + ...-fix-incorrect-type-conversion-for-c.patch | 47 + ...7921e-fix-use-after-free-in-free_irq.patch | 92 + ...-add-flow-to-avoid-chip-bt-function-.patch | 54 + ...-add-support-to-set-ifs-time-by-mcu-.patch | 136 + ...-fix-connect-to-80211b-mode-fail-in-.patch | 40 + ...ifi-mt76-mt7925-fix-fw-download-fail.patch | 35 + ...76-mt7925-fix-mcu-query-command-fail.patch | 46 + ...-fix-sap-no-beacon-issue-in-5ghz-and.patch | 93 + ...-fix-the-wrong-header-translation-co.patch | 92 + ...fi-mt76-mt7925-fix-wmm-queue-mapping.patch | 76 + ...925-fix-wow-failed-in-encrypted-mode.patch | 301 ++ ...mt76-mt7925-update-pcie-dma-settings.patch | 92 + ...7925e-fix-use-after-free-in-free_irq.patch | 38 + ...-fix-a-potential-loading-failure-of-.patch | 83 + ...wifi-mt76-mt792x-fix-ethtool-warning.patch | 35 + ...-check-txs-format-before-getting-skb.patch | 68 + ...-mt76-mt7996-fix-efuse-reading-issue.patch | 37 + ...i-mt76-mt7996-fix-fw-loading-timeout.patch | 48 + ...-fix-he-beamformer-phy-cap-for-stati.patch | 43 + ...i-mt76-mt7996-fix-hif_txd_v2_1-value.patch | 37 + ...-fix-incorrect-interpretation-of-eht.patch | 61 + .../wifi-mt76-mt7996-fix-twt-issues.patch | 137 + ...ugfs-drop-unnecessary-error-check-fo.patch | 46 + ...add-cancel_work_sync-for-c2hcmd_work.patch | 37 + ...8821c-fix-beacon-loss-and-disconnect.patch | 86 + ...fi-rtw88-8821c-fix-false-alarm-count.patch | 40 + ...tw88-8821cu-fix-firmware-upload-fail.patch | 96 + ...wfx-fix-memory-leak-when-starting-ap.patch | 123 + ...-not-realloc-workqueue-everytime-an-.patch | 123 + ...i-wilc1000-fix-declarations-ordering.patch | 49 + ...x-multi-vif-management-when-deleting.patch | 54 + ...lc1000-fix-rcu-usage-in-connect-path.patch | 176 + ...event-use-after-free-on-vif-when-cle.patch | 172 + ...ilc1000-revert-reset-line-logic-flip.patch | 70 + ...call-cpumask_test_cpu-with-1-cpu-in-.patch | 61 + .../workqueue-factor-out-pwq_is_empty.patch | 75 + ...ent-system-wide-nr_active-enforcemen.patch | 753 ++++ ...e-introduce-struct-wq_node_nr_active.patch | 306 ++ ...q_adjust_max_active-round-robin-pwqs.patch | 82 + ...move-nr_active-handling-into-helpers.patch | 183 + ...move-pwq-max_active-to-wq-max_active.patch | 299 ++ ...otect-wq-dfl_pwq-and-implement-acces.patch | 184 + ...e-pwq_activate_inactive_work-with-__.patch | 93 + ...eue.c-increase-workqueue-name-length.patch | 60 + ...he-__iomem-annotation-of-movdir64b-s.patch | 117 + ...put-to-pfn_to_kaddr-is-treated-as-a-.patch | 73 + ...ignore-relocations-in-.notes-section.patch | 54 + ...ement-new-mba_mbps-throttling-heuris.patch | 162 + ...-supported-bandwidth-sources-from-cp.patch | 119 + ...ve-hard-coded-memory-bandwidth-limit.patch | 79 + ...ry-encryption-setting-if-enabled-by-.patch | 82 + 620 files changed, 53916 insertions(+) create mode 100644 queue-6.8/acpi-cppc-enable-amd-cppc-v2-support-for-family-17h-.patch create mode 100644 queue-6.8/acpi-hmat-remove-register-of-memory-node-for-generic.patch create mode 100644 queue-6.8/acpi-processor_idle-fix-memory-leak-in-acpi_processo.patch create mode 100644 queue-6.8/acpi-resource-add-maibenben-x577-to-irq1_edge_low_fo.patch create mode 100644 queue-6.8/acpi-resource-do-irq-override-on-lunnen-ground-lapto.patch create mode 100644 queue-6.8/acpi-scan-fix-device-check-notification-handling.patch create mode 100644 queue-6.8/af_unix-annotate-data-race-of-gc_in_progress-in-wait.patch create mode 100644 queue-6.8/afs-don-t-cache-preferred-address.patch create mode 100644 queue-6.8/afs-fix-occasional-rmdir-then-vnovnode-with-generic-.patch create mode 100644 queue-6.8/afs-revert-afs-hide-silly-rename-files-from-userspac.patch create mode 100644 queue-6.8/alsa-hda-cs35l41-set-channel-index-correctly-when-sy.patch create mode 100644 queue-6.8/alsa-hda-realtek-fix-alc285-issues-on-hp-envy-x360-l.patch create mode 100644 queue-6.8/alsa-hda-tas2781-add-lock-to-system_suspend.patch create mode 100644 queue-6.8/alsa-hda-tas2781-do-not-call-pm_runtime_force_-in-sy.patch create mode 100644 queue-6.8/alsa-hda-tas2781-do-not-reset-cur_-values-in-runtime.patch create mode 100644 queue-6.8/alsa-hda-tas2781-restore-power-state-after-system_re.patch create mode 100644 queue-6.8/alsa-hda-tas2781-use-dev_dbg-in-system_resume.patch create mode 100644 queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-4i4-low-voltage-.patch create mode 100644 queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-autogain-status-.patch create mode 100644 queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch create mode 100644 queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch-21200 create mode 100644 queue-6.8/alsa-seq-fix-function-cast-warnings.patch create mode 100644 queue-6.8/alsa-usb-audio-stop-parsing-channels-bits-when-all-c.patch create mode 100644 queue-6.8/aoe-fix-the-potential-use-after-free-problem-in-aoec.patch create mode 100644 queue-6.8/arch-powerpc-remove-linux-fb.h-from-backlight-code.patch create mode 100644 queue-6.8/arm-dts-arm-realview-fix-development-chip-rom-compat.patch create mode 100644 queue-6.8/arm-dts-imx6dl-yapp4-fix-typo-in-the-qca-switch-regi.patch create mode 100644 queue-6.8/arm-dts-imx6dl-yapp4-move-the-internal-switch-phys-u.patch create mode 100644 queue-6.8/arm-dts-qcom-msm8974-correct-qfprom-node-size.patch create mode 100644 queue-6.8/arm-dts-renesas-r8a73a4-fix-external-clocks-and-cloc.patch create mode 100644 queue-6.8/arm64-dts-allwinner-h6-add-rx-dma-channel-for-spdif.patch create mode 100644 queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch create mode 100644 queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch-27736 create mode 100644 queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch create mode 100644 queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch-24016 create mode 100644 queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch create mode 100644 queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch-1464 create mode 100644 queue-6.8/arm64-dts-imx8mm-kontron-fix-interrupt-for-rtc-on-os.patch create mode 100644 queue-6.8/arm64-dts-imx8mm-venice-gw71xx-fix-usb-otg-vbus.patch create mode 100644 queue-6.8/arm64-dts-imx8mp-evk-fix-hdmi-3d-node.patch create mode 100644 queue-6.8/arm64-dts-imx8mp-set-spi-nor-to-max-40-mhz-on-data-m.patch create mode 100644 queue-6.8/arm64-dts-imx8qm-align-edma3-power-domains-resources.patch create mode 100644 queue-6.8/arm64-dts-imx8qm-correct-edma3-power-domains-and-int.patch create mode 100644 queue-6.8/arm64-dts-marvell-reorder-crypto-interrupts-on-armad.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt7622-add-missing-device_type-to.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt7986-add-reset-cells-to-infracf.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt7986-drop-clock-cells-from-pwm.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt7986-drop-crypto-s-unneeded-inv.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt7986-fix-reference-to-pwm-in-fa.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-bus-width-properti.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-nodename.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt8186-add-missing-clocks-to-ssus.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt8186-add-missing-xhci-clock-to-.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt8186-fix-venc-power-domain-cloc.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt8192-asurada-remove-crosec-base.patch create mode 100644 queue-6.8/arm64-dts-mediatek-mt8192-fix-vencoder-clock-name.patch create mode 100644 queue-6.8/arm64-dts-mt8183-move-crosec-base-detection-node-to-.patch create mode 100644 queue-6.8/arm64-dts-mt8195-cherry-tomato-change-watchdog-reset.patch create mode 100644 queue-6.8/arm64-dts-qcom-msm8996-define-ufs-unipro-clock-limit.patch create mode 100644 queue-6.8/arm64-dts-qcom-msm8996-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-msm8998-declare-vls-clamp-register-fo.patch create mode 100644 queue-6.8/arm64-dts-qcom-msm8998-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-qcm2290-declare-vls-clamp-register-fo.patch create mode 100644 queue-6.8/arm64-dts-qcom-qcm6490-fairphone-fp5-add-missing-res.patch create mode 100644 queue-6.8/arm64-dts-qcom-qcm6490-idp-correct-the-voltage-setti.patch create mode 100644 queue-6.8/arm64-dts-qcom-qcs6490-rb3gen2-correct-the-voltage-s.patch create mode 100644 queue-6.8/arm64-dts-qcom-rename-pm2250-to-pm4125.patch create mode 100644 queue-6.8/arm64-dts-qcom-sa8540p-drop-gfx.lvl-as-power-domain-.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc7280-add-static-properties-to-crypt.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-mdp_cfg-path.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-off-state.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-don-t-hold-mdp-core-clock-at-.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-fix-edp-phy-power-domains.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-fix-up-big-cpu-idle-state-ent.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-hook-up-vdd_cx-as-gcc-parent-.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-require-low_svs-vote-for-mmcx.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8180x-shrink-aoss_qmp-register-spac.patch create mode 100644 queue-6.8/arm64-dts-qcom-sc8280xp-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sdm845-db845c-correct-pcie-wake-gpios.patch create mode 100644 queue-6.8/arm64-dts-qcom-sdm845-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sdm845-oneplus-common-improve-dai-nod.patch create mode 100644 queue-6.8/arm64-dts-qcom-sdm845-use-the-low-power-island-cx-mx.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm6115-declare-vls-clamp-register-for.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm6115-drop-pipe-clock-selection.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm6115-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm6125-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm6350-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8150-correct-pcie-wake-gpios.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8150-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8250-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8350-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8450-add-missing-interconnects-to-s.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8550-fix-spmi-channels-size.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8550-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8650-fix-spmi-channels-size.patch create mode 100644 queue-6.8/arm64-dts-qcom-sm8650-fix-ufs-phy-clocks.patch create mode 100644 queue-6.8/arm64-dts-qcom-x1e80100-drop-qcom-drv-count.patch create mode 100644 queue-6.8/arm64-dts-qcom-x1e80100-qcp-fix-supplies-for-ldos-3e.patch create mode 100644 queue-6.8/arm64-dts-renesas-r8a779a0-correct-avb-01-reg-sizes.patch create mode 100644 queue-6.8/arm64-dts-renesas-r8a779g0-add-missing-scif_clk2.patch create mode 100644 queue-6.8/arm64-dts-renesas-r8a779g0-correct-avb-01-reg-sizes.patch create mode 100644 queue-6.8/arm64-dts-renesas-r8a779g0-restore-sort-order.patch create mode 100644 queue-6.8/arm64-dts-renesas-r9a08g045-add-missing-interrupts-t.patch create mode 100644 queue-6.8/arm64-dts-renesas-rzg2l-add-missing-interrupts-to-ir.patch create mode 100644 queue-6.8/arm64-dts-renesas-rzg3s-smarc-som-guard-ethernet-irq.patch create mode 100644 queue-6.8/arm64-dts-rockchip-add-missing-interrupt-names-for-r.patch create mode 100644 queue-6.8/arm64-dts-rockchip-drop-rockchip-trcm-sync-tx-only-f.patch create mode 100644 queue-6.8/arm64-dts-rockchip-fix-reset-names-for-rk356x-i2s2-c.patch create mode 100644 queue-6.8/arm64-dts-ti-add-common1-register-space-for-am62x-so.patch create mode 100644 queue-6.8/arm64-dts-ti-add-common1-register-space-for-am65x-so.patch create mode 100644 queue-6.8/arm64-dts-ti-am65x-fix-dtbs_install-for-rocktech-old.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-am62-main-disable-usb-lpm.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-am62p-fix-memory-ranges-for-dmss.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-am62p-mcu-wakeup-disable-mcu-and-wak.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-am62p5-sk-enable-cpsw-mdio-node.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-am64-main-fix-itap-otap-values-for-m.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-am69-sk-fix-pmic-interrupt-number.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-am69-sk-remove-assigned-clock-parent.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-modify-pinmu.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-remove-clock.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j721e-fix-mux-reg-masks-in-hbmc_mux.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j721e-sk-fix-pmic-interrupt-number.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j721s2-common-proc-board-remove-pinm.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j721s2-fix-power-domain-for-vtm-node.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j784s4-evm-remove-pinmux-for-cts-and.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j784s4-fix-power-domain-for-vtm-node.patch create mode 100644 queue-6.8/arm64-dts-ti-k3-j784s4-main-fix-mux-reg-masks-in-ser.patch create mode 100644 queue-6.8/arm64-ftrace-don-t-forbid-call_ops-cc_optimize_for_s.patch create mode 100644 queue-6.8/asoc-amd-acp-add-missing-error-handling-in-sof-mach.patch create mode 100644 queue-6.8/asoc-intel-ssp-common-add-stub-for-sof_ssp_get_codec.patch create mode 100644 queue-6.8/asoc-meson-aiu-fix-function-pointer-type-mismatch.patch create mode 100644 queue-6.8/asoc-meson-axg-tdm-interface-add-frame-rate-constrai.patch create mode 100644 queue-6.8/asoc-meson-axg-tdm-interface-fix-mclk-setup-without-.patch create mode 100644 queue-6.8/asoc-meson-t9015-fix-function-pointer-type-mismatch.patch create mode 100644 queue-6.8/asoc-sh-rz-ssi-fix-error-message-print.patch create mode 100644 queue-6.8/asoc-sof-add-some-bounds-checking-to-firmware-data.patch create mode 100644 queue-6.8/asoc-sof-amd-compute-file-paths-on-firmware-load.patch create mode 100644 queue-6.8/asoc-sof-amd-fix-memory-leak-in-amd_sof_acp_probe.patch create mode 100644 queue-6.8/asoc-sof-core-skip-firmware-test-for-custom-loaders.patch create mode 100644 queue-6.8/backlight-da9052-fully-initialize-backlight_properti.patch create mode 100644 queue-6.8/backlight-hx8357-fix-potential-null-pointer-derefere.patch create mode 100644 queue-6.8/backlight-ktz8866-correct-the-check-for-of_property_.patch create mode 100644 queue-6.8/backlight-lm3630a-don-t-set-bl-props.brightness-in-g.patch create mode 100644 queue-6.8/backlight-lm3630a-initialize-backlight_properties-on.patch create mode 100644 queue-6.8/backlight-lm3639-fully-initialize-backlight_properti.patch create mode 100644 queue-6.8/backlight-lp8788-fully-initialize-backlight_properti.patch create mode 100644 queue-6.8/block-fix-deadlock-between-bd_link_disk_holder-and-p.patch create mode 100644 queue-6.8/bluetooth-af_bluetooth-fix-deadlock.patch create mode 100644 queue-6.8/bluetooth-btrtl-fix-out-of-bounds-memory-access.patch create mode 100644 queue-6.8/bluetooth-btusb-fix-memory-leak.patch create mode 100644 queue-6.8/bluetooth-fix-eir-name-length.patch create mode 100644 queue-6.8/bluetooth-fix-use-after-free-in-accessing-skb-after-.patch create mode 100644 queue-6.8/bluetooth-hci_core-cancel-request-on-command-timeout.patch create mode 100644 queue-6.8/bluetooth-hci_core-fix-possible-buffer-overflow.patch create mode 100644 queue-6.8/bluetooth-hci_event-fix-not-indicating-new-connectio.patch create mode 100644 queue-6.8/bluetooth-hci_h5-add-ability-to-allocate-memory-for-.patch create mode 100644 queue-6.8/bluetooth-hci_qca-don-t-use-is_err_or_null-with-gpio.patch create mode 100644 queue-6.8/bluetooth-hci_sync-fix-overwriting-request-callback.patch create mode 100644 queue-6.8/bluetooth-mgmt-remove-leftover-queuing-of-power_off-.patch create mode 100644 queue-6.8/bluetooth-msft-fix-memory-leak.patch create mode 100644 queue-6.8/bluetooth-remove-bt_hs.patch create mode 100644 queue-6.8/bluetooth-remove-hci_power_off_timeout.patch create mode 100644 queue-6.8/bluetooth-remove-superfluous-call-to-hci_conn_check_.patch create mode 100644 queue-6.8/bpf-don-t-emit-warnings-intended-for-global-subprogs.patch create mode 100644 queue-6.8/bpf-don-t-infer-ptr_to_ctx-for-programs-with-unnamed.patch create mode 100644 queue-6.8/bpf-fix-devmap_hash-overflow-check-on-32-bit-arches.patch create mode 100644 queue-6.8/bpf-fix-hashtab-overflow-check-on-32-bit-arches.patch create mode 100644 queue-6.8/bpf-fix-stackmap-overflow-check-on-32-bit-arches.patch create mode 100644 queue-6.8/bpf-hardcode-bpf_prog_pack_size-to-2mb-num_possible_.patch create mode 100644 queue-6.8/bpf-make-sure-scalar-args-don-t-accept-__arg_nonnull.patch create mode 100644 queue-6.8/bpf-mark-bpf_spin_-lock-unlock-helpers-with-notrace-.patch create mode 100644 queue-6.8/bpftool-fix-wrong-free-call-in-do_show_link.patch create mode 100644 queue-6.8/bpftool-silence-build-warning-about-calloc.patch create mode 100644 queue-6.8/btrfs-fix-race-when-detecting-delalloc-ranges-during.patch create mode 100644 queue-6.8/bus-tegra-aconnect-update-dependency-to-arch_tegra.patch create mode 100644 queue-6.8/can-m_can-start-cancel-polling-timer-together-with-i.patch create mode 100644 queue-6.8/cifs-fix-writeback-data-corruption.patch create mode 100644 queue-6.8/clk-fix-clk_core_get-null-dereference.patch create mode 100644 queue-6.8/clk-hisilicon-hi3519-release-the-correct-number-of-g.patch create mode 100644 queue-6.8/clk-hisilicon-hi3559a-fix-an-erroneous-devm_kfree.patch create mode 100644 queue-6.8/clk-imx-imx8mp-fix-sai_mclk_sel-definition.patch create mode 100644 queue-6.8/clk-mediatek-mt7622-apmixedsys-fix-an-error-handling.patch create mode 100644 queue-6.8/clk-mediatek-mt7981-topckgen-flag-sgm_reg_sel-as-cri.patch create mode 100644 queue-6.8/clk-mediatek-mt8135-fix-an-error-handling-path-in-cl.patch create mode 100644 queue-6.8/clk-mediatek-mt8183-correct-parent-of-clk_infra_sspm.patch create mode 100644 queue-6.8/clk-meson-add-missing-clocks-to-axg_clk_regmaps.patch create mode 100644 queue-6.8/clk-qcom-dispcc-sdm845-adjust-internal-gdsc-wait-tim.patch create mode 100644 queue-6.8/clk-qcom-gcc-ipq5018-fix-enable_reg-offset-of-gcc_gm.patch create mode 100644 queue-6.8/clk-qcom-gcc-ipq5018-fix-halt_reg-offset-of-gcc_pcie.patch create mode 100644 queue-6.8/clk-qcom-gcc-ipq5018-fix-register-offset-for-gcc_ubi.patch create mode 100644 queue-6.8/clk-qcom-reset-commonize-the-de-assert-functions.patch create mode 100644 queue-6.8/clk-qcom-reset-ensure-write-completion-on-reset-de-a.patch create mode 100644 queue-6.8/clk-renesas-r8a779f0-correct-pfc-gpio-parent-clock.patch create mode 100644 queue-6.8/clk-renesas-r8a779g0-correct-pfc-gpio-parent-clocks.patch create mode 100644 queue-6.8/clk-renesas-r8a779g0-fix-pcie-clock-name.patch create mode 100644 queue-6.8/clk-renesas-r9a07g04-34-use-sel_sdhi1_sts-status-con.patch create mode 100644 queue-6.8/clk-samsung-exynos850-propagate-spi-ipclk-rate-chang.patch create mode 100644 queue-6.8/clk-zynq-prevent-null-pointer-dereference-caused-by-.patch create mode 100644 queue-6.8/cpufreq-brcmstb-avs-cpufreq-add-check-for-cpufreq_cp.patch create mode 100644 queue-6.8/cpufreq-mediatek-hw-don-t-error-out-if-supply-is-not.patch create mode 100644 queue-6.8/cpufreq-mediatek-hw-wait-for-cpu-supplies-before-pro.patch create mode 100644 queue-6.8/cpufreq-qcom-hw-add-config_common_clk-dependency.patch create mode 100644 queue-6.8/crypto-arm-sha-fix-function-cast-warnings.patch create mode 100644 queue-6.8/crypto-ccp-avoid-discarding-errors-in-psp_send_platf.patch create mode 100644 queue-6.8/crypto-jitter-fix-crypto_jitterentropy-help-text.patch create mode 100644 queue-6.8/crypto-qat-avoid-division-by-zero.patch create mode 100644 queue-6.8/crypto-qat-avoid-memcpy-overflow-warning.patch create mode 100644 queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-420xx.patch create mode 100644 queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-4xxx.patch create mode 100644 queue-6.8/crypto-qat-remove-double-initialization-of-value.patch create mode 100644 queue-6.8/crypto-qat-remove-unused-macros-in-qat_comp_alg.c.patch create mode 100644 queue-6.8/crypto-qat-removed-unused-macro-in-adf_cnv_dbgfs.c.patch create mode 100644 queue-6.8/crypto-xilinx-call-finalize-with-bh-disabled.patch create mode 100644 queue-6.8/cxl-fix-the-incorrect-assignment-of-sslbis-entry-poi.patch create mode 100644 queue-6.8/devlink-fix-length-of-eswitch-inline-mode.patch create mode 100644 queue-6.8/dm-call-the-resume-method-on-internal-suspend.patch create mode 100644 queue-6.8/dm-raid-fix-false-positive-for-requeue-needed-during.patch create mode 100644 queue-6.8/dmaengine-tegra210-adma-update-dependency-to-arch_te.patch create mode 100644 queue-6.8/do_sys_name_to_handle-use-kzalloc-to-fix-kernel-info.patch create mode 100644 queue-6.8/dpll-fix-dpll_xa_ref_-_del-for-multiple-registration.patch create mode 100644 queue-6.8/dpll-spec-use-proper-enum-for-pin-capabilities-attri.patch create mode 100644 queue-6.8/drivers-ps3-select-video-to-provide-cmdline-function.patch create mode 100644 queue-6.8/drm-amd-display-add-replay-null-check-in-edp_set_rep.patch create mode 100644 queue-6.8/drm-amd-display-fix-a-potential-buffer-overflow-in-d.patch create mode 100644 queue-6.8/drm-amd-display-fix-null-checks-for-adev-dm.dc-in-am.patch create mode 100644 queue-6.8/drm-amd-display-fix-potential-null-pointer-dereferen.patch create mode 100644 queue-6.8/drm-amd-pm-fix-esm-reg-mask-use-to-get-pcie-speed.patch create mode 100644 queue-6.8/drm-amdgpu-fix-missing-break-in-atom_arg_imm-case-of.patch create mode 100644 queue-6.8/drm-amdgpu-fix-potential-out-of-bounds-access-in-amd.patch create mode 100644 queue-6.8/drm-bridge-adv7511-fix-crash-on-irq-during-probe.patch create mode 100644 queue-6.8/drm-ci-use-clk_ignore_unused-for-apq8016.patch create mode 100644 queue-6.8/drm-don-t-treat-0-as-1-in-drm_fixp2int_ceil.patch create mode 100644 queue-6.8/drm-lima-fix-a-memleak-in-lima_heap_alloc.patch create mode 100644 queue-6.8/drm-mediatek-dsi-fix-dsi-rgb666-formats-and-definiti.patch create mode 100644 queue-6.8/drm-mediatek-fix-a-null-pointer-crash-in-mtk_drm_crt.patch create mode 100644 queue-6.8/drm-msm-a6xx-specify-ubwc-config-for-sc7180.patch create mode 100644 queue-6.8/drm-msm-a7xx-fix-llc-typo.patch create mode 100644 queue-6.8/drm-msm-dpu-add-division-of-drm_display_mode-s-hskew.patch create mode 100644 queue-6.8/drm-msm-dpu-allow-certain-formats-for-cdm-for-dp.patch create mode 100644 queue-6.8/drm-msm-dpu-finalise-global-state-object.patch create mode 100644 queue-6.8/drm-msm-dpu-fix-the-programming-of-intf_cfg2_data_hc.patch create mode 100644 queue-6.8/drm-msm-dpu-only-enable-dsc_mode_multiplex-if-dsc_me.patch create mode 100644 queue-6.8/drm-panel-boe-tv101wum-nl6-make-use-of-prepare_prev_.patch create mode 100644 queue-6.8/drm-panel-edp-use-put_sync-in-unprepare.patch create mode 100644 queue-6.8/drm-radeon-ni-fix-wrong-firmware-size-logging-in-ni_.patch create mode 100644 queue-6.8/drm-rockchip-inno_hdmi-fix-video-timing.patch create mode 100644 queue-6.8/drm-rockchip-lvds-do-not-overwrite-error-code.patch create mode 100644 queue-6.8/drm-rockchip-lvds-do-not-print-scary-message-when-pr.patch create mode 100644 queue-6.8/drm-tegra-dpaux-fix-pm-disable-depth-imbalance-in-te.patch create mode 100644 queue-6.8/drm-tegra-dsi-add-missing-check-for-of_find_device_b.patch create mode 100644 queue-6.8/drm-tegra-dsi-fix-missing-pm_runtime_disable-in-the-.patch create mode 100644 queue-6.8/drm-tegra-dsi-fix-some-error-handling-paths-in-tegra.patch create mode 100644 queue-6.8/drm-tegra-hdmi-fix-some-error-handling-paths-in-tegr.patch create mode 100644 queue-6.8/drm-tegra-output-fix-missing-i2c_put_adapter-in-the-.patch create mode 100644 queue-6.8/drm-tegra-put-drm_gem_object-ref-on-error-in-tegra_f.patch create mode 100644 queue-6.8/drm-tegra-rgb-fix-missing-clk_put-in-the-error-handl.patch create mode 100644 queue-6.8/drm-tegra-rgb-fix-some-error-handling-paths-in-tegra.patch create mode 100644 queue-6.8/drm-tests-fix-invalid-printf-format-specifiers-in-ku.patch create mode 100644 queue-6.8/drm-tests-helpers-include-missing-drm_drv-header.patch create mode 100644 queue-6.8/drm-tidss-fix-initial-plane-zpos-values.patch create mode 100644 queue-6.8/drm-tidss-fix-sync-lost-issue-with-two-displays.patch create mode 100644 queue-6.8/drm-vkms-avoid-reading-beyond-lut-array.patch create mode 100644 queue-6.8/drm-vmwgfx-fix-a-memleak-in-vmw_gmrid_man_get_node.patch create mode 100644 queue-6.8/drm-vmwgfx-fix-vmw_du_get_cursor_mob-fencing-of-newl.patch create mode 100644 queue-6.8/drm-xe-fix-ref-counting-leak-on-page-fault.patch create mode 100644 queue-6.8/drm-xe-replace-grouped-target-in-makefile-with-patte.patch create mode 100644 queue-6.8/drm-xe-tests-fix-printf-format-specifiers-in-xe_migr.patch create mode 100644 queue-6.8/dt-bindings-arm-smmu-fix-sm8-45-50-gpu-smmu-if-condi.patch create mode 100644 queue-6.8/dt-bindings-msm-qcom-mdss-include-ommited-fam-b-comp.patch create mode 100644 queue-6.8/erofs-fix-lockdep-false-positives-on-initializing-er.patch create mode 100644 queue-6.8/f2fs-check-number-of-blocks-in-a-current-section.patch create mode 100644 queue-6.8/f2fs-compress-fix-reserve_cblocks-counting-error-whe.patch create mode 100644 queue-6.8/f2fs-compress-fix-to-avoid-inconsistence-bewteen-i_b.patch create mode 100644 queue-6.8/f2fs-compress-fix-to-check-compress-flag-w-.i_sem-lo.patch create mode 100644 queue-6.8/f2fs-compress-fix-to-check-unreleased-compressed-clu.patch create mode 100644 queue-6.8/f2fs-compress-fix-to-check-zstd-compress-level-corre.patch create mode 100644 queue-6.8/f2fs-compress-fix-to-cover-f2fs_disable_compressed_f.patch create mode 100644 queue-6.8/f2fs-compress-fix-to-cover-normal-cluster-write-with.patch create mode 100644 queue-6.8/f2fs-compress-fix-to-guarantee-persisting-compressed.patch create mode 100644 queue-6.8/f2fs-compress-relocate-some-judgments-in-f2fs_reserv.patch create mode 100644 queue-6.8/f2fs-fix-null-pointer-dereference-in-f2fs_submit_pag.patch create mode 100644 queue-6.8/f2fs-fix-to-avoid-potential-panic-during-recovery.patch create mode 100644 queue-6.8/f2fs-fix-to-avoid-use-after-free-issue-in-f2fs_filem.patch create mode 100644 queue-6.8/f2fs-fix-to-create-selinux-label-during-whiteout-ini.patch create mode 100644 queue-6.8/f2fs-fix-to-remove-unnecessary-f2fs_bug_on-to-avoid-.patch create mode 100644 queue-6.8/f2fs-fix-to-truncate-meta-inode-pages-forcely.patch create mode 100644 queue-6.8/f2fs-fix-to-use-correct-segment-type-in-f2fs_allocat.patch create mode 100644 queue-6.8/f2fs-ro-compress-fix-to-avoid-caching-unaligned-exte.patch create mode 100644 queue-6.8/f2fs-zone-fix-to-remove-pow2-check-condition-for-zon.patch create mode 100644 queue-6.8/f2fs-zone-fix-to-wait-completion-of-last-bio-in-zone.patch create mode 100644 queue-6.8/fbdev-simplefb-change-loglevel-when-the-power-domain.patch create mode 100644 queue-6.8/firmware-arm_scmi-fix-double-free-in-smc-transport-c.patch create mode 100644 queue-6.8/fs-fix-rw_hint-validation.patch create mode 100644 queue-6.8/fs-hfsplus-use-better-opf-description.patch create mode 100644 queue-6.8/fs-select-rework-stack-allocation-hack-for-clang.patch create mode 100644 queue-6.8/gpio-nomadik-fix-offset-bug-in-nmk_pmx_set.patch create mode 100644 queue-6.8/gpio-vf610-allow-disabling-the-vf610-driver.patch create mode 100644 queue-6.8/gpiolib-pass-consumer-device-through-to-core-in-devm.patch create mode 100644 queue-6.8/hid-amd_sfh-avoid-disabling-the-interrupt.patch create mode 100644 queue-6.8/hid-amd_sfh-update-hpd-sensor-structure-elements.patch create mode 100644 queue-6.8/hid-lenovo-add-middleclick_workaround-sysfs-knob-for.patch create mode 100644 queue-6.8/i3c-dw-disable-ibi-irq-depends-on-hot-join-and-sir-e.patch create mode 100644 queue-6.8/ice-fix-stats-being-updated-by-way-too-large-values.patch create mode 100644 queue-6.8/igb-fix-missing-time-sync-events.patch create mode 100644 queue-6.8/igc-fix-missing-time-sync-events.patch create mode 100644 queue-6.8/inet_diag-annotate-data-races-around-inet_diag_table.patch create mode 100644 queue-6.8/input-iqs7222-add-support-for-iqs7222d-v1.1-and-v1.2.patch create mode 100644 queue-6.8/io_uring-net-correct-the-type-of-variable.patch create mode 100644 queue-6.8/io_uring-net-fix-overflow-check-in-io_recvmsg_mshot_.patch create mode 100644 queue-6.8/io_uring-net-move-receive-multishot-out-of-the-gener.patch create mode 100644 queue-6.8/io_uring-net-unify-how-recvmsg-and-sendmsg-copy-in-t.patch create mode 100644 queue-6.8/io_uring-remove-looping-around-handling-traditional-.patch create mode 100644 queue-6.8/io_uring-remove-unconditional-looping-in-local-task_.patch create mode 100644 queue-6.8/iomap-clear-the-per-folio-dirty-bits-on-all-writebac.patch create mode 100644 queue-6.8/iommu-add-static-iommu_ops-release_domain.patch create mode 100644 queue-6.8/iommu-amd-mark-interrupt-as-managed.patch create mode 100644 queue-6.8/iommu-arm-smmu-v3-check-that-the-rid-domain-is-s1-in.patch create mode 100644 queue-6.8/iommu-fix-compilation-without-config_iommu_intel.patch create mode 100644 queue-6.8/iommu-vt-d-don-t-issue-ats-invalidation-request-when.patch create mode 100644 queue-6.8/iommu-vt-d-fix-null-domain-on-device-release.patch create mode 100644 queue-6.8/iommu-vt-d-improve-ite-fault-handling-if-target-devi.patch create mode 100644 queue-6.8/iommu-vt-d-use-device-rbtree-in-iopf-reporting-path.patch create mode 100644 queue-6.8/iommu-vt-d-use-rbtree-to-track-iommu-probed-devices.patch create mode 100644 queue-6.8/ipmr-fix-incorrect-parameter-validation-in-the-ip_mr.patch create mode 100644 queue-6.8/ipv6-fib6_rules-flush-route-cache-when-rule-is-chang.patch create mode 100644 queue-6.8/ipv6-mcast-remove-one-synchronize_net-barrier-in-ipv.patch create mode 100644 queue-6.8/kunit-setup-dma-masks-on-the-kunit-device.patch create mode 100644 queue-6.8/kunit-test-log-the-correct-filter-string-in-executor.patch create mode 100644 queue-6.8/l2tp-fix-incorrect-parameter-validation-in-the-pppol.patch create mode 100644 queue-6.8/leds-aw2013-unlock-mutex-before-destroying-it.patch create mode 100644 queue-6.8/leds-sgm3140-add-missing-timer-cleanup-and-flash-gpi.patch create mode 100644 queue-6.8/lib-cmdline-fix-an-invalid-format-specifier-in-an-as.patch create mode 100644 queue-6.8/lib-memcpy_kunit-fix-an-invalid-format-specifier-in-.patch create mode 100644 queue-6.8/lib-stackdepot-fix-first-entry-having-a-0-handle.patch create mode 100644 queue-6.8/lib-stackdepot-off-by-one-in-depot_fetch_stack.patch create mode 100644 queue-6.8/libbpf-add-bpf_token_create-api.patch create mode 100644 queue-6.8/libbpf-add-btf__new_split-api-that-was-declared-but-.patch create mode 100644 queue-6.8/libbpf-add-missed-btf_ext__raw_data-api.patch create mode 100644 queue-6.8/libbpf-add-missing-libbpf_api-annotation-to-libbpf_s.patch create mode 100644 queue-6.8/libbpf-apply-map_set_def_max_entries-for-inner_maps-.patch create mode 100644 queue-6.8/libbpf-fix-__arg_ctx-type-enforcement-for-perf_event.patch create mode 100644 queue-6.8/libbpf-fix-faccessat-usage-on-android.patch create mode 100644 queue-6.8/libbpf-fix-return-value-for-perf_event-__arg_ctx-typ.patch create mode 100644 queue-6.8/libbpf-use-opts_set-macro-in-bpf_xdp_query.patch create mode 100644 queue-6.8/md-don-t-clear-md_closing-when-the-raid-is-about-to-.patch create mode 100644 queue-6.8/md-fix-kmemleak-of-rdev-serial.patch create mode 100644 queue-6.8/md-raid1-factor-out-helpers-to-add-rdev-to-conf.patch create mode 100644 queue-6.8/md-raid1-fix-choose-next-idle-in-read_balance.patch create mode 100644 queue-6.8/md-raid1-record-nonrot-rdevs-while-adding-removing-r.patch create mode 100644 queue-6.8/media-cadence-csi2rx-use-match-fwnode-for-media-link.patch create mode 100644 queue-6.8/media-cedrus-h265-fix-configuring-bitstream-size.patch create mode 100644 queue-6.8/media-dt-bindings-techwell-tw9900-fix-port-schema-re.patch create mode 100644 queue-6.8/media-dvb-frontends-avoid-stack-overflow-warnings-wi.patch create mode 100644 queue-6.8/media-edia-dvbdev-fix-a-use-after-free.patch create mode 100644 queue-6.8/media-em28xx-annotate-unchecked-call-to-media_device.patch create mode 100644 queue-6.8/media-go7007-add-check-of-return-value-of-go7007_rea.patch create mode 100644 queue-6.8/media-go7007-fix-a-memleak-in-go7007_load_encoder.patch create mode 100644 queue-6.8/media-i2c-imx290-fix-imx920-typo.patch create mode 100644 queue-6.8/media-imx-csc-scaler-fix-v4l2_ctrl_handler-memory-le.patch create mode 100644 queue-6.8/media-ivsc-csi-swap-sink-and-source-pads.patch create mode 100644 queue-6.8/media-mediatek-vcodec-avoid-wcast-function-type-stri.patch create mode 100644 queue-6.8/media-pvrusb2-fix-pvr2_stream_callback-casts.patch create mode 100644 queue-6.8/media-pvrusb2-fix-uaf-in-pvr2_context_set_notify.patch create mode 100644 queue-6.8/media-pvrusb2-remove-redundant-null-check.patch create mode 100644 queue-6.8/media-sun8i-di-fix-chroma-difference-threshold.patch create mode 100644 queue-6.8/media-sun8i-di-fix-coefficient-writes.patch create mode 100644 queue-6.8/media-sun8i-di-fix-power-on-off-sequences.patch create mode 100644 queue-6.8/media-tc358743-register-v4l2-async-device-only-after.patch create mode 100644 queue-6.8/media-ttpci-fix-two-memleaks-in-budget_av_attach.patch create mode 100644 queue-6.8/media-usbtv-remove-useless-locks-in-usbtv_video_free.patch create mode 100644 queue-6.8/media-v4l2-cci-print-leading-0-on-error.patch create mode 100644 queue-6.8/media-v4l2-mem2mem-fix-a-memleak-in-v4l2_m2m_registe.patch create mode 100644 queue-6.8/media-v4l2-tpg-fix-some-memleaks-in-tpg_alloc.patch create mode 100644 queue-6.8/media-videobuf2-add-missing-doc-comment-for-waiting_.patch create mode 100644 queue-6.8/memory-tegra-correct-dla-client-names.patch create mode 100644 queue-6.8/mfd-altera-sysmgr-call-of_node_put-only-when-of_pars.patch create mode 100644 queue-6.8/mfd-cs42l43-fix-wrong-gpio_fn_sel-and-spi_clk_config.patch create mode 100644 queue-6.8/mfd-cs42l43-fix-wrong-register-defaults.patch create mode 100644 queue-6.8/mfd-syscon-call-of_node_put-only-when-of_parse_phand.patch create mode 100644 queue-6.8/mips-cm-convert-__mips_cm_l2sync_phys_base-to-weak-f.patch create mode 100644 queue-6.8/mmc-wmt-sdmmc-remove-an-incorrect-release_mem_region.patch create mode 100644 queue-6.8/modules-wait-do_free_init-correctly.patch create mode 100644 queue-6.8/mtd-maps-physmap-core-fix-flash-size-larger-than-32-.patch create mode 100644 queue-6.8/mtd-maps-sun_uflash-declare-uflash_devinit-static.patch create mode 100644 queue-6.8/mtd-rawnand-brcmnand-exec_op-helper-functions-return.patch create mode 100644 queue-6.8/mtd-rawnand-lpc32xx_mlc-fix-irq-handler-prototype.patch create mode 100644 queue-6.8/mtd-spinand-esmt-extend-ids-to-5-bytes.patch create mode 100644 queue-6.8/nbd-null-check-for-nla_nest_start.patch create mode 100644 queue-6.8/net-blackhole_dev-fix-build-warning-for-ethh-set-but.patch create mode 100644 queue-6.8/net-dsa-microchip-make-sure-drive-strength-configura.patch create mode 100644 queue-6.8/net-ena-remove-ena_select_queue.patch create mode 100644 queue-6.8/net-hns3-fix-kernel-crash-when-1588-is-received-on-h.patch create mode 100644 queue-6.8/net-hns3-fix-port-duplex-configure-error-in-imp-rese.patch create mode 100644 queue-6.8/net-hns3-fix-wrong-judgment-condition-issue.patch create mode 100644 queue-6.8/net-ip_tunnel-make-sure-to-pull-inner-header-in-ip_t.patch create mode 100644 queue-6.8/net-kcm-fix-incorrect-parameter-validation-in-the-kc.patch create mode 100644 queue-6.8/net-mctp-copy-skb-ext-data-when-fragmenting.patch create mode 100644 queue-6.8/net-phy-dp83822-fix-rgmii-tx-delay-configuration.patch create mode 100644 queue-6.8/net-phy-fix-phy_get_internal_delay-accessing-an-empt.patch create mode 100644 queue-6.8/net-sunrpc-fix-an-off-by-one-in-rpc_sockaddr2uaddr.patch create mode 100644 queue-6.8/net-test-fix-printf-format-specifier-in-skb_segment-.patch create mode 100644 queue-6.8/net-x25-fix-incorrect-parameter-validation-in-the-x2.patch create mode 100644 queue-6.8/nfp-flower-handle-acti_netdevs-allocation-failure.patch create mode 100644 queue-6.8/nfs-fix-an-off-by-one-in-root_nfs_cat.patch create mode 100644 queue-6.8/nfs-fix-nfs_netfs_issue_read-xarray-locking-for-writ.patch create mode 100644 queue-6.8/nfs-fix-panic-when-nfs4_ff_layout_prepare_ds-fails.patch create mode 100644 queue-6.8/nfsv4.1-pnfs-fix-nfs-with-tls-in-pnfs.patch create mode 100644 queue-6.8/nfsv4.2-fix-listxattr-maximum-xdr-buffer-size.patch create mode 100644 queue-6.8/nfsv4.2-fix-nfs4_listxattr-kernel-bug-at-mm-usercopy.patch create mode 100644 queue-6.8/ntb-fix-possible-name-leak-in-ntb_register_device.patch create mode 100644 queue-6.8/nvme-host-fix-double-free-of-struct-nvme_id_ns-in-ns.patch create mode 100644 queue-6.8/objtool-fix-unwind_hint_-save-restore-across-basic-b.patch create mode 100644 queue-6.8/octeontx2-af-fix-devlink-params.patch create mode 100644 queue-6.8/opp-debugfs-fix-warning-around-icc_get_name.patch create mode 100644 queue-6.8/ovl-always-reject-mounting-over-case-insensitive-dir.patch create mode 100644 queue-6.8/ovl-relax-warn_on-in-ovl_verify_area.patch create mode 100644 queue-6.8/pci-aer-fix-rootport-attribute-paths-in-abi-docs.patch create mode 100644 queue-6.8/pci-brcmstb-fix-broken-brcm_pcie_mdio_write-polling.patch create mode 100644 queue-6.8/pci-dpc-print-all-tlp-prefixes-not-just-the-first.patch create mode 100644 queue-6.8/pci-make-pci_dev_is_disconnected-helper-public-for-o.patch create mode 100644 queue-6.8/pci-mark-3ware-9650se-root-port-extended-tags-as-bro.patch create mode 100644 queue-6.8/pci-p2pdma-fix-a-sleeping-issue-in-a-rcu-read-sectio.patch create mode 100644 queue-6.8/pci-switchtec-fix-an-error-handling-path-in-switchte.patch create mode 100644 queue-6.8/perf-bpf-clean-up-the-generated-copied-vmlinux.h.patch create mode 100644 queue-6.8/perf-evsel-fix-duplicate-initialization-of-data-id-i.patch create mode 100644 queue-6.8/perf-expr-fix-has_event-function-for-metric-style-ev.patch create mode 100644 queue-6.8/perf-metric-don-t-remove-scale-from-counts.patch create mode 100644 queue-6.8/perf-pmu-fix-a-potential-memory-leak-in-perf_pmu__lo.patch create mode 100644 queue-6.8/perf-pmu-treat-the-msr-pmu-as-software.patch create mode 100644 queue-6.8/perf-print-events-make-is_event_supported-more-robus.patch create mode 100644 queue-6.8/perf-record-check-conflict-between-timestamp-filenam.patch create mode 100644 queue-6.8/perf-record-fix-possible-incorrect-free-in-record__s.patch create mode 100644 queue-6.8/perf-srcline-add-missed-addr2line-closes.patch create mode 100644 queue-6.8/perf-stat-avoid-metric-only-segv.patch create mode 100644 queue-6.8/perf-thread_map-free-strlist-on-normal-path-in-threa.patch create mode 100644 queue-6.8/perf-vendor-events-amd-fix-zen-4-cache-latency-event.patch create mode 100644 queue-6.8/perf-x86-amd-core-avoid-register-reset-when-cpu-is-d.patch create mode 100644 queue-6.8/phy-qcom-qmp-usb-split-usb-c-phy-driver.patch create mode 100644 queue-6.8/phy-qcom-qmp-usbc-add-support-for-the-type-c-handlin.patch create mode 100644 queue-6.8/phy-qcom-qmp-usbc-handle-clamp-register-in-a-correct.patch create mode 100644 queue-6.8/pinctrl-mediatek-drop-bogus-slew-rate-register-range.patch create mode 100644 queue-6.8/pinctrl-mediatek-drop-bogus-slew-rate-register-range.patch-14189 create mode 100644 queue-6.8/pinctrl-renesas-allow-the-compiler-to-optimize-away-.patch create mode 100644 queue-6.8/pinctrl-renesas-r8a779g0-add-missing-scif_clk2-pin-g.patch create mode 100644 queue-6.8/pinctrl-renesas-rzg2l-fix-locking-in-rzg2l_dt_subnod.patch create mode 100644 queue-6.8/platform-x86-amd-pmf-do-not-use-readl-for-policy-buf.patch create mode 100644 queue-6.8/platform-x86-intel-pmc-arl-put-gna-device-in-d3.patch create mode 100644 queue-6.8/platform-x86-intel-pmc-lnl-remove-ssram-support.patch create mode 100644 queue-6.8/pmdomain-qcom-rpmhpd-drop-sa8540p-gfx.lvl.patch create mode 100644 queue-6.8/power-supply-mm8013-fix-not-charging-detection.patch create mode 100644 queue-6.8/powercap-dtpm_cpu-fix-error-check-against-freq_qos_a.patch create mode 100644 queue-6.8/powerpc-32-fix-adb_cuda-kconfig-warning.patch create mode 100644 queue-6.8/powerpc-4xx-fix-warp_gpio_leds-build-failure.patch create mode 100644 queue-6.8/powerpc-embedded6xx-fix-no-previous-prototype-for-av.patch create mode 100644 queue-6.8/powerpc-force-inlining-of-arch_vmap_p-u-m-d_supporte.patch create mode 100644 queue-6.8/powerpc-hv-gpci-fix-the-h_get_perf_counter_info-hcal.patch create mode 100644 queue-6.8/powerpc-ps3-fix-lv1-hcall-assembly-for-elfv2-calling.patch create mode 100644 queue-6.8/powerpc-pseries-fix-potential-memleak-in-papr_get_at.patch create mode 100644 queue-6.8/printk-add-this_cpu_in_panic.patch create mode 100644 queue-6.8/printk-disable-passing-console-lock-owner-completely.patch create mode 100644 queue-6.8/printk-nbcon-relocate-32bit-seq-macros.patch create mode 100644 queue-6.8/printk-ringbuffer-cleanup-reader-terminology.patch create mode 100644 queue-6.8/printk-ringbuffer-do-not-skip-non-finalized-records-.patch create mode 100644 queue-6.8/printk-ringbuffer-skip-non-finalized-records-in-pani.patch create mode 100644 queue-6.8/printk-wait-for-all-reserved-records-with-pr_flush.patch create mode 100644 queue-6.8/pstore-inode-only-d_invalidate-is-needed.patch create mode 100644 queue-6.8/pwm-atmel-hlcdc-fix-clock-imbalance-related-to-suspe.patch create mode 100644 queue-6.8/pwm-dwc-use-pm_sleep_ptr-macro.patch create mode 100644 queue-6.8/pwm-sti-fix-capture-for-st-pwm-num-chan-st-capture-n.patch create mode 100644 queue-6.8/quota-fix-potential-null-pointer-dereference.patch create mode 100644 queue-6.8/quota-fix-rcu-annotations-of-inode-dquot-pointers.patch create mode 100644 queue-6.8/quota-properly-annotate-i_dquot-arrays-with-__rcu.patch create mode 100644 queue-6.8/r8152-fix-unknown-device-for-choose_configuration.patch create mode 100644 queue-6.8/rcu-exp-fix-rcu-expedited-parallel-grace-period-kwor.patch create mode 100644 queue-6.8/rcu-exp-handle-rcu-expedited-grace-period-kworker-al.patch create mode 100644 queue-6.8/rdma-device-fix-a-race-between-mad_client-and-cm_cli.patch create mode 100644 queue-6.8/rdma-hns-fix-mis-modifying-default-congestion-contro.patch create mode 100644 queue-6.8/rdma-irdma-remove-duplicate-assignment.patch create mode 100644 queue-6.8/rdma-mana_ib-fix-bug-in-creation-of-dma-regions.patch create mode 100644 queue-6.8/rdma-mana_ib-introduce-mana_ib_get_netdev-helper-fun.patch create mode 100644 queue-6.8/rdma-mana_ib-introduce-mana_ib_install_cq_cb-helper-.patch create mode 100644 queue-6.8/rdma-mana_ib-introduce-mdev_to_gc-helper-function.patch create mode 100644 queue-6.8/rdma-mana_ib-use-virtual-address-in-dma-regions-for-.patch create mode 100644 queue-6.8/rdma-rtrs-clt-check-strnlen-return-len-in-sysfs-mpat.patch create mode 100644 queue-6.8/rdma-srpt-do-not-register-event-handler-until-srpt-d.patch create mode 100644 queue-6.8/regulator-userspace-consumer-add-module-device-table.patch create mode 100644 queue-6.8/risc-v-kvm-forward-seed-csr-access-to-user-space.patch create mode 100644 queue-6.8/riscv-dts-starfive-jh7100-fix-root-clock-names.patch create mode 100644 queue-6.8/rtc-test-fix-invalid-format-specifier.patch create mode 100644 queue-6.8/s390-cache-prevent-rebuild-of-shared_cpu_list.patch create mode 100644 queue-6.8/s390-dasd-fix-double-module-refcount-decrement.patch create mode 100644 queue-6.8/s390-dasd-use-dev_-for-device-log-messages.patch create mode 100644 queue-6.8/s390-pai-fix-attr_event_free-upper-limit-for-pai-dev.patch create mode 100644 queue-6.8/s390-vdso-drop-fpic-from-ldflags.patch create mode 100644 queue-6.8/sched-fair-take-the-scheduling-domain-into-account-i.patch create mode 100644 queue-6.8/sched-fair-take-the-scheduling-domain-into-account-i.patch-30615 create mode 100644 queue-6.8/scsi-bfa-fix-function-pointer-type-mismatch-for-hcb_.patch create mode 100644 queue-6.8/scsi-csiostor-avoid-function-pointer-casts.patch create mode 100644 queue-6.8/scsi-hisi_sas-fix-a-deadlock-issue-related-to-automa.patch create mode 100644 queue-6.8/selftest-bpf-add-map_in_maps-with-bpf_map_type_perf_.patch create mode 100644 queue-6.8/selftests-bpf-disable-ipv6-for-lwt_redirect-test.patch create mode 100644 queue-6.8/selftests-bpf-fix-potential-premature-unload-in-bpf_.patch create mode 100644 queue-6.8/selftests-bpf-fix-the-flaky-tc_redirect_dtime-test.patch create mode 100644 queue-6.8/selftests-bpf-trace_helpers.c-do-not-use-poisoned-ty.patch create mode 100644 queue-6.8/selftests-bpf-wait-for-the-netstamp_needed_key-stati.patch create mode 100644 queue-6.8/selftests-forwarding-add-missing-config-entries.patch create mode 100644 queue-6.8/selftests-forwarding-add-missing-multicast-routing-c.patch create mode 100644 queue-6.8/series create mode 100644 queue-6.8/soc-qcom-llcc-check-return-value-on-broadcast_or-reg.patch create mode 100644 queue-6.8/soc-qcom-socinfo-rename-pm2250-to-pm4125.patch create mode 100644 queue-6.8/sock_diag-annotate-data-races-around-sock_diag_handl.patch create mode 100644 queue-6.8/soundwire-stream-add-missing-const-to-documentation.patch create mode 100644 queue-6.8/sparc32-do-not-select-generic_isa_dma.patch create mode 100644 queue-6.8/sparc32-fix-section-mismatch-in-leon_pci_grpci.patch create mode 100644 queue-6.8/sparc32-use-generic-cmpdi2-ucmpdi2-variants.patch create mode 100644 queue-6.8/spi-consolidate-setting-message-spi.patch create mode 100644 queue-6.8/spi-move-split-xfers-for-cs_word-emulation.patch create mode 100644 queue-6.8/sr9800-add-check-for-usbnet_get_endpoints.patch create mode 100644 queue-6.8/staging-media-starfive-set-16-bpp-for-capture_raw-de.patch create mode 100644 queue-6.8/sunrpc-fix-a-memleak-in-gss_import_v2_context.patch create mode 100644 queue-6.8/sunrpc-fix-some-memleaks-in-gssx_dec_option_array.patch create mode 100644 queue-6.8/tcp-fix-incorrect-parameter-validation-in-the-do_tcp.patch create mode 100644 queue-6.8/time-test-fix-incorrect-format-specifier.patch create mode 100644 queue-6.8/timekeeping-fix-cross-timestamp-interpolation-corner.patch create mode 100644 queue-6.8/timekeeping-fix-cross-timestamp-interpolation-for-no.patch create mode 100644 queue-6.8/timekeeping-fix-cross-timestamp-interpolation-on-cou.patch create mode 100644 queue-6.8/tools-resolve_btfids-fix-cross-compilation-to-non-ho.patch create mode 100644 queue-6.8/tools-resolve_btfids-refactor-set-sorting-with-types.patch create mode 100644 queue-6.8/tty-mips_ejtag_fdc-fix-passing-incompatible-pointer-.patch create mode 100644 queue-6.8/udp-fix-incorrect-parameter-validation-in-the-udp_li.patch create mode 100644 queue-6.8/watchdog-starfive-check-pm_runtime_enabled-before-de.patch create mode 100644 queue-6.8/watchdog-stm32_iwdg-initialize-default-timeout.patch create mode 100644 queue-6.8/wifi-ath10k-fix-null-pointer-dereference-in-ath10k_w.patch create mode 100644 queue-6.8/wifi-ath11k-add-support-to-select-6-ghz-regulatory-t.patch create mode 100644 queue-6.8/wifi-ath11k-change-to-move-wmi_vdev_param_set_hemu_m.patch create mode 100644 queue-6.8/wifi-ath11k-fix-a-possible-dead-lock-caused-by-ab-ba.patch create mode 100644 queue-6.8/wifi-ath11k-initialize-rx_mcs_80-and-rx_mcs_160-befo.patch create mode 100644 queue-6.8/wifi-ath11k-store-cur_regulatory_info-for-each-radio.patch create mode 100644 queue-6.8/wifi-ath12k-fix-fetching-mcbc-flag-for-qcn9274.patch create mode 100644 queue-6.8/wifi-ath12k-fix-incorrect-logic-of-calculating-vdev_.patch create mode 100644 queue-6.8/wifi-ath12k-fix-issues-in-channel-list-update.patch create mode 100644 queue-6.8/wifi-ath9k-delay-all-of-ath9k_wmi_event_tasklet-unti.patch create mode 100644 queue-6.8/wifi-b43-disable-qos-for-bcm4331.patch create mode 100644 queue-6.8/wifi-b43-stop-correct-queue-in-dma-worker-when-qos-i.patch create mode 100644 queue-6.8/wifi-b43-stop-wake-correct-queue-in-dma-tx-path-when.patch create mode 100644 queue-6.8/wifi-b43-stop-wake-correct-queue-in-pio-tx-path-when.patch create mode 100644 queue-6.8/wifi-brcm80211-handle-pmk_op-allocation-failure.patch create mode 100644 queue-6.8/wifi-brcmsmac-avoid-function-pointer-casts.patch create mode 100644 queue-6.8/wifi-cfg80211-add-rnr-with-reporting-ap-information.patch create mode 100644 queue-6.8/wifi-cfg80211-set-correct-param-change-count-in-ml-e.patch create mode 100644 queue-6.8/wifi-iwlwifi-acpi-fix-wpfc-reading.patch create mode 100644 queue-6.8/wifi-iwlwifi-always-have-uats_enabled.patch create mode 100644 queue-6.8/wifi-iwlwifi-change-link-id-in-time-event-to-s8.patch create mode 100644 queue-6.8/wifi-iwlwifi-dbg-tlv-ensure-nul-termination.patch create mode 100644 queue-6.8/wifi-iwlwifi-fix-ewrd-table-validity-check.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-d3-fix-ipn-byte-order.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-don-t-set-replay-counters-to-0xff.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-don-t-set-the-mfp-flag-for-the-gtk.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-fix-erroneous-queue-index-mask.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-fix-the-listener-mac-filter-flags.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-fix-the-tlc-command-after-add_sta.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-initialize-rates-in-fw-earlier.patch create mode 100644 queue-6.8/wifi-iwlwifi-mvm-report-beacon-protection-failures.patch create mode 100644 queue-6.8/wifi-iwlwifi-properly-check-if-link-is-active.patch create mode 100644 queue-6.8/wifi-iwlwifi-read-bios-pnvm-only-for-non-intel-sku.patch create mode 100644 queue-6.8/wifi-iwlwifi-support-eht-for-wh.patch create mode 100644 queue-6.8/wifi-libertas-fix-some-memleaks-in-lbs_allocate_cmd_.patch create mode 100644 queue-6.8/wifi-mac80211-use-deflink-and-fix-typo-in-link-id-ch.patch create mode 100644 queue-6.8/wifi-mt76-fix-the-issue-of-missing-txpwr-settings-fr.patch create mode 100644 queue-6.8/wifi-mt76-mt7921-fix-incorrect-type-conversion-for-c.patch create mode 100644 queue-6.8/wifi-mt76-mt7921e-fix-use-after-free-in-free_irq.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-add-flow-to-avoid-chip-bt-function-.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-add-support-to-set-ifs-time-by-mcu-.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-fix-connect-to-80211b-mode-fail-in-.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-fix-fw-download-fail.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-fix-mcu-query-command-fail.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-fix-sap-no-beacon-issue-in-5ghz-and.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-fix-the-wrong-header-translation-co.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-fix-wmm-queue-mapping.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-fix-wow-failed-in-encrypted-mode.patch create mode 100644 queue-6.8/wifi-mt76-mt7925-update-pcie-dma-settings.patch create mode 100644 queue-6.8/wifi-mt76-mt7925e-fix-use-after-free-in-free_irq.patch create mode 100644 queue-6.8/wifi-mt76-mt792x-fix-a-potential-loading-failure-of-.patch create mode 100644 queue-6.8/wifi-mt76-mt792x-fix-ethtool-warning.patch create mode 100644 queue-6.8/wifi-mt76-mt7996-check-txs-format-before-getting-skb.patch create mode 100644 queue-6.8/wifi-mt76-mt7996-fix-efuse-reading-issue.patch create mode 100644 queue-6.8/wifi-mt76-mt7996-fix-fw-loading-timeout.patch create mode 100644 queue-6.8/wifi-mt76-mt7996-fix-he-beamformer-phy-cap-for-stati.patch create mode 100644 queue-6.8/wifi-mt76-mt7996-fix-hif_txd_v2_1-value.patch create mode 100644 queue-6.8/wifi-mt76-mt7996-fix-incorrect-interpretation-of-eht.patch create mode 100644 queue-6.8/wifi-mt76-mt7996-fix-twt-issues.patch create mode 100644 queue-6.8/wifi-mwifiex-debugfs-drop-unnecessary-error-check-fo.patch create mode 100644 queue-6.8/wifi-rtl8xxxu-add-cancel_work_sync-for-c2hcmd_work.patch create mode 100644 queue-6.8/wifi-rtw88-8821c-fix-beacon-loss-and-disconnect.patch create mode 100644 queue-6.8/wifi-rtw88-8821c-fix-false-alarm-count.patch create mode 100644 queue-6.8/wifi-rtw88-8821cu-fix-firmware-upload-fail.patch create mode 100644 queue-6.8/wifi-wfx-fix-memory-leak-when-starting-ap.patch create mode 100644 queue-6.8/wifi-wilc1000-do-not-realloc-workqueue-everytime-an-.patch create mode 100644 queue-6.8/wifi-wilc1000-fix-declarations-ordering.patch create mode 100644 queue-6.8/wifi-wilc1000-fix-multi-vif-management-when-deleting.patch create mode 100644 queue-6.8/wifi-wilc1000-fix-rcu-usage-in-connect-path.patch create mode 100644 queue-6.8/wifi-wilc1000-prevent-use-after-free-on-vif-when-cle.patch create mode 100644 queue-6.8/wifi-wilc1000-revert-reset-line-logic-flip.patch create mode 100644 queue-6.8/workqueue-don-t-call-cpumask_test_cpu-with-1-cpu-in-.patch create mode 100644 queue-6.8/workqueue-factor-out-pwq_is_empty.patch create mode 100644 queue-6.8/workqueue-implement-system-wide-nr_active-enforcemen.patch create mode 100644 queue-6.8/workqueue-introduce-struct-wq_node_nr_active.patch create mode 100644 queue-6.8/workqueue-make-wq_adjust_max_active-round-robin-pwqs.patch create mode 100644 queue-6.8/workqueue-move-nr_active-handling-into-helpers.patch create mode 100644 queue-6.8/workqueue-move-pwq-max_active-to-wq-max_active.patch create mode 100644 queue-6.8/workqueue-rcu-protect-wq-dfl_pwq-and-implement-acces.patch create mode 100644 queue-6.8/workqueue-replace-pwq_activate_inactive_work-with-__.patch create mode 100644 queue-6.8/workqueue.c-increase-workqueue-name-length.patch create mode 100644 queue-6.8/x86-asm-remove-the-__iomem-annotation-of-movdir64b-s.patch create mode 100644 queue-6.8/x86-mm-ensure-input-to-pfn_to_kaddr-is-treated-as-a-.patch create mode 100644 queue-6.8/x86-relocs-ignore-relocations-in-.notes-section.patch create mode 100644 queue-6.8/x86-resctrl-implement-new-mba_mbps-throttling-heuris.patch create mode 100644 queue-6.8/x86-resctrl-read-supported-bandwidth-sources-from-cp.patch create mode 100644 queue-6.8/x86-resctrl-remove-hard-coded-memory-bandwidth-limit.patch create mode 100644 queue-6.8/x86-sme-fix-memory-encryption-setting-if-enabled-by-.patch diff --git a/queue-6.8/acpi-cppc-enable-amd-cppc-v2-support-for-family-17h-.patch b/queue-6.8/acpi-cppc-enable-amd-cppc-v2-support-for-family-17h-.patch new file mode 100644 index 00000000000..b0db6de1298 --- /dev/null +++ b/queue-6.8/acpi-cppc-enable-amd-cppc-v2-support-for-family-17h-.patch @@ -0,0 +1,47 @@ +From f08c80e3e04d6a71f43fd52bf7808344638bda55 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Feb 2024 11:46:28 +0800 +Subject: ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors + +From: Perry Yuan + +[ Upstream commit a51ab63b297ce9e26e3ffb9be896018a42d5f32f ] + +As there are some AMD processors which only support CPPC V2 firmware and +BIOS implementation, the amd_pstate driver will be failed to load when +system booting with below kernel warning message: + +[ 0.477523] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled + +To make the amd_pstate driver can be loaded on those TR40 processors, it +needs to match x86_model from 0x30 to 0x7F for family 17H. +With the change, the system can load amd_pstate driver as expected. + +Reviewed-by: Mario Limonciello +Reported-by: Gino Badouri +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218171 +Fixes: fbd74d1689 ("ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory") +Signed-off-by: Perry Yuan +Reviewed-by: Gautham R. Shenoy +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + arch/x86/kernel/acpi/cppc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c +index 8d8752b44f113..ff8f25faca3dd 100644 +--- a/arch/x86/kernel/acpi/cppc.c ++++ b/arch/x86/kernel/acpi/cppc.c +@@ -20,7 +20,7 @@ bool cpc_supported_by_cpu(void) + (boot_cpu_data.x86_model >= 0x20 && boot_cpu_data.x86_model <= 0x2f))) + return true; + else if (boot_cpu_data.x86 == 0x17 && +- boot_cpu_data.x86_model >= 0x70 && boot_cpu_data.x86_model <= 0x7f) ++ boot_cpu_data.x86_model >= 0x30 && boot_cpu_data.x86_model <= 0x7f) + return true; + return boot_cpu_has(X86_FEATURE_CPPC); + } +-- +2.43.0 + diff --git a/queue-6.8/acpi-hmat-remove-register-of-memory-node-for-generic.patch b/queue-6.8/acpi-hmat-remove-register-of-memory-node-for-generic.patch new file mode 100644 index 00000000000..b24f4640849 --- /dev/null +++ b/queue-6.8/acpi-hmat-remove-register-of-memory-node-for-generic.patch @@ -0,0 +1,62 @@ +From ec0ac153b89d5cad22cc745d9a8a8975e3f210b4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Mar 2024 14:59:20 -0700 +Subject: ACPI: HMAT: Remove register of memory node for generic target + +From: Dave Jiang + +[ Upstream commit 54b9460b0a28c4c76a7b455ec1b3b61a13e97291 ] + +For generic targets, there's no reason to call +register_memory_node_under_compute_node() with the access levels that are +only visible to HMAT handling code. Only update the attributes and rename +hmat_register_generic_target_initiators() to hmat_update_generic_target(). + +The original call path ends up triggering register_memory_node_under_compute_node(). +Although the access level would be "3" and not impact any current node arrays, it +introduces unwanted data into the numa node access_coordinate array. + +Fixes: a3a3e341f169 ("acpi: numa: Add setting of generic port system locality attributes") +Cc: Rafael J. Wysocki +Reviewed-by: Jonathan Cameron +Tested-by: Jonathan Cameron +Signed-off-by: Dave Jiang +Link: https://lore.kernel.org/r/20240308220055.2172956-2-dave.jiang@intel.com +Signed-off-by: Dan Williams +Signed-off-by: Sasha Levin +--- + drivers/acpi/numa/hmat.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c +index d6b85f0f6082f..a26e7793ec4ef 100644 +--- a/drivers/acpi/numa/hmat.c ++++ b/drivers/acpi/numa/hmat.c +@@ -770,12 +770,12 @@ static void __hmat_register_target_initiators(struct memory_target *target, + } + } + +-static void hmat_register_generic_target_initiators(struct memory_target *target) ++static void hmat_update_generic_target(struct memory_target *target) + { + static DECLARE_BITMAP(p_nodes, MAX_NUMNODES); + +- __hmat_register_target_initiators(target, p_nodes, +- NODE_ACCESS_CLASS_GENPORT_SINK); ++ hmat_update_target_attrs(target, p_nodes, ++ NODE_ACCESS_CLASS_GENPORT_SINK); + } + + static void hmat_register_target_initiators(struct memory_target *target) +@@ -835,7 +835,7 @@ static void hmat_register_target(struct memory_target *target) + */ + mutex_lock(&target_lock); + if (*(u16 *)target->gen_port_device_handle) { +- hmat_register_generic_target_initiators(target); ++ hmat_update_generic_target(target); + target->registered = true; + } + mutex_unlock(&target_lock); +-- +2.43.0 + diff --git a/queue-6.8/acpi-processor_idle-fix-memory-leak-in-acpi_processo.patch b/queue-6.8/acpi-processor_idle-fix-memory-leak-in-acpi_processo.patch new file mode 100644 index 00000000000..39f824a4606 --- /dev/null +++ b/queue-6.8/acpi-processor_idle-fix-memory-leak-in-acpi_processo.patch @@ -0,0 +1,61 @@ +From 27be1efb292de4fb1327cc004e619e7038f5963d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 01:41:58 +0100 +Subject: ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit() + +From: Armin Wolf + +[ Upstream commit e18afcb7b2a12b635ac10081f943fcf84ddacc51 ] + +After unregistering the CPU idle device, the memory associated with +it is not freed, leading to a memory leak: + +unreferenced object 0xffff896282f6c000 (size 1024): + comm "swapper/0", pid 1, jiffies 4294893170 + hex dump (first 32 bytes): + 00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 ................ + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + backtrace (crc 8836a742): + [] kmalloc_trace+0x29d/0x340 + [] acpi_processor_power_init+0xf3/0x1c0 + [] __acpi_processor_start+0xd3/0xf0 + [] acpi_processor_start+0x2c/0x50 + [] really_probe+0xe2/0x480 + [] __driver_probe_device+0x78/0x160 + [] driver_probe_device+0x1f/0x90 + [] __driver_attach+0xce/0x1c0 + [] bus_for_each_dev+0x70/0xc0 + [] bus_add_driver+0x112/0x210 + [] driver_register+0x55/0x100 + [] acpi_processor_driver_init+0x3b/0xc0 + [] do_one_initcall+0x41/0x300 + [] kernel_init_freeable+0x320/0x470 + [] kernel_init+0x16/0x1b0 + [] ret_from_fork+0x2d/0x50 + +Fix this by freeing the CPU idle device after unregistering it. + +Fixes: 3d339dcbb56d ("cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure") +Signed-off-by: Armin Wolf +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/processor_idle.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c +index 55437f5e0c3ae..bd6a7857ce058 100644 +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -1430,6 +1430,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr) + acpi_processor_registered--; + if (acpi_processor_registered == 0) + cpuidle_unregister_driver(&acpi_idle_driver); ++ ++ kfree(dev); + } + + pr->flags.power_setup_done = 0; +-- +2.43.0 + diff --git a/queue-6.8/acpi-resource-add-maibenben-x577-to-irq1_edge_low_fo.patch b/queue-6.8/acpi-resource-add-maibenben-x577-to-irq1_edge_low_fo.patch new file mode 100644 index 00000000000..c24fe82c22a --- /dev/null +++ b/queue-6.8/acpi-resource-add-maibenben-x577-to-irq1_edge_low_fo.patch @@ -0,0 +1,49 @@ +From 875585208d6c7078fa92b41bb3928a5758c5a519 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Feb 2024 19:24:08 +0300 +Subject: ACPI: resource: Add MAIBENBEN X577 to irq1_edge_low_force_override + +From: Maxim Kudinov + +[ Upstream commit 021a67d096154893cd1d883c7be0097e2ee327fd ] + +A known issue on some Zen laptops, keyboard stopped working due to commit +9946e39fe8d0 fael@kernel.org("ACPI: resource: skip IRQ override on AMD +Zen platforms") on kernel 5.19.10. + +The ACPI IRQ override is required for this board due to buggy DSDT, thus +adding the board vendor and name to irq1_edge_low_force_override fixes +the issue. + +Fixes: 9946e39fe8d0 ("ACPI: resource: skip IRQ override on AMD Zen platforms") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=217394 +Link: https://lore.kernel.org/linux-acpi/20231006123304.32686-1-hdegoede@redhat.com/ +Tested-by: Maxim Trofimov +Signed-off-by: Maxim Kudinov +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/resource.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c +index 3ebb74eb768a5..c843feb02e980 100644 +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -602,6 +602,13 @@ static const struct dmi_system_id irq1_edge_low_force_override[] = { + DMI_MATCH(DMI_BOARD_NAME, "LL6FA"), + }, + }, ++ { ++ /* MAIBENBEN X577 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "MAIBENBEN"), ++ DMI_MATCH(DMI_BOARD_NAME, "X577"), ++ }, ++ }, + { } + }; + +-- +2.43.0 + diff --git a/queue-6.8/acpi-resource-do-irq-override-on-lunnen-ground-lapto.patch b/queue-6.8/acpi-resource-do-irq-override-on-lunnen-ground-lapto.patch new file mode 100644 index 00000000000..d90f46366cb --- /dev/null +++ b/queue-6.8/acpi-resource-do-irq-override-on-lunnen-ground-lapto.patch @@ -0,0 +1,51 @@ +From 94ff395e054c4a73d71f9bbc2e9a46157c697b46 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 12:30:09 +0000 +Subject: ACPI: resource: Do IRQ override on Lunnen Ground laptops + +From: Alexey I. Froloff + +[ Upstream commit e23ad54fef186aa66007895be1382c88f1ee2bf7 ] + +The Lunnen Ground 15 and 16 needs IRQ overriding for the keyboard to +work. + +Adding an entries for these laptops to the override_table makes the +internal keyboard functional. + +Signed-off-by: Alexey I. Froloff +Signed-off-by: Rafael J. Wysocki +Stable-dep-of: 021a67d09615 ("ACPI: resource: Add MAIBENBEN X577 to irq1_edge_low_force_override") +Signed-off-by: Sasha Levin +--- + drivers/acpi/resource.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c +index dacad1d846c0d..3ebb74eb768a5 100644 +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -588,6 +588,20 @@ static const struct dmi_system_id irq1_edge_low_force_override[] = { + DMI_MATCH(DMI_BOARD_NAME, "GM5RGEE0016COM"), + }, + }, ++ { ++ /* Lunnen Ground 15 / AMD Ryzen 5 5500U */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Lunnen"), ++ DMI_MATCH(DMI_BOARD_NAME, "LLL5DAW"), ++ }, ++ }, ++ { ++ /* Lunnen Ground 16 / AMD Ryzen 7 5800U */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Lunnen"), ++ DMI_MATCH(DMI_BOARD_NAME, "LL6FA"), ++ }, ++ }, + { } + }; + +-- +2.43.0 + diff --git a/queue-6.8/acpi-scan-fix-device-check-notification-handling.patch b/queue-6.8/acpi-scan-fix-device-check-notification-handling.patch new file mode 100644 index 00000000000..4614761c7cd --- /dev/null +++ b/queue-6.8/acpi-scan-fix-device-check-notification-handling.patch @@ -0,0 +1,57 @@ +From ddf7b3afbb62b6b72de3b671b5724b6cfc663920 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Feb 2024 17:35:27 +0100 +Subject: ACPI: scan: Fix device check notification handling + +From: Rafael J. Wysocki + +[ Upstream commit 793551c965116d9dfaf0550dacae1396a20efa69 ] + +It is generally invalid to fail a Device Check notification if the scan +handler has not been attached to the given device after a bus rescan, +because there may be valid reasons for the scan handler to refuse +attaching to the device (for example, the device is not ready). + +For this reason, modify acpi_scan_device_check() to return 0 in that +case without printing a warning. + +While at it, reduce the log level of the "already enumerated" message +in the same function, because it is only interesting when debugging +notification handling + +Fixes: 443fc8202272 ("ACPI / hotplug: Rework generic code to handle suprise removals") +Signed-off-by: Rafael J. Wysocki +Reviewed-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/acpi/scan.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c +index e6ed1ba91e5c9..617f3e0e963d5 100644 +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -314,18 +314,14 @@ static int acpi_scan_device_check(struct acpi_device *adev) + * again). + */ + if (adev->handler) { +- dev_warn(&adev->dev, "Already enumerated\n"); +- return -EALREADY; ++ dev_dbg(&adev->dev, "Already enumerated\n"); ++ return 0; + } + error = acpi_bus_scan(adev->handle); + if (error) { + dev_warn(&adev->dev, "Namespace scan failure\n"); + return error; + } +- if (!adev->handler) { +- dev_warn(&adev->dev, "Enumeration failure\n"); +- error = -ENODEV; +- } + } else { + error = acpi_scan_device_not_enumerated(adev); + } +-- +2.43.0 + diff --git a/queue-6.8/af_unix-annotate-data-race-of-gc_in_progress-in-wait.patch b/queue-6.8/af_unix-annotate-data-race-of-gc_in_progress-in-wait.patch new file mode 100644 index 00000000000..faee4ed0310 --- /dev/null +++ b/queue-6.8/af_unix-annotate-data-race-of-gc_in_progress-in-wait.patch @@ -0,0 +1,39 @@ +From 47669a6486c383f67188f6f0548042a1b717e628 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Jan 2024 09:08:52 -0800 +Subject: af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc(). + +From: Kuniyuki Iwashima + +[ Upstream commit 31e03207119a535d0b0e3b3a7f91983aeb2cb14d ] + +gc_in_progress is changed under spin_lock(&unix_gc_lock), +but wait_for_unix_gc() reads it locklessly. + +Let's use READ_ONCE(). + +Fixes: 5f23b734963e ("net: Fix soft lockups/OOM issues w/ unix garbage collector") +Signed-off-by: Kuniyuki Iwashima +Link: https://lore.kernel.org/r/20240123170856.41348-2-kuniyu@amazon.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/unix/garbage.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/unix/garbage.c b/net/unix/garbage.c +index 2a81880dac7b7..027c86e804f8a 100644 +--- a/net/unix/garbage.c ++++ b/net/unix/garbage.c +@@ -198,7 +198,7 @@ void wait_for_unix_gc(void) + if (READ_ONCE(unix_tot_inflight) > UNIX_INFLIGHT_TRIGGER_GC && + !READ_ONCE(gc_in_progress)) + unix_gc(); +- wait_event(unix_gc_wait, gc_in_progress == false); ++ wait_event(unix_gc_wait, !READ_ONCE(gc_in_progress)); + } + + /* The external entry point: unix_gc() */ +-- +2.43.0 + diff --git a/queue-6.8/afs-don-t-cache-preferred-address.patch b/queue-6.8/afs-don-t-cache-preferred-address.patch new file mode 100644 index 00000000000..01359165b4e --- /dev/null +++ b/queue-6.8/afs-don-t-cache-preferred-address.patch @@ -0,0 +1,81 @@ +From 0f861a92f74159529fd326aa63e958f4006cd058 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 Mar 2024 08:15:02 +0000 +Subject: afs: Don't cache preferred address + +From: David Howells + +[ Upstream commit 83505bde45e347f1451d007b3ddd7f06cee4c269 ] + +In the AFS fileserver rotation algorithm, don't cache the preferred address +for the server as that will override the explicit preference if a +non-preferred address responds first. + +Fixes: 495f2ae9e355 ("afs: Fix fileserver rotation") +Signed-off-by: David Howells +Link: https://lore.kernel.org/r/20240313081505.3060173-2-dhowells@redhat.com +Reviewed-by: Marc Dionne +cc: Marc Dionne +cc: linux-afs@lists.infradead.org +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + fs/afs/rotate.c | 21 ++++----------------- + 1 file changed, 4 insertions(+), 17 deletions(-) + +diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c +index 700a27bc8c257..ed04bd1eeae89 100644 +--- a/fs/afs/rotate.c ++++ b/fs/afs/rotate.c +@@ -602,6 +602,8 @@ bool afs_select_fileserver(struct afs_operation *op) + goto wait_for_more_probe_results; + + alist = op->estate->addresses; ++ best_prio = -1; ++ addr_index = 0; + for (i = 0; i < alist->nr_addrs; i++) { + if (alist->addrs[i].prio > best_prio) { + addr_index = i; +@@ -609,9 +611,7 @@ bool afs_select_fileserver(struct afs_operation *op) + } + } + +- addr_index = READ_ONCE(alist->preferred); +- if (!test_bit(addr_index, &set)) +- addr_index = __ffs(set); ++ alist->preferred = addr_index; + + op->addr_index = addr_index; + set_bit(addr_index, &op->addr_tried); +@@ -656,12 +656,6 @@ bool afs_select_fileserver(struct afs_operation *op) + next_server: + trace_afs_rotate(op, afs_rotate_trace_next_server, 0); + _debug("next"); +- ASSERT(op->estate); +- alist = op->estate->addresses; +- if (op->call_responded && +- op->addr_index != READ_ONCE(alist->preferred) && +- test_bit(alist->preferred, &op->addr_tried)) +- WRITE_ONCE(alist->preferred, op->addr_index); + op->estate = NULL; + goto pick_server; + +@@ -690,14 +684,7 @@ bool afs_select_fileserver(struct afs_operation *op) + failed: + trace_afs_rotate(op, afs_rotate_trace_failed, 0); + op->flags |= AFS_OPERATION_STOP; +- if (op->estate) { +- alist = op->estate->addresses; +- if (op->call_responded && +- op->addr_index != READ_ONCE(alist->preferred) && +- test_bit(alist->preferred, &op->addr_tried)) +- WRITE_ONCE(alist->preferred, op->addr_index); +- op->estate = NULL; +- } ++ op->estate = NULL; + _leave(" = f [failed %d]", afs_op_error(op)); + return false; + } +-- +2.43.0 + diff --git a/queue-6.8/afs-fix-occasional-rmdir-then-vnovnode-with-generic-.patch b/queue-6.8/afs-fix-occasional-rmdir-then-vnovnode-with-generic-.patch new file mode 100644 index 00000000000..e3a39130d94 --- /dev/null +++ b/queue-6.8/afs-fix-occasional-rmdir-then-vnovnode-with-generic-.patch @@ -0,0 +1,104 @@ +From 6cdbf843346615333727d6928ce8fa8dceab5490 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 Mar 2024 08:15:03 +0000 +Subject: afs: Fix occasional rmdir-then-VNOVNODE with generic/011 + +From: David Howells + +[ Upstream commit b74c02a37987d3ea755f96119c527f5e91950592 ] + +Sometimes generic/011 causes kafs to follow up an FS.RemoveDir RPC call by +spending around a second sending a slew of FS.FetchStatus RPC calls to the +directory just deleted that then abort with VNOVNODE, indicating deletion +of the target directory. + +This seems to stem from userspace attempting to stat the directory or +something in it: + + afs_select_fileserver+0x46d/0xaa2 + afs_wait_for_operation+0x12/0x17e + afs_fetch_status+0x56/0x75 + afs_validate+0xfb/0x240 + afs_permission+0xef/0x1b0 + inode_permission+0x90/0x139 + link_path_walk.part.0.constprop.0+0x6f/0x2f0 + path_lookupat+0x4c/0xfa + filename_lookup+0x63/0xd7 + vfs_statx+0x62/0x13f + vfs_fstatat+0x72/0x8a + +The issue appears to be that afs_dir_remove_subdir() marks the callback +promise as being cancelled by setting the expiry time to AFS_NO_CB_PROMISE +- which then confuses afs_validate() which sends the FetchStatus to try and +get a new one before it checks for the AFS_VNODE_DELETED flag which +indicates that we know the directory got deleted. + +Fix this by: + + (1) Make afs_check_validity() return true if AFS_VNODE_DELETED is set, and + then tweak the return from afs_validate() if the DELETED flag is set. + + (2) Move the AFS_VNODE_DELETED check in afs_validate() up above the + expiration check to immediately after we've grabbed the validate_lock. + +Fixes: 453924de6212 ("afs: Overhaul invalidation handling to better support RO volumes") +Signed-off-by: David Howells +Link: https://lore.kernel.org/r/20240313081505.3060173-3-dhowells@redhat.com +Reviewed-by: Marc Dionne +cc: Marc Dionne +cc: linux-afs@lists.infradead.org +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + fs/afs/validation.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/fs/afs/validation.c b/fs/afs/validation.c +index 46b37f2cce7d9..32a53fc8dfb26 100644 +--- a/fs/afs/validation.c ++++ b/fs/afs/validation.c +@@ -122,6 +122,9 @@ bool afs_check_validity(const struct afs_vnode *vnode) + const struct afs_volume *volume = vnode->volume; + time64_t deadline = ktime_get_real_seconds() + 10; + ++ if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) ++ return true; ++ + if (atomic_read(&volume->cb_v_check) != atomic_read(&volume->cb_v_break) || + atomic64_read(&vnode->cb_expires_at) <= deadline || + volume->cb_expires_at <= deadline || +@@ -389,12 +392,17 @@ int afs_validate(struct afs_vnode *vnode, struct key *key) + key_serial(key)); + + if (afs_check_validity(vnode)) +- return 0; ++ return test_bit(AFS_VNODE_DELETED, &vnode->flags) ? -ESTALE : 0; + + ret = down_write_killable(&vnode->validate_lock); + if (ret < 0) + goto error; + ++ if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) { ++ ret = -ESTALE; ++ goto error_unlock; ++ } ++ + /* Validate a volume after the v_break has changed or the volume + * callback expired. We only want to do this once per volume per + * v_break change. The actual work will be done when parsing the +@@ -448,12 +456,6 @@ int afs_validate(struct afs_vnode *vnode, struct key *key) + vnode->cb_ro_snapshot = cb_ro_snapshot; + vnode->cb_scrub = cb_scrub; + +- if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) { +- _debug("file already deleted"); +- ret = -ESTALE; +- goto error_unlock; +- } +- + /* if the vnode's data version number changed then its contents are + * different */ + zap |= test_and_clear_bit(AFS_VNODE_ZAP_DATA, &vnode->flags); +-- +2.43.0 + diff --git a/queue-6.8/afs-revert-afs-hide-silly-rename-files-from-userspac.patch b/queue-6.8/afs-revert-afs-hide-silly-rename-files-from-userspac.patch new file mode 100644 index 00000000000..0f2bbe56fe1 --- /dev/null +++ b/queue-6.8/afs-revert-afs-hide-silly-rename-files-from-userspac.patch @@ -0,0 +1,55 @@ +From fb51bf3caa3cf70cbb4f194476a894dba0ff2858 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 Mar 2024 11:08:41 +0000 +Subject: afs: Revert "afs: Hide silly-rename files from userspace" + +From: David Howells + +[ Upstream commit 0aec3847d044273733285dcff90afda89ad461d2 ] + +This reverts commit 57e9d49c54528c49b8bffe6d99d782ea051ea534. + +This undoes the hiding of .__afsXXXX silly-rename files. The problem with +hiding them is that rm can't then manually delete them. + +This also reverts commit 5f7a07646655fb4108da527565dcdc80124b14c4 ("afs: Fix +endless loop in directory parsing") as that's a bugfix for the above. + +Fixes: 57e9d49c5452 ("afs: Hide silly-rename files from userspace") +Reported-by: Markus Suvanto +Link: https://lists.infradead.org/pipermail/linux-afs/2024-February/008102.html +Signed-off-by: David Howells +Link: https://lore.kernel.org/r/3085695.1710328121@warthog.procyon.org.uk +Reviewed-by: Jeffrey E Altman +cc: Marc Dionne +cc: linux-afs@lists.infradead.org +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + fs/afs/dir.c | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/fs/afs/dir.c b/fs/afs/dir.c +index 8a67fc427e748..67afe68972d5c 100644 +--- a/fs/afs/dir.c ++++ b/fs/afs/dir.c +@@ -474,16 +474,6 @@ static int afs_dir_iterate_block(struct afs_vnode *dvnode, + continue; + } + +- /* Don't expose silly rename entries to userspace. */ +- if (nlen > 6 && +- dire->u.name[0] == '.' && +- ctx->actor != afs_lookup_filldir && +- ctx->actor != afs_lookup_one_filldir && +- memcmp(dire->u.name, ".__afs", 6) == 0) { +- ctx->pos = blkoff + next * sizeof(union afs_xdr_dirent); +- continue; +- } +- + /* found the next entry */ + if (!dir_emit(ctx, dire->u.name, nlen, + ntohl(dire->u.vnode), +-- +2.43.0 + diff --git a/queue-6.8/alsa-hda-cs35l41-set-channel-index-correctly-when-sy.patch b/queue-6.8/alsa-hda-cs35l41-set-channel-index-correctly-when-sy.patch new file mode 100644 index 00000000000..e4bc223b1f2 --- /dev/null +++ b/queue-6.8/alsa-hda-cs35l41-set-channel-index-correctly-when-sy.patch @@ -0,0 +1,69 @@ +From d84577ac51269d3eb2c2d32148604ecbe83196de Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 26 Jan 2024 16:40:02 +0000 +Subject: ALSA: hda: cs35l41: Set Channel Index correctly when system is + missing _DSD + +From: Stefan Binding + +[ Upstream commit 135096ebfab656823d0037102a00776f3914fee3 ] + +Current method to set Channel Index when the system is missing _DSD +assumes that the channels alternate, which is not guaranteed. +Instead use the same methodology as the main driver does when _DSD +exists. + +Fixes: 8c4c216db8fb ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD") + +Signed-off-by: Stefan Binding +Link: https://lore.kernel.org/r/20240126164005.367021-2-sbinding@opensource.cirrus.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/cs35l41_hda_property.c | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c +index e436d4dab317f..86ddaff915de1 100644 +--- a/sound/pci/hda/cs35l41_hda_property.c ++++ b/sound/pci/hda/cs35l41_hda_property.c +@@ -210,6 +210,7 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde + struct spi_device *spi; + bool dsd_found; + int ret; ++ int i; + + for (cfg = cs35l41_config_table; cfg->ssid; cfg++) { + if (!strcasecmp(cfg->ssid, cs35l41->acpi_subsystem_id)) +@@ -295,16 +296,6 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde + cs35l41->index = id == 0x40 ? 0 : 1; + } + +- if (cfg->num_amps == 3) +- /* 3 amps means a center channel, so no duplicate channels */ +- cs35l41->channel_index = 0; +- else +- /* +- * if 4 amps, there are duplicate channels, so they need different indexes +- * if 2 amps, no duplicate channels, channel_index would be 0 +- */ +- cs35l41->channel_index = cs35l41->index / 2; +- + cs35l41->reset_gpio = fwnode_gpiod_get_index(acpi_fwnode_handle(cs35l41->dacpi), "reset", + cs35l41->index, GPIOD_OUT_LOW, + "cs35l41-reset"); +@@ -312,6 +303,11 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde + + hw_cfg->spk_pos = cfg->channel[cs35l41->index]; + ++ cs35l41->channel_index = 0; ++ for (i = 0; i < cs35l41->index; i++) ++ if (cfg->channel[i] == hw_cfg->spk_pos) ++ cs35l41->channel_index++; ++ + if (cfg->boost_type == INTERNAL) { + hw_cfg->bst_type = CS35L41_INT_BOOST; + hw_cfg->bst_ind = cfg->boost_ind_nanohenry; +-- +2.43.0 + diff --git a/queue-6.8/alsa-hda-realtek-fix-alc285-issues-on-hp-envy-x360-l.patch b/queue-6.8/alsa-hda-realtek-fix-alc285-issues-on-hp-envy-x360-l.patch new file mode 100644 index 00000000000..c45469bdc09 --- /dev/null +++ b/queue-6.8/alsa-hda-realtek-fix-alc285-issues-on-hp-envy-x360-l.patch @@ -0,0 +1,147 @@ +From afeefbf0db84fe96ccb76fead9dd1ce6b08933f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 10 Mar 2024 20:58:44 +0700 +Subject: ALSA: hda/realtek: fix ALC285 issues on HP Envy x360 laptops + +From: Athaariq Ardhiansyah + +[ Upstream commit c062166995c9e57d5cd508b332898f79da319802 ] + +Realtek codec on HP Envy laptop series are heavily modified by vendor. +Therefore, need intervention to make it work properly. The patch fixes: + +- B&O soundbar speakers (between lid and keyboard) activation +- Enable LED on mute button +- Add missing process coefficient which affects the output amplifier +- Volume control synchronization between B&O soundbar and side speakers +- Unmute headset output on several HP Envy models +- Auto-enable headset mic when plugged + +This patch was tested on HP Envy x360 13-AR0107AU with Realtek ALC285 + +The only unsolved problem is output amplifier of all built-in speakers +is too weak, which causes volume of built-in speakers cannot be loud +as vendor's proprietary driver due to missing _DSD parameter in the +firmware. The solution is currently on research. Expected to has another +patch in the future. + +Potential fix to related issues, need test before close those issues: + +- https://bugzilla.kernel.org/show_bug.cgi?id=189331 +- https://bugzilla.kernel.org/show_bug.cgi?id=216632 +- https://bugzilla.kernel.org/show_bug.cgi?id=216311 +- https://bugzilla.kernel.org/show_bug.cgi?id=213507 + +Signed-off-by: Athaariq Ardhiansyah +Message-ID: <20240310140249.3695-1-foss@athaariq.my.id> +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_realtek.c | 63 +++++++++++++++++++++++++++++++++++ + 1 file changed, 63 insertions(+) + +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index a1facdb98d9a0..1dc5eb92ddcad 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6696,6 +6696,60 @@ static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, + } + } + ++static void alc285_fixup_hp_envy_x360(struct hda_codec *codec, ++ const struct hda_fixup *fix, ++ int action) ++{ ++ static const struct coef_fw coefs[] = { ++ WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023), ++ WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03), ++ WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a), ++ WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014), ++ WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15), ++ WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489), ++ WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0), ++ WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000), ++ WRITE_COEF(0x6e, 0x1005), { } ++ }; ++ ++ static const struct hda_pintbl pincfgs[] = { ++ { 0x12, 0xb7a60130 }, /* Internal microphone*/ ++ { 0x14, 0x90170150 }, /* B&O soundbar speakers */ ++ { 0x17, 0x90170153 }, /* Side speakers */ ++ { 0x19, 0x03a11040 }, /* Headset microphone */ ++ { } ++ }; ++ ++ switch (action) { ++ case HDA_FIXUP_ACT_PRE_PROBE: ++ snd_hda_apply_pincfgs(codec, pincfgs); ++ ++ /* Fixes volume control problem for side speakers */ ++ alc295_fixup_disable_dac3(codec, fix, action); ++ ++ /* Fixes no sound from headset speaker */ ++ snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0); ++ ++ /* Auto-enable headset mic when plugged */ ++ snd_hda_jack_set_gating_jack(codec, 0x19, 0x21); ++ ++ /* Headset mic volume enhancement */ ++ snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50); ++ break; ++ case HDA_FIXUP_ACT_INIT: ++ alc_process_coef_fw(codec, coefs); ++ break; ++ case HDA_FIXUP_ACT_BUILD: ++ rename_ctl(codec, "Bass Speaker Playback Volume", ++ "B&O-Tuned Playback Volume"); ++ rename_ctl(codec, "Front Playback Switch", ++ "B&O Soundbar Playback Switch"); ++ rename_ctl(codec, "Bass Speaker Playback Switch", ++ "Side Speaker Playback Switch"); ++ break; ++ } ++} ++ + /* for hda_fixup_thinkpad_acpi() */ + #include "thinkpad_helper.c" + +@@ -7297,6 +7351,7 @@ enum { + ALC280_FIXUP_HP_9480M, + ALC245_FIXUP_HP_X360_AMP, + ALC285_FIXUP_HP_SPECTRE_X360_EB1, ++ ALC285_FIXUP_HP_ENVY_X360, + ALC288_FIXUP_DELL_HEADSET_MODE, + ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC288_FIXUP_DELL_XPS_13, +@@ -9273,6 +9328,12 @@ static const struct hda_fixup alc269_fixups[] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_hp_spectre_x360_eb1 + }, ++ [ALC285_FIXUP_HP_ENVY_X360] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc285_fixup_hp_envy_x360, ++ .chained = true, ++ .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT, ++ }, + [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc285_fixup_ideapad_s740_coef, +@@ -9861,6 +9922,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), + SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), + SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), ++ SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360), + SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), + SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), + SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), +@@ -10559,6 +10621,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { + {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, + {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, + {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, ++ {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"}, + {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, + {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"}, + {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, +-- +2.43.0 + diff --git a/queue-6.8/alsa-hda-tas2781-add-lock-to-system_suspend.patch b/queue-6.8/alsa-hda-tas2781-add-lock-to-system_suspend.patch new file mode 100644 index 00000000000..2481e52f9ba --- /dev/null +++ b/queue-6.8/alsa-hda-tas2781-add-lock-to-system_suspend.patch @@ -0,0 +1,41 @@ +From c0c8ae53ca7ddc620e6bf76d19520eaab65da991 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Mar 2024 18:41:41 +0100 +Subject: ALSA: hda/tas2781: add lock to system_suspend + +From: Gergo Koteles + +[ Upstream commit c58e6ed55a1bb9811d6d936d001b068bb0419467 ] + +Add the missing lock around tasdevice_tuning_switch(). + +Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") +Signed-off-by: Gergo Koteles +Signed-off-by: Takashi Iwai +Message-ID: +Signed-off-by: Sasha Levin +--- + sound/pci/hda/tas2781_hda_i2c.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c +index ee3e0afc9b313..750e49fbb91e5 100644 +--- a/sound/pci/hda/tas2781_hda_i2c.c ++++ b/sound/pci/hda/tas2781_hda_i2c.c +@@ -885,9 +885,13 @@ static int tas2781_system_suspend(struct device *dev) + if (ret) + return ret; + ++ mutex_lock(&tas_hda->priv->codec_lock); ++ + /* Shutdown chip before system suspend */ + tasdevice_tuning_switch(tas_hda->priv, 1); + ++ mutex_unlock(&tas_hda->priv->codec_lock); ++ + /* + * Reset GPIO may be shared, so cannot reset here. + * However beyond this point, amps may be powered down. +-- +2.43.0 + diff --git a/queue-6.8/alsa-hda-tas2781-do-not-call-pm_runtime_force_-in-sy.patch b/queue-6.8/alsa-hda-tas2781-do-not-call-pm_runtime_force_-in-sy.patch new file mode 100644 index 00000000000..778353df618 --- /dev/null +++ b/queue-6.8/alsa-hda-tas2781-do-not-call-pm_runtime_force_-in-sy.patch @@ -0,0 +1,64 @@ +From ff28fd94e4bb4e38fd5560e94b7f00180891cc39 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Mar 2024 18:41:43 +0100 +Subject: ALSA: hda/tas2781: do not call pm_runtime_force_* in + system_resume/suspend + +From: Gergo Koteles + +[ Upstream commit 5f51de7e30c7282162a631af8a425b54a4576346 ] + +The runtime_resume function calls prmg_load and apply_calibration +functions, but system_resume also calls them, so calling +pm_runtime_force_resume before reset is unnecessary. + +For consistency, do not call the pm_runtime_force_suspend in +system_suspend, as runtime_suspend does the same. + +Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") +Signed-off-by: Gergo Koteles +Signed-off-by: Takashi Iwai +Message-ID: +Signed-off-by: Sasha Levin +--- + sound/pci/hda/tas2781_hda_i2c.c | 11 +---------- + 1 file changed, 1 insertion(+), 10 deletions(-) + +diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c +index 0e61e872bb716..a99f490c6a234 100644 +--- a/sound/pci/hda/tas2781_hda_i2c.c ++++ b/sound/pci/hda/tas2781_hda_i2c.c +@@ -870,14 +870,9 @@ static int tas2781_runtime_resume(struct device *dev) + static int tas2781_system_suspend(struct device *dev) + { + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); +- int ret; + + dev_dbg(tas_hda->priv->dev, "System Suspend\n"); + +- ret = pm_runtime_force_suspend(dev); +- if (ret) +- return ret; +- + mutex_lock(&tas_hda->priv->codec_lock); + + /* Shutdown chip before system suspend */ +@@ -895,14 +890,10 @@ static int tas2781_system_suspend(struct device *dev) + static int tas2781_system_resume(struct device *dev) + { + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); +- int i, ret; ++ int i; + + dev_dbg(tas_hda->priv->dev, "System Resume\n"); + +- ret = pm_runtime_force_resume(dev); +- if (ret) +- return ret; +- + mutex_lock(&tas_hda->priv->codec_lock); + + for (i = 0; i < tas_hda->priv->ndev; i++) { +-- +2.43.0 + diff --git a/queue-6.8/alsa-hda-tas2781-do-not-reset-cur_-values-in-runtime.patch b/queue-6.8/alsa-hda-tas2781-do-not-reset-cur_-values-in-runtime.patch new file mode 100644 index 00000000000..cd0c47fb066 --- /dev/null +++ b/queue-6.8/alsa-hda-tas2781-do-not-reset-cur_-values-in-runtime.patch @@ -0,0 +1,53 @@ +From a9e09b91e3e4a4362a4f24a6f9619039558d75cd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Mar 2024 18:41:42 +0100 +Subject: ALSA: hda/tas2781: do not reset cur_* values in runtime_suspend + +From: Gergo Koteles + +[ Upstream commit bec7760a6c5fa59593dac264fa0c628e46815986 ] + +The amplifier doesn't loose register state in software shutdown mode, so +there is no need to reset the cur_* values. + +Without these resets, the amplifier can be turned on after +runtime_suspend without waiting for the program and +profile to be restored. + +Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") +Signed-off-by: Gergo Koteles +Signed-off-by: Takashi Iwai +Message-ID: +Signed-off-by: Sasha Levin +--- + sound/pci/hda/tas2781_hda_i2c.c | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c +index 750e49fbb91e5..0e61e872bb716 100644 +--- a/sound/pci/hda/tas2781_hda_i2c.c ++++ b/sound/pci/hda/tas2781_hda_i2c.c +@@ -832,7 +832,6 @@ static void tas2781_hda_i2c_remove(struct i2c_client *clt) + static int tas2781_runtime_suspend(struct device *dev) + { + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); +- int i; + + dev_dbg(tas_hda->dev, "Runtime Suspend\n"); + +@@ -843,12 +842,6 @@ static int tas2781_runtime_suspend(struct device *dev) + tas_hda->priv->playback_started = false; + } + +- for (i = 0; i < tas_hda->priv->ndev; i++) { +- tas_hda->priv->tasdevice[i].cur_book = -1; +- tas_hda->priv->tasdevice[i].cur_prog = -1; +- tas_hda->priv->tasdevice[i].cur_conf = -1; +- } +- + mutex_unlock(&tas_hda->priv->codec_lock); + + return 0; +-- +2.43.0 + diff --git a/queue-6.8/alsa-hda-tas2781-restore-power-state-after-system_re.patch b/queue-6.8/alsa-hda-tas2781-restore-power-state-after-system_re.patch new file mode 100644 index 00000000000..ac94da4d1b2 --- /dev/null +++ b/queue-6.8/alsa-hda-tas2781-restore-power-state-after-system_re.patch @@ -0,0 +1,84 @@ +From eb0808aab77798a933bc64ccd59108cd1332ed59 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Mar 2024 18:41:44 +0100 +Subject: ALSA: hda/tas2781: restore power state after system_resume + +From: Gergo Koteles + +[ Upstream commit 9fc91a6fe37c78ef301aed4251f7e50b8524e72d ] + +After system_resume the amplifers will remain off, even if they were on +before system_suspend. + +Use playback_started bool to save the playback state, and restore power +state based on it. + +Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") +Signed-off-by: Gergo Koteles +Signed-off-by: Takashi Iwai +Message-ID: <1742b61901781826f6e6212ffe1d21af542d134a.1709918447.git.soyer@irl.hu> +Signed-off-by: Sasha Levin +--- + sound/pci/hda/tas2781_hda_i2c.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c +index a99f490c6a234..7aef93126ed0c 100644 +--- a/sound/pci/hda/tas2781_hda_i2c.c ++++ b/sound/pci/hda/tas2781_hda_i2c.c +@@ -160,11 +160,13 @@ static void tas2781_hda_playback_hook(struct device *dev, int action) + pm_runtime_get_sync(dev); + mutex_lock(&tas_hda->priv->codec_lock); + tasdevice_tuning_switch(tas_hda->priv, 0); ++ tas_hda->priv->playback_started = true; + mutex_unlock(&tas_hda->priv->codec_lock); + break; + case HDA_GEN_PCM_ACT_CLOSE: + mutex_lock(&tas_hda->priv->codec_lock); + tasdevice_tuning_switch(tas_hda->priv, 1); ++ tas_hda->priv->playback_started = false; + mutex_unlock(&tas_hda->priv->codec_lock); + + pm_runtime_mark_last_busy(dev); +@@ -666,6 +668,7 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context) + tasdevice_save_calibration(tas_priv); + + tasdevice_tuning_switch(tas_hda->priv, 0); ++ tas_hda->priv->playback_started = true; + + out: + mutex_unlock(&tas_hda->priv->codec_lock); +@@ -837,6 +840,9 @@ static int tas2781_runtime_suspend(struct device *dev) + + mutex_lock(&tas_hda->priv->codec_lock); + ++ /* The driver powers up the amplifiers at module load time. ++ * Stop the playback if it's unused. ++ */ + if (tas_hda->priv->playback_started) { + tasdevice_tuning_switch(tas_hda->priv, 1); + tas_hda->priv->playback_started = false; +@@ -876,7 +882,8 @@ static int tas2781_system_suspend(struct device *dev) + mutex_lock(&tas_hda->priv->codec_lock); + + /* Shutdown chip before system suspend */ +- tasdevice_tuning_switch(tas_hda->priv, 1); ++ if (tas_hda->priv->playback_started) ++ tasdevice_tuning_switch(tas_hda->priv, 1); + + mutex_unlock(&tas_hda->priv->codec_lock); + +@@ -908,6 +915,10 @@ static int tas2781_system_resume(struct device *dev) + * calibrated data inside algo. + */ + tasdevice_apply_calibration(tas_hda->priv); ++ ++ if (tas_hda->priv->playback_started) ++ tasdevice_tuning_switch(tas_hda->priv, 0); ++ + mutex_unlock(&tas_hda->priv->codec_lock); + + return 0; +-- +2.43.0 + diff --git a/queue-6.8/alsa-hda-tas2781-use-dev_dbg-in-system_resume.patch b/queue-6.8/alsa-hda-tas2781-use-dev_dbg-in-system_resume.patch new file mode 100644 index 00000000000..9fa0f784668 --- /dev/null +++ b/queue-6.8/alsa-hda-tas2781-use-dev_dbg-in-system_resume.patch @@ -0,0 +1,39 @@ +From df907fef579ca5181e3aef66a7c1693c6e8770df Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Mar 2024 18:41:40 +0100 +Subject: ALSA: hda/tas2781: use dev_dbg in system_resume + +From: Gergo Koteles + +[ Upstream commit c850c9121cc8de867ce3ac36b9ae9d05f62bef14 ] + +The system_resume function uses dev_info for tracing, but the other pm +functions use dev_dbg. + +Use dev_dbg as the other pm functions. + +Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") +Signed-off-by: Gergo Koteles +Signed-off-by: Takashi Iwai +Message-ID: <140f3c689c9eb5874e6eb48a570fcd8207f06a41.1709918447.git.soyer@irl.hu> +Signed-off-by: Sasha Levin +--- + sound/pci/hda/tas2781_hda_i2c.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c +index 1bfb00102a77a..ee3e0afc9b313 100644 +--- a/sound/pci/hda/tas2781_hda_i2c.c ++++ b/sound/pci/hda/tas2781_hda_i2c.c +@@ -900,7 +900,7 @@ static int tas2781_system_resume(struct device *dev) + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); + int i, ret; + +- dev_info(tas_hda->priv->dev, "System Resume\n"); ++ dev_dbg(tas_hda->priv->dev, "System Resume\n"); + + ret = pm_runtime_force_resume(dev); + if (ret) +-- +2.43.0 + diff --git a/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-4i4-low-voltage-.patch b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-4i4-low-voltage-.patch new file mode 100644 index 00000000000..5a732c61d2e --- /dev/null +++ b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-4i4-low-voltage-.patch @@ -0,0 +1,75 @@ +From 710cd8c9f07844eff3148636befc89524044e143 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 10 Mar 2024 21:04:27 +1030 +Subject: ALSA: scarlett2: Fix Scarlett 4th Gen 4i4 low-voltage detection + +From: Geoffrey D. Bennett + +[ Upstream commit 6ef1f08b53fdb6f5f00f17f85a60b3247d77fa54 ] + +The value currently being read to determine the low-voltage state is +actually the front panel state. Fix the code to use the correct offset +for the low-voltage state. + +Signed-off-by: Geoffrey D. Bennett +Fixes: d7cfa2fdfc8a ("ALSA: scarlett2: Add power status control") +Signed-off-by: Takashi Iwai +Message-ID: +Signed-off-by: Sasha Levin +--- + sound/usb/mixer_scarlett2.c | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c +index 6de605a601e5f..bce69a78c5052 100644 +--- a/sound/usb/mixer_scarlett2.c ++++ b/sound/usb/mixer_scarlett2.c +@@ -415,7 +415,7 @@ enum { + SCARLETT2_CONFIG_INPUT_SELECT_SWITCH, + SCARLETT2_CONFIG_INPUT_LINK_SWITCH, + SCARLETT2_CONFIG_POWER_EXT, +- SCARLETT2_CONFIG_POWER_STATUS, ++ SCARLETT2_CONFIG_POWER_LOW, + SCARLETT2_CONFIG_PCM_INPUT_SWITCH, + SCARLETT2_CONFIG_DIRECT_MONITOR_GAIN, + SCARLETT2_CONFIG_COUNT +@@ -723,8 +723,8 @@ static const struct scarlett2_config_set scarlett2_config_set_gen4_4i4 = { + [SCARLETT2_CONFIG_POWER_EXT] = { + .offset = 0x168 }, + +- [SCARLETT2_CONFIG_POWER_STATUS] = { +- .offset = 0x66 } ++ [SCARLETT2_CONFIG_POWER_LOW] = { ++ .offset = 0x16d } + } + }; + +@@ -6294,8 +6294,7 @@ static int scarlett2_update_power_status(struct usb_mixer_interface *mixer) + { + struct scarlett2_data *private = mixer->private_data; + int err; +- u8 power_ext; +- u8 power_status; ++ u8 power_ext, power_low; + + private->power_status_updated = 0; + +@@ -6304,12 +6303,12 @@ static int scarlett2_update_power_status(struct usb_mixer_interface *mixer) + if (err < 0) + return err; + +- err = scarlett2_usb_get_config(mixer, SCARLETT2_CONFIG_POWER_STATUS, +- 1, &power_status); ++ err = scarlett2_usb_get_config(mixer, SCARLETT2_CONFIG_POWER_LOW, ++ 1, &power_low); + if (err < 0) + return err; + +- if (power_status > 1) ++ if (power_low) + private->power_status = SCARLETT2_POWER_STATUS_FAIL; + else if (power_ext) + private->power_status = SCARLETT2_POWER_STATUS_EXT; +-- +2.43.0 + diff --git a/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-autogain-status-.patch b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-autogain-status-.patch new file mode 100644 index 00000000000..885d80e3451 --- /dev/null +++ b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-autogain-status-.patch @@ -0,0 +1,127 @@ +From 168c851a19bddf2db12ccb230d3201a9414668c6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 10 Mar 2024 21:04:41 +1030 +Subject: ALSA: scarlett2: Fix Scarlett 4th Gen autogain status values + +From: Geoffrey D. Bennett + +[ Upstream commit be157c4683a91857d3fdf319117c9b9dc6e8a849 ] + +The meanings of the raw_auto_gain_status values were originally +guessed through experimentation, but the official names have now been +discovered. Update the autogain status control strings accordingly. + +Signed-off-by: Geoffrey D. Bennett +Fixes: 0a995e38dc44 ("ALSA: scarlett2: Add support for software-controllable input gain") +Signed-off-by: Takashi Iwai +Message-ID: <8bd12a5e7dc714801dd9887c4bc5cb35c384e27c.1710047969.git.g@b4.vu> +Signed-off-by: Sasha Levin +--- + sound/usb/mixer_scarlett2.c | 62 ++++++++++++++++++++----------------- + 1 file changed, 34 insertions(+), 28 deletions(-) + +diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c +index bce69a78c5052..3815ce1d216e6 100644 +--- a/sound/usb/mixer_scarlett2.c ++++ b/sound/usb/mixer_scarlett2.c +@@ -284,14 +284,22 @@ static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = { + "Mute Playback Switch", "Dim Playback Switch" + }; + +-/* Autogain Status Values */ +-enum { +- SCARLETT2_AUTOGAIN_STATUS_STOPPED, +- SCARLETT2_AUTOGAIN_STATUS_RUNNING, +- SCARLETT2_AUTOGAIN_STATUS_FAILED, +- SCARLETT2_AUTOGAIN_STATUS_CANCELLED, +- SCARLETT2_AUTOGAIN_STATUS_UNKNOWN, +- SCARLETT2_AUTOGAIN_STATUS_COUNT ++/* The autogain_status is set based on the autogain_switch and ++ * raw_autogain_status values. ++ * ++ * If autogain_switch is set, autogain_status is set to 0 (Running). ++ * The other status values are from the raw_autogain_status value + 1. ++ */ ++static const char *const scarlett2_autogain_status_texts[] = { ++ "Running", ++ "Success", ++ "SuccessDRover", ++ "WarnMinGainLimit", ++ "FailDRunder", ++ "FailMaxGainLimit", ++ "FailClipped", ++ "Cancelled", ++ "Invalid" + }; + + /* Power Status Values */ +@@ -2835,9 +2843,9 @@ static int scarlett2_autogain_is_running(struct scarlett2_data *private) + { + int i; + ++ /* autogain_status[] is 0 if autogain is running */ + for (i = 0; i < private->info->gain_input_count; i++) +- if (private->autogain_status[i] == +- SCARLETT2_AUTOGAIN_STATUS_RUNNING) ++ if (!private->autogain_status[i]) + return 1; + + return 0; +@@ -2867,25 +2875,25 @@ static int scarlett2_update_autogain(struct usb_mixer_interface *mixer) + return err; + + /* Translate autogain_switch and raw_autogain_status into +- * autogain_status ++ * autogain_status. ++ * ++ * When autogain_switch[] is set, the status is the first ++ * element in scarlett2_autogain_status_texts[] (Running). The ++ * subsequent elements correspond to the status value from the ++ * device (raw_autogain_status[]) + 1. The last element is ++ * "Invalid", in case the device reports a status outside the ++ * range of scarlett2_autogain_status_texts[]. + */ + for (i = 0; i < info->gain_input_count; i++) + if (private->autogain_switch[i]) ++ private->autogain_status[i] = 0; ++ else if (raw_autogain_status[i] < ++ ARRAY_SIZE(scarlett2_autogain_status_texts) - 1) + private->autogain_status[i] = +- SCARLETT2_AUTOGAIN_STATUS_RUNNING; +- else if (raw_autogain_status[i] == 0) +- private->autogain_status[i] = +- SCARLETT2_AUTOGAIN_STATUS_STOPPED; +- else if (raw_autogain_status[i] >= 2 && +- raw_autogain_status[i] <= 5) +- private->autogain_status[i] = +- SCARLETT2_AUTOGAIN_STATUS_FAILED; +- else if (raw_autogain_status[i] == 6) +- private->autogain_status[i] = +- SCARLETT2_AUTOGAIN_STATUS_CANCELLED; ++ raw_autogain_status[i] + 1; + else + private->autogain_status[i] = +- SCARLETT2_AUTOGAIN_STATUS_UNKNOWN; ++ ARRAY_SIZE(scarlett2_autogain_status_texts) - 1; + + return 0; + } +@@ -3111,12 +3119,10 @@ static int scarlett2_autogain_switch_ctl_put( + static int scarlett2_autogain_status_ctl_info( + struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo) + { +- static const char *const values[SCARLETT2_AUTOGAIN_STATUS_COUNT] = { +- "Stopped", "Running", "Failed", "Cancelled", "Unknown" +- }; +- + return snd_ctl_enum_info( +- uinfo, 1, SCARLETT2_AUTOGAIN_STATUS_COUNT, values); ++ uinfo, 1, ++ ARRAY_SIZE(scarlett2_autogain_status_texts), ++ scarlett2_autogain_status_texts); + } + + static const struct snd_kcontrol_new scarlett2_autogain_switch_ctl = { +-- +2.43.0 + diff --git a/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch new file mode 100644 index 00000000000..6dbd253057f --- /dev/null +++ b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch @@ -0,0 +1,58 @@ +From 1824ef6dcf983f23e453268a0e64ff62a96e0030 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 10 Mar 2024 21:04:59 +1030 +Subject: ALSA: scarlett2: Fix Scarlett 4th Gen input gain range + +From: Geoffrey D. Bennett + +[ Upstream commit a45cf0a0834779c741ac204c0320469e9aaef006 ] + +The input gain range TLV was declared as -70dB to 0dB, but the preamp +gain range is actually 0dB to +70dB. Rename SCARLETT2_GAIN_BIAS to +SCARLETT2_MAX_GAIN and update the TLV to fix. + +Signed-off-by: Geoffrey D. Bennett +Fixes: 0a995e38dc44 ("ALSA: scarlett2: Add support for software-controllable input gain") +Signed-off-by: Takashi Iwai +Message-ID: <9168317b5ac5335943d3f14dbcd1cc2d9b2299d0.1710047969.git.g@b4.vu> +Signed-off-by: Sasha Levin +--- + sound/usb/mixer_scarlett2.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c +index 3815ce1d216e6..ffb8bcebf9ad6 100644 +--- a/sound/usb/mixer_scarlett2.c ++++ b/sound/usb/mixer_scarlett2.c +@@ -173,7 +173,9 @@ + + /* some gui mixers can't handle negative ctl values */ + #define SCARLETT2_VOLUME_BIAS 127 +-#define SCARLETT2_GAIN_BIAS 70 ++ ++/* maximum preamp input gain */ ++#define SCARLETT2_MAX_GAIN 70 + + /* mixer range from -80dB to +6dB in 0.5dB steps */ + #define SCARLETT2_MIXER_MIN_DB -80 +@@ -3464,7 +3466,7 @@ static int scarlett2_input_gain_ctl_info(struct snd_kcontrol *kctl, + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = elem->channels; + uinfo->value.integer.min = 0; +- uinfo->value.integer.max = SCARLETT2_GAIN_BIAS; ++ uinfo->value.integer.max = SCARLETT2_MAX_GAIN; + uinfo->value.integer.step = 1; + + unlock: +@@ -3541,7 +3543,7 @@ static int scarlett2_input_gain_ctl_put(struct snd_kcontrol *kctl, + } + + static const DECLARE_TLV_DB_MINMAX( +- db_scale_scarlett2_gain, -SCARLETT2_GAIN_BIAS * 100, 0 ++ db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN * 100 + ); + + static const struct snd_kcontrol_new scarlett2_input_gain_ctl = { +-- +2.43.0 + diff --git a/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch-21200 b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch-21200 new file mode 100644 index 00000000000..01d4763c4d7 --- /dev/null +++ b/queue-6.8/alsa-scarlett2-fix-scarlett-4th-gen-input-gain-range.patch-21200 @@ -0,0 +1,62 @@ +From c80f38fc036253689d82a41f12995db5df0e3fb6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 11 Mar 2024 19:56:08 +1030 +Subject: ALSA: scarlett2: Fix Scarlett 4th Gen input gain range again + +From: Geoffrey D. Bennett + +[ Upstream commit 6719cd5e45111449f4021e08f2e488f17a9b292b ] + +The 4th Gen input preamp gain range is 0dB to +69dB, although the +control values range from 0 to 70. Replace SCARLETT2_MAX_GAIN with +SCARLETT2_MAX_GAIN_VALUE and SCARLETT2_MAX_GAIN_DB, and update the TLV +again. + +Signed-off-by: Geoffrey D. Bennett +Fixes: a45cf0a08347 ("ALSA: scarlett2: Fix Scarlett 4th Gen input gain range") +Message-ID: +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/usb/mixer_scarlett2.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c +index ffb8bcebf9ad6..bd114be537d7a 100644 +--- a/sound/usb/mixer_scarlett2.c ++++ b/sound/usb/mixer_scarlett2.c +@@ -174,8 +174,11 @@ + /* some gui mixers can't handle negative ctl values */ + #define SCARLETT2_VOLUME_BIAS 127 + +-/* maximum preamp input gain */ +-#define SCARLETT2_MAX_GAIN 70 ++/* maximum preamp input gain and value ++ * values are from 0 to 70, preamp gain is from 0 to 69 dB ++ */ ++#define SCARLETT2_MAX_GAIN_VALUE 70 ++#define SCARLETT2_MAX_GAIN_DB 69 + + /* mixer range from -80dB to +6dB in 0.5dB steps */ + #define SCARLETT2_MIXER_MIN_DB -80 +@@ -3466,7 +3469,7 @@ static int scarlett2_input_gain_ctl_info(struct snd_kcontrol *kctl, + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = elem->channels; + uinfo->value.integer.min = 0; +- uinfo->value.integer.max = SCARLETT2_MAX_GAIN; ++ uinfo->value.integer.max = SCARLETT2_MAX_GAIN_VALUE; + uinfo->value.integer.step = 1; + + unlock: +@@ -3543,7 +3546,7 @@ static int scarlett2_input_gain_ctl_put(struct snd_kcontrol *kctl, + } + + static const DECLARE_TLV_DB_MINMAX( +- db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN * 100 ++ db_scale_scarlett2_gain, 0, SCARLETT2_MAX_GAIN_DB * 100 + ); + + static const struct snd_kcontrol_new scarlett2_input_gain_ctl = { +-- +2.43.0 + diff --git a/queue-6.8/alsa-seq-fix-function-cast-warnings.patch b/queue-6.8/alsa-seq-fix-function-cast-warnings.patch new file mode 100644 index 00000000000..28728a4532e --- /dev/null +++ b/queue-6.8/alsa-seq-fix-function-cast-warnings.patch @@ -0,0 +1,95 @@ +From bd03ffa19ef6323037f4684d51abe38813e85764 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 14:53:43 +0100 +Subject: ALSA: seq: fix function cast warnings + +From: Takashi Iwai + +[ Upstream commit d7bf73809849463f76de42aad62c850305dd6c5d ] + +clang-16 points out a control flow integrity (kcfi) issue when event +callbacks get converted to incompatible types: + +sound/core/seq/seq_midi.c:135:30: error: cast from 'int (*)(struct snd_rawmidi_substream *, const char *, int)' to 'snd_seq_dump_func_t' (aka 'int (*)(void *, void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] + 135 | snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +sound/core/seq/seq_virmidi.c:83:31: error: cast from 'int (*)(struct snd_rawmidi_substream *, const unsigned char *, int)' to 'snd_seq_dump_func_t' (aka 'int (*)(void *, void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] + 83 | snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For addressing those errors, introduce wrapper functions that are used +for callbacks and bridge to the actual function call with pointer +cast. + +The code was originally added with the initial ALSA merge in linux-2.5.4. + +[ the patch description shamelessly copied from Arnd's original patch + -- tiwai ] + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Reported-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20240213101020.459183-1-arnd@kernel.org +Link: https://lore.kernel.org/r/20240213135343.16411-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/core/seq/seq_midi.c | 8 +++++++- + sound/core/seq/seq_virmidi.c | 9 ++++++++- + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c +index 18320a248aa7d..78dcb0ea15582 100644 +--- a/sound/core/seq/seq_midi.c ++++ b/sound/core/seq/seq_midi.c +@@ -113,6 +113,12 @@ static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, i + return 0; + } + ++/* callback for snd_seq_dump_var_event(), bridging to dump_midi() */ ++static int __dump_midi(void *ptr, void *buf, int count) ++{ ++ return dump_midi(ptr, buf, count); ++} ++ + static int event_process_midi(struct snd_seq_event *ev, int direct, + void *private_data, int atomic, int hop) + { +@@ -132,7 +138,7 @@ static int event_process_midi(struct snd_seq_event *ev, int direct, + pr_debug("ALSA: seq_midi: invalid sysex event flags = 0x%x\n", ev->flags); + return 0; + } +- snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream); ++ snd_seq_dump_var_event(ev, __dump_midi, substream); + snd_midi_event_reset_decode(msynth->parser); + } else { + if (msynth->parser == NULL) +diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c +index 1b9260108e482..1678737f11be7 100644 +--- a/sound/core/seq/seq_virmidi.c ++++ b/sound/core/seq/seq_virmidi.c +@@ -62,6 +62,13 @@ static void snd_virmidi_init_event(struct snd_virmidi *vmidi, + /* + * decode input event and put to read buffer of each opened file + */ ++ ++/* callback for snd_seq_dump_var_event(), bridging to snd_rawmidi_receive() */ ++static int dump_to_rawmidi(void *ptr, void *buf, int count) ++{ ++ return snd_rawmidi_receive(ptr, buf, count); ++} ++ + static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev, + struct snd_seq_event *ev, + bool atomic) +@@ -80,7 +87,7 @@ static int snd_virmidi_dev_receive_event(struct snd_virmidi_dev *rdev, + if (ev->type == SNDRV_SEQ_EVENT_SYSEX) { + if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE) + continue; +- snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream); ++ snd_seq_dump_var_event(ev, dump_to_rawmidi, vmidi->substream); + snd_midi_event_reset_decode(vmidi->parser); + } else { + len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev); +-- +2.43.0 + diff --git a/queue-6.8/alsa-usb-audio-stop-parsing-channels-bits-when-all-c.patch b/queue-6.8/alsa-usb-audio-stop-parsing-channels-bits-when-all-c.patch new file mode 100644 index 00000000000..e37b4e2eabe --- /dev/null +++ b/queue-6.8/alsa-usb-audio-stop-parsing-channels-bits-when-all-c.patch @@ -0,0 +1,43 @@ +From 78e5af36508d7d800f3387cb90e8a57834019bec Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 Mar 2024 09:15:09 +0100 +Subject: ALSA: usb-audio: Stop parsing channels bits when all channels are + found. + +From: Johan Carlsson + +[ Upstream commit a39d51ff1f52cd0b6fe7d379ac93bd8b4237d1b7 ] + +If a usb audio device sets more bits than the amount of channels +it could write outside of the map array. + +Signed-off-by: Johan Carlsson +Fixes: 04324ccc75f9 ("ALSA: usb-audio: add channel map support") +Message-ID: <20240313081509.9801-1-johan.carlsson@teenage.engineering> +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/usb/stream.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/sound/usb/stream.c b/sound/usb/stream.c +index 3d4add94e367d..d5409f3879455 100644 +--- a/sound/usb/stream.c ++++ b/sound/usb/stream.c +@@ -300,9 +300,12 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, + c = 0; + + if (bits) { +- for (; bits && *maps; maps++, bits >>= 1) ++ for (; bits && *maps; maps++, bits >>= 1) { + if (bits & 1) + chmap->map[c++] = *maps; ++ if (c == chmap->channels) ++ break; ++ } + } else { + /* If we're missing wChannelConfig, then guess something + to make sure the channel map is not skipped entirely */ +-- +2.43.0 + diff --git a/queue-6.8/aoe-fix-the-potential-use-after-free-problem-in-aoec.patch b/queue-6.8/aoe-fix-the-potential-use-after-free-problem-in-aoec.patch new file mode 100644 index 00000000000..9a27fcbad1d --- /dev/null +++ b/queue-6.8/aoe-fix-the-potential-use-after-free-problem-in-aoec.patch @@ -0,0 +1,88 @@ +From 3d9cad798445bb10f0bd61c923a80cce7e1cebef Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Mar 2024 16:20:48 +0800 +Subject: aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts + +From: Chun-Yi Lee + +[ Upstream commit f98364e926626c678fb4b9004b75cacf92ff0662 ] + +This patch is against CVE-2023-6270. The description of cve is: + + A flaw was found in the ATA over Ethernet (AoE) driver in the Linux + kernel. The aoecmd_cfg_pkts() function improperly updates the refcnt on + `struct net_device`, and a use-after-free can be triggered by racing + between the free on the struct and the access through the `skbtxq` + global queue. This could lead to a denial of service condition or + potential code execution. + +In aoecmd_cfg_pkts(), it always calls dev_put(ifp) when skb initial +code is finished. But the net_device ifp will still be used in +later tx()->dev_queue_xmit() in kthread. Which means that the +dev_put(ifp) should NOT be called in the success path of skb +initial code in aoecmd_cfg_pkts(). Otherwise tx() may run into +use-after-free because the net_device is freed. + +This patch removed the dev_put(ifp) in the success path in +aoecmd_cfg_pkts(), and added dev_put() after skb xmit in tx(). + +Link: https://nvd.nist.gov/vuln/detail/CVE-2023-6270 +Fixes: 7562f876cd93 ("[NET]: Rework dev_base via list_head (v3)") +Signed-off-by: Chun-Yi Lee +Link: https://lore.kernel.org/r/20240305082048.25526-1-jlee@suse.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/block/aoe/aoecmd.c | 12 ++++++------ + drivers/block/aoe/aoenet.c | 1 + + 2 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c +index d7317425be510..cc9077b588d7e 100644 +--- a/drivers/block/aoe/aoecmd.c ++++ b/drivers/block/aoe/aoecmd.c +@@ -419,13 +419,16 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff_head *qu + rcu_read_lock(); + for_each_netdev_rcu(&init_net, ifp) { + dev_hold(ifp); +- if (!is_aoe_netif(ifp)) +- goto cont; ++ if (!is_aoe_netif(ifp)) { ++ dev_put(ifp); ++ continue; ++ } + + skb = new_skb(sizeof *h + sizeof *ch); + if (skb == NULL) { + printk(KERN_INFO "aoe: skb alloc failure\n"); +- goto cont; ++ dev_put(ifp); ++ continue; + } + skb_put(skb, sizeof *h + sizeof *ch); + skb->dev = ifp; +@@ -440,9 +443,6 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff_head *qu + h->major = cpu_to_be16(aoemajor); + h->minor = aoeminor; + h->cmd = AOECMD_CFG; +- +-cont: +- dev_put(ifp); + } + rcu_read_unlock(); + } +diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c +index c51ea95bc2ce4..923a134fd7665 100644 +--- a/drivers/block/aoe/aoenet.c ++++ b/drivers/block/aoe/aoenet.c +@@ -63,6 +63,7 @@ tx(int id) __must_hold(&txlock) + pr_warn("aoe: packet could not be sent on %s. %s\n", + ifp ? ifp->name : "netif", + "consider increasing tx_queue_len"); ++ dev_put(ifp); + spin_lock_irq(&txlock); + } + return 0; +-- +2.43.0 + diff --git a/queue-6.8/arch-powerpc-remove-linux-fb.h-from-backlight-code.patch b/queue-6.8/arch-powerpc-remove-linux-fb.h-from-backlight-code.patch new file mode 100644 index 00000000000..bfaf3f6bad0 --- /dev/null +++ b/queue-6.8/arch-powerpc-remove-linux-fb.h-from-backlight-code.patch @@ -0,0 +1,98 @@ +From 6873f153d744b21560e4409feb0f7a51b3258c6e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Mar 2024 13:28:20 +0100 +Subject: arch/powerpc: Remove from backlight code + +From: Thomas Zimmermann + +[ Upstream commit 838f865802b9f26135ea7df4e30f89ac2f50c23e ] + +Replace with a forward declaration in to +resolve an unnecessary dependency. Remove pmac_backlight_curve_lookup() +and struct fb_info from source and header files. The function and the +framebuffer struct are unused. No functional changes. + +v3: + * Add Fixes tag (Christophe) + * fix typos in commit message (Jani) + +Signed-off-by: Thomas Zimmermann +Fixes: d565dd3b0824 ("[PATCH] powerpc: More via-pmu backlight fixes") +Reviewed-by: Jani Nikula +Acked-by: Michael Ellerman # (powerpc) +Link: https://patchwork.freedesktop.org/patch/msgid/20240306122935.10626-4-tzimmermann@suse.de +Signed-off-by: Sasha Levin +--- + arch/powerpc/include/asm/backlight.h | 5 ++-- + arch/powerpc/platforms/powermac/backlight.c | 26 --------------------- + 2 files changed, 2 insertions(+), 29 deletions(-) + +diff --git a/arch/powerpc/include/asm/backlight.h b/arch/powerpc/include/asm/backlight.h +index 1b5eab62ed047..061a910d74929 100644 +--- a/arch/powerpc/include/asm/backlight.h ++++ b/arch/powerpc/include/asm/backlight.h +@@ -10,15 +10,14 @@ + #define __ASM_POWERPC_BACKLIGHT_H + #ifdef __KERNEL__ + +-#include + #include + ++struct backlight_device; ++ + /* For locking instructions, see the implementation file */ + extern struct backlight_device *pmac_backlight; + extern struct mutex pmac_backlight_mutex; + +-extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); +- + extern int pmac_has_backlight_type(const char *type); + + extern void pmac_backlight_key(int direction); +diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c +index aeb79a8b3e109..12bc01353bd3c 100644 +--- a/arch/powerpc/platforms/powermac/backlight.c ++++ b/arch/powerpc/platforms/powermac/backlight.c +@@ -9,7 +9,6 @@ + */ + + #include +-#include + #include + #include + #include +@@ -72,31 +71,6 @@ int pmac_has_backlight_type(const char *type) + return 0; + } + +-int pmac_backlight_curve_lookup(struct fb_info *info, int value) +-{ +- int level = (FB_BACKLIGHT_LEVELS - 1); +- +- if (info && info->bl_dev) { +- int i, max = 0; +- +- /* Look for biggest value */ +- for (i = 0; i < FB_BACKLIGHT_LEVELS; i++) +- max = max((int)info->bl_curve[i], max); +- +- /* Look for nearest value */ +- for (i = 0; i < FB_BACKLIGHT_LEVELS; i++) { +- int diff = abs(info->bl_curve[i] - value); +- if (diff < max) { +- max = diff; +- level = i; +- } +- } +- +- } +- +- return level; +-} +- + static void pmac_backlight_key_worker(struct work_struct *work) + { + if (atomic_read(&kernel_backlight_disabled)) +-- +2.43.0 + diff --git a/queue-6.8/arm-dts-arm-realview-fix-development-chip-rom-compat.patch b/queue-6.8/arm-dts-arm-realview-fix-development-chip-rom-compat.patch new file mode 100644 index 00000000000..2a804c5a848 --- /dev/null +++ b/queue-6.8/arm-dts-arm-realview-fix-development-chip-rom-compat.patch @@ -0,0 +1,43 @@ +From b619bb3601e2b16caf26b46bb0304471319d8876 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 30 Aug 2023 17:03:04 +0200 +Subject: ARM: dts: arm: realview: Fix development chip ROM compatible value + +From: Geert Uytterhoeven + +[ Upstream commit 3baa4c5143d65ebab2de0d99a395e5f4f1f46608 ] + +When the development chip ROM was added, the "direct-mapped" compatible +value was already obsolete. In addition, the device node lacked the +accompanying "probe-type" property, causing the old physmap_of_core +driver to fall back to trying all available probe types. +Unfortunately this fallback was lost when the DT and pdata cases were +merged. + +Fix this by using the modern "mtd-rom" compatible value instead. + +Fixes: 5c3f5edbe0a1dff3 ("ARM: realview: add flash devices to the PB1176 DTS") +Fixes: 642b1e8dbed7bbbf ("mtd: maps: Merge physmap_of.c into physmap-core.c") +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/arm/arm-realview-pb1176.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/arm/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm/arm-realview-pb1176.dts +index efed325af88d2..d99bac02232b3 100644 +--- a/arch/arm/boot/dts/arm/arm-realview-pb1176.dts ++++ b/arch/arm/boot/dts/arm/arm-realview-pb1176.dts +@@ -451,7 +451,7 @@ pb1176_serial3: serial@1010f000 { + + /* Direct-mapped development chip ROM */ + pb1176_rom@10200000 { +- compatible = "direct-mapped"; ++ compatible = "mtd-rom"; + reg = <0x10200000 0x4000>; + bank-width = <1>; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm-dts-imx6dl-yapp4-fix-typo-in-the-qca-switch-regi.patch b/queue-6.8/arm-dts-imx6dl-yapp4-fix-typo-in-the-qca-switch-regi.patch new file mode 100644 index 00000000000..ec39544d919 --- /dev/null +++ b/queue-6.8/arm-dts-imx6dl-yapp4-fix-typo-in-the-qca-switch-regi.patch @@ -0,0 +1,42 @@ +From 673230f0bc85209e4bff8ecb6a1b099cc9117940 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 10:03:27 +0100 +Subject: ARM: dts: imx6dl-yapp4: Fix typo in the QCA switch register address +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Michal Vokáč + +[ Upstream commit 023bd910d3ab735459f84b22bb99fb9e00bd9d76 ] + +This change does not have any functional effect. The switch works just +fine without this patch as it has full access to all the addresses +on the bus. This is simply a clean-up to set the node name address +and reg address to the same value. + +Fixes: 15b43e497ffd ("ARM: dts: imx6dl-yapp4: Use correct pseudo PHY address for the switch") +Signed-off-by: Michal Vokáč +Reviewed-by: Andrew Lunn +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi +index 3be38a3c4bb11..d2b3e09eb7df8 100644 +--- a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi ++++ b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi +@@ -127,7 +127,7 @@ phy_port3: phy@2 { + + switch@10 { + compatible = "qca,qca8334"; +- reg = <10>; ++ reg = <0x10>; + reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; + + switch_ports: ports { +-- +2.43.0 + diff --git a/queue-6.8/arm-dts-imx6dl-yapp4-move-the-internal-switch-phys-u.patch b/queue-6.8/arm-dts-imx6dl-yapp4-move-the-internal-switch-phys-u.patch new file mode 100644 index 00000000000..b2d8c01eb02 --- /dev/null +++ b/queue-6.8/arm-dts-imx6dl-yapp4-move-the-internal-switch-phys-u.patch @@ -0,0 +1,98 @@ +From a5c8b39a03e4bf1c6678318a1a99c7239d1035e0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 10:03:28 +0100 +Subject: ARM: dts: imx6dl-yapp4: Move the internal switch PHYs under the + switch node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Michal Vokáč + +[ Upstream commit 79978bff2e4b8e05ebdf5fc3ee6b794002393484 ] + +We identified that the PHYs actually do not work since commit 7da7b84fee58 +("ARM: dts: imx6dl-yapp4: Move phy reset into switch node") as +a coincidence of several circumstances. + +The reset signal is kept asserted by a pull-down resistor on the board +unless it is deasserted by GPIO from the SoC. This is to keep the switch +dead until it is configured properly by the kernel and user space. + +Prior to the referenced commit the switch was reset by the FEC driver +and the reset GPIO was actively deasserted. The mdio-bus was scanned +and the attached switch and its PHYs were found and configured. + +With the referenced commit the switch is reset by the qca8k driver. +Because of another bug in the qca8k driver, functionality of the reset +pin depends on its pre-kernel configuration. See commit c44fc98f0a8f +("net: dsa: qca8k: fix illegal usage of GPIO") + +The problem did not appear until we removed support for the switch +and configuration of its reset pin from the bootloader. + +To fix that, properly describe the internal mdio-bus configuration of +the qca8334 switch. The PHYs are internal to the switch and sit on its +internal mdio-bus. + +Fixes: 7da7b84fee58 ("ARM: dts: imx6dl-yapp4: Move phy reset into switch node") +Signed-off-by: Michal Vokáč +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + .../boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi | 23 ++++++++++++------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi +index d2b3e09eb7df8..c32ea040fecdd 100644 +--- a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi ++++ b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi +@@ -117,14 +117,6 @@ mdio { + #address-cells = <1>; + #size-cells = <0>; + +- phy_port2: phy@1 { +- reg = <1>; +- }; +- +- phy_port3: phy@2 { +- reg = <2>; +- }; +- + switch@10 { + compatible = "qca,qca8334"; + reg = <0x10>; +@@ -149,15 +141,30 @@ fixed-link { + eth2: port@2 { + reg = <2>; + label = "eth2"; ++ phy-mode = "internal"; + phy-handle = <&phy_port2>; + }; + + eth1: port@3 { + reg = <3>; + label = "eth1"; ++ phy-mode = "internal"; + phy-handle = <&phy_port3>; + }; + }; ++ ++ mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy_port2: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ phy_port3: ethernet-phy@2 { ++ reg = <2>; ++ }; ++ }; + }; + }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm-dts-qcom-msm8974-correct-qfprom-node-size.patch b/queue-6.8/arm-dts-qcom-msm8974-correct-qfprom-node-size.patch new file mode 100644 index 00000000000..6ae70d33fa1 --- /dev/null +++ b/queue-6.8/arm-dts-qcom-msm8974-correct-qfprom-node-size.patch @@ -0,0 +1,46 @@ +From be3671b4c0748b3868a2f920d443203ca5c38865 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 10 Feb 2024 17:45:40 +0100 +Subject: ARM: dts: qcom: msm8974: correct qfprom node size + +From: Craig Tatlor + +[ Upstream commit 724c4bf0e4bf81dba77736afb93964c986c3c123 ] + +The qfprom actually is bigger than 0x1000, so adjust the reg. + +Note that the non-ECC-corrected qfprom can be found at 0xfc4b8000 +(-0x4000). The current reg points to the ECC-corrected qfprom block +which should have equivalent values at all offsets compared to the +non-corrected version. + +[luca@z3ntu.xyz: extract to standalone patch and adjust for review +comments] + +Fixes: c59ffb519357 ("arm: dts: msm8974: Add thermal zones, tsens and qfprom nodes") +Signed-off-by: Craig Tatlor +Signed-off-by: Luca Weiss +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240210-msm8974-qfprom-v3-1-26c424160334@z3ntu.xyz +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi +index b1413983787c2..083ab780ab7e4 100644 +--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi ++++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi +@@ -1234,7 +1234,7 @@ restart@fc4ab000 { + + qfprom: qfprom@fc4bc000 { + compatible = "qcom,msm8974-qfprom", "qcom,qfprom"; +- reg = <0xfc4bc000 0x1000>; ++ reg = <0xfc4bc000 0x2100>; + #address-cells = <1>; + #size-cells = <1>; + +-- +2.43.0 + diff --git a/queue-6.8/arm-dts-renesas-r8a73a4-fix-external-clocks-and-cloc.patch b/queue-6.8/arm-dts-renesas-r8a73a4-fix-external-clocks-and-cloc.patch new file mode 100644 index 00000000000..219482b303d --- /dev/null +++ b/queue-6.8/arm-dts-renesas-r8a73a4-fix-external-clocks-and-cloc.patch @@ -0,0 +1,82 @@ +From 74454922cf37828e1d4a2269db9e025142aa05c1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Jan 2024 12:03:03 +0100 +Subject: ARM: dts: renesas: r8a73a4: Fix external clocks and clock rate +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Geert Uytterhoeven + +[ Upstream commit 090c4094574705b0afc7d37825cdc5d06f0e7e02 ] + +External clocks should be defined as zero-Hz clocks in the SoC .dtsi, +and overridden in the board .dts when present. + +Correct the clock rate of extal1 from 25 to 26 MHz, to match the crystal +oscillator present on the APE6-EVM board. + +Fixes: a76809a329d6ebae ("ARM: shmobile: r8a73a4: Common clock framework DT description") +Signed-off-by: Geert Uytterhoeven +Reviewed-by: Niklas Söderlund +Link: https://lore.kernel.org/r/1692bc8cd465d62168cbf110522ad62a7af3f606.1705315614.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts | 12 ++++++++++++ + arch/arm/boot/dts/renesas/r8a73a4.dtsi | 9 ++++++--- + 2 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts b/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts +index ed75c01dbee10..3d02f065f71c2 100644 +--- a/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts ++++ b/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts +@@ -209,6 +209,18 @@ &cmt1 { + status = "okay"; + }; + ++&extal1_clk { ++ clock-frequency = <26000000>; ++}; ++ ++&extal2_clk { ++ clock-frequency = <48000000>; ++}; ++ ++&extalr_clk { ++ clock-frequency = <32768>; ++}; ++ + &pfc { + scifa0_pins: scifa0 { + groups = "scifa0_data"; +diff --git a/arch/arm/boot/dts/renesas/r8a73a4.dtsi b/arch/arm/boot/dts/renesas/r8a73a4.dtsi +index c39066967053f..d1f4cbd099efb 100644 +--- a/arch/arm/boot/dts/renesas/r8a73a4.dtsi ++++ b/arch/arm/boot/dts/renesas/r8a73a4.dtsi +@@ -450,17 +450,20 @@ clocks { + extalr_clk: extalr { + compatible = "fixed-clock"; + #clock-cells = <0>; +- clock-frequency = <32768>; ++ /* This value must be overridden by the board. */ ++ clock-frequency = <0>; + }; + extal1_clk: extal1 { + compatible = "fixed-clock"; + #clock-cells = <0>; +- clock-frequency = <25000000>; ++ /* This value must be overridden by the board. */ ++ clock-frequency = <0>; + }; + extal2_clk: extal2 { + compatible = "fixed-clock"; + #clock-cells = <0>; +- clock-frequency = <48000000>; ++ /* This value must be overridden by the board. */ ++ clock-frequency = <0>; + }; + fsiack_clk: fsiack { + compatible = "fixed-clock"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-allwinner-h6-add-rx-dma-channel-for-spdif.patch b/queue-6.8/arm64-dts-allwinner-h6-add-rx-dma-channel-for-spdif.patch new file mode 100644 index 00000000000..477138664ca --- /dev/null +++ b/queue-6.8/arm64-dts-allwinner-h6-add-rx-dma-channel-for-spdif.patch @@ -0,0 +1,83 @@ +From 1b4aee47ae4f54086e6b09c9771aaa02787e6ba4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jan 2024 00:32:45 +0800 +Subject: arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF + +From: Chen-Yu Tsai + +[ Upstream commit 7b59348c11f3355e284d77bbe3d33632ddadcfc2 ] + +The SPDIF hardware found on the H6 supports both transmit and receive +functions. However it is missing the RX DMA channel. + +Add the SPDIF hardware block's RX DMA channel. Also remove the +by-default pinmux, since the end device can choose to implement +either or both functionalities. + +Fixes: f95b598df419 ("arm64: dts: allwinner: Add SPDIF node for Allwinner H6") +Signed-off-by: Chen-Yu Tsai +Reviewed-by: Andre Przywara +Reviewed-by: Jernej Skrabec +Link: https://lore.kernel.org/r/20240127163247.384439-6-wens@kernel.org +Signed-off-by: Jernej Skrabec +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 2 ++ + arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi | 2 ++ + arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++---- + 3 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +index 9ec49ac2f6fd5..381d58cea092d 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +@@ -291,6 +291,8 @@ sw { + }; + + &spdif { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spdif_tx_pin>; + status = "okay"; + }; + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi +index 4903d6358112d..855b7d43bc503 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi +@@ -166,6 +166,8 @@ &r_ir { + }; + + &spdif { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spdif_tx_pin>; + status = "okay"; + }; + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +index ca1d287a0a01d..d11e5041bae9a 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +@@ -406,6 +406,7 @@ spi1_cs_pin: spi1-cs-pin { + function = "spi1"; + }; + ++ /omit-if-no-ref/ + spdif_tx_pin: spdif-tx-pin { + pins = "PH7"; + function = "spdif"; +@@ -655,10 +656,8 @@ spdif: spdif@5093000 { + clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>; + clock-names = "apb", "spdif"; + resets = <&ccu RST_BUS_SPDIF>; +- dmas = <&dma 2>; +- dma-names = "tx"; +- pinctrl-names = "default"; +- pinctrl-0 = <&spdif_tx_pin>; ++ dmas = <&dma 2>, <&dma 2>; ++ dma-names = "rx", "tx"; + status = "disabled"; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch new file mode 100644 index 00000000000..5b63a49af9a --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch @@ -0,0 +1,80 @@ +From 2f289db9fbc4aed9f7dcd80ab08cbd72bb12767a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 09:49:02 +0100 +Subject: arm64: dts: imx8mm-kontron: Disable pull resistors for SD card + signals on BL OSM-S board + +From: Frieder Schrempf + +[ Upstream commit 5a940ba3e4d7c8710c9073ff5d0ca4644d4da9db ] + +Some signals have external pullup resistors on the board and don't need +the internal ones to be enabled. Due to silicon errata ERR050080 let's +disable the internal pull resistors whererever possible and prevent +any unwanted behavior in case they wear out. + +Fixes: de9618e84f76 ("arm64: dts: Add support for Kontron SL/BL i.MX8MM OSM-S") +Signed-off-by: Frieder Schrempf +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + .../dts/freescale/imx8mm-kontron-bl-osm-s.dts | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +index 1dd03ef0a7835..d9fa0deea7002 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +@@ -337,40 +337,40 @@ MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x19 + + pinctrl_usdhc2: usdhc2grp { + fsl,pins = < +- MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x190 ++ MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90 + MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d0 + MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d0 + MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0 + MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0 + MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0 +- MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 +- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 ++ MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 ++ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 + >; + }; + + pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { + fsl,pins = < +- MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x194 ++ MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94 + MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d4 + MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d4 + MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4 + MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4 + MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4 +- MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 +- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 ++ MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 ++ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 + >; + }; + + pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { + fsl,pins = < +- MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x196 ++ MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96 + MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d6 + MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d6 + MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6 + MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6 + MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6 +- MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 +- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 ++ MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 ++ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 + >; + }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch-27736 b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch-27736 new file mode 100644 index 00000000000..4c7e4b6cf16 --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pull-resistors-for-.patch-27736 @@ -0,0 +1,80 @@ +From db1e0b9db770ed189d266fb8510d536f7a236946 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 09:49:03 +0100 +Subject: arm64: dts: imx8mm-kontron: Disable pull resistors for SD card + signals on BL board + +From: Frieder Schrempf + +[ Upstream commit 008820524844326ffb3123cebceba1960c0ad0dc ] + +Some signals have external pullup resistors on the board and don't need +the internal ones to be enabled. Due to silicon errata ERR050080 let's +disable the internal pull resistors whererever possible and prevent +any unwanted behavior in case they wear out. + +Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") +Signed-off-by: Frieder Schrempf +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + .../boot/dts/freescale/imx8mm-kontron-bl.dts | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +index ee93db11c0d06..aab8e24216501 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +@@ -316,40 +316,40 @@ MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x19 + + pinctrl_usdhc2: usdhc2grp { + fsl,pins = < +- MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x190 ++ MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90 + MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d0 + MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d0 + MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0 + MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0 + MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0 +- MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 +- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 ++ MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 ++ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 + >; + }; + + pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { + fsl,pins = < +- MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x194 ++ MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94 + MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d4 + MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d4 + MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4 + MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4 + MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4 +- MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 +- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 ++ MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 ++ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 + >; + }; + + pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { + fsl,pins = < +- MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x196 ++ MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96 + MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d6 + MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d6 + MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6 + MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6 + MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6 +- MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 +- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 ++ MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 ++ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 + >; + }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch new file mode 100644 index 00000000000..c3956815a56 --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch @@ -0,0 +1,56 @@ +From 871d62af4a8635d6889f53c5cd2434a7e840c367 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 09:48:58 +0100 +Subject: arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on OSM-S + i.MX8MM + +From: Frieder Schrempf + +[ Upstream commit 96293af54f6aa859015d8ca40a1437d3115ad50c ] + +There are external pullup resistors on the board and due to silicon +errata ERR050080 let's disable the internal ones to prevent any +unwanted behavior in case they wear out. + +Fixes: de9618e84f76 ("arm64: dts: Add support for Kontron SL/BL i.MX8MM OSM-S") +Signed-off-by: Frieder Schrempf +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts | 4 ++-- + arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +index 8b16bd68576c0..0730c22e5b6b9 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +@@ -294,8 +294,8 @@ MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2 0x19 + + pinctrl_i2c4: i2c4grp { + fsl,pins = < +- MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x400001c3 +- MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x400001c3 ++ MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x40000083 ++ MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x40000083 + >; + }; + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +index 6e75ab879bf59..3e7db968f7e64 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +@@ -252,8 +252,8 @@ MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x19 + + pinctrl_i2c1: i2c1grp { + fsl,pins = < +- MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x400001c3 +- MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x400001c3 ++ MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x40000083 ++ MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x40000083 + >; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch-24016 b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch-24016 new file mode 100644 index 00000000000..1027db5395f --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-i2c-sig.patch-24016 @@ -0,0 +1,56 @@ +From 6f38c0453ea21b874e48d0d3f8207b3bbe0a9a99 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 09:48:59 +0100 +Subject: arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on SL/BL + i.MX8MM + +From: Frieder Schrempf + +[ Upstream commit f19e5bb91d53264d7dac5d845a4825afadf72440 ] + +There are external pullup resistors on the board and due to silicon +errata ERR050080 let's disable the internal ones to prevent any +unwanted behavior in case they wear out. + +Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") +Signed-off-by: Frieder Schrempf +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts | 4 ++-- + arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +index dcec57c20399e..5fd2e45258b11 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +@@ -279,8 +279,8 @@ MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2 0x19 + + pinctrl_i2c4: i2c4grp { + fsl,pins = < +- MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x400001c3 +- MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x400001c3 ++ MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x40000083 ++ MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x40000083 + >; + }; + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi +index 1f8326613ee9e..2076148e08627 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi +@@ -237,8 +237,8 @@ MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x19 + + pinctrl_i2c1: i2c1grp { + fsl,pins = < +- MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x400001c3 +- MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x400001c3 ++ MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x40000083 ++ MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x40000083 + >; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch new file mode 100644 index 00000000000..e41dba1cb0e --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch @@ -0,0 +1,58 @@ +From c79720a86a6c33d4e87a2ebf27cc478b90a06b44 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 09:49:00 +0100 +Subject: arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals + on BL OSM-S board + +From: Frieder Schrempf + +[ Upstream commit c6d9b5672a0e2c4b1079a50d2fc8780c40cfd3eb ] + +These signals are actively driven by the SoC or by the onboard +transceiver. There's no need to enable the internal pull resistors +and due to silicon errata ERR050080 let's disable the internal ones +to prevent any unwanted behavior in case they wear out. + +Fixes: de9618e84f76 ("arm64: dts: Add support for Kontron SL/BL i.MX8MM OSM-S") +Signed-off-by: Frieder Schrempf +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + .../dts/freescale/imx8mm-kontron-bl-osm-s.dts | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +index 0730c22e5b6b9..1dd03ef0a7835 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +@@ -313,19 +313,19 @@ MX8MM_IOMUXC_SAI5_MCLK_GPIO3_IO25 0x19 + + pinctrl_uart1: uart1grp { + fsl,pins = < +- MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x140 +- MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x140 +- MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x140 +- MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x140 ++ MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x0 ++ MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x0 ++ MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x0 ++ MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x0 + >; + }; + + pinctrl_uart2: uart2grp { + fsl,pins = < +- MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x140 +- MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x140 +- MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x140 +- MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x140 ++ MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x0 ++ MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x0 ++ MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x0 ++ MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x0 + >; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch-1464 b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch-1464 new file mode 100644 index 00000000000..a4f77428c62 --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-kontron-disable-pullups-for-onboard.patch-1464 @@ -0,0 +1,58 @@ +From 922c6f983f5819505544714eeb6aaabbc2a9b640 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 09:49:01 +0100 +Subject: arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals + on BL board + +From: Frieder Schrempf + +[ Upstream commit 162aadaa0df8217b0cc49d919dd00022fef65e78 ] + +These signals are actively driven by the SoC or by the onboard +transceiver. There's no need to enable the internal pull resistors +and due to silicon errata ERR050080 let's disable the internal ones +to prevent any unwanted behavior in case they wear out. + +Fixes: 8668d8b2e67f ("arm64: dts: Add the Kontron i.MX8M Mini SoMs and baseboards") +Signed-off-by: Frieder Schrempf +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + .../boot/dts/freescale/imx8mm-kontron-bl.dts | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +index 5fd2e45258b11..ee93db11c0d06 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +@@ -292,19 +292,19 @@ MX8MM_IOMUXC_SPDIF_RX_PWM2_OUT 0x19 + + pinctrl_uart1: uart1grp { + fsl,pins = < +- MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x140 +- MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x140 +- MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x140 +- MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x140 ++ MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x0 ++ MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x0 ++ MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x0 ++ MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x0 + >; + }; + + pinctrl_uart2: uart2grp { + fsl,pins = < +- MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x140 +- MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x140 +- MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x140 +- MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x140 ++ MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x0 ++ MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x0 ++ MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x0 ++ MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x0 + >; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-kontron-fix-interrupt-for-rtc-on-os.patch b/queue-6.8/arm64-dts-imx8mm-kontron-fix-interrupt-for-rtc-on-os.patch new file mode 100644 index 00000000000..8e94d99fe29 --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-kontron-fix-interrupt-for-rtc-on-os.patch @@ -0,0 +1,36 @@ +From b0416b95db3c1078698862baddb22f308fd01b31 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 09:49:04 +0100 +Subject: arm64: dts: imx8mm-kontron: Fix interrupt for RTC on OSM-S i.MX8MM + module + +From: Frieder Schrempf + +[ Upstream commit 8d0f39b7d04d864e89b84063b124fd10aa4b8809 ] + +The level of the interrupt signal is active low instead. Fix this. + +Fixes: de9618e84f76 ("arm64: dts: Add support for Kontron SL/BL i.MX8MM OSM-S") +Signed-off-by: Frieder Schrempf +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +index 3e7db968f7e64..60abcb636cedf 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +@@ -210,7 +210,7 @@ rv3028: rtc@52 { + reg = <0x52>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rtc>; +- interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_HIGH>; ++ interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_LOW>; + trickle-diode-disable; + }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mm-venice-gw71xx-fix-usb-otg-vbus.patch b/queue-6.8/arm64-dts-imx8mm-venice-gw71xx-fix-usb-otg-vbus.patch new file mode 100644 index 00000000000..ee458707a0e --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mm-venice-gw71xx-fix-usb-otg-vbus.patch @@ -0,0 +1,85 @@ +From 84dc68fcc665fc053e70d8d038edd84ddaa5d48c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Dec 2023 15:30:46 -0800 +Subject: arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS + +From: Tim Harvey + +[ Upstream commit ec2cb52fcfef5d58574f2cfbc9a99ffc20ae5a9d ] + +The GW71xx does not have a gpio controlled vbus regulator but it does +require some pinctrl. Remove the regulator and move the valid pinctrl +into the usbotg1 node. + +Fixes: bd306fdb4e60 ("arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS") +Signed-off-by: Tim Harvey +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + .../dts/freescale/imx8mm-venice-gw71xx.dtsi | 29 ++++++------------- + 1 file changed, 9 insertions(+), 20 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi +index 6425773f68e0a..bbbaf2165ea28 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi +@@ -47,17 +47,6 @@ pps { + gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; +- +- reg_usb_otg1_vbus: regulator-usb-otg1 { +- pinctrl-names = "default"; +- pinctrl-0 = <&pinctrl_reg_usb1_en>; +- compatible = "regulator-fixed"; +- regulator-name = "usb_otg1_vbus"; +- gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>; +- enable-active-high; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- }; + }; + + /* off-board header */ +@@ -144,9 +133,10 @@ &uart3 { + }; + + &usbotg1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usbotg1>; + dr_mode = "otg"; + over-current-active-low; +- vbus-supply = <®_usb_otg1_vbus>; + status = "okay"; + }; + +@@ -204,14 +194,6 @@ MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x41 + >; + }; + +- pinctrl_reg_usb1_en: regusb1grp { +- fsl,pins = < +- MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x41 +- MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 +- MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 +- >; +- }; +- + pinctrl_spi2: spi2grp { + fsl,pins = < + MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6 +@@ -234,4 +216,11 @@ MX8MM_IOMUXC_UART3_RXD_UART3_DCE_RX 0x140 + MX8MM_IOMUXC_UART3_TXD_UART3_DCE_TX 0x140 + >; + }; ++ ++ pinctrl_usbotg1: usbotg1grp { ++ fsl,pins = < ++ MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 ++ MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 ++ >; ++ }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mp-evk-fix-hdmi-3d-node.patch b/queue-6.8/arm64-dts-imx8mp-evk-fix-hdmi-3d-node.patch new file mode 100644 index 00000000000..d27380f2f7b --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mp-evk-fix-hdmi-3d-node.patch @@ -0,0 +1,119 @@ +From f8077e7c83d4a271a814c5dd3451498137a888ee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Feb 2024 10:57:38 +0800 +Subject: arm64: dts: imx8mp-evk: Fix hdmi@3d node + +From: Liu Ying + +[ Upstream commit 0ff08803eca417dfa9372194bebf3d1b1f501f98 ] + +The hdmi@3d node's compatible string is "adi,adv7535" instead of +"adi,adv7533" or "adi,adv751*". + +Fix the hdmi@3d node by means of: +* Use default register addresses for "cec", "edid" and "packet", because + there is no need to use a non-default address map. +* Add missing interrupt related properties. +* Drop "adi,input-*" properties which are only valid for adv751*. +* Add VEXT_3V3 fixed regulator. +* Add "*-supply" properties, since most are required. +* Fix label names - s/adv7533/adv7535/. + +Fixes: 65344b9bed3a ("arm64: dts: imx8mp-evk: Add HDMI support") +Signed-off-by: Liu Ying +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 33 +++++++++++++------- + 1 file changed, 21 insertions(+), 12 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +index f87fa5a948ccc..9beba8d6a0dfe 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +@@ -23,7 +23,7 @@ hdmi-connector { + + port { + hdmi_connector_in: endpoint { +- remote-endpoint = <&adv7533_out>; ++ remote-endpoint = <&adv7535_out>; + }; + }; + }; +@@ -107,6 +107,13 @@ reg_usdhc2_vmmc: regulator-usdhc2 { + enable-active-high; + }; + ++ reg_vext_3v3: regulator-vext-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VEXT_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "wm8960-audio"; +@@ -364,7 +371,7 @@ BUCK4 { + regulator-always-on; + }; + +- BUCK5 { ++ reg_buck5: BUCK5 { + regulator-name = "BUCK5"; + regulator-min-microvolt = <1650000>; + regulator-max-microvolt = <1950000>; +@@ -415,14 +422,16 @@ &i2c2 { + + hdmi@3d { + compatible = "adi,adv7535"; +- reg = <0x3d>, <0x3c>, <0x3e>, <0x3f>; +- reg-names = "main", "cec", "edid", "packet"; ++ reg = <0x3d>; ++ interrupt-parent = <&gpio1>; ++ interrupts = <9 IRQ_TYPE_EDGE_FALLING>; + adi,dsi-lanes = <4>; +- adi,input-depth = <8>; +- adi,input-colorspace = "rgb"; +- adi,input-clock = "1x"; +- adi,input-style = <1>; +- adi,input-justification = "evenly"; ++ avdd-supply = <®_buck5>; ++ dvdd-supply = <®_buck5>; ++ pvdd-supply = <®_buck5>; ++ a2vdd-supply = <®_buck5>; ++ v3p3-supply = <®_vext_3v3>; ++ v1p2-supply = <®_buck5>; + + ports { + #address-cells = <1>; +@@ -431,7 +440,7 @@ ports { + port@0 { + reg = <0>; + +- adv7533_in: endpoint { ++ adv7535_in: endpoint { + remote-endpoint = <&dsi_out>; + }; + }; +@@ -439,7 +448,7 @@ adv7533_in: endpoint { + port@1 { + reg = <1>; + +- adv7533_out: endpoint { ++ adv7535_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; +@@ -524,7 +533,7 @@ port@1 { + reg = <1>; + + dsi_out: endpoint { +- remote-endpoint = <&adv7533_in>; ++ remote-endpoint = <&adv7535_in>; + data-lanes = <1 2 3 4>; + }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8mp-set-spi-nor-to-max-40-mhz-on-data-m.patch b/queue-6.8/arm64-dts-imx8mp-set-spi-nor-to-max-40-mhz-on-data-m.patch new file mode 100644 index 00000000000..99a42f60e75 --- /dev/null +++ b/queue-6.8/arm64-dts-imx8mp-set-spi-nor-to-max-40-mhz-on-data-m.patch @@ -0,0 +1,38 @@ +From 00b2a5b6c1086369d4aba4633b86d1dda124cb63 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 17 Feb 2024 22:33:30 +0100 +Subject: arm64: dts: imx8mp: Set SPI NOR to max 40 MHz on Data Modul i.MX8M + Plus eDM SBC + +From: Marek Vasut + +[ Upstream commit 13ab6f174a6b577bd7d09124b47ec8ace2682e42 ] + +The SPI NOR bus routing on this board cannot go above 50 MHz, +set the clock frequency to maximum of 40 MHz to be within a +safe margin. Remove the comment as well. + +Fixes: 562d222f23f0 ("arm64: dts: imx8mp: Add support for Data Modul i.MX8M Plus eDM SBC") +Signed-off-by: Marek Vasut +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc.dts b/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc.dts +index 5828c9d7821de..b5ce7b14b5434 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc.dts +@@ -121,7 +121,7 @@ &ecspi1 { + flash@0 { /* W25Q128JVEI */ + compatible = "jedec,spi-nor"; + reg = <0>; +- spi-max-frequency = <100000000>; /* Up to 133 MHz */ ++ spi-max-frequency = <40000000>; + spi-tx-bus-width = <1>; + spi-rx-bus-width = <1>; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8qm-align-edma3-power-domains-resources.patch b/queue-6.8/arm64-dts-imx8qm-align-edma3-power-domains-resources.patch new file mode 100644 index 00000000000..7953baa644d --- /dev/null +++ b/queue-6.8/arm64-dts-imx8qm-align-edma3-power-domains-resources.patch @@ -0,0 +1,48 @@ +From b9f973996b5b20151fcfd7f9198f515850d4ea0b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Dec 2023 14:46:54 -0500 +Subject: arm64: dts: imx8qm: Align edma3 power-domains resources indentation + +From: Frank Li + +[ Upstream commit 7edee2b297e5a4f805e5b945c0c0e6f4f8f719b5 ] + +<&pd IMX_SC_R_DMA_1_CH*> is now properly aligned with the previous line +for improved code readability. + +Signed-off-by: Frank Li +Signed-off-by: Shawn Guo +Stable-dep-of: 5136ea6b109d ("arm64: dts: imx8qm: Correct edma3 power-domains and interrupt numbers") +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi b/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi +index 69cb8676732ea..453fabfd17b81 100644 +--- a/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi +@@ -98,13 +98,13 @@ &edma2 { + + &edma3 { + power-domains = <&pd IMX_SC_R_DMA_1_CH0>, +- <&pd IMX_SC_R_DMA_1_CH1>, +- <&pd IMX_SC_R_DMA_1_CH2>, +- <&pd IMX_SC_R_DMA_1_CH3>, +- <&pd IMX_SC_R_DMA_1_CH4>, +- <&pd IMX_SC_R_DMA_1_CH5>, +- <&pd IMX_SC_R_DMA_1_CH6>, +- <&pd IMX_SC_R_DMA_1_CH7>; ++ <&pd IMX_SC_R_DMA_1_CH1>, ++ <&pd IMX_SC_R_DMA_1_CH2>, ++ <&pd IMX_SC_R_DMA_1_CH3>, ++ <&pd IMX_SC_R_DMA_1_CH4>, ++ <&pd IMX_SC_R_DMA_1_CH5>, ++ <&pd IMX_SC_R_DMA_1_CH6>, ++ <&pd IMX_SC_R_DMA_1_CH7>; + }; + + &flexcan1 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-imx8qm-correct-edma3-power-domains-and-int.patch b/queue-6.8/arm64-dts-imx8qm-correct-edma3-power-domains-and-int.patch new file mode 100644 index 00000000000..2d3babe48e1 --- /dev/null +++ b/queue-6.8/arm64-dts-imx8qm-correct-edma3-power-domains-and-int.patch @@ -0,0 +1,65 @@ +From 4a81c63c21d93f444e77e5cb3e1c5f3253a6041e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Dec 2023 14:46:55 -0500 +Subject: arm64: dts: imx8qm: Correct edma3 power-domains and interrupt numbers + +From: Frank Li + +[ Upstream commit 5136ea6b109de66b1327a3069f88ad8f5efb37b2 ] + +It is eDMA1 at QM, which have the same register with eDMA3 at qxp. + +The below commit fix panic problem. +commit b37e75bddc35 ("arm64: dts: imx8qm: Add imx8qm's own pm to avoid panic during startup") + +This fixes the IRQ and DMA channel numbers. While QM eDMA1 technically has +32 channels, only 10 channels are likely used for I2C. The exact IRQ +numbers for the remaining channels were unclear in the reference manual. + +Fixes: e4d7a330fb7a ("arm64: dts: imx8: add edma[0..3]") +Signed-off-by: Frank Li +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + .../arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi b/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi +index 453fabfd17b81..cafc1383115ab 100644 +--- a/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi +@@ -96,7 +96,20 @@ &edma2 { + status = "okay"; + }; + ++/* It is eDMA1 in 8QM RM, but 8QXP it is eDMA3 */ + &edma3 { ++ reg = <0x5a9f0000 0x210000>; ++ dma-channels = <10>; ++ interrupts = , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; + power-domains = <&pd IMX_SC_R_DMA_1_CH0>, + <&pd IMX_SC_R_DMA_1_CH1>, + <&pd IMX_SC_R_DMA_1_CH2>, +@@ -104,7 +117,9 @@ &edma3 { + <&pd IMX_SC_R_DMA_1_CH4>, + <&pd IMX_SC_R_DMA_1_CH5>, + <&pd IMX_SC_R_DMA_1_CH6>, +- <&pd IMX_SC_R_DMA_1_CH7>; ++ <&pd IMX_SC_R_DMA_1_CH7>, ++ <&pd IMX_SC_R_DMA_1_CH8>, ++ <&pd IMX_SC_R_DMA_1_CH9>; + }; + + &flexcan1 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-marvell-reorder-crypto-interrupts-on-armad.patch b/queue-6.8/arm64-dts-marvell-reorder-crypto-interrupts-on-armad.patch new file mode 100644 index 00000000000..5cb6604a5de --- /dev/null +++ b/queue-6.8/arm64-dts-marvell-reorder-crypto-interrupts-on-armad.patch @@ -0,0 +1,88 @@ +From 8a312cf3a7cb83f91aabdb8f8779dc931f197929 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Jan 2024 13:22:58 +0100 +Subject: arm64: dts: marvell: reorder crypto interrupts on Armada SoCs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit ec55a22149d64f9ac41845d923b884d4a666bf4d ] + +Match order specified in binding documentation. It says "mem" should be +the last interrupt. + +This fixes: +arch/arm64/boot/dts/marvell/armada-3720-db.dtb: crypto@90000: interrupt-names:0: 'ring0' was expected + from schema $id: http://devicetree.org/schemas/crypto/inside-secure,safexcel.yaml# +arch/arm64/boot/dts/marvell/armada-3720-db.dtb: crypto@90000: interrupt-names:1: 'ring1' was expected + from schema $id: http://devicetree.org/schemas/crypto/inside-secure,safexcel.yaml# +arch/arm64/boot/dts/marvell/armada-3720-db.dtb: crypto@90000: interrupt-names:2: 'ring2' was expected + from schema $id: http://devicetree.org/schemas/crypto/inside-secure,safexcel.yaml# +arch/arm64/boot/dts/marvell/armada-3720-db.dtb: crypto@90000: interrupt-names:3: 'ring3' was expected + from schema $id: http://devicetree.org/schemas/crypto/inside-secure,safexcel.yaml# +arch/arm64/boot/dts/marvell/armada-3720-db.dtb: crypto@90000: interrupt-names:4: 'eip' was expected + from schema $id: http://devicetree.org/schemas/crypto/inside-secure,safexcel.yaml# +arch/arm64/boot/dts/marvell/armada-3720-db.dtb: crypto@90000: interrupt-names:5: 'mem' was expected + from schema $id: http://devicetree.org/schemas/crypto/inside-secure,safexcel.yaml# + +Signed-off-by: Rafał Miłecki +Signed-off-by: Gregory CLEMENT +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 10 +++++----- + arch/arm64/boot/dts/marvell/armada-cp11x.dtsi | 10 +++++----- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +index e300145ad1a6f..1cc3fa1c354de 100644 +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -431,14 +431,14 @@ xor11 { + crypto: crypto@90000 { + compatible = "inside-secure,safexcel-eip97ies"; + reg = <0x90000 0x20000>; +- interrupts = , +- , ++ interrupts = , + , + , + , +- ; +- interrupt-names = "mem", "ring0", "ring1", +- "ring2", "ring3", "eip"; ++ , ++ ; ++ interrupt-names = "ring0", "ring1", "ring2", ++ "ring3", "eip", "mem"; + clocks = <&nb_periph_clk 15>; + }; + +diff --git a/arch/arm64/boot/dts/marvell/armada-cp11x.dtsi b/arch/arm64/boot/dts/marvell/armada-cp11x.dtsi +index 4ec1aae0a3a9c..7e595ac80043a 100644 +--- a/arch/arm64/boot/dts/marvell/armada-cp11x.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-cp11x.dtsi +@@ -511,14 +511,14 @@ CP11X_LABEL(sdhci0): mmc@780000 { + CP11X_LABEL(crypto): crypto@800000 { + compatible = "inside-secure,safexcel-eip197b"; + reg = <0x800000 0x200000>; +- interrupts = <87 IRQ_TYPE_LEVEL_HIGH>, +- <88 IRQ_TYPE_LEVEL_HIGH>, ++ interrupts = <88 IRQ_TYPE_LEVEL_HIGH>, + <89 IRQ_TYPE_LEVEL_HIGH>, + <90 IRQ_TYPE_LEVEL_HIGH>, + <91 IRQ_TYPE_LEVEL_HIGH>, +- <92 IRQ_TYPE_LEVEL_HIGH>; +- interrupt-names = "mem", "ring0", "ring1", +- "ring2", "ring3", "eip"; ++ <92 IRQ_TYPE_LEVEL_HIGH>, ++ <87 IRQ_TYPE_LEVEL_HIGH>; ++ interrupt-names = "ring0", "ring1", "ring2", "ring3", ++ "eip", "mem"; + clock-names = "core", "reg"; + clocks = <&CP11X_LABEL(clk) 1 26>, + <&CP11X_LABEL(clk) 1 17>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt7622-add-missing-device_type-to.patch b/queue-6.8/arm64-dts-mediatek-mt7622-add-missing-device_type-to.patch new file mode 100644 index 00000000000..0e4d7a82134 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt7622-add-missing-device_type-to.patch @@ -0,0 +1,57 @@ +From 5d5fc422d8a7a4468fd1a32a41ebbb6b2cdead31 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 22 Jan 2024 14:23:57 +0100 +Subject: arm64: dts: mediatek: mt7622: add missing "device_type" to memory + nodes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit 99d100e00144bc01b49a697f4bc4398f2f7e7ce4 ] + +This fixes: +arch/arm64/boot/dts/mediatek/mt7622-rfb1.dtb: /: memory@40000000: 'device_type' is a required property + from schema $id: http://devicetree.org/schemas/memory.yaml# +arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dtb: /: memory@40000000: 'device_type' is a required property + from schema $id: http://devicetree.org/schemas/memory.yaml# + +Signed-off-by: Rafał Miłecki +Reviewed-by: Matthias Brugger +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20240122132357.31264-1-zajec5@gmail.com +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 + + arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +index a1f42048dcc70..850b3e2773680 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +@@ -75,6 +75,7 @@ led-1 { + + memory@40000000 { + reg = <0 0x40000000 0 0x40000000>; ++ device_type = "memory"; + }; + + reg_1p8v: regulator-1p8v { +diff --git a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +index 2dc1bdc74e212..5c26021fc4cf1 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +@@ -57,6 +57,7 @@ key-wps { + + memory@40000000 { + reg = <0 0x40000000 0 0x20000000>; ++ device_type = "memory"; + }; + + reg_1p8v: regulator-1p8v { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt7986-add-reset-cells-to-infracf.patch b/queue-6.8/arm64-dts-mediatek-mt7986-add-reset-cells-to-infracf.patch new file mode 100644 index 00000000000..fa303db4549 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt7986-add-reset-cells-to-infracf.patch @@ -0,0 +1,47 @@ +From 4ecd5a251ccffefb15f6fb7f4c8c98f62ec319e4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 1 Jan 2024 19:20:40 +0100 +Subject: arm64: dts: mediatek: mt7986: add "#reset-cells" to infracfg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit d993daff5962b2dd08f32a83bb1c0e5fa75732ea ] + +MT7986's Infrastructure System Configuration Controller includes reset +controller. It can reset blocks as specified in the +include/dt-bindings/reset/mt7986-resets.h . Add #reset-cells so it can +be referenced properly. + +This fixes: +arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: infracfg@10001000: '#reset-cells' is a required property + from schema $id: http://devicetree.org/schemas/arm/mediatek/mediatek,infracfg.yaml# + +Fixes: 1f9986b258c2 ("arm64: dts: mediatek: add clock support for mt7986a") +Cc: Sam Shih +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20240101182040.28538-2-zajec5@gmail.com +Signed-off-by: Matthias Brugger +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +index 7b6591509c54d..d974739eae1c9 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +@@ -153,6 +153,7 @@ infracfg: infracfg@10001000 { + compatible = "mediatek,mt7986-infracfg", "syscon"; + reg = <0 0x10001000 0 0x1000>; + #clock-cells = <1>; ++ #reset-cells = <1>; + }; + + wed_pcie: wed-pcie@10003000 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt7986-drop-clock-cells-from-pwm.patch b/queue-6.8/arm64-dts-mediatek-mt7986-drop-clock-cells-from-pwm.patch new file mode 100644 index 00000000000..888a4236f45 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt7986-drop-clock-cells-from-pwm.patch @@ -0,0 +1,45 @@ +From a2df2e9ab17ba577587fd26e19635e2fe6f2c6fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 1 Jan 2024 19:20:39 +0100 +Subject: arm64: dts: mediatek: mt7986: drop "#clock-cells" from PWM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit 0b721691f0c80af682d0ef3aa4a177c23d41b072 ] + +PWM is not a clock provider and its binding doesn't specify +"#clock-cells" property. + +This fixes: +arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pwm@10048000: '#clock-cells' does not match any of the regexes: 'pinctrl-[0-9]+' + from schema $id: http://devicetree.org/schemas/pwm/mediatek,mt2712-pwm.yaml# + +Fixes: eabb04df46c6 ("arm64: dts: mt7986: add PWM") +Cc: Daniel Golle +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20240101182040.28538-1-zajec5@gmail.com +Signed-off-by: Matthias Brugger +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +index a7d9c3246a875..7b6591509c54d 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +@@ -242,7 +242,6 @@ crypto: crypto@10320000 { + pwm: pwm@10048000 { + compatible = "mediatek,mt7986-pwm"; + reg = <0 0x10048000 0 0x1000>; +- #clock-cells = <1>; + #pwm-cells = <2>; + interrupts = ; + clocks = <&topckgen CLK_TOP_PWM_SEL>, +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt7986-drop-crypto-s-unneeded-inv.patch b/queue-6.8/arm64-dts-mediatek-mt7986-drop-crypto-s-unneeded-inv.patch new file mode 100644 index 00000000000..8813d7181bb --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt7986-drop-crypto-s-unneeded-inv.patch @@ -0,0 +1,46 @@ +From 6a05bc2216df7b28c0f73f2d62696bc561e235b4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Nov 2023 14:24:11 +0100 +Subject: arm64: dts: mediatek: mt7986: drop crypto's unneeded/invalid clock + name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit bb69d19c649669f700149df309245cd925612f7c ] + +According to the "inside-secure,safexcel-eip97" binding "clock-names" is +required only if there are two clocks specified. If present the first +name must by "core". + +Name "infra_eip97_ck" is invalid and was probably just a typo. Drop it. + +Fixes: ecc5287cfe53 ("arm64: dts: mt7986: add crypto related device nodes") +Cc: Sam Shih +Signed-off-by: Rafał Miłecki +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20231116132411.7665-1-zajec5@gmail.com +Signed-off-by: Matthias Brugger +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +index fc751e049953c..a7d9c3246a875 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +@@ -234,7 +234,6 @@ crypto: crypto@10320000 { + ; + interrupt-names = "ring0", "ring1", "ring2", "ring3"; + clocks = <&infracfg CLK_INFRA_EIP97_CK>; +- clock-names = "infra_eip97_ck"; + assigned-clocks = <&topckgen CLK_TOP_EIP_B_SEL>; + assigned-clock-parents = <&apmixedsys CLK_APMIXED_NET2PLL>; + status = "disabled"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt7986-fix-reference-to-pwm-in-fa.patch b/queue-6.8/arm64-dts-mediatek-mt7986-fix-reference-to-pwm-in-fa.patch new file mode 100644 index 00000000000..7140a632594 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt7986-fix-reference-to-pwm-in-fa.patch @@ -0,0 +1,44 @@ +From 975c2f653e7aba31a291c2335379d6248e6e9495 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Nov 2023 14:08:16 +0100 +Subject: arm64: dts: mediatek: mt7986: fix reference to PWM in fan node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit 7865abbbdf1e1ee57a0bb8ec83079f8840c16854 ] + +This fixes typo and resolves following validation error: +arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pwm-fan: pwms: [[54, 0, 10000], [0]] is too long + from schema $id: http://devicetree.org/schemas/hwmon/pwm-fan.yaml# + +Fixes: c26f779a2295 ("arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts") +Cc: Daniel Golle +Signed-off-by: Rafał Miłecki +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20231116130816.4932-1-zajec5@gmail.com +Signed-off-by: Matthias Brugger +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +index d06d4af43cbff..e04b1c0c0ebbf 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +@@ -43,7 +43,7 @@ fan: pwm-fan { + #cooling-cells = <2>; + /* cooling level (0, 1, 2) - pwm inverted */ + cooling-levels = <255 96 0>; +- pwms = <&pwm 0 10000 0>; ++ pwms = <&pwm 0 10000>; + status = "okay"; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-bus-width-properti.patch b/queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-bus-width-properti.patch new file mode 100644 index 00000000000..050b108d37e --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-bus-width-properti.patch @@ -0,0 +1,63 @@ +From 544441f4f37133490cf57ddf6c186a782178548d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Nov 2023 14:09:51 +0100 +Subject: arm64: dts: mediatek: mt7986: fix SPI bus width properties +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit 4e7dc18a753cec130b06f1ddbae10ea9dcfb1723 ] + +This fixes SPI setup and resolves following validation errors: +arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtb: spi_nand@0: Unevaluated properties are not allowed ('spi-rx-buswidth', 'spi-tx-buswidth' were unexpected) + from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml# +arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtb: spi_nand@0: Unevaluated properties are not allowed ('spi-rx-buswidth', 'spi-tx-buswidth' were unexpected) + from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml# + +Fixes: 885e153ed7c1 ("arm64: dts: mt7986: add spi related device nodes") +Signed-off-by: Rafał Miłecki +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20231116130952.5099-1-zajec5@gmail.com +Signed-off-by: Matthias Brugger +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 4 ++-- + arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +index 3ef371ca254e8..bcb3ebb85d708 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +@@ -241,8 +241,8 @@ spi_nand: spi_nand@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <10000000>; +- spi-tx-buswidth = <4>; +- spi-rx-buswidth = <4>; ++ spi-tx-bus-width = <4>; ++ spi-rx-bus-width = <4>; + }; + }; + +diff --git a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +index dde190442e386..48fe50e671779 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +@@ -156,8 +156,8 @@ spi_nand: spi_nand@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <10000000>; +- spi-tx-buswidth = <4>; +- spi-rx-buswidth = <4>; ++ spi-tx-bus-width = <4>; ++ spi-rx-bus-width = <4>; + }; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-nodename.patch b/queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-nodename.patch new file mode 100644 index 00000000000..bb7ab60ba37 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt7986-fix-spi-nodename.patch @@ -0,0 +1,61 @@ +From 8f085cf7892d53389af490c3bf4b5fccde9173c3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Nov 2023 14:09:52 +0100 +Subject: arm64: dts: mediatek: mt7986: fix SPI nodename +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rafał Miłecki + +[ Upstream commit bbe266c70e1343ee3e71ca31138141b3da265085 ] + +This fixes following validation errors: +arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtb: spi_nand@0: $nodename:0: 'spi_nand@0' does not match '^(flash|.*sram|nand)(@.*)?$' + from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml# +arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtb: spi_nand@0: $nodename:0: 'spi_nand@0' does not match '^(flash|.*sram|nand)(@.*)?$' + from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml# + +Fixes: 885e153ed7c1 ("arm64: dts: mt7986: add spi related device nodes") +Signed-off-by: Rafał Miłecki +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20231116130952.5099-2-zajec5@gmail.com +Signed-off-by: Matthias Brugger +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 3 ++- + arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +index bcb3ebb85d708..2f884c24f1eb4 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +@@ -237,7 +237,8 @@ &spi0 { + pinctrl-0 = <&spi_flash_pins>; + cs-gpios = <0>, <0>; + status = "okay"; +- spi_nand: spi_nand@0 { ++ ++ spi_nand: flash@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <10000000>; +diff --git a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +index 48fe50e671779..57dcaeef31d7f 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +@@ -152,7 +152,8 @@ &spi0 { + pinctrl-0 = <&spi_flash_pins>; + cs-gpios = <0>, <0>; + status = "okay"; +- spi_nand: spi_nand@0 { ++ ++ spi_nand: flash@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <10000000>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt8186-add-missing-clocks-to-ssus.patch b/queue-6.8/arm64-dts-mediatek-mt8186-add-missing-clocks-to-ssus.patch new file mode 100644 index 00000000000..67b6ece5871 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt8186-add-missing-clocks-to-ssus.patch @@ -0,0 +1,64 @@ +From 6d13fefda019129f0ee191682e6f9a5c1cc7b3be Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 10:02:37 -0500 +Subject: arm64: dts: mediatek: mt8186: Add missing clocks to ssusb power + domains +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nícolas F. R. A. Prado + +[ Upstream commit a00d4a98af44e025891e97c490b2545368a25e08 ] + +The ssusb power domains currently don't list any clocks, despite +depending on some, and thus rely on the bootloader leaving the required +clocks on in order to work. + +When booting with the upstream arm64 defconfig, the power domain +controller will defer probe until modules have loaded since it has an +indirect dependency on CONFIG_MTK_CMDQ, which is configured as a module. +However at the point where modules are loaded, unused clocks are also +disabled, causing the ssusb domains to fail to be enabled and +consequently the controller to fail probe: + +mtk-power-controller 10006000.syscon:power-controller: /soc/syscon@10006000/power-controller/power-domain@4: failed to power on domain: -110 +mtk-power-controller: probe of 10006000.syscon:power-controller failed with error -110 + +Add the missing clocks for the ssusb power domains so that they can +successfully probe without relying on the bootloader state. + +Fixes: d9e43c1e7a38 ("arm64: dts: mt8186: Add power domains controller") +Signed-off-by: Nícolas F. R. A. Prado +Link: https://lore.kernel.org/r/20240213-mt8186-ssusb-domain-clk-fix-v2-1-1f981d35f3fd@collabora.com +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8186.dtsi | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi +index ee0feadbf9619..4fd25f0f313d2 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi +@@ -931,11 +931,17 @@ power-domain@MT8186_POWER_DOMAIN_CSIRX_TOP { + + power-domain@MT8186_POWER_DOMAIN_SSUSB { + reg = ; ++ clocks = <&topckgen CLK_TOP_USB_TOP>, ++ <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_REF>; ++ clock-names = "sys_ck", "ref_ck"; + #power-domain-cells = <0>; + }; + + power-domain@MT8186_POWER_DOMAIN_SSUSB_P1 { + reg = ; ++ clocks = <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_SYS>, ++ <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_REF>; ++ clock-names = "sys_ck", "ref_ck"; + #power-domain-cells = <0>; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt8186-add-missing-xhci-clock-to-.patch b/queue-6.8/arm64-dts-mediatek-mt8186-add-missing-xhci-clock-to-.patch new file mode 100644 index 00000000000..e6bdf16fb7f --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt8186-add-missing-xhci-clock-to-.patch @@ -0,0 +1,74 @@ +From 2d1b0da749a0022a02def5000ba55b10343802eb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 10:02:38 -0500 +Subject: arm64: dts: mediatek: mt8186: Add missing xhci clock to usb + controllers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nícolas F. R. A. Prado + +[ Upstream commit 1af98c3e53da5a8f627855cecd68b017e753ffd3 ] + +The mtu3 usb controllers don't list the xhci clock, though they require +it, and thus rely on the bootloader leaving it on in order to work. + +When booting with the upstream arm64 defconfig, the usb controllers will +defer probe until modules have loaded since they have an indirect +dependency on CONFIG_MTK_CMDQ, which is configured as a module. However +at the point where modules are loaded, unused clocks are also disabled, +causing the usb controllers to probe without the xhci clock enabled and +fail to probe: + +mtu3 11201000.usb: clks of sts1 are not stable! +mtu3 11201000.usb: device enable failed -110 +mtu3 11201000.usb: mtu3 hw init failed:-110 +mtu3 11201000.usb: failed to initialize gadget +mtu3: probe of 11201000.usb failed with error -110 + +(and same for the one at 11281000) + +Add the missing clock for the usb controllers so that they can +successfully probe without relying on the bootloader state. + +Fixes: f6c3e61c5486 ("arm64: dts: mediatek: mt8186: Add MTU3 nodes") +Signed-off-by: Nícolas F. R. A. Prado +Link: https://lore.kernel.org/r/20240213-mt8186-ssusb-domain-clk-fix-v2-2-1f981d35f3fd@collabora.com +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8186.dtsi | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi +index 4fd25f0f313d2..84ec6c1aa12b9 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi +@@ -1536,8 +1536,9 @@ ssusb0: usb@11201000 { + clocks = <&topckgen CLK_TOP_USB_TOP>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_REF>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_HCLK>, +- <&infracfg_ao CLK_INFRA_AO_ICUSB>; +- clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck"; ++ <&infracfg_ao CLK_INFRA_AO_ICUSB>, ++ <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_XHCI>; ++ clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; + interrupts = ; + phys = <&u2port0 PHY_TYPE_USB2>; + power-domains = <&spm MT8186_POWER_DOMAIN_SSUSB>; +@@ -1601,8 +1602,9 @@ ssusb1: usb@11281000 { + clocks = <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_SYS>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_REF>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_HCLK>, +- <&clk26m>; +- clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck"; ++ <&clk26m>, ++ <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_XHCI>; ++ clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; + interrupts = ; + phys = <&u2port1 PHY_TYPE_USB2>, <&u3port1 PHY_TYPE_USB3>; + power-domains = <&spm MT8186_POWER_DOMAIN_SSUSB_P1>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt8186-fix-venc-power-domain-cloc.patch b/queue-6.8/arm64-dts-mediatek-mt8186-fix-venc-power-domain-cloc.patch new file mode 100644 index 00000000000..22b1eb375c3 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt8186-fix-venc-power-domain-cloc.patch @@ -0,0 +1,38 @@ +From a8b517c572cc6b13633dd54518d88f7c8ce7e472 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 28 Dec 2023 13:32:44 +0200 +Subject: arm64: dts: mediatek: mt8186: fix VENC power domain clocks + +From: Eugen Hristev + +[ Upstream commit 09860910c589a3bb3b5268ff6f704cf6b18ada73 ] + +The larb clock is in fact a subsys clock, so it must be prefixed by +'subsys-' to be correctly identified in the driver. + +Fixes: d9e43c1e7a38 ("arm64: dts: mt8186: Add power domains controller") +Signed-off-by: Eugen Hristev +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20231228113245.174706-6-eugen.hristev@collabora.com +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8186.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi +index 2fec6fd1c1a71..ee0feadbf9619 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi +@@ -1061,7 +1061,7 @@ power-domain@MT8186_POWER_DOMAIN_VENC { + reg = ; + clocks = <&topckgen CLK_TOP_VENC>, + <&vencsys CLK_VENC_CKE1_VENC>; +- clock-names = "venc0", "larb"; ++ clock-names = "venc0", "subsys-larb"; + mediatek,infracfg = <&infracfg_ao>; + #power-domain-cells = <0>; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt8192-asurada-remove-crosec-base.patch b/queue-6.8/arm64-dts-mediatek-mt8192-asurada-remove-crosec-base.patch new file mode 100644 index 00000000000..b7e70701634 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt8192-asurada-remove-crosec-base.patch @@ -0,0 +1,49 @@ +From f3d47ff5ee4ce60793af8ae0dfc05f1582832131 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Feb 2024 15:08:42 -0500 +Subject: arm64: dts: mediatek: mt8192-asurada: Remove CrosEC base detection + node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nícolas F. R. A. Prado + +[ Upstream commit 9b49cabe631b0a25aaf8fc2ba81b5b9ea6ff01b7 ] + +The commit adding the ChromeOS EC to the Asurada Devicetree mistakenly +added a base detection node. While tablet mode detection is supported by +CrosEC and used by Hayato, it is done through the cros-ec-keyb driver. +The base detection node, which is handled by the hid-google-hammer +driver, also provides tablet mode detection but by checking base +attachment status on the CrosEC, which is not supported for Asurada. + +Hence, remove the unused CrosEC base detection node for Asurada. + +Fixes: eb188a2aaa82 ("arm64: dts: mediatek: asurada: Add ChromeOS EC") +Signed-off-by: Nícolas F. R. A. Prado +Link: https://lore.kernel.org/r/20240207-mt8192-asurada-cbas-remove-v1-1-04cb65951975@collabora.com +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +index d87aab8d7a79e..d4dd5e8b2e1d3 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +@@ -1336,10 +1336,6 @@ cros_ec: ec@0 { + #address-cells = <1>; + #size-cells = <0>; + +- base_detection: cbas { +- compatible = "google,cros-cbas"; +- }; +- + cros_ec_pwm: pwm { + compatible = "google,cros-ec-pwm"; + #pwm-cells = <1>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mediatek-mt8192-fix-vencoder-clock-name.patch b/queue-6.8/arm64-dts-mediatek-mt8192-fix-vencoder-clock-name.patch new file mode 100644 index 00000000000..8dc0ad6a9a7 --- /dev/null +++ b/queue-6.8/arm64-dts-mediatek-mt8192-fix-vencoder-clock-name.patch @@ -0,0 +1,40 @@ +From 0c8bc69bf80af57993f93bcd2a8c7df849435ba6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 28 Dec 2023 13:32:42 +0200 +Subject: arm64: dts: mediatek: mt8192: fix vencoder clock name + +From: Eugen Hristev + +[ Upstream commit 76aac0f2a46847ed4a7a4fdd848dd66023c19ad1 ] + +Clock name should be `venc_sel` as per binding. +Fix the warning message : +arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dtb: vcodec@17020000: clock-names:0: 'venc_sel' was expected + from schema $id: http://devicetree.org/schemas/media/mediatek,vcodec-encoder.yaml# + +Fixes: aa8f3711fc87 ("arm64: dts: mt8192: Add H264 venc device node") +Signed-off-by: Eugen Hristev +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20231228113245.174706-4-eugen.hristev@collabora.com +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8192.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8192.dtsi b/arch/arm64/boot/dts/mediatek/mt8192.dtsi +index 6dd32dbfb832e..0e432636b8c23 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8192.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8192.dtsi +@@ -1814,7 +1814,7 @@ vcodec_enc: vcodec@17020000 { + mediatek,scp = <&scp>; + power-domains = <&spm MT8192_POWER_DOMAIN_VENC>; + clocks = <&vencsys CLK_VENC_SET1_VENC>; +- clock-names = "venc-set1"; ++ clock-names = "venc_sel"; + assigned-clocks = <&topckgen CLK_TOP_VENC_SEL>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D4>; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mt8183-move-crosec-base-detection-node-to-.patch b/queue-6.8/arm64-dts-mt8183-move-crosec-base-detection-node-to-.patch new file mode 100644 index 00000000000..7fb0fc67a97 --- /dev/null +++ b/queue-6.8/arm64-dts-mt8183-move-crosec-base-detection-node-to-.patch @@ -0,0 +1,106 @@ +From 122e39db9993870a34f529f5e258b3f3c6cf84db Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Jan 2024 18:38:34 -0300 +Subject: arm64: dts: mt8183: Move CrosEC base detection node to kukui-based + DTs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nícolas F. R. A. Prado + +[ Upstream commit 04bd6411f506357fd1faedc2b2156e7ef206aa9a ] + +The cbas node is used to describe base detection functionality in the +ChromeOS EC, which is used for units that have a detachable keyboard and +thus rely on this functionality to switch between tablet and laptop +mode. + +Despite the original commit having added the cbas node to the +mt8183-kukui.dtsi, not all machines that include it are detachables. In +fact all machines that include from mt8183-kukui-jacuzzi.dtsi are either +clamshells (ie normal laptops) or convertibles, meaning the keyboard can +be flipped but not detached. The detection for the keyboard getting +flipped is handled by the driver bound to the keyboard-controller node +in the EC. + +Move the base detection node from the base kukui dtsi to the dtsis where +all machines are detachables, and thus actually make use of the node. + +Fixes: 4fa8492d1e5b ("arm64: dts: mt8183: add cbas node under cros_ec") +Signed-off-by: Nícolas F. R. A. Prado +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20240116-mt8183-kukui-cbas-remove-v3-1-055e21406e86@collabora.com +Signed-off-by: Matthias Brugger +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi | 4 ++++ + arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi | 4 ++++ + arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi | 4 ++++ + arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ---- + 4 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi +index b6a9830af2696..bfb9e42c8acaa 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi +@@ -360,6 +360,10 @@ pen_eject { + }; + + &cros_ec { ++ cbas { ++ compatible = "google,cros-cbas"; ++ }; ++ + keyboard-controller { + compatible = "google,cros-ec-keyb-switches"; + }; +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi +index 306c95166f3fe..5c1bf6a1e4758 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi +@@ -339,6 +339,10 @@ touch_pin_reset: pin_reset { + }; + + &cros_ec { ++ cbas { ++ compatible = "google,cros-cbas"; ++ }; ++ + keyboard-controller { + compatible = "google,cros-ec-keyb-switches"; + }; +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi +index 382e4c6d7191c..0f5fa893a7742 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi +@@ -343,6 +343,10 @@ rst_pin { + }; + + &cros_ec { ++ cbas { ++ compatible = "google,cros-cbas"; ++ }; ++ + keyboard-controller { + compatible = "google,cros-ec-keyb-switches"; + }; +diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +index 1b3396b1cee39..90c5ad917a9ba 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +@@ -937,10 +937,6 @@ usbc_extcon: extcon0 { + google,usb-port-id = <0>; + }; + +- cbas { +- compatible = "google,cros-cbas"; +- }; +- + typec { + compatible = "google,cros-ec-typec"; + #address-cells = <1>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-mt8195-cherry-tomato-change-watchdog-reset.patch b/queue-6.8/arm64-dts-mt8195-cherry-tomato-change-watchdog-reset.patch new file mode 100644 index 00000000000..1e1b7cf9c73 --- /dev/null +++ b/queue-6.8/arm64-dts-mt8195-cherry-tomato-change-watchdog-reset.patch @@ -0,0 +1,66 @@ +From b6f1708fe9cd6d255bb71d93c5e1e197c1272d00 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jan 2024 07:51:57 +0000 +Subject: arm64: dts: mt8195-cherry-tomato: change watchdog reset boot flow + +From: Hsin-Te Yuan + +[ Upstream commit ef569d5db50e7edd709e482157769a5b3c367e22 ] + +The external output reset signal was originally disabled and sent from +firmware. However, an unfixed bug in the firmware on tomato prevents +the signal from being sent, causing the device to fail to boot. To fix +this, enable external output reset signal to allow the device to reboot +normally. + +Fixes: 5eb2e303ec6b ("arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato") +Signed-off-by: Hsin-Te Yuan +Reviewed-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20240124-send-upstream-v3-1-5097c9862a73@chromium.org +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 4 ++++ + arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts | 4 ++++ + arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts | 4 ++++ + 3 files changed, 12 insertions(+) + +diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts +index 2d5e8f371b6de..a82d716f10d44 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts ++++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts +@@ -23,3 +23,7 @@ &sound { + &ts_10 { + status = "okay"; + }; ++ ++&watchdog { ++ /delete-property/ mediatek,disable-extrst; ++}; +diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts +index 2586c32ce6e6f..2fe20e0dad836 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts ++++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts +@@ -43,3 +43,7 @@ &sound { + &ts_10 { + status = "okay"; + }; ++ ++&watchdog { ++ /delete-property/ mediatek,disable-extrst; ++}; +diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts +index f54f9477b99da..dd294ca98194c 100644 +--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts ++++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts +@@ -44,3 +44,7 @@ &sound { + &ts_10 { + status = "okay"; + }; ++ ++&watchdog { ++ /delete-property/ mediatek,disable-extrst; ++}; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-msm8996-define-ufs-unipro-clock-limit.patch b/queue-6.8/arm64-dts-qcom-msm8996-define-ufs-unipro-clock-limit.patch new file mode 100644 index 00000000000..265e9536bce --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-msm8996-define-ufs-unipro-clock-limit.patch @@ -0,0 +1,42 @@ +From d862ef35cead2bf2e9802d4c05f8669a89ca0aad Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 18 Dec 2023 13:39:42 +0000 +Subject: arm64: dts: qcom: msm8996: Define UFS UniPro clock limits + +From: Yassine Oudjana + +[ Upstream commit 68c4c20848d71b0e69c3403becb5dd23e89e5896 ] + +These limits were always defined as 0, but that didn't cause any issue +since the driver had hardcoded limits. In commit b4e13e1ae95e ("scsi: ufs: +qcom: Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES") the +hardcoded limits were removed and the driver started reading them from DT, +causing UFS to stop working on MSM8996. Add real UniPro clock limits to fix +UFS. + +Signed-off-by: Yassine Oudjana +Fixes: 57fc67ef0d35 ("arm64: dts: qcom: msm8996: Add ufs related nodes") +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231218133917.78770-1-y.oudjana@protonmail.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi +index a66f2f8ef3be5..8ec95bfd884f2 100644 +--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi +@@ -2077,7 +2077,7 @@ ufshc: ufshc@624000 { + <0 0>, + <0 0>, + <150000000 300000000>, +- <0 0>, ++ <75000000 150000000>, + <0 0>, + <0 0>, + <0 0>, +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-msm8996-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-msm8996-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..d363f4b6f16 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-msm8996-fix-ufs-phy-clocks.patch @@ -0,0 +1,42 @@ +From 6d7ea5f8f533c6a08cbd1f35b8981881c24c82a7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:28 +0530 +Subject: arm64: dts: qcom: msm8996: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit c83fdb4335cec507d685ba9661ed7c4ccbaf12ff ] + +QMP PHY used in MSM8996 requires 2 clocks: + +* ref - 19.2MHz reference clock from RPM +* qref - QREF clock from GCC + +Fixes: 27520210e881 ("arm64: dts: qcom: msm8996: Use generic QMP driver for UFS") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-5-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi +index ee6f87c828aef..a66f2f8ef3be5 100644 +--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi +@@ -2096,8 +2096,8 @@ ufsphy: phy@627000 { + compatible = "qcom,msm8996-qmp-ufs-phy"; + reg = <0x00627000 0x1000>; + +- clocks = <&gcc GCC_UFS_CLKREF_CLK>; +- clock-names = "ref"; ++ clocks = <&rpmcc RPM_SMD_LN_BB_CLK>, <&gcc GCC_UFS_CLKREF_CLK>; ++ clock-names = "ref", "qref"; + + resets = <&ufshc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-msm8998-declare-vls-clamp-register-fo.patch b/queue-6.8/arm64-dts-qcom-msm8998-declare-vls-clamp-register-fo.patch new file mode 100644 index 00000000000..31db293ab06 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-msm8998-declare-vls-clamp-register-fo.patch @@ -0,0 +1,53 @@ +From c0abd45869e90dfffcf4c9b1eb6b5f3d1aef5133 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jan 2024 16:04:25 +0200 +Subject: arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY + +From: Dmitry Baryshkov + +[ Upstream commit fc835b2311d4deb85d776c1d73562338462aa7ac ] + +The USB3 PHY on the MSM8998 platform doesn't have built-in +PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately +via the register in the TCSR space. Declare corresponding register. + +Fixes: 026dad8f5873 ("arm64: dts: qcom: msm8998: Add USB-related nodes") +Cc: Jeffrey Hugo +Signed-off-by: Dmitry Baryshkov +Reviewed-by: Konrad Dybcio +Reviewed-by: Jeffrey Hugo +Link: https://lore.kernel.org/r/20240117-usbc-phy-vls-clamp-v2-4-a950c223f10f@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi +index 2793cc22d381a..317a91d669f82 100644 +--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi +@@ -1072,6 +1072,11 @@ tcsr_regs_1: syscon@1f60000 { + reg = <0x01f60000 0x20000>; + }; + ++ tcsr_regs_2: syscon@1fc0000 { ++ compatible = "qcom,msm8998-tcsr", "syscon"; ++ reg = <0x01fc0000 0x26000>; ++ }; ++ + tlmm: pinctrl@3400000 { + compatible = "qcom,msm8998-pinctrl"; + reg = <0x03400000 0xc00000>; +@@ -2174,6 +2179,8 @@ usb3phy: phy@c010000 { + reset-names = "phy", + "phy_phy"; + ++ qcom,tcsr-reg = <&tcsr_regs_2 0xb244>; ++ + status = "disabled"; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-msm8998-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-msm8998-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..790d7453c77 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-msm8998-fix-ufs-phy-clocks.patch @@ -0,0 +1,51 @@ +From 1ed7d0d9f95e7c0a179492be0aff880e60a36b45 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:29 +0530 +Subject: arm64: dts: qcom: msm8998: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 5e653a7ff4426242f22dd8bc6af7f29e10ee0d68 ] + +QMP PHY used in MSM8998 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPM +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +Fixes: cd3dbe2a4e6c ("arm64: dts: qcom: msm8998: Add UFS nodes") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-6-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/msm8998.dtsi | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi +index 317a91d669f82..20200a0d76a6b 100644 +--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi +@@ -1047,12 +1047,12 @@ ufsphy: phy@1da7000 { + compatible = "qcom,msm8998-qmp-ufs-phy"; + reg = <0x01da7000 0x1000>; + +- clock-names = +- "ref", +- "ref_aux"; +- clocks = +- <&gcc GCC_UFS_CLKREF_CLK>, +- <&gcc GCC_UFS_PHY_AUX_CLK>; ++ clocks = <&rpmcc RPM_SMD_LN_BB_CLK1>, ++ <&gcc GCC_UFS_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_CLKREF_CLK>; ++ clock-names = "ref", ++ "ref_aux", ++ "qref"; + + reset-names = "ufsphy"; + resets = <&ufshc 0>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-qcm2290-declare-vls-clamp-register-fo.patch b/queue-6.8/arm64-dts-qcom-qcm2290-declare-vls-clamp-register-fo.patch new file mode 100644 index 00000000000..e9e9a380fba --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-qcm2290-declare-vls-clamp-register-fo.patch @@ -0,0 +1,51 @@ +From 5324ad07862d058139098638d1cba3fea314258d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jan 2024 16:04:26 +0200 +Subject: arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY + +From: Dmitry Baryshkov + +[ Upstream commit acb94d67f5a23dbb2e0021b6c30609ed05d7d6a5 ] + +The USB3 PHY on the QCM2290 platform doesn't have built-in +PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately +via the register in the TCSR space. Declare corresponding register. + +Fixes: 0c55f6229bc3 ("arm64: dts: qcom: qcm2290: Add USB3 PHY") +Signed-off-by: Dmitry Baryshkov +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240117-usbc-phy-vls-clamp-v2-5-a950c223f10f@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/qcm2290.dtsi | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi +index 0911fb08ed632..89beac833d435 100644 +--- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi ++++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi +@@ -442,6 +442,11 @@ tcsr_mutex: hwlock@340000 { + #hwlock-cells = <1>; + }; + ++ tcsr_regs: syscon@3c0000 { ++ compatible = "qcom,qcm2290-tcsr", "syscon"; ++ reg = <0x0 0x003c0000 0x0 0x40000>; ++ }; ++ + tlmm: pinctrl@500000 { + compatible = "qcom,qcm2290-tlmm"; + reg = <0x0 0x00500000 0x0 0x300000>; +@@ -690,6 +695,8 @@ usb_qmpphy: phy@1615000 { + + #phy-cells = <0>; + ++ qcom,tcsr-reg = <&tcsr_regs 0xb244>; ++ + status = "disabled"; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-qcm6490-fairphone-fp5-add-missing-res.patch b/queue-6.8/arm64-dts-qcom-qcm6490-fairphone-fp5-add-missing-res.patch new file mode 100644 index 00000000000..4037b1b0a57 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-qcm6490-fairphone-fp5-add-missing-res.patch @@ -0,0 +1,43 @@ +From 701cfd1b2e63c6ddd737e3459ddce2872793c272 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 29 Dec 2023 13:53:17 +0100 +Subject: arm64: dts: qcom: qcm6490-fairphone-fp5: Add missing reserved-memory + +From: Luca Weiss + +[ Upstream commit 5dbbe7e0a2b91ac5901ee188724a997004759171 ] + +It seems we also need to reserve a region of 81 MiB called "removed_mem" +otherwise we can easily hit the following error with higher RAM usage: + + [ 1467.809274] Internal error: synchronous external abort: 0000000096000010 [#2] SMP + +Fixes: eee9602ad649 ("arm64: dts: qcom: qcm6490: Add device-tree for Fairphone 5") +Signed-off-by: Luca Weiss +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231229-fp5-reserved-mem-v1-1-87bb818f1397@fairphone.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +index 176898c9dbbd7..1e85c43a6fd14 100644 +--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts ++++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +@@ -82,6 +82,11 @@ cdsp_mem: cdsp@88f00000 { + no-map; + }; + ++ removed_mem: removed@c0000000 { ++ reg = <0x0 0xc0000000 0x0 0x5100000>; ++ no-map; ++ }; ++ + rmtfs_mem: memory@f8500000 { + compatible = "qcom,rmtfs-mem"; + reg = <0x0 0xf8500000 0x0 0x600000>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-qcm6490-idp-correct-the-voltage-setti.patch b/queue-6.8/arm64-dts-qcom-qcm6490-idp-correct-the-voltage-setti.patch new file mode 100644 index 00000000000..8e1b466f1de --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-qcm6490-idp-correct-the-voltage-setti.patch @@ -0,0 +1,41 @@ +From 4985ac0138a571aaef4d39e36eab8dce9ac715da Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Dec 2023 16:30:14 +0530 +Subject: arm64: dts: qcom: qcm6490-idp: Correct the voltage setting for + vph_pwr + +From: Komal Bajaj + +[ Upstream commit aa56130e88de50773f84de4039c7de81ab783744 ] + +Min and max voltages for vph_pwr should be same, otherwise rpmh +will not probe, so correcting the min and max voltages for vph_pwr. + +Fixes: 9af6a9f32ad0 ("arm64: dts: qcom: Add base qcm6490 idp board dts") +Signed-off-by: Komal Bajaj +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231220110015.25378-2-quic_kbajaj@quicinc.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts +index 03e97e27d16d4..74f5a43d53db9 100644 +--- a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts ++++ b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts +@@ -123,8 +123,8 @@ debug_vm_mem: debug-vm@d0600000 { + vph_pwr: vph-pwr-regulator { + compatible = "regulator-fixed"; + regulator-name = "vph_pwr"; +- regulator-min-microvolt = <2500000>; +- regulator-max-microvolt = <4350000>; ++ regulator-min-microvolt = <3700000>; ++ regulator-max-microvolt = <3700000>; + }; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-qcs6490-rb3gen2-correct-the-voltage-s.patch b/queue-6.8/arm64-dts-qcom-qcs6490-rb3gen2-correct-the-voltage-s.patch new file mode 100644 index 00000000000..7b6e55b29cb --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-qcs6490-rb3gen2-correct-the-voltage-s.patch @@ -0,0 +1,41 @@ +From 752e8ee82075b6d278418c69d105009af16b0fe6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Dec 2023 16:30:15 +0530 +Subject: arm64: dts: qcom: qcs6490-rb3gen2: Correct the voltage setting for + vph_pwr + +From: Komal Bajaj + +[ Upstream commit 05f439c0e64b877c1f9cc7f0bed894b6df45d43d ] + +Min and max voltages for vph_pwr should be same, otherwise rpmh +will not probe, so correcting the min and max voltages for vph_pwr. + +Fixes: 04cf333afc75 ("arm64: dts: qcom: Add base qcs6490-rb3gen2 board dts") +Signed-off-by: Komal Bajaj +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231220110015.25378-3-quic_kbajaj@quicinc.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +index 8bb7d13d85f66..ae1632182d7c1 100644 +--- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts ++++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +@@ -124,8 +124,8 @@ debug_vm_mem: debug-vm@d0600000 { + vph_pwr: vph-pwr-regulator { + compatible = "regulator-fixed"; + regulator-name = "vph_pwr"; +- regulator-min-microvolt = <2500000>; +- regulator-max-microvolt = <4350000>; ++ regulator-min-microvolt = <3700000>; ++ regulator-max-microvolt = <3700000>; + }; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-rename-pm2250-to-pm4125.patch b/queue-6.8/arm64-dts-qcom-rename-pm2250-to-pm4125.patch new file mode 100644 index 00000000000..b7ebec59c69 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-rename-pm2250-to-pm4125.patch @@ -0,0 +1,345 @@ +From f3ee63de2ba80ad671be1bcc87a7a9e8b5b3401c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jan 2024 03:32:45 +0200 +Subject: arm64: dts: qcom: rename PM2250 to PM4125 + +From: Dmitry Baryshkov + +[ Upstream commit 39e62f41c3ce210554cc054f345d4135ef4e587b ] + +It seems, the only actual mentions of PM2250 can be found are related to +the Qualcomm RB1 platform. However even RB1 schematics use PM4125 as a +PMIC name. Rename PM2250 to PM4125 to follow the documentation. + +Note, this doesn't change the compatible strings. There was a previous +argument regarding renaming of compat strings. + +Fixes: c309b9a54039 ("arm64: dts: qcom: Add initial PM2250 device tree") +Acked-by: Konrad Dybcio +Signed-off-by: Dmitry Baryshkov +Link: https://lore.kernel.org/r/20240128-pm2250-pm4125-rename-v2-2-d51987e9f83a@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + .../dts/qcom/{pm2250.dtsi => pm4125.dtsi} | 8 +- + arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 78 +++++++++---------- + 2 files changed, 43 insertions(+), 43 deletions(-) + rename arch/arm64/boot/dts/qcom/{pm2250.dtsi => pm4125.dtsi} (91%) + +diff --git a/arch/arm64/boot/dts/qcom/pm2250.dtsi b/arch/arm64/boot/dts/qcom/pm4125.dtsi +similarity index 91% +rename from arch/arm64/boot/dts/qcom/pm2250.dtsi +rename to arch/arm64/boot/dts/qcom/pm4125.dtsi +index 5f1d15db5c993..d886a9e4b0918 100644 +--- a/arch/arm64/boot/dts/qcom/pm2250.dtsi ++++ b/arch/arm64/boot/dts/qcom/pm4125.dtsi +@@ -19,7 +19,7 @@ pon@800 { + compatible = "qcom,pm8916-pon"; + reg = <0x800>; + +- pm2250_pwrkey: pwrkey { ++ pm4125_pwrkey: pwrkey { + compatible = "qcom,pm8941-pwrkey"; + interrupts-extended = <&spmi_bus 0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>; + linux,code = ; +@@ -27,7 +27,7 @@ pm2250_pwrkey: pwrkey { + bias-pull-up; + }; + +- pm2250_resin: resin { ++ pm4125_resin: resin { + compatible = "qcom,pm8941-resin"; + interrupts-extended = <&spmi_bus 0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; + debounce = <15625>; +@@ -43,11 +43,11 @@ rtc@6000 { + interrupts-extended = <&spmi_bus 0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; + }; + +- pm2250_gpios: gpio@c000 { ++ pm4125_gpios: gpio@c000 { + compatible = "qcom,pm2250-gpio", "qcom,spmi-gpio"; + reg = <0xc000>; + gpio-controller; +- gpio-ranges = <&pm2250_gpios 0 0 10>; ++ gpio-ranges = <&pm4125_gpios 0 0 10>; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; +diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts +index aa53b6af6d9cb..64b2ab2862793 100644 +--- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts ++++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts +@@ -7,7 +7,7 @@ + + #include + #include "qcm2290.dtsi" +-#include "pm2250.dtsi" ++#include "pm4125.dtsi" + + / { + model = "Qualcomm Technologies, Inc. Robotics RB1"; +@@ -226,7 +226,7 @@ &mdss { + }; + + &mdss_dsi0 { +- vdda-supply = <&pm2250_l5>; ++ vdda-supply = <&pm4125_l5>; + status = "okay"; + }; + +@@ -239,7 +239,7 @@ &mdss_dsi0_phy { + status = "okay"; + }; + +-&pm2250_resin { ++&pm4125_resin { + linux,code = ; + status = "okay"; + }; +@@ -263,23 +263,23 @@ regulators { + compatible = "qcom,rpm-pm2250-regulators"; + vdd_s3-supply = <&vph_pwr>; + vdd_s4-supply = <&vph_pwr>; +- vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12-supply = <&pm2250_s3>; ++ vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12-supply = <&pm4125_s3>; + vdd_l4_l17_l18_l19_l20_l21_l22-supply = <&vph_pwr>; +- vdd_l13_l14_l15_l16-supply = <&pm2250_s4>; ++ vdd_l13_l14_l15_l16-supply = <&pm4125_s4>; + + /* + * S1 - VDD_APC + * S2 - VDD_CX + */ + +- pm2250_s3: s3 { ++ pm4125_s3: s3 { + /* 0.4V-1.6625V -> 1.3V (Power tree requirements) */ + regulator-min-microvolt = <1352000>; + regulator-max-microvolt = <1352000>; + regulator-boot-on; + }; + +- pm2250_s4: s4 { ++ pm4125_s4: s4 { + /* 1.2V-2.35V -> 2.05V (Power tree requirements) */ + regulator-min-microvolt = <2072000>; + regulator-max-microvolt = <2072000>; +@@ -288,7 +288,7 @@ pm2250_s4: s4 { + + /* L1 - VDD_MX */ + +- pm2250_l2: l2 { ++ pm4125_l2: l2 { + /* LPDDR4X VDD2 */ + regulator-min-microvolt = <1136000>; + regulator-max-microvolt = <1136000>; +@@ -296,7 +296,7 @@ pm2250_l2: l2 { + regulator-boot-on; + }; + +- pm2250_l3: l3 { ++ pm4125_l3: l3 { + /* LPDDR4X VDDQ */ + regulator-min-microvolt = <616000>; + regulator-max-microvolt = <616000>; +@@ -304,14 +304,14 @@ pm2250_l3: l3 { + regulator-boot-on; + }; + +- pm2250_l4: l4 { ++ pm4125_l4: l4 { + /* max = 3.05V -> max = 2.7 to disable 3V signaling (SDHCI2) */ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2700000>; + regulator-allow-set-load; + }; + +- pm2250_l5: l5 { ++ pm4125_l5: l5 { + /* CSI/DSI */ + regulator-min-microvolt = <1232000>; + regulator-max-microvolt = <1232000>; +@@ -319,7 +319,7 @@ pm2250_l5: l5 { + regulator-boot-on; + }; + +- pm2250_l6: l6 { ++ pm4125_l6: l6 { + /* DRAM PLL */ + regulator-min-microvolt = <928000>; + regulator-max-microvolt = <928000>; +@@ -327,7 +327,7 @@ pm2250_l6: l6 { + regulator-boot-on; + }; + +- pm2250_l7: l7 { ++ pm4125_l7: l7 { + /* Wi-Fi CX/MX */ + regulator-min-microvolt = <664000>; + regulator-max-microvolt = <664000>; +@@ -338,20 +338,20 @@ pm2250_l7: l7 { + * L9 - VDD_LPI_MX + */ + +- pm2250_l10: l10 { ++ pm4125_l10: l10 { + /* Wi-Fi RFA */ + regulator-min-microvolt = <1304000>; + regulator-max-microvolt = <1304000>; + }; + +- pm2250_l11: l11 { ++ pm4125_l11: l11 { + /* GPS RF1 */ + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + regulator-boot-on; + }; + +- pm2250_l12: l12 { ++ pm4125_l12: l12 { + /* USB PHYs */ + regulator-min-microvolt = <928000>; + regulator-max-microvolt = <928000>; +@@ -359,7 +359,7 @@ pm2250_l12: l12 { + regulator-boot-on; + }; + +- pm2250_l13: l13 { ++ pm4125_l13: l13 { + /* USB/QFPROM/PLLs */ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +@@ -367,7 +367,7 @@ pm2250_l13: l13 { + regulator-boot-on; + }; + +- pm2250_l14: l14 { ++ pm4125_l14: l14 { + /* SDHCI1 VQMMC */ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +@@ -376,7 +376,7 @@ pm2250_l14: l14 { + regulator-always-on; + }; + +- pm2250_l15: l15 { ++ pm4125_l15: l15 { + /* WCD/DSI/BT VDDIO */ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +@@ -385,38 +385,38 @@ pm2250_l15: l15 { + regulator-boot-on; + }; + +- pm2250_l16: l16 { ++ pm4125_l16: l16 { + /* GPS RF2 */ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + }; + +- pm2250_l17: l17 { ++ pm4125_l17: l17 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + +- pm2250_l18: l18 { ++ pm4125_l18: l18 { + /* VDD_PXn */ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + +- pm2250_l19: l19 { ++ pm4125_l19: l19 { + /* VDD_PXn */ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + +- pm2250_l20: l20 { ++ pm4125_l20: l20 { + /* SDHCI1 VMMC */ + regulator-min-microvolt = <2400000>; + regulator-max-microvolt = <3600000>; + regulator-allow-set-load; + }; + +- pm2250_l21: l21 { ++ pm4125_l21: l21 { + /* SDHCI2 VMMC */ + regulator-min-microvolt = <2960000>; + regulator-max-microvolt = <3300000>; +@@ -424,7 +424,7 @@ pm2250_l21: l21 { + regulator-boot-on; + }; + +- pm2250_l22: l22 { ++ pm4125_l22: l22 { + /* Wi-Fi */ + regulator-min-microvolt = <3312000>; + regulator-max-microvolt = <3312000>; +@@ -433,8 +433,8 @@ pm2250_l22: l22 { + }; + + &sdhc_1 { +- vmmc-supply = <&pm2250_l20>; +- vqmmc-supply = <&pm2250_l14>; ++ vmmc-supply = <&pm4125_l20>; ++ vqmmc-supply = <&pm4125_l14>; + pinctrl-0 = <&sdc1_state_on>; + pinctrl-1 = <&sdc1_state_off>; + pinctrl-names = "default", "sleep"; +@@ -446,8 +446,8 @@ &sdhc_1 { + }; + + &sdhc_2 { +- vmmc-supply = <&pm2250_l21>; +- vqmmc-supply = <&pm2250_l4>; ++ vmmc-supply = <&pm4125_l21>; ++ vqmmc-supply = <&pm4125_l4>; + cd-gpios = <&tlmm 88 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&sdc2_state_on &sd_det_in_on>; + pinctrl-1 = <&sdc2_state_off &sd_det_in_off>; +@@ -518,8 +518,8 @@ &usb { + }; + + &usb_qmpphy { +- vdda-phy-supply = <&pm2250_l12>; +- vdda-pll-supply = <&pm2250_l13>; ++ vdda-phy-supply = <&pm4125_l12>; ++ vdda-pll-supply = <&pm4125_l13>; + status = "okay"; + }; + +@@ -528,17 +528,17 @@ &usb_dwc3 { + }; + + &usb_hsphy { +- vdd-supply = <&pm2250_l12>; +- vdda-pll-supply = <&pm2250_l13>; +- vdda-phy-dpdm-supply = <&pm2250_l21>; ++ vdd-supply = <&pm4125_l12>; ++ vdda-pll-supply = <&pm4125_l13>; ++ vdda-phy-dpdm-supply = <&pm4125_l21>; + status = "okay"; + }; + + &wifi { +- vdd-0.8-cx-mx-supply = <&pm2250_l7>; +- vdd-1.8-xo-supply = <&pm2250_l13>; +- vdd-1.3-rfa-supply = <&pm2250_l10>; +- vdd-3.3-ch0-supply = <&pm2250_l22>; ++ vdd-0.8-cx-mx-supply = <&pm4125_l7>; ++ vdd-1.8-xo-supply = <&pm4125_l13>; ++ vdd-1.3-rfa-supply = <&pm4125_l10>; ++ vdd-3.3-ch0-supply = <&pm4125_l22>; + qcom,ath10k-calibration-variant = "Thundercomm_RB1"; + status = "okay"; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sa8540p-drop-gfx.lvl-as-power-domain-.patch b/queue-6.8/arm64-dts-qcom-sa8540p-drop-gfx.lvl-as-power-domain-.patch new file mode 100644 index 00000000000..d251350b9fe --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sa8540p-drop-gfx.lvl-as-power-domain-.patch @@ -0,0 +1,41 @@ +From f138d458c681cdddcc8e492dc437271f9742581a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jan 2024 13:05:11 -0800 +Subject: arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc + +From: Bjorn Andersson + +[ Upstream commit fd5821a1a83c969ed2dcc72fef885f3a82c1d978 ] + +The SA8295P and SA8540P uses an external regulator (max20411), and +gfx.lvl is not provided by rpmh. Drop the power-domains property of the +gpucc node to reflect this. + +Fixes: eec51ab2fd6f ("arm64: dts: qcom: sc8280xp: Add GPU related nodes") +Reviewed-by: Dmitry Baryshkov +Reviewed-by: Konrad Dybcio +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20240125-sa8295p-gpu-v4-5-7011c2a63037@quicinc.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sa8540p.dtsi | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/sa8540p.dtsi b/arch/arm64/boot/dts/qcom/sa8540p.dtsi +index 96b2c59ad02b4..23888029cc117 100644 +--- a/arch/arm64/boot/dts/qcom/sa8540p.dtsi ++++ b/arch/arm64/boot/dts/qcom/sa8540p.dtsi +@@ -168,6 +168,9 @@ opp-2592000000 { + }; + + &gpucc { ++ /* SA8295P and SA8540P doesn't provide gfx.lvl */ ++ /delete-property/ power-domains; ++ + status = "disabled"; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc7280-add-static-properties-to-crypt.patch b/queue-6.8/arm64-dts-qcom-sc7280-add-static-properties-to-crypt.patch new file mode 100644 index 00000000000..8a9e2927336 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc7280-add-static-properties-to-crypt.patch @@ -0,0 +1,43 @@ +From a400f2cc86d63dcac97efdc349bd088b7dea7890 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 29 Dec 2023 09:51:37 +0100 +Subject: arm64: dts: qcom: sc7280: Add static properties to cryptobam + +From: Luca Weiss + +[ Upstream commit 40ec6a2817d927367461fb0335b42b0d494ff927 ] + +When the properties num-channels & qcom,num-ees are not specified, the +driver tries to read the values from registers, but this read fails and +resets the device if the interconnect from the qcom,qce node is not +already active when that happens. + +Add the static properties to not touch any registers during probe, the +rest of the time when the BAM is used by QCE then the interconnect will +be active already. + +Fixes: d488f903a860 ("arm64: dts: qcom: sc7280: add QCrypto nodes") +Signed-off-by: Luca Weiss +Link: https://lore.kernel.org/r/20231229-sc7280-cryptobam-fixup-v1-1-bd8f68589b80@fairphone.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi +index 83b5b76ba1794..ce0d24ee7eedb 100644 +--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi +@@ -2345,6 +2345,8 @@ cryptobam: dma-controller@1dc4000 { + <&apps_smmu 0x4e6 0x0011>; + qcom,ee = <0>; + qcom,controlled-remotely; ++ num-channels = <16>; ++ qcom,num-ees = <4>; + }; + + crypto: crypto@1dfa000 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-mdp_cfg-path.patch b/queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-mdp_cfg-path.patch new file mode 100644 index 00000000000..f963c943b97 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-mdp_cfg-path.patch @@ -0,0 +1,47 @@ +From 43da8889836b3c5990b65e95a34828790e1aa754 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:09 +0100 +Subject: arm64: dts: qcom: sc8180x: Add missing CPU<->MDP_CFG path + +From: Konrad Dybcio + +[ Upstream commit f0cd5a0ebd419bd151ed79baf5f044da797521ac ] + +To guarantee the required resources are enabled, describe the +interconnect path between the MDSS and the CPU. + +Fixes: 494dec9b6f54 ("arm64: dts: qcom: sc8180x: Add display and gpu nodes") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-8-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index 97c139d0399d4..960058624a2f5 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -2701,9 +2701,15 @@ mdss: mdss@ae00000 { + interrupt-controller; + #interrupt-cells = <1>; + +- interconnects = <&mmss_noc MASTER_MDP_PORT0 0 &mc_virt SLAVE_EBI_CH0 0>, +- <&mmss_noc MASTER_MDP_PORT1 0 &mc_virt SLAVE_EBI_CH0 0>; +- interconnect-names = "mdp0-mem", "mdp1-mem"; ++ interconnects = <&mmss_noc MASTER_MDP_PORT0 QCOM_ICC_TAG_ALWAYS ++ &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>, ++ <&mmss_noc MASTER_MDP_PORT1 QCOM_ICC_TAG_ALWAYS ++ &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>, ++ <&gem_noc MASTER_AMPSS_M0 QCOM_ICC_TAG_ALWAYS ++ &config_noc SLAVE_DISPLAY_CFG QCOM_ICC_TAG_ALWAYS>; ++ interconnect-names = "mdp0-mem", ++ "mdp1-mem", ++ "cpu-cfg"; + + iommus = <&apps_smmu 0x800 0x420>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-off-state.patch b/queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-off-state.patch new file mode 100644 index 00000000000..8eb9ca95520 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-add-missing-cpu-off-state.patch @@ -0,0 +1,54 @@ +From db77741c09a25b932245d81c4b07e2dd90878440 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:05 +0100 +Subject: arm64: dts: qcom: sc8180x: Add missing CPU off state + +From: Konrad Dybcio + +[ Upstream commit 07b600dfdfea65d58dd80ea25becd8cff69bfafc ] + +The CPUs can be powered off without pulling the plug from the rest of +the system. Describe the idle state responsible for this. + +Fixes: 8575f197b077 ("arm64: dts: qcom: Introduce the SC8180x platform") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-4-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index b84fe5f3b41cb..8849469d0aa10 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -298,7 +298,15 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 { + }; + + domain-idle-states { +- CLUSTER_SLEEP_0: cluster-sleep-0 { ++ CLUSTER_SLEEP_APSS_OFF: cluster-sleep-0 { ++ compatible = "domain-idle-state"; ++ arm,psci-suspend-param = <0x41000044>; ++ entry-latency-us = <3300>; ++ exit-latency-us = <3300>; ++ min-residency-us = <6000>; ++ }; ++ ++ CLUSTER_SLEEP_AOSS_SLEEP: cluster-sleep-1 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x4100a344>; + entry-latency-us = <3263>; +@@ -582,7 +590,7 @@ CPU_PD7: power-domain-cpu7 { + + CLUSTER_PD: power-domain-cpu-cluster0 { + #power-domain-cells = <0>; +- domain-idle-states = <&CLUSTER_SLEEP_0>; ++ domain-idle-states = <&CLUSTER_SLEEP_APSS_OFF &CLUSTER_SLEEP_AOSS_SLEEP>; + }; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-don-t-hold-mdp-core-clock-at-.patch b/queue-6.8/arm64-dts-qcom-sc8180x-don-t-hold-mdp-core-clock-at-.patch new file mode 100644 index 00000000000..1d8c83c41c5 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-don-t-hold-mdp-core-clock-at-.patch @@ -0,0 +1,40 @@ +From 0cddab3b2e360894cac6434458aeaace744ab097 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:07 +0100 +Subject: arm64: dts: qcom: sc8180x: Don't hold MDP core clock at FMAX + +From: Konrad Dybcio + +[ Upstream commit 309b5774f45aafd002efdb2656673542419abd6f ] + +There's an OPP table to handle this, drop the permanent vote. + +Fixes: 494dec9b6f54 ("arm64: dts: qcom: sc8180x: Add display and gpu nodes") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-6-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index 8f7f5b74cdb9f..3bb9d25b1dec6 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -2732,10 +2732,8 @@ mdss_mdp: mdp@ae01000 { + "rot", + "lut"; + +- assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>, +- <&dispcc DISP_CC_MDSS_VSYNC_CLK>; +- assigned-clock-rates = <460000000>, +- <19200000>; ++ assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>; ++ assigned-clock-rates = <19200000>; + + operating-points-v2 = <&mdp_opp_table>; + power-domains = <&rpmhpd SC8180X_MMCX>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-fix-edp-phy-power-domains.patch b/queue-6.8/arm64-dts-qcom-sc8180x-fix-edp-phy-power-domains.patch new file mode 100644 index 00000000000..daea61d62ed --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-fix-edp-phy-power-domains.patch @@ -0,0 +1,37 @@ +From 63741cc94297cfb7261f6d6cd6b5815dacab1323 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:06 +0100 +Subject: arm64: dts: qcom: sc8180x: Fix eDP PHY power-domains + +From: Konrad Dybcio + +[ Upstream commit 24e98cb3d5e2c86565680e00008a794b4eac0040 ] + +The (e)DP PHYs are powered by the MX line, not through the MDSS GDSC. +Fix that up. + +Fixes: 494dec9b6f54 ("arm64: dts: qcom: sc8180x: Add display and gpu nodes") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-5-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index 8849469d0aa10..8f7f5b74cdb9f 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -3193,7 +3193,7 @@ edp_phy: phy@aec2a00 { + <&dispcc DISP_CC_MDSS_AHB_CLK>; + clock-names = "aux", "cfg_ahb"; + +- power-domains = <&dispcc MDSS_GDSC>; ++ power-domains = <&rpmhpd SC8180X_MX>; + + #clock-cells = <1>; + #phy-cells = <0>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-fix-up-big-cpu-idle-state-ent.patch b/queue-6.8/arm64-dts-qcom-sc8180x-fix-up-big-cpu-idle-state-ent.patch new file mode 100644 index 00000000000..0473ecc6918 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-fix-up-big-cpu-idle-state-ent.patch @@ -0,0 +1,37 @@ +From 7a76df82ead203436d198c7c28602a080cad0349 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:04 +0100 +Subject: arm64: dts: qcom: sc8180x: Fix up big CPU idle state entry latency + +From: Konrad Dybcio + +[ Upstream commit 266a3a92044b89c392b3e9cfcc328d4167c18294 ] + +The entry latency was oddly low.. Turns out somebody forgot about a +second '1'! Fix it. + +Fixes: 8575f197b077 ("arm64: dts: qcom: Introduce the SC8180x platform") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-3-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index 91fd805f17a1b..b84fe5f3b41cb 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -290,7 +290,7 @@ LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { + BIG_CPU_SLEEP_0: cpu-sleep-1-0 { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x40000004>; +- entry-latency-us = <241>; ++ entry-latency-us = <2411>; + exit-latency-us = <1461>; + min-residency-us = <4488>; + local-timer-stop; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-hook-up-vdd_cx-as-gcc-parent-.patch b/queue-6.8/arm64-dts-qcom-sc8180x-hook-up-vdd_cx-as-gcc-parent-.patch new file mode 100644 index 00000000000..cb30c5681fb --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-hook-up-vdd_cx-as-gcc-parent-.patch @@ -0,0 +1,36 @@ +From 0153ef94dcd2462a61e8850e1729d7fb0dd06d5b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:03 +0100 +Subject: arm64: dts: qcom: sc8180x: Hook up VDD_CX as GCC parent domain + +From: Konrad Dybcio + +[ Upstream commit 3c58b96df110a80e78fa36ef928f1e6c375008e3 ] + +Most of GCC is powered by the CX rail. Describe that relationship to +let the performance state requests trickle up the chain. + +Fixes: 8575f197b077 ("arm64: dts: qcom: Introduce the SC8180x platform") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-2-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index 0430d99091e30..91fd805f17a1b 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -782,6 +782,7 @@ gcc: clock-controller@100000 { + clock-names = "bi_tcxo", + "bi_tcxo_ao", + "sleep_clk"; ++ power-domains = <&rpmhpd SC8180X_CX>; + }; + + qupv3_id_0: geniqup@8c0000 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-require-low_svs-vote-for-mmcx.patch b/queue-6.8/arm64-dts-qcom-sc8180x-require-low_svs-vote-for-mmcx.patch new file mode 100644 index 00000000000..fd2b14fc947 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-require-low_svs-vote-for-mmcx.patch @@ -0,0 +1,37 @@ +From baba33314717867c091bb1857972d22994c1f6a3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:08 +0100 +Subject: arm64: dts: qcom: sc8180x: Require LOW_SVS vote for MMCX if DISPCC is + on + +From: Konrad Dybcio + +[ Upstream commit 6d9fb9e4c473cdfd2adca019b46d8e482105cae7 ] + +To ensure the PLLs are getting enough power, cast a vote with DISPCC so +that MMCX is at least at LOW_SVS. + +Fixes: 494dec9b6f54 ("arm64: dts: qcom: sc8180x: Add display and gpu nodes") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-7-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index 3bb9d25b1dec6..97c139d0399d4 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -3217,6 +3217,7 @@ dispcc: clock-controller@af00000 { + "edp_phy_pll_link_clk", + "edp_phy_pll_vco_div_clk"; + power-domains = <&rpmhpd SC8180X_MMCX>; ++ required-opps = <&rpmhpd_opp_low_svs>; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8180x-shrink-aoss_qmp-register-spac.patch b/queue-6.8/arm64-dts-qcom-sc8180x-shrink-aoss_qmp-register-spac.patch new file mode 100644 index 00000000000..de64492c980 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8180x-shrink-aoss_qmp-register-spac.patch @@ -0,0 +1,37 @@ +From 23cd617fb37e509854608667dde8ab0f0faeea38 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 30 Dec 2023 01:05:10 +0100 +Subject: arm64: dts: qcom: sc8180x: Shrink aoss_qmp register space size + +From: Konrad Dybcio + +[ Upstream commit dcad0590d1ea4278a55c30dd2903611a96111601 ] + +The AOSS_QMP region is overallocated, bleeding into space that's supposed +to be used by other peripherals. Fix it. + +Fixes: 8575f197b077 ("arm64: dts: qcom: Introduce the SC8180x platform") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231230-topic-8180_more_fixes-v1-9-93b5c107ed43@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +index 960058624a2f5..c0dd44f146748 100644 +--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi +@@ -3262,7 +3262,7 @@ tsens1: thermal-sensor@c265000 { + + aoss_qmp: power-controller@c300000 { + compatible = "qcom,sc8180x-aoss-qmp", "qcom,aoss-qmp"; +- reg = <0x0 0x0c300000 0x0 0x100000>; ++ reg = <0x0 0x0c300000 0x0 0x400>; + interrupts = ; + mboxes = <&apss_shared 0>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sc8280xp-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sc8280xp-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..c96576e6f5f --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sc8280xp-fix-ufs-phy-clocks.patch @@ -0,0 +1,63 @@ +From ded687f305f7c8f497b2f71fd79cc0644d622ffc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:37 +0530 +Subject: arm64: dts: qcom: sc8280xp: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 1d4ef9644e219202ed89ac42f3e1defebcab9c7d ] + +QMP PHY used in SC8280XP requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform") +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-14-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +index febf28356ff8b..bb0786ab2864d 100644 +--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi ++++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +@@ -2257,9 +2257,12 @@ ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sc8280xp-qmp-ufs-phy"; + reg = <0 0x01d87000 0 0x1000>; + +- clocks = <&gcc GCC_UFS_CARD_CLKREF_CLK>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; +- clock-names = "ref", "ref_aux"; ++ clocks = <&rpmhcc RPMH_CXO_CLK>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_CARD_CLKREF_CLK>; ++ clock-names = "ref", ++ "ref_aux", ++ "qref"; + + power-domains = <&gcc UFS_PHY_GDSC>; + +@@ -2319,9 +2322,12 @@ ufs_card_phy: phy@1da7000 { + compatible = "qcom,sc8280xp-qmp-ufs-phy"; + reg = <0 0x01da7000 0 0x1000>; + +- clocks = <&gcc GCC_UFS_1_CARD_CLKREF_CLK>, +- <&gcc GCC_UFS_CARD_PHY_AUX_CLK>; +- clock-names = "ref", "ref_aux"; ++ clocks = <&rpmhcc RPMH_CXO_CLK>, ++ <&gcc GCC_UFS_CARD_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_1_CARD_CLKREF_CLK>; ++ clock-names = "ref", ++ "ref_aux", ++ "qref"; + + power-domains = <&gcc UFS_CARD_GDSC>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sdm845-db845c-correct-pcie-wake-gpios.patch b/queue-6.8/arm64-dts-qcom-sdm845-db845c-correct-pcie-wake-gpios.patch new file mode 100644 index 00000000000..70e6db2b5ed --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sdm845-db845c-correct-pcie-wake-gpios.patch @@ -0,0 +1,40 @@ +From 89fccee38a5552419b44431bb6456a37834ece4b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 14:12:15 +0100 +Subject: arm64: dts: qcom: sdm845-db845c: correct PCIe wake-gpios + +From: Krzysztof Kozlowski + +[ Upstream commit 584a327c5cffc36369b2a8953d9448826240f1ac ] + +Bindings allow a "wake", not "enable", GPIO. Schematics also use WAKE +name for the pin: + + sdm845-db845c.dtb: pcie@1c00000: Unevaluated properties are not allowed ('enable-gpio' was unexpected) + +Fixes: 4a657c264b78 ("arm64: dts: qcom: db845c: Enable PCIe controllers") +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240108131216.53867-1-krzysztof.kozlowski@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts +index ab6220456513c..1f517328199b9 100644 +--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts ++++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts +@@ -580,7 +580,7 @@ &mss_pil { + &pcie0 { + status = "okay"; + perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>; +- enable-gpio = <&tlmm 134 GPIO_ACTIVE_HIGH>; ++ wake-gpios = <&tlmm 134 GPIO_ACTIVE_HIGH>; + + vddpe-3v3-supply = <&pcie0_3p3v_dual>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sdm845-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sdm845-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..1df41dc6d25 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sdm845-fix-ufs-phy-clocks.patch @@ -0,0 +1,51 @@ +From aee7a0f6fc799a34d1bb8d2795c35ed907ba84b6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:30 +0530 +Subject: arm64: dts: qcom: sdm845: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit ca8fb2bd2248ae05890c011d691ba5d4a1e7d8d6 ] + +QMP PHY used in SDM845 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +While at it, let's move 'clocks' property before 'clock-names' to match +the style used commonly. + +Fixes: cc16687fbd74 ("arm64: dts: qcom: sdm845: add UFS controller") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-7-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi +index c2244824355a2..5ee98ff84d171 100644 +--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi ++++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi +@@ -2639,10 +2639,12 @@ ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sdm845-qmp-ufs-phy"; + reg = <0 0x01d87000 0 0x1000>; + ++ clocks = <&rpmhcc RPMH_CXO_CLK>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_MEM_CLKREF_CLK>; + clock-names = "ref", +- "ref_aux"; +- clocks = <&gcc GCC_UFS_MEM_CLKREF_CLK>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; ++ "ref_aux", ++ "qref"; + + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sdm845-oneplus-common-improve-dai-nod.patch b/queue-6.8/arm64-dts-qcom-sdm845-oneplus-common-improve-dai-nod.patch new file mode 100644 index 00000000000..5ce9eedf65a --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sdm845-oneplus-common-improve-dai-nod.patch @@ -0,0 +1,54 @@ +From 17c6954515b4ddb41fd1a11795c4bad85b91705e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 29 Dec 2023 21:02:33 +0100 +Subject: arm64: dts: qcom: sdm845-oneplus-common: improve DAI node naming + +From: David Heidelberg + +[ Upstream commit afe9867a0c0e10ba618c15d4ef6f8699872f6cc3 ] + +Make it easier to understand what the reg in those nodes is by using the +constants provided by qcom,q6dsp-lpass-ports.h. + +Name nodes according to dt-binding expectations. + +Fix for +``` +arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: service@4: dais: Unevaluated properties are not allowed ('qi2s@22', 'qi2s@23' were unexpected) +``` + +Fixes: b7b734286856 ("arm64: dts: qcom: sdm845-oneplus-*: add audio devices") +Signed-off-by: David Heidelberg +Reviewed-by: Luca Weiss +Link: https://lore.kernel.org/r/20231229200245.259689-1-david@ixit.cz +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +index e821103d49c0a..46e25c53829ad 100644 +--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi ++++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +@@ -508,13 +508,13 @@ led-1 { + }; + + &q6afedai { +- qi2s@22 { +- reg = <22>; ++ dai@22 { ++ reg = ; + qcom,sd-lines = <1>; + }; + +- qi2s@23 { +- reg = <23>; ++ dai@23 { ++ reg = ; + qcom,sd-lines = <0>; + }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sdm845-use-the-low-power-island-cx-mx.patch b/queue-6.8/arm64-dts-qcom-sdm845-use-the-low-power-island-cx-mx.patch new file mode 100644 index 00000000000..68df97e3593 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sdm845-use-the-low-power-island-cx-mx.patch @@ -0,0 +1,39 @@ +From ac17e35dd8f0bca2a41b372469fcec1440907114 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Dec 2023 15:15:11 +0100 +Subject: arm64: dts: qcom: sdm845: Use the Low Power Island CX/MX for SLPI + +From: Konrad Dybcio + +[ Upstream commit 5dd227ccfb9568935bdaf82bc1893b36457dd4d3 ] + +The SLPI is powered by the Low Power Island power rails. Fix the incorrect +assignment. + +Fixes: 74588aada59a ("arm64: dts: qcom: sdm845: add SLPI remoteproc") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20231220-topic-sdm845_slpi_lcxmx-v1-1-db7c72ef99ae@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi +index 5ee98ff84d171..29349d715b2cc 100644 +--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi ++++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi +@@ -3368,8 +3368,8 @@ slpi_pas: remoteproc@5c00000 { + + qcom,qmp = <&aoss_qmp>; + +- power-domains = <&rpmhpd SDM845_CX>, +- <&rpmhpd SDM845_MX>; ++ power-domains = <&rpmhpd SDM845_LCX>, ++ <&rpmhpd SDM845_LMX>; + power-domain-names = "lcx", "lmx"; + + memory-region = <&slpi_mem>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm6115-declare-vls-clamp-register-for.patch b/queue-6.8/arm64-dts-qcom-sm6115-declare-vls-clamp-register-for.patch new file mode 100644 index 00000000000..21cd24f128c --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm6115-declare-vls-clamp-register-for.patch @@ -0,0 +1,51 @@ +From e3f64ad92f848b840a43dd8362c300a3d121d0c5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jan 2024 16:04:27 +0200 +Subject: arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY + +From: Dmitry Baryshkov + +[ Upstream commit 95d739ed962c9aaa17d77b739606dbdf31879f6e ] + +The USB3 PHY on the SM6115 platform doesn't have built-in +PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately +via the register in the TCSR space. Declare corresponding register. + +Fixes: 9dd5f6dba729 ("arm64: dts: qcom: sm6115: Add USB SS qmp phy node") +Signed-off-by: Dmitry Baryshkov +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240117-usbc-phy-vls-clamp-v2-6-a950c223f10f@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm6115.dtsi | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi +index f9849b8befbf2..b627c473ffa54 100644 +--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi +@@ -614,6 +614,11 @@ tcsr_mutex: hwlock@340000 { + #hwlock-cells = <1>; + }; + ++ tcsr_regs: syscon@3c0000 { ++ compatible = "qcom,sm6115-tcsr", "syscon"; ++ reg = <0x0 0x003c0000 0x0 0x40000>; ++ }; ++ + tlmm: pinctrl@500000 { + compatible = "qcom,sm6115-tlmm"; + reg = <0x0 0x00500000 0x0 0x400000>, +@@ -879,6 +884,8 @@ usb_qmpphy: phy@1615000 { + + #phy-cells = <0>; + ++ qcom,tcsr-reg = <&tcsr_regs 0xb244>; ++ + status = "disabled"; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm6115-drop-pipe-clock-selection.patch b/queue-6.8/arm64-dts-qcom-sm6115-drop-pipe-clock-selection.patch new file mode 100644 index 00000000000..b390ab45229 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm6115-drop-pipe-clock-selection.patch @@ -0,0 +1,57 @@ +From 6bfbc3b5a87ae3180325cab39b210be6be52a8d2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jan 2024 21:32:58 +0200 +Subject: arm64: dts: qcom: sm6115: drop pipe clock selection + +From: Vladimir Zapolskiy + +[ Upstream commit 7e3a1f6470f7243c81156d2ead60f87da1184225 ] + +Stop selecting UTMI clock as the USB3 PIPE clock. This setting is +incompatible with the USB host working in USB3 (SuperSpeed) mode. +While we are at it, also drop the default setting for the port speed. + +Fixes: 9dd5f6dba729 ("arm64: dts: qcom: sm6115: Add USB SS qmp phy node") +Signed-off-by: Vladimir Zapolskiy +[DB: fixed commit message, dropped dr_mode setting] +Reviewed-by: Konrad Dybcio +Tested-by: Luca Weiss # sdm632-fairphone-fp3 +Signed-off-by: Dmitry Baryshkov +Link: https://lore.kernel.org/r/20240130-pmi632-typec-v3-5-b05fe44f0a51@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 4 ---- + arch/arm64/boot/dts/qcom/sm6115.dtsi | 1 - + 2 files changed, 5 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts +index 7c19f874fa716..52f31f3166c2f 100644 +--- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts ++++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts +@@ -607,10 +607,6 @@ &usb { + status = "okay"; + }; + +-&usb_dwc3 { +- maximum-speed = "super-speed"; +-}; +- + &usb_hsphy { + vdd-supply = <&vreg_l4a_0p9>; + vdda-pll-supply = <&vreg_l12a_1p8>; +diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi +index 4808982659eda..27b4a7836e247 100644 +--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi +@@ -1614,7 +1614,6 @@ &bimc SLAVE_EBI_CH0 RPM_ALWAYS_TAG>, + interconnect-names = "usb-ddr", + "apps-usb"; + +- qcom,select-utmi-as-pipe-clk; + status = "disabled"; + + usb_dwc3: usb@4e00000 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm6115-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm6115-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..ac1df7ac172 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm6115-fix-ufs-phy-clocks.patch @@ -0,0 +1,47 @@ +From 9b3676bb66eaf5cf80bea43080add0b435aceb65 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:31 +0530 +Subject: arm64: dts: qcom: sm6115: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit a820a285ef1b7c7fd94055bbb114c0413c04b96b ] + +QMP PHY used in SM6115 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPM +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +Fixes: 97e563bf5ba1 ("arm64: dts: qcom: sm6115: Add basic soc dtsi") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-8-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm6115.dtsi | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi +index b627c473ffa54..4808982659eda 100644 +--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi +@@ -1201,8 +1201,12 @@ ufs_mem_phy: phy@4807000 { + compatible = "qcom,sm6115-qmp-ufs-phy"; + reg = <0x0 0x04807000 0x0 0x1000>; + +- clocks = <&gcc GCC_UFS_CLKREF_CLK>, <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; +- clock-names = "ref", "ref_aux"; ++ clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_CLKREF_CLK>; ++ clock-names = "ref", ++ "ref_aux", ++ "qref"; + + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm6125-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm6125-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..c236ad23672 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm6125-fix-ufs-phy-clocks.patch @@ -0,0 +1,48 @@ +From 4a649dc5fa5c78a69eb53b0de015c49e647ab62e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:32 +0530 +Subject: arm64: dts: qcom: sm6125: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 3823a877f25baa152e34325818d5140990d6464f ] + +QMP PHY used in SM6125 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPM +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +Fixes: f8399e8a2f80 ("arm64: dts: qcom: sm6125: Add UFS nodes") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-9-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm6125.dtsi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi +index 1dd3a4056e26f..e180f7c6e8c93 100644 +--- a/arch/arm64/boot/dts/qcom/sm6125.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi +@@ -812,10 +812,12 @@ ufs_mem_phy: phy@4807000 { + compatible = "qcom,sm6125-qmp-ufs-phy"; + reg = <0x04807000 0xdb8>; + +- clocks = <&gcc GCC_UFS_MEM_CLKREF_CLK>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; ++ clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_MEM_CLKREF_CLK>; + clock-names = "ref", +- "ref_aux"; ++ "ref_aux", ++ "qref"; + + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm6350-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm6350-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..4e70feff822 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm6350-fix-ufs-phy-clocks.patch @@ -0,0 +1,51 @@ +From 54908b940a4311f6e92adb053334998de5ec691d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:33 +0530 +Subject: arm64: dts: qcom: sm6350: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 68f9fcba3a0c015d649907805534fe66c9c60865 ] + +QMP PHY used in SM6350 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +While at it, let's move 'clocks' property before 'clock-names' to match +the style used commonly. + +Fixes: 5a814af5fc22 ("arm64: dts: qcom: sm6350: Add UFS nodes") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-10-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm6350.dtsi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi +index 43cffe8e1247e..7a2df6bcef7ec 100644 +--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi +@@ -1189,10 +1189,12 @@ ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sm6350-qmp-ufs-phy"; + reg = <0 0x01d87000 0 0x1000>; + ++ clocks = <&rpmhcc RPMH_CXO_CLK>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_MEM_CLKREF_CLK>; + clock-names = "ref", +- "ref_aux"; +- clocks = <&gcc GCC_UFS_MEM_CLKREF_CLK>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; ++ "ref_aux", ++ "qref"; + + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8150-correct-pcie-wake-gpios.patch b/queue-6.8/arm64-dts-qcom-sm8150-correct-pcie-wake-gpios.patch new file mode 100644 index 00000000000..3764285e2ac --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8150-correct-pcie-wake-gpios.patch @@ -0,0 +1,40 @@ +From f58e2ea982e19d5ea34f65a25e2247cae1e93140 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 14:12:16 +0100 +Subject: arm64: dts: qcom: sm8150: correct PCIe wake-gpios + +From: Krzysztof Kozlowski + +[ Upstream commit 7c38989d0f7a35c83e7c4781271d42662903fa8d ] + +Bindings allow a "wake", not "enable", GPIO. Schematics also use WAKE +name for the pin: + + sa8155p-adp.dtb: pcie@1c00000: Unevaluated properties are not allowed ('enable-gpio' was unexpected) + +Fixes: a1c86c680533 ("arm64: dts: qcom: sm8150: Add PCIe nodes") +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240108131216.53867-2-krzysztof.kozlowski@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi +index d44b799b1c511..d7849a2eb5eb2 100644 +--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi +@@ -1879,7 +1879,7 @@ pcie0: pcie@1c00000 { + phy-names = "pciephy"; + + perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; +- enable-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; ++ wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_default_state>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8150-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm8150-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..3766c44af21 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8150-fix-ufs-phy-clocks.patch @@ -0,0 +1,51 @@ +From a681cf6c94a6c717a36f1367a6e1d39374156496 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:34 +0530 +Subject: arm64: dts: qcom: sm8150: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit eff7496b72810ca54da8c9c4542bf2aca479dd44 ] + +QMP PHY used in SM8150 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +While at it, let's move 'clocks' property before 'clock-names' to match +the style used commonly. + +Fixes: 3834a2e92229 ("arm64: dts: qcom: sm8150: Add ufs nodes") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-11-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8150.dtsi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi +index 761a6757dc26f..d44b799b1c511 100644 +--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi +@@ -2063,10 +2063,12 @@ ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sm8150-qmp-ufs-phy"; + reg = <0 0x01d87000 0 0x1000>; + ++ clocks = <&rpmhcc RPMH_CXO_CLK>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_MEM_CLKREF_CLK>; + clock-names = "ref", +- "ref_aux"; +- clocks = <&gcc GCC_UFS_MEM_CLKREF_CLK>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; ++ "ref_aux", ++ "qref"; + + power-domains = <&gcc UFS_PHY_GDSC>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8250-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm8250-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..7b3ab710929 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8250-fix-ufs-phy-clocks.patch @@ -0,0 +1,51 @@ +From 5a15a5c0b16dfecd9d6026379146826e57cfd100 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:35 +0530 +Subject: arm64: dts: qcom: sm8250: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 55ee02b10bdd9577b6eabe98ebb383ec4e0674a7 ] + +QMP PHY used in SM8250 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +While at it, let's move 'clocks' property before 'clock-names' to match +the style used commonly. + +Fixes: b7e2fba06622 ("arm64: dts: qcom: sm8250: Add UFS controller and PHY") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-12-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8250.dtsi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi +index 760501c1301a6..5e4265b2d80bd 100644 +--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi +@@ -2506,10 +2506,12 @@ ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sm8250-qmp-ufs-phy"; + reg = <0 0x01d87000 0 0x1000>; + +- clock-names = "ref", +- "ref_aux"; + clocks = <&rpmhcc RPMH_CXO_CLK>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_1X_CLKREF_EN>; ++ clock-names = "ref", ++ "ref_aux", ++ "qref"; + + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8350-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm8350-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..bc4c2f0a0c8 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8350-fix-ufs-phy-clocks.patch @@ -0,0 +1,51 @@ +From 5e53494e4e751873918d75dfa190fb348fee0d3d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:38 +0530 +Subject: arm64: dts: qcom: sm8350: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 8edbdefee1c9eb24690d5794556af08f00ecc576 ] + +QMP PHY used in SM8350 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from GCC + +While at it, let's move 'clocks' property before 'clock-names' to match +the style used commonly. + +Fixes: 59c7cf814783 ("arm64: dts: qcom: sm8350: Add UFS nodes") +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-15-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8350.dtsi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi +index e78c83a897c28..ab233d6843931 100644 +--- a/arch/arm64/boot/dts/qcom/sm8350.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi +@@ -1726,10 +1726,12 @@ ufs_mem_phy: phy@1d87000 { + compatible = "qcom,sm8350-qmp-ufs-phy"; + reg = <0 0x01d87000 0 0x1000>; + +- clock-names = "ref", +- "ref_aux"; + clocks = <&rpmhcc RPMH_CXO_CLK>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&gcc GCC_UFS_1_CLKREF_EN>; ++ clock-names = "ref", ++ "ref_aux", ++ "qref"; + + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8450-add-missing-interconnects-to-s.patch b/queue-6.8/arm64-dts-qcom-sm8450-add-missing-interconnects-to-s.patch new file mode 100644 index 00000000000..ead30137cd3 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8450-add-missing-interconnects-to-s.patch @@ -0,0 +1,59 @@ +From 7bd278a77418cd8fbe028c3d237eb8c8a1333220 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Jan 2024 13:25:44 +0100 +Subject: arm64: dts: qcom: sm8450: Add missing interconnects to serial + +From: Konrad Dybcio + +[ Upstream commit 6e115b75b43bd12d4061e53c8ff175e387783d8a ] + +The serial ports did not have their interconnect paths specified when +they were first introduced. Fix that. + +Fixes: 5188049c9b36 ("arm64: dts: qcom: Add base SM8450 DTSI") +Fixes: f5837418479a ("arm64: dts: qcom: sm8450: add uart20 node") +Reported-by: Krzysztof Kozlowski +Suggested-by: Georgi Djakov +Signed-off-by: Konrad Dybcio +Reviewed-by: Krzysztof Kozlowski +Tested-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20240116-topic-8450serial-v1-1-b685e6a5ad78@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi +index 01e4dfc4babd2..06f183ef8c78f 100644 +--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi +@@ -1028,6 +1028,12 @@ uart20: serial@894000 { + pinctrl-names = "default"; + pinctrl-0 = <&qup_uart20_default>; + interrupts = ; ++ interconnects = <&clk_virt MASTER_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS ++ &clk_virt SLAVE_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS>, ++ <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS ++ &config_noc SLAVE_QUP_2 QCOM_ICC_TAG_ALWAYS>; ++ interconnect-names = "qup-core", ++ "qup-config"; + status = "disabled"; + }; + +@@ -1420,6 +1426,12 @@ uart7: serial@99c000 { + pinctrl-names = "default"; + pinctrl-0 = <&qup_uart7_tx>, <&qup_uart7_rx>; + interrupts = ; ++ interconnects = <&clk_virt MASTER_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS ++ &clk_virt SLAVE_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS>, ++ <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS ++ &config_noc SLAVE_QUP_2 QCOM_ICC_TAG_ALWAYS>; ++ interconnect-names = "qup-core", ++ "qup-config"; + status = "disabled"; + }; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8550-fix-spmi-channels-size.patch b/queue-6.8/arm64-dts-qcom-sm8550-fix-spmi-channels-size.patch new file mode 100644 index 00000000000..5abb0728917 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8550-fix-spmi-channels-size.patch @@ -0,0 +1,44 @@ +From 289d47dbd1f747a9814b237b1affc3192426d38e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Feb 2024 15:04:25 +0200 +Subject: arm64: dts: qcom: sm8550: Fix SPMI channels size + +From: Abel Vesa + +[ Upstream commit 77dd1e50ffcba33c3195ae4fc78f354368ddacb2 ] + +The actual size of the channels registers region is 4MB, according to the +documentation. This issue was not caught until now because the driver was +supposed to allow same regions being mapped multiple times for supporting +multiple buses. Thie driver is using platform_get_resource_byname() and +devm_ioremap() towards that purpose, which intentionally avoids +devm_request_mem_region() altogether. + +Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi") +Reviewed-by: Neil Armstrong +Signed-off-by: Abel Vesa +Reviewed-by: Konrad Dybcio +Tested-by: Neil Armstrong # on SM8550-QRD +Link: https://lore.kernel.org/r/20240221-dts-qcom-sm8550-fix-spmi-chnls-size-v2-1-72b5efd9dc4f@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi +index 72b1b8caafaa7..d3170b86ba1e8 100644 +--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi +@@ -3251,7 +3251,7 @@ sram@c3f0000 { + spmi_bus: spmi@c400000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0 0x0c400000 0 0x3000>, +- <0 0x0c500000 0 0x4000000>, ++ <0 0x0c500000 0 0x400000>, + <0 0x0c440000 0 0x80000>, + <0 0x0c4c0000 0 0x20000>, + <0 0x0c42d000 0 0x4000>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8550-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm8550-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..17bc197fc5a --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8550-fix-ufs-phy-clocks.patch @@ -0,0 +1,49 @@ +From d35f8901acab8f3774c9d34f7c81d01e38b8ae16 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:39 +0530 +Subject: arm64: dts: qcom: sm8550: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 746ae23ad02004fe283e2edb45b7a060bbc36d46 ] + +QMP PHY used in SM8550 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from TCSR + +Fixes: 35cf1aaab169 ("arm64: dts: qcom: sm8550: Add UFS host controller and phy nodes") +Reviewed-by: Can Guo +Reviewed-by: Konrad Dybcio +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-16-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8550.dtsi | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi +index ee1ba5a8c8fc2..72b1b8caafaa7 100644 +--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi +@@ -1907,9 +1907,12 @@ crypto: crypto@1dfa000 { + ufs_mem_phy: phy@1d80000 { + compatible = "qcom,sm8550-qmp-ufs-phy"; + reg = <0x0 0x01d80000 0x0 0x2000>; +- clocks = <&tcsr TCSR_UFS_CLKREF_EN>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; +- clock-names = "ref", "ref_aux"; ++ clocks = <&rpmhcc RPMH_CXO_CLK>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&tcsr TCSR_UFS_CLKREF_EN>; ++ clock-names = "ref", ++ "ref_aux", ++ "qref"; + + power-domains = <&gcc UFS_MEM_PHY_GDSC>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8650-fix-spmi-channels-size.patch b/queue-6.8/arm64-dts-qcom-sm8650-fix-spmi-channels-size.patch new file mode 100644 index 00000000000..e0247aa5614 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8650-fix-spmi-channels-size.patch @@ -0,0 +1,44 @@ +From 6384a900a28056f5531b681ccb965711e212e2f5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Feb 2024 15:04:26 +0200 +Subject: arm64: dts: qcom: sm8650: Fix SPMI channels size + +From: Abel Vesa + +[ Upstream commit a4f82b8045e3c7913266aa6ea1ee15752a062abd ] + +The actual size of the channels registers region is 4MB, according to the +documentation. This issue was not caught until now because the driver was +supposed to allow same regions being mapped multiple times for supporting +multiple buses. Thie driver is using platform_get_resource_byname() and +devm_ioremap() towards that purpose, which intentionally avoids +devm_request_mem_region() altogether. + +Fixes: 10e024671295 ("arm64: dts: qcom: sm8650: add interconnect dependent device nodes") +Reviewed-by: Neil Armstrong +Signed-off-by: Abel Vesa +Reviewed-by: Konrad Dybcio +Tested-by: Neil Armstrong # on SM8650-QRD +Link: https://lore.kernel.org/r/20240221-dts-qcom-sm8550-fix-spmi-chnls-size-v2-2-72b5efd9dc4f@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8650.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi +index bad0eb84549fe..0e4bd83b2c68a 100644 +--- a/arch/arm64/boot/dts/qcom/sm8650.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi +@@ -3705,7 +3705,7 @@ sram@c3f0000 { + spmi_bus: spmi@c400000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0 0x0c400000 0 0x3000>, +- <0 0x0c500000 0 0x4000000>, ++ <0 0x0c500000 0 0x400000>, + <0 0x0c440000 0 0x80000>, + <0 0x0c4c0000 0 0x20000>, + <0 0x0c42d000 0 0x4000>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-sm8650-fix-ufs-phy-clocks.patch b/queue-6.8/arm64-dts-qcom-sm8650-fix-ufs-phy-clocks.patch new file mode 100644 index 00000000000..afbd49d86c0 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-sm8650-fix-ufs-phy-clocks.patch @@ -0,0 +1,48 @@ +From 2893a7c558facbaa91a9463c848cb6749fd23e64 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:37:40 +0530 +Subject: arm64: dts: qcom: sm8650: Fix UFS PHY clocks + +From: Manivannan Sadhasivam + +[ Upstream commit 0f9b8054bb4abd7b4686cc66b85f71fec9160136 ] + +QMP PHY used in SM8650 requires 3 clocks: + +* ref - 19.2MHz reference clock from RPMh +* ref_aux - Auxiliary reference clock from GCC +* qref - QREF clock from TCSR + +Fixes: 10e024671295 ("arm64: dts: qcom: sm8650: add interconnect dependent device nodes") +Signed-off-by: Manivannan Sadhasivam +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240131-ufs-phy-clock-v3-17-58a49d2f4605@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/sm8650.dtsi | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi +index 2df77123a8c7b..bad0eb84549fe 100644 +--- a/arch/arm64/boot/dts/qcom/sm8650.dtsi ++++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi +@@ -2448,10 +2448,12 @@ ufs_mem_phy: phy@1d80000 { + compatible = "qcom,sm8650-qmp-ufs-phy"; + reg = <0 0x01d80000 0 0x2000>; + +- clocks = <&tcsr TCSR_UFS_CLKREF_EN>, +- <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; ++ clocks = <&rpmhcc RPMH_CXO_CLK>, ++ <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, ++ <&tcsr TCSR_UFS_CLKREF_EN>; + clock-names = "ref", +- "ref_aux"; ++ "ref_aux", ++ "qref"; + + resets = <&ufs_mem_hc 0>; + reset-names = "ufsphy"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-x1e80100-drop-qcom-drv-count.patch b/queue-6.8/arm64-dts-qcom-x1e80100-drop-qcom-drv-count.patch new file mode 100644 index 00000000000..8e96be28071 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-x1e80100-drop-qcom-drv-count.patch @@ -0,0 +1,37 @@ +From 39f2c26deaeb8bc6202625dc4c4075714ea7a0da Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 18 Dec 2023 15:50:50 +0100 +Subject: arm64: dts: qcom: x1e80100: drop qcom,drv-count + +From: Krzysztof Kozlowski + +[ Upstream commit e81e86765f957f3c5d48df9e275c527bd8c14156 ] + +Property qcom,drv-count in the RSC node is not allowed and not used: + + x1e80100-crd.dtb: rsc@17500000: 'qcom,drv-count' does not match any of the regexes: '^regulators(-[0-9])?$', 'pinctrl-[0-9]+' + +Fixes: af16b00578a7 ("arm64: dts: qcom: Add base X1E80100 dtsi and the QCP dts") +Signed-off-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20231218145050.66394-1-krzysztof.kozlowski@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/x1e80100.dtsi | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/qcom/x1e80100.dtsi b/arch/arm64/boot/dts/qcom/x1e80100.dtsi +index 6f75fc342ceb3..be1285d9919e0 100644 +--- a/arch/arm64/boot/dts/qcom/x1e80100.dtsi ++++ b/arch/arm64/boot/dts/qcom/x1e80100.dtsi +@@ -3315,7 +3315,6 @@ apps_rsc: rsc@17500000 { + <0 0x17510000 0 0x10000>, + <0 0x17520000 0 0x10000>; + reg-names = "drv-0", "drv-1", "drv-2"; +- qcom,drv-count = <3>; + + interrupts = , + , +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-qcom-x1e80100-qcp-fix-supplies-for-ldos-3e.patch b/queue-6.8/arm64-dts-qcom-x1e80100-qcp-fix-supplies-for-ldos-3e.patch new file mode 100644 index 00000000000..a01b3ecd347 --- /dev/null +++ b/queue-6.8/arm64-dts-qcom-x1e80100-qcp-fix-supplies-for-ldos-3e.patch @@ -0,0 +1,46 @@ +From a63f8e2677eab481c08f510876b1763acc9071dc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Jan 2024 14:45:43 +0200 +Subject: arm64: dts: qcom: x1e80100-qcp: Fix supplies for LDOs 3E and 2J + +From: Abel Vesa + +[ Upstream commit 7eac281cbedbd71d777eabca3a52d97983c61692 ] + +The LDOs 3E and 2J are actually supplied by SMPS 5J. Fix accordingly. + +Fixes: af16b00578a7 ("arm64: dts: qcom: Add base X1E80100 dtsi and the QCP dts") +Acked-by: Konrad Dybcio +Signed-off-by: Abel Vesa +Link: https://lore.kernel.org/r/20240129-x1e80100-dts-missing-nodes-v6-11-2c0e691cfa3b@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts +index a37ad9475c90d..3112487d2a168 100644 +--- a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts ++++ b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts +@@ -243,7 +243,7 @@ regulators-3 { + qcom,pmic-id = "e"; + + vdd-l2-supply = <&vreg_s1f_0p7>; +- vdd-l3-supply = <&vph_pwr>; ++ vdd-l3-supply = <&vreg_s5j_1p2>; + + vreg_l2e_0p8: ldo2 { + regulator-name = "vreg_l2e_0p8"; +@@ -349,7 +349,7 @@ regulators-7 { + qcom,pmic-id = "j"; + + vdd-l1-supply = <&vreg_s1f_0p7>; +- vdd-l2-supply = <&vph_pwr>; ++ vdd-l2-supply = <&vreg_s5j_1p2>; + vdd-l3-supply = <&vreg_s1f_0p7>; + vdd-s5-supply = <&vph_pwr>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-renesas-r8a779a0-correct-avb-01-reg-sizes.patch b/queue-6.8/arm64-dts-renesas-r8a779a0-correct-avb-01-reg-sizes.patch new file mode 100644 index 00000000000..41ca93dae25 --- /dev/null +++ b/queue-6.8/arm64-dts-renesas-r8a779a0-correct-avb-01-reg-sizes.patch @@ -0,0 +1,48 @@ +From 6b33a2cc113d9e39e2d6840d05caf65bd05845a7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Feb 2024 15:21:30 +0100 +Subject: arm64: dts: renesas: r8a779a0: Correct avb[01] reg sizes + +From: Geert Uytterhoeven + +[ Upstream commit 0c51912331f8ba5ce5fb52f46e340945160672a3 ] + +All Ethernet AVB instances on R-Car V3U have registers related to UDP/IP +support, but the declared register blocks for the first two instances +are too small to cover them. + +Fix this by extending the register block sizes. + +Fixes: 5a633320f08b8c9b ("arm64: dts: renesas: r8a779a0: Add Ethernet-AVB support") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/ce6ce3c4b1495e02e7c1803fca810a7178a84500.1707660323.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi +index 4e67a03564971..504ac8c93faf5 100644 +--- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi ++++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi +@@ -658,7 +658,7 @@ channel7 { + avb0: ethernet@e6800000 { + compatible = "renesas,etheravb-r8a779a0", + "renesas,etheravb-rcar-gen4"; +- reg = <0 0xe6800000 0 0x800>; ++ reg = <0 0xe6800000 0 0x1000>; + interrupts = , + , + , +@@ -706,7 +706,7 @@ avb0: ethernet@e6800000 { + avb1: ethernet@e6810000 { + compatible = "renesas,etheravb-r8a779a0", + "renesas,etheravb-rcar-gen4"; +- reg = <0 0xe6810000 0 0x800>; ++ reg = <0 0xe6810000 0 0x1000>; + interrupts = , + , + , +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-renesas-r8a779g0-add-missing-scif_clk2.patch b/queue-6.8/arm64-dts-renesas-r8a779g0-add-missing-scif_clk2.patch new file mode 100644 index 00000000000..ef3bcb4a41c --- /dev/null +++ b/queue-6.8/arm64-dts-renesas-r8a779g0-add-missing-scif_clk2.patch @@ -0,0 +1,67 @@ +From a29837c8fc31f71be74c37ef576ad8478ee9cda2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Jan 2024 17:32:37 +0100 +Subject: arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2 + +From: Geert Uytterhoeven + +[ Upstream commit 08e799f6bce80dd63c174d8d0fc61d1a6149960b ] + +R-Car V4H actually has two SCIF_CLK pins. +The second pin provides the SCIF_CLK signal for HSCIF2 and SCIF4. + +Fixes: a4c31c56d2d35641 ("arm64: dts: renesas: r8a779g0: Add SCIF nodes") +Fixes: 39d9dfc6fbe1860e ("arm64: dts: renesas: r8a779g0: Add remaining HSCIF nodes") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/72f20c1bf32187bd30a963cafe27252907d661f9.1705589612.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +index 3be1159982b20..0c83940b3d8a1 100644 +--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi ++++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +@@ -185,13 +185,19 @@ psci { + method = "smc"; + }; + +- /* External SCIF clock - to be overridden by boards that provide it */ ++ /* External SCIF clocks - to be overridden by boards that provide them */ + scif_clk: scif { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <0>; + }; + ++ scif_clk2: scif2 { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <0>; ++ }; ++ + soc: soc { + compatible = "simple-bus"; + interrupt-parent = <&gic>; +@@ -681,7 +687,7 @@ hscif2: serial@e6560000 { + interrupts = ; + clocks = <&cpg CPG_MOD 516>, + <&cpg CPG_CORE R8A779G0_CLK_SASYNCPERD1>, +- <&scif_clk>; ++ <&scif_clk2>; + clock-names = "fck", "brg_int", "scif_clk"; + dmas = <&dmac0 0x35>, <&dmac0 0x34>, + <&dmac1 0x35>, <&dmac1 0x34>; +@@ -1057,7 +1063,7 @@ scif4: serial@e6c40000 { + interrupts = ; + clocks = <&cpg CPG_MOD 705>, + <&cpg CPG_CORE R8A779G0_CLK_SASYNCPERD1>, +- <&scif_clk>; ++ <&scif_clk2>; + clock-names = "fck", "brg_int", "scif_clk"; + dmas = <&dmac0 0x59>, <&dmac0 0x58>, + <&dmac1 0x59>, <&dmac1 0x58>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-renesas-r8a779g0-correct-avb-01-reg-sizes.patch b/queue-6.8/arm64-dts-renesas-r8a779g0-correct-avb-01-reg-sizes.patch new file mode 100644 index 00000000000..f42d1d45cfd --- /dev/null +++ b/queue-6.8/arm64-dts-renesas-r8a779g0-correct-avb-01-reg-sizes.patch @@ -0,0 +1,48 @@ +From 0b6ba561348b296e36ddcae13635a57850907390 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Feb 2024 15:21:31 +0100 +Subject: arm64: dts: renesas: r8a779g0: Correct avb[01] reg sizes + +From: Geert Uytterhoeven + +[ Upstream commit 7edbb5880dc3317a5eaec2166de71ff394598e6b ] + +All Ethernet AVB instances on R-Car V4H have registers related to UDP/IP +support, but the declared register blocks for the first two instances +are too small to cover them. + +Fix this by extending the register block sizes. + +Fixes: 848c82db56923a8b ("arm64: dts: renesas: r8a779g0: Add RAVB nodes") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/83437778614a7c96f4d8f1be98dffeee29bb4a0b.1707660323.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +index 0c83940b3d8a1..d7677595204dc 100644 +--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi ++++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +@@ -767,7 +767,7 @@ channel7 { + avb0: ethernet@e6800000 { + compatible = "renesas,etheravb-r8a779g0", + "renesas,etheravb-rcar-gen4"; +- reg = <0 0xe6800000 0 0x800>; ++ reg = <0 0xe6800000 0 0x1000>; + interrupts = , + , + , +@@ -814,7 +814,7 @@ avb0: ethernet@e6800000 { + avb1: ethernet@e6810000 { + compatible = "renesas,etheravb-r8a779g0", + "renesas,etheravb-rcar-gen4"; +- reg = <0 0xe6810000 0 0x800>; ++ reg = <0 0xe6810000 0 0x1000>; + interrupts = , + , + , +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-renesas-r8a779g0-restore-sort-order.patch b/queue-6.8/arm64-dts-renesas-r8a779g0-restore-sort-order.patch new file mode 100644 index 00000000000..c7397b5239b --- /dev/null +++ b/queue-6.8/arm64-dts-renesas-r8a779g0-restore-sort-order.patch @@ -0,0 +1,126 @@ +From a3bc20eff0e18fc980399b9c21825fdfbbd06c7e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Jan 2024 14:33:18 +0100 +Subject: arm64: dts: renesas: r8a779g0: Restore sort order + +From: Geert Uytterhoeven + +[ Upstream commit 8b93657c976a61726d7ffbe8d019b84b4abfb673 ] + +Numerical by unit address, alphabetical by node name. + +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/f00ef274a73c8fd60f940a1649423a8927b9ae8a.1705324708.git.geert+renesas@glider.be +Stable-dep-of: 08e799f6bce8 ("arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2") +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 72 +++++++++++------------ + 1 file changed, 36 insertions(+), 36 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +index d3d25e077c5d5..3be1159982b20 100644 +--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi ++++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +@@ -161,11 +161,6 @@ L3_CA76_1: cache-controller-1 { + }; + }; + +- psci { +- compatible = "arm,psci-1.0", "arm,psci-0.2"; +- method = "smc"; +- }; +- + extal_clk: extal { + compatible = "fixed-clock"; + #clock-cells = <0>; +@@ -185,6 +180,11 @@ pmu_a76 { + interrupts-extended = <&gic GIC_PPI 7 IRQ_TYPE_LEVEL_LOW>; + }; + ++ psci { ++ compatible = "arm,psci-1.0", "arm,psci-0.2"; ++ method = "smc"; ++ }; ++ + /* External SCIF clock - to be overridden by boards that provide it */ + scif_clk: scif { + compatible = "fixed-clock"; +@@ -1777,6 +1777,37 @@ ssi0: ssi-0 { + }; + }; + ++ mmc0: mmc@ee140000 { ++ compatible = "renesas,sdhi-r8a779g0", ++ "renesas,rcar-gen4-sdhi"; ++ reg = <0 0xee140000 0 0x2000>; ++ interrupts = ; ++ clocks = <&cpg CPG_MOD 706>, ++ <&cpg CPG_CORE R8A779G0_CLK_SD0H>; ++ clock-names = "core", "clkh"; ++ power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; ++ resets = <&cpg 706>; ++ max-frequency = <200000000>; ++ iommus = <&ipmmu_ds0 32>; ++ status = "disabled"; ++ }; ++ ++ rpc: spi@ee200000 { ++ compatible = "renesas,r8a779g0-rpc-if", ++ "renesas,rcar-gen4-rpc-if"; ++ reg = <0 0xee200000 0 0x200>, ++ <0 0x08000000 0 0x04000000>, ++ <0 0xee208000 0 0x100>; ++ reg-names = "regs", "dirmap", "wbuf"; ++ interrupts = ; ++ clocks = <&cpg CPG_MOD 629>; ++ power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; ++ resets = <&cpg 629>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ }; ++ + ipmmu_rt0: iommu@ee480000 { + compatible = "renesas,ipmmu-r8a779g0", + "renesas,rcar-gen4-ipmmu-vmsa"; +@@ -1886,37 +1917,6 @@ ipmmu_mm: iommu@eefc0000 { + #iommu-cells = <1>; + }; + +- mmc0: mmc@ee140000 { +- compatible = "renesas,sdhi-r8a779g0", +- "renesas,rcar-gen4-sdhi"; +- reg = <0 0xee140000 0 0x2000>; +- interrupts = ; +- clocks = <&cpg CPG_MOD 706>, +- <&cpg CPG_CORE R8A779G0_CLK_SD0H>; +- clock-names = "core", "clkh"; +- power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; +- resets = <&cpg 706>; +- max-frequency = <200000000>; +- iommus = <&ipmmu_ds0 32>; +- status = "disabled"; +- }; +- +- rpc: spi@ee200000 { +- compatible = "renesas,r8a779g0-rpc-if", +- "renesas,rcar-gen4-rpc-if"; +- reg = <0 0xee200000 0 0x200>, +- <0 0x08000000 0 0x04000000>, +- <0 0xee208000 0 0x100>; +- reg-names = "regs", "dirmap", "wbuf"; +- interrupts = ; +- clocks = <&cpg CPG_MOD 629>; +- power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; +- resets = <&cpg 629>; +- #address-cells = <1>; +- #size-cells = <0>; +- status = "disabled"; +- }; +- + gic: interrupt-controller@f1000000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-renesas-r9a08g045-add-missing-interrupts-t.patch b/queue-6.8/arm64-dts-renesas-r9a08g045-add-missing-interrupts-t.patch new file mode 100644 index 00000000000..a9878466e3f --- /dev/null +++ b/queue-6.8/arm64-dts-renesas-r9a08g045-add-missing-interrupts-t.patch @@ -0,0 +1,52 @@ +From 957750256e449fa72120591cc34a37a06b48b17c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Feb 2024 14:44:21 +0000 +Subject: arm64: dts: renesas: r9a08g045: Add missing interrupts to IRQC node + +From: Lad Prabhakar + +[ Upstream commit bf7e37716d995c54630c30540db5642f58ea037a ] + +The IRQC block on the RZ/G3S (R9A08G045) SoC supports ECCRAM error +interrupts too. Add those missing interrupts to the IRQC node. + +Fixes: 837918aa3fdd ("arm64: dts: renesas: r9a08g045: Add IA55 interrupt controller node") +Signed-off-by: Lad Prabhakar +Reviewed-by: Claudiu Beznea +Reviewed-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/20240205144421.51195-4-prabhakar.mahadev-lad.rj@bp.renesas.com +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi +index 5facfad961583..6315ffa6c1bb9 100644 +--- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi ++++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi +@@ -152,7 +152,10 @@ irqc: interrupt-controller@11050000 { + , + , + , +- ; ++ , ++ , ++ , ++ ; + interrupt-names = "nmi", + "irq0", "irq1", "irq2", "irq3", + "irq4", "irq5", "irq6", "irq7", +@@ -164,7 +167,8 @@ irqc: interrupt-controller@11050000 { + "tint20", "tint21", "tint22", "tint23", + "tint24", "tint25", "tint26", "tint27", + "tint28", "tint29", "tint30", "tint31", +- "bus-err"; ++ "bus-err", "ec7tie1-0", "ec7tie2-0", ++ "ec7tiovf-0"; + clocks = <&cpg CPG_MOD R9A08G045_IA55_CLK>, + <&cpg CPG_MOD R9A08G045_IA55_PCLK>; + clock-names = "clk", "pclk"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-renesas-rzg2l-add-missing-interrupts-to-ir.patch b/queue-6.8/arm64-dts-renesas-rzg2l-add-missing-interrupts-to-ir.patch new file mode 100644 index 00000000000..a805292d730 --- /dev/null +++ b/queue-6.8/arm64-dts-renesas-rzg2l-add-missing-interrupts-to-ir.patch @@ -0,0 +1,131 @@ +From e26183dcd1244d4f3f0de587a47d7c448e3924c8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Feb 2024 14:44:20 +0000 +Subject: arm64: dts: renesas: rzg2l: Add missing interrupts to IRQC nodes + +From: Lad Prabhakar + +[ Upstream commit 14fe225dd5fcd5928583b0bcc34398a581f51602 ] + +The IRQC IP block supports Bus error and ECCRAM interrupts on RZ/G2L and +alike SoC's (listed below). Update the IRQC nodes with the missing +interrupts, and additionally, include the 'interrupt-names' properties +in the IRQC nodes so that the driver can parse interrupts by name. + + - R9A07G043U - RZ/G2UL + - R9A07G044L/R9A07G044LC - RZ/{G2L,G2LC} + - R9A07G054 - RZ/V2L + +Fixes: 5edc51af5b30 ("arm64: dts: renesas: r9a07g044: Add IRQC node") +Fixes: 48ab6eddd8bb ("arm64: dts: renesas: r9a07g043u: Add IRQC node") +Fixes: 379478ab09e0 ("arm64: dts: renesas: r9a07g054: Add IRQC node") +Signed-off-by: Lad Prabhakar +Reviewed-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/20240205144421.51195-3-prabhakar.mahadev-lad.rj@bp.renesas.com +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/renesas/r9a07g043u.dtsi | 12 +++++++++-- + arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 22 ++++++++++++++++++++- + arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 22 ++++++++++++++++++++- + 3 files changed, 52 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/renesas/r9a07g043u.dtsi b/arch/arm64/boot/dts/renesas/r9a07g043u.dtsi +index 2ab231572d95f..b3f83d0ebcbb5 100644 +--- a/arch/arm64/boot/dts/renesas/r9a07g043u.dtsi ++++ b/arch/arm64/boot/dts/renesas/r9a07g043u.dtsi +@@ -109,7 +109,13 @@ irqc: interrupt-controller@110a0000 { + , + , + , +- ; ++ , ++ , ++ , ++ , ++ , ++ , ++ ; + interrupt-names = "nmi", + "irq0", "irq1", "irq2", "irq3", + "irq4", "irq5", "irq6", "irq7", +@@ -121,7 +127,9 @@ irqc: interrupt-controller@110a0000 { + "tint20", "tint21", "tint22", "tint23", + "tint24", "tint25", "tint26", "tint27", + "tint28", "tint29", "tint30", "tint31", +- "bus-err"; ++ "bus-err", "ec7tie1-0", "ec7tie2-0", ++ "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", ++ "ec7tiovf-1"; + clocks = <&cpg CPG_MOD R9A07G043_IA55_CLK>, + <&cpg CPG_MOD R9A07G043_IA55_PCLK>; + clock-names = "clk", "pclk"; +diff --git a/arch/arm64/boot/dts/renesas/r9a07g044.dtsi b/arch/arm64/boot/dts/renesas/r9a07g044.dtsi +index 66f68fc2b2411..081d8f49db879 100644 +--- a/arch/arm64/boot/dts/renesas/r9a07g044.dtsi ++++ b/arch/arm64/boot/dts/renesas/r9a07g044.dtsi +@@ -905,7 +905,27 @@ irqc: interrupt-controller@110a0000 { + , + , + , +- ; ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; ++ interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", ++ "irq4", "irq5", "irq6", "irq7", ++ "tint0", "tint1", "tint2", "tint3", ++ "tint4", "tint5", "tint6", "tint7", ++ "tint8", "tint9", "tint10", "tint11", ++ "tint12", "tint13", "tint14", "tint15", ++ "tint16", "tint17", "tint18", "tint19", ++ "tint20", "tint21", "tint22", "tint23", ++ "tint24", "tint25", "tint26", "tint27", ++ "tint28", "tint29", "tint30", "tint31", ++ "bus-err", "ec7tie1-0", "ec7tie2-0", ++ "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", ++ "ec7tiovf-1"; + clocks = <&cpg CPG_MOD R9A07G044_IA55_CLK>, + <&cpg CPG_MOD R9A07G044_IA55_PCLK>; + clock-names = "clk", "pclk"; +diff --git a/arch/arm64/boot/dts/renesas/r9a07g054.dtsi b/arch/arm64/boot/dts/renesas/r9a07g054.dtsi +index 1f1d481dc7830..0d327464d2baf 100644 +--- a/arch/arm64/boot/dts/renesas/r9a07g054.dtsi ++++ b/arch/arm64/boot/dts/renesas/r9a07g054.dtsi +@@ -912,7 +912,27 @@ irqc: interrupt-controller@110a0000 { + , + , + , +- ; ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; ++ interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", ++ "irq4", "irq5", "irq6", "irq7", ++ "tint0", "tint1", "tint2", "tint3", ++ "tint4", "tint5", "tint6", "tint7", ++ "tint8", "tint9", "tint10", "tint11", ++ "tint12", "tint13", "tint14", "tint15", ++ "tint16", "tint17", "tint18", "tint19", ++ "tint20", "tint21", "tint22", "tint23", ++ "tint24", "tint25", "tint26", "tint27", ++ "tint28", "tint29", "tint30", "tint31", ++ "bus-err", "ec7tie1-0", "ec7tie2-0", ++ "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", ++ "ec7tiovf-1"; + clocks = <&cpg CPG_MOD R9A07G054_IA55_CLK>, + <&cpg CPG_MOD R9A07G054_IA55_PCLK>; + clock-names = "clk", "pclk"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-renesas-rzg3s-smarc-som-guard-ethernet-irq.patch b/queue-6.8/arm64-dts-renesas-rzg3s-smarc-som-guard-ethernet-irq.patch new file mode 100644 index 00000000000..7f685ddb78a --- /dev/null +++ b/queue-6.8/arm64-dts-renesas-rzg3s-smarc-som-guard-ethernet-irq.patch @@ -0,0 +1,64 @@ +From 3ea56c36d81b8dbcb37e9b85d44397528c23ad4d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Feb 2024 14:42:55 +0200 +Subject: arm64: dts: renesas: rzg3s-smarc-som: Guard Ethernet IRQ GPIO hogs + +From: Claudiu Beznea + +[ Upstream commit 150d81f7a260f36c118cbec253fdd493c671dc29 ] + +Ethernet IRQ GPIOs are marked as GPIO hogs. Thus, these GPIOs are +requested at probe time without considering if there are other +peripherals that need them. The Ethernet IRQ GPIOs are shared with +SDHI2. Selection between Ethernet and SDHI2 is done through a hardware +switch. To avoid scenarios where one wants to boot with SDHI2 support +and some SDHI pins are not propertly configured because of the GPIO +hogs, guard the Ethernet IRQ GPIO hogs with the proper build flag. + +Fixes: 932ff0c802c6 ("arm64: dts: renesas: rzg3s-smarc-som: Enable the Ethernet interfaces") +Signed-off-by: Claudiu Beznea +Reviewed-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/20240208124300.2740313-13-claudiu.beznea.uj@bp.renesas.com +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +index f062d4ad78b79..d33ab4c887878 100644 +--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi ++++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +@@ -193,12 +193,14 @@ &sdhi2 { + #endif + + &pinctrl { ++#if SW_CONFIG3 == SW_ON + eth0-phy-irq-hog { + gpio-hog; + gpios = ; + input; + line-name = "eth0-phy-irq"; + }; ++#endif + + eth0_pins: eth0 { + txc { +@@ -234,12 +236,14 @@ mux { + }; + }; + ++#if SW_CONFIG3 == SW_ON + eth1-phy-irq-hog { + gpio-hog; + gpios = ; + input; + line-name = "eth1-phy-irq"; + }; ++#endif + + eth1_pins: eth1 { + txc { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-rockchip-add-missing-interrupt-names-for-r.patch b/queue-6.8/arm64-dts-rockchip-add-missing-interrupt-names-for-r.patch new file mode 100644 index 00000000000..c5104f2630f --- /dev/null +++ b/queue-6.8/arm64-dts-rockchip-add-missing-interrupt-names-for-r.patch @@ -0,0 +1,40 @@ +From 478f2cd21db76429cfb3130c410a50c9a07a3e39 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 27 Feb 2024 18:35:25 +0100 +Subject: arm64: dts: rockchip: add missing interrupt-names for rk356x vdpu +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Heiko Stuebner + +[ Upstream commit d1c44d9afa6f89aa0e10a191f30868eb12cd719f ] + +The video-codec@fdea0400 was missing the interrupt-names property that is +part of the binding. Add it. + +Fixes: 944be6fba401 ("arm64: dts: rockchip: Add VPU support for RK3568/RK3566") +Cc: Piotr Oniszczuk +Acked-by: Uwe Kleine-König +Signed-off-by: Heiko Stuebner +Link: https://lore.kernel.org/r/20240227173526.710056-1-heiko@sntech.de +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/rockchip/rk356x.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi +index c19c0f1b3778f..6a9bfb0550c04 100644 +--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi +@@ -597,6 +597,7 @@ vpu: video-codec@fdea0400 { + compatible = "rockchip,rk3568-vpu"; + reg = <0x0 0xfdea0000 0x0 0x800>; + interrupts = ; ++ interrupt-names = "vdpu"; + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>; + clock-names = "aclk", "hclk"; + iommus = <&vdpu_mmu>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-rockchip-drop-rockchip-trcm-sync-tx-only-f.patch b/queue-6.8/arm64-dts-rockchip-drop-rockchip-trcm-sync-tx-only-f.patch new file mode 100644 index 00000000000..71a3a58cccc --- /dev/null +++ b/queue-6.8/arm64-dts-rockchip-drop-rockchip-trcm-sync-tx-only-f.patch @@ -0,0 +1,55 @@ +From a2a548b38b33979617536d9315865d7649576ddd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 27 Feb 2024 17:46:56 +0100 +Subject: arm64: dts: rockchip: drop rockchip,trcm-sync-tx-only from rk3588 i2s + +From: Heiko Stuebner + +[ Upstream commit a8037ceb89649659831e86a87a9329d1bb43c735 ] + +The rockchip,trcm-sync-tx-only property is at this time only documented +for the tdm variant of Rockchip i2s controllers. + +While there was a series [0] adding code and binding for the property, +it doesn't seem to have gone forward back in 2021. + +So for now fix the devicetree check by removing the property from rk3588 +i2s controllers until support for it gets merged. + +[0] https://patchwork.kernel.org/project/linux-rockchip/patch/1629796734-4243-5-git-send-email-sugar.zhang@rock-chips.com/ + +Fixes: 8ae112a5554f ("arm64: dts: rockchip: Add rk3588s I2S nodes") +Cc: Sugar Zhang +Cc: Cristian Ciocaltea +Signed-off-by: Heiko Stuebner +Reviewed-by: Quentin Schulz +Link: https://lore.kernel.org/r/20240227164659.705271-2-heiko@sntech.de +Signed-off-by: Heiko Stuebner +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +index 36b1b7acfe6a1..82350ddb262f2 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +@@ -1704,7 +1704,6 @@ i2s2_2ch: i2s@fe490000 { + dmas = <&dmac1 0>, <&dmac1 1>; + dma-names = "tx", "rx"; + power-domains = <&power RK3588_PD_AUDIO>; +- rockchip,trcm-sync-tx-only; + pinctrl-names = "default"; + pinctrl-0 = <&i2s2m1_lrck + &i2s2m1_sclk +@@ -1725,7 +1724,6 @@ i2s3_2ch: i2s@fe4a0000 { + dmas = <&dmac1 2>, <&dmac1 3>; + dma-names = "tx", "rx"; + power-domains = <&power RK3588_PD_AUDIO>; +- rockchip,trcm-sync-tx-only; + pinctrl-names = "default"; + pinctrl-0 = <&i2s3_lrck + &i2s3_sclk +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-rockchip-fix-reset-names-for-rk356x-i2s2-c.patch b/queue-6.8/arm64-dts-rockchip-fix-reset-names-for-rk356x-i2s2-c.patch new file mode 100644 index 00000000000..0a303cd920e --- /dev/null +++ b/queue-6.8/arm64-dts-rockchip-fix-reset-names-for-rk356x-i2s2-c.patch @@ -0,0 +1,48 @@ +From 6e261aa60782fd81a62a9d113ae994f88c56ac24 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 27 Feb 2024 18:35:26 +0100 +Subject: arm64: dts: rockchip: fix reset-names for rk356x i2s2 controller +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Heiko Stuebner + +[ Upstream commit 0fc19ab75acde78558bd0f6fe3e5f63cf8ee88b0 ] + +The dtbscheck reports a warning for a wrong reset-names property for +the i2s2 controller on rk356x socs. + +The other controllers on the soc provide tx and rx directions and hence +two resets and separate clocks for each direction, while i2s2 only +provides one reset. This was so far named just "m" which isn't part of +the binding. + +The clock-names the controller uses all end in "tx", so use the matching +"tx-m" reset-name for the i2s controller. + +Fixes: 755f37010f3e ("arm64: dts: rockchip: RK356x: Add I2S2 device node") +Acked-by: Uwe Kleine-König +Signed-off-by: Heiko Stuebner +Link: https://lore.kernel.org/r/20240227173526.710056-2-heiko@sntech.de +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/rockchip/rk356x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi +index 6a9bfb0550c04..92f96ec01385d 100644 +--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi +@@ -1124,7 +1124,7 @@ i2s2_2ch: i2s@fe420000 { + dmas = <&dmac1 4>, <&dmac1 5>; + dma-names = "tx", "rx"; + resets = <&cru SRST_M_I2S2_2CH>; +- reset-names = "m"; ++ reset-names = "tx-m"; + rockchip,grf = <&grf>; + pinctrl-names = "default"; + pinctrl-0 = <&i2s2m0_sclktx +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-add-common1-register-space-for-am62x-so.patch b/queue-6.8/arm64-dts-ti-add-common1-register-space-for-am62x-so.patch new file mode 100644 index 00000000000..49b7e327d2f --- /dev/null +++ b/queue-6.8/arm64-dts-ti-add-common1-register-space-for-am62x-so.patch @@ -0,0 +1,44 @@ +From d426d0e757432a85c8c223817c6a01e49cc6e394 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 11:54:25 +0530 +Subject: arm64: dts: ti: Add common1 register space for AM62x SoC + +From: Devarsh Thakkar + +[ Upstream commit 7d8ee2c3b8a2aabb9ce75795bad20773bfe1ba13 ] + +This adds common1 register space for AM62x SoC which is using TI's Keystone +display hardware and supporting it as described in +Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml + +Fixes: 8ccc1073c7bb ("arm64: dts: ti: k3-am62-main: Add node for DSS") +Signed-off-by: Devarsh Thakkar +Reviewed-by: Tomi Valkeinen +Reviewed-by: Aradhya Bhatia +Link: https://lore.kernel.org/r/20240216062426.4170528-4-devarsht@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi +index c49fbce5cb707..6d07b65a3614e 100644 +--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi +@@ -783,9 +783,10 @@ dss: dss@30200000 { + <0x00 0x30207000 0x00 0x1000>, /* ovr1 */ + <0x00 0x30208000 0x00 0x1000>, /* ovr2 */ + <0x00 0x3020a000 0x00 0x1000>, /* vp1: Used for OLDI */ +- <0x00 0x3020b000 0x00 0x1000>; /* vp2: Used as DPI Out */ ++ <0x00 0x3020b000 0x00 0x1000>, /* vp2: Used as DPI Out */ ++ <0x00 0x30201000 0x00 0x1000>; /* common1 */ + reg-names = "common", "vidl1", "vid", +- "ovr1", "ovr2", "vp1", "vp2"; ++ "ovr1", "ovr2", "vp1", "vp2", "common1"; + power-domains = <&k3_pds 186 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 186 6>, + <&dss_vp1_clk>, +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-add-common1-register-space-for-am65x-so.patch b/queue-6.8/arm64-dts-ti-add-common1-register-space-for-am65x-so.patch new file mode 100644 index 00000000000..0bb78f6dcbe --- /dev/null +++ b/queue-6.8/arm64-dts-ti-add-common1-register-space-for-am65x-so.patch @@ -0,0 +1,44 @@ +From bf0694037f203b4fc917002f599efd9f5b9c00cb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 11:54:24 +0530 +Subject: arm64: dts: ti: Add common1 register space for AM65x SoC + +From: Devarsh Thakkar + +[ Upstream commit 1a5010eade10b409d353b770d97b548b0fbdf5d7 ] + +This adds common1 register space for AM65x SoC which is using TI's Keystone +display hardware and supporting it as described in +Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml + +Fixes: fc539b90eda2 ("arm64: dts: ti: am654: Add DSS node") +Signed-off-by: Devarsh Thakkar +Reviewed-by: Tomi Valkeinen +Reviewed-by: Aradhya Bhatia +Link: https://lore.kernel.org/r/20240216062426.4170528-3-devarsht@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi +index fcea544656360..5b2d4365b9111 100644 +--- a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi +@@ -1019,9 +1019,10 @@ dss: dss@4a00000 { + <0x0 0x04a07000 0x0 0x1000>, /* ovr1 */ + <0x0 0x04a08000 0x0 0x1000>, /* ovr2 */ + <0x0 0x04a0a000 0x0 0x1000>, /* vp1 */ +- <0x0 0x04a0b000 0x0 0x1000>; /* vp2 */ ++ <0x0 0x04a0b000 0x0 0x1000>, /* vp2 */ ++ <0x0 0x04a01000 0x0 0x1000>; /* common1 */ + reg-names = "common", "vidl1", "vid", +- "ovr1", "ovr2", "vp1", "vp2"; ++ "ovr1", "ovr2", "vp1", "vp2", "common1"; + + ti,am65x-oldi-io-ctrl = <&dss_oldi_io_ctrl>; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-am65x-fix-dtbs_install-for-rocktech-old.patch b/queue-6.8/arm64-dts-ti-am65x-fix-dtbs_install-for-rocktech-old.patch new file mode 100644 index 00000000000..0ab557b08a2 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-am65x-fix-dtbs_install-for-rocktech-old.patch @@ -0,0 +1,37 @@ +From 05e05d117fe8ddfc513c947819940c47195b88d6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Feb 2024 15:51:43 +0200 +Subject: arm64: dts: ti: am65x: Fix dtbs_install for Rocktech OLDI overlay + +From: Roger Quadros + +[ Upstream commit 8ada14cafc5e185c668198617cd1ab4f1d8d325a ] + +Add the overlay dtbo file to a Makefile target so it can be +picked by the dtbs_install command. + +Fixes: b8690ed3d1d1 ("arm64: dts: ti: am65x: Add Rocktech OLDI panel DT overlay") +Signed-off-by: Roger Quadros +Reviewed-by: Aradhya Bhatia +Link: https://lore.kernel.org/r/20240208-for-v6-9-am65-overlays-2-0-v2-1-70bae3e91597@kernel.org +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile +index 52c1dc9103087..08ce34d21d5d0 100644 +--- a/arch/arm64/boot/dts/ti/Makefile ++++ b/arch/arm64/boot/dts/ti/Makefile +@@ -57,6 +57,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board.dtb + dtb-$(CONFIG_ARCH_K3) += k3-am654-gp-evm.dtb + dtb-$(CONFIG_ARCH_K3) += k3-am654-evm.dtb + dtb-$(CONFIG_ARCH_K3) += k3-am654-idk.dtb ++dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board-rocktech-rk101-panel.dtbo + + # Boards with J7200 SoC + k3-j7200-evm-dtbs := k3-j7200-common-proc-board.dtb k3-j7200-evm-quad-port-eth-exp.dtbo +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-am62-main-disable-usb-lpm.patch b/queue-6.8/arm64-dts-ti-k3-am62-main-disable-usb-lpm.patch new file mode 100644 index 00000000000..153d9eb73bc --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-am62-main-disable-usb-lpm.patch @@ -0,0 +1,65 @@ +From 0e46e7256baa6474fa66106322856f32fc12b444 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Feb 2024 14:02:12 +0100 +Subject: arm64: dts: ti: k3-am62-main: disable usb lpm + +From: Andrejs Cainikovs + +[ Upstream commit 9c99b337a8755a09df7735d4324ae26a6eca6261 ] + +AM62 USB works with some devices, while failing to operate with others. + +[ 560.189822] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller +[ 560.195631] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 2 +[ 574.388509] xhci-hcd xhci-hcd.4.auto: can't setup: -110 +[ 574.393814] xhci-hcd xhci-hcd.4.auto: USB bus 2 deregistered +[ 574.399544] xhci-hcd: probe of xhci-hcd.4.auto failed with error -110 + +This seems to be related to LPM (Link Power Management), and disabling it +turns USB into reliable working state. + +As per AM62 reference manual: + +> 4.8.2.1 USB2SS Unsupported Features +> +> The following features are not supported on this family of devices: +> ... +> - USB 2.0 ECN: Link Power Management (LPM) +> ... + +Fixes: 2240f96cf3cd ("arm64: dts: ti: k3-am62-main: Add support for USB") +Signed-off-by: Andrejs Cainikovs +Reviewed-by: Francesco Dolcini +Reviewed-by: Roger Quadros +Link: https://lore.kernel.org/r/20240209130213.38908-1-andrejs.cainikovs@gmail.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi +index 464b7565d085d..c49fbce5cb707 100644 +--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi +@@ -640,6 +640,8 @@ usb0: usb@31000000 { + interrupt-names = "host", "peripheral"; + maximum-speed = "high-speed"; + dr_mode = "otg"; ++ snps,usb2-gadget-lpm-disable; ++ snps,usb2-lpm-disable; + }; + }; + +@@ -663,6 +665,8 @@ usb1: usb@31100000 { + interrupt-names = "host", "peripheral"; + maximum-speed = "high-speed"; + dr_mode = "otg"; ++ snps,usb2-gadget-lpm-disable; ++ snps,usb2-lpm-disable; + }; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-am62p-fix-memory-ranges-for-dmss.patch b/queue-6.8/arm64-dts-ti-k3-am62p-fix-memory-ranges-for-dmss.patch new file mode 100644 index 00000000000..7cf494a99a4 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-am62p-fix-memory-ranges-for-dmss.patch @@ -0,0 +1,39 @@ +From 29df3e91851dd57ee243381c95591075890d431a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Feb 2024 11:48:02 +0530 +Subject: arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS + +From: Jai Luthra + +[ Upstream commit 90a67583171f213711de662fab9f8d24a2d291a9 ] + +The INTR module for DMASS1 (CSI specific DMASS) is outside the currently +available ranges, as it starts at 0x4e400000. So fix the ranges property +to enable programming the interrupts correctly. + +Fixes: 29075cc09f43 ("arm64: dts: ti: Introduce AM62P5 family of SoCs") +Reviewed-by: Vaishnav Achath +Signed-off-by: Jai Luthra +Link: https://lore.kernel.org/r/20240220-am62p_csi-v2-1-3e71d9945571@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am62p.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-am62p.dtsi b/arch/arm64/boot/dts/ti/k3-am62p.dtsi +index 84ffe7b9dcaf3..4f22b5d9fb9f0 100644 +--- a/arch/arm64/boot/dts/ti/k3-am62p.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-am62p.dtsi +@@ -71,7 +71,7 @@ cbass_main: bus@f0000 { + <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* SA3 sproxy data */ + <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */ + <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* SA3 sproxy config */ +- <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */ ++ <0x00 0x48000000 0x00 0x48000000 0x00 0x06408000>, /* DMSS */ + <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */ + <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */ + <0x01 0x00000000 0x01 0x00000000 0x00 0x00310000>, /* A53 PERIPHBASE */ +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-am62p-mcu-wakeup-disable-mcu-and-wak.patch b/queue-6.8/arm64-dts-ti-k3-am62p-mcu-wakeup-disable-mcu-and-wak.patch new file mode 100644 index 00000000000..86b552174dc --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-am62p-mcu-wakeup-disable-mcu-and-wak.patch @@ -0,0 +1,62 @@ +From cbfcbefb23136db0359553587de25ee991482de9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 21 Jan 2024 19:10:17 +0530 +Subject: arm64: dts: ti: k3-am62p-mcu/wakeup: Disable MCU and wakeup R5FSS + nodes + +From: Vaishnav Achath + +[ Upstream commit dfc90e5f1a0fe0f8124521bc1911e38aa6cd9118 ] + +K3 Remoteproc R5 driver requires reserved memory carveouts and +mailbox configuration to instantiate the cores successfully. +Since this is a board level dependency, keep the R5 subsytem +disabled at SoC dtsi, otherwise it results in probe errors like +below during AM62P SK boot: + +r5fss@79000000: reserved memory init failed, ret = -22 +r5fss@79000000: k3_r5_cluster_rproc_init failed, ret = -22 +r5fss@78000000: reserved memory init failed, ret = -22 +r5fss@78000000: k3_r5_cluster_rproc_init failed, ret = -22 + +Fixes: b5080c7c1f7e ("arm64: dts: ti: k3-am62p: Add nodes for more IPs") + +Signed-off-by: Vaishnav Achath +Reviewed-by: Jayesh Choudhary +Reviewed-by: Nishanth Menon +Link: https://lore.kernel.org/r/20240121134017.374992-1-vaishnav.a@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi | 2 ++ + arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi +index c4b0b91d70cf3..14eb9ba836d32 100644 +--- a/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi +@@ -187,6 +187,8 @@ mcu_r5fss0: r5fss@79000000 { + ranges = <0x79000000 0x00 0x79000000 0x8000>, + <0x79020000 0x00 0x79020000 0x8000>; + power-domains = <&k3_pds 7 TI_SCI_PD_EXCLUSIVE>; ++ status = "disabled"; ++ + mcu_r5fss0_core0: r5f@79000000 { + compatible = "ti,am62-r5f"; + reg = <0x79000000 0x00008000>, +diff --git a/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi +index 19f42b39394ee..10a7059b2d9b5 100644 +--- a/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi +@@ -78,6 +78,7 @@ wkup_r5fss0: r5fss@78000000 { + ranges = <0x78000000 0x00 0x78000000 0x8000>, + <0x78100000 0x00 0x78100000 0x8000>; + power-domains = <&k3_pds 119 TI_SCI_PD_EXCLUSIVE>; ++ status = "disabled"; + + wkup_r5fss0_core0: r5f@78000000 { + compatible = "ti,am62-r5f"; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-am62p5-sk-enable-cpsw-mdio-node.patch b/queue-6.8/arm64-dts-ti-k3-am62p5-sk-enable-cpsw-mdio-node.patch new file mode 100644 index 00000000000..ad9d57b5b3e --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-am62p5-sk-enable-cpsw-mdio-node.patch @@ -0,0 +1,44 @@ +From f5a919f8719a5ab073945a4ba0117c18ff52eb49 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 1 Feb 2024 18:13:53 +0530 +Subject: arm64: dts: ti: k3-am62p5-sk: Enable CPSW MDIO node + +From: Ravi Gunasekaran + +[ Upstream commit 8839a9af397e803e0447a6b3e69fad54ed22d26d ] + +Enable the CPSW MDIO node, and link the pinctrl information to enable +ethernet on SK-AM62P. + +Ethernet was unintentally broken on this board, even though these nodes +were already present, as enabling them was missed in the original +patch. + +Fixes: c00504ea42c0 ("arm64: dts: ti: k3-am62p5-sk: Updates for SK EVM") +Signed-off-by: Ravi Gunasekaran +Signed-off-by: Jai Luthra +Link: https://lore.kernel.org/r/20240201-am62p_cpsw_mdio-v1-1-05f758300f6e@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am62p5-sk.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts +index 1773c05f752cd..60868862e3b43 100644 +--- a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts ++++ b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts +@@ -445,6 +445,10 @@ &cpsw_port2 { + }; + + &cpsw3g_mdio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&main_mdio1_pins_default>; ++ status = "okay"; ++ + cpsw3g_phy0: ethernet-phy@0 { + reg = <0>; + ti,rx-internal-delay = ; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-am64-main-fix-itap-otap-values-for-m.patch b/queue-6.8/arm64-dts-ti-k3-am64-main-fix-itap-otap-values-for-m.patch new file mode 100644 index 00000000000..aaff7705673 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-am64-main-fix-itap-otap-values-for-m.patch @@ -0,0 +1,59 @@ +From a6f9ed52a72f2aec1aa948faa04ff8ef231e9a4d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 17:56:56 -0600 +Subject: arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC + +From: Judith Mendez + +[ Upstream commit 379c7752bbd0e81654544a896dd19c19ebb6faba ] + +Update MMC0/MMC1 OTAP/ITAP values according to the datasheet +[0], refer to Table 7-68 for MMC0 and Table 7-77 for MMC1. + +[0] https://www.ti.com/lit/ds/symlink/am6442.pdf + +Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC") +Signed-off-by: Judith Mendez +Tested-by: Wadim Egorov +Link: https://lore.kernel.org/r/20240213235701.2438513-5-jm@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi +index e348114f42e01..ba624ef72f5b4 100644 +--- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi +@@ -633,6 +633,9 @@ sdhci0: mmc@fa10000 { + ti,otap-del-sel-mmc-hs = <0x0>; + ti,otap-del-sel-ddr52 = <0x6>; + ti,otap-del-sel-hs200 = <0x7>; ++ ti,itap-del-sel-legacy = <0x10>; ++ ti,itap-del-sel-mmc-hs = <0xa>; ++ ti,itap-del-sel-ddr52 = <0x3>; + status = "disabled"; + }; + +@@ -645,12 +648,16 @@ sdhci1: mmc@fa00000 { + clock-names = "clk_ahb", "clk_xin"; + ti,trm-icp = <0x2>; + ti,otap-del-sel-legacy = <0x0>; +- ti,otap-del-sel-sd-hs = <0xf>; ++ ti,otap-del-sel-sd-hs = <0x0>; + ti,otap-del-sel-sdr12 = <0xf>; + ti,otap-del-sel-sdr25 = <0xf>; + ti,otap-del-sel-sdr50 = <0xc>; + ti,otap-del-sel-sdr104 = <0x6>; + ti,otap-del-sel-ddr50 = <0x9>; ++ ti,itap-del-sel-legacy = <0x0>; ++ ti,itap-del-sel-sd-hs = <0x0>; ++ ti,itap-del-sel-sdr12 = <0x0>; ++ ti,itap-del-sel-sdr25 = <0x0>; + ti,clkbuf-sel = <0x7>; + status = "disabled"; + }; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-am69-sk-fix-pmic-interrupt-number.patch b/queue-6.8/arm64-dts-ti-k3-am69-sk-fix-pmic-interrupt-number.patch new file mode 100644 index 00000000000..6fb869c25d0 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-am69-sk-fix-pmic-interrupt-number.patch @@ -0,0 +1,43 @@ +From d9f7c92464a1a355a924a0bbcc99835618ccbe61 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Feb 2024 18:11:45 +0100 +Subject: arm64: dts: ti: k3-am69-sk: fix PMIC interrupt number + +From: Romain Naour + +[ Upstream commit c205595e3b708c36ef2d7609b9182c6729bb06ae ] + +The tps659413 node set WKUP_GPIO0_83 (AA37) pin as input to be used as +PMIC interrupt but uses 39 (WKUP_GPIO0_39) as "interrupts" property. + +Replace 39 by 83 after checking in the board schematic [1]. + +[1] https://www.ti.com/tool/SK-AM69 + +Fixes: 865a1593bf99 ("arm64: dts: ti: k3-am69-sk: Add support for TPS6594 PMIC") +Cc: Neha Malcom Francis +Signed-off-by: Romain Naour +Reviewed-by: Neha Malcom Francis +Link: https://lore.kernel.org/r/20240209171146.307465-1-romain.naour@smile.fr +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am69-sk.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-am69-sk.dts b/arch/arm64/boot/dts/ti/k3-am69-sk.dts +index 370980eb59b02..c8fb9dfb89723 100644 +--- a/arch/arm64/boot/dts/ti/k3-am69-sk.dts ++++ b/arch/arm64/boot/dts/ti/k3-am69-sk.dts +@@ -646,7 +646,7 @@ tps659413: pmic@48 { + pinctrl-names = "default"; + pinctrl-0 = <&pmic_irq_pins_default>; + interrupt-parent = <&wkup_gpio0>; +- interrupts = <39 IRQ_TYPE_EDGE_FALLING>; ++ interrupts = <83 IRQ_TYPE_EDGE_FALLING>; + gpio-controller; + #gpio-cells = <2>; + ti,primary-pmic; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-am69-sk-remove-assigned-clock-parent.patch b/queue-6.8/arm64-dts-ti-k3-am69-sk-remove-assigned-clock-parent.patch new file mode 100644 index 00000000000..7abfaa860bf --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-am69-sk-remove-assigned-clock-parent.patch @@ -0,0 +1,55 @@ +From d8f234f5d3e1389cf781ef70af29525c136d2c1e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 1 Feb 2024 19:53:08 +0530 +Subject: arm64: dts: ti: k3-am69-sk: remove assigned-clock-parents for unused + VP + +From: Jayesh Choudhary + +[ Upstream commit cfdb4f7ffdb855c1a3d274dc7757e780dcbf2d55 ] + +VP2 and VP3 are unused video ports and VP3 share the same parent +clock as VP1 causing issue with pixel clock setting for HDMI (VP1). +The current DM firmware does not support changing parent clock if it +is shared by another component. It returns 0 for the determine_rate +query before causing set_rate to set the clock at default maximum of +1.8GHz which is a lot more than the maximum frequency videoports can +support (600MHz) causing SYNC LOST issues. +So remove the parent clocks for unused VPs to avoid conflict. + +Fixes: 6f8605fd7d11 ("arm64: dts: ti: k3-am69-sk: Add DP and HDMI support") +Reported-by: Nishanth Menon +Signed-off-by: Jayesh Choudhary +Reviewed-by: Tomi Valkeinen +Reviewed-by: Aradhya Bhatia +Tested-by: Enric Balletbo i Serra +Link: https://lore.kernel.org/r/20240201142308.4954-1-j-choudhary@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-am69-sk.dts | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-am69-sk.dts b/arch/arm64/boot/dts/ti/k3-am69-sk.dts +index 8da5915798688..370980eb59b02 100644 +--- a/arch/arm64/boot/dts/ti/k3-am69-sk.dts ++++ b/arch/arm64/boot/dts/ti/k3-am69-sk.dts +@@ -918,13 +918,9 @@ &dss { + pinctrl-names = "default"; + pinctrl-0 = <&dss_vout0_pins_default>; + assigned-clocks = <&k3_clks 218 2>, +- <&k3_clks 218 5>, +- <&k3_clks 218 14>, +- <&k3_clks 218 18>; ++ <&k3_clks 218 5>; + assigned-clock-parents = <&k3_clks 218 3>, +- <&k3_clks 218 7>, +- <&k3_clks 218 16>, +- <&k3_clks 218 22>; ++ <&k3_clks 218 7>; + }; + + &serdes_wiz4 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-modify-pinmu.patch b/queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-modify-pinmu.patch new file mode 100644 index 00000000000..31a82d4832d --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-modify-pinmu.patch @@ -0,0 +1,64 @@ +From cab89dc97b0d9a15e8a19faa04ad2f19a169bbc6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 16:28:43 +0530 +Subject: arm64: dts: ti: k3-j7200-common-proc-board: Modify Pinmux for + wkup_uart0 and mcu_uart0 + +From: Bhavya Kapoor + +[ Upstream commit 566feddd2ba5e29d9ccab36d6508592ae563f275 ] + +WKUP_PADCONFIG registers for wkup_uart0 and mcu_uart0 lies +under wkup_pmx2 for J7200. Thus, modify pinmux for both +of them. + +Fixes: 3709ea7f960e ("arm64: dts: ti: k3-j7200-common-proc-board: Add uart pinmux") +Signed-off-by: Bhavya Kapoor +Link: https://lore.kernel.org/r/20240214105846.1096733-2-b-kapoor@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + .../boot/dts/ti/k3-j7200-common-proc-board.dts | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +index cee2b4b0eb87d..53594c5fb8e8f 100644 +--- a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts ++++ b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +@@ -91,24 +91,25 @@ vdd_sd_dv: gpio-regulator-TLV71033 { + }; + + &wkup_pmx0 { ++}; ++ ++&wkup_pmx2 { + mcu_uart0_pins_default: mcu-uart0-default-pins { + pinctrl-single,pins = < +- J721E_WKUP_IOPAD(0xf4, PIN_INPUT, 0) /* (D20) MCU_UART0_RXD */ +- J721E_WKUP_IOPAD(0xf0, PIN_OUTPUT, 0) /* (D19) MCU_UART0_TXD */ +- J721E_WKUP_IOPAD(0xf8, PIN_INPUT, 0) /* (E20) MCU_UART0_CTSn */ +- J721E_WKUP_IOPAD(0xfc, PIN_OUTPUT, 0) /* (E21) MCU_UART0_RTSn */ ++ J721E_WKUP_IOPAD(0x90, PIN_INPUT, 0) /* (E20) MCU_UART0_CTSn */ ++ J721E_WKUP_IOPAD(0x94, PIN_OUTPUT, 0) /* (E21) MCU_UART0_RTSn */ ++ J721E_WKUP_IOPAD(0x8c, PIN_INPUT, 0) /* (D20) MCU_UART0_RXD */ ++ J721E_WKUP_IOPAD(0x88, PIN_OUTPUT, 0) /* (D19) MCU_UART0_TXD */ + >; + }; + + wkup_uart0_pins_default: wkup-uart0-default-pins { + pinctrl-single,pins = < +- J721E_WKUP_IOPAD(0xb0, PIN_INPUT, 0) /* (B14) WKUP_UART0_RXD */ +- J721E_WKUP_IOPAD(0xb4, PIN_OUTPUT, 0) /* (A14) WKUP_UART0_TXD */ ++ J721E_WKUP_IOPAD(0x48, PIN_INPUT, 0) /* (B14) WKUP_UART0_RXD */ ++ J721E_WKUP_IOPAD(0x4c, PIN_OUTPUT, 0) /* (A14) WKUP_UART0_TXD */ + >; + }; +-}; + +-&wkup_pmx2 { + mcu_cpsw_pins_default: mcu-cpsw-default-pins { + pinctrl-single,pins = < + J721E_WKUP_IOPAD(0x0000, PIN_OUTPUT, 0) /* MCU_RGMII1_TX_CTL */ +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-remove-clock.patch b/queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-remove-clock.patch new file mode 100644 index 00000000000..c1f80ab2bb5 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j7200-common-proc-board-remove-clock.patch @@ -0,0 +1,38 @@ +From 1db4201b902b7922d7a87bcd812bf5728325f8cd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 16:28:44 +0530 +Subject: arm64: dts: ti: k3-j7200-common-proc-board: Remove clock-frequency + from mcu_uart0 + +From: Bhavya Kapoor + +[ Upstream commit 0fa8b0e2083d333e4854b9767fb893f924e70ae5 ] + +Clock-frequency property is already present in mcu_uart0 node of the +k3-j7200-mcu-wakeup.dtsi file. Thus, remove redundant clock-frequency +property from mcu_uart0 node. + +Fixes: 3709ea7f960e ("arm64: dts: ti: k3-j7200-common-proc-board: Add uart pinmux") +Signed-off-by: Bhavya Kapoor +Link: https://lore.kernel.org/r/20240214105846.1096733-3-b-kapoor@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +index 53594c5fb8e8f..7a0c599f2b1c3 100644 +--- a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts ++++ b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +@@ -211,7 +211,6 @@ &mcu_uart0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mcu_uart0_pins_default>; +- clock-frequency = <96000000>; + }; + + &main_uart0 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j721e-fix-mux-reg-masks-in-hbmc_mux.patch b/queue-6.8/arm64-dts-ti-k3-j721e-fix-mux-reg-masks-in-hbmc_mux.patch new file mode 100644 index 00000000000..10f2dc36d3c --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j721e-fix-mux-reg-masks-in-hbmc_mux.patch @@ -0,0 +1,44 @@ +From 09fbc1550a542ba0c724236958e9535ed17397f0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Feb 2024 08:19:57 -0600 +Subject: arm64: dts: ti: k3-j721e: Fix mux-reg-masks in hbmc_mux + +From: Andrew Davis + +[ Upstream commit 3d585389d454e147187684e492a0eb8f56adf311 ] + +Change offset in mux-reg-masks property for hbmc_mux node +since reg-mux property is used in compatible. + +While here, update the reg region to include 4 bytes as this +is a 32bit register. + +Fixes: 2765149273f4 ("mux: mmio: use reg property when parent device is not a syscon") +Suggested-by: Peter Rosin +Signed-off-by: Andrew Davis +Link: https://lore.kernel.org/r/20240215141957.13775-1-afd@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi +index a74912d9e4daf..c463e23ced04e 100644 +--- a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi +@@ -353,9 +353,9 @@ fss: bus@47000000 { + + hbmc_mux: mux-controller@47000004 { + compatible = "reg-mux"; +- reg = <0x00 0x47000004 0x00 0x2>; ++ reg = <0x00 0x47000004 0x00 0x4>; + #mux-control-cells = <1>; +- mux-reg-masks = <0x4 0x2>; /* HBMC select */ ++ mux-reg-masks = <0x0 0x2>; /* HBMC select */ + }; + + hbmc: hyperbus@47034000 { +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j721e-sk-fix-pmic-interrupt-number.patch b/queue-6.8/arm64-dts-ti-k3-j721e-sk-fix-pmic-interrupt-number.patch new file mode 100644 index 00000000000..41fe2499ee6 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j721e-sk-fix-pmic-interrupt-number.patch @@ -0,0 +1,54 @@ +From 8a4bc357c20de7e0cc134a06dd15e531331e577c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Feb 2024 18:11:46 +0100 +Subject: arm64: dts: ti: k3-j721e-sk: fix PMIC interrupt number + +From: Romain Naour + +[ Upstream commit 7f25d6926d178734db17cfc12f0b1841e82914da ] + +The tps659413 and tps659411 nodes set WKUP_GPIO0_7 (G28) pin as input +to be used as PMIC interrupt but uses 9 (WKUP_GPIO0_9) as +"interrupts" property. + +Replace 9 by 7 for both tps659413 and tps659411 after checking in the +board schematic [1]. + +[1] https://www.ti.com/tool/SK-TDA4VM + +Fixes: b808cef0be46 ("arm64: dts: ti: k3-j721e-sk: Add TPS6594 family PMICs") +Cc: Neha Malcom Francis +Signed-off-by: Romain Naour +Reviewed-by: Neha Malcom Francis +Link: https://lore.kernel.org/r/20240209171146.307465-2-romain.naour@smile.fr +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts +index 188dfe291a32b..658764f7d5443 100644 +--- a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts ++++ b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts +@@ -574,7 +574,7 @@ tps659413: pmic@48 { + pinctrl-names = "default"; + pinctrl-0 = <&pmic_irq_pins_default>; + interrupt-parent = <&wkup_gpio0>; +- interrupts = <9 IRQ_TYPE_EDGE_FALLING>; ++ interrupts = <7 IRQ_TYPE_EDGE_FALLING>; + gpio-controller; + #gpio-cells = <2>; + ti,primary-pmic; +@@ -651,7 +651,7 @@ tps659411: pmic@4c { + reg = <0x4c>; + system-power-controller; + interrupt-parent = <&wkup_gpio0>; +- interrupts = <9 IRQ_TYPE_EDGE_FALLING>; ++ interrupts = <7 IRQ_TYPE_EDGE_FALLING>; + gpio-controller; + #gpio-cells = <2>; + buck1234-supply = <&vsys_3v3>; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j721s2-common-proc-board-remove-pinm.patch b/queue-6.8/arm64-dts-ti-k3-j721s2-common-proc-board-remove-pinm.patch new file mode 100644 index 00000000000..e0e0373a8e9 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j721s2-common-proc-board-remove-pinm.patch @@ -0,0 +1,40 @@ +From d5929ccad1bef8da03cd06bad88599efaa1221bc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 16:28:45 +0530 +Subject: arm64: dts: ti: k3-j721s2-common-proc-board: Remove Pinmux for CTS + and RTS in wkup_uart0 + +From: Bhavya Kapoor + +[ Upstream commit 28e5b74d524050008edf415f20a3e38907b8f176 ] + +Only Tx and Rx Signal lines for wkup_uart0 are brought out on +the Common Proc Board through SoM, but CTS and RTS signal lines +are not brought on the board. Thus, remove pinmux for CTS and RTS +signal lines for wkup_uart0 in J721S2. + +Fixes: f5e9ee0b354a ("arm64: dts: ti: k3-j721s2-common-proc-board: Add uart pinmux") +Signed-off-by: Bhavya Kapoor +Link: https://lore.kernel.org/r/20240214105846.1096733-4-b-kapoor@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts b/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts +index c6b85bbf9a179..1ba1f53c72d03 100644 +--- a/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts ++++ b/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts +@@ -190,8 +190,6 @@ J721S2_IOPAD(0x038, PIN_OUTPUT, 0) /* (AB28) MCASP0_ACLKX.MCAN5_TX */ + &wkup_pmx2 { + wkup_uart0_pins_default: wkup-uart0-default-pins { + pinctrl-single,pins = < +- J721S2_WKUP_IOPAD(0x070, PIN_INPUT, 0) /* (E25) WKUP_GPIO0_6.WKUP_UART0_CTSn */ +- J721S2_WKUP_IOPAD(0x074, PIN_OUTPUT, 0) /* (F28) WKUP_GPIO0_7.WKUP_UART0_RTSn */ + J721S2_WKUP_IOPAD(0x048, PIN_INPUT, 0) /* (D28) WKUP_UART0_RXD */ + J721S2_WKUP_IOPAD(0x04c, PIN_OUTPUT, 0) /* (D27) WKUP_UART0_TXD */ + >; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j721s2-fix-power-domain-for-vtm-node.patch b/queue-6.8/arm64-dts-ti-k3-j721s2-fix-power-domain-for-vtm-node.patch new file mode 100644 index 00000000000..a235d1e514e --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j721s2-fix-power-domain-for-vtm-node.patch @@ -0,0 +1,38 @@ +From a6fa193b8f35e7004b8cfdda053da9f39139dd2f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 1 Feb 2024 13:37:26 +0530 +Subject: arm64: dts: ti: k3-j721s2: Fix power domain for VTM node + +From: Manorit Chawdhry + +[ Upstream commit 5ef196ed912e80a1e64936119ced8d7eb5635f0f ] + +Fix the power domain device ID for wkup_vtm0 node. + +Link: https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j721s2/devices.html +Fixes: d148e3fe52c8 ("arm64: dts: ti: j721s2: Add VTM node") +Signed-off-by: Manorit Chawdhry +Reviewed-by: Andrew Davis +Link: https://lore.kernel.org/r/20240201-b4-upstream-j721s2-fix-vtm-devid-v2-1-85fd568b77e3@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi +index 80aa33c58a452..a47cb557dd956 100644 +--- a/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi +@@ -663,7 +663,7 @@ wkup_vtm0: temperature-sensor@42040000 { + compatible = "ti,j7200-vtm"; + reg = <0x00 0x42040000 0x0 0x350>, + <0x00 0x42050000 0x0 0x350>; +- power-domains = <&k3_pds 154 TI_SCI_PD_SHARED>; ++ power-domains = <&k3_pds 180 TI_SCI_PD_SHARED>; + #thermal-sensor-cells = <1>; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j784s4-evm-remove-pinmux-for-cts-and.patch b/queue-6.8/arm64-dts-ti-k3-j784s4-evm-remove-pinmux-for-cts-and.patch new file mode 100644 index 00000000000..c4c391e4acd --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j784s4-evm-remove-pinmux-for-cts-and.patch @@ -0,0 +1,40 @@ +From 1cb20c9a4deb99db158b0acb1704b998e68cb81b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 16:28:46 +0530 +Subject: arm64: dts: ti: k3-j784s4-evm: Remove Pinmux for CTS and RTS in + wkup_uart0 + +From: Bhavya Kapoor + +[ Upstream commit d29a6cf980572d8cf7b63935716fca663e2610f0 ] + +Only Tx and Rx Signal lines for wkup_uart0 are brought out on +the J784S4 EVM from SoC, but CTS and RTS signal lines are not +brought on the EVM. Thus, remove pinmux for CTS and RTS signal +lines for wkup_uart0 in J784S4. + +Fixes: 6fa5d37a2f34 ("arm64: dts: ti: k3-j784s4-evm: Add mcu and wakeup uarts") +Signed-off-by: Bhavya Kapoor +Link: https://lore.kernel.org/r/20240214105846.1096733-5-b-kapoor@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts b/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts +index f34b92acc56d8..33795a0bc69cf 100644 +--- a/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts ++++ b/arch/arm64/boot/dts/ti/k3-j784s4-evm.dts +@@ -335,8 +335,6 @@ &wkup_pmx2 { + wkup_uart0_pins_default: wkup-uart0-default-pins { + bootph-all; + pinctrl-single,pins = < +- J721S2_WKUP_IOPAD(0x070, PIN_INPUT, 0) /* (L37) WKUP_GPIO0_6.WKUP_UART0_CTSn */ +- J721S2_WKUP_IOPAD(0x074, PIN_INPUT, 0) /* (L36) WKUP_GPIO0_7.WKUP_UART0_RTSn */ + J721S2_WKUP_IOPAD(0x048, PIN_INPUT, 0) /* (K35) WKUP_UART0_RXD */ + J721S2_WKUP_IOPAD(0x04c, PIN_INPUT, 0) /* (K34) WKUP_UART0_TXD */ + >; +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j784s4-fix-power-domain-for-vtm-node.patch b/queue-6.8/arm64-dts-ti-k3-j784s4-fix-power-domain-for-vtm-node.patch new file mode 100644 index 00000000000..33f18ebdb87 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j784s4-fix-power-domain-for-vtm-node.patch @@ -0,0 +1,38 @@ +From 4f0236f1f1a9c0bf877c82a0d326450fc640df18 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 1 Feb 2024 13:37:27 +0530 +Subject: arm64: dts: ti: k3-j784s4: Fix power domain for VTM node + +From: Manorit Chawdhry + +[ Upstream commit e4d252e6d29208aea56d4c04270523e306b1e3c2 ] + +Fix the power domain device ID for wkup_vtm0 node. + +Link: https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j784s4/devices.html +Fixes: 64821fbf6738 ("arm64: dts: ti: j784s4: Add VTM node") +Signed-off-by: Manorit Chawdhry +Reviewed-by: Andrew Davis +Link: https://lore.kernel.org/r/20240201-b4-upstream-j721s2-fix-vtm-devid-v2-2-85fd568b77e3@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi +index 3902a921d7e58..337122c3f4020 100644 +--- a/arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi +@@ -628,7 +628,7 @@ wkup_vtm0: temperature-sensor@42040000 { + compatible = "ti,j7200-vtm"; + reg = <0x00 0x42040000 0x00 0x350>, + <0x00 0x42050000 0x00 0x350>; +- power-domains = <&k3_pds 154 TI_SCI_PD_SHARED>; ++ power-domains = <&k3_pds 243 TI_SCI_PD_SHARED>; + #thermal-sensor-cells = <1>; + }; + +-- +2.43.0 + diff --git a/queue-6.8/arm64-dts-ti-k3-j784s4-main-fix-mux-reg-masks-in-ser.patch b/queue-6.8/arm64-dts-ti-k3-j784s4-main-fix-mux-reg-masks-in-ser.patch new file mode 100644 index 00000000000..64feac5ecd3 --- /dev/null +++ b/queue-6.8/arm64-dts-ti-k3-j784s4-main-fix-mux-reg-masks-in-ser.patch @@ -0,0 +1,49 @@ +From 5e39efd86b09b5742ee16ddc99b1476c309fca5b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 13:33:48 +0530 +Subject: arm64: dts: ti: k3-j784s4-main: Fix mux-reg-masks in serdes_ln_ctrl + +From: Chintan Vankar + +[ Upstream commit 9a0c0a9baa2d1f906589d715f9baeab93e7fcdcb ] + +Change offset in mux-reg-masks property for serdes_ln_ctrl node +since reg-mux property is used in compatible. + +Fixes: 2765149273f4 ("mux: mmio: use reg property when parent device is not a syscon") +Signed-off-by: Chintan Vankar +Acked-by: Andrew Davis +Signed-off-by: Siddharth Vadapalli +Link: https://lore.kernel.org/r/20240213080348.248916-1-s-vadapalli@ti.com +Signed-off-by: Vignesh Raghavendra +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi b/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +index f2b720ed1e4f2..56c8eaad6324b 100644 +--- a/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi ++++ b/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +@@ -52,12 +52,12 @@ serdes_ln_ctrl: mux-controller@4080 { + compatible = "reg-mux"; + reg = <0x00004080 0x30>; + #mux-control-cells = <1>; +- mux-reg-masks = <0x4080 0x3>, <0x4084 0x3>, /* SERDES0 lane0/1 select */ +- <0x4088 0x3>, <0x408c 0x3>, /* SERDES0 lane2/3 select */ +- <0x4090 0x3>, <0x4094 0x3>, /* SERDES1 lane0/1 select */ +- <0x4098 0x3>, <0x409c 0x3>, /* SERDES1 lane2/3 select */ +- <0x40a0 0x3>, <0x40a4 0x3>, /* SERDES2 lane0/1 select */ +- <0x40a8 0x3>, <0x40ac 0x3>; /* SERDES2 lane2/3 select */ ++ mux-reg-masks = <0x0 0x3>, <0x4 0x3>, /* SERDES0 lane0/1 select */ ++ <0x8 0x3>, <0xc 0x3>, /* SERDES0 lane2/3 select */ ++ <0x10 0x3>, <0x14 0x3>, /* SERDES1 lane0/1 select */ ++ <0x18 0x3>, <0x1c 0x3>, /* SERDES1 lane2/3 select */ ++ <0x20 0x3>, <0x24 0x3>, /* SERDES2 lane0/1 select */ ++ <0x28 0x3>, <0x2c 0x3>; /* SERDES2 lane2/3 select */ + idle-states = , + , + , +-- +2.43.0 + diff --git a/queue-6.8/arm64-ftrace-don-t-forbid-call_ops-cc_optimize_for_s.patch b/queue-6.8/arm64-ftrace-don-t-forbid-call_ops-cc_optimize_for_s.patch new file mode 100644 index 00000000000..de0a2cb6118 --- /dev/null +++ b/queue-6.8/arm64-ftrace-don-t-forbid-call_ops-cc_optimize_for_s.patch @@ -0,0 +1,52 @@ +From da2c494d0bd711f5f1c87761fcf062e53f1bf3c7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Feb 2024 22:40:29 -0800 +Subject: arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang + +From: Stephen Boyd + +[ Upstream commit a743f26d03a96593c0f3d05dc26b388f45de67c9 ] + +Per commit b3f11af9b2ce ("arm64: ftrace: forbid CALL_OPS with +CC_OPTIMIZE_FOR_SIZE"), GCC is silently ignoring `-falign-functions=N` +when passed `-Os`, causing functions to be improperly aligned. This +doesn't seem to be a problem with Clang though, where enabling CALL_OPS +with CC_OPTIMIZE_FOR_SIZE doesn't spit out any warnings at boot about +misaligned patch-sites. Only forbid CALL_OPS if GCC is used and we're +optimizing for size so that CALL_OPS can be used with clang optimizing +for size. + +Cc: Jason Ling +Cc: Florian Fainelli +Cc: Mark Rutland +Cc: Nathan Chancellor +Cc: Nick Desaulniers +Cc: Bill Wendling +Cc: Justin Stitt +Cc: llvm@lists.linux.dev +Fixes: b3f11af9b2ce ("arm64: ftrace: forbid CALL_OPS with CC_OPTIMIZE_FOR_SIZE") +Signed-off-by: Stephen Boyd +Reviewed-by: Nathan Chancellor +Link: https://lore.kernel.org/r/20240223064032.3463229-1-swboyd@chromium.org +Signed-off-by: Catalin Marinas +Signed-off-by: Sasha Levin +--- + arch/arm64/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index aa7c1d4351396..6b96d75a3a3d8 100644 +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -198,7 +198,7 @@ config ARM64 + if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS + select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \ + if (DYNAMIC_FTRACE_WITH_ARGS && !CFI_CLANG && \ +- !CC_OPTIMIZE_FOR_SIZE) ++ (CC_IS_CLANG || !CC_OPTIMIZE_FOR_SIZE)) + select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \ + if DYNAMIC_FTRACE_WITH_ARGS + select HAVE_SAMPLE_FTRACE_DIRECT +-- +2.43.0 + diff --git a/queue-6.8/asoc-amd-acp-add-missing-error-handling-in-sof-mach.patch b/queue-6.8/asoc-amd-acp-add-missing-error-handling-in-sof-mach.patch new file mode 100644 index 00000000000..449a80e7676 --- /dev/null +++ b/queue-6.8/asoc-amd-acp-add-missing-error-handling-in-sof-mach.patch @@ -0,0 +1,54 @@ +From 4cacb276df958f29e3e9175952d986f9bcd393ac Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Dec 2023 05:07:21 +0200 +Subject: ASoC: amd: acp: Add missing error handling in sof-mach + +From: Cristian Ciocaltea + +[ Upstream commit d0ada20279db2649a7549a2b8a4a3379c59f238d ] + +Handle potential acp_sofdsp_dai_links_create() errors in ACP SOF machine +driver's probe function. Note there is no need for an undo. + +While at it, switch to dev_err_probe(). + +Fixes: 9f84940f5004 ("ASoC: amd: acp: Add SOF audio support on Chrome board") +Signed-off-by: Cristian Ciocaltea +Reviewed-by: Emil Velikov +Link: https://msgid.link/r/20231219030728.2431640-4-cristian.ciocaltea@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/amd/acp/acp-sof-mach.c | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/amd/acp/acp-sof-mach.c b/sound/soc/amd/acp/acp-sof-mach.c +index 20b94814a0462..b86f65d420054 100644 +--- a/sound/soc/amd/acp/acp-sof-mach.c ++++ b/sound/soc/amd/acp/acp-sof-mach.c +@@ -126,16 +126,14 @@ static int acp_sof_probe(struct platform_device *pdev) + if (dmi_id && dmi_id->driver_data) + acp_card_drvdata->tdm_mode = dmi_id->driver_data; + +- acp_sofdsp_dai_links_create(card); ++ ret = acp_sofdsp_dai_links_create(card); ++ if (ret) ++ return dev_err_probe(&pdev->dev, ret, "Failed to create DAI links\n"); + + ret = devm_snd_soc_register_card(&pdev->dev, card); +- if (ret) { +- dev_err(&pdev->dev, +- "devm_snd_soc_register_card(%s) failed: %d\n", +- card->name, ret); +- return ret; +- } +- ++ if (ret) ++ return dev_err_probe(&pdev->dev, ret, ++ "Failed to register card(%s)\n", card->name); + return 0; + } + +-- +2.43.0 + diff --git a/queue-6.8/asoc-intel-ssp-common-add-stub-for-sof_ssp_get_codec.patch b/queue-6.8/asoc-intel-ssp-common-add-stub-for-sof_ssp_get_codec.patch new file mode 100644 index 00000000000..63096fa0d59 --- /dev/null +++ b/queue-6.8/asoc-intel-ssp-common-add-stub-for-sof_ssp_get_codec.patch @@ -0,0 +1,49 @@ +From a9fddc2c986dbb5123c3f513f06a6c93846d2316 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Feb 2024 10:55:41 -0600 +Subject: ASoC: Intel: ssp-common: Add stub for sof_ssp_get_codec_name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Charles Keepax + +[ Upstream commit c1469c3a8a306e5f1eab1ae9585640d08e183f87 ] + +As this function is now used in sof_board_helpers it requires a build +stub for the case SSP_COMMON is not built in. + +Fixes: ba0c7c328762 ("ASoC: Intel: board_helpers: support amp link initialization") +Reviewed-by: Bard Liao +Reviewed-by: Péter Ujfalusi +Signed-off-by: Charles Keepax +Signed-off-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20240208165545.93811-21-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/sof_ssp_common.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/sound/soc/intel/boards/sof_ssp_common.h b/sound/soc/intel/boards/sof_ssp_common.h +index 6d827103479b5..d24888bc99fde 100644 +--- a/sound/soc/intel/boards/sof_ssp_common.h ++++ b/sound/soc/intel/boards/sof_ssp_common.h +@@ -67,6 +67,14 @@ enum sof_ssp_codec { + + enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev); + enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev); ++ ++#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SOF_SSP_COMMON) + const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type); ++#else ++static inline const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type) ++{ ++ return NULL; ++} ++#endif + + #endif /* __SOF_SSP_COMMON_H */ +-- +2.43.0 + diff --git a/queue-6.8/asoc-meson-aiu-fix-function-pointer-type-mismatch.patch b/queue-6.8/asoc-meson-aiu-fix-function-pointer-type-mismatch.patch new file mode 100644 index 00000000000..0b8e78206db --- /dev/null +++ b/queue-6.8/asoc-meson-aiu-fix-function-pointer-type-mismatch.patch @@ -0,0 +1,85 @@ +From 6e6b1908d9256b4388bd15bdc8fb20729840361b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 22:58:03 +0100 +Subject: ASoC: meson: aiu: fix function pointer type mismatch + +From: Jerome Brunet + +[ Upstream commit 98ac85a00f31d2e9d5452b825a9ed0153d934043 ] + +clang-16 warns about casting functions to incompatible types, as is done +here to call clk_disable_unprepare: + +sound/soc/meson/aiu.c:243:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] + 243 | (void(*)(void *))clk_disable_unprepare, + +The pattern of getting, enabling and setting a disable callback for a +clock can be replaced with devm_clk_get_enabled(), which also fixes +this warning. + +Fixes: 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support") +Reported-by: Arnd Bergmann +Signed-off-by: Jerome Brunet +Reviewed-by: Justin Stitt +Link: https://msgid.link/r/20240213215807.3326688-2-jbrunet@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/meson/aiu.c | 19 ++++--------------- + sound/soc/meson/aiu.h | 1 - + 2 files changed, 4 insertions(+), 16 deletions(-) + +diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c +index 7109b81cc3d0a..5d1419ed7a62d 100644 +--- a/sound/soc/meson/aiu.c ++++ b/sound/soc/meson/aiu.c +@@ -212,11 +212,12 @@ static const char * const aiu_spdif_ids[] = { + static int aiu_clk_get(struct device *dev) + { + struct aiu *aiu = dev_get_drvdata(dev); ++ struct clk *pclk; + int ret; + +- aiu->pclk = devm_clk_get(dev, "pclk"); +- if (IS_ERR(aiu->pclk)) +- return dev_err_probe(dev, PTR_ERR(aiu->pclk), "Can't get the aiu pclk\n"); ++ pclk = devm_clk_get_enabled(dev, "pclk"); ++ if (IS_ERR(pclk)) ++ return dev_err_probe(dev, PTR_ERR(pclk), "Can't get the aiu pclk\n"); + + aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk"); + if (IS_ERR(aiu->spdif_mclk)) +@@ -233,18 +234,6 @@ static int aiu_clk_get(struct device *dev) + if (ret) + return dev_err_probe(dev, ret, "Can't get the spdif clocks\n"); + +- ret = clk_prepare_enable(aiu->pclk); +- if (ret) { +- dev_err(dev, "peripheral clock enable failed\n"); +- return ret; +- } +- +- ret = devm_add_action_or_reset(dev, +- (void(*)(void *))clk_disable_unprepare, +- aiu->pclk); +- if (ret) +- dev_err(dev, "failed to add reset action on pclk"); +- + return ret; + } + +diff --git a/sound/soc/meson/aiu.h b/sound/soc/meson/aiu.h +index 393b6c2307e49..0f94c8bf60818 100644 +--- a/sound/soc/meson/aiu.h ++++ b/sound/soc/meson/aiu.h +@@ -33,7 +33,6 @@ struct aiu_platform_data { + }; + + struct aiu { +- struct clk *pclk; + struct clk *spdif_mclk; + struct aiu_interface i2s; + struct aiu_interface spdif; +-- +2.43.0 + diff --git a/queue-6.8/asoc-meson-axg-tdm-interface-add-frame-rate-constrai.patch b/queue-6.8/asoc-meson-axg-tdm-interface-add-frame-rate-constrai.patch new file mode 100644 index 00000000000..ca5abb0dc8d --- /dev/null +++ b/queue-6.8/asoc-meson-axg-tdm-interface-add-frame-rate-constrai.patch @@ -0,0 +1,86 @@ +From 2a371930f1b31b24f4928f13cf47c94c96ee5415 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Feb 2024 18:51:08 +0100 +Subject: ASoC: meson: axg-tdm-interface: add frame rate constraint + +From: Jerome Brunet + +[ Upstream commit 59c6a3a43b221cc2a211181b1298e43b2c2df782 ] + +According to Amlogic datasheets for the SoCs supported by this driver, the +maximum bit clock rate is 100MHz. + +The tdm interface allows the rates listed by the DAI driver, regardless of +the number slots or their width. However, these will impact the bit clock +rate. + +Hitting the 100MHz limit is very unlikely for most use cases but it is +possible. + +For example with 32 slots / 32 bits wide, the maximum rate is no longer +384kHz but ~96kHz. + +Add the constraint accordingly if the component is not already active. +If it is active, the rate is already constrained by the first stream rate. + +Fixes: d60e4f1e4be5 ("ASoC: meson: add tdm interface driver") +Signed-off-by: Jerome Brunet +Link: https://msgid.link/r/20240223175116.2005407-3-jbrunet@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/meson/axg-tdm-interface.c | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c +index cd5168e826df4..2cedbce738373 100644 +--- a/sound/soc/meson/axg-tdm-interface.c ++++ b/sound/soc/meson/axg-tdm-interface.c +@@ -12,6 +12,9 @@ + + #include "axg-tdm.h" + ++/* Maximum bit clock frequency according the datasheets */ ++#define MAX_SCLK 100000000 /* Hz */ ++ + enum { + TDM_IFACE_PAD, + TDM_IFACE_LOOPBACK, +@@ -153,19 +156,27 @@ static int axg_tdm_iface_startup(struct snd_pcm_substream *substream, + return -EINVAL; + } + +- /* Apply component wide rate symmetry */ + if (snd_soc_component_active(dai->component)) { ++ /* Apply component wide rate symmetry */ + ret = snd_pcm_hw_constraint_single(substream->runtime, + SNDRV_PCM_HW_PARAM_RATE, + iface->rate); +- if (ret < 0) { +- dev_err(dai->dev, +- "can't set iface rate constraint\n"); +- return ret; +- } ++ ++ } else { ++ /* Limit rate according to the slot number and width */ ++ unsigned int max_rate = ++ MAX_SCLK / (iface->slots * iface->slot_width); ++ ret = snd_pcm_hw_constraint_minmax(substream->runtime, ++ SNDRV_PCM_HW_PARAM_RATE, ++ 0, max_rate); + } + +- return 0; ++ if (ret < 0) ++ dev_err(dai->dev, "can't set iface rate constraint\n"); ++ else ++ ret = 0; ++ ++ return ret; + } + + static int axg_tdm_iface_set_stream(struct snd_pcm_substream *substream, +-- +2.43.0 + diff --git a/queue-6.8/asoc-meson-axg-tdm-interface-fix-mclk-setup-without-.patch b/queue-6.8/asoc-meson-axg-tdm-interface-fix-mclk-setup-without-.patch new file mode 100644 index 00000000000..1f6a4413816 --- /dev/null +++ b/queue-6.8/asoc-meson-axg-tdm-interface-fix-mclk-setup-without-.patch @@ -0,0 +1,49 @@ +From c5ed03da79c81be070abcf1b829ae68e5b9aba6a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Feb 2024 18:51:07 +0100 +Subject: ASoC: meson: axg-tdm-interface: fix mclk setup without mclk-fs + +From: Jerome Brunet + +[ Upstream commit e3741a8d28a1137f8b19ae6f3d6e3be69a454a0a ] + +By default, when mclk-fs is not provided, the tdm-interface driver +requests an MCLK that is 4x the bit clock, SCLK. + +However there is no justification for this: + +* If the codec needs MCLK for its operation, mclk-fs is expected to be set + according to the codec requirements. +* If the codec does not need MCLK the minimum is 2 * SCLK, because this is + minimum the divider between SCLK and MCLK can do. + +Multiplying by 4 may cause problems because the PLL limit may be reached +sooner than it should, so use 2x instead. + +Fixes: d60e4f1e4be5 ("ASoC: meson: add tdm interface driver") +Signed-off-by: Jerome Brunet +Link: https://msgid.link/r/20240223175116.2005407-2-jbrunet@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/meson/axg-tdm-interface.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c +index 1c3d433cefd23..cd5168e826df4 100644 +--- a/sound/soc/meson/axg-tdm-interface.c ++++ b/sound/soc/meson/axg-tdm-interface.c +@@ -264,8 +264,8 @@ static int axg_tdm_iface_set_sclk(struct snd_soc_dai *dai, + srate = iface->slots * iface->slot_width * params_rate(params); + + if (!iface->mclk_rate) { +- /* If no specific mclk is requested, default to bit clock * 4 */ +- clk_set_rate(iface->mclk, 4 * srate); ++ /* If no specific mclk is requested, default to bit clock * 2 */ ++ clk_set_rate(iface->mclk, 2 * srate); + } else { + /* Check if we can actually get the bit clock from mclk */ + if (iface->mclk_rate % srate) { +-- +2.43.0 + diff --git a/queue-6.8/asoc-meson-t9015-fix-function-pointer-type-mismatch.patch b/queue-6.8/asoc-meson-t9015-fix-function-pointer-type-mismatch.patch new file mode 100644 index 00000000000..d91793967a0 --- /dev/null +++ b/queue-6.8/asoc-meson-t9015-fix-function-pointer-type-mismatch.patch @@ -0,0 +1,83 @@ +From 1e1b885ee72c149d6c9c26c03bd16154aaf99e49 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 22:58:04 +0100 +Subject: ASoC: meson: t9015: fix function pointer type mismatch + +From: Jerome Brunet + +[ Upstream commit 5ad992c71b6a8e8a547954addc7af9fbde6ca10a ] + +clang-16 warns about casting functions to incompatible types, as is done +here to call clk_disable_unprepare: + +sound/soc/meson/t9015.c:274:4: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] + 274 | (void(*)(void *))clk_disable_unprepare, + +The pattern of getting, enabling and setting a disable callback for a +clock can be replaced with devm_clk_get_enabled(), which also fixes +this warning. + +Fixes: 33901f5b9b16 ("ASoC: meson: add t9015 internal DAC driver") +Reported-by: Arnd Bergmann +Signed-off-by: Jerome Brunet +Reviewed-by: Justin Stitt +Link: https://msgid.link/r/20240213215807.3326688-3-jbrunet@baylibre.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/meson/t9015.c | 20 ++++---------------- + 1 file changed, 4 insertions(+), 16 deletions(-) + +diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c +index 9c6b4dac68932..571f65788c592 100644 +--- a/sound/soc/meson/t9015.c ++++ b/sound/soc/meson/t9015.c +@@ -48,7 +48,6 @@ + #define POWER_CFG 0x10 + + struct t9015 { +- struct clk *pclk; + struct regulator *avdd; + }; + +@@ -249,6 +248,7 @@ static int t9015_probe(struct platform_device *pdev) + struct t9015 *priv; + void __iomem *regs; + struct regmap *regmap; ++ struct clk *pclk; + int ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); +@@ -256,26 +256,14 @@ static int t9015_probe(struct platform_device *pdev) + return -ENOMEM; + platform_set_drvdata(pdev, priv); + +- priv->pclk = devm_clk_get(dev, "pclk"); +- if (IS_ERR(priv->pclk)) +- return dev_err_probe(dev, PTR_ERR(priv->pclk), "failed to get core clock\n"); ++ pclk = devm_clk_get_enabled(dev, "pclk"); ++ if (IS_ERR(pclk)) ++ return dev_err_probe(dev, PTR_ERR(pclk), "failed to get core clock\n"); + + priv->avdd = devm_regulator_get(dev, "AVDD"); + if (IS_ERR(priv->avdd)) + return dev_err_probe(dev, PTR_ERR(priv->avdd), "failed to AVDD\n"); + +- ret = clk_prepare_enable(priv->pclk); +- if (ret) { +- dev_err(dev, "core clock enable failed\n"); +- return ret; +- } +- +- ret = devm_add_action_or_reset(dev, +- (void(*)(void *))clk_disable_unprepare, +- priv->pclk); +- if (ret) +- return ret; +- + ret = device_reset(dev); + if (ret) { + dev_err(dev, "reset failed\n"); +-- +2.43.0 + diff --git a/queue-6.8/asoc-sh-rz-ssi-fix-error-message-print.patch b/queue-6.8/asoc-sh-rz-ssi-fix-error-message-print.patch new file mode 100644 index 00000000000..121e0806631 --- /dev/null +++ b/queue-6.8/asoc-sh-rz-ssi-fix-error-message-print.patch @@ -0,0 +1,39 @@ +From b1fb5dee386913912efa7e61d6611ac128411397 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jan 2024 15:08:22 +0000 +Subject: ASoC: sh: rz-ssi: Fix error message print + +From: Lad Prabhakar + +[ Upstream commit 9a6d7c4fb2801b675a9c31a7ceb78c84b8c439bc ] + +The devm_request_irq() call is done for "dma_rt" interrupt but the error +message printed "dma_tx" interrupt on failure, fix this by updating +dma_tx -> dma_rt in dev_err_probe() message. While at it aligned the code. + +Signed-off-by: Lad Prabhakar +Fixes: 38c042b59af0248a ("ASoC: sh: rz-ssi: Update interrupt handling for half duplex channels") +Reviewed-by: Geert Uytterhoeven +Link: https://msgid.link/r/20240130150822.327434-1-prabhakar.mahadev-lad.rj@bp.renesas.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sh/rz-ssi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c +index 14cf1a41fb0d1..9d103646973ad 100644 +--- a/sound/soc/sh/rz-ssi.c ++++ b/sound/soc/sh/rz-ssi.c +@@ -1015,7 +1015,7 @@ static int rz_ssi_probe(struct platform_device *pdev) + dev_name(&pdev->dev), ssi); + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, +- "irq request error (dma_tx)\n"); ++ "irq request error (dma_rt)\n"); + } else { + if (ssi->irq_tx < 0) + return ssi->irq_tx; +-- +2.43.0 + diff --git a/queue-6.8/asoc-sof-add-some-bounds-checking-to-firmware-data.patch b/queue-6.8/asoc-sof-add-some-bounds-checking-to-firmware-data.patch new file mode 100644 index 00000000000..c9d9a47b86c --- /dev/null +++ b/queue-6.8/asoc-sof-add-some-bounds-checking-to-firmware-data.patch @@ -0,0 +1,39 @@ +From e48b4b23fcf14a4a290317d374725bda8b56387c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Feb 2024 16:02:16 +0300 +Subject: ASoC: SOF: Add some bounds checking to firmware data + +From: Dan Carpenter + +[ Upstream commit 98f681b0f84cfc3a1d83287b77697679e0398306 ] + +Smatch complains about "head->full_size - head->header_size" can +underflow. To some extent, we're always going to have to trust the +firmware a bit. However, it's easy enough to add a check for negatives, +and let's add a upper bounds check as well. + +Fixes: d2458baa799f ("ASoC: SOF: ipc3-loader: Implement firmware parsing and loading") +Signed-off-by: Dan Carpenter +Link: https://msgid.link/r/5593d147-058c-4de3-a6f5-540ecb96f6f8@moroto.mountain +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/ipc3-loader.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/sof/ipc3-loader.c b/sound/soc/sof/ipc3-loader.c +index 28218766d2114..6e3ef06721106 100644 +--- a/sound/soc/sof/ipc3-loader.c ++++ b/sound/soc/sof/ipc3-loader.c +@@ -148,6 +148,8 @@ static size_t sof_ipc3_fw_parse_ext_man(struct snd_sof_dev *sdev) + + head = (struct sof_ext_man_header *)fw->data; + remaining = head->full_size - head->header_size; ++ if (remaining < 0 || remaining > sdev->basefw.fw->size) ++ return -EINVAL; + ext_man_size = ipc3_fw_ext_man_size(sdev, fw); + + /* Assert firmware starts with extended manifest */ +-- +2.43.0 + diff --git a/queue-6.8/asoc-sof-amd-compute-file-paths-on-firmware-load.patch b/queue-6.8/asoc-sof-amd-compute-file-paths-on-firmware-load.patch new file mode 100644 index 00000000000..7315ee1a602 --- /dev/null +++ b/queue-6.8/asoc-sof-amd-compute-file-paths-on-firmware-load.patch @@ -0,0 +1,141 @@ +From 54fd47ca0e51a12365f737d6a962e70b9fba19a9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Dec 2023 05:07:26 +0200 +Subject: ASoC: SOF: amd: Compute file paths on firmware load + +From: Cristian Ciocaltea + +[ Upstream commit d9cacc1a2af2e1cd781b5cd2a3e57fbde64f5a2d ] + +Commit 6c393ebbd74a ("ASoC: SOF: core: Implement IPC version fallback if +firmware files are missing") changed the order of some operations and +the firmware paths are not available anymore at snd_sof_probe() time. + +Precisely, fw_filename_prefix is set by sof_select_ipc_and_paths() via + + plat_data->fw_filename_prefix = out_profile.fw_path; + +but sof_init_environment() which calls this function was moved from +snd_sof_device_probe() to sof_probe_continue(). Moreover, +snd_sof_probe() was moved from sof_probe_continue() to +sof_init_environment(), but before the call to +sof_select_ipc_and_paths(). + +The problem here is that amd_sof_acp_probe() uses fw_filename_prefix to +compute fw_code_bin and fw_data_bin paths, and because the field is not +yet initialized, the paths end up containing (null): + +snd_sof_amd_vangogh 0000:04:00.5: Direct firmware load for (null)/sof-vangogh-code.bin failed with error -2 +snd_sof_amd_vangogh 0000:04:00.5: sof signed firmware code bin is missing +snd_sof_amd_vangogh 0000:04:00.5: error: failed to load DSP firmware -2 +snd_sof_amd_vangogh: probe of 0000:04:00.5 failed with error -2 + +Move usage of fw_filename_prefix right before request_firmware() calls +in acp_sof_load_signed_firmware(). + +Fixes: 6c393ebbd74a ("ASoC: SOF: core: Implement IPC version fallback if firmware files are missing") +Signed-off-by: Cristian Ciocaltea +Reviewed-by: Emil Velikov +Link: https://msgid.link/r/20231219030728.2431640-9-cristian.ciocaltea@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/amd/acp-loader.c | 32 ++++++++++++++++++++++++++------ + sound/soc/sof/amd/acp.c | 7 ++----- + 2 files changed, 28 insertions(+), 11 deletions(-) + +diff --git a/sound/soc/sof/amd/acp-loader.c b/sound/soc/sof/amd/acp-loader.c +index e05eb7a86dd44..d2d21478399e0 100644 +--- a/sound/soc/sof/amd/acp-loader.c ++++ b/sound/soc/sof/amd/acp-loader.c +@@ -267,29 +267,49 @@ int acp_sof_load_signed_firmware(struct snd_sof_dev *sdev) + { + struct snd_sof_pdata *plat_data = sdev->pdata; + struct acp_dev_data *adata = plat_data->hw_pdata; ++ const char *fw_filename; + int ret; + +- ret = request_firmware(&sdev->basefw.fw, adata->fw_code_bin, sdev->dev); ++ fw_filename = kasprintf(GFP_KERNEL, "%s/%s", ++ plat_data->fw_filename_prefix, ++ adata->fw_code_bin); ++ if (!fw_filename) ++ return -ENOMEM; ++ ++ ret = request_firmware(&sdev->basefw.fw, fw_filename, sdev->dev); + if (ret < 0) { ++ kfree(fw_filename); + dev_err(sdev->dev, "sof signed firmware code bin is missing\n"); + return ret; + } else { +- dev_dbg(sdev->dev, "request_firmware %s successful\n", adata->fw_code_bin); ++ dev_dbg(sdev->dev, "request_firmware %s successful\n", fw_filename); + } ++ kfree(fw_filename); ++ + ret = snd_sof_dsp_block_write(sdev, SOF_FW_BLK_TYPE_IRAM, 0, +- (void *)sdev->basefw.fw->data, sdev->basefw.fw->size); ++ (void *)sdev->basefw.fw->data, ++ sdev->basefw.fw->size); ++ ++ fw_filename = kasprintf(GFP_KERNEL, "%s/%s", ++ plat_data->fw_filename_prefix, ++ adata->fw_data_bin); ++ if (!fw_filename) ++ return -ENOMEM; + +- ret = request_firmware(&adata->fw_dbin, adata->fw_data_bin, sdev->dev); ++ ret = request_firmware(&adata->fw_dbin, fw_filename, sdev->dev); + if (ret < 0) { ++ kfree(fw_filename); + dev_err(sdev->dev, "sof signed firmware data bin is missing\n"); + return ret; + + } else { +- dev_dbg(sdev->dev, "request_firmware %s successful\n", adata->fw_data_bin); ++ dev_dbg(sdev->dev, "request_firmware %s successful\n", fw_filename); + } ++ kfree(fw_filename); + + ret = snd_sof_dsp_block_write(sdev, SOF_FW_BLK_TYPE_DRAM, 0, +- (void *)adata->fw_dbin->data, adata->fw_dbin->size); ++ (void *)adata->fw_dbin->data, ++ adata->fw_dbin->size); + return ret; + } + EXPORT_SYMBOL_NS(acp_sof_load_signed_firmware, SND_SOC_SOF_AMD_COMMON); +diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c +index 9aa9600c05d61..9794d64a110fd 100644 +--- a/sound/soc/sof/amd/acp.c ++++ b/sound/soc/sof/amd/acp.c +@@ -493,7 +493,6 @@ EXPORT_SYMBOL_NS(amd_sof_acp_resume, SND_SOC_SOF_AMD_COMMON); + int amd_sof_acp_probe(struct snd_sof_dev *sdev) + { + struct pci_dev *pci = to_pci_dev(sdev->dev); +- struct snd_sof_pdata *plat_data = sdev->pdata; + struct acp_dev_data *adata; + const struct sof_amd_acp_desc *chip; + const struct dmi_system_id *dmi_id; +@@ -561,8 +560,7 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) + dmi_id = dmi_first_match(acp_sof_quirk_table); + if (dmi_id && dmi_id->driver_data) { + adata->fw_code_bin = devm_kasprintf(sdev->dev, GFP_KERNEL, +- "%s/sof-%s-code.bin", +- plat_data->fw_filename_prefix, ++ "sof-%s-code.bin", + chip->name); + if (!adata->fw_code_bin) { + ret = -ENOMEM; +@@ -570,8 +568,7 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) + } + + adata->fw_data_bin = devm_kasprintf(sdev->dev, GFP_KERNEL, +- "%s/sof-%s-data.bin", +- plat_data->fw_filename_prefix, ++ "sof-%s-data.bin", + chip->name); + if (!adata->fw_data_bin) { + ret = -ENOMEM; +-- +2.43.0 + diff --git a/queue-6.8/asoc-sof-amd-fix-memory-leak-in-amd_sof_acp_probe.patch b/queue-6.8/asoc-sof-amd-fix-memory-leak-in-amd_sof_acp_probe.patch new file mode 100644 index 00000000000..112c864e23c --- /dev/null +++ b/queue-6.8/asoc-sof-amd-fix-memory-leak-in-amd_sof_acp_probe.patch @@ -0,0 +1,70 @@ +From f01daa17ec1396e23357655c246fb0caad51d13b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Dec 2023 05:07:23 +0200 +Subject: ASoC: SOF: amd: Fix memory leak in amd_sof_acp_probe() + +From: Cristian Ciocaltea + +[ Upstream commit 222be59e5eed1554119294edc743ee548c2371d0 ] + +Driver uses kasprintf() to initialize fw_{code,data}_bin members of +struct acp_dev_data, but kfree() is never called to deallocate the +memory, which results in a memory leak. + +Fix the issue by switching to devm_kasprintf(). Additionally, ensure the +allocation was successful by checking the pointer validity. + +Fixes: f7da88003c53 ("ASoC: SOF: amd: Enable signed firmware image loading for Vangogh platform") +Signed-off-by: Cristian Ciocaltea +Reviewed-by: Emil Velikov +Link: https://msgid.link/r/20231219030728.2431640-6-cristian.ciocaltea@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/amd/acp.c | 28 +++++++++++++++++++--------- + 1 file changed, 19 insertions(+), 9 deletions(-) + +diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c +index 07632ae6ccf5e..9aa9600c05d61 100644 +--- a/sound/soc/sof/amd/acp.c ++++ b/sound/soc/sof/amd/acp.c +@@ -560,17 +560,27 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) + adata->signed_fw_image = false; + dmi_id = dmi_first_match(acp_sof_quirk_table); + if (dmi_id && dmi_id->driver_data) { +- adata->fw_code_bin = kasprintf(GFP_KERNEL, "%s/sof-%s-code.bin", +- plat_data->fw_filename_prefix, +- chip->name); +- adata->fw_data_bin = kasprintf(GFP_KERNEL, "%s/sof-%s-data.bin", +- plat_data->fw_filename_prefix, +- chip->name); +- adata->signed_fw_image = dmi_id->driver_data; ++ adata->fw_code_bin = devm_kasprintf(sdev->dev, GFP_KERNEL, ++ "%s/sof-%s-code.bin", ++ plat_data->fw_filename_prefix, ++ chip->name); ++ if (!adata->fw_code_bin) { ++ ret = -ENOMEM; ++ goto free_ipc_irq; ++ } ++ ++ adata->fw_data_bin = devm_kasprintf(sdev->dev, GFP_KERNEL, ++ "%s/sof-%s-data.bin", ++ plat_data->fw_filename_prefix, ++ chip->name); ++ if (!adata->fw_data_bin) { ++ ret = -ENOMEM; ++ goto free_ipc_irq; ++ } + +- dev_dbg(sdev->dev, "fw_code_bin:%s, fw_data_bin:%s\n", adata->fw_code_bin, +- adata->fw_data_bin); ++ adata->signed_fw_image = dmi_id->driver_data; + } ++ + adata->enable_fw_debug = enable_fw_debug; + acp_memory_init(sdev); + +-- +2.43.0 + diff --git a/queue-6.8/asoc-sof-core-skip-firmware-test-for-custom-loaders.patch b/queue-6.8/asoc-sof-core-skip-firmware-test-for-custom-loaders.patch new file mode 100644 index 00000000000..abbfe7a9214 --- /dev/null +++ b/queue-6.8/asoc-sof-core-skip-firmware-test-for-custom-loaders.patch @@ -0,0 +1,103 @@ +From e0c184e163223546a2fa489ebb1fe1aaa110ac16 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Dec 2023 05:07:25 +0200 +Subject: ASoC: SOF: core: Skip firmware test for custom loaders +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Cristian Ciocaltea + +[ Upstream commit 369b997a1371aeecd0a1fb0f9f4ef3747a1d07a4 ] + +The ACP driver for Vangogh platform uses a quirk for Valve Galileo +device to setup a custom firmware loader, which neither requires nor +uses the firmware file indicated via the default_fw_filename member of +struct sof_dev_desc. + +Since commit 6c393ebbd74a ("ASoC: SOF: core: Implement IPC version +fallback if firmware files are missing"), the provided filename gets +verified and triggers a fatal error on probe: + +[ 7.719337] snd_sof_amd_vangogh 0000:04:00.5: enabling device (0000 -> 0002) +[ 7.721486] snd_sof_amd_vangogh 0000:04:00.5: SOF firmware and/or topology file not found. +[ 7.721565] snd_sof_amd_vangogh 0000:04:00.5: Supported default profiles +[ 7.721569] snd_sof_amd_vangogh 0000:04:00.5: - ipc type 0 (Requested): +[ 7.721573] snd_sof_amd_vangogh 0000:04:00.5: Firmware file: amd/sof/sof-vangogh.ri +[ 7.721577] snd_sof_amd_vangogh 0000:04:00.5: Topology file: amd/sof-tplg/sof-vangogh-nau8821-max.tplg +[ 7.721582] snd_sof_amd_vangogh 0000:04:00.5: Check if you have 'sof-firmware' package installed. +[ 7.721585] snd_sof_amd_vangogh 0000:04:00.5: Optionally it can be manually downloaded from: +[ 7.721589] snd_sof_amd_vangogh 0000:04:00.5: https://github.com/thesofproject/sof-bin/ +[ 7.721997] snd_sof_amd_vangogh: probe of 0000:04:00.5 failed with error -2 + +According to AMD, a combined ".ri" file which includes the code and data +segments cannot be used due to a limitation preventing the code image to +be signed on build time. + +Fix the issue by skipping the firmware file test if a custom loader is +being used instead of the generic one. + +Fixes: 6c393ebbd74a ("ASoC: SOF: core: Implement IPC version fallback if firmware files are missing") +Co-developed-by: Péter Ujfalusi +Signed-off-by: Péter Ujfalusi +Signed-off-by: Cristian Ciocaltea +Link: https://msgid.link/r/20231219030728.2431640-8-cristian.ciocaltea@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sof/fw-file-profile.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/sof/fw-file-profile.c b/sound/soc/sof/fw-file-profile.c +index 138a1ca2c4a85..b56b14232444c 100644 +--- a/sound/soc/sof/fw-file-profile.c ++++ b/sound/soc/sof/fw-file-profile.c +@@ -89,6 +89,12 @@ static int sof_test_topology_file(struct device *dev, + return ret; + } + ++static bool sof_platform_uses_generic_loader(struct snd_sof_dev *sdev) ++{ ++ return (sdev->pdata->desc->ops->load_firmware == snd_sof_load_firmware_raw || ++ sdev->pdata->desc->ops->load_firmware == snd_sof_load_firmware_memcpy); ++} ++ + static int + sof_file_profile_for_ipc_type(struct snd_sof_dev *sdev, + enum sof_ipc_type ipc_type, +@@ -130,7 +136,8 @@ sof_file_profile_for_ipc_type(struct snd_sof_dev *sdev, + * For default path and firmware name do a verification before + * continuing further. + */ +- if (base_profile->fw_path || base_profile->fw_name) { ++ if ((base_profile->fw_path || base_profile->fw_name) && ++ sof_platform_uses_generic_loader(sdev)) { + ret = sof_test_firmware_file(dev, out_profile, &ipc_type); + if (ret) + return ret; +@@ -181,7 +188,8 @@ sof_file_profile_for_ipc_type(struct snd_sof_dev *sdev, + out_profile->ipc_type = ipc_type; + + /* Test only default firmware file */ +- if (!base_profile->fw_path && !base_profile->fw_name) ++ if ((!base_profile->fw_path && !base_profile->fw_name) && ++ sof_platform_uses_generic_loader(sdev)) + ret = sof_test_firmware_file(dev, out_profile, NULL); + + if (!ret) +@@ -267,7 +275,11 @@ static void sof_print_profile_info(struct snd_sof_dev *sdev, + + dev_info(dev, "Firmware paths/files for ipc type %d:\n", profile->ipc_type); + +- dev_info(dev, " Firmware file: %s/%s\n", profile->fw_path, profile->fw_name); ++ /* The firmware path is only valid when generic loader is used */ ++ if (sof_platform_uses_generic_loader(sdev)) ++ dev_info(dev, " Firmware file: %s/%s\n", ++ profile->fw_path, profile->fw_name); ++ + if (profile->fw_lib_path) + dev_info(dev, " Firmware lib path: %s\n", profile->fw_lib_path); + dev_info(dev, " Topology file: %s/%s\n", profile->tplg_path, profile->tplg_name); +-- +2.43.0 + diff --git a/queue-6.8/backlight-da9052-fully-initialize-backlight_properti.patch b/queue-6.8/backlight-da9052-fully-initialize-backlight_properti.patch new file mode 100644 index 00000000000..068fbd0a848 --- /dev/null +++ b/queue-6.8/backlight-da9052-fully-initialize-backlight_properti.patch @@ -0,0 +1,37 @@ +From 2ea819fa166911fff96755b1114775aa459077d1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Feb 2024 15:35:24 +0000 +Subject: backlight: da9052: Fully initialize backlight_properties during probe + +From: Daniel Thompson + +[ Upstream commit 0285e9efaee8276305db5c52a59baf84e9731556 ] + +props is stack allocated and the fields that are not explcitly set +by the probe function need to be zeroed or we'll get undefined behaviour +(especially so power/blank states)! + +Fixes: 6ede3d832aaa ("backlight: add driver for DA9052/53 PMIC v1") +Signed-off-by: Daniel Thompson +Link: https://lore.kernel.org/r/20240220153532.76613-2-daniel.thompson@linaro.org +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/video/backlight/da9052_bl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c +index 1cdc8543310b4..b8ff7046510eb 100644 +--- a/drivers/video/backlight/da9052_bl.c ++++ b/drivers/video/backlight/da9052_bl.c +@@ -117,6 +117,7 @@ static int da9052_backlight_probe(struct platform_device *pdev) + wleds->led_reg = platform_get_device_id(pdev)->driver_data; + wleds->state = DA9052_WLEDS_OFF; + ++ memset(&props, 0, sizeof(struct backlight_properties)); + props.type = BACKLIGHT_RAW; + props.max_brightness = DA9052_MAX_BRIGHTNESS; + +-- +2.43.0 + diff --git a/queue-6.8/backlight-hx8357-fix-potential-null-pointer-derefere.patch b/queue-6.8/backlight-hx8357-fix-potential-null-pointer-derefere.patch new file mode 100644 index 00000000000..f5525f9e717 --- /dev/null +++ b/queue-6.8/backlight-hx8357-fix-potential-null-pointer-derefere.patch @@ -0,0 +1,48 @@ +From 04936e6820b559d4fde633e4a3559e3d829c4e87 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 14 Jan 2024 16:39:21 +0200 +Subject: backlight: hx8357: Fix potential NULL pointer dereference + +From: Andy Shevchenko + +[ Upstream commit b1ba8bcb2d1ffce11b308ce166c9cc28d989e3b9 ] + +The "im" pins are optional. Add missing check in the hx8357_probe(). + +Reported-by: Dan Carpenter +Closes: https://lore.kernel.org/r/642e1230-3358-4006-a17f-3f297897ae74@moroto.mountain +Fixes: 7d84a63a39b7 ("backlight: hx8357: Convert to agnostic GPIO API") +Signed-off-by: Andy Shevchenko +Reviewed-by: Daniel Thompson +Link: https://lore.kernel.org/r/20240114143921.550736-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/video/backlight/hx8357.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c +index d7298376cf74d..bf18337ff0c2c 100644 +--- a/drivers/video/backlight/hx8357.c ++++ b/drivers/video/backlight/hx8357.c +@@ -609,11 +609,13 @@ static int hx8357_probe(struct spi_device *spi) + lcd->im_pins = devm_gpiod_get_array_optional(dev, "im", GPIOD_OUT_LOW); + if (IS_ERR(lcd->im_pins)) + return dev_err_probe(dev, PTR_ERR(lcd->im_pins), "failed to request im GPIOs\n"); +- if (lcd->im_pins->ndescs < HX8357_NUM_IM_PINS) +- return dev_err_probe(dev, -EINVAL, "not enough im GPIOs\n"); ++ if (lcd->im_pins) { ++ if (lcd->im_pins->ndescs < HX8357_NUM_IM_PINS) ++ return dev_err_probe(dev, -EINVAL, "not enough im GPIOs\n"); + +- for (i = 0; i < HX8357_NUM_IM_PINS; i++) +- gpiod_set_consumer_name(lcd->im_pins->desc[i], "im_pins"); ++ for (i = 0; i < HX8357_NUM_IM_PINS; i++) ++ gpiod_set_consumer_name(lcd->im_pins->desc[i], "im_pins"); ++ } + + lcdev = devm_lcd_device_register(&spi->dev, "mxsfb", &spi->dev, lcd, + &hx8357_ops); +-- +2.43.0 + diff --git a/queue-6.8/backlight-ktz8866-correct-the-check-for-of_property_.patch b/queue-6.8/backlight-ktz8866-correct-the-check-for-of_property_.patch new file mode 100644 index 00000000000..97137c6945f --- /dev/null +++ b/queue-6.8/backlight-ktz8866-correct-the-check-for-of_property_.patch @@ -0,0 +1,53 @@ +From d105ac2627cd92bcf66fe1ffe8a462b474d79d99 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 29 Jan 2024 20:28:29 +0800 +Subject: backlight: ktz8866: Correct the check for of_property_read_u32 + +From: Jianhua Lu + +[ Upstream commit f1ac3c9825f99c93a9833beee6b78aa386e55b0b ] + +of_property_read_u32 returns 0 when success, so reverse the +return value to get the true value. + +Fixes: f8449c8f7355 ("backlight: ktz8866: Add support for Kinetic KTZ8866 backlight") +Signed-off-by: Jianhua Lu +Reviewed-by: Daniel Thompson +Link: https://lore.kernel.org/r/20240129122829.16248-1-lujianhua000@gmail.com +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/video/backlight/ktz8866.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c +index 9c980f2571ee3..014877b5a9848 100644 +--- a/drivers/video/backlight/ktz8866.c ++++ b/drivers/video/backlight/ktz8866.c +@@ -97,20 +97,20 @@ static void ktz8866_init(struct ktz8866 *ktz) + { + unsigned int val = 0; + +- if (of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) ++ if (!of_property_read_u32(ktz->client->dev.of_node, "current-num-sinks", &val)) + ktz8866_write(ktz, BL_EN, BIT(val) - 1); + else + /* Enable all 6 current sinks if the number of current sinks isn't specified. */ + ktz8866_write(ktz, BL_EN, BIT(6) - 1); + +- if (of_property_read_u32(ktz->client->dev.of_node, "kinetic,current-ramp-delay-ms", &val)) { ++ if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,current-ramp-delay-ms", &val)) { + if (val <= 128) + ktz8866_write(ktz, BL_CFG2, BIT(7) | (ilog2(val) << 3) | PWM_HYST); + else + ktz8866_write(ktz, BL_CFG2, BIT(7) | ((5 + val / 64) << 3) | PWM_HYST); + } + +- if (of_property_read_u32(ktz->client->dev.of_node, "kinetic,led-enable-ramp-delay-ms", &val)) { ++ if (!of_property_read_u32(ktz->client->dev.of_node, "kinetic,led-enable-ramp-delay-ms", &val)) { + if (val == 0) + ktz8866_write(ktz, BL_DIMMING, 0); + else { +-- +2.43.0 + diff --git a/queue-6.8/backlight-lm3630a-don-t-set-bl-props.brightness-in-g.patch b/queue-6.8/backlight-lm3630a-don-t-set-bl-props.brightness-in-g.patch new file mode 100644 index 00000000000..c168236b218 --- /dev/null +++ b/queue-6.8/backlight-lm3630a-don-t-set-bl-props.brightness-in-g.patch @@ -0,0 +1,77 @@ +From 6e3b0ee4cd620d5acf771309de51fd6ad15565c0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Feb 2024 00:11:20 +0100 +Subject: backlight: lm3630a: Don't set bl->props.brightness in get_brightness + +From: Luca Weiss + +[ Upstream commit 4bf7ddd2d2f0f8826f25f74c7eba4e2c323a1446 ] + +There's no need to set bl->props.brightness, the get_brightness function +is just supposed to return the current brightness and not touch the +struct. + +With that done we can also remove the 'goto out' and just return the +value. + +Fixes: 0c2a665a648e ("backlight: add Backlight driver for lm3630 chip") +Signed-off-by: Luca Weiss +Reviewed-by: Daniel Thompson +Link: https://lore.kernel.org/r/20240220-lm3630a-fixups-v1-2-9ca62f7e4a33@z3ntu.xyz +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/video/backlight/lm3630a_bl.c | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c +index 8e275275b808f..26ff4178cc161 100644 +--- a/drivers/video/backlight/lm3630a_bl.c ++++ b/drivers/video/backlight/lm3630a_bl.c +@@ -233,7 +233,7 @@ static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) + if (rval < 0) + goto out_i2c_err; + brightness |= rval; +- goto out; ++ return brightness; + } + + /* disable sleep */ +@@ -244,11 +244,8 @@ static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) + rval = lm3630a_read(pchip, REG_BRT_A); + if (rval < 0) + goto out_i2c_err; +- brightness = rval; ++ return rval; + +-out: +- bl->props.brightness = brightness; +- return bl->props.brightness; + out_i2c_err: + dev_err(pchip->dev, "i2c failed to access register\n"); + return 0; +@@ -310,7 +307,7 @@ static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) + if (rval < 0) + goto out_i2c_err; + brightness |= rval; +- goto out; ++ return brightness; + } + + /* disable sleep */ +@@ -321,11 +318,8 @@ static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) + rval = lm3630a_read(pchip, REG_BRT_B); + if (rval < 0) + goto out_i2c_err; +- brightness = rval; ++ return rval; + +-out: +- bl->props.brightness = brightness; +- return bl->props.brightness; + out_i2c_err: + dev_err(pchip->dev, "i2c failed to access register\n"); + return 0; +-- +2.43.0 + diff --git a/queue-6.8/backlight-lm3630a-initialize-backlight_properties-on.patch b/queue-6.8/backlight-lm3630a-initialize-backlight_properties-on.patch new file mode 100644 index 00000000000..3759eb754a9 --- /dev/null +++ b/queue-6.8/backlight-lm3630a-initialize-backlight_properties-on.patch @@ -0,0 +1,37 @@ +From 795c3ac192365d41824b10beed4680549919e1ac Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Feb 2024 00:11:19 +0100 +Subject: backlight: lm3630a: Initialize backlight_properties on init + +From: Luca Weiss + +[ Upstream commit ad9aeb0e3aa90ebdad5fabf9c21783740eb95907 ] + +The backlight_properties struct should be initialized to zero before +using, otherwise there will be some random values in the struct. + +Fixes: 0c2a665a648e ("backlight: add Backlight driver for lm3630 chip") +Signed-off-by: Luca Weiss +Reviewed-by: Daniel Thompson +Link: https://lore.kernel.org/r/20240220-lm3630a-fixups-v1-1-9ca62f7e4a33@z3ntu.xyz +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/video/backlight/lm3630a_bl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c +index a3412c936ca28..8e275275b808f 100644 +--- a/drivers/video/backlight/lm3630a_bl.c ++++ b/drivers/video/backlight/lm3630a_bl.c +@@ -343,6 +343,7 @@ static int lm3630a_backlight_register(struct lm3630a_chip *pchip) + struct backlight_properties props; + const char *label; + ++ memset(&props, 0, sizeof(struct backlight_properties)); + props.type = BACKLIGHT_RAW; + if (pdata->leda_ctrl != LM3630A_LEDA_DISABLE) { + props.brightness = pdata->leda_init_brt; +-- +2.43.0 + diff --git a/queue-6.8/backlight-lm3639-fully-initialize-backlight_properti.patch b/queue-6.8/backlight-lm3639-fully-initialize-backlight_properti.patch new file mode 100644 index 00000000000..1650571b055 --- /dev/null +++ b/queue-6.8/backlight-lm3639-fully-initialize-backlight_properti.patch @@ -0,0 +1,37 @@ +From 501861d0a1e5421fdac2b3ce36dbda950ee0eca8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Feb 2024 15:35:25 +0000 +Subject: backlight: lm3639: Fully initialize backlight_properties during probe + +From: Daniel Thompson + +[ Upstream commit abb5a5d951fbea3feb5c4ba179b89bb96a1d3462 ] + +props is stack allocated and the fields that are not explcitly set +by the probe function need to be zeroed or we'll get undefined behaviour +(especially so power/blank states)! + +Fixes: 0f59858d5119 ("backlight: add new lm3639 backlight driver") +Signed-off-by: Daniel Thompson +Link: https://lore.kernel.org/r/20240220153532.76613-3-daniel.thompson@linaro.org +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/video/backlight/lm3639_bl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c +index 5246c171497d6..564f62acd7211 100644 +--- a/drivers/video/backlight/lm3639_bl.c ++++ b/drivers/video/backlight/lm3639_bl.c +@@ -338,6 +338,7 @@ static int lm3639_probe(struct i2c_client *client) + } + + /* backlight */ ++ memset(&props, 0, sizeof(struct backlight_properties)); + props.type = BACKLIGHT_RAW; + props.brightness = pdata->init_brt_led; + props.max_brightness = pdata->max_brt_led; +-- +2.43.0 + diff --git a/queue-6.8/backlight-lp8788-fully-initialize-backlight_properti.patch b/queue-6.8/backlight-lp8788-fully-initialize-backlight_properti.patch new file mode 100644 index 00000000000..13fa039f53b --- /dev/null +++ b/queue-6.8/backlight-lp8788-fully-initialize-backlight_properti.patch @@ -0,0 +1,37 @@ +From ba39e23018e177fa555e72a664158b13015d5c33 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Feb 2024 15:35:26 +0000 +Subject: backlight: lp8788: Fully initialize backlight_properties during probe + +From: Daniel Thompson + +[ Upstream commit 392346827fbe8a7fd573dfb145170d7949f639a6 ] + +props is stack allocated and the fields that are not explcitly set +by the probe function need to be zeroed or we'll get undefined behaviour +(especially so power/blank states)! + +Fixes: c5a51053cf3b ("backlight: add new lp8788 backlight driver") +Signed-off-by: Daniel Thompson +Link: https://lore.kernel.org/r/20240220153532.76613-4-daniel.thompson@linaro.org +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/video/backlight/lp8788_bl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c +index d1a14b0db265b..31f97230ee506 100644 +--- a/drivers/video/backlight/lp8788_bl.c ++++ b/drivers/video/backlight/lp8788_bl.c +@@ -191,6 +191,7 @@ static int lp8788_backlight_register(struct lp8788_bl *bl) + int init_brt; + char *name; + ++ memset(&props, 0, sizeof(struct backlight_properties)); + props.type = BACKLIGHT_PLATFORM; + props.max_brightness = MAX_BRIGHTNESS; + +-- +2.43.0 + diff --git a/queue-6.8/block-fix-deadlock-between-bd_link_disk_holder-and-p.patch b/queue-6.8/block-fix-deadlock-between-bd_link_disk_holder-and-p.patch new file mode 100644 index 00000000000..eda7c85f8c6 --- /dev/null +++ b/queue-6.8/block-fix-deadlock-between-bd_link_disk_holder-and-p.patch @@ -0,0 +1,113 @@ +From d1c6037389f445c1ef19f6dbad419bc20f7aa535 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Feb 2024 17:01:22 +0800 +Subject: block: fix deadlock between bd_link_disk_holder and partition scan + +From: Li Nan + +[ Upstream commit 03f12122b20b6e6028e9ed69030a49f9cffcbb75 ] + +'open_mutex' of gendisk is used to protect open/close block devices. But +in bd_link_disk_holder(), it is used to protect the creation of symlink +between holding disk and slave bdev, which introduces some issues. + +When bd_link_disk_holder() is called, the driver is usually in the process +of initialization/modification and may suspend submitting io. At this +time, any io hold 'open_mutex', such as scanning partitions, can cause +deadlocks. For example, in raid: + +T1 T2 +bdev_open_by_dev + lock open_mutex [1] + ... + efi_partition + ... + md_submit_bio + md_ioctl mddev_syspend + -> suspend all io + md_add_new_disk + bind_rdev_to_array + bd_link_disk_holder + try lock open_mutex [2] + md_handle_request + -> wait mddev_resume + +T1 scan partition, T2 add a new device to raid. T1 waits for T2 to resume +mddev, but T2 waits for open_mutex held by T1. Deadlock occurs. + +Fix it by introducing a local mutex 'blk_holder_mutex' to replace +'open_mutex'. + +Fixes: 1b0a2d950ee2 ("md: use new apis to suspend array for ioctls involed array reconfiguration") +Reported-by: mgperkow@gmail.com +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218459 +Signed-off-by: Li Nan +Reviewed-by: Christoph Hellwig +Reviewed-by: Yu Kuai +Link: https://lore.kernel.org/r/20240221090122.1281868-1-linan666@huaweicloud.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/holder.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/block/holder.c b/block/holder.c +index 37d18c13d9581..791091a7eac23 100644 +--- a/block/holder.c ++++ b/block/holder.c +@@ -8,6 +8,8 @@ struct bd_holder_disk { + int refcnt; + }; + ++static DEFINE_MUTEX(blk_holder_mutex); ++ + static struct bd_holder_disk *bd_find_holder_disk(struct block_device *bdev, + struct gendisk *disk) + { +@@ -80,7 +82,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) + kobject_get(bdev->bd_holder_dir); + mutex_unlock(&bdev->bd_disk->open_mutex); + +- mutex_lock(&disk->open_mutex); ++ mutex_lock(&blk_holder_mutex); + WARN_ON_ONCE(!bdev->bd_holder); + + holder = bd_find_holder_disk(bdev, disk); +@@ -108,7 +110,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) + goto out_del_symlink; + list_add(&holder->list, &disk->slave_bdevs); + +- mutex_unlock(&disk->open_mutex); ++ mutex_unlock(&blk_holder_mutex); + return 0; + + out_del_symlink: +@@ -116,7 +118,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) + out_free_holder: + kfree(holder); + out_unlock: +- mutex_unlock(&disk->open_mutex); ++ mutex_unlock(&blk_holder_mutex); + if (ret) + kobject_put(bdev->bd_holder_dir); + return ret; +@@ -140,7 +142,7 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) + if (WARN_ON_ONCE(!disk->slave_dir)) + return; + +- mutex_lock(&disk->open_mutex); ++ mutex_lock(&blk_holder_mutex); + holder = bd_find_holder_disk(bdev, disk); + if (!WARN_ON_ONCE(holder == NULL) && !--holder->refcnt) { + del_symlink(disk->slave_dir, bdev_kobj(bdev)); +@@ -149,6 +151,6 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) + list_del_init(&holder->list); + kfree(holder); + } +- mutex_unlock(&disk->open_mutex); ++ mutex_unlock(&blk_holder_mutex); + } + EXPORT_SYMBOL_GPL(bd_unlink_disk_holder); +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-af_bluetooth-fix-deadlock.patch b/queue-6.8/bluetooth-af_bluetooth-fix-deadlock.patch new file mode 100644 index 00000000000..3746f8437c6 --- /dev/null +++ b/queue-6.8/bluetooth-af_bluetooth-fix-deadlock.patch @@ -0,0 +1,90 @@ +From 6da4c8b689b547cbf8318c8fa81adb30ef93e242 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 1 Mar 2024 12:58:11 -0500 +Subject: Bluetooth: af_bluetooth: Fix deadlock + +From: Luiz Augusto von Dentz + +[ Upstream commit f7b94bdc1ec107c92262716b073b3e816d4784fb ] + +Attemting to do sock_lock on .recvmsg may cause a deadlock as shown +bellow, so instead of using sock_sock this uses sk_receive_queue.lock +on bt_sock_ioctl to avoid the UAF: + +INFO: task kworker/u9:1:121 blocked for more than 30 seconds. + Not tainted 6.7.6-lemon #183 +Workqueue: hci0 hci_rx_work +Call Trace: + + __schedule+0x37d/0xa00 + schedule+0x32/0xe0 + __lock_sock+0x68/0xa0 + ? __pfx_autoremove_wake_function+0x10/0x10 + lock_sock_nested+0x43/0x50 + l2cap_sock_recv_cb+0x21/0xa0 + l2cap_recv_frame+0x55b/0x30a0 + ? psi_task_switch+0xeb/0x270 + ? finish_task_switch.isra.0+0x93/0x2a0 + hci_rx_work+0x33a/0x3f0 + process_one_work+0x13a/0x2f0 + worker_thread+0x2f0/0x410 + ? __pfx_worker_thread+0x10/0x10 + kthread+0xe0/0x110 + ? __pfx_kthread+0x10/0x10 + ret_from_fork+0x2c/0x50 + ? __pfx_kthread+0x10/0x10 + ret_from_fork_asm+0x1b/0x30 + + +Fixes: 2e07e8348ea4 ("Bluetooth: af_bluetooth: Fix Use-After-Free in bt_sock_recvmsg") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/af_bluetooth.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c +index b93464ac3517f..67604ccec2f42 100644 +--- a/net/bluetooth/af_bluetooth.c ++++ b/net/bluetooth/af_bluetooth.c +@@ -309,14 +309,11 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, + if (flags & MSG_OOB) + return -EOPNOTSUPP; + +- lock_sock(sk); +- + skb = skb_recv_datagram(sk, flags, &err); + if (!skb) { + if (sk->sk_shutdown & RCV_SHUTDOWN) + err = 0; + +- release_sock(sk); + return err; + } + +@@ -346,8 +343,6 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, + + skb_free_datagram(sk, skb); + +- release_sock(sk); +- + if (flags & MSG_TRUNC) + copied = skblen; + +@@ -570,10 +565,11 @@ int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) + if (sk->sk_state == BT_LISTEN) + return -EINVAL; + +- lock_sock(sk); ++ spin_lock(&sk->sk_receive_queue.lock); + skb = skb_peek(&sk->sk_receive_queue); + amount = skb ? skb->len : 0; +- release_sock(sk); ++ spin_unlock(&sk->sk_receive_queue.lock); ++ + err = put_user(amount, (int __user *)arg); + break; + +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-btrtl-fix-out-of-bounds-memory-access.patch b/queue-6.8/bluetooth-btrtl-fix-out-of-bounds-memory-access.patch new file mode 100644 index 00000000000..1acce5b9df0 --- /dev/null +++ b/queue-6.8/bluetooth-btrtl-fix-out-of-bounds-memory-access.patch @@ -0,0 +1,125 @@ +From c4b1368c51804cf03672cf9153b86571260b547b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 24 Feb 2024 00:37:04 +0300 +Subject: Bluetooth: btrtl: fix out of bounds memory access + +From: Andrey Skvortsov + +[ Upstream commit de4e88ec58c4202efd1f02eebb4939bbf6945358 ] + +The problem is detected by KASAN. +btrtl driver uses private hci data to store 'struct btrealtek_data'. +If btrtl driver is used with btusb, then memory for private hci data +is allocated in btusb. But no private data is allocated after hci_dev, +when btrtl is used with hci_h5. + +This commit adds memory allocation for hci_h5 case. + + ================================================================== + BUG: KASAN: slab-out-of-bounds in btrtl_initialize+0x6cc/0x958 [btrtl] + Write of size 8 at addr ffff00000f5a5748 by task kworker/u9:0/76 + + Hardware name: Pine64 PinePhone (1.2) (DT) + Workqueue: hci0 hci_power_on [bluetooth] + Call trace: + dump_backtrace+0x9c/0x128 + show_stack+0x20/0x38 + dump_stack_lvl+0x48/0x60 + print_report+0xf8/0x5d8 + kasan_report+0x90/0xd0 + __asan_store8+0x9c/0xc0 + [btrtl] + h5_btrtl_setup+0xd0/0x2f8 [hci_uart] + h5_setup+0x50/0x80 [hci_uart] + hci_uart_setup+0xd4/0x260 [hci_uart] + hci_dev_open_sync+0x1cc/0xf68 [bluetooth] + hci_dev_do_open+0x34/0x90 [bluetooth] + hci_power_on+0xc4/0x3c8 [bluetooth] + process_one_work+0x328/0x6f0 + worker_thread+0x410/0x778 + kthread+0x168/0x178 + ret_from_fork+0x10/0x20 + + Allocated by task 53: + kasan_save_stack+0x3c/0x68 + kasan_save_track+0x20/0x40 + kasan_save_alloc_info+0x68/0x78 + __kasan_kmalloc+0xd4/0xd8 + __kmalloc+0x1b4/0x3b0 + hci_alloc_dev_priv+0x28/0xa58 [bluetooth] + hci_uart_register_device+0x118/0x4f8 [hci_uart] + h5_serdev_probe+0xf4/0x178 [hci_uart] + serdev_drv_probe+0x54/0xa0 + really_probe+0x254/0x588 + __driver_probe_device+0xc4/0x210 + driver_probe_device+0x64/0x160 + __driver_attach_async_helper+0x88/0x158 + async_run_entry_fn+0xd0/0x388 + process_one_work+0x328/0x6f0 + worker_thread+0x410/0x778 + kthread+0x168/0x178 + ret_from_fork+0x10/0x20 + + Last potentially related work creation: + kasan_save_stack+0x3c/0x68 + __kasan_record_aux_stack+0xb0/0x150 + kasan_record_aux_stack_noalloc+0x14/0x20 + __queue_work+0x33c/0x960 + queue_work_on+0x98/0xc0 + hci_recv_frame+0xc8/0x1e8 [bluetooth] + h5_complete_rx_pkt+0x2c8/0x800 [hci_uart] + h5_rx_payload+0x98/0xb8 [hci_uart] + h5_recv+0x158/0x3d8 [hci_uart] + hci_uart_receive_buf+0xa0/0xe8 [hci_uart] + ttyport_receive_buf+0xac/0x178 + flush_to_ldisc+0x130/0x2c8 + process_one_work+0x328/0x6f0 + worker_thread+0x410/0x778 + kthread+0x168/0x178 + ret_from_fork+0x10/0x20 + + Second to last potentially related work creation: + kasan_save_stack+0x3c/0x68 + __kasan_record_aux_stack+0xb0/0x150 + kasan_record_aux_stack_noalloc+0x14/0x20 + __queue_work+0x788/0x960 + queue_work_on+0x98/0xc0 + __hci_cmd_sync_sk+0x23c/0x7a0 [bluetooth] + __hci_cmd_sync+0x24/0x38 [bluetooth] + btrtl_initialize+0x760/0x958 [btrtl] + h5_btrtl_setup+0xd0/0x2f8 [hci_uart] + h5_setup+0x50/0x80 [hci_uart] + hci_uart_setup+0xd4/0x260 [hci_uart] + hci_dev_open_sync+0x1cc/0xf68 [bluetooth] + hci_dev_do_open+0x34/0x90 [bluetooth] + hci_power_on+0xc4/0x3c8 [bluetooth] + process_one_work+0x328/0x6f0 + worker_thread+0x410/0x778 + kthread+0x168/0x178 + ret_from_fork+0x10/0x20 + ================================================================== + +Fixes: 5b355944b190 ("Bluetooth: btrtl: Add btrealtek data struct") +Fixes: 044014ce85a1 ("Bluetooth: btrtl: Add Realtek devcoredump support") +Signed-off-by: Andrey Skvortsov +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + drivers/bluetooth/hci_h5.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c +index b66136348bd64..c0436881a533c 100644 +--- a/drivers/bluetooth/hci_h5.c ++++ b/drivers/bluetooth/hci_h5.c +@@ -1072,6 +1072,7 @@ static struct h5_vnd rtl_vnd = { + .suspend = h5_btrtl_suspend, + .resume = h5_btrtl_resume, + .acpi_gpio_map = acpi_btrtl_gpios, ++ .sizeof_priv = sizeof(struct btrealtek_data), + }; + + static const struct h5_device_data h5_data_rtl8822cs = { +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-btusb-fix-memory-leak.patch b/queue-6.8/bluetooth-btusb-fix-memory-leak.patch new file mode 100644 index 00000000000..86ec9dffa61 --- /dev/null +++ b/queue-6.8/bluetooth-btusb-fix-memory-leak.patch @@ -0,0 +1,68 @@ +From 1b8a74782215009c69c36bdb6c99322e3d2c0c9f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Feb 2024 11:17:24 -0500 +Subject: Bluetooth: btusb: Fix memory leak + +From: Luiz Augusto von Dentz + +[ Upstream commit 79f4127a502c5905f04da1f20a7bbe07103fb77c ] + +This checks if CONFIG_DEV_COREDUMP is enabled before attempting to clone +the skb and also make sure btmtk_process_coredump frees the skb passed +following the same logic. + +Fixes: 0b7015132878 ("Bluetooth: btusb: mediatek: add MediaTek devcoredump support") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + drivers/bluetooth/btmtk.c | 4 +++- + drivers/bluetooth/btusb.c | 10 ++++++---- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c +index aaabb732082cd..285418dbb43f5 100644 +--- a/drivers/bluetooth/btmtk.c ++++ b/drivers/bluetooth/btmtk.c +@@ -372,8 +372,10 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb) + struct btmediatek_data *data = hci_get_priv(hdev); + int err; + +- if (!IS_ENABLED(CONFIG_DEV_COREDUMP)) ++ if (!IS_ENABLED(CONFIG_DEV_COREDUMP)) { ++ kfree_skb(skb); + return 0; ++ } + + switch (data->cd_info.state) { + case HCI_DEVCOREDUMP_IDLE: +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c +index d31edad7a0560..6cb87d47ad7d5 100644 +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -3273,7 +3273,6 @@ static int btusb_recv_acl_mtk(struct hci_dev *hdev, struct sk_buff *skb) + { + struct btusb_data *data = hci_get_drvdata(hdev); + u16 handle = le16_to_cpu(hci_acl_hdr(skb)->handle); +- struct sk_buff *skb_cd; + + switch (handle) { + case 0xfc6f: /* Firmware dump from device */ +@@ -3286,9 +3285,12 @@ static int btusb_recv_acl_mtk(struct hci_dev *hdev, struct sk_buff *skb) + * for backward compatibility, so we have to clone the packet + * extraly for the in-kernel coredump support. + */ +- skb_cd = skb_clone(skb, GFP_ATOMIC); +- if (skb_cd) +- btmtk_process_coredump(hdev, skb_cd); ++ if (IS_ENABLED(CONFIG_DEV_COREDUMP)) { ++ struct sk_buff *skb_cd = skb_clone(skb, GFP_ATOMIC); ++ ++ if (skb_cd) ++ btmtk_process_coredump(hdev, skb_cd); ++ } + + fallthrough; + case 0x05ff: /* Firmware debug logging 1 */ +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-fix-eir-name-length.patch b/queue-6.8/bluetooth-fix-eir-name-length.patch new file mode 100644 index 00000000000..372993b3c53 --- /dev/null +++ b/queue-6.8/bluetooth-fix-eir-name-length.patch @@ -0,0 +1,106 @@ +From c31b8b4efa61898ab2166ab93bcb7d270ae15074 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Mar 2024 17:42:05 +0100 +Subject: Bluetooth: Fix eir name length +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Frédéric Danis + +[ Upstream commit 2ab3e8d67fc1d4a7638b769cf83023ec209fc0a9 ] + +According to Section 1.2 of Core Specification Supplement Part A the +complete or short name strings are defined as utf8s, which should not +include the trailing NULL for variable length array as defined in Core +Specification Vol1 Part E Section 2.9.3. + +Removing the trailing NULL allows PTS to retrieve the random address based +on device name, e.g. for SM/PER/KDU/BV-02-C, SM/PER/KDU/BV-08-C or +GAP/BROB/BCST/BV-03-C. + +Fixes: f61851f64b17 ("Bluetooth: Fix append max 11 bytes of name to scan rsp data") +Signed-off-by: Frédéric Danis +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/eir.c | 29 +++++++---------------------- + net/bluetooth/mgmt.c | 2 +- + 2 files changed, 8 insertions(+), 23 deletions(-) + +diff --git a/net/bluetooth/eir.c b/net/bluetooth/eir.c +index 9214189279e80..1bc51e2b05a34 100644 +--- a/net/bluetooth/eir.c ++++ b/net/bluetooth/eir.c +@@ -13,48 +13,33 @@ + + #define PNP_INFO_SVCLASS_ID 0x1200 + +-static u8 eir_append_name(u8 *eir, u16 eir_len, u8 type, u8 *data, u8 data_len) +-{ +- u8 name[HCI_MAX_SHORT_NAME_LENGTH + 1]; +- +- /* If data is already NULL terminated just pass it directly */ +- if (data[data_len - 1] == '\0') +- return eir_append_data(eir, eir_len, type, data, data_len); +- +- memcpy(name, data, HCI_MAX_SHORT_NAME_LENGTH); +- name[HCI_MAX_SHORT_NAME_LENGTH] = '\0'; +- +- return eir_append_data(eir, eir_len, type, name, sizeof(name)); +-} +- + u8 eir_append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len) + { + size_t short_len; + size_t complete_len; + +- /* no space left for name (+ NULL + type + len) */ +- if ((max_adv_len(hdev) - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 3) ++ /* no space left for name (+ type + len) */ ++ if ((max_adv_len(hdev) - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 2) + return ad_len; + + /* use complete name if present and fits */ + complete_len = strnlen(hdev->dev_name, sizeof(hdev->dev_name)); + if (complete_len && complete_len <= HCI_MAX_SHORT_NAME_LENGTH) +- return eir_append_name(ptr, ad_len, EIR_NAME_COMPLETE, +- hdev->dev_name, complete_len + 1); ++ return eir_append_data(ptr, ad_len, EIR_NAME_COMPLETE, ++ hdev->dev_name, complete_len); + + /* use short name if present */ + short_len = strnlen(hdev->short_name, sizeof(hdev->short_name)); + if (short_len) +- return eir_append_name(ptr, ad_len, EIR_NAME_SHORT, ++ return eir_append_data(ptr, ad_len, EIR_NAME_SHORT, + hdev->short_name, +- short_len == HCI_MAX_SHORT_NAME_LENGTH ? +- short_len : short_len + 1); ++ short_len); + + /* use shortened full name if present, we already know that name + * is longer then HCI_MAX_SHORT_NAME_LENGTH + */ + if (complete_len) +- return eir_append_name(ptr, ad_len, EIR_NAME_SHORT, ++ return eir_append_data(ptr, ad_len, EIR_NAME_SHORT, + hdev->dev_name, + HCI_MAX_SHORT_NAME_LENGTH); + +diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c +index cc8efdc4ad431..640d6d54ac6ba 100644 +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -8400,7 +8400,7 @@ static int read_adv_features(struct sock *sk, struct hci_dev *hdev, + + static u8 calculate_name_len(struct hci_dev *hdev) + { +- u8 buf[HCI_MAX_SHORT_NAME_LENGTH + 3]; ++ u8 buf[HCI_MAX_SHORT_NAME_LENGTH + 2]; /* len + type + name */ + + return eir_append_local_name(hdev, buf, 0); + } +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-fix-use-after-free-in-accessing-skb-after-.patch b/queue-6.8/bluetooth-fix-use-after-free-in-accessing-skb-after-.patch new file mode 100644 index 00000000000..2f0c281a2cf --- /dev/null +++ b/queue-6.8/bluetooth-fix-use-after-free-in-accessing-skb-after-.patch @@ -0,0 +1,61 @@ +From 0b7cf642048dbc16db86551324323eae4ad89b1a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 Mar 2024 19:06:23 +0200 +Subject: Bluetooth: fix use-after-free in accessing skb after sending it + +From: Pauli Virtanen + +[ Upstream commit 947ec0d002dce8577b655793dcc6fc78d67b7cb6 ] + +hci_send_cmd_sync first sends skb and then tries to clone it. However, +the driver may have already freed the skb at that point. + +Fix by cloning the sent_cmd cloned just above, instead of the original. + +Log: +================================================================ +BUG: KASAN: slab-use-after-free in __copy_skb_header+0x1a/0x240 +... +Call Trace: .. + __skb_clone+0x59/0x2c0 + hci_cmd_work+0x3b3/0x3d0 [bluetooth] + process_one_work+0x459/0x900 +... +Allocated by task 129: ... + __alloc_skb+0x1ae/0x220 + __hci_cmd_sync_sk+0x44c/0x7a0 [bluetooth] + __hci_cmd_sync_status+0x24/0xb0 [bluetooth] + set_cig_params_sync+0x778/0x7d0 [bluetooth] +... +Freed by task 0: ... + kmem_cache_free+0x157/0x3c0 + __usb_hcd_giveback_urb+0x11e/0x1e0 + usb_giveback_urb_bh+0x1ad/0x2a0 + tasklet_action_common.isra.0+0x259/0x4a0 + __do_softirq+0x15b/0x5a7 +================================================================ + +Fixes: 2615fd9a7c25 ("Bluetooth: hci_sync: Fix overwriting request callback") +Signed-off-by: Pauli Virtanen +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/hci_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c +index 85a91c438d721..7d5334b529834 100644 +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -4185,7 +4185,7 @@ static void hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb) + if (hci_req_status_pend(hdev) && + !hci_dev_test_and_set_flag(hdev, HCI_CMD_PENDING)) { + kfree_skb(hdev->req_skb); +- hdev->req_skb = skb_clone(skb, GFP_KERNEL); ++ hdev->req_skb = skb_clone(hdev->sent_cmd, GFP_KERNEL); + } + + atomic_dec(&hdev->cmd_cnt); +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-hci_core-cancel-request-on-command-timeout.patch b/queue-6.8/bluetooth-hci_core-cancel-request-on-command-timeout.patch new file mode 100644 index 00000000000..9370909aac6 --- /dev/null +++ b/queue-6.8/bluetooth-hci_core-cancel-request-on-command-timeout.patch @@ -0,0 +1,245 @@ +From bcb39bf018fb4db5fb7d6c7f5b4eb233ac6d5226 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 9 Jan 2024 13:45:40 -0500 +Subject: Bluetooth: hci_core: Cancel request on command timeout + +From: Luiz Augusto von Dentz + +[ Upstream commit 63298d6e752fc0ec7f5093860af8bc9f047b30c8 ] + +If command has timed out call __hci_cmd_sync_cancel to notify the +hci_req since it will inevitably cause a timeout. + +This also rework the code around __hci_cmd_sync_cancel since it was +wrongly assuming it needs to cancel timer as well, but sometimes the +timers have not been started or in fact they already had timed out in +which case they don't need to be cancel yet again. + +Signed-off-by: Luiz Augusto von Dentz +Stable-dep-of: 2615fd9a7c25 ("Bluetooth: hci_sync: Fix overwriting request callback") +Signed-off-by: Sasha Levin +--- + include/net/bluetooth/hci_sync.h | 2 +- + net/bluetooth/hci_core.c | 84 ++++++++++++++++++++++---------- + net/bluetooth/hci_request.c | 2 +- + net/bluetooth/hci_sync.c | 20 ++++---- + net/bluetooth/mgmt.c | 2 +- + 5 files changed, 71 insertions(+), 39 deletions(-) + +diff --git a/include/net/bluetooth/hci_sync.h b/include/net/bluetooth/hci_sync.h +index 6efbc2152146b..e2582c2425449 100644 +--- a/include/net/bluetooth/hci_sync.h ++++ b/include/net/bluetooth/hci_sync.h +@@ -42,7 +42,7 @@ int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen, + void hci_cmd_sync_init(struct hci_dev *hdev); + void hci_cmd_sync_clear(struct hci_dev *hdev); + void hci_cmd_sync_cancel(struct hci_dev *hdev, int err); +-void __hci_cmd_sync_cancel(struct hci_dev *hdev, int err); ++void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err); + + int hci_cmd_sync_submit(struct hci_dev *hdev, hci_cmd_sync_work_func_t func, + void *data, hci_cmd_sync_work_destroy_t destroy); +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c +index 2821a42cefdc6..539305b9a0e27 100644 +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -1492,10 +1492,11 @@ static void hci_cmd_timeout(struct work_struct *work) + cmd_timer.work); + + if (hdev->sent_cmd) { +- struct hci_command_hdr *sent = (void *) hdev->sent_cmd->data; +- u16 opcode = __le16_to_cpu(sent->opcode); ++ u16 opcode = hci_skb_opcode(hdev->sent_cmd); + + bt_dev_err(hdev, "command 0x%4.4x tx timeout", opcode); ++ ++ hci_cmd_sync_cancel_sync(hdev, ETIMEDOUT); + } else { + bt_dev_err(hdev, "command tx timeout"); + } +@@ -2826,6 +2827,23 @@ int hci_unregister_suspend_notifier(struct hci_dev *hdev) + return ret; + } + ++/* Cancel ongoing command synchronously: ++ * ++ * - Cancel command timer ++ * - Reset command counter ++ * - Cancel command request ++ */ ++static void hci_cancel_cmd_sync(struct hci_dev *hdev, int err) ++{ ++ bt_dev_dbg(hdev, "err 0x%2.2x", err); ++ ++ cancel_delayed_work_sync(&hdev->cmd_timer); ++ cancel_delayed_work_sync(&hdev->ncmd_timer); ++ atomic_set(&hdev->cmd_cnt, 1); ++ ++ hci_cmd_sync_cancel_sync(hdev, -err); ++} ++ + /* Suspend HCI device */ + int hci_suspend_dev(struct hci_dev *hdev) + { +@@ -2843,7 +2861,7 @@ int hci_suspend_dev(struct hci_dev *hdev) + return 0; + + /* Cancel potentially blocking sync operation before suspend */ +- __hci_cmd_sync_cancel(hdev, -EHOSTDOWN); ++ hci_cancel_cmd_sync(hdev, -EHOSTDOWN); + + hci_req_sync_lock(hdev); + ret = hci_suspend_sync(hdev); +@@ -4128,6 +4146,33 @@ static void hci_rx_work(struct work_struct *work) + } + } + ++static void hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb) ++{ ++ int err; ++ ++ bt_dev_dbg(hdev, "skb %p", skb); ++ ++ kfree_skb(hdev->sent_cmd); ++ ++ hdev->sent_cmd = skb_clone(skb, GFP_KERNEL); ++ if (!hdev->sent_cmd) { ++ skb_queue_head(&hdev->cmd_q, skb); ++ queue_work(hdev->workqueue, &hdev->cmd_work); ++ return; ++ } ++ ++ err = hci_send_frame(hdev, skb); ++ if (err < 0) { ++ hci_cmd_sync_cancel_sync(hdev, err); ++ return; ++ } ++ ++ if (hci_req_status_pend(hdev)) ++ hci_dev_set_flag(hdev, HCI_CMD_PENDING); ++ ++ atomic_dec(&hdev->cmd_cnt); ++} ++ + static void hci_cmd_work(struct work_struct *work) + { + struct hci_dev *hdev = container_of(work, struct hci_dev, cmd_work); +@@ -4142,30 +4187,15 @@ static void hci_cmd_work(struct work_struct *work) + if (!skb) + return; + +- kfree_skb(hdev->sent_cmd); +- +- hdev->sent_cmd = skb_clone(skb, GFP_KERNEL); +- if (hdev->sent_cmd) { +- int res; +- if (hci_req_status_pend(hdev)) +- hci_dev_set_flag(hdev, HCI_CMD_PENDING); +- atomic_dec(&hdev->cmd_cnt); ++ hci_send_cmd_sync(hdev, skb); + +- res = hci_send_frame(hdev, skb); +- if (res < 0) +- __hci_cmd_sync_cancel(hdev, -res); +- +- rcu_read_lock(); +- if (test_bit(HCI_RESET, &hdev->flags) || +- hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE)) +- cancel_delayed_work(&hdev->cmd_timer); +- else +- queue_delayed_work(hdev->workqueue, &hdev->cmd_timer, +- HCI_CMD_TIMEOUT); +- rcu_read_unlock(); +- } else { +- skb_queue_head(&hdev->cmd_q, skb); +- queue_work(hdev->workqueue, &hdev->cmd_work); +- } ++ rcu_read_lock(); ++ if (test_bit(HCI_RESET, &hdev->flags) || ++ hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE)) ++ cancel_delayed_work(&hdev->cmd_timer); ++ else ++ queue_delayed_work(hdev->workqueue, &hdev->cmd_timer, ++ HCI_CMD_TIMEOUT); ++ rcu_read_unlock(); + } + } +diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c +index 6e023b0104b03..00e02138003ec 100644 +--- a/net/bluetooth/hci_request.c ++++ b/net/bluetooth/hci_request.c +@@ -895,7 +895,7 @@ void hci_request_setup(struct hci_dev *hdev) + + void hci_request_cancel_all(struct hci_dev *hdev) + { +- __hci_cmd_sync_cancel(hdev, ENODEV); ++ hci_cmd_sync_cancel_sync(hdev, ENODEV); + + cancel_interleave_scan(hdev); + } +diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c +index 5716345a26dfb..5236fe72a8553 100644 +--- a/net/bluetooth/hci_sync.c ++++ b/net/bluetooth/hci_sync.c +@@ -584,7 +584,7 @@ void hci_cmd_sync_clear(struct hci_dev *hdev) + mutex_unlock(&hdev->cmd_sync_work_lock); + } + +-void __hci_cmd_sync_cancel(struct hci_dev *hdev, int err) ++void hci_cmd_sync_cancel(struct hci_dev *hdev, int err) + { + bt_dev_dbg(hdev, "err 0x%2.2x", err); + +@@ -592,15 +592,17 @@ void __hci_cmd_sync_cancel(struct hci_dev *hdev, int err) + hdev->req_result = err; + hdev->req_status = HCI_REQ_CANCELED; + +- cancel_delayed_work_sync(&hdev->cmd_timer); +- cancel_delayed_work_sync(&hdev->ncmd_timer); +- atomic_set(&hdev->cmd_cnt, 1); +- +- wake_up_interruptible(&hdev->req_wait_q); ++ queue_work(hdev->workqueue, &hdev->cmd_sync_cancel_work); + } + } ++EXPORT_SYMBOL(hci_cmd_sync_cancel); + +-void hci_cmd_sync_cancel(struct hci_dev *hdev, int err) ++/* Cancel ongoing command request synchronously: ++ * ++ * - Set result and mark status to HCI_REQ_CANCELED ++ * - Wakeup command sync thread ++ */ ++void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err) + { + bt_dev_dbg(hdev, "err 0x%2.2x", err); + +@@ -608,10 +610,10 @@ void hci_cmd_sync_cancel(struct hci_dev *hdev, int err) + hdev->req_result = err; + hdev->req_status = HCI_REQ_CANCELED; + +- queue_work(hdev->workqueue, &hdev->cmd_sync_cancel_work); ++ wake_up_interruptible(&hdev->req_wait_q); + } + } +-EXPORT_SYMBOL(hci_cmd_sync_cancel); ++EXPORT_SYMBOL(hci_cmd_sync_cancel_sync); + + /* Submit HCI command to be run in as cmd_sync_work: + * +diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c +index 7490092ccb2de..cc8efdc4ad431 100644 +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -1404,7 +1404,7 @@ static int set_powered(struct sock *sk, struct hci_dev *hdev, void *data, + + /* Cancel potentially blocking sync operation before power off */ + if (cp->val == 0x00) { +- __hci_cmd_sync_cancel(hdev, -EHOSTDOWN); ++ hci_cmd_sync_cancel_sync(hdev, -EHOSTDOWN); + err = hci_cmd_sync_queue(hdev, set_powered_sync, cmd, + mgmt_set_powered_complete); + } else { +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-hci_core-fix-possible-buffer-overflow.patch b/queue-6.8/bluetooth-hci_core-fix-possible-buffer-overflow.patch new file mode 100644 index 00000000000..fc96ed51eef --- /dev/null +++ b/queue-6.8/bluetooth-hci_core-fix-possible-buffer-overflow.patch @@ -0,0 +1,36 @@ +From 7e1ae1413802be5ad839c9ebf6a4c805002ff682 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Feb 2024 10:49:26 -0500 +Subject: Bluetooth: hci_core: Fix possible buffer overflow + +From: Luiz Augusto von Dentz + +[ Upstream commit 81137162bfaa7278785b24c1fd2e9e74f082e8e4 ] + +struct hci_dev_info has a fixed size name[8] field so in the event that +hdev->name is bigger than that strcpy would attempt to write past its +size, so this fixes this problem by switching to use strscpy. + +Fixes: dcda165706b9 ("Bluetooth: hci_core: Fix build warnings") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/hci_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c +index 96707deef296b..85a91c438d721 100644 +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -908,7 +908,7 @@ int hci_get_dev_info(void __user *arg) + else + flags = hdev->flags; + +- strcpy(di.name, hdev->name); ++ strscpy(di.name, hdev->name, sizeof(di.name)); + di.bdaddr = hdev->bdaddr; + di.type = (hdev->bus & 0x0f) | ((hdev->dev_type & 0x03) << 4); + di.flags = flags; +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-hci_event-fix-not-indicating-new-connectio.patch b/queue-6.8/bluetooth-hci_event-fix-not-indicating-new-connectio.patch new file mode 100644 index 00000000000..d9e2a217869 --- /dev/null +++ b/queue-6.8/bluetooth-hci_event-fix-not-indicating-new-connectio.patch @@ -0,0 +1,115 @@ +From 7fc8f5f18ab4db0040c87cae25c81535210dc97d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 11:24:19 -0500 +Subject: Bluetooth: hci_event: Fix not indicating new connection for BIG Sync + +From: Luiz Augusto von Dentz + +[ Upstream commit eeda1bf97bb500a901f7a9ee5615bad2160f2378 ] + +BIG Sync (aka. Broadcast sink) requires to inform that the device is +connected when a data path is active otherwise userspace could attempt +to free resources allocated to the device object while scanning. + +Fixes: 1d11d70d1f6b ("Bluetooth: ISO: Pass BIG encryption info through QoS") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/hci_event.c | 21 ++++++++++++++------- + net/bluetooth/mgmt.c | 4 ++++ + 2 files changed, 18 insertions(+), 7 deletions(-) + +diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c +index 55daada8dc15d..9ee66b393981b 100644 +--- a/net/bluetooth/hci_event.c ++++ b/net/bluetooth/hci_event.c +@@ -2524,9 +2524,7 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn, + * Only those in BT_CONFIG or BT_CONNECTED states can be + * considered connected. + */ +- if (conn && +- (conn->state == BT_CONFIG || conn->state == BT_CONNECTED) && +- !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) ++ if (conn && (conn->state == BT_CONFIG || conn->state == BT_CONNECTED)) + mgmt_device_connected(hdev, conn, name, name_len); + + if (discov->state == DISCOVERY_STOPPED) +@@ -3758,8 +3756,9 @@ static void hci_remote_features_evt(struct hci_dev *hdev, void *data, + bacpy(&cp.bdaddr, &conn->dst); + cp.pscan_rep_mode = 0x02; + hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); +- } else if (!test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) ++ } else { + mgmt_device_connected(hdev, conn, NULL, 0); ++ } + + if (!hci_outgoing_auth_needed(hdev, conn)) { + conn->state = BT_CONNECTED; +@@ -3932,6 +3931,11 @@ static u8 hci_cc_le_setup_iso_path(struct hci_dev *hdev, void *data, + * last. + */ + hci_connect_cfm(conn, rp->status); ++ ++ /* Notify device connected in case it is a BIG Sync */ ++ if (!rp->status && test_bit(HCI_CONN_BIG_SYNC, &conn->flags)) ++ mgmt_device_connected(hdev, conn, NULL, 0); ++ + break; + } + +@@ -5006,8 +5010,9 @@ static void hci_remote_ext_features_evt(struct hci_dev *hdev, void *data, + bacpy(&cp.bdaddr, &conn->dst); + cp.pscan_rep_mode = 0x02; + hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); +- } else if (!test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) ++ } else { + mgmt_device_connected(hdev, conn, NULL, 0); ++ } + + if (!hci_outgoing_auth_needed(hdev, conn)) { + conn->state = BT_CONNECTED; +@@ -5980,8 +5985,7 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status, + goto unlock; + } + +- if (!test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) +- mgmt_device_connected(hdev, conn, NULL, 0); ++ mgmt_device_connected(hdev, conn, NULL, 0); + + conn->sec_level = BT_SECURITY_LOW; + conn->state = BT_CONFIG; +@@ -7210,6 +7214,9 @@ static void hci_le_big_info_adv_report_evt(struct hci_dev *hdev, void *data, + /* Notify iso layer */ + hci_connect_cfm(pa_sync, 0x00); + ++ /* Notify MGMT layer */ ++ mgmt_device_connected(hdev, pa_sync, NULL, 0); ++ + unlock: + hci_dev_unlock(hdev); + } +diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c +index b2a272bc4d7c5..7490092ccb2de 100644 +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -3118,6 +3118,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data, + static u8 link_to_bdaddr(u8 link_type, u8 addr_type) + { + switch (link_type) { ++ case ISO_LINK: + case LE_LINK: + switch (addr_type) { + case ADDR_LE_DEV_PUBLIC: +@@ -9610,6 +9611,9 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn, + u16 eir_len = 0; + u32 flags = 0; + ++ if (test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) ++ return; ++ + /* allocate buff for LE or BR/EDR adv */ + if (conn->le_adv_data_len > 0) + skb = mgmt_alloc_skb(hdev, MGMT_EV_DEVICE_CONNECTED, +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-hci_h5-add-ability-to-allocate-memory-for-.patch b/queue-6.8/bluetooth-hci_h5-add-ability-to-allocate-memory-for-.patch new file mode 100644 index 00000000000..0838663d520 --- /dev/null +++ b/queue-6.8/bluetooth-hci_h5-add-ability-to-allocate-memory-for-.patch @@ -0,0 +1,104 @@ +From de0768fd3e48a7cc71f561f64480c032f535e419 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 24 Feb 2024 00:37:03 +0300 +Subject: Bluetooth: hci_h5: Add ability to allocate memory for private data + +From: Andrey Skvortsov + +[ Upstream commit 7a6d793e9ca8bc0c1d2f0aa0a02ec380d1124c74 ] + +In some cases uart-base drivers may need to use priv data. For +example, to store information needed for devcoredump. + +Fixes: 044014ce85a1 ("Bluetooth: btrtl: Add Realtek devcoredump support") +Signed-off-by: Andrey Skvortsov +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + drivers/bluetooth/hci_h5.c | 4 +++- + drivers/bluetooth/hci_serdev.c | 9 +++++---- + drivers/bluetooth/hci_uart.h | 12 +++++++++++- + 3 files changed, 19 insertions(+), 6 deletions(-) + +diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c +index 71e748a9477e4..b66136348bd64 100644 +--- a/drivers/bluetooth/hci_h5.c ++++ b/drivers/bluetooth/hci_h5.c +@@ -113,6 +113,7 @@ struct h5_vnd { + int (*suspend)(struct h5 *h5); + int (*resume)(struct h5 *h5); + const struct acpi_gpio_mapping *acpi_gpio_map; ++ int sizeof_priv; + }; + + struct h5_device_data { +@@ -863,7 +864,8 @@ static int h5_serdev_probe(struct serdev_device *serdev) + if (IS_ERR(h5->device_wake_gpio)) + return PTR_ERR(h5->device_wake_gpio); + +- return hci_uart_register_device(&h5->serdev_hu, &h5p); ++ return hci_uart_register_device_priv(&h5->serdev_hu, &h5p, ++ h5->vnd->sizeof_priv); + } + + static void h5_serdev_remove(struct serdev_device *serdev) +diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c +index 39c8b567da3c0..214fff876eae5 100644 +--- a/drivers/bluetooth/hci_serdev.c ++++ b/drivers/bluetooth/hci_serdev.c +@@ -300,8 +300,9 @@ static const struct serdev_device_ops hci_serdev_client_ops = { + .write_wakeup = hci_uart_write_wakeup, + }; + +-int hci_uart_register_device(struct hci_uart *hu, +- const struct hci_uart_proto *p) ++int hci_uart_register_device_priv(struct hci_uart *hu, ++ const struct hci_uart_proto *p, ++ int sizeof_priv) + { + int err; + struct hci_dev *hdev; +@@ -325,7 +326,7 @@ int hci_uart_register_device(struct hci_uart *hu, + set_bit(HCI_UART_PROTO_READY, &hu->flags); + + /* Initialize and register HCI device */ +- hdev = hci_alloc_dev(); ++ hdev = hci_alloc_dev_priv(sizeof_priv); + if (!hdev) { + BT_ERR("Can't allocate HCI device"); + err = -ENOMEM; +@@ -394,7 +395,7 @@ int hci_uart_register_device(struct hci_uart *hu, + percpu_free_rwsem(&hu->proto_lock); + return err; + } +-EXPORT_SYMBOL_GPL(hci_uart_register_device); ++EXPORT_SYMBOL_GPL(hci_uart_register_device_priv); + + void hci_uart_unregister_device(struct hci_uart *hu) + { +diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h +index fb4a2d0d8cc80..68c8c7e95d64d 100644 +--- a/drivers/bluetooth/hci_uart.h ++++ b/drivers/bluetooth/hci_uart.h +@@ -97,7 +97,17 @@ struct hci_uart { + + int hci_uart_register_proto(const struct hci_uart_proto *p); + int hci_uart_unregister_proto(const struct hci_uart_proto *p); +-int hci_uart_register_device(struct hci_uart *hu, const struct hci_uart_proto *p); ++ ++int hci_uart_register_device_priv(struct hci_uart *hu, ++ const struct hci_uart_proto *p, ++ int sizeof_priv); ++ ++static inline int hci_uart_register_device(struct hci_uart *hu, ++ const struct hci_uart_proto *p) ++{ ++ return hci_uart_register_device_priv(hu, p, 0); ++} ++ + void hci_uart_unregister_device(struct hci_uart *hu); + + int hci_uart_tx_wakeup(struct hci_uart *hu); +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-hci_qca-don-t-use-is_err_or_null-with-gpio.patch b/queue-6.8/bluetooth-hci_qca-don-t-use-is_err_or_null-with-gpio.patch new file mode 100644 index 00000000000..ce587d58527 --- /dev/null +++ b/queue-6.8/bluetooth-hci_qca-don-t-use-is_err_or_null-with-gpio.patch @@ -0,0 +1,59 @@ +From 00d1075da6daa567b3b47638a4a17a7763043609 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Feb 2024 17:40:17 +0100 +Subject: Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with + gpiod_get_optional() + +From: Bartosz Golaszewski + +[ Upstream commit 56d074d26c5828773b00b2185dd7e1d08273b8e8 ] + +The optional variants for the gpiod_get() family of functions return NULL +if the GPIO in question is not associated with this device. They return +ERR_PTR() on any other error. NULL descriptors are graciously handled by +GPIOLIB and can be safely passed to any of the GPIO consumer interfaces +as they will return 0 and act as if the function succeeded. If one is +using the optional variant, then there's no point in checking for NULL. + +Fixes: 6845667146a2 ("Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe") +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + drivers/bluetooth/hci_qca.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c +index edd2a81b4d5ed..8a60ad7acd705 100644 +--- a/drivers/bluetooth/hci_qca.c ++++ b/drivers/bluetooth/hci_qca.c +@@ -2326,7 +2326,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) + + qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", + GPIOD_OUT_LOW); +- if (IS_ERR_OR_NULL(qcadev->bt_en) && ++ if (IS_ERR(qcadev->bt_en) && + (data->soc_type == QCA_WCN6750 || + data->soc_type == QCA_WCN6855)) { + dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n"); +@@ -2335,7 +2335,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) + + qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->dev, "swctrl", + GPIOD_IN); +- if (IS_ERR_OR_NULL(qcadev->sw_ctrl) && ++ if (IS_ERR(qcadev->sw_ctrl) && + (data->soc_type == QCA_WCN6750 || + data->soc_type == QCA_WCN6855 || + data->soc_type == QCA_WCN7850)) +@@ -2357,7 +2357,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) + default: + qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", + GPIOD_OUT_LOW); +- if (IS_ERR_OR_NULL(qcadev->bt_en)) { ++ if (IS_ERR(qcadev->bt_en)) { + dev_warn(&serdev->dev, "failed to acquire enable gpio\n"); + power_ctrl_enabled = false; + } +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-hci_sync-fix-overwriting-request-callback.patch b/queue-6.8/bluetooth-hci_sync-fix-overwriting-request-callback.patch new file mode 100644 index 00000000000..531793f3f00 --- /dev/null +++ b/queue-6.8/bluetooth-hci_sync-fix-overwriting-request-callback.patch @@ -0,0 +1,257 @@ +From 75d6f384c3a291ba3d7e3562803ad7eab9b147ab Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 16:20:11 -0500 +Subject: Bluetooth: hci_sync: Fix overwriting request callback + +From: Luiz Augusto von Dentz + +[ Upstream commit 2615fd9a7c2507eb3be3fbe49dcec88a2f56454a ] + +In a few cases the stack may generate commands as responses to events +which would happen to overwrite the sent_cmd, so this attempts to store +the request in req_skb so even if sent_cmd is replaced with a new +command the pending request will remain in stored in req_skb. + +Fixes: 6a98e3836fa2 ("Bluetooth: Add helper for serialized HCI command execution") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + include/net/bluetooth/hci_core.h | 1 + + net/bluetooth/hci_conn.c | 2 +- + net/bluetooth/hci_core.c | 46 ++++++++++++++++++++++---------- + net/bluetooth/hci_event.c | 18 ++++++------- + net/bluetooth/hci_sync.c | 21 ++++++++++++--- + 5 files changed, 61 insertions(+), 27 deletions(-) + +diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h +index 8f8dd91737142..d1228857b1d0f 100644 +--- a/include/net/bluetooth/hci_core.h ++++ b/include/net/bluetooth/hci_core.h +@@ -552,6 +552,7 @@ struct hci_dev { + __u32 req_status; + __u32 req_result; + struct sk_buff *req_skb; ++ struct sk_buff *req_rsp; + + void *smp_data; + void *smp_bredr_data; +diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c +index fc4d72f83ac25..ba330114d38f7 100644 +--- a/net/bluetooth/hci_conn.c ++++ b/net/bluetooth/hci_conn.c +@@ -3010,7 +3010,7 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason) + case HCI_EV_LE_CONN_COMPLETE: + case HCI_EV_LE_ENHANCED_CONN_COMPLETE: + case HCI_EVT_LE_CIS_ESTABLISHED: +- hci_cmd_sync_cancel(hdev, -ECANCELED); ++ hci_cmd_sync_cancel(hdev, ECANCELED); + break; + } + } +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c +index 539305b9a0e27..96707deef296b 100644 +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -1491,8 +1491,8 @@ static void hci_cmd_timeout(struct work_struct *work) + struct hci_dev *hdev = container_of(work, struct hci_dev, + cmd_timer.work); + +- if (hdev->sent_cmd) { +- u16 opcode = hci_skb_opcode(hdev->sent_cmd); ++ if (hdev->req_skb) { ++ u16 opcode = hci_skb_opcode(hdev->req_skb); + + bt_dev_err(hdev, "command 0x%4.4x tx timeout", opcode); + +@@ -2796,6 +2796,7 @@ void hci_release_dev(struct hci_dev *hdev) + ida_destroy(&hdev->unset_handle_ida); + ida_simple_remove(&hci_index_ida, hdev->id); + kfree_skb(hdev->sent_cmd); ++ kfree_skb(hdev->req_skb); + kfree_skb(hdev->recv_event); + kfree(hdev); + } +@@ -3125,21 +3126,33 @@ int __hci_cmd_send(struct hci_dev *hdev, u16 opcode, u32 plen, + EXPORT_SYMBOL(__hci_cmd_send); + + /* Get data from the previously sent command */ +-void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode) ++static void *hci_cmd_data(struct sk_buff *skb, __u16 opcode) + { + struct hci_command_hdr *hdr; + +- if (!hdev->sent_cmd) ++ if (!skb || skb->len < HCI_COMMAND_HDR_SIZE) + return NULL; + +- hdr = (void *) hdev->sent_cmd->data; ++ hdr = (void *)skb->data; + + if (hdr->opcode != cpu_to_le16(opcode)) + return NULL; + +- BT_DBG("%s opcode 0x%4.4x", hdev->name, opcode); ++ return skb->data + HCI_COMMAND_HDR_SIZE; ++} + +- return hdev->sent_cmd->data + HCI_COMMAND_HDR_SIZE; ++/* Get data from the previously sent command */ ++void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode) ++{ ++ void *data; ++ ++ /* Check if opcode matches last sent command */ ++ data = hci_cmd_data(hdev->sent_cmd, opcode); ++ if (!data) ++ /* Check if opcode matches last request */ ++ data = hci_cmd_data(hdev->req_skb, opcode); ++ ++ return data; + } + + /* Get data from last received event */ +@@ -4040,17 +4053,19 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status, + if (!status && !hci_req_is_complete(hdev)) + return; + ++ skb = hdev->req_skb; ++ + /* If this was the last command in a request the complete +- * callback would be found in hdev->sent_cmd instead of the ++ * callback would be found in hdev->req_skb instead of the + * command queue (hdev->cmd_q). + */ +- if (bt_cb(hdev->sent_cmd)->hci.req_flags & HCI_REQ_SKB) { +- *req_complete_skb = bt_cb(hdev->sent_cmd)->hci.req_complete_skb; ++ if (skb && bt_cb(skb)->hci.req_flags & HCI_REQ_SKB) { ++ *req_complete_skb = bt_cb(skb)->hci.req_complete_skb; + return; + } + +- if (bt_cb(hdev->sent_cmd)->hci.req_complete) { +- *req_complete = bt_cb(hdev->sent_cmd)->hci.req_complete; ++ if (skb && bt_cb(skb)->hci.req_complete) { ++ *req_complete = bt_cb(skb)->hci.req_complete; + return; + } + +@@ -4167,8 +4182,11 @@ static void hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb) + return; + } + +- if (hci_req_status_pend(hdev)) +- hci_dev_set_flag(hdev, HCI_CMD_PENDING); ++ if (hci_req_status_pend(hdev) && ++ !hci_dev_test_and_set_flag(hdev, HCI_CMD_PENDING)) { ++ kfree_skb(hdev->req_skb); ++ hdev->req_skb = skb_clone(skb, GFP_KERNEL); ++ } + + atomic_dec(&hdev->cmd_cnt); + } +diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c +index 9ee66b393981b..6275b14b56927 100644 +--- a/net/bluetooth/hci_event.c ++++ b/net/bluetooth/hci_event.c +@@ -4381,7 +4381,7 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, void *data, + * (since for this kind of commands there will not be a command + * complete event). + */ +- if (ev->status || (hdev->sent_cmd && !hci_skb_event(hdev->sent_cmd))) { ++ if (ev->status || (hdev->req_skb && !hci_skb_event(hdev->req_skb))) { + hci_req_cmd_complete(hdev, *opcode, ev->status, req_complete, + req_complete_skb); + if (hci_dev_test_flag(hdev, HCI_CMD_PENDING)) { +@@ -7327,10 +7327,10 @@ static void hci_le_meta_evt(struct hci_dev *hdev, void *data, + bt_dev_dbg(hdev, "subevent 0x%2.2x", ev->subevent); + + /* Only match event if command OGF is for LE */ +- if (hdev->sent_cmd && +- hci_opcode_ogf(hci_skb_opcode(hdev->sent_cmd)) == 0x08 && +- hci_skb_event(hdev->sent_cmd) == ev->subevent) { +- *opcode = hci_skb_opcode(hdev->sent_cmd); ++ if (hdev->req_skb && ++ hci_opcode_ogf(hci_skb_opcode(hdev->req_skb)) == 0x08 && ++ hci_skb_event(hdev->req_skb) == ev->subevent) { ++ *opcode = hci_skb_opcode(hdev->req_skb); + hci_req_cmd_complete(hdev, *opcode, 0x00, req_complete, + req_complete_skb); + } +@@ -7717,10 +7717,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) + } + + /* Only match event if command OGF is not for LE */ +- if (hdev->sent_cmd && +- hci_opcode_ogf(hci_skb_opcode(hdev->sent_cmd)) != 0x08 && +- hci_skb_event(hdev->sent_cmd) == event) { +- hci_req_cmd_complete(hdev, hci_skb_opcode(hdev->sent_cmd), ++ if (hdev->req_skb && ++ hci_opcode_ogf(hci_skb_opcode(hdev->req_skb)) != 0x08 && ++ hci_skb_event(hdev->req_skb) == event) { ++ hci_req_cmd_complete(hdev, hci_skb_opcode(hdev->req_skb), + status, &req_complete, &req_complete_skb); + req_evt = event; + } +diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c +index 5236fe72a8553..684a6ac02b80d 100644 +--- a/net/bluetooth/hci_sync.c ++++ b/net/bluetooth/hci_sync.c +@@ -32,6 +32,10 @@ static void hci_cmd_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode, + hdev->req_result = result; + hdev->req_status = HCI_REQ_DONE; + ++ /* Free the request command so it is not used as response */ ++ kfree_skb(hdev->req_skb); ++ hdev->req_skb = NULL; ++ + if (skb) { + struct sock *sk = hci_skb_sk(skb); + +@@ -39,7 +43,7 @@ static void hci_cmd_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode, + if (sk) + sock_put(sk); + +- hdev->req_skb = skb_get(skb); ++ hdev->req_rsp = skb_get(skb); + } + + wake_up_interruptible(&hdev->req_wait_q); +@@ -187,8 +191,8 @@ struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen, + + hdev->req_status = 0; + hdev->req_result = 0; +- skb = hdev->req_skb; +- hdev->req_skb = NULL; ++ skb = hdev->req_rsp; ++ hdev->req_rsp = NULL; + + bt_dev_dbg(hdev, "end: err %d", err); + +@@ -4836,6 +4840,11 @@ int hci_dev_open_sync(struct hci_dev *hdev) + hdev->sent_cmd = NULL; + } + ++ if (hdev->req_skb) { ++ kfree_skb(hdev->req_skb); ++ hdev->req_skb = NULL; ++ } ++ + clear_bit(HCI_RUNNING, &hdev->flags); + hci_sock_dev_event(hdev, HCI_DEV_CLOSE); + +@@ -4996,6 +5005,12 @@ int hci_dev_close_sync(struct hci_dev *hdev) + hdev->sent_cmd = NULL; + } + ++ /* Drop last request */ ++ if (hdev->req_skb) { ++ kfree_skb(hdev->req_skb); ++ hdev->req_skb = NULL; ++ } ++ + clear_bit(HCI_RUNNING, &hdev->flags); + hci_sock_dev_event(hdev, HCI_DEV_CLOSE); + +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-mgmt-remove-leftover-queuing-of-power_off-.patch b/queue-6.8/bluetooth-mgmt-remove-leftover-queuing-of-power_off-.patch new file mode 100644 index 00000000000..267e655a8e5 --- /dev/null +++ b/queue-6.8/bluetooth-mgmt-remove-leftover-queuing-of-power_off-.patch @@ -0,0 +1,78 @@ +From 97e28c46c20c89864376b8d949490585ea9c9329 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Jan 2024 19:02:48 +0100 +Subject: Bluetooth: mgmt: Remove leftover queuing of power_off work +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jonas Dreßler + +[ Upstream commit fee054b7579fe252f8b9e6c17b9c5bfdaa84dd7e ] + +Queuing of power_off work was introduced in these functions with commits +8b064a3ad377 ("Bluetooth: Clean up HCI state when doing power off") and +c9910d0fb4fc ("Bluetooth: Fix disconnecting connections in non-connected +states") in an effort to clean up state and do things like disconnecting +devices before actually powering off the device. + +After that, commit a3172b7eb4a2 ("Bluetooth: Add timer to force power off") +introduced a timeout to ensure that the device actually got powered off, +even if some of the cleanup work would never complete. + +This code later got refactored with commit cf75ad8b41d2 ("Bluetooth: +hci_sync: Convert MGMT_SET_POWERED"), which made powering off the device +synchronous and removed the need for initiating the power_off work from +other places. The timeout mentioned above got removed too, because we now +also made use of the command timeout during power on/off. + +These days the power_off work still exists, but it only seems to only be +used for HCI_AUTO_OFF functionality, which is why we never noticed +those two leftover places where we queue power_off work. So let's remove +that code. + +Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") +Signed-off-by: Jonas Dreßler +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/mgmt.c | 16 ---------------- + 1 file changed, 16 deletions(-) + +diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c +index ee3b4aad8bd8d..688890f581cba 100644 +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -9766,14 +9766,6 @@ void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, + struct mgmt_ev_device_disconnected ev; + struct sock *sk = NULL; + +- /* The connection is still in hci_conn_hash so test for 1 +- * instead of 0 to know if this is the last one. +- */ +- if (mgmt_powering_down(hdev) && hci_conn_count(hdev) == 1) { +- cancel_delayed_work(&hdev->power_off); +- queue_work(hdev->req_workqueue, &hdev->power_off.work); +- } +- + if (!mgmt_connected) + return; + +@@ -9830,14 +9822,6 @@ void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, + { + struct mgmt_ev_connect_failed ev; + +- /* The connection is still in hci_conn_hash so test for 1 +- * instead of 0 to know if this is the last one. +- */ +- if (mgmt_powering_down(hdev) && hci_conn_count(hdev) == 1) { +- cancel_delayed_work(&hdev->power_off); +- queue_work(hdev->req_workqueue, &hdev->power_off.work); +- } +- + bacpy(&ev.addr.bdaddr, bdaddr); + ev.addr.type = link_to_bdaddr(link_type, addr_type); + ev.status = mgmt_status(status); +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-msft-fix-memory-leak.patch b/queue-6.8/bluetooth-msft-fix-memory-leak.patch new file mode 100644 index 00000000000..993c2558eb6 --- /dev/null +++ b/queue-6.8/bluetooth-msft-fix-memory-leak.patch @@ -0,0 +1,42 @@ +From 1a058990cf39bfcb3bd8153451408ebdb402baaf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Feb 2024 10:56:49 -0500 +Subject: Bluetooth: msft: Fix memory leak + +From: Luiz Augusto von Dentz + +[ Upstream commit a6e06258f4c31eba0fcd503e19828b5f8fe7b08b ] + +Fix leaking buffer allocated to send MSFT_OP_LE_MONITOR_ADVERTISEMENT. + +Fixes: 9e14606d8f38 ("Bluetooth: msft: Extended monitor tracking by address filter") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/msft.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c +index 630e3023273b2..9612c5d1b13f6 100644 +--- a/net/bluetooth/msft.c ++++ b/net/bluetooth/msft.c +@@ -875,6 +875,7 @@ static int msft_add_address_filter_sync(struct hci_dev *hdev, void *data) + remove = true; + goto done; + } ++ + cp->sub_opcode = MSFT_OP_LE_MONITOR_ADVERTISEMENT; + cp->rssi_high = address_filter->rssi_high; + cp->rssi_low = address_filter->rssi_low; +@@ -887,6 +888,8 @@ static int msft_add_address_filter_sync(struct hci_dev *hdev, void *data) + + skb = __hci_cmd_sync(hdev, hdev->msft_opcode, size, cp, + HCI_CMD_TIMEOUT); ++ kfree(cp); ++ + if (IS_ERR(skb)) { + bt_dev_err(hdev, "Failed to enable address %pMR filter", + &address_filter->bdaddr); +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-remove-bt_hs.patch b/queue-6.8/bluetooth-remove-bt_hs.patch new file mode 100644 index 00000000000..651c93c78fc --- /dev/null +++ b/queue-6.8/bluetooth-remove-bt_hs.patch @@ -0,0 +1,3573 @@ +From 7b71d52eae6e57cd36ef4b9f67d509f91a49d83e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 1 Feb 2024 11:18:58 -0500 +Subject: Bluetooth: Remove BT_HS + +From: Luiz Augusto von Dentz + +[ Upstream commit e7b02296fb400ee64822fbdd81a0718449066333 ] + +High Speed, Alternate MAC and PHY (AMP) extension, has been removed from +Bluetooth Core specification on 5.3: + +https://www.bluetooth.com/blog/new-core-specification-v5-3-feature-enhancements/ + +Fixes: 244bc377591c ("Bluetooth: Add BT_HS config option") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + include/net/bluetooth/hci.h | 1 - + include/net/bluetooth/l2cap.h | 42 -- + net/bluetooth/Kconfig | 8 - + net/bluetooth/Makefile | 1 - + net/bluetooth/a2mp.c | 1054 -------------------------------- + net/bluetooth/a2mp.h | 154 ----- + net/bluetooth/amp.c | 590 ------------------ + net/bluetooth/amp.h | 60 -- + net/bluetooth/hci_conn.c | 4 - + net/bluetooth/hci_event.c | 2 - + net/bluetooth/l2cap_core.c | 1069 +-------------------------------- + net/bluetooth/l2cap_sock.c | 18 +- + net/bluetooth/mgmt.c | 73 +-- + 13 files changed, 20 insertions(+), 3056 deletions(-) + delete mode 100644 net/bluetooth/a2mp.c + delete mode 100644 net/bluetooth/a2mp.h + delete mode 100644 net/bluetooth/amp.c + delete mode 100644 net/bluetooth/amp.h + +diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h +index f7918c7551834..0d231024570a3 100644 +--- a/include/net/bluetooth/hci.h ++++ b/include/net/bluetooth/hci.h +@@ -393,7 +393,6 @@ enum { + HCI_LIMITED_PRIVACY, + HCI_RPA_EXPIRED, + HCI_RPA_RESOLVING, +- HCI_HS_ENABLED, + HCI_LE_ENABLED, + HCI_ADVERTISING, + HCI_ADVERTISING_CONNECTABLE, +diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h +index cf393e72d6ed6..92d7197f9a563 100644 +--- a/include/net/bluetooth/l2cap.h ++++ b/include/net/bluetooth/l2cap.h +@@ -59,8 +59,6 @@ + #define L2CAP_WAIT_ACK_POLL_PERIOD msecs_to_jiffies(200) + #define L2CAP_WAIT_ACK_TIMEOUT msecs_to_jiffies(10000) + +-#define L2CAP_A2MP_DEFAULT_MTU 670 +- + /* L2CAP socket address */ + struct sockaddr_l2 { + sa_family_t l2_family; +@@ -109,12 +107,6 @@ struct l2cap_conninfo { + #define L2CAP_ECHO_RSP 0x09 + #define L2CAP_INFO_REQ 0x0a + #define L2CAP_INFO_RSP 0x0b +-#define L2CAP_CREATE_CHAN_REQ 0x0c +-#define L2CAP_CREATE_CHAN_RSP 0x0d +-#define L2CAP_MOVE_CHAN_REQ 0x0e +-#define L2CAP_MOVE_CHAN_RSP 0x0f +-#define L2CAP_MOVE_CHAN_CFM 0x10 +-#define L2CAP_MOVE_CHAN_CFM_RSP 0x11 + #define L2CAP_CONN_PARAM_UPDATE_REQ 0x12 + #define L2CAP_CONN_PARAM_UPDATE_RSP 0x13 + #define L2CAP_LE_CONN_REQ 0x14 +@@ -144,7 +136,6 @@ struct l2cap_conninfo { + /* L2CAP fixed channels */ + #define L2CAP_FC_SIG_BREDR 0x02 + #define L2CAP_FC_CONNLESS 0x04 +-#define L2CAP_FC_A2MP 0x08 + #define L2CAP_FC_ATT 0x10 + #define L2CAP_FC_SIG_LE 0x20 + #define L2CAP_FC_SMP_LE 0x40 +@@ -267,7 +258,6 @@ struct l2cap_conn_rsp { + /* channel identifier */ + #define L2CAP_CID_SIGNALING 0x0001 + #define L2CAP_CID_CONN_LESS 0x0002 +-#define L2CAP_CID_A2MP 0x0003 + #define L2CAP_CID_ATT 0x0004 + #define L2CAP_CID_LE_SIGNALING 0x0005 + #define L2CAP_CID_SMP 0x0006 +@@ -282,7 +272,6 @@ struct l2cap_conn_rsp { + #define L2CAP_CR_BAD_PSM 0x0002 + #define L2CAP_CR_SEC_BLOCK 0x0003 + #define L2CAP_CR_NO_MEM 0x0004 +-#define L2CAP_CR_BAD_AMP 0x0005 + #define L2CAP_CR_INVALID_SCID 0x0006 + #define L2CAP_CR_SCID_IN_USE 0x0007 + +@@ -404,29 +393,6 @@ struct l2cap_info_rsp { + __u8 data[]; + } __packed; + +-struct l2cap_create_chan_req { +- __le16 psm; +- __le16 scid; +- __u8 amp_id; +-} __packed; +- +-struct l2cap_create_chan_rsp { +- __le16 dcid; +- __le16 scid; +- __le16 result; +- __le16 status; +-} __packed; +- +-struct l2cap_move_chan_req { +- __le16 icid; +- __u8 dest_amp_id; +-} __packed; +- +-struct l2cap_move_chan_rsp { +- __le16 icid; +- __le16 result; +-} __packed; +- + #define L2CAP_MR_SUCCESS 0x0000 + #define L2CAP_MR_PEND 0x0001 + #define L2CAP_MR_BAD_ID 0x0002 +@@ -539,8 +505,6 @@ struct l2cap_seq_list { + + struct l2cap_chan { + struct l2cap_conn *conn; +- struct hci_conn *hs_hcon; +- struct hci_chan *hs_hchan; + struct kref kref; + atomic_t nesting; + +@@ -591,12 +555,6 @@ struct l2cap_chan { + unsigned long conn_state; + unsigned long flags; + +- __u8 remote_amp_id; +- __u8 local_amp_id; +- __u8 move_id; +- __u8 move_state; +- __u8 move_role; +- + __u16 next_tx_seq; + __u16 expected_ack_seq; + __u16 expected_tx_seq; +diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig +index da7cac0a1b716..6b2b65a667008 100644 +--- a/net/bluetooth/Kconfig ++++ b/net/bluetooth/Kconfig +@@ -62,14 +62,6 @@ source "net/bluetooth/cmtp/Kconfig" + + source "net/bluetooth/hidp/Kconfig" + +-config BT_HS +- bool "Bluetooth High Speed (HS) features" +- depends on BT_BREDR +- help +- Bluetooth High Speed includes support for off-loading +- Bluetooth connections via 802.11 (wifi) physical layer +- available with Bluetooth version 3.0 or later. +- + config BT_LE + bool "Bluetooth Low Energy (LE) features" + depends on BT +diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile +index 141ac1fda0bfa..628d448d78be3 100644 +--- a/net/bluetooth/Makefile ++++ b/net/bluetooth/Makefile +@@ -21,7 +21,6 @@ bluetooth-$(CONFIG_DEV_COREDUMP) += coredump.o + + bluetooth-$(CONFIG_BT_BREDR) += sco.o + bluetooth-$(CONFIG_BT_LE) += iso.o +-bluetooth-$(CONFIG_BT_HS) += a2mp.o amp.o + bluetooth-$(CONFIG_BT_LEDS) += leds.o + bluetooth-$(CONFIG_BT_MSFTEXT) += msft.o + bluetooth-$(CONFIG_BT_AOSPEXT) += aosp.o +diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c +deleted file mode 100644 +index e7adb8a98cf90..0000000000000 +--- a/net/bluetooth/a2mp.c ++++ /dev/null +@@ -1,1054 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-only +-/* +- Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved. +- Copyright (c) 2011,2012 Intel Corp. +- +-*/ +- +-#include +-#include +-#include +- +-#include "hci_request.h" +-#include "a2mp.h" +-#include "amp.h" +- +-#define A2MP_FEAT_EXT 0x8000 +- +-/* Global AMP Manager list */ +-static LIST_HEAD(amp_mgr_list); +-static DEFINE_MUTEX(amp_mgr_list_lock); +- +-/* A2MP build & send command helper functions */ +-static struct a2mp_cmd *__a2mp_build(u8 code, u8 ident, u16 len, void *data) +-{ +- struct a2mp_cmd *cmd; +- int plen; +- +- plen = sizeof(*cmd) + len; +- cmd = kzalloc(plen, GFP_KERNEL); +- if (!cmd) +- return NULL; +- +- cmd->code = code; +- cmd->ident = ident; +- cmd->len = cpu_to_le16(len); +- +- memcpy(cmd->data, data, len); +- +- return cmd; +-} +- +-static void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data) +-{ +- struct l2cap_chan *chan = mgr->a2mp_chan; +- struct a2mp_cmd *cmd; +- u16 total_len = len + sizeof(*cmd); +- struct kvec iv; +- struct msghdr msg; +- +- cmd = __a2mp_build(code, ident, len, data); +- if (!cmd) +- return; +- +- iv.iov_base = cmd; +- iv.iov_len = total_len; +- +- memset(&msg, 0, sizeof(msg)); +- +- iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, &iv, 1, total_len); +- +- l2cap_chan_send(chan, &msg, total_len); +- +- kfree(cmd); +-} +- +-static u8 __next_ident(struct amp_mgr *mgr) +-{ +- if (++mgr->ident == 0) +- mgr->ident = 1; +- +- return mgr->ident; +-} +- +-static struct amp_mgr *amp_mgr_lookup_by_state(u8 state) +-{ +- struct amp_mgr *mgr; +- +- mutex_lock(&_mgr_list_lock); +- list_for_each_entry(mgr, &_mgr_list, list) { +- if (test_and_clear_bit(state, &mgr->state)) { +- amp_mgr_get(mgr); +- mutex_unlock(&_mgr_list_lock); +- return mgr; +- } +- } +- mutex_unlock(&_mgr_list_lock); +- +- return NULL; +-} +- +-/* hci_dev_list shall be locked */ +-static void __a2mp_add_cl(struct amp_mgr *mgr, struct a2mp_cl *cl) +-{ +- struct hci_dev *hdev; +- int i = 1; +- +- cl[0].id = AMP_ID_BREDR; +- cl[0].type = AMP_TYPE_BREDR; +- cl[0].status = AMP_STATUS_BLUETOOTH_ONLY; +- +- list_for_each_entry(hdev, &hci_dev_list, list) { +- if (hdev->dev_type == HCI_AMP) { +- cl[i].id = hdev->id; +- cl[i].type = hdev->amp_type; +- if (test_bit(HCI_UP, &hdev->flags)) +- cl[i].status = hdev->amp_status; +- else +- cl[i].status = AMP_STATUS_POWERED_DOWN; +- i++; +- } +- } +-} +- +-/* Processing A2MP messages */ +-static int a2mp_command_rej(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_cmd_rej *rej = (void *) skb->data; +- +- if (le16_to_cpu(hdr->len) < sizeof(*rej)) +- return -EINVAL; +- +- BT_DBG("ident %u reason %d", hdr->ident, le16_to_cpu(rej->reason)); +- +- skb_pull(skb, sizeof(*rej)); +- +- return 0; +-} +- +-static int a2mp_discover_req(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_discov_req *req = (void *) skb->data; +- u16 len = le16_to_cpu(hdr->len); +- struct a2mp_discov_rsp *rsp; +- u16 ext_feat; +- u8 num_ctrl; +- struct hci_dev *hdev; +- +- if (len < sizeof(*req)) +- return -EINVAL; +- +- skb_pull(skb, sizeof(*req)); +- +- ext_feat = le16_to_cpu(req->ext_feat); +- +- BT_DBG("mtu %d efm 0x%4.4x", le16_to_cpu(req->mtu), ext_feat); +- +- /* check that packet is not broken for now */ +- while (ext_feat & A2MP_FEAT_EXT) { +- if (len < sizeof(ext_feat)) +- return -EINVAL; +- +- ext_feat = get_unaligned_le16(skb->data); +- BT_DBG("efm 0x%4.4x", ext_feat); +- len -= sizeof(ext_feat); +- skb_pull(skb, sizeof(ext_feat)); +- } +- +- read_lock(&hci_dev_list_lock); +- +- /* at minimum the BR/EDR needs to be listed */ +- num_ctrl = 1; +- +- list_for_each_entry(hdev, &hci_dev_list, list) { +- if (hdev->dev_type == HCI_AMP) +- num_ctrl++; +- } +- +- len = struct_size(rsp, cl, num_ctrl); +- rsp = kmalloc(len, GFP_ATOMIC); +- if (!rsp) { +- read_unlock(&hci_dev_list_lock); +- return -ENOMEM; +- } +- +- rsp->mtu = cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU); +- rsp->ext_feat = 0; +- +- __a2mp_add_cl(mgr, rsp->cl); +- +- read_unlock(&hci_dev_list_lock); +- +- a2mp_send(mgr, A2MP_DISCOVER_RSP, hdr->ident, len, rsp); +- +- kfree(rsp); +- return 0; +-} +- +-static int a2mp_discover_rsp(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_discov_rsp *rsp = (void *) skb->data; +- u16 len = le16_to_cpu(hdr->len); +- struct a2mp_cl *cl; +- u16 ext_feat; +- bool found = false; +- +- if (len < sizeof(*rsp)) +- return -EINVAL; +- +- len -= sizeof(*rsp); +- skb_pull(skb, sizeof(*rsp)); +- +- ext_feat = le16_to_cpu(rsp->ext_feat); +- +- BT_DBG("mtu %d efm 0x%4.4x", le16_to_cpu(rsp->mtu), ext_feat); +- +- /* check that packet is not broken for now */ +- while (ext_feat & A2MP_FEAT_EXT) { +- if (len < sizeof(ext_feat)) +- return -EINVAL; +- +- ext_feat = get_unaligned_le16(skb->data); +- BT_DBG("efm 0x%4.4x", ext_feat); +- len -= sizeof(ext_feat); +- skb_pull(skb, sizeof(ext_feat)); +- } +- +- cl = (void *) skb->data; +- while (len >= sizeof(*cl)) { +- BT_DBG("Remote AMP id %u type %u status %u", cl->id, cl->type, +- cl->status); +- +- if (cl->id != AMP_ID_BREDR && cl->type != AMP_TYPE_BREDR) { +- struct a2mp_info_req req; +- +- found = true; +- +- memset(&req, 0, sizeof(req)); +- +- req.id = cl->id; +- a2mp_send(mgr, A2MP_GETINFO_REQ, __next_ident(mgr), +- sizeof(req), &req); +- } +- +- len -= sizeof(*cl); +- cl = skb_pull(skb, sizeof(*cl)); +- } +- +- /* Fall back to L2CAP init sequence */ +- if (!found) { +- struct l2cap_conn *conn = mgr->l2cap_conn; +- struct l2cap_chan *chan; +- +- mutex_lock(&conn->chan_lock); +- +- list_for_each_entry(chan, &conn->chan_l, list) { +- +- BT_DBG("chan %p state %s", chan, +- state_to_string(chan->state)); +- +- if (chan->scid == L2CAP_CID_A2MP) +- continue; +- +- l2cap_chan_lock(chan); +- +- if (chan->state == BT_CONNECT) +- l2cap_send_conn_req(chan); +- +- l2cap_chan_unlock(chan); +- } +- +- mutex_unlock(&conn->chan_lock); +- } +- +- return 0; +-} +- +-static int a2mp_change_notify(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_cl *cl = (void *) skb->data; +- +- while (skb->len >= sizeof(*cl)) { +- BT_DBG("Controller id %u type %u status %u", cl->id, cl->type, +- cl->status); +- cl = skb_pull(skb, sizeof(*cl)); +- } +- +- /* TODO send A2MP_CHANGE_RSP */ +- +- return 0; +-} +- +-static void read_local_amp_info_complete(struct hci_dev *hdev, u8 status, +- u16 opcode) +-{ +- BT_DBG("%s status 0x%2.2x", hdev->name, status); +- +- a2mp_send_getinfo_rsp(hdev); +-} +- +-static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_info_req *req = (void *) skb->data; +- struct hci_dev *hdev; +- struct hci_request hreq; +- int err = 0; +- +- if (le16_to_cpu(hdr->len) < sizeof(*req)) +- return -EINVAL; +- +- BT_DBG("id %u", req->id); +- +- hdev = hci_dev_get(req->id); +- if (!hdev || hdev->dev_type != HCI_AMP) { +- struct a2mp_info_rsp rsp; +- +- memset(&rsp, 0, sizeof(rsp)); +- +- rsp.id = req->id; +- rsp.status = A2MP_STATUS_INVALID_CTRL_ID; +- +- a2mp_send(mgr, A2MP_GETINFO_RSP, hdr->ident, sizeof(rsp), +- &rsp); +- +- goto done; +- } +- +- set_bit(READ_LOC_AMP_INFO, &mgr->state); +- hci_req_init(&hreq, hdev); +- hci_req_add(&hreq, HCI_OP_READ_LOCAL_AMP_INFO, 0, NULL); +- err = hci_req_run(&hreq, read_local_amp_info_complete); +- if (err < 0) +- a2mp_send_getinfo_rsp(hdev); +- +-done: +- if (hdev) +- hci_dev_put(hdev); +- +- skb_pull(skb, sizeof(*req)); +- return 0; +-} +- +-static int a2mp_getinfo_rsp(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_info_rsp *rsp = (struct a2mp_info_rsp *) skb->data; +- struct a2mp_amp_assoc_req req; +- struct amp_ctrl *ctrl; +- +- if (le16_to_cpu(hdr->len) < sizeof(*rsp)) +- return -EINVAL; +- +- BT_DBG("id %u status 0x%2.2x", rsp->id, rsp->status); +- +- if (rsp->status) +- return -EINVAL; +- +- ctrl = amp_ctrl_add(mgr, rsp->id); +- if (!ctrl) +- return -ENOMEM; +- +- memset(&req, 0, sizeof(req)); +- +- req.id = rsp->id; +- a2mp_send(mgr, A2MP_GETAMPASSOC_REQ, __next_ident(mgr), sizeof(req), +- &req); +- +- skb_pull(skb, sizeof(*rsp)); +- return 0; +-} +- +-static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_amp_assoc_req *req = (void *) skb->data; +- struct hci_dev *hdev; +- struct amp_mgr *tmp; +- +- if (le16_to_cpu(hdr->len) < sizeof(*req)) +- return -EINVAL; +- +- BT_DBG("id %u", req->id); +- +- /* Make sure that other request is not processed */ +- tmp = amp_mgr_lookup_by_state(READ_LOC_AMP_ASSOC); +- +- hdev = hci_dev_get(req->id); +- if (!hdev || hdev->amp_type == AMP_TYPE_BREDR || tmp) { +- struct a2mp_amp_assoc_rsp rsp; +- +- memset(&rsp, 0, sizeof(rsp)); +- rsp.id = req->id; +- +- if (tmp) { +- rsp.status = A2MP_STATUS_COLLISION_OCCURED; +- amp_mgr_put(tmp); +- } else { +- rsp.status = A2MP_STATUS_INVALID_CTRL_ID; +- } +- +- a2mp_send(mgr, A2MP_GETAMPASSOC_RSP, hdr->ident, sizeof(rsp), +- &rsp); +- +- goto done; +- } +- +- amp_read_loc_assoc(hdev, mgr); +- +-done: +- if (hdev) +- hci_dev_put(hdev); +- +- skb_pull(skb, sizeof(*req)); +- return 0; +-} +- +-static int a2mp_getampassoc_rsp(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_amp_assoc_rsp *rsp = (void *) skb->data; +- u16 len = le16_to_cpu(hdr->len); +- struct hci_dev *hdev; +- struct amp_ctrl *ctrl; +- struct hci_conn *hcon; +- size_t assoc_len; +- +- if (len < sizeof(*rsp)) +- return -EINVAL; +- +- assoc_len = len - sizeof(*rsp); +- +- BT_DBG("id %u status 0x%2.2x assoc len %zu", rsp->id, rsp->status, +- assoc_len); +- +- if (rsp->status) +- return -EINVAL; +- +- /* Save remote ASSOC data */ +- ctrl = amp_ctrl_lookup(mgr, rsp->id); +- if (ctrl) { +- u8 *assoc; +- +- assoc = kmemdup(rsp->amp_assoc, assoc_len, GFP_KERNEL); +- if (!assoc) { +- amp_ctrl_put(ctrl); +- return -ENOMEM; +- } +- +- ctrl->assoc = assoc; +- ctrl->assoc_len = assoc_len; +- ctrl->assoc_rem_len = assoc_len; +- ctrl->assoc_len_so_far = 0; +- +- amp_ctrl_put(ctrl); +- } +- +- /* Create Phys Link */ +- hdev = hci_dev_get(rsp->id); +- if (!hdev) +- return -EINVAL; +- +- hcon = phylink_add(hdev, mgr, rsp->id, true); +- if (!hcon) +- goto done; +- +- BT_DBG("Created hcon %p: loc:%u -> rem:%u", hcon, hdev->id, rsp->id); +- +- mgr->bredr_chan->remote_amp_id = rsp->id; +- +- amp_create_phylink(hdev, mgr, hcon); +- +-done: +- hci_dev_put(hdev); +- skb_pull(skb, len); +- return 0; +-} +- +-static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_physlink_req *req = (void *) skb->data; +- struct a2mp_physlink_rsp rsp; +- struct hci_dev *hdev; +- struct hci_conn *hcon; +- struct amp_ctrl *ctrl; +- +- if (le16_to_cpu(hdr->len) < sizeof(*req)) +- return -EINVAL; +- +- BT_DBG("local_id %u, remote_id %u", req->local_id, req->remote_id); +- +- memset(&rsp, 0, sizeof(rsp)); +- +- rsp.local_id = req->remote_id; +- rsp.remote_id = req->local_id; +- +- hdev = hci_dev_get(req->remote_id); +- if (!hdev || hdev->amp_type == AMP_TYPE_BREDR) { +- rsp.status = A2MP_STATUS_INVALID_CTRL_ID; +- goto send_rsp; +- } +- +- ctrl = amp_ctrl_lookup(mgr, rsp.remote_id); +- if (!ctrl) { +- ctrl = amp_ctrl_add(mgr, rsp.remote_id); +- if (ctrl) { +- amp_ctrl_get(ctrl); +- } else { +- rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION; +- goto send_rsp; +- } +- } +- +- if (ctrl) { +- size_t assoc_len = le16_to_cpu(hdr->len) - sizeof(*req); +- u8 *assoc; +- +- assoc = kmemdup(req->amp_assoc, assoc_len, GFP_KERNEL); +- if (!assoc) { +- amp_ctrl_put(ctrl); +- hci_dev_put(hdev); +- return -ENOMEM; +- } +- +- ctrl->assoc = assoc; +- ctrl->assoc_len = assoc_len; +- ctrl->assoc_rem_len = assoc_len; +- ctrl->assoc_len_so_far = 0; +- +- amp_ctrl_put(ctrl); +- } +- +- hcon = phylink_add(hdev, mgr, req->local_id, false); +- if (hcon) { +- amp_accept_phylink(hdev, mgr, hcon); +- rsp.status = A2MP_STATUS_SUCCESS; +- } else { +- rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION; +- } +- +-send_rsp: +- if (hdev) +- hci_dev_put(hdev); +- +- /* Reply error now and success after HCI Write Remote AMP Assoc +- command complete with success status +- */ +- if (rsp.status != A2MP_STATUS_SUCCESS) { +- a2mp_send(mgr, A2MP_CREATEPHYSLINK_RSP, hdr->ident, +- sizeof(rsp), &rsp); +- } else { +- set_bit(WRITE_REMOTE_AMP_ASSOC, &mgr->state); +- mgr->ident = hdr->ident; +- } +- +- skb_pull(skb, le16_to_cpu(hdr->len)); +- return 0; +-} +- +-static int a2mp_discphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- struct a2mp_physlink_req *req = (void *) skb->data; +- struct a2mp_physlink_rsp rsp; +- struct hci_dev *hdev; +- struct hci_conn *hcon; +- +- if (le16_to_cpu(hdr->len) < sizeof(*req)) +- return -EINVAL; +- +- BT_DBG("local_id %u remote_id %u", req->local_id, req->remote_id); +- +- memset(&rsp, 0, sizeof(rsp)); +- +- rsp.local_id = req->remote_id; +- rsp.remote_id = req->local_id; +- rsp.status = A2MP_STATUS_SUCCESS; +- +- hdev = hci_dev_get(req->remote_id); +- if (!hdev) { +- rsp.status = A2MP_STATUS_INVALID_CTRL_ID; +- goto send_rsp; +- } +- +- hcon = hci_conn_hash_lookup_ba(hdev, AMP_LINK, +- &mgr->l2cap_conn->hcon->dst); +- if (!hcon) { +- bt_dev_err(hdev, "no phys link exist"); +- rsp.status = A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS; +- goto clean; +- } +- +- /* TODO Disconnect Phys Link here */ +- +-clean: +- hci_dev_put(hdev); +- +-send_rsp: +- a2mp_send(mgr, A2MP_DISCONNPHYSLINK_RSP, hdr->ident, sizeof(rsp), &rsp); +- +- skb_pull(skb, sizeof(*req)); +- return 0; +-} +- +-static inline int a2mp_cmd_rsp(struct amp_mgr *mgr, struct sk_buff *skb, +- struct a2mp_cmd *hdr) +-{ +- BT_DBG("ident %u code 0x%2.2x", hdr->ident, hdr->code); +- +- skb_pull(skb, le16_to_cpu(hdr->len)); +- return 0; +-} +- +-/* Handle A2MP signalling */ +-static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) +-{ +- struct a2mp_cmd *hdr; +- struct amp_mgr *mgr = chan->data; +- int err = 0; +- +- amp_mgr_get(mgr); +- +- while (skb->len >= sizeof(*hdr)) { +- u16 len; +- +- hdr = (void *) skb->data; +- len = le16_to_cpu(hdr->len); +- +- BT_DBG("code 0x%2.2x id %u len %u", hdr->code, hdr->ident, len); +- +- skb_pull(skb, sizeof(*hdr)); +- +- if (len > skb->len || !hdr->ident) { +- err = -EINVAL; +- break; +- } +- +- mgr->ident = hdr->ident; +- +- switch (hdr->code) { +- case A2MP_COMMAND_REJ: +- a2mp_command_rej(mgr, skb, hdr); +- break; +- +- case A2MP_DISCOVER_REQ: +- err = a2mp_discover_req(mgr, skb, hdr); +- break; +- +- case A2MP_CHANGE_NOTIFY: +- err = a2mp_change_notify(mgr, skb, hdr); +- break; +- +- case A2MP_GETINFO_REQ: +- err = a2mp_getinfo_req(mgr, skb, hdr); +- break; +- +- case A2MP_GETAMPASSOC_REQ: +- err = a2mp_getampassoc_req(mgr, skb, hdr); +- break; +- +- case A2MP_CREATEPHYSLINK_REQ: +- err = a2mp_createphyslink_req(mgr, skb, hdr); +- break; +- +- case A2MP_DISCONNPHYSLINK_REQ: +- err = a2mp_discphyslink_req(mgr, skb, hdr); +- break; +- +- case A2MP_DISCOVER_RSP: +- err = a2mp_discover_rsp(mgr, skb, hdr); +- break; +- +- case A2MP_GETINFO_RSP: +- err = a2mp_getinfo_rsp(mgr, skb, hdr); +- break; +- +- case A2MP_GETAMPASSOC_RSP: +- err = a2mp_getampassoc_rsp(mgr, skb, hdr); +- break; +- +- case A2MP_CHANGE_RSP: +- case A2MP_CREATEPHYSLINK_RSP: +- case A2MP_DISCONNPHYSLINK_RSP: +- err = a2mp_cmd_rsp(mgr, skb, hdr); +- break; +- +- default: +- BT_ERR("Unknown A2MP sig cmd 0x%2.2x", hdr->code); +- err = -EINVAL; +- break; +- } +- } +- +- if (err) { +- struct a2mp_cmd_rej rej; +- +- memset(&rej, 0, sizeof(rej)); +- +- rej.reason = cpu_to_le16(0); +- hdr = (void *) skb->data; +- +- BT_DBG("Send A2MP Rej: cmd 0x%2.2x err %d", hdr->code, err); +- +- a2mp_send(mgr, A2MP_COMMAND_REJ, hdr->ident, sizeof(rej), +- &rej); +- } +- +- /* Always free skb and return success error code to prevent +- from sending L2CAP Disconnect over A2MP channel */ +- kfree_skb(skb); +- +- amp_mgr_put(mgr); +- +- return 0; +-} +- +-static void a2mp_chan_close_cb(struct l2cap_chan *chan) +-{ +- l2cap_chan_put(chan); +-} +- +-static void a2mp_chan_state_change_cb(struct l2cap_chan *chan, int state, +- int err) +-{ +- struct amp_mgr *mgr = chan->data; +- +- if (!mgr) +- return; +- +- BT_DBG("chan %p state %s", chan, state_to_string(state)); +- +- chan->state = state; +- +- switch (state) { +- case BT_CLOSED: +- if (mgr) +- amp_mgr_put(mgr); +- break; +- } +-} +- +-static struct sk_buff *a2mp_chan_alloc_skb_cb(struct l2cap_chan *chan, +- unsigned long hdr_len, +- unsigned long len, int nb) +-{ +- struct sk_buff *skb; +- +- skb = bt_skb_alloc(hdr_len + len, GFP_KERNEL); +- if (!skb) +- return ERR_PTR(-ENOMEM); +- +- return skb; +-} +- +-static const struct l2cap_ops a2mp_chan_ops = { +- .name = "L2CAP A2MP channel", +- .recv = a2mp_chan_recv_cb, +- .close = a2mp_chan_close_cb, +- .state_change = a2mp_chan_state_change_cb, +- .alloc_skb = a2mp_chan_alloc_skb_cb, +- +- /* Not implemented for A2MP */ +- .new_connection = l2cap_chan_no_new_connection, +- .teardown = l2cap_chan_no_teardown, +- .ready = l2cap_chan_no_ready, +- .defer = l2cap_chan_no_defer, +- .resume = l2cap_chan_no_resume, +- .set_shutdown = l2cap_chan_no_set_shutdown, +- .get_sndtimeo = l2cap_chan_no_get_sndtimeo, +-}; +- +-static struct l2cap_chan *a2mp_chan_open(struct l2cap_conn *conn, bool locked) +-{ +- struct l2cap_chan *chan; +- int err; +- +- chan = l2cap_chan_create(); +- if (!chan) +- return NULL; +- +- BT_DBG("chan %p", chan); +- +- chan->chan_type = L2CAP_CHAN_FIXED; +- chan->scid = L2CAP_CID_A2MP; +- chan->dcid = L2CAP_CID_A2MP; +- chan->omtu = L2CAP_A2MP_DEFAULT_MTU; +- chan->imtu = L2CAP_A2MP_DEFAULT_MTU; +- chan->flush_to = L2CAP_DEFAULT_FLUSH_TO; +- +- chan->ops = &a2mp_chan_ops; +- +- l2cap_chan_set_defaults(chan); +- chan->remote_max_tx = chan->max_tx; +- chan->remote_tx_win = chan->tx_win; +- +- chan->retrans_timeout = L2CAP_DEFAULT_RETRANS_TO; +- chan->monitor_timeout = L2CAP_DEFAULT_MONITOR_TO; +- +- skb_queue_head_init(&chan->tx_q); +- +- chan->mode = L2CAP_MODE_ERTM; +- +- err = l2cap_ertm_init(chan); +- if (err < 0) { +- l2cap_chan_del(chan, 0); +- return NULL; +- } +- +- chan->conf_state = 0; +- +- if (locked) +- __l2cap_chan_add(conn, chan); +- else +- l2cap_chan_add(conn, chan); +- +- chan->remote_mps = chan->omtu; +- chan->mps = chan->omtu; +- +- chan->state = BT_CONNECTED; +- +- return chan; +-} +- +-/* AMP Manager functions */ +-struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr) +-{ +- BT_DBG("mgr %p orig refcnt %d", mgr, kref_read(&mgr->kref)); +- +- kref_get(&mgr->kref); +- +- return mgr; +-} +- +-static void amp_mgr_destroy(struct kref *kref) +-{ +- struct amp_mgr *mgr = container_of(kref, struct amp_mgr, kref); +- +- BT_DBG("mgr %p", mgr); +- +- mutex_lock(&_mgr_list_lock); +- list_del(&mgr->list); +- mutex_unlock(&_mgr_list_lock); +- +- amp_ctrl_list_flush(mgr); +- kfree(mgr); +-} +- +-int amp_mgr_put(struct amp_mgr *mgr) +-{ +- BT_DBG("mgr %p orig refcnt %d", mgr, kref_read(&mgr->kref)); +- +- return kref_put(&mgr->kref, &_mgr_destroy); +-} +- +-static struct amp_mgr *amp_mgr_create(struct l2cap_conn *conn, bool locked) +-{ +- struct amp_mgr *mgr; +- struct l2cap_chan *chan; +- +- mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); +- if (!mgr) +- return NULL; +- +- BT_DBG("conn %p mgr %p", conn, mgr); +- +- mgr->l2cap_conn = conn; +- +- chan = a2mp_chan_open(conn, locked); +- if (!chan) { +- kfree(mgr); +- return NULL; +- } +- +- mgr->a2mp_chan = chan; +- chan->data = mgr; +- +- conn->hcon->amp_mgr = mgr; +- +- kref_init(&mgr->kref); +- +- /* Remote AMP ctrl list initialization */ +- INIT_LIST_HEAD(&mgr->amp_ctrls); +- mutex_init(&mgr->amp_ctrls_lock); +- +- mutex_lock(&_mgr_list_lock); +- list_add(&mgr->list, &_mgr_list); +- mutex_unlock(&_mgr_list_lock); +- +- return mgr; +-} +- +-struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, +- struct sk_buff *skb) +-{ +- struct amp_mgr *mgr; +- +- if (conn->hcon->type != ACL_LINK) +- return NULL; +- +- mgr = amp_mgr_create(conn, false); +- if (!mgr) { +- BT_ERR("Could not create AMP manager"); +- return NULL; +- } +- +- BT_DBG("mgr: %p chan %p", mgr, mgr->a2mp_chan); +- +- return mgr->a2mp_chan; +-} +- +-void a2mp_send_getinfo_rsp(struct hci_dev *hdev) +-{ +- struct amp_mgr *mgr; +- struct a2mp_info_rsp rsp; +- +- mgr = amp_mgr_lookup_by_state(READ_LOC_AMP_INFO); +- if (!mgr) +- return; +- +- BT_DBG("%s mgr %p", hdev->name, mgr); +- +- memset(&rsp, 0, sizeof(rsp)); +- +- rsp.id = hdev->id; +- rsp.status = A2MP_STATUS_INVALID_CTRL_ID; +- +- if (hdev->amp_type != AMP_TYPE_BREDR) { +- rsp.status = 0; +- rsp.total_bw = cpu_to_le32(hdev->amp_total_bw); +- rsp.max_bw = cpu_to_le32(hdev->amp_max_bw); +- rsp.min_latency = cpu_to_le32(hdev->amp_min_latency); +- rsp.pal_cap = cpu_to_le16(hdev->amp_pal_cap); +- rsp.assoc_size = cpu_to_le16(hdev->amp_assoc_size); +- } +- +- a2mp_send(mgr, A2MP_GETINFO_RSP, mgr->ident, sizeof(rsp), &rsp); +- amp_mgr_put(mgr); +-} +- +-void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status) +-{ +- struct amp_mgr *mgr; +- struct amp_assoc *loc_assoc = &hdev->loc_assoc; +- struct a2mp_amp_assoc_rsp *rsp; +- size_t len; +- +- mgr = amp_mgr_lookup_by_state(READ_LOC_AMP_ASSOC); +- if (!mgr) +- return; +- +- BT_DBG("%s mgr %p", hdev->name, mgr); +- +- len = sizeof(struct a2mp_amp_assoc_rsp) + loc_assoc->len; +- rsp = kzalloc(len, GFP_KERNEL); +- if (!rsp) { +- amp_mgr_put(mgr); +- return; +- } +- +- rsp->id = hdev->id; +- +- if (status) { +- rsp->status = A2MP_STATUS_INVALID_CTRL_ID; +- } else { +- rsp->status = A2MP_STATUS_SUCCESS; +- memcpy(rsp->amp_assoc, loc_assoc->data, loc_assoc->len); +- } +- +- a2mp_send(mgr, A2MP_GETAMPASSOC_RSP, mgr->ident, len, rsp); +- amp_mgr_put(mgr); +- kfree(rsp); +-} +- +-void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status) +-{ +- struct amp_mgr *mgr; +- struct amp_assoc *loc_assoc = &hdev->loc_assoc; +- struct a2mp_physlink_req *req; +- struct l2cap_chan *bredr_chan; +- size_t len; +- +- mgr = amp_mgr_lookup_by_state(READ_LOC_AMP_ASSOC_FINAL); +- if (!mgr) +- return; +- +- len = sizeof(*req) + loc_assoc->len; +- +- BT_DBG("%s mgr %p assoc_len %zu", hdev->name, mgr, len); +- +- req = kzalloc(len, GFP_KERNEL); +- if (!req) { +- amp_mgr_put(mgr); +- return; +- } +- +- bredr_chan = mgr->bredr_chan; +- if (!bredr_chan) +- goto clean; +- +- req->local_id = hdev->id; +- req->remote_id = bredr_chan->remote_amp_id; +- memcpy(req->amp_assoc, loc_assoc->data, loc_assoc->len); +- +- a2mp_send(mgr, A2MP_CREATEPHYSLINK_REQ, __next_ident(mgr), len, req); +- +-clean: +- amp_mgr_put(mgr); +- kfree(req); +-} +- +-void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status) +-{ +- struct amp_mgr *mgr; +- struct a2mp_physlink_rsp rsp; +- struct hci_conn *hs_hcon; +- +- mgr = amp_mgr_lookup_by_state(WRITE_REMOTE_AMP_ASSOC); +- if (!mgr) +- return; +- +- memset(&rsp, 0, sizeof(rsp)); +- +- hs_hcon = hci_conn_hash_lookup_state(hdev, AMP_LINK, BT_CONNECT); +- if (!hs_hcon) { +- rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION; +- } else { +- rsp.remote_id = hs_hcon->remote_id; +- rsp.status = A2MP_STATUS_SUCCESS; +- } +- +- BT_DBG("%s mgr %p hs_hcon %p status %u", hdev->name, mgr, hs_hcon, +- status); +- +- rsp.local_id = hdev->id; +- a2mp_send(mgr, A2MP_CREATEPHYSLINK_RSP, mgr->ident, sizeof(rsp), &rsp); +- amp_mgr_put(mgr); +-} +- +-void a2mp_discover_amp(struct l2cap_chan *chan) +-{ +- struct l2cap_conn *conn = chan->conn; +- struct amp_mgr *mgr = conn->hcon->amp_mgr; +- struct a2mp_discov_req req; +- +- BT_DBG("chan %p conn %p mgr %p", chan, conn, mgr); +- +- if (!mgr) { +- mgr = amp_mgr_create(conn, true); +- if (!mgr) +- return; +- } +- +- mgr->bredr_chan = chan; +- +- memset(&req, 0, sizeof(req)); +- +- req.mtu = cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU); +- req.ext_feat = 0; +- a2mp_send(mgr, A2MP_DISCOVER_REQ, 1, sizeof(req), &req); +-} +diff --git a/net/bluetooth/a2mp.h b/net/bluetooth/a2mp.h +deleted file mode 100644 +index 2fd253a61a2a1..0000000000000 +--- a/net/bluetooth/a2mp.h ++++ /dev/null +@@ -1,154 +0,0 @@ +-/* SPDX-License-Identifier: GPL-2.0-only */ +-/* +- Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved. +- Copyright (c) 2011,2012 Intel Corp. +- +-*/ +- +-#ifndef __A2MP_H +-#define __A2MP_H +- +-#include +- +-enum amp_mgr_state { +- READ_LOC_AMP_INFO, +- READ_LOC_AMP_ASSOC, +- READ_LOC_AMP_ASSOC_FINAL, +- WRITE_REMOTE_AMP_ASSOC, +-}; +- +-struct amp_mgr { +- struct list_head list; +- struct l2cap_conn *l2cap_conn; +- struct l2cap_chan *a2mp_chan; +- struct l2cap_chan *bredr_chan; +- struct kref kref; +- __u8 ident; +- __u8 handle; +- unsigned long state; +- unsigned long flags; +- +- struct list_head amp_ctrls; +- struct mutex amp_ctrls_lock; +-}; +- +-struct a2mp_cmd { +- __u8 code; +- __u8 ident; +- __le16 len; +- __u8 data[]; +-} __packed; +- +-/* A2MP command codes */ +-#define A2MP_COMMAND_REJ 0x01 +-struct a2mp_cmd_rej { +- __le16 reason; +- __u8 data[]; +-} __packed; +- +-#define A2MP_DISCOVER_REQ 0x02 +-struct a2mp_discov_req { +- __le16 mtu; +- __le16 ext_feat; +-} __packed; +- +-struct a2mp_cl { +- __u8 id; +- __u8 type; +- __u8 status; +-} __packed; +- +-#define A2MP_DISCOVER_RSP 0x03 +-struct a2mp_discov_rsp { +- __le16 mtu; +- __le16 ext_feat; +- struct a2mp_cl cl[]; +-} __packed; +- +-#define A2MP_CHANGE_NOTIFY 0x04 +-#define A2MP_CHANGE_RSP 0x05 +- +-#define A2MP_GETINFO_REQ 0x06 +-struct a2mp_info_req { +- __u8 id; +-} __packed; +- +-#define A2MP_GETINFO_RSP 0x07 +-struct a2mp_info_rsp { +- __u8 id; +- __u8 status; +- __le32 total_bw; +- __le32 max_bw; +- __le32 min_latency; +- __le16 pal_cap; +- __le16 assoc_size; +-} __packed; +- +-#define A2MP_GETAMPASSOC_REQ 0x08 +-struct a2mp_amp_assoc_req { +- __u8 id; +-} __packed; +- +-#define A2MP_GETAMPASSOC_RSP 0x09 +-struct a2mp_amp_assoc_rsp { +- __u8 id; +- __u8 status; +- __u8 amp_assoc[]; +-} __packed; +- +-#define A2MP_CREATEPHYSLINK_REQ 0x0A +-#define A2MP_DISCONNPHYSLINK_REQ 0x0C +-struct a2mp_physlink_req { +- __u8 local_id; +- __u8 remote_id; +- __u8 amp_assoc[]; +-} __packed; +- +-#define A2MP_CREATEPHYSLINK_RSP 0x0B +-#define A2MP_DISCONNPHYSLINK_RSP 0x0D +-struct a2mp_physlink_rsp { +- __u8 local_id; +- __u8 remote_id; +- __u8 status; +-} __packed; +- +-/* A2MP response status */ +-#define A2MP_STATUS_SUCCESS 0x00 +-#define A2MP_STATUS_INVALID_CTRL_ID 0x01 +-#define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02 +-#define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02 +-#define A2MP_STATUS_COLLISION_OCCURED 0x03 +-#define A2MP_STATUS_DISCONN_REQ_RECVD 0x04 +-#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 +-#define A2MP_STATUS_SECURITY_VIOLATION 0x06 +- +-struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); +- +-#if IS_ENABLED(CONFIG_BT_HS) +-int amp_mgr_put(struct amp_mgr *mgr); +-struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, +- struct sk_buff *skb); +-void a2mp_discover_amp(struct l2cap_chan *chan); +-#else +-static inline int amp_mgr_put(struct amp_mgr *mgr) +-{ +- return 0; +-} +- +-static inline struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, +- struct sk_buff *skb) +-{ +- return NULL; +-} +- +-static inline void a2mp_discover_amp(struct l2cap_chan *chan) +-{ +-} +-#endif +- +-void a2mp_send_getinfo_rsp(struct hci_dev *hdev); +-void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); +-void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); +-void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status); +- +-#endif /* __A2MP_H */ +diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c +deleted file mode 100644 +index 5d698f19868c5..0000000000000 +--- a/net/bluetooth/amp.c ++++ /dev/null +@@ -1,590 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0-only +-/* +- Copyright (c) 2011,2012 Intel Corp. +- +-*/ +- +-#include +-#include +-#include +-#include +- +-#include "hci_request.h" +-#include "a2mp.h" +-#include "amp.h" +- +-/* Remote AMP Controllers interface */ +-void amp_ctrl_get(struct amp_ctrl *ctrl) +-{ +- BT_DBG("ctrl %p orig refcnt %d", ctrl, +- kref_read(&ctrl->kref)); +- +- kref_get(&ctrl->kref); +-} +- +-static void amp_ctrl_destroy(struct kref *kref) +-{ +- struct amp_ctrl *ctrl = container_of(kref, struct amp_ctrl, kref); +- +- BT_DBG("ctrl %p", ctrl); +- +- kfree(ctrl->assoc); +- kfree(ctrl); +-} +- +-int amp_ctrl_put(struct amp_ctrl *ctrl) +-{ +- BT_DBG("ctrl %p orig refcnt %d", ctrl, +- kref_read(&ctrl->kref)); +- +- return kref_put(&ctrl->kref, &_ctrl_destroy); +-} +- +-struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id) +-{ +- struct amp_ctrl *ctrl; +- +- ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); +- if (!ctrl) +- return NULL; +- +- kref_init(&ctrl->kref); +- ctrl->id = id; +- +- mutex_lock(&mgr->amp_ctrls_lock); +- list_add(&ctrl->list, &mgr->amp_ctrls); +- mutex_unlock(&mgr->amp_ctrls_lock); +- +- BT_DBG("mgr %p ctrl %p", mgr, ctrl); +- +- return ctrl; +-} +- +-void amp_ctrl_list_flush(struct amp_mgr *mgr) +-{ +- struct amp_ctrl *ctrl, *n; +- +- BT_DBG("mgr %p", mgr); +- +- mutex_lock(&mgr->amp_ctrls_lock); +- list_for_each_entry_safe(ctrl, n, &mgr->amp_ctrls, list) { +- list_del(&ctrl->list); +- amp_ctrl_put(ctrl); +- } +- mutex_unlock(&mgr->amp_ctrls_lock); +-} +- +-struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id) +-{ +- struct amp_ctrl *ctrl; +- +- BT_DBG("mgr %p id %u", mgr, id); +- +- mutex_lock(&mgr->amp_ctrls_lock); +- list_for_each_entry(ctrl, &mgr->amp_ctrls, list) { +- if (ctrl->id == id) { +- amp_ctrl_get(ctrl); +- mutex_unlock(&mgr->amp_ctrls_lock); +- return ctrl; +- } +- } +- mutex_unlock(&mgr->amp_ctrls_lock); +- +- return NULL; +-} +- +-/* Physical Link interface */ +-static u8 __next_handle(struct amp_mgr *mgr) +-{ +- if (++mgr->handle == 0) +- mgr->handle = 1; +- +- return mgr->handle; +-} +- +-struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, +- u8 remote_id, bool out) +-{ +- bdaddr_t *dst = &mgr->l2cap_conn->hcon->dst; +- struct hci_conn *hcon; +- u8 role = out ? HCI_ROLE_MASTER : HCI_ROLE_SLAVE; +- +- hcon = hci_conn_add(hdev, AMP_LINK, dst, role, __next_handle(mgr)); +- if (!hcon) +- return NULL; +- +- BT_DBG("hcon %p dst %pMR", hcon, dst); +- +- hcon->state = BT_CONNECT; +- hcon->attempt++; +- hcon->remote_id = remote_id; +- hcon->amp_mgr = amp_mgr_get(mgr); +- +- return hcon; +-} +- +-/* AMP crypto key generation interface */ +-static int hmac_sha256(u8 *key, u8 ksize, char *plaintext, u8 psize, u8 *output) +-{ +- struct crypto_shash *tfm; +- struct shash_desc *shash; +- int ret; +- +- if (!ksize) +- return -EINVAL; +- +- tfm = crypto_alloc_shash("hmac(sha256)", 0, 0); +- if (IS_ERR(tfm)) { +- BT_DBG("crypto_alloc_ahash failed: err %ld", PTR_ERR(tfm)); +- return PTR_ERR(tfm); +- } +- +- ret = crypto_shash_setkey(tfm, key, ksize); +- if (ret) { +- BT_DBG("crypto_ahash_setkey failed: err %d", ret); +- goto failed; +- } +- +- shash = kzalloc(sizeof(*shash) + crypto_shash_descsize(tfm), +- GFP_KERNEL); +- if (!shash) { +- ret = -ENOMEM; +- goto failed; +- } +- +- shash->tfm = tfm; +- +- ret = crypto_shash_digest(shash, plaintext, psize, output); +- +- kfree(shash); +- +-failed: +- crypto_free_shash(tfm); +- return ret; +-} +- +-int phylink_gen_key(struct hci_conn *conn, u8 *data, u8 *len, u8 *type) +-{ +- struct hci_dev *hdev = conn->hdev; +- struct link_key *key; +- u8 keybuf[HCI_AMP_LINK_KEY_SIZE]; +- u8 gamp_key[HCI_AMP_LINK_KEY_SIZE]; +- int err; +- +- if (!hci_conn_check_link_mode(conn)) +- return -EACCES; +- +- BT_DBG("conn %p key_type %d", conn, conn->key_type); +- +- /* Legacy key */ +- if (conn->key_type < 3) { +- bt_dev_err(hdev, "legacy key type %u", conn->key_type); +- return -EACCES; +- } +- +- *type = conn->key_type; +- *len = HCI_AMP_LINK_KEY_SIZE; +- +- key = hci_find_link_key(hdev, &conn->dst); +- if (!key) { +- BT_DBG("No Link key for conn %p dst %pMR", conn, &conn->dst); +- return -EACCES; +- } +- +- /* BR/EDR Link Key concatenated together with itself */ +- memcpy(&keybuf[0], key->val, HCI_LINK_KEY_SIZE); +- memcpy(&keybuf[HCI_LINK_KEY_SIZE], key->val, HCI_LINK_KEY_SIZE); +- +- /* Derive Generic AMP Link Key (gamp) */ +- err = hmac_sha256(keybuf, HCI_AMP_LINK_KEY_SIZE, "gamp", 4, gamp_key); +- if (err) { +- bt_dev_err(hdev, "could not derive Generic AMP Key: err %d", err); +- return err; +- } +- +- if (conn->key_type == HCI_LK_DEBUG_COMBINATION) { +- BT_DBG("Use Generic AMP Key (gamp)"); +- memcpy(data, gamp_key, HCI_AMP_LINK_KEY_SIZE); +- return err; +- } +- +- /* Derive Dedicated AMP Link Key: "802b" is 802.11 PAL keyID */ +- return hmac_sha256(gamp_key, HCI_AMP_LINK_KEY_SIZE, "802b", 4, data); +-} +- +-static void read_local_amp_assoc_complete(struct hci_dev *hdev, u8 status, +- u16 opcode, struct sk_buff *skb) +-{ +- struct hci_rp_read_local_amp_assoc *rp = (void *)skb->data; +- struct amp_assoc *assoc = &hdev->loc_assoc; +- size_t rem_len, frag_len; +- +- BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); +- +- if (rp->status) +- goto send_rsp; +- +- frag_len = skb->len - sizeof(*rp); +- rem_len = __le16_to_cpu(rp->rem_len); +- +- if (rem_len > frag_len) { +- BT_DBG("frag_len %zu rem_len %zu", frag_len, rem_len); +- +- memcpy(assoc->data + assoc->offset, rp->frag, frag_len); +- assoc->offset += frag_len; +- +- /* Read other fragments */ +- amp_read_loc_assoc_frag(hdev, rp->phy_handle); +- +- return; +- } +- +- memcpy(assoc->data + assoc->offset, rp->frag, rem_len); +- assoc->len = assoc->offset + rem_len; +- assoc->offset = 0; +- +-send_rsp: +- /* Send A2MP Rsp when all fragments are received */ +- a2mp_send_getampassoc_rsp(hdev, rp->status); +- a2mp_send_create_phy_link_req(hdev, rp->status); +-} +- +-void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle) +-{ +- struct hci_cp_read_local_amp_assoc cp; +- struct amp_assoc *loc_assoc = &hdev->loc_assoc; +- struct hci_request req; +- int err; +- +- BT_DBG("%s handle %u", hdev->name, phy_handle); +- +- cp.phy_handle = phy_handle; +- cp.max_len = cpu_to_le16(hdev->amp_assoc_size); +- cp.len_so_far = cpu_to_le16(loc_assoc->offset); +- +- hci_req_init(&req, hdev); +- hci_req_add(&req, HCI_OP_READ_LOCAL_AMP_ASSOC, sizeof(cp), &cp); +- err = hci_req_run_skb(&req, read_local_amp_assoc_complete); +- if (err < 0) +- a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID); +-} +- +-void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr) +-{ +- struct hci_cp_read_local_amp_assoc cp; +- struct hci_request req; +- int err; +- +- memset(&hdev->loc_assoc, 0, sizeof(struct amp_assoc)); +- memset(&cp, 0, sizeof(cp)); +- +- cp.max_len = cpu_to_le16(hdev->amp_assoc_size); +- +- set_bit(READ_LOC_AMP_ASSOC, &mgr->state); +- hci_req_init(&req, hdev); +- hci_req_add(&req, HCI_OP_READ_LOCAL_AMP_ASSOC, sizeof(cp), &cp); +- err = hci_req_run_skb(&req, read_local_amp_assoc_complete); +- if (err < 0) +- a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID); +-} +- +-void amp_read_loc_assoc_final_data(struct hci_dev *hdev, +- struct hci_conn *hcon) +-{ +- struct hci_cp_read_local_amp_assoc cp; +- struct amp_mgr *mgr = hcon->amp_mgr; +- struct hci_request req; +- int err; +- +- if (!mgr) +- return; +- +- cp.phy_handle = hcon->handle; +- cp.len_so_far = cpu_to_le16(0); +- cp.max_len = cpu_to_le16(hdev->amp_assoc_size); +- +- set_bit(READ_LOC_AMP_ASSOC_FINAL, &mgr->state); +- +- /* Read Local AMP Assoc final link information data */ +- hci_req_init(&req, hdev); +- hci_req_add(&req, HCI_OP_READ_LOCAL_AMP_ASSOC, sizeof(cp), &cp); +- err = hci_req_run_skb(&req, read_local_amp_assoc_complete); +- if (err < 0) +- a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID); +-} +- +-static void write_remote_amp_assoc_complete(struct hci_dev *hdev, u8 status, +- u16 opcode, struct sk_buff *skb) +-{ +- struct hci_rp_write_remote_amp_assoc *rp = (void *)skb->data; +- +- BT_DBG("%s status 0x%2.2x phy_handle 0x%2.2x", +- hdev->name, rp->status, rp->phy_handle); +- +- if (rp->status) +- return; +- +- amp_write_rem_assoc_continue(hdev, rp->phy_handle); +-} +- +-/* Write AMP Assoc data fragments, returns true with last fragment written*/ +-static bool amp_write_rem_assoc_frag(struct hci_dev *hdev, +- struct hci_conn *hcon) +-{ +- struct hci_cp_write_remote_amp_assoc *cp; +- struct amp_mgr *mgr = hcon->amp_mgr; +- struct amp_ctrl *ctrl; +- struct hci_request req; +- u16 frag_len, len; +- +- ctrl = amp_ctrl_lookup(mgr, hcon->remote_id); +- if (!ctrl) +- return false; +- +- if (!ctrl->assoc_rem_len) { +- BT_DBG("all fragments are written"); +- ctrl->assoc_rem_len = ctrl->assoc_len; +- ctrl->assoc_len_so_far = 0; +- +- amp_ctrl_put(ctrl); +- return true; +- } +- +- frag_len = min_t(u16, 248, ctrl->assoc_rem_len); +- len = frag_len + sizeof(*cp); +- +- cp = kzalloc(len, GFP_KERNEL); +- if (!cp) { +- amp_ctrl_put(ctrl); +- return false; +- } +- +- BT_DBG("hcon %p ctrl %p frag_len %u assoc_len %u rem_len %u", +- hcon, ctrl, frag_len, ctrl->assoc_len, ctrl->assoc_rem_len); +- +- cp->phy_handle = hcon->handle; +- cp->len_so_far = cpu_to_le16(ctrl->assoc_len_so_far); +- cp->rem_len = cpu_to_le16(ctrl->assoc_rem_len); +- memcpy(cp->frag, ctrl->assoc, frag_len); +- +- ctrl->assoc_len_so_far += frag_len; +- ctrl->assoc_rem_len -= frag_len; +- +- amp_ctrl_put(ctrl); +- +- hci_req_init(&req, hdev); +- hci_req_add(&req, HCI_OP_WRITE_REMOTE_AMP_ASSOC, len, cp); +- hci_req_run_skb(&req, write_remote_amp_assoc_complete); +- +- kfree(cp); +- +- return false; +-} +- +-void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle) +-{ +- struct hci_conn *hcon; +- +- BT_DBG("%s phy handle 0x%2.2x", hdev->name, handle); +- +- hcon = hci_conn_hash_lookup_handle(hdev, handle); +- if (!hcon) +- return; +- +- /* Send A2MP create phylink rsp when all fragments are written */ +- if (amp_write_rem_assoc_frag(hdev, hcon)) +- a2mp_send_create_phy_link_rsp(hdev, 0); +-} +- +-void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle) +-{ +- struct hci_conn *hcon; +- +- BT_DBG("%s phy handle 0x%2.2x", hdev->name, handle); +- +- hcon = hci_conn_hash_lookup_handle(hdev, handle); +- if (!hcon) +- return; +- +- BT_DBG("%s phy handle 0x%2.2x hcon %p", hdev->name, handle, hcon); +- +- amp_write_rem_assoc_frag(hdev, hcon); +-} +- +-static void create_phylink_complete(struct hci_dev *hdev, u8 status, +- u16 opcode) +-{ +- struct hci_cp_create_phy_link *cp; +- +- BT_DBG("%s status 0x%2.2x", hdev->name, status); +- +- cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_PHY_LINK); +- if (!cp) +- return; +- +- hci_dev_lock(hdev); +- +- if (status) { +- struct hci_conn *hcon; +- +- hcon = hci_conn_hash_lookup_handle(hdev, cp->phy_handle); +- if (hcon) +- hci_conn_del(hcon); +- } else { +- amp_write_remote_assoc(hdev, cp->phy_handle); +- } +- +- hci_dev_unlock(hdev); +-} +- +-void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, +- struct hci_conn *hcon) +-{ +- struct hci_cp_create_phy_link cp; +- struct hci_request req; +- +- cp.phy_handle = hcon->handle; +- +- BT_DBG("%s hcon %p phy handle 0x%2.2x", hdev->name, hcon, +- hcon->handle); +- +- if (phylink_gen_key(mgr->l2cap_conn->hcon, cp.key, &cp.key_len, +- &cp.key_type)) { +- BT_DBG("Cannot create link key"); +- return; +- } +- +- hci_req_init(&req, hdev); +- hci_req_add(&req, HCI_OP_CREATE_PHY_LINK, sizeof(cp), &cp); +- hci_req_run(&req, create_phylink_complete); +-} +- +-static void accept_phylink_complete(struct hci_dev *hdev, u8 status, +- u16 opcode) +-{ +- struct hci_cp_accept_phy_link *cp; +- +- BT_DBG("%s status 0x%2.2x", hdev->name, status); +- +- if (status) +- return; +- +- cp = hci_sent_cmd_data(hdev, HCI_OP_ACCEPT_PHY_LINK); +- if (!cp) +- return; +- +- amp_write_remote_assoc(hdev, cp->phy_handle); +-} +- +-void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, +- struct hci_conn *hcon) +-{ +- struct hci_cp_accept_phy_link cp; +- struct hci_request req; +- +- cp.phy_handle = hcon->handle; +- +- BT_DBG("%s hcon %p phy handle 0x%2.2x", hdev->name, hcon, +- hcon->handle); +- +- if (phylink_gen_key(mgr->l2cap_conn->hcon, cp.key, &cp.key_len, +- &cp.key_type)) { +- BT_DBG("Cannot create link key"); +- return; +- } +- +- hci_req_init(&req, hdev); +- hci_req_add(&req, HCI_OP_ACCEPT_PHY_LINK, sizeof(cp), &cp); +- hci_req_run(&req, accept_phylink_complete); +-} +- +-void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon) +-{ +- struct hci_dev *bredr_hdev = hci_dev_hold(bredr_hcon->hdev); +- struct amp_mgr *mgr = hs_hcon->amp_mgr; +- struct l2cap_chan *bredr_chan; +- +- BT_DBG("bredr_hcon %p hs_hcon %p mgr %p", bredr_hcon, hs_hcon, mgr); +- +- if (!bredr_hdev || !mgr || !mgr->bredr_chan) +- return; +- +- bredr_chan = mgr->bredr_chan; +- +- l2cap_chan_lock(bredr_chan); +- +- set_bit(FLAG_EFS_ENABLE, &bredr_chan->flags); +- bredr_chan->remote_amp_id = hs_hcon->remote_id; +- bredr_chan->local_amp_id = hs_hcon->hdev->id; +- bredr_chan->hs_hcon = hs_hcon; +- bredr_chan->conn->mtu = hs_hcon->hdev->block_mtu; +- +- __l2cap_physical_cfm(bredr_chan, 0); +- +- l2cap_chan_unlock(bredr_chan); +- +- hci_dev_put(bredr_hdev); +-} +- +-void amp_create_logical_link(struct l2cap_chan *chan) +-{ +- struct hci_conn *hs_hcon = chan->hs_hcon; +- struct hci_cp_create_accept_logical_link cp; +- struct hci_dev *hdev; +- +- BT_DBG("chan %p hs_hcon %p dst %pMR", chan, hs_hcon, +- &chan->conn->hcon->dst); +- +- if (!hs_hcon) +- return; +- +- hdev = hci_dev_hold(chan->hs_hcon->hdev); +- if (!hdev) +- return; +- +- cp.phy_handle = hs_hcon->handle; +- +- cp.tx_flow_spec.id = chan->local_id; +- cp.tx_flow_spec.stype = chan->local_stype; +- cp.tx_flow_spec.msdu = cpu_to_le16(chan->local_msdu); +- cp.tx_flow_spec.sdu_itime = cpu_to_le32(chan->local_sdu_itime); +- cp.tx_flow_spec.acc_lat = cpu_to_le32(chan->local_acc_lat); +- cp.tx_flow_spec.flush_to = cpu_to_le32(chan->local_flush_to); +- +- cp.rx_flow_spec.id = chan->remote_id; +- cp.rx_flow_spec.stype = chan->remote_stype; +- cp.rx_flow_spec.msdu = cpu_to_le16(chan->remote_msdu); +- cp.rx_flow_spec.sdu_itime = cpu_to_le32(chan->remote_sdu_itime); +- cp.rx_flow_spec.acc_lat = cpu_to_le32(chan->remote_acc_lat); +- cp.rx_flow_spec.flush_to = cpu_to_le32(chan->remote_flush_to); +- +- if (hs_hcon->out) +- hci_send_cmd(hdev, HCI_OP_CREATE_LOGICAL_LINK, sizeof(cp), +- &cp); +- else +- hci_send_cmd(hdev, HCI_OP_ACCEPT_LOGICAL_LINK, sizeof(cp), +- &cp); +- +- hci_dev_put(hdev); +-} +- +-void amp_disconnect_logical_link(struct hci_chan *hchan) +-{ +- struct hci_conn *hcon = hchan->conn; +- struct hci_cp_disconn_logical_link cp; +- +- if (hcon->state != BT_CONNECTED) { +- BT_DBG("hchan %p not connected", hchan); +- return; +- } +- +- cp.log_handle = cpu_to_le16(hchan->handle); +- hci_send_cmd(hcon->hdev, HCI_OP_DISCONN_LOGICAL_LINK, sizeof(cp), &cp); +-} +- +-void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason) +-{ +- BT_DBG("hchan %p", hchan); +- +- hci_chan_del(hchan); +-} +diff --git a/net/bluetooth/amp.h b/net/bluetooth/amp.h +deleted file mode 100644 +index 97c87abd129f6..0000000000000 +--- a/net/bluetooth/amp.h ++++ /dev/null +@@ -1,60 +0,0 @@ +-/* SPDX-License-Identifier: GPL-2.0-only */ +-/* +- Copyright (c) 2011,2012 Intel Corp. +- +-*/ +- +-#ifndef __AMP_H +-#define __AMP_H +- +-struct amp_ctrl { +- struct list_head list; +- struct kref kref; +- __u8 id; +- __u16 assoc_len_so_far; +- __u16 assoc_rem_len; +- __u16 assoc_len; +- __u8 *assoc; +-}; +- +-int amp_ctrl_put(struct amp_ctrl *ctrl); +-void amp_ctrl_get(struct amp_ctrl *ctrl); +-struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id); +-struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id); +-void amp_ctrl_list_flush(struct amp_mgr *mgr); +- +-struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, +- u8 remote_id, bool out); +- +-int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type); +- +-void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); +-void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); +-void amp_read_loc_assoc_final_data(struct hci_dev *hdev, +- struct hci_conn *hcon); +-void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, +- struct hci_conn *hcon); +-void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, +- struct hci_conn *hcon); +- +-#if IS_ENABLED(CONFIG_BT_HS) +-void amp_create_logical_link(struct l2cap_chan *chan); +-void amp_disconnect_logical_link(struct hci_chan *hchan); +-#else +-static inline void amp_create_logical_link(struct l2cap_chan *chan) +-{ +-} +- +-static inline void amp_disconnect_logical_link(struct hci_chan *hchan) +-{ +-} +-#endif +- +-void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); +-void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); +-void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); +-void amp_create_logical_link(struct l2cap_chan *chan); +-void amp_disconnect_logical_link(struct hci_chan *hchan); +-void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); +- +-#endif /* __AMP_H */ +diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c +index a41d2693f4d8c..fc4d72f83ac25 100644 +--- a/net/bluetooth/hci_conn.c ++++ b/net/bluetooth/hci_conn.c +@@ -36,7 +36,6 @@ + + #include "hci_request.h" + #include "smp.h" +-#include "a2mp.h" + #include "eir.h" + + struct sco_param { +@@ -1175,9 +1174,6 @@ void hci_conn_del(struct hci_conn *conn) + } + } + +- if (conn->amp_mgr) +- amp_mgr_put(conn->amp_mgr); +- + skb_queue_purge(&conn->data_q); + + /* Remove the connection from the list and cleanup its remaining +diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c +index 1f63f77661dce..55daada8dc15d 100644 +--- a/net/bluetooth/hci_event.c ++++ b/net/bluetooth/hci_event.c +@@ -36,8 +36,6 @@ + #include "hci_request.h" + #include "hci_debugfs.h" + #include "hci_codec.h" +-#include "a2mp.h" +-#include "amp.h" + #include "smp.h" + #include "msft.h" + #include "eir.h" +diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c +index 656f49b299d20..ab5a9d42fae71 100644 +--- a/net/bluetooth/l2cap_core.c ++++ b/net/bluetooth/l2cap_core.c +@@ -39,8 +39,6 @@ + #include + + #include "smp.h" +-#include "a2mp.h" +-#include "amp.h" + + #define LE_FLOWCTL_MAX_CREDITS 65535 + +@@ -167,24 +165,6 @@ static struct l2cap_chan *__l2cap_get_chan_by_ident(struct l2cap_conn *conn, + return NULL; + } + +-static struct l2cap_chan *l2cap_get_chan_by_ident(struct l2cap_conn *conn, +- u8 ident) +-{ +- struct l2cap_chan *c; +- +- mutex_lock(&conn->chan_lock); +- c = __l2cap_get_chan_by_ident(conn, ident); +- if (c) { +- /* Only lock if chan reference is not 0 */ +- c = l2cap_chan_hold_unless_zero(c); +- if (c) +- l2cap_chan_lock(c); +- } +- mutex_unlock(&conn->chan_lock); +- +- return c; +-} +- + static struct l2cap_chan *__l2cap_global_chan_by_addr(__le16 psm, bdaddr_t *src, + u8 src_type) + { +@@ -651,7 +631,6 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err) + chan->ops->teardown(chan, err); + + if (conn) { +- struct amp_mgr *mgr = conn->hcon->amp_mgr; + /* Delete from channel list */ + list_del(&chan->list); + +@@ -666,16 +645,6 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err) + if (chan->chan_type != L2CAP_CHAN_FIXED || + test_bit(FLAG_HOLD_HCI_CONN, &chan->flags)) + hci_conn_drop(conn->hcon); +- +- if (mgr && mgr->bredr_chan == chan) +- mgr->bredr_chan = NULL; +- } +- +- if (chan->hs_hchan) { +- struct hci_chan *hs_hchan = chan->hs_hchan; +- +- BT_DBG("chan %p disconnect hs_hchan %p", chan, hs_hchan); +- amp_disconnect_logical_link(hs_hchan); + } + + if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state)) +@@ -977,12 +946,6 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, + hci_send_acl(conn->hchan, skb, flags); + } + +-static bool __chan_is_moving(struct l2cap_chan *chan) +-{ +- return chan->move_state != L2CAP_MOVE_STABLE && +- chan->move_state != L2CAP_MOVE_WAIT_PREPARE; +-} +- + static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb) + { + struct hci_conn *hcon = chan->conn->hcon; +@@ -991,15 +954,6 @@ static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb) + BT_DBG("chan %p, skb %p len %d priority %u", chan, skb, skb->len, + skb->priority); + +- if (chan->hs_hcon && !__chan_is_moving(chan)) { +- if (chan->hs_hchan) +- hci_send_acl(chan->hs_hchan, skb, ACL_COMPLETE); +- else +- kfree_skb(skb); +- +- return; +- } +- + /* Use NO_FLUSH for LE links (where this is the only option) or + * if the BR/EDR link supports it and flushing has not been + * explicitly requested (through FLAG_FLUSHABLE). +@@ -1180,9 +1134,6 @@ static void l2cap_send_sframe(struct l2cap_chan *chan, + if (!control->sframe) + return; + +- if (__chan_is_moving(chan)) +- return; +- + if (test_and_clear_bit(CONN_SEND_FBIT, &chan->conn_state) && + !control->poll) + control->final = 1; +@@ -1237,40 +1188,6 @@ static inline int __l2cap_no_conn_pending(struct l2cap_chan *chan) + return !test_bit(CONF_CONNECT_PEND, &chan->conf_state); + } + +-static bool __amp_capable(struct l2cap_chan *chan) +-{ +- struct l2cap_conn *conn = chan->conn; +- struct hci_dev *hdev; +- bool amp_available = false; +- +- if (!(conn->local_fixed_chan & L2CAP_FC_A2MP)) +- return false; +- +- if (!(conn->remote_fixed_chan & L2CAP_FC_A2MP)) +- return false; +- +- read_lock(&hci_dev_list_lock); +- list_for_each_entry(hdev, &hci_dev_list, list) { +- if (hdev->amp_type != AMP_TYPE_BREDR && +- test_bit(HCI_UP, &hdev->flags)) { +- amp_available = true; +- break; +- } +- } +- read_unlock(&hci_dev_list_lock); +- +- if (chan->chan_policy == BT_CHANNEL_POLICY_AMP_PREFERRED) +- return amp_available; +- +- return false; +-} +- +-static bool l2cap_check_efs(struct l2cap_chan *chan) +-{ +- /* Check EFS parameters */ +- return true; +-} +- + void l2cap_send_conn_req(struct l2cap_chan *chan) + { + struct l2cap_conn *conn = chan->conn; +@@ -1286,76 +1203,6 @@ void l2cap_send_conn_req(struct l2cap_chan *chan) + l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_REQ, sizeof(req), &req); + } + +-static void l2cap_send_create_chan_req(struct l2cap_chan *chan, u8 amp_id) +-{ +- struct l2cap_create_chan_req req; +- req.scid = cpu_to_le16(chan->scid); +- req.psm = chan->psm; +- req.amp_id = amp_id; +- +- chan->ident = l2cap_get_ident(chan->conn); +- +- l2cap_send_cmd(chan->conn, chan->ident, L2CAP_CREATE_CHAN_REQ, +- sizeof(req), &req); +-} +- +-static void l2cap_move_setup(struct l2cap_chan *chan) +-{ +- struct sk_buff *skb; +- +- BT_DBG("chan %p", chan); +- +- if (chan->mode != L2CAP_MODE_ERTM) +- return; +- +- __clear_retrans_timer(chan); +- __clear_monitor_timer(chan); +- __clear_ack_timer(chan); +- +- chan->retry_count = 0; +- skb_queue_walk(&chan->tx_q, skb) { +- if (bt_cb(skb)->l2cap.retries) +- bt_cb(skb)->l2cap.retries = 1; +- else +- break; +- } +- +- chan->expected_tx_seq = chan->buffer_seq; +- +- clear_bit(CONN_REJ_ACT, &chan->conn_state); +- clear_bit(CONN_SREJ_ACT, &chan->conn_state); +- l2cap_seq_list_clear(&chan->retrans_list); +- l2cap_seq_list_clear(&chan->srej_list); +- skb_queue_purge(&chan->srej_q); +- +- chan->tx_state = L2CAP_TX_STATE_XMIT; +- chan->rx_state = L2CAP_RX_STATE_MOVE; +- +- set_bit(CONN_REMOTE_BUSY, &chan->conn_state); +-} +- +-static void l2cap_move_done(struct l2cap_chan *chan) +-{ +- u8 move_role = chan->move_role; +- BT_DBG("chan %p", chan); +- +- chan->move_state = L2CAP_MOVE_STABLE; +- chan->move_role = L2CAP_MOVE_ROLE_NONE; +- +- if (chan->mode != L2CAP_MODE_ERTM) +- return; +- +- switch (move_role) { +- case L2CAP_MOVE_ROLE_INITIATOR: +- l2cap_tx(chan, NULL, NULL, L2CAP_EV_EXPLICIT_POLL); +- chan->rx_state = L2CAP_RX_STATE_WAIT_F; +- break; +- case L2CAP_MOVE_ROLE_RESPONDER: +- chan->rx_state = L2CAP_RX_STATE_WAIT_P; +- break; +- } +-} +- + static void l2cap_chan_ready(struct l2cap_chan *chan) + { + /* The channel may have already been flagged as connected in +@@ -1505,10 +1352,7 @@ static void l2cap_le_start(struct l2cap_chan *chan) + + static void l2cap_start_connection(struct l2cap_chan *chan) + { +- if (__amp_capable(chan)) { +- BT_DBG("chan %p AMP capable: discover AMPs", chan); +- a2mp_discover_amp(chan); +- } else if (chan->conn->hcon->type == LE_LINK) { ++ if (chan->conn->hcon->type == LE_LINK) { + l2cap_le_start(chan); + } else { + l2cap_send_conn_req(chan); +@@ -1611,11 +1455,6 @@ static void l2cap_send_disconn_req(struct l2cap_chan *chan, int err) + __clear_ack_timer(chan); + } + +- if (chan->scid == L2CAP_CID_A2MP) { +- l2cap_state_change(chan, BT_DISCONN); +- return; +- } +- + req.dcid = cpu_to_le16(chan->dcid); + req.scid = cpu_to_le16(chan->scid); + l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_DISCONN_REQ, +@@ -1754,11 +1593,6 @@ static void l2cap_conn_ready(struct l2cap_conn *conn) + + l2cap_chan_lock(chan); + +- if (chan->scid == L2CAP_CID_A2MP) { +- l2cap_chan_unlock(chan); +- continue; +- } +- + if (hcon->type == LE_LINK) { + l2cap_le_start(chan); + } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { +@@ -2067,9 +1901,6 @@ static void l2cap_streaming_send(struct l2cap_chan *chan, + + BT_DBG("chan %p, skbs %p", chan, skbs); + +- if (__chan_is_moving(chan)) +- return; +- + skb_queue_splice_tail_init(skbs, &chan->tx_q); + + while (!skb_queue_empty(&chan->tx_q)) { +@@ -2112,9 +1943,6 @@ static int l2cap_ertm_send(struct l2cap_chan *chan) + if (test_bit(CONN_REMOTE_BUSY, &chan->conn_state)) + return 0; + +- if (__chan_is_moving(chan)) +- return 0; +- + while (chan->tx_send_head && + chan->unacked_frames < chan->remote_tx_win && + chan->tx_state == L2CAP_TX_STATE_XMIT) { +@@ -2180,9 +2008,6 @@ static void l2cap_ertm_resend(struct l2cap_chan *chan) + if (test_bit(CONN_REMOTE_BUSY, &chan->conn_state)) + return; + +- if (__chan_is_moving(chan)) +- return; +- + while (chan->retrans_list.head != L2CAP_SEQ_LIST_CLEAR) { + seq = l2cap_seq_list_pop(&chan->retrans_list); + +@@ -2522,8 +2347,7 @@ static int l2cap_segment_sdu(struct l2cap_chan *chan, + pdu_len = chan->conn->mtu; + + /* Constrain PDU size for BR/EDR connections */ +- if (!chan->hs_hcon) +- pdu_len = min_t(size_t, pdu_len, L2CAP_BREDR_MAX_PAYLOAD); ++ pdu_len = min_t(size_t, pdu_len, L2CAP_BREDR_MAX_PAYLOAD); + + /* Adjust for largest possible L2CAP overhead. */ + if (chan->fcs) +@@ -3287,11 +3111,6 @@ int l2cap_ertm_init(struct l2cap_chan *chan) + + skb_queue_head_init(&chan->tx_q); + +- chan->local_amp_id = AMP_ID_BREDR; +- chan->move_id = AMP_ID_BREDR; +- chan->move_state = L2CAP_MOVE_STABLE; +- chan->move_role = L2CAP_MOVE_ROLE_NONE; +- + if (chan->mode != L2CAP_MODE_ERTM) + return 0; + +@@ -3326,52 +3145,19 @@ static inline __u8 l2cap_select_mode(__u8 mode, __u16 remote_feat_mask) + + static inline bool __l2cap_ews_supported(struct l2cap_conn *conn) + { +- return ((conn->local_fixed_chan & L2CAP_FC_A2MP) && +- (conn->feat_mask & L2CAP_FEAT_EXT_WINDOW)); ++ return (conn->feat_mask & L2CAP_FEAT_EXT_WINDOW); + } + + static inline bool __l2cap_efs_supported(struct l2cap_conn *conn) + { +- return ((conn->local_fixed_chan & L2CAP_FC_A2MP) && +- (conn->feat_mask & L2CAP_FEAT_EXT_FLOW)); ++ return (conn->feat_mask & L2CAP_FEAT_EXT_FLOW); + } + + static void __l2cap_set_ertm_timeouts(struct l2cap_chan *chan, + struct l2cap_conf_rfc *rfc) + { +- if (chan->local_amp_id != AMP_ID_BREDR && chan->hs_hcon) { +- u64 ertm_to = chan->hs_hcon->hdev->amp_be_flush_to; +- +- /* Class 1 devices have must have ERTM timeouts +- * exceeding the Link Supervision Timeout. The +- * default Link Supervision Timeout for AMP +- * controllers is 10 seconds. +- * +- * Class 1 devices use 0xffffffff for their +- * best-effort flush timeout, so the clamping logic +- * will result in a timeout that meets the above +- * requirement. ERTM timeouts are 16-bit values, so +- * the maximum timeout is 65.535 seconds. +- */ +- +- /* Convert timeout to milliseconds and round */ +- ertm_to = DIV_ROUND_UP_ULL(ertm_to, 1000); +- +- /* This is the recommended formula for class 2 devices +- * that start ERTM timers when packets are sent to the +- * controller. +- */ +- ertm_to = 3 * ertm_to + 500; +- +- if (ertm_to > 0xffff) +- ertm_to = 0xffff; +- +- rfc->retrans_timeout = cpu_to_le16((u16) ertm_to); +- rfc->monitor_timeout = rfc->retrans_timeout; +- } else { +- rfc->retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO); +- rfc->monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO); +- } ++ rfc->retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO); ++ rfc->monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO); + } + + static inline void l2cap_txwin_setup(struct l2cap_chan *chan) +@@ -3623,13 +3409,7 @@ static int l2cap_parse_conf_req(struct l2cap_chan *chan, void *data, size_t data + case L2CAP_CONF_EWS: + if (olen != 2) + break; +- if (!(chan->conn->local_fixed_chan & L2CAP_FC_A2MP)) +- return -ECONNREFUSED; +- set_bit(FLAG_EXT_CTRL, &chan->flags); +- set_bit(CONF_EWS_RECV, &chan->conf_state); +- chan->tx_win_max = L2CAP_DEFAULT_EXT_WINDOW; +- chan->remote_tx_win = val; +- break; ++ return -ECONNREFUSED; + + default: + if (hint) +@@ -4027,11 +3807,7 @@ void __l2cap_connect_rsp_defer(struct l2cap_chan *chan) + rsp.dcid = cpu_to_le16(chan->scid); + rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS); + rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); +- +- if (chan->hs_hcon) +- rsp_code = L2CAP_CREATE_CHAN_RSP; +- else +- rsp_code = L2CAP_CONN_RSP; ++ rsp_code = L2CAP_CONN_RSP; + + BT_DBG("chan %p rsp_code %u", chan, rsp_code); + +@@ -4190,7 +3966,6 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, + chan->dst_type = bdaddr_dst_type(conn->hcon); + chan->psm = psm; + chan->dcid = scid; +- chan->local_amp_id = amp_id; + + __l2cap_chan_add(conn, chan); + +@@ -4516,10 +4291,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, + /* check compatibility */ + + /* Send rsp for BR/EDR channel */ +- if (!chan->hs_hcon) +- l2cap_send_efs_conf_rsp(chan, rsp, cmd->ident, flags); +- else +- chan->ident = cmd->ident; ++ l2cap_send_efs_conf_rsp(chan, rsp, cmd->ident, flags); + } + + unlock: +@@ -4571,15 +4343,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, + goto done; + } + +- if (!chan->hs_hcon) { +- l2cap_send_efs_conf_rsp(chan, buf, cmd->ident, +- 0); +- } else { +- if (l2cap_check_efs(chan)) { +- amp_create_logical_link(chan); +- chan->ident = cmd->ident; +- } +- } ++ l2cap_send_efs_conf_rsp(chan, buf, cmd->ident, 0); + } + goto done; + +@@ -4750,9 +4514,6 @@ static inline int l2cap_information_req(struct l2cap_conn *conn, + if (!disable_ertm) + feat_mask |= L2CAP_FEAT_ERTM | L2CAP_FEAT_STREAMING + | L2CAP_FEAT_FCS; +- if (conn->local_fixed_chan & L2CAP_FC_A2MP) +- feat_mask |= L2CAP_FEAT_EXT_FLOW +- | L2CAP_FEAT_EXT_WINDOW; + + put_unaligned_le32(feat_mask, rsp->data); + l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(buf), +@@ -4841,751 +4602,6 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, + return 0; + } + +-static int l2cap_create_channel_req(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, +- u16 cmd_len, void *data) +-{ +- struct l2cap_create_chan_req *req = data; +- struct l2cap_create_chan_rsp rsp; +- struct l2cap_chan *chan; +- struct hci_dev *hdev; +- u16 psm, scid; +- +- if (cmd_len != sizeof(*req)) +- return -EPROTO; +- +- if (!(conn->local_fixed_chan & L2CAP_FC_A2MP)) +- return -EINVAL; +- +- psm = le16_to_cpu(req->psm); +- scid = le16_to_cpu(req->scid); +- +- BT_DBG("psm 0x%2.2x, scid 0x%4.4x, amp_id %d", psm, scid, req->amp_id); +- +- /* For controller id 0 make BR/EDR connection */ +- if (req->amp_id == AMP_ID_BREDR) { +- l2cap_connect(conn, cmd, data, L2CAP_CREATE_CHAN_RSP, +- req->amp_id); +- return 0; +- } +- +- /* Validate AMP controller id */ +- hdev = hci_dev_get(req->amp_id); +- if (!hdev) +- goto error; +- +- if (hdev->dev_type != HCI_AMP || !test_bit(HCI_UP, &hdev->flags)) { +- hci_dev_put(hdev); +- goto error; +- } +- +- chan = l2cap_connect(conn, cmd, data, L2CAP_CREATE_CHAN_RSP, +- req->amp_id); +- if (chan) { +- struct amp_mgr *mgr = conn->hcon->amp_mgr; +- struct hci_conn *hs_hcon; +- +- hs_hcon = hci_conn_hash_lookup_ba(hdev, AMP_LINK, +- &conn->hcon->dst); +- if (!hs_hcon) { +- hci_dev_put(hdev); +- cmd_reject_invalid_cid(conn, cmd->ident, chan->scid, +- chan->dcid); +- return 0; +- } +- +- BT_DBG("mgr %p bredr_chan %p hs_hcon %p", mgr, chan, hs_hcon); +- +- mgr->bredr_chan = chan; +- chan->hs_hcon = hs_hcon; +- chan->fcs = L2CAP_FCS_NONE; +- conn->mtu = hdev->block_mtu; +- } +- +- hci_dev_put(hdev); +- +- return 0; +- +-error: +- rsp.dcid = 0; +- rsp.scid = cpu_to_le16(scid); +- rsp.result = cpu_to_le16(L2CAP_CR_BAD_AMP); +- rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); +- +- l2cap_send_cmd(conn, cmd->ident, L2CAP_CREATE_CHAN_RSP, +- sizeof(rsp), &rsp); +- +- return 0; +-} +- +-static void l2cap_send_move_chan_req(struct l2cap_chan *chan, u8 dest_amp_id) +-{ +- struct l2cap_move_chan_req req; +- u8 ident; +- +- BT_DBG("chan %p, dest_amp_id %d", chan, dest_amp_id); +- +- ident = l2cap_get_ident(chan->conn); +- chan->ident = ident; +- +- req.icid = cpu_to_le16(chan->scid); +- req.dest_amp_id = dest_amp_id; +- +- l2cap_send_cmd(chan->conn, ident, L2CAP_MOVE_CHAN_REQ, sizeof(req), +- &req); +- +- __set_chan_timer(chan, L2CAP_MOVE_TIMEOUT); +-} +- +-static void l2cap_send_move_chan_rsp(struct l2cap_chan *chan, u16 result) +-{ +- struct l2cap_move_chan_rsp rsp; +- +- BT_DBG("chan %p, result 0x%4.4x", chan, result); +- +- rsp.icid = cpu_to_le16(chan->dcid); +- rsp.result = cpu_to_le16(result); +- +- l2cap_send_cmd(chan->conn, chan->ident, L2CAP_MOVE_CHAN_RSP, +- sizeof(rsp), &rsp); +-} +- +-static void l2cap_send_move_chan_cfm(struct l2cap_chan *chan, u16 result) +-{ +- struct l2cap_move_chan_cfm cfm; +- +- BT_DBG("chan %p, result 0x%4.4x", chan, result); +- +- chan->ident = l2cap_get_ident(chan->conn); +- +- cfm.icid = cpu_to_le16(chan->scid); +- cfm.result = cpu_to_le16(result); +- +- l2cap_send_cmd(chan->conn, chan->ident, L2CAP_MOVE_CHAN_CFM, +- sizeof(cfm), &cfm); +- +- __set_chan_timer(chan, L2CAP_MOVE_TIMEOUT); +-} +- +-static void l2cap_send_move_chan_cfm_icid(struct l2cap_conn *conn, u16 icid) +-{ +- struct l2cap_move_chan_cfm cfm; +- +- BT_DBG("conn %p, icid 0x%4.4x", conn, icid); +- +- cfm.icid = cpu_to_le16(icid); +- cfm.result = cpu_to_le16(L2CAP_MC_UNCONFIRMED); +- +- l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_MOVE_CHAN_CFM, +- sizeof(cfm), &cfm); +-} +- +-static void l2cap_send_move_chan_cfm_rsp(struct l2cap_conn *conn, u8 ident, +- u16 icid) +-{ +- struct l2cap_move_chan_cfm_rsp rsp; +- +- BT_DBG("icid 0x%4.4x", icid); +- +- rsp.icid = cpu_to_le16(icid); +- l2cap_send_cmd(conn, ident, L2CAP_MOVE_CHAN_CFM_RSP, sizeof(rsp), &rsp); +-} +- +-static void __release_logical_link(struct l2cap_chan *chan) +-{ +- chan->hs_hchan = NULL; +- chan->hs_hcon = NULL; +- +- /* Placeholder - release the logical link */ +-} +- +-static void l2cap_logical_fail(struct l2cap_chan *chan) +-{ +- /* Logical link setup failed */ +- if (chan->state != BT_CONNECTED) { +- /* Create channel failure, disconnect */ +- l2cap_send_disconn_req(chan, ECONNRESET); +- return; +- } +- +- switch (chan->move_role) { +- case L2CAP_MOVE_ROLE_RESPONDER: +- l2cap_move_done(chan); +- l2cap_send_move_chan_rsp(chan, L2CAP_MR_NOT_SUPP); +- break; +- case L2CAP_MOVE_ROLE_INITIATOR: +- if (chan->move_state == L2CAP_MOVE_WAIT_LOGICAL_COMP || +- chan->move_state == L2CAP_MOVE_WAIT_LOGICAL_CFM) { +- /* Remote has only sent pending or +- * success responses, clean up +- */ +- l2cap_move_done(chan); +- } +- +- /* Other amp move states imply that the move +- * has already aborted +- */ +- l2cap_send_move_chan_cfm(chan, L2CAP_MC_UNCONFIRMED); +- break; +- } +-} +- +-static void l2cap_logical_finish_create(struct l2cap_chan *chan, +- struct hci_chan *hchan) +-{ +- struct l2cap_conf_rsp rsp; +- +- chan->hs_hchan = hchan; +- chan->hs_hcon->l2cap_data = chan->conn; +- +- l2cap_send_efs_conf_rsp(chan, &rsp, chan->ident, 0); +- +- if (test_bit(CONF_INPUT_DONE, &chan->conf_state)) { +- int err; +- +- set_default_fcs(chan); +- +- err = l2cap_ertm_init(chan); +- if (err < 0) +- l2cap_send_disconn_req(chan, -err); +- else +- l2cap_chan_ready(chan); +- } +-} +- +-static void l2cap_logical_finish_move(struct l2cap_chan *chan, +- struct hci_chan *hchan) +-{ +- chan->hs_hcon = hchan->conn; +- chan->hs_hcon->l2cap_data = chan->conn; +- +- BT_DBG("move_state %d", chan->move_state); +- +- switch (chan->move_state) { +- case L2CAP_MOVE_WAIT_LOGICAL_COMP: +- /* Move confirm will be sent after a success +- * response is received +- */ +- chan->move_state = L2CAP_MOVE_WAIT_RSP_SUCCESS; +- break; +- case L2CAP_MOVE_WAIT_LOGICAL_CFM: +- if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) { +- chan->move_state = L2CAP_MOVE_WAIT_LOCAL_BUSY; +- } else if (chan->move_role == L2CAP_MOVE_ROLE_INITIATOR) { +- chan->move_state = L2CAP_MOVE_WAIT_CONFIRM_RSP; +- l2cap_send_move_chan_cfm(chan, L2CAP_MC_CONFIRMED); +- } else if (chan->move_role == L2CAP_MOVE_ROLE_RESPONDER) { +- chan->move_state = L2CAP_MOVE_WAIT_CONFIRM; +- l2cap_send_move_chan_rsp(chan, L2CAP_MR_SUCCESS); +- } +- break; +- default: +- /* Move was not in expected state, free the channel */ +- __release_logical_link(chan); +- +- chan->move_state = L2CAP_MOVE_STABLE; +- } +-} +- +-/* Call with chan locked */ +-void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, +- u8 status) +-{ +- BT_DBG("chan %p, hchan %p, status %d", chan, hchan, status); +- +- if (status) { +- l2cap_logical_fail(chan); +- __release_logical_link(chan); +- return; +- } +- +- if (chan->state != BT_CONNECTED) { +- /* Ignore logical link if channel is on BR/EDR */ +- if (chan->local_amp_id != AMP_ID_BREDR) +- l2cap_logical_finish_create(chan, hchan); +- } else { +- l2cap_logical_finish_move(chan, hchan); +- } +-} +- +-void l2cap_move_start(struct l2cap_chan *chan) +-{ +- BT_DBG("chan %p", chan); +- +- if (chan->local_amp_id == AMP_ID_BREDR) { +- if (chan->chan_policy != BT_CHANNEL_POLICY_AMP_PREFERRED) +- return; +- chan->move_role = L2CAP_MOVE_ROLE_INITIATOR; +- chan->move_state = L2CAP_MOVE_WAIT_PREPARE; +- /* Placeholder - start physical link setup */ +- } else { +- chan->move_role = L2CAP_MOVE_ROLE_INITIATOR; +- chan->move_state = L2CAP_MOVE_WAIT_RSP_SUCCESS; +- chan->move_id = 0; +- l2cap_move_setup(chan); +- l2cap_send_move_chan_req(chan, 0); +- } +-} +- +-static void l2cap_do_create(struct l2cap_chan *chan, int result, +- u8 local_amp_id, u8 remote_amp_id) +-{ +- BT_DBG("chan %p state %s %u -> %u", chan, state_to_string(chan->state), +- local_amp_id, remote_amp_id); +- +- chan->fcs = L2CAP_FCS_NONE; +- +- /* Outgoing channel on AMP */ +- if (chan->state == BT_CONNECT) { +- if (result == L2CAP_CR_SUCCESS) { +- chan->local_amp_id = local_amp_id; +- l2cap_send_create_chan_req(chan, remote_amp_id); +- } else { +- /* Revert to BR/EDR connect */ +- l2cap_send_conn_req(chan); +- } +- +- return; +- } +- +- /* Incoming channel on AMP */ +- if (__l2cap_no_conn_pending(chan)) { +- struct l2cap_conn_rsp rsp; +- char buf[128]; +- rsp.scid = cpu_to_le16(chan->dcid); +- rsp.dcid = cpu_to_le16(chan->scid); +- +- if (result == L2CAP_CR_SUCCESS) { +- /* Send successful response */ +- rsp.result = cpu_to_le16(L2CAP_CR_SUCCESS); +- rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); +- } else { +- /* Send negative response */ +- rsp.result = cpu_to_le16(L2CAP_CR_NO_MEM); +- rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); +- } +- +- l2cap_send_cmd(chan->conn, chan->ident, L2CAP_CREATE_CHAN_RSP, +- sizeof(rsp), &rsp); +- +- if (result == L2CAP_CR_SUCCESS) { +- l2cap_state_change(chan, BT_CONFIG); +- set_bit(CONF_REQ_SENT, &chan->conf_state); +- l2cap_send_cmd(chan->conn, l2cap_get_ident(chan->conn), +- L2CAP_CONF_REQ, +- l2cap_build_conf_req(chan, buf, sizeof(buf)), buf); +- chan->num_conf_req++; +- } +- } +-} +- +-static void l2cap_do_move_initiate(struct l2cap_chan *chan, u8 local_amp_id, +- u8 remote_amp_id) +-{ +- l2cap_move_setup(chan); +- chan->move_id = local_amp_id; +- chan->move_state = L2CAP_MOVE_WAIT_RSP; +- +- l2cap_send_move_chan_req(chan, remote_amp_id); +-} +- +-static void l2cap_do_move_respond(struct l2cap_chan *chan, int result) +-{ +- struct hci_chan *hchan = NULL; +- +- /* Placeholder - get hci_chan for logical link */ +- +- if (hchan) { +- if (hchan->state == BT_CONNECTED) { +- /* Logical link is ready to go */ +- chan->hs_hcon = hchan->conn; +- chan->hs_hcon->l2cap_data = chan->conn; +- chan->move_state = L2CAP_MOVE_WAIT_CONFIRM; +- l2cap_send_move_chan_rsp(chan, L2CAP_MR_SUCCESS); +- +- l2cap_logical_cfm(chan, hchan, L2CAP_MR_SUCCESS); +- } else { +- /* Wait for logical link to be ready */ +- chan->move_state = L2CAP_MOVE_WAIT_LOGICAL_CFM; +- } +- } else { +- /* Logical link not available */ +- l2cap_send_move_chan_rsp(chan, L2CAP_MR_NOT_ALLOWED); +- } +-} +- +-static void l2cap_do_move_cancel(struct l2cap_chan *chan, int result) +-{ +- if (chan->move_role == L2CAP_MOVE_ROLE_RESPONDER) { +- u8 rsp_result; +- if (result == -EINVAL) +- rsp_result = L2CAP_MR_BAD_ID; +- else +- rsp_result = L2CAP_MR_NOT_ALLOWED; +- +- l2cap_send_move_chan_rsp(chan, rsp_result); +- } +- +- chan->move_role = L2CAP_MOVE_ROLE_NONE; +- chan->move_state = L2CAP_MOVE_STABLE; +- +- /* Restart data transmission */ +- l2cap_ertm_send(chan); +-} +- +-/* Invoke with locked chan */ +-void __l2cap_physical_cfm(struct l2cap_chan *chan, int result) +-{ +- u8 local_amp_id = chan->local_amp_id; +- u8 remote_amp_id = chan->remote_amp_id; +- +- BT_DBG("chan %p, result %d, local_amp_id %d, remote_amp_id %d", +- chan, result, local_amp_id, remote_amp_id); +- +- if (chan->state == BT_DISCONN || chan->state == BT_CLOSED) +- return; +- +- if (chan->state != BT_CONNECTED) { +- l2cap_do_create(chan, result, local_amp_id, remote_amp_id); +- } else if (result != L2CAP_MR_SUCCESS) { +- l2cap_do_move_cancel(chan, result); +- } else { +- switch (chan->move_role) { +- case L2CAP_MOVE_ROLE_INITIATOR: +- l2cap_do_move_initiate(chan, local_amp_id, +- remote_amp_id); +- break; +- case L2CAP_MOVE_ROLE_RESPONDER: +- l2cap_do_move_respond(chan, result); +- break; +- default: +- l2cap_do_move_cancel(chan, result); +- break; +- } +- } +-} +- +-static inline int l2cap_move_channel_req(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, +- u16 cmd_len, void *data) +-{ +- struct l2cap_move_chan_req *req = data; +- struct l2cap_move_chan_rsp rsp; +- struct l2cap_chan *chan; +- u16 icid = 0; +- u16 result = L2CAP_MR_NOT_ALLOWED; +- +- if (cmd_len != sizeof(*req)) +- return -EPROTO; +- +- icid = le16_to_cpu(req->icid); +- +- BT_DBG("icid 0x%4.4x, dest_amp_id %d", icid, req->dest_amp_id); +- +- if (!(conn->local_fixed_chan & L2CAP_FC_A2MP)) +- return -EINVAL; +- +- chan = l2cap_get_chan_by_dcid(conn, icid); +- if (!chan) { +- rsp.icid = cpu_to_le16(icid); +- rsp.result = cpu_to_le16(L2CAP_MR_NOT_ALLOWED); +- l2cap_send_cmd(conn, cmd->ident, L2CAP_MOVE_CHAN_RSP, +- sizeof(rsp), &rsp); +- return 0; +- } +- +- chan->ident = cmd->ident; +- +- if (chan->scid < L2CAP_CID_DYN_START || +- chan->chan_policy == BT_CHANNEL_POLICY_BREDR_ONLY || +- (chan->mode != L2CAP_MODE_ERTM && +- chan->mode != L2CAP_MODE_STREAMING)) { +- result = L2CAP_MR_NOT_ALLOWED; +- goto send_move_response; +- } +- +- if (chan->local_amp_id == req->dest_amp_id) { +- result = L2CAP_MR_SAME_ID; +- goto send_move_response; +- } +- +- if (req->dest_amp_id != AMP_ID_BREDR) { +- struct hci_dev *hdev; +- hdev = hci_dev_get(req->dest_amp_id); +- if (!hdev || hdev->dev_type != HCI_AMP || +- !test_bit(HCI_UP, &hdev->flags)) { +- if (hdev) +- hci_dev_put(hdev); +- +- result = L2CAP_MR_BAD_ID; +- goto send_move_response; +- } +- hci_dev_put(hdev); +- } +- +- /* Detect a move collision. Only send a collision response +- * if this side has "lost", otherwise proceed with the move. +- * The winner has the larger bd_addr. +- */ +- if ((__chan_is_moving(chan) || +- chan->move_role != L2CAP_MOVE_ROLE_NONE) && +- bacmp(&conn->hcon->src, &conn->hcon->dst) > 0) { +- result = L2CAP_MR_COLLISION; +- goto send_move_response; +- } +- +- chan->move_role = L2CAP_MOVE_ROLE_RESPONDER; +- l2cap_move_setup(chan); +- chan->move_id = req->dest_amp_id; +- +- if (req->dest_amp_id == AMP_ID_BREDR) { +- /* Moving to BR/EDR */ +- if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) { +- chan->move_state = L2CAP_MOVE_WAIT_LOCAL_BUSY; +- result = L2CAP_MR_PEND; +- } else { +- chan->move_state = L2CAP_MOVE_WAIT_CONFIRM; +- result = L2CAP_MR_SUCCESS; +- } +- } else { +- chan->move_state = L2CAP_MOVE_WAIT_PREPARE; +- /* Placeholder - uncomment when amp functions are available */ +- /*amp_accept_physical(chan, req->dest_amp_id);*/ +- result = L2CAP_MR_PEND; +- } +- +-send_move_response: +- l2cap_send_move_chan_rsp(chan, result); +- +- l2cap_chan_unlock(chan); +- l2cap_chan_put(chan); +- +- return 0; +-} +- +-static void l2cap_move_continue(struct l2cap_conn *conn, u16 icid, u16 result) +-{ +- struct l2cap_chan *chan; +- struct hci_chan *hchan = NULL; +- +- chan = l2cap_get_chan_by_scid(conn, icid); +- if (!chan) { +- l2cap_send_move_chan_cfm_icid(conn, icid); +- return; +- } +- +- __clear_chan_timer(chan); +- if (result == L2CAP_MR_PEND) +- __set_chan_timer(chan, L2CAP_MOVE_ERTX_TIMEOUT); +- +- switch (chan->move_state) { +- case L2CAP_MOVE_WAIT_LOGICAL_COMP: +- /* Move confirm will be sent when logical link +- * is complete. +- */ +- chan->move_state = L2CAP_MOVE_WAIT_LOGICAL_CFM; +- break; +- case L2CAP_MOVE_WAIT_RSP_SUCCESS: +- if (result == L2CAP_MR_PEND) { +- break; +- } else if (test_bit(CONN_LOCAL_BUSY, +- &chan->conn_state)) { +- chan->move_state = L2CAP_MOVE_WAIT_LOCAL_BUSY; +- } else { +- /* Logical link is up or moving to BR/EDR, +- * proceed with move +- */ +- chan->move_state = L2CAP_MOVE_WAIT_CONFIRM_RSP; +- l2cap_send_move_chan_cfm(chan, L2CAP_MC_CONFIRMED); +- } +- break; +- case L2CAP_MOVE_WAIT_RSP: +- /* Moving to AMP */ +- if (result == L2CAP_MR_SUCCESS) { +- /* Remote is ready, send confirm immediately +- * after logical link is ready +- */ +- chan->move_state = L2CAP_MOVE_WAIT_LOGICAL_CFM; +- } else { +- /* Both logical link and move success +- * are required to confirm +- */ +- chan->move_state = L2CAP_MOVE_WAIT_LOGICAL_COMP; +- } +- +- /* Placeholder - get hci_chan for logical link */ +- if (!hchan) { +- /* Logical link not available */ +- l2cap_send_move_chan_cfm(chan, L2CAP_MC_UNCONFIRMED); +- break; +- } +- +- /* If the logical link is not yet connected, do not +- * send confirmation. +- */ +- if (hchan->state != BT_CONNECTED) +- break; +- +- /* Logical link is already ready to go */ +- +- chan->hs_hcon = hchan->conn; +- chan->hs_hcon->l2cap_data = chan->conn; +- +- if (result == L2CAP_MR_SUCCESS) { +- /* Can confirm now */ +- l2cap_send_move_chan_cfm(chan, L2CAP_MC_CONFIRMED); +- } else { +- /* Now only need move success +- * to confirm +- */ +- chan->move_state = L2CAP_MOVE_WAIT_RSP_SUCCESS; +- } +- +- l2cap_logical_cfm(chan, hchan, L2CAP_MR_SUCCESS); +- break; +- default: +- /* Any other amp move state means the move failed. */ +- chan->move_id = chan->local_amp_id; +- l2cap_move_done(chan); +- l2cap_send_move_chan_cfm(chan, L2CAP_MC_UNCONFIRMED); +- } +- +- l2cap_chan_unlock(chan); +- l2cap_chan_put(chan); +-} +- +-static void l2cap_move_fail(struct l2cap_conn *conn, u8 ident, u16 icid, +- u16 result) +-{ +- struct l2cap_chan *chan; +- +- chan = l2cap_get_chan_by_ident(conn, ident); +- if (!chan) { +- /* Could not locate channel, icid is best guess */ +- l2cap_send_move_chan_cfm_icid(conn, icid); +- return; +- } +- +- __clear_chan_timer(chan); +- +- if (chan->move_role == L2CAP_MOVE_ROLE_INITIATOR) { +- if (result == L2CAP_MR_COLLISION) { +- chan->move_role = L2CAP_MOVE_ROLE_RESPONDER; +- } else { +- /* Cleanup - cancel move */ +- chan->move_id = chan->local_amp_id; +- l2cap_move_done(chan); +- } +- } +- +- l2cap_send_move_chan_cfm(chan, L2CAP_MC_UNCONFIRMED); +- +- l2cap_chan_unlock(chan); +- l2cap_chan_put(chan); +-} +- +-static int l2cap_move_channel_rsp(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, +- u16 cmd_len, void *data) +-{ +- struct l2cap_move_chan_rsp *rsp = data; +- u16 icid, result; +- +- if (cmd_len != sizeof(*rsp)) +- return -EPROTO; +- +- icid = le16_to_cpu(rsp->icid); +- result = le16_to_cpu(rsp->result); +- +- BT_DBG("icid 0x%4.4x, result 0x%4.4x", icid, result); +- +- if (result == L2CAP_MR_SUCCESS || result == L2CAP_MR_PEND) +- l2cap_move_continue(conn, icid, result); +- else +- l2cap_move_fail(conn, cmd->ident, icid, result); +- +- return 0; +-} +- +-static int l2cap_move_channel_confirm(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, +- u16 cmd_len, void *data) +-{ +- struct l2cap_move_chan_cfm *cfm = data; +- struct l2cap_chan *chan; +- u16 icid, result; +- +- if (cmd_len != sizeof(*cfm)) +- return -EPROTO; +- +- icid = le16_to_cpu(cfm->icid); +- result = le16_to_cpu(cfm->result); +- +- BT_DBG("icid 0x%4.4x, result 0x%4.4x", icid, result); +- +- chan = l2cap_get_chan_by_dcid(conn, icid); +- if (!chan) { +- /* Spec requires a response even if the icid was not found */ +- l2cap_send_move_chan_cfm_rsp(conn, cmd->ident, icid); +- return 0; +- } +- +- if (chan->move_state == L2CAP_MOVE_WAIT_CONFIRM) { +- if (result == L2CAP_MC_CONFIRMED) { +- chan->local_amp_id = chan->move_id; +- if (chan->local_amp_id == AMP_ID_BREDR) +- __release_logical_link(chan); +- } else { +- chan->move_id = chan->local_amp_id; +- } +- +- l2cap_move_done(chan); +- } +- +- l2cap_send_move_chan_cfm_rsp(conn, cmd->ident, icid); +- +- l2cap_chan_unlock(chan); +- l2cap_chan_put(chan); +- +- return 0; +-} +- +-static inline int l2cap_move_channel_confirm_rsp(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, +- u16 cmd_len, void *data) +-{ +- struct l2cap_move_chan_cfm_rsp *rsp = data; +- struct l2cap_chan *chan; +- u16 icid; +- +- if (cmd_len != sizeof(*rsp)) +- return -EPROTO; +- +- icid = le16_to_cpu(rsp->icid); +- +- BT_DBG("icid 0x%4.4x", icid); +- +- chan = l2cap_get_chan_by_scid(conn, icid); +- if (!chan) +- return 0; +- +- __clear_chan_timer(chan); +- +- if (chan->move_state == L2CAP_MOVE_WAIT_CONFIRM_RSP) { +- chan->local_amp_id = chan->move_id; +- +- if (chan->local_amp_id == AMP_ID_BREDR && chan->hs_hchan) +- __release_logical_link(chan); +- +- l2cap_move_done(chan); +- } +- +- l2cap_chan_unlock(chan); +- l2cap_chan_put(chan); +- +- return 0; +-} +- + static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, + struct l2cap_cmd_hdr *cmd, + u16 cmd_len, u8 *data) +@@ -5745,7 +4761,6 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn, + break; + + case L2CAP_CONN_RSP: +- case L2CAP_CREATE_CHAN_RSP: + l2cap_connect_create_rsp(conn, cmd, cmd_len, data); + break; + +@@ -5780,26 +4795,6 @@ static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn, + l2cap_information_rsp(conn, cmd, cmd_len, data); + break; + +- case L2CAP_CREATE_CHAN_REQ: +- err = l2cap_create_channel_req(conn, cmd, cmd_len, data); +- break; +- +- case L2CAP_MOVE_CHAN_REQ: +- err = l2cap_move_channel_req(conn, cmd, cmd_len, data); +- break; +- +- case L2CAP_MOVE_CHAN_RSP: +- l2cap_move_channel_rsp(conn, cmd, cmd_len, data); +- break; +- +- case L2CAP_MOVE_CHAN_CFM: +- err = l2cap_move_channel_confirm(conn, cmd, cmd_len, data); +- break; +- +- case L2CAP_MOVE_CHAN_CFM_RSP: +- l2cap_move_channel_confirm_rsp(conn, cmd, cmd_len, data); +- break; +- + default: + BT_ERR("Unknown BR/EDR signaling command 0x%2.2x", cmd->code); + err = -EINVAL; +@@ -7051,8 +6046,8 @@ static int l2cap_rx_state_recv(struct l2cap_chan *chan, + if (control->final) { + clear_bit(CONN_REMOTE_BUSY, &chan->conn_state); + +- if (!test_and_clear_bit(CONN_REJ_ACT, &chan->conn_state) && +- !__chan_is_moving(chan)) { ++ if (!test_and_clear_bit(CONN_REJ_ACT, ++ &chan->conn_state)) { + control->final = 0; + l2cap_retransmit_all(chan, control); + } +@@ -7245,11 +6240,7 @@ static int l2cap_finish_move(struct l2cap_chan *chan) + BT_DBG("chan %p", chan); + + chan->rx_state = L2CAP_RX_STATE_RECV; +- +- if (chan->hs_hcon) +- chan->conn->mtu = chan->hs_hcon->hdev->block_mtu; +- else +- chan->conn->mtu = chan->conn->hcon->hdev->acl_mtu; ++ chan->conn->mtu = chan->conn->hcon->hdev->acl_mtu; + + return l2cap_resegment(chan); + } +@@ -7316,11 +6307,7 @@ static int l2cap_rx_state_wait_f(struct l2cap_chan *chan, + */ + chan->next_tx_seq = control->reqseq; + chan->unacked_frames = 0; +- +- if (chan->hs_hcon) +- chan->conn->mtu = chan->hs_hcon->hdev->block_mtu; +- else +- chan->conn->mtu = chan->conn->hcon->hdev->acl_mtu; ++ chan->conn->mtu = chan->conn->hcon->hdev->acl_mtu; + + err = l2cap_resegment(chan); + +@@ -7672,21 +6659,10 @@ static void l2cap_data_channel(struct l2cap_conn *conn, u16 cid, + + chan = l2cap_get_chan_by_scid(conn, cid); + if (!chan) { +- if (cid == L2CAP_CID_A2MP) { +- chan = a2mp_channel_create(conn, skb); +- if (!chan) { +- kfree_skb(skb); +- return; +- } +- +- l2cap_chan_hold(chan); +- l2cap_chan_lock(chan); +- } else { +- BT_DBG("unknown cid 0x%4.4x", cid); +- /* Drop packet and return */ +- kfree_skb(skb); +- return; +- } ++ BT_DBG("unknown cid 0x%4.4x", cid); ++ /* Drop packet and return */ ++ kfree_skb(skb); ++ return; + } + + BT_DBG("chan %p, len %d", chan, skb->len); +@@ -7887,10 +6863,6 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon) + + conn->local_fixed_chan = L2CAP_FC_SIG_BREDR | L2CAP_FC_CONNLESS; + +- if (hcon->type == ACL_LINK && +- hci_dev_test_flag(hcon->hdev, HCI_HS_ENABLED)) +- conn->local_fixed_chan |= L2CAP_FC_A2MP; +- + if (hci_dev_test_flag(hcon->hdev, HCI_LE_ENABLED) && + (bredr_sc_enabled(hcon->hdev) || + hci_dev_test_flag(hcon->hdev, HCI_FORCE_BREDR_SMP))) +@@ -8355,11 +7327,6 @@ static void l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) + BT_DBG("chan %p scid 0x%4.4x state %s", chan, chan->scid, + state_to_string(chan->state)); + +- if (chan->scid == L2CAP_CID_A2MP) { +- l2cap_chan_unlock(chan); +- continue; +- } +- + if (!status && encrypt) + chan->sec_level = hcon->sec_level; + +diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c +index e50d3d102078e..ee7a41d6994fc 100644 +--- a/net/bluetooth/l2cap_sock.c ++++ b/net/bluetooth/l2cap_sock.c +@@ -1027,23 +1027,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, + break; + } + +- if (opt > BT_CHANNEL_POLICY_AMP_PREFERRED) { +- err = -EINVAL; +- break; +- } +- +- if (chan->mode != L2CAP_MODE_ERTM && +- chan->mode != L2CAP_MODE_STREAMING) { +- err = -EOPNOTSUPP; +- break; +- } +- +- chan->chan_policy = (u8) opt; +- +- if (sk->sk_state == BT_CONNECTED && +- chan->move_role == L2CAP_MOVE_ROLE_NONE) +- l2cap_move_start(chan); +- ++ err = -EOPNOTSUPP; + break; + + case BT_SNDMTU: +diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c +index 688890f581cba..b2a272bc4d7c5 100644 +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -835,8 +835,6 @@ static u32 get_supported_settings(struct hci_dev *hdev) + + if (lmp_ssp_capable(hdev)) { + settings |= MGMT_SETTING_SSP; +- if (IS_ENABLED(CONFIG_BT_HS)) +- settings |= MGMT_SETTING_HS; + } + + if (lmp_sc_capable(hdev)) +@@ -901,9 +899,6 @@ static u32 get_current_settings(struct hci_dev *hdev) + if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) + settings |= MGMT_SETTING_SSP; + +- if (hci_dev_test_flag(hdev, HCI_HS_ENABLED)) +- settings |= MGMT_SETTING_HS; +- + if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) + settings |= MGMT_SETTING_ADVERTISING; + +@@ -1930,7 +1925,6 @@ static void set_ssp_complete(struct hci_dev *hdev, void *data, int err) + + if (enable && hci_dev_test_and_clear_flag(hdev, + HCI_SSP_ENABLED)) { +- hci_dev_clear_flag(hdev, HCI_HS_ENABLED); + new_settings(hdev, NULL); + } + +@@ -1943,12 +1937,6 @@ static void set_ssp_complete(struct hci_dev *hdev, void *data, int err) + changed = !hci_dev_test_and_set_flag(hdev, HCI_SSP_ENABLED); + } else { + changed = hci_dev_test_and_clear_flag(hdev, HCI_SSP_ENABLED); +- +- if (!changed) +- changed = hci_dev_test_and_clear_flag(hdev, +- HCI_HS_ENABLED); +- else +- hci_dev_clear_flag(hdev, HCI_HS_ENABLED); + } + + mgmt_pending_foreach(MGMT_OP_SET_SSP, hdev, settings_rsp, &match); +@@ -2012,11 +2000,6 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) + } else { + changed = hci_dev_test_and_clear_flag(hdev, + HCI_SSP_ENABLED); +- if (!changed) +- changed = hci_dev_test_and_clear_flag(hdev, +- HCI_HS_ENABLED); +- else +- hci_dev_clear_flag(hdev, HCI_HS_ENABLED); + } + + err = send_settings_rsp(sk, MGMT_OP_SET_SSP, hdev); +@@ -2062,63 +2045,10 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) + + static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) + { +- struct mgmt_mode *cp = data; +- bool changed; +- u8 status; +- int err; +- + bt_dev_dbg(hdev, "sock %p", sk); + +- if (!IS_ENABLED(CONFIG_BT_HS)) +- return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, ++ return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, + MGMT_STATUS_NOT_SUPPORTED); +- +- status = mgmt_bredr_support(hdev); +- if (status) +- return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status); +- +- if (!lmp_ssp_capable(hdev)) +- return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, +- MGMT_STATUS_NOT_SUPPORTED); +- +- if (!hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) +- return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, +- MGMT_STATUS_REJECTED); +- +- if (cp->val != 0x00 && cp->val != 0x01) +- return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, +- MGMT_STATUS_INVALID_PARAMS); +- +- hci_dev_lock(hdev); +- +- if (pending_find(MGMT_OP_SET_SSP, hdev)) { +- err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, +- MGMT_STATUS_BUSY); +- goto unlock; +- } +- +- if (cp->val) { +- changed = !hci_dev_test_and_set_flag(hdev, HCI_HS_ENABLED); +- } else { +- if (hdev_is_powered(hdev)) { +- err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, +- MGMT_STATUS_REJECTED); +- goto unlock; +- } +- +- changed = hci_dev_test_and_clear_flag(hdev, HCI_HS_ENABLED); +- } +- +- err = send_settings_rsp(sk, MGMT_OP_SET_HS, hdev); +- if (err < 0) +- goto unlock; +- +- if (changed) +- err = new_settings(hdev, sk); +- +-unlock: +- hci_dev_unlock(hdev); +- return err; + } + + static void set_le_complete(struct hci_dev *hdev, void *data, int err) +@@ -6766,7 +6696,6 @@ static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) + hci_dev_clear_flag(hdev, HCI_SSP_ENABLED); + hci_dev_clear_flag(hdev, HCI_LINK_SECURITY); + hci_dev_clear_flag(hdev, HCI_FAST_CONNECTABLE); +- hci_dev_clear_flag(hdev, HCI_HS_ENABLED); + } + + hci_dev_change_flag(hdev, HCI_BREDR_ENABLED); +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-remove-hci_power_off_timeout.patch b/queue-6.8/bluetooth-remove-hci_power_off_timeout.patch new file mode 100644 index 00000000000..842ce98baa3 --- /dev/null +++ b/queue-6.8/bluetooth-remove-hci_power_off_timeout.patch @@ -0,0 +1,39 @@ +From 3cb0efe274d01b1303e94155b01a667522bee784 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Jan 2024 19:02:47 +0100 +Subject: Bluetooth: Remove HCI_POWER_OFF_TIMEOUT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jonas Dreßler + +[ Upstream commit 968667f2e0345a67a6eea5a502f4659085666564 ] + +With commit cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED"), +the power off sequence got refactored so that this timeout was no longer +necessary, let's remove the leftover define from the header too. + +Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") +Signed-off-by: Jonas Dreßler +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + include/net/bluetooth/hci.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h +index bdee5d649cc61..f7918c7551834 100644 +--- a/include/net/bluetooth/hci.h ++++ b/include/net/bluetooth/hci.h +@@ -437,7 +437,6 @@ enum { + #define HCI_NCMD_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ + #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ + #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ +-#define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ + #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ + #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ + +-- +2.43.0 + diff --git a/queue-6.8/bluetooth-remove-superfluous-call-to-hci_conn_check_.patch b/queue-6.8/bluetooth-remove-superfluous-call-to-hci_conn_check_.patch new file mode 100644 index 00000000000..1df30995964 --- /dev/null +++ b/queue-6.8/bluetooth-remove-superfluous-call-to-hci_conn_check_.patch @@ -0,0 +1,62 @@ +From 88d2759ff5bcd15a32ee51b65d0d0229bda154a9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 23:46:06 +0100 +Subject: Bluetooth: Remove superfluous call to hci_conn_check_pending() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jonas Dreßler + +[ Upstream commit 78e3639fc8031275010c3287ac548c0bc8de83b1 ] + +The "pending connections" feature was originally introduced with commit +4c67bc74f016 ("[Bluetooth] Support concurrent connect requests") and +6bd57416127e ("[Bluetooth] Handling pending connect attempts after +inquiry") to handle controllers supporting only a single connection request +at a time. Later things were extended to also cancel ongoing inquiries on +connect() with commit 89e65975fea5 ("Bluetooth: Cancel Inquiry before +Create Connection"). + +With commit a9de9248064b ("[Bluetooth] Switch from OGF+OCF to using only +opcodes"), hci_conn_check_pending() was introduced as a helper to +consolidate a few places where we check for pending connections (indicated +by the BT_CONNECT2 flag) and then try to connect. + +This refactoring commit also snuck in two more calls to +hci_conn_check_pending(): + +- One is in the failure callback of hci_cs_inquiry(), this one probably +makes sense: If we send an "HCI Inquiry" command and then immediately +after a "Create Connection" command, the "Create Connection" command might +fail before the "HCI Inquiry" command, and then we want to retry the +"Create Connection" on failure of the "HCI Inquiry". + +- The other added call to hci_conn_check_pending() is in the event handler +for the "Remote Name" event, this seems unrelated and is possibly a +copy-paste error, so remove that one. + +Fixes: a9de9248064b ("[Bluetooth] Switch from OGF+OCF to using only opcodes") +Signed-off-by: Jonas Dreßler +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + net/bluetooth/hci_event.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c +index 2a5f5a7d2412b..1f63f77661dce 100644 +--- a/net/bluetooth/hci_event.c ++++ b/net/bluetooth/hci_event.c +@@ -3556,8 +3556,6 @@ static void hci_remote_name_evt(struct hci_dev *hdev, void *data, + + bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); + +- hci_conn_check_pending(hdev); +- + hci_dev_lock(hdev); + + conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); +-- +2.43.0 + diff --git a/queue-6.8/bpf-don-t-emit-warnings-intended-for-global-subprogs.patch b/queue-6.8/bpf-don-t-emit-warnings-intended-for-global-subprogs.patch new file mode 100644 index 00000000000..4f2dc4cbaea --- /dev/null +++ b/queue-6.8/bpf-don-t-emit-warnings-intended-for-global-subprogs.patch @@ -0,0 +1,60 @@ +From 1cfc35d0eb86343fb61465a176b8447301e3e92a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Feb 2024 11:05:29 -0800 +Subject: bpf: don't emit warnings intended for global subprogs for static + subprogs + +From: Andrii Nakryiko + +[ Upstream commit 1eb986746a67952df86eb2c50a36450ef103d01b ] + +When btf_prepare_func_args() was generalized to handle both static and +global subprogs, a few warnings/errors that are meant only for global +subprog cases started to be emitted for static subprogs, where they are +sort of expected and irrelavant. + +Stop polutting verifier logs with irrelevant scary-looking messages. + +Fixes: e26080d0da87 ("bpf: prepare btf_prepare_func_args() for handling static subprogs") +Signed-off-by: Andrii Nakryiko +Link: https://lore.kernel.org/r/20240202190529.2374377-4-andrii@kernel.org +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + kernel/bpf/btf.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c +index dbe7a590f565a..92aa3cf0396b8 100644 +--- a/kernel/bpf/btf.c ++++ b/kernel/bpf/btf.c +@@ -7009,6 +7009,8 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog) + args = (const struct btf_param *)(t + 1); + nargs = btf_type_vlen(t); + if (nargs > MAX_BPF_FUNC_REG_ARGS) { ++ if (!is_global) ++ return -EINVAL; + bpf_log(log, "Global function %s() with %d > %d args. Buggy compiler.\n", + tname, nargs, MAX_BPF_FUNC_REG_ARGS); + return -EINVAL; +@@ -7018,6 +7020,8 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog) + while (btf_type_is_modifier(t)) + t = btf_type_by_id(btf, t->type); + if (!btf_type_is_int(t) && !btf_is_any_enum(t)) { ++ if (!is_global) ++ return -EINVAL; + bpf_log(log, + "Global function %s() doesn't return scalar. Only those are supported.\n", + tname); +@@ -7091,6 +7095,8 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog) + sub->args[i].arg_type = ARG_ANYTHING; + continue; + } ++ if (!is_global) ++ return -EINVAL; + bpf_log(log, "Arg#%d type %s in %s() is not supported yet.\n", + i, btf_type_str(t), tname); + return -EINVAL; +-- +2.43.0 + diff --git a/queue-6.8/bpf-don-t-infer-ptr_to_ctx-for-programs-with-unnamed.patch b/queue-6.8/bpf-don-t-infer-ptr_to_ctx-for-programs-with-unnamed.patch new file mode 100644 index 00000000000..8b58d992ea7 --- /dev/null +++ b/queue-6.8/bpf-don-t-infer-ptr_to_ctx-for-programs-with-unnamed.patch @@ -0,0 +1,97 @@ +From 29668686ac3ffbfd5114dac1bb2a4c52cf87dc12 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Feb 2024 15:32:20 -0800 +Subject: bpf: don't infer PTR_TO_CTX for programs with unnamed context type + +From: Andrii Nakryiko + +[ Upstream commit 879bbe7aa4afa80acf72a1cad7f52416ea78c52d ] + +For program types that don't have named context type name (e.g., BPF +iterator programs or tracepoint programs), ctx_tname will be a non-NULL +empty string. For such programs it shouldn't be possible to have +PTR_TO_CTX argument for global subprogs based on type name alone. +arg:ctx tag is the only way to have PTR_TO_CTX passed into global +subprog for such program types. + +Fix this loophole, which currently would assume PTR_TO_CTX whenever +user uses a pointer to anonymous struct as an argument to their global +subprogs. This happens in practice with the following (quite common, in +practice) approach: + +typedef struct { /* anonymous */ + int x; +} my_type_t; + +int my_subprog(my_type_t *arg) { ... } + +User's intent is to have PTR_TO_MEM argument for `arg`, but verifier +will complain about expecting PTR_TO_CTX. + +This fix also closes unintended s390x-specific KPROBE handling of +PTR_TO_CTX case. Selftest change is necessary to accommodate this. + +Fixes: 91cc1a99740e ("bpf: Annotate context types") +Signed-off-by: Andrii Nakryiko +Link: https://lore.kernel.org/r/20240212233221.2575350-4-andrii@kernel.org +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + kernel/bpf/btf.c | 3 +++ + .../bpf/progs/test_global_func_ctx_args.c | 19 +++++++++++++++++++ + 2 files changed, 22 insertions(+) + +diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c +index 92aa3cf0396b8..9041848cf1a1b 100644 +--- a/kernel/bpf/btf.c ++++ b/kernel/bpf/btf.c +@@ -5685,6 +5685,9 @@ btf_get_prog_ctx_type(struct bpf_verifier_log *log, const struct btf *btf, + bpf_log(log, "Please fix kernel include/linux/bpf_types.h\n"); + return NULL; + } ++ /* program types without named context types work only with arg:ctx tag */ ++ if (ctx_tname[0] == '\0') ++ return false; + /* only compare that prog's ctx type name is the same as + * kernel expects. No need to compare field by field. + * It's ok for bpf prog to do: +diff --git a/tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c b/tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c +index 9a06e5eb1fbef..143c8a4852bfe 100644 +--- a/tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c ++++ b/tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c +@@ -26,6 +26,23 @@ int kprobe_typedef_ctx(void *ctx) + return kprobe_typedef_ctx_subprog(ctx); + } + ++/* s390x defines: ++ * ++ * typedef user_pt_regs bpf_user_pt_regs_t; ++ * typedef struct { ... } user_pt_regs; ++ * ++ * And so "canonical" underlying struct type is anonymous. ++ * So on s390x only valid ways to have PTR_TO_CTX argument in global subprogs ++ * are: ++ * - bpf_user_pt_regs_t *ctx (typedef); ++ * - struct bpf_user_pt_regs_t *ctx (backwards compatible struct hack); ++ * - void *ctx __arg_ctx (arg:ctx tag) ++ * ++ * Other architectures also allow using underlying struct types (e.g., ++ * `struct pt_regs *ctx` for x86-64) ++ */ ++#ifndef bpf_target_s390 ++ + #define pt_regs_struct_t typeof(*(__PT_REGS_CAST((struct pt_regs *)NULL))) + + __weak int kprobe_struct_ctx_subprog(pt_regs_struct_t *ctx) +@@ -40,6 +57,8 @@ int kprobe_resolved_ctx(void *ctx) + return kprobe_struct_ctx_subprog(ctx); + } + ++#endif ++ + /* this is current hack to make this work on old kernels */ + struct bpf_user_pt_regs_t {}; + +-- +2.43.0 + diff --git a/queue-6.8/bpf-fix-devmap_hash-overflow-check-on-32-bit-arches.patch b/queue-6.8/bpf-fix-devmap_hash-overflow-check-on-32-bit-arches.patch new file mode 100644 index 00000000000..197b738697d --- /dev/null +++ b/queue-6.8/bpf-fix-devmap_hash-overflow-check-on-32-bit-arches.patch @@ -0,0 +1,66 @@ +From 31734e86346a6923101da1c70588e04827bc24f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Mar 2024 13:03:35 +0100 +Subject: bpf: Fix DEVMAP_HASH overflow check on 32-bit arches +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Toke Høiland-Jørgensen + +[ Upstream commit 281d464a34f540de166cee74b723e97ac2515ec3 ] + +The devmap code allocates a number hash buckets equal to the next power +of two of the max_entries value provided when creating the map. When +rounding up to the next power of two, the 32-bit variable storing the +number of buckets can overflow, and the code checks for overflow by +checking if the truncated 32-bit value is equal to 0. However, on 32-bit +arches the rounding up itself can overflow mid-way through, because it +ends up doing a left-shift of 32 bits on an unsigned long value. If the +size of an unsigned long is four bytes, this is undefined behaviour, so +there is no guarantee that we'll end up with a nice and tidy 0-value at +the end. + +Syzbot managed to turn this into a crash on arm32 by creating a +DEVMAP_HASH with max_entries > 0x80000000 and then trying to update it. +Fix this by moving the overflow check to before the rounding up +operation. + +Fixes: 6f9d451ab1a3 ("xdp: Add devmap_hash map type for looking up devices by hashed index") +Link: https://lore.kernel.org/r/000000000000ed666a0611af6818@google.com +Reported-and-tested-by: syzbot+8cd36f6b65f3cafd400a@syzkaller.appspotmail.com +Signed-off-by: Toke Høiland-Jørgensen +Message-ID: <20240307120340.99577-2-toke@redhat.com> +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + kernel/bpf/devmap.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c +index a936c704d4e77..4e2cdbb5629f2 100644 +--- a/kernel/bpf/devmap.c ++++ b/kernel/bpf/devmap.c +@@ -130,13 +130,14 @@ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) + bpf_map_init_from_attr(&dtab->map, attr); + + if (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH) { +- dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries); +- +- if (!dtab->n_buckets) /* Overflow check */ ++ /* hash table size must be power of 2; roundup_pow_of_two() can ++ * overflow into UB on 32-bit arches, so check that first ++ */ ++ if (dtab->map.max_entries > 1UL << 31) + return -EINVAL; +- } + +- if (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH) { ++ dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries); ++ + dtab->dev_index_head = dev_map_create_hash(dtab->n_buckets, + dtab->map.numa_node); + if (!dtab->dev_index_head) +-- +2.43.0 + diff --git a/queue-6.8/bpf-fix-hashtab-overflow-check-on-32-bit-arches.patch b/queue-6.8/bpf-fix-hashtab-overflow-check-on-32-bit-arches.patch new file mode 100644 index 00000000000..14a04a81429 --- /dev/null +++ b/queue-6.8/bpf-fix-hashtab-overflow-check-on-32-bit-arches.patch @@ -0,0 +1,65 @@ +From 0d9ac17a03c8a21f959ba9b68193548f9945aa0a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Mar 2024 13:03:36 +0100 +Subject: bpf: Fix hashtab overflow check on 32-bit arches +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Toke Høiland-Jørgensen + +[ Upstream commit 6787d916c2cf9850c97a0a3f73e08c43e7d973b1 ] + +The hashtab code relies on roundup_pow_of_two() to compute the number of +hash buckets, and contains an overflow check by checking if the +resulting value is 0. However, on 32-bit arches, the roundup code itself +can overflow by doing a 32-bit left-shift of an unsigned long value, +which is undefined behaviour, so it is not guaranteed to truncate +neatly. This was triggered by syzbot on the DEVMAP_HASH type, which +contains the same check, copied from the hashtab code. So apply the same +fix to hashtab, by moving the overflow check to before the roundup. + +Fixes: daaf427c6ab3 ("bpf: fix arraymap NULL deref and missing overflow and zero size checks") +Signed-off-by: Toke Høiland-Jørgensen +Message-ID: <20240307120340.99577-3-toke@redhat.com> +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + kernel/bpf/hashtab.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c +index 03a6a2500b6ab..3a088a5349bc0 100644 +--- a/kernel/bpf/hashtab.c ++++ b/kernel/bpf/hashtab.c +@@ -499,7 +499,13 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr) + num_possible_cpus()); + } + +- /* hash table size must be power of 2 */ ++ /* hash table size must be power of 2; roundup_pow_of_two() can overflow ++ * into UB on 32-bit arches, so check that first ++ */ ++ err = -E2BIG; ++ if (htab->map.max_entries > 1UL << 31) ++ goto free_htab; ++ + htab->n_buckets = roundup_pow_of_two(htab->map.max_entries); + + htab->elem_size = sizeof(struct htab_elem) + +@@ -509,10 +515,8 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr) + else + htab->elem_size += round_up(htab->map.value_size, 8); + +- err = -E2BIG; +- /* prevent zero size kmalloc and check for u32 overflow */ +- if (htab->n_buckets == 0 || +- htab->n_buckets > U32_MAX / sizeof(struct bucket)) ++ /* check for u32 overflow */ ++ if (htab->n_buckets > U32_MAX / sizeof(struct bucket)) + goto free_htab; + + err = bpf_map_init_elem_count(&htab->map); +-- +2.43.0 + diff --git a/queue-6.8/bpf-fix-stackmap-overflow-check-on-32-bit-arches.patch b/queue-6.8/bpf-fix-stackmap-overflow-check-on-32-bit-arches.patch new file mode 100644 index 00000000000..1825cfaf2a3 --- /dev/null +++ b/queue-6.8/bpf-fix-stackmap-overflow-check-on-32-bit-arches.patch @@ -0,0 +1,61 @@ +From df3e197388810b4f063dfcbb1600a25e4de0b49c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Mar 2024 13:03:37 +0100 +Subject: bpf: Fix stackmap overflow check on 32-bit arches +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Toke Høiland-Jørgensen + +[ Upstream commit 7a4b21250bf79eef26543d35bd390448646c536b ] + +The stackmap code relies on roundup_pow_of_two() to compute the number +of hash buckets, and contains an overflow check by checking if the +resulting value is 0. However, on 32-bit arches, the roundup code itself +can overflow by doing a 32-bit left-shift of an unsigned long value, +which is undefined behaviour, so it is not guaranteed to truncate +neatly. This was triggered by syzbot on the DEVMAP_HASH type, which +contains the same check, copied from the hashtab code. + +The commit in the fixes tag actually attempted to fix this, but the fix +did not account for the UB, so the fix only works on CPUs where an +overflow does result in a neat truncation to zero, which is not +guaranteed. Checking the value before rounding does not have this +problem. + +Fixes: 6183f4d3a0a2 ("bpf: Check for integer overflow when using roundup_pow_of_two()") +Signed-off-by: Toke Høiland-Jørgensen +Reviewed-by: Bui Quang Minh +Message-ID: <20240307120340.99577-4-toke@redhat.com> +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + kernel/bpf/stackmap.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c +index dff7ba5397015..c99f8e5234ac4 100644 +--- a/kernel/bpf/stackmap.c ++++ b/kernel/bpf/stackmap.c +@@ -91,11 +91,14 @@ static struct bpf_map *stack_map_alloc(union bpf_attr *attr) + } else if (value_size / 8 > sysctl_perf_event_max_stack) + return ERR_PTR(-EINVAL); + +- /* hash table size must be power of 2 */ +- n_buckets = roundup_pow_of_two(attr->max_entries); +- if (!n_buckets) ++ /* hash table size must be power of 2; roundup_pow_of_two() can overflow ++ * into UB on 32-bit arches, so check that first ++ */ ++ if (attr->max_entries > 1UL << 31) + return ERR_PTR(-E2BIG); + ++ n_buckets = roundup_pow_of_two(attr->max_entries); ++ + cost = n_buckets * sizeof(struct stack_map_bucket *) + sizeof(*smap); + smap = bpf_map_area_alloc(cost, bpf_map_attr_numa_node(attr)); + if (!smap) +-- +2.43.0 + diff --git a/queue-6.8/bpf-hardcode-bpf_prog_pack_size-to-2mb-num_possible_.patch b/queue-6.8/bpf-hardcode-bpf_prog_pack_size-to-2mb-num_possible_.patch new file mode 100644 index 00000000000..ed1a5965fc2 --- /dev/null +++ b/queue-6.8/bpf-hardcode-bpf_prog_pack_size-to-2mb-num_possible_.patch @@ -0,0 +1,53 @@ +From 400e2ee0bbf15b6e070e579284733561357daeba Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 11 Mar 2024 12:27:22 +0000 +Subject: bpf: hardcode BPF_PROG_PACK_SIZE to 2MB * num_possible_nodes() + +From: Puranjay Mohan + +[ Upstream commit d6170e4aaf86424c24ce06e355b4573daa891b17 ] + +On some architectures like ARM64, PMD_SIZE can be really large in some +configurations. Like with CONFIG_ARM64_64K_PAGES=y the PMD_SIZE is +512MB. + +Use 2MB * num_possible_nodes() as the size for allocations done through +the prog pack allocator. On most architectures, PMD_SIZE will be equal +to 2MB in case of 4KB pages and will be greater than 2MB for bigger page +sizes. + +Fixes: ea2babac63d4 ("bpf: Simplify bpf_prog_pack_[size|mask]") +Reported-by: "kernelci.org bot" +Closes: https://lore.kernel.org/all/7e216c88-77ee-47b8-becc-a0f780868d3c@sirena.org.uk/ +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202403092219.dhgcuz2G-lkp@intel.com/ +Suggested-by: Song Liu +Signed-off-by: Puranjay Mohan +Message-ID: <20240311122722.86232-1-puranjay12@gmail.com> +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + kernel/bpf/core.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c +index ea6843be2616c..026627226ec48 100644 +--- a/kernel/bpf/core.c ++++ b/kernel/bpf/core.c +@@ -888,7 +888,12 @@ static LIST_HEAD(pack_list); + * CONFIG_MMU=n. Use PAGE_SIZE in these cases. + */ + #ifdef PMD_SIZE +-#define BPF_PROG_PACK_SIZE (PMD_SIZE * num_possible_nodes()) ++/* PMD_SIZE is really big for some archs. It doesn't make sense to ++ * reserve too much memory in one allocation. Hardcode BPF_PROG_PACK_SIZE to ++ * 2MiB * num_possible_nodes(). On most architectures PMD_SIZE will be ++ * greater than or equal to 2MB. ++ */ ++#define BPF_PROG_PACK_SIZE (SZ_2M * num_possible_nodes()) + #else + #define BPF_PROG_PACK_SIZE PAGE_SIZE + #endif +-- +2.43.0 + diff --git a/queue-6.8/bpf-make-sure-scalar-args-don-t-accept-__arg_nonnull.patch b/queue-6.8/bpf-make-sure-scalar-args-don-t-accept-__arg_nonnull.patch new file mode 100644 index 00000000000..59d903c58b4 --- /dev/null +++ b/queue-6.8/bpf-make-sure-scalar-args-don-t-accept-__arg_nonnull.patch @@ -0,0 +1,53 @@ +From 77572d29a28df711b1feb1c0647fb816662733fa Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 4 Jan 2024 16:09:03 -0800 +Subject: bpf: make sure scalar args don't accept __arg_nonnull tag + +From: Andrii Nakryiko + +[ Upstream commit 18810ad3929ff6b5d8e67e3adc40d690bd780fd6 ] + +Move scalar arg processing in btf_prepare_func_args() after all pointer +arg processing is done. This makes it easier to do validation. One +example of unintended behavior right now is ability to specify +__arg_nonnull for integer/enum arguments. This patch fixes this. + +Signed-off-by: Andrii Nakryiko +Acked-by: Eduard Zingerman +Link: https://lore.kernel.org/r/20240105000909.2818934-3-andrii@kernel.org +Signed-off-by: Alexei Starovoitov +Stable-dep-of: 1eb986746a67 ("bpf: don't emit warnings intended for global subprogs for static subprogs") +Signed-off-by: Sasha Levin +--- + kernel/bpf/btf.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c +index 5964711891767..dbe7a590f565a 100644 +--- a/kernel/bpf/btf.c ++++ b/kernel/bpf/btf.c +@@ -7058,10 +7058,6 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog) + + while (btf_type_is_modifier(t)) + t = btf_type_by_id(btf, t->type); +- if (btf_type_is_int(t) || btf_is_any_enum(t)) { +- sub->args[i].arg_type = ARG_ANYTHING; +- continue; +- } + if (btf_type_is_ptr(t) && btf_get_prog_ctx_type(log, btf, t, prog_type, i)) { + sub->args[i].arg_type = ARG_PTR_TO_CTX; + continue; +@@ -7091,6 +7087,10 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog) + bpf_log(log, "arg#%d marked as non-null, but is not a pointer type\n", i); + return -EINVAL; + } ++ if (btf_type_is_int(t) || btf_is_any_enum(t)) { ++ sub->args[i].arg_type = ARG_ANYTHING; ++ continue; ++ } + bpf_log(log, "Arg#%d type %s in %s() is not supported yet.\n", + i, btf_type_str(t), tname); + return -EINVAL; +-- +2.43.0 + diff --git a/queue-6.8/bpf-mark-bpf_spin_-lock-unlock-helpers-with-notrace-.patch b/queue-6.8/bpf-mark-bpf_spin_-lock-unlock-helpers-with-notrace-.patch new file mode 100644 index 00000000000..ae331a76cd9 --- /dev/null +++ b/queue-6.8/bpf-mark-bpf_spin_-lock-unlock-helpers-with-notrace-.patch @@ -0,0 +1,133 @@ +From f070f9994e0eb5ff62f69b26600a9e5ea90e8a22 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Feb 2024 23:01:02 -0800 +Subject: bpf: Mark bpf_spin_{lock,unlock}() helpers with notrace correctly + +From: Yonghong Song + +[ Upstream commit 178c54666f9c4d2f49f2ea661d0c11b52f0ed190 ] + +Currently tracing is supposed not to allow for bpf_spin_{lock,unlock}() +helper calls. This is to prevent deadlock for the following cases: + - there is a prog (prog-A) calling bpf_spin_{lock,unlock}(). + - there is a tracing program (prog-B), e.g., fentry, attached + to bpf_spin_lock() and/or bpf_spin_unlock(). + - prog-B calls bpf_spin_{lock,unlock}(). +For such a case, when prog-A calls bpf_spin_{lock,unlock}(), +a deadlock will happen. + +The related source codes are below in kernel/bpf/helpers.c: + notrace BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) + notrace BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock) +notrace is supposed to prevent fentry prog from attaching to +bpf_spin_{lock,unlock}(). + +But actually this is not the case and fentry prog can successfully +attached to bpf_spin_lock(). Siddharth Chintamaneni reported +the issue in [1]. The following is the macro definition for +above BPF_CALL_1: + #define BPF_CALL_x(x, name, ...) \ + static __always_inline \ + u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ + typedef u64 (*btf_##name)(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ + u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ + u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ + { \ + return ((btf_##name)____##name)(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\ + } \ + static __always_inline \ + u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)) + + #define BPF_CALL_1(name, ...) BPF_CALL_x(1, name, __VA_ARGS__) + +The notrace attribute is actually applied to the static always_inline function +____bpf_spin_{lock,unlock}(). The actual callback function +bpf_spin_{lock,unlock}() is not marked with notrace, hence +allowing fentry prog to attach to two helpers, and this +may cause the above mentioned deadlock. Siddharth Chintamaneni +actually has a reproducer in [2]. + +To fix the issue, a new macro NOTRACE_BPF_CALL_1 is introduced which +will add notrace attribute to the original function instead of +the hidden always_inline function and this fixed the problem. + + [1] https://lore.kernel.org/bpf/CAE5sdEigPnoGrzN8WU7Tx-h-iFuMZgW06qp0KHWtpvoXxf1OAQ@mail.gmail.com/ + [2] https://lore.kernel.org/bpf/CAE5sdEg6yUc_Jz50AnUXEEUh6O73yQ1Z6NV2srJnef0ZrQkZew@mail.gmail.com/ + +Fixes: d83525ca62cf ("bpf: introduce bpf_spin_lock") +Signed-off-by: Yonghong Song +Signed-off-by: Andrii Nakryiko +Acked-by: Jiri Olsa +Link: https://lore.kernel.org/bpf/20240207070102.335167-1-yonghong.song@linux.dev +Signed-off-by: Sasha Levin +--- + include/linux/filter.h | 21 ++++++++++++--------- + kernel/bpf/helpers.c | 4 ++-- + 2 files changed, 14 insertions(+), 11 deletions(-) + +diff --git a/include/linux/filter.h b/include/linux/filter.h +index 68fb6c8142fec..f537a394c42d0 100644 +--- a/include/linux/filter.h ++++ b/include/linux/filter.h +@@ -547,24 +547,27 @@ static inline bool insn_is_zext(const struct bpf_insn *insn) + __BPF_MAP(n, __BPF_DECL_ARGS, __BPF_N, u64, __ur_1, u64, __ur_2, \ + u64, __ur_3, u64, __ur_4, u64, __ur_5) + +-#define BPF_CALL_x(x, name, ...) \ ++#define BPF_CALL_x(x, attr, name, ...) \ + static __always_inline \ + u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ + typedef u64 (*btf_##name)(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ +- u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ +- u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ ++ attr u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ ++ attr u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ + { \ + return ((btf_##name)____##name)(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\ + } \ + static __always_inline \ + u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)) + +-#define BPF_CALL_0(name, ...) BPF_CALL_x(0, name, __VA_ARGS__) +-#define BPF_CALL_1(name, ...) BPF_CALL_x(1, name, __VA_ARGS__) +-#define BPF_CALL_2(name, ...) BPF_CALL_x(2, name, __VA_ARGS__) +-#define BPF_CALL_3(name, ...) BPF_CALL_x(3, name, __VA_ARGS__) +-#define BPF_CALL_4(name, ...) BPF_CALL_x(4, name, __VA_ARGS__) +-#define BPF_CALL_5(name, ...) BPF_CALL_x(5, name, __VA_ARGS__) ++#define __NOATTR ++#define BPF_CALL_0(name, ...) BPF_CALL_x(0, __NOATTR, name, __VA_ARGS__) ++#define BPF_CALL_1(name, ...) BPF_CALL_x(1, __NOATTR, name, __VA_ARGS__) ++#define BPF_CALL_2(name, ...) BPF_CALL_x(2, __NOATTR, name, __VA_ARGS__) ++#define BPF_CALL_3(name, ...) BPF_CALL_x(3, __NOATTR, name, __VA_ARGS__) ++#define BPF_CALL_4(name, ...) BPF_CALL_x(4, __NOATTR, name, __VA_ARGS__) ++#define BPF_CALL_5(name, ...) BPF_CALL_x(5, __NOATTR, name, __VA_ARGS__) ++ ++#define NOTRACE_BPF_CALL_1(name, ...) BPF_CALL_x(1, notrace, name, __VA_ARGS__) + + #define bpf_ctx_range(TYPE, MEMBER) \ + offsetof(TYPE, MEMBER) ... offsetofend(TYPE, MEMBER) - 1 +diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c +index d19cd863d294e..b10092754dde3 100644 +--- a/kernel/bpf/helpers.c ++++ b/kernel/bpf/helpers.c +@@ -334,7 +334,7 @@ static inline void __bpf_spin_lock_irqsave(struct bpf_spin_lock *lock) + __this_cpu_write(irqsave_flags, flags); + } + +-notrace BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) ++NOTRACE_BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) + { + __bpf_spin_lock_irqsave(lock); + return 0; +@@ -357,7 +357,7 @@ static inline void __bpf_spin_unlock_irqrestore(struct bpf_spin_lock *lock) + local_irq_restore(flags); + } + +-notrace BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock) ++NOTRACE_BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock) + { + __bpf_spin_unlock_irqrestore(lock); + return 0; +-- +2.43.0 + diff --git a/queue-6.8/bpftool-fix-wrong-free-call-in-do_show_link.patch b/queue-6.8/bpftool-fix-wrong-free-call-in-do_show_link.patch new file mode 100644 index 00000000000..348f66038e6 --- /dev/null +++ b/queue-6.8/bpftool-fix-wrong-free-call-in-do_show_link.patch @@ -0,0 +1,39 @@ +From 0f1f19ea08865b922b21784e11410cb2126a25b9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Jan 2024 12:05:00 +0100 +Subject: bpftool: Fix wrong free call in do_show_link + +From: Jiri Olsa + +[ Upstream commit 2adb2e0fcdf3c6d8e28a5a9c33e458e1037ae5ad ] + +The error path frees wrong array, it should be ref_ctr_offsets. + +Acked-by: Yafang Shao +Reviewed-by: Quentin Monnet +Fixes: a7795698f8b6 ("bpftool: Add support to display uprobe_multi links") +Signed-off-by: Jiri Olsa +Acked-by: Song Liu +Link: https://lore.kernel.org/r/20240119110505.400573-4-jolsa@kernel.org +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + tools/bpf/bpftool/link.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c +index cb46667a6b2e7..35b6859dd7c3d 100644 +--- a/tools/bpf/bpftool/link.c ++++ b/tools/bpf/bpftool/link.c +@@ -977,7 +977,7 @@ static int do_show_link(int fd) + cookies = calloc(count, sizeof(__u64)); + if (!cookies) { + p_err("mem alloc failed"); +- free(cookies); ++ free(ref_ctr_offsets); + free(offsets); + close(fd); + return -ENOMEM; +-- +2.43.0 + diff --git a/queue-6.8/bpftool-silence-build-warning-about-calloc.patch b/queue-6.8/bpftool-silence-build-warning-about-calloc.patch new file mode 100644 index 00000000000..118aca41239 --- /dev/null +++ b/queue-6.8/bpftool-silence-build-warning-about-calloc.patch @@ -0,0 +1,54 @@ +From 7ed01e99f68efa1eec411649b8dda1cdb18bc7e7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Jan 2024 14:19:20 +0800 +Subject: bpftool: Silence build warning about calloc() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Tiezhu Yang + +[ Upstream commit f5f30386c78105cba520e443a6a9ee945ec1d066 ] + +There exists the following warning when building bpftool: + + CC prog.o +prog.c: In function ‘profile_open_perf_events’: +prog.c:2301:24: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] + 2301 | sizeof(int), obj->rodata->num_cpu * obj->rodata->num_metric); + | ^~~ +prog.c:2301:24: note: earlier argument should specify number of elements, later size of each element + +Tested with the latest upstream GCC which contains a new warning option +-Wcalloc-transposed-args. The first argument to calloc is documented to +be number of elements in array, while the second argument is size of each +element, just switch the first and second arguments of calloc() to silence +the build warning, compile tested only. + +Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command") +Signed-off-by: Tiezhu Yang +Signed-off-by: Daniel Borkmann +Reviewed-by: Quentin Monnet +Link: https://lore.kernel.org/bpf/20240116061920.31172-1-yangtiezhu@loongson.cn +Signed-off-by: Alexei Starovoitov +Signed-off-by: Sasha Levin +--- + tools/bpf/bpftool/prog.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c +index feb8e305804fc..9cb42a3366c07 100644 +--- a/tools/bpf/bpftool/prog.c ++++ b/tools/bpf/bpftool/prog.c +@@ -2298,7 +2298,7 @@ static int profile_open_perf_events(struct profiler_bpf *obj) + int map_fd; + + profile_perf_events = calloc( +- sizeof(int), obj->rodata->num_cpu * obj->rodata->num_metric); ++ obj->rodata->num_cpu * obj->rodata->num_metric, sizeof(int)); + if (!profile_perf_events) { + p_err("failed to allocate memory for perf_event array: %s", + strerror(errno)); +-- +2.43.0 + diff --git a/queue-6.8/btrfs-fix-race-when-detecting-delalloc-ranges-during.patch b/queue-6.8/btrfs-fix-race-when-detecting-delalloc-ranges-during.patch new file mode 100644 index 00000000000..e0f5eb0f308 --- /dev/null +++ b/queue-6.8/btrfs-fix-race-when-detecting-delalloc-ranges-during.patch @@ -0,0 +1,511 @@ +From e644af5e5a5efdf88e0c693729b64357262874b9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Feb 2024 11:37:56 +0000 +Subject: btrfs: fix race when detecting delalloc ranges during fiemap + +From: Filipe Manana + +[ Upstream commit 978b63f7464abcfd364a6c95f734282c50f3decf ] + +For fiemap we recently stopped locking the target extent range for the +whole duration of the fiemap call, in order to avoid a deadlock in a +scenario where the fiemap buffer happens to be a memory mapped range of +the same file. This use case is very unlikely to be useful in practice but +it may be triggered by fuzz testing (syzbot, etc). + +This however introduced a race that makes us miss delalloc ranges for +file regions that are currently holes, so the caller of fiemap will not +be aware that there's data for some file regions. This can be quite +serious for some use cases - for example in coreutils versions before 9.0, +the cp program used fiemap to detect holes and data in the source file, +copying only regions with data (extents or delalloc) from the source file +to the destination file in order to preserve holes (see the documentation +for its --sparse command line option). This means that if cp was used +with a source file that had delalloc in a hole, the destination file could +end up without that data, which is effectively a data loss issue, if it +happened to hit the race described below. + +The race happens like this: + +1) Fiemap is called, without the FIEMAP_FLAG_SYNC flag, for a file that + has delalloc in the file range [64M, 65M[, which is currently a hole; + +2) Fiemap locks the inode in shared mode, then starts iterating the + inode's subvolume tree searching for file extent items, without having + the whole fiemap target range locked in the inode's io tree - the + change introduced recently by commit b0ad381fa769 ("btrfs: fix + deadlock with fiemap and extent locking"). It only locks ranges in + the io tree when it finds a hole or prealloc extent since that + commit; + +3) Note that fiemap clones each leaf before using it, and this is to + avoid deadlocks when locking a file range in the inode's io tree and + the fiemap buffer is memory mapped to some file, because writing + to the page with btrfs_page_mkwrite() will wait on any ordered extent + for the page's range and the ordered extent needs to lock the range + and may need to modify the same leaf, therefore leading to a deadlock + on the leaf; + +4) While iterating the file extent items in the cloned leaf before + finding the hole in the range [64M, 65M[, the delalloc in that range + is flushed and its ordered extent completes - meaning the corresponding + file extent item is in the inode's subvolume tree, but not present in + the cloned leaf that fiemap is iterating over; + +5) When fiemap finds the hole in the [64M, 65M[ range by seeing the gap in + the cloned leaf (or a file extent item with disk_bytenr == 0 in case + the NO_HOLES feature is not enabled), it will lock that file range in + the inode's io tree and then search for delalloc by checking for the + EXTENT_DELALLOC bit in the io tree for that range and ordered extents + (with btrfs_find_delalloc_in_range()). But it finds nothing since the + delalloc in that range was already flushed and the ordered extent + completed and is gone - as a result fiemap will not report that there's + delalloc or an extent for the range [64M, 65M[, so user space will be + mislead into thinking that there's a hole in that range. + +This could actually be sporadically triggered with test case generic/094 +from fstests, which reports a missing extent/delalloc range like this: + + generic/094 2s ... - output mismatch (see /home/fdmanana/git/hub/xfstests/results//generic/094.out.bad) + --- tests/generic/094.out 2020-06-10 19:29:03.830519425 +0100 + +++ /home/fdmanana/git/hub/xfstests/results//generic/094.out.bad 2024-02-28 11:00:00.381071525 +0000 + @@ -1,3 +1,9 @@ + QA output created by 094 + fiemap run with sync + fiemap run without sync + +ERROR: couldn't find extent at 7 + +map is 'HHDDHPPDPHPH' + +logical: [ 5.. 6] phys: 301517.. 301518 flags: 0x800 tot: 2 + +logical: [ 8.. 8] phys: 301520.. 301520 flags: 0x800 tot: 1 + ... + (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/generic/094.out /home/fdmanana/git/hub/xfstests/results//generic/094.out.bad' to see the entire diff) + +So in order to fix this, while still avoiding deadlocks in the case where +the fiemap buffer is memory mapped to the same file, change fiemap to work +like the following: + +1) Always lock the whole range in the inode's io tree before starting to + iterate the inode's subvolume tree searching for file extent items, + just like we did before commit b0ad381fa769 ("btrfs: fix deadlock with + fiemap and extent locking"); + +2) Now instead of writing to the fiemap buffer every time we have an extent + to report, write instead to a temporary buffer (1 page), and when that + buffer becomes full, stop iterating the file extent items, unlock the + range in the io tree, release the search path, submit all the entries + kept in that buffer to the fiemap buffer, and then resume the search + for file extent items after locking again the remainder of the range in + the io tree. + + The buffer having a size of a page, allows for 146 entries in a system + with 4K pages. This is a large enough value to have a good performance + by avoiding too many restarts of the search for file extent items. + In other words this preserves the huge performance gains made in the + last two years to fiemap, while avoiding the deadlocks in case the + fiemap buffer is memory mapped to the same file (useless in practice, + but possible and exercised by fuzz testing and syzbot). + +Fixes: b0ad381fa769 ("btrfs: fix deadlock with fiemap and extent locking") +Reviewed-by: Josef Bacik +Signed-off-by: Filipe Manana +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/extent_io.c | 221 +++++++++++++++++++++++++++++++------------ + 1 file changed, 160 insertions(+), 61 deletions(-) + +diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c +index 8b4bef05e2221..7761d7d93ba98 100644 +--- a/fs/btrfs/extent_io.c ++++ b/fs/btrfs/extent_io.c +@@ -2453,12 +2453,65 @@ int try_release_extent_mapping(struct page *page, gfp_t mask) + return try_release_extent_state(tree, page, mask); + } + ++struct btrfs_fiemap_entry { ++ u64 offset; ++ u64 phys; ++ u64 len; ++ u32 flags; ++}; ++ + /* +- * To cache previous fiemap extent ++ * Indicate the caller of emit_fiemap_extent() that it needs to unlock the file ++ * range from the inode's io tree, unlock the subvolume tree search path, flush ++ * the fiemap cache and relock the file range and research the subvolume tree. ++ * The value here is something negative that can't be confused with a valid ++ * errno value and different from 1 because that's also a return value from ++ * fiemap_fill_next_extent() and also it's often used to mean some btree search ++ * did not find a key, so make it some distinct negative value. ++ */ ++#define BTRFS_FIEMAP_FLUSH_CACHE (-(MAX_ERRNO + 1)) ++ ++/* ++ * Used to: ++ * ++ * - Cache the next entry to be emitted to the fiemap buffer, so that we can ++ * merge extents that are contiguous and can be grouped as a single one; + * +- * Will be used for merging fiemap extent ++ * - Store extents ready to be written to the fiemap buffer in an intermediary ++ * buffer. This intermediary buffer is to ensure that in case the fiemap ++ * buffer is memory mapped to the fiemap target file, we don't deadlock ++ * during btrfs_page_mkwrite(). This is because during fiemap we are locking ++ * an extent range in order to prevent races with delalloc flushing and ++ * ordered extent completion, which is needed in order to reliably detect ++ * delalloc in holes and prealloc extents. And this can lead to a deadlock ++ * if the fiemap buffer is memory mapped to the file we are running fiemap ++ * against (a silly, useless in practice scenario, but possible) because ++ * btrfs_page_mkwrite() will try to lock the same extent range. + */ + struct fiemap_cache { ++ /* An array of ready fiemap entries. */ ++ struct btrfs_fiemap_entry *entries; ++ /* Number of entries in the entries array. */ ++ int entries_size; ++ /* Index of the next entry in the entries array to write to. */ ++ int entries_pos; ++ /* ++ * Once the entries array is full, this indicates what's the offset for ++ * the next file extent item we must search for in the inode's subvolume ++ * tree after unlocking the extent range in the inode's io tree and ++ * releasing the search path. ++ */ ++ u64 next_search_offset; ++ /* ++ * This matches struct fiemap_extent_info::fi_mapped_extents, we use it ++ * to count ourselves emitted extents and stop instead of relying on ++ * fiemap_fill_next_extent() because we buffer ready fiemap entries at ++ * the @entries array, and we want to stop as soon as we hit the max ++ * amount of extents to map, not just to save time but also to make the ++ * logic at extent_fiemap() simpler. ++ */ ++ unsigned int extents_mapped; ++ /* Fields for the cached extent (unsubmitted, not ready, extent). */ + u64 offset; + u64 phys; + u64 len; +@@ -2466,6 +2519,28 @@ struct fiemap_cache { + bool cached; + }; + ++static int flush_fiemap_cache(struct fiemap_extent_info *fieinfo, ++ struct fiemap_cache *cache) ++{ ++ for (int i = 0; i < cache->entries_pos; i++) { ++ struct btrfs_fiemap_entry *entry = &cache->entries[i]; ++ int ret; ++ ++ ret = fiemap_fill_next_extent(fieinfo, entry->offset, ++ entry->phys, entry->len, ++ entry->flags); ++ /* ++ * Ignore 1 (reached max entries) because we keep track of that ++ * ourselves in emit_fiemap_extent(). ++ */ ++ if (ret < 0) ++ return ret; ++ } ++ cache->entries_pos = 0; ++ ++ return 0; ++} ++ + /* + * Helper to submit fiemap extent. + * +@@ -2480,8 +2555,8 @@ static int emit_fiemap_extent(struct fiemap_extent_info *fieinfo, + struct fiemap_cache *cache, + u64 offset, u64 phys, u64 len, u32 flags) + { ++ struct btrfs_fiemap_entry *entry; + u64 cache_end; +- int ret = 0; + + /* Set at the end of extent_fiemap(). */ + ASSERT((flags & FIEMAP_EXTENT_LAST) == 0); +@@ -2494,7 +2569,9 @@ static int emit_fiemap_extent(struct fiemap_extent_info *fieinfo, + * find an extent that starts at an offset behind the end offset of the + * previous extent we processed. This happens if fiemap is called + * without FIEMAP_FLAG_SYNC and there are ordered extents completing +- * while we call btrfs_next_leaf() (through fiemap_next_leaf_item()). ++ * after we had to unlock the file range, release the search path, emit ++ * the fiemap extents stored in the buffer (cache->entries array) and ++ * the lock the remainder of the range and re-search the btree. + * + * For example we are in leaf X processing its last item, which is the + * file extent item for file range [512K, 1M[, and after +@@ -2607,11 +2684,35 @@ static int emit_fiemap_extent(struct fiemap_extent_info *fieinfo, + + emit: + /* Not mergeable, need to submit cached one */ +- ret = fiemap_fill_next_extent(fieinfo, cache->offset, cache->phys, +- cache->len, cache->flags); +- cache->cached = false; +- if (ret) +- return ret; ++ ++ if (cache->entries_pos == cache->entries_size) { ++ /* ++ * We will need to research for the end offset of the last ++ * stored extent and not from the current offset, because after ++ * unlocking the range and releasing the path, if there's a hole ++ * between that end offset and this current offset, a new extent ++ * may have been inserted due to a new write, so we don't want ++ * to miss it. ++ */ ++ entry = &cache->entries[cache->entries_size - 1]; ++ cache->next_search_offset = entry->offset + entry->len; ++ cache->cached = false; ++ ++ return BTRFS_FIEMAP_FLUSH_CACHE; ++ } ++ ++ entry = &cache->entries[cache->entries_pos]; ++ entry->offset = cache->offset; ++ entry->phys = cache->phys; ++ entry->len = cache->len; ++ entry->flags = cache->flags; ++ cache->entries_pos++; ++ cache->extents_mapped++; ++ ++ if (cache->extents_mapped == fieinfo->fi_extents_max) { ++ cache->cached = false; ++ return 1; ++ } + assign: + cache->cached = true; + cache->offset = offset; +@@ -2737,8 +2838,8 @@ static int fiemap_search_slot(struct btrfs_inode *inode, struct btrfs_path *path + * neighbour leaf). + * We also need the private clone because holding a read lock on an + * extent buffer of the subvolume's b+tree will make lockdep unhappy +- * when we call fiemap_fill_next_extent(), because that may cause a page +- * fault when filling the user space buffer with fiemap data. ++ * when we check if extents are shared, as backref walking may need to ++ * lock the same leaf we are processing. + */ + clone = btrfs_clone_extent_buffer(path->nodes[0]); + if (!clone) +@@ -2778,34 +2879,16 @@ static int fiemap_process_hole(struct btrfs_inode *inode, + * it beyond i_size. + */ + while (cur_offset < end && cur_offset < i_size) { +- struct extent_state *cached_state = NULL; + u64 delalloc_start; + u64 delalloc_end; + u64 prealloc_start; +- u64 lockstart; +- u64 lockend; + u64 prealloc_len = 0; + bool delalloc; + +- lockstart = round_down(cur_offset, inode->root->fs_info->sectorsize); +- lockend = round_up(end, inode->root->fs_info->sectorsize); +- +- /* +- * We are only locking for the delalloc range because that's the +- * only thing that can change here. With fiemap we have a lock +- * on the inode, so no buffered or direct writes can happen. +- * +- * However mmaps and normal page writeback will cause this to +- * change arbitrarily. We have to lock the extent lock here to +- * make sure that nobody messes with the tree while we're doing +- * btrfs_find_delalloc_in_range. +- */ +- lock_extent(&inode->io_tree, lockstart, lockend, &cached_state); + delalloc = btrfs_find_delalloc_in_range(inode, cur_offset, end, + delalloc_cached_state, + &delalloc_start, + &delalloc_end); +- unlock_extent(&inode->io_tree, lockstart, lockend, &cached_state); + if (!delalloc) + break; + +@@ -2973,6 +3056,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + u64 start, u64 len) + { + const u64 ino = btrfs_ino(inode); ++ struct extent_state *cached_state = NULL; + struct extent_state *delalloc_cached_state = NULL; + struct btrfs_path *path; + struct fiemap_cache cache = { 0 }; +@@ -2985,26 +3069,33 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + bool stopped = false; + int ret; + ++ cache.entries_size = PAGE_SIZE / sizeof(struct btrfs_fiemap_entry); ++ cache.entries = kmalloc_array(cache.entries_size, ++ sizeof(struct btrfs_fiemap_entry), ++ GFP_KERNEL); + backref_ctx = btrfs_alloc_backref_share_check_ctx(); + path = btrfs_alloc_path(); +- if (!backref_ctx || !path) { ++ if (!cache.entries || !backref_ctx || !path) { + ret = -ENOMEM; + goto out; + } + ++restart: + range_start = round_down(start, sectorsize); + range_end = round_up(start + len, sectorsize); + prev_extent_end = range_start; + ++ lock_extent(&inode->io_tree, range_start, range_end, &cached_state); ++ + ret = fiemap_find_last_extent_offset(inode, path, &last_extent_end); + if (ret < 0) +- goto out; ++ goto out_unlock; + btrfs_release_path(path); + + path->reada = READA_FORWARD; + ret = fiemap_search_slot(inode, path, range_start); + if (ret < 0) { +- goto out; ++ goto out_unlock; + } else if (ret > 0) { + /* + * No file extent item found, but we may have delalloc between +@@ -3051,7 +3142,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + backref_ctx, 0, 0, 0, + prev_extent_end, hole_end); + if (ret < 0) { +- goto out; ++ goto out_unlock; + } else if (ret > 0) { + /* fiemap_fill_next_extent() told us to stop. */ + stopped = true; +@@ -3107,7 +3198,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + extent_gen, + backref_ctx); + if (ret < 0) +- goto out; ++ goto out_unlock; + else if (ret > 0) + flags |= FIEMAP_EXTENT_SHARED; + } +@@ -3118,9 +3209,9 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + } + + if (ret < 0) { +- goto out; ++ goto out_unlock; + } else if (ret > 0) { +- /* fiemap_fill_next_extent() told us to stop. */ ++ /* emit_fiemap_extent() told us to stop. */ + stopped = true; + break; + } +@@ -3129,12 +3220,12 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + next_item: + if (fatal_signal_pending(current)) { + ret = -EINTR; +- goto out; ++ goto out_unlock; + } + + ret = fiemap_next_leaf_item(inode, path); + if (ret < 0) { +- goto out; ++ goto out_unlock; + } else if (ret > 0) { + /* No more file extent items for this inode. */ + break; +@@ -3143,22 +3234,12 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + } + + check_eof_delalloc: +- /* +- * Release (and free) the path before emitting any final entries to +- * fiemap_fill_next_extent() to keep lockdep happy. This is because +- * once we find no more file extent items exist, we may have a +- * non-cloned leaf, and fiemap_fill_next_extent() can trigger page +- * faults when copying data to the user space buffer. +- */ +- btrfs_free_path(path); +- path = NULL; +- + if (!stopped && prev_extent_end < range_end) { + ret = fiemap_process_hole(inode, fieinfo, &cache, + &delalloc_cached_state, backref_ctx, + 0, 0, 0, prev_extent_end, range_end - 1); + if (ret < 0) +- goto out; ++ goto out_unlock; + prev_extent_end = range_end; + } + +@@ -3166,28 +3247,16 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + const u64 i_size = i_size_read(&inode->vfs_inode); + + if (prev_extent_end < i_size) { +- struct extent_state *cached_state = NULL; + u64 delalloc_start; + u64 delalloc_end; +- u64 lockstart; +- u64 lockend; + bool delalloc; + +- lockstart = round_down(prev_extent_end, sectorsize); +- lockend = round_up(i_size, sectorsize); +- +- /* +- * See the comment in fiemap_process_hole as to why +- * we're doing the locking here. +- */ +- lock_extent(&inode->io_tree, lockstart, lockend, &cached_state); + delalloc = btrfs_find_delalloc_in_range(inode, + prev_extent_end, + i_size - 1, + &delalloc_cached_state, + &delalloc_start, + &delalloc_end); +- unlock_extent(&inode->io_tree, lockstart, lockend, &cached_state); + if (!delalloc) + cache.flags |= FIEMAP_EXTENT_LAST; + } else { +@@ -3195,9 +3264,39 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, + } + } + ++out_unlock: ++ unlock_extent(&inode->io_tree, range_start, range_end, &cached_state); ++ ++ if (ret == BTRFS_FIEMAP_FLUSH_CACHE) { ++ btrfs_release_path(path); ++ ret = flush_fiemap_cache(fieinfo, &cache); ++ if (ret) ++ goto out; ++ len -= cache.next_search_offset - start; ++ start = cache.next_search_offset; ++ goto restart; ++ } else if (ret < 0) { ++ goto out; ++ } ++ ++ /* ++ * Must free the path before emitting to the fiemap buffer because we ++ * may have a non-cloned leaf and if the fiemap buffer is memory mapped ++ * to a file, a write into it (through btrfs_page_mkwrite()) may trigger ++ * waiting for an ordered extent that in order to complete needs to ++ * modify that leaf, therefore leading to a deadlock. ++ */ ++ btrfs_free_path(path); ++ path = NULL; ++ ++ ret = flush_fiemap_cache(fieinfo, &cache); ++ if (ret) ++ goto out; ++ + ret = emit_last_fiemap_cache(fieinfo, &cache); + out: + free_extent_state(delalloc_cached_state); ++ kfree(cache.entries); + btrfs_free_backref_share_ctx(backref_ctx); + btrfs_free_path(path); + return ret; +-- +2.43.0 + diff --git a/queue-6.8/bus-tegra-aconnect-update-dependency-to-arch_tegra.patch b/queue-6.8/bus-tegra-aconnect-update-dependency-to-arch_tegra.patch new file mode 100644 index 00000000000..f6812132a46 --- /dev/null +++ b/queue-6.8/bus-tegra-aconnect-update-dependency-to-arch_tegra.patch @@ -0,0 +1,47 @@ +From 47301708125a40d17ceec82e36a2399a73056111 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 10:02:37 +0000 +Subject: bus: tegra-aconnect: Update dependency to ARCH_TEGRA + +From: Peter Robinson + +[ Upstream commit 4acd21a45c1446277e2abaece97d7fa7c2e692a9 ] + +Update the architecture dependency to be the generic Tegra +because the driver works on the four latest Tegra generations +not just Tegra210, if you build a kernel with a specific +ARCH_TEGRA_xxx_SOC option that excludes Tegra210 you don't get +this driver. + +Fixes: 46a88534afb59 ("bus: Add support for Tegra ACONNECT") +Signed-off-by: Peter Robinson +Cc: Jon Hunter +Cc: Thierry Reding +Signed-off-by: Thierry Reding +Signed-off-by: Sasha Levin +--- + drivers/bus/Kconfig | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig +index e6742998f372c..d5e7fa9173a16 100644 +--- a/drivers/bus/Kconfig ++++ b/drivers/bus/Kconfig +@@ -186,11 +186,12 @@ config SUNXI_RSB + + config TEGRA_ACONNECT + tristate "Tegra ACONNECT Bus Driver" +- depends on ARCH_TEGRA_210_SOC ++ depends on ARCH_TEGRA + depends on OF && PM + help + Driver for the Tegra ACONNECT bus which is used to interface with +- the devices inside the Audio Processing Engine (APE) for Tegra210. ++ the devices inside the Audio Processing Engine (APE) for ++ Tegra210 and later. + + config TEGRA_GMI + tristate "Tegra Generic Memory Interface bus driver" +-- +2.43.0 + diff --git a/queue-6.8/can-m_can-start-cancel-polling-timer-together-with-i.patch b/queue-6.8/can-m_can-start-cancel-polling-timer-together-with-i.patch new file mode 100644 index 00000000000..1382ba9b367 --- /dev/null +++ b/queue-6.8/can-m_can-start-cancel-polling-timer-together-with-i.patch @@ -0,0 +1,82 @@ +From 3aebac51a64b812b271cec02ad61dcd691788238 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Feb 2024 10:32:07 +0100 +Subject: can: m_can: Start/Cancel polling timer together with interrupts + +From: Markus Schneider-Pargmann + +[ Upstream commit a163c5761019b94258ca655b27b46e82657fd6f5 ] + +Interrupts are enabled/disabled in more places than just m_can_start() +and m_can_stop(). Couple the polling timer with enabling/disabling of +all interrupts to achieve equivalent behavior. + +Cc: Judith Mendez +Fixes: b382380c0d2d ("can: m_can: Add hrtimer to generate software interrupt") +Signed-off-by: Markus Schneider-Pargmann +Reviewed-by: Simon Horman +Link: https://lore.kernel.org/all/20240207093220.2681425-2-msp@baylibre.com +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Sasha Levin +--- + drivers/net/can/m_can/m_can.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c +index 16ecc11c7f62a..2395b1225cc8a 100644 +--- a/drivers/net/can/m_can/m_can.c ++++ b/drivers/net/can/m_can/m_can.c +@@ -418,6 +418,13 @@ static void m_can_config_endisable(struct m_can_classdev *cdev, bool enable) + + static inline void m_can_enable_all_interrupts(struct m_can_classdev *cdev) + { ++ if (!cdev->net->irq) { ++ dev_dbg(cdev->dev, "Start hrtimer\n"); ++ hrtimer_start(&cdev->hrtimer, ++ ms_to_ktime(HRTIMER_POLL_INTERVAL_MS), ++ HRTIMER_MODE_REL_PINNED); ++ } ++ + /* Only interrupt line 0 is used in this driver */ + m_can_write(cdev, M_CAN_ILE, ILE_EINT0); + } +@@ -425,6 +432,11 @@ static inline void m_can_enable_all_interrupts(struct m_can_classdev *cdev) + static inline void m_can_disable_all_interrupts(struct m_can_classdev *cdev) + { + m_can_write(cdev, M_CAN_ILE, 0x0); ++ ++ if (!cdev->net->irq) { ++ dev_dbg(cdev->dev, "Stop hrtimer\n"); ++ hrtimer_cancel(&cdev->hrtimer); ++ } + } + + /* Retrieve internal timestamp counter from TSCV.TSC, and shift it to 32-bit +@@ -1417,12 +1429,6 @@ static int m_can_start(struct net_device *dev) + + m_can_enable_all_interrupts(cdev); + +- if (!dev->irq) { +- dev_dbg(cdev->dev, "Start hrtimer\n"); +- hrtimer_start(&cdev->hrtimer, ms_to_ktime(HRTIMER_POLL_INTERVAL_MS), +- HRTIMER_MODE_REL_PINNED); +- } +- + return 0; + } + +@@ -1577,11 +1583,6 @@ static void m_can_stop(struct net_device *dev) + { + struct m_can_classdev *cdev = netdev_priv(dev); + +- if (!dev->irq) { +- dev_dbg(cdev->dev, "Stop hrtimer\n"); +- hrtimer_cancel(&cdev->hrtimer); +- } +- + /* disable all interrupts */ + m_can_disable_all_interrupts(cdev); + +-- +2.43.0 + diff --git a/queue-6.8/cifs-fix-writeback-data-corruption.patch b/queue-6.8/cifs-fix-writeback-data-corruption.patch new file mode 100644 index 00000000000..7c210534ed4 --- /dev/null +++ b/queue-6.8/cifs-fix-writeback-data-corruption.patch @@ -0,0 +1,510 @@ +From 328de8ee686d8f1cf9d84de4338f0555517d9717 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Feb 2024 11:20:26 +0000 +Subject: cifs: Fix writeback data corruption + +From: David Howells + +[ Upstream commit f3dc1bdb6b0b0693562c7c54a6c28bafa608ba3c ] + +cifs writeback doesn't correctly handle the case where +cifs_extend_writeback() hits a point where it is considering an additional +folio, but this would overrun the wsize - at which point it drops out of +the xarray scanning loop and calls xas_pause(). The problem is that +xas_pause() advances the loop counter - thereby skipping that page. + +What needs to happen is for xas_reset() to be called any time we decide we +don't want to process the page we're looking at, but rather send the +request we are building and start a new one. + +Fix this by copying and adapting the netfslib writepages code as a +temporary measure, with cifs writeback intending to be offloaded to +netfslib in the near future. + +This also fixes the issue with the use of filemap_get_folios_tag() causing +retry of a bunch of pages which the extender already dealt with. + +This can be tested by creating, say, a 64K file somewhere not on cifs +(otherwise copy-offload may get underfoot), mounting a cifs share with a +wsize of 64000, copying the file to it and then comparing the original file +and the copy: + + dd if=/dev/urandom of=/tmp/64K bs=64k count=1 + mount //192.168.6.1/test /mnt -o user=...,pass=...,wsize=64000 + cp /tmp/64K /mnt/64K + cmp /tmp/64K /mnt/64K + +Without the fix, the cmp fails at position 64000 (or shortly thereafter). + +Fixes: d08089f649a0 ("cifs: Change the I/O paths to use an iterator rather than a page list") +Signed-off-by: David Howells +cc: Steve French +cc: Paulo Alcantara +cc: Ronnie Sahlberg +cc: Shyam Prasad N +cc: Tom Talpey +cc: Jeff Layton +cc: linux-cifs@vger.kernel.org +cc: samba-technical@lists.samba.org +cc: netfs@lists.linux.dev +cc: linux-fsdevel@vger.kernel.org +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/client/file.c | 283 ++++++++++++++++++++++++------------------- + 1 file changed, 157 insertions(+), 126 deletions(-) + +diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c +index f391c9b803d84..98514f2f2d7b1 100644 +--- a/fs/smb/client/file.c ++++ b/fs/smb/client/file.c +@@ -2624,20 +2624,20 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) + * dirty pages if possible, but don't sleep while doing so. + */ + static void cifs_extend_writeback(struct address_space *mapping, ++ struct xa_state *xas, + long *_count, + loff_t start, + int max_pages, +- size_t max_len, +- unsigned int *_len) ++ loff_t max_len, ++ size_t *_len) + { + struct folio_batch batch; + struct folio *folio; +- unsigned int psize, nr_pages; +- size_t len = *_len; +- pgoff_t index = (start + len) / PAGE_SIZE; ++ unsigned int nr_pages; ++ pgoff_t index = (start + *_len) / PAGE_SIZE; ++ size_t len; + bool stop = true; + unsigned int i; +- XA_STATE(xas, &mapping->i_pages, index); + + folio_batch_init(&batch); + +@@ -2648,54 +2648,64 @@ static void cifs_extend_writeback(struct address_space *mapping, + */ + rcu_read_lock(); + +- xas_for_each(&xas, folio, ULONG_MAX) { ++ xas_for_each(xas, folio, ULONG_MAX) { + stop = true; +- if (xas_retry(&xas, folio)) ++ if (xas_retry(xas, folio)) + continue; + if (xa_is_value(folio)) + break; +- if (folio->index != index) ++ if (folio->index != index) { ++ xas_reset(xas); + break; ++ } ++ + if (!folio_try_get_rcu(folio)) { +- xas_reset(&xas); ++ xas_reset(xas); + continue; + } + nr_pages = folio_nr_pages(folio); +- if (nr_pages > max_pages) ++ if (nr_pages > max_pages) { ++ xas_reset(xas); + break; ++ } + + /* Has the page moved or been split? */ +- if (unlikely(folio != xas_reload(&xas))) { ++ if (unlikely(folio != xas_reload(xas))) { + folio_put(folio); ++ xas_reset(xas); + break; + } + + if (!folio_trylock(folio)) { + folio_put(folio); ++ xas_reset(xas); + break; + } +- if (!folio_test_dirty(folio) || folio_test_writeback(folio)) { ++ if (!folio_test_dirty(folio) || ++ folio_test_writeback(folio)) { + folio_unlock(folio); + folio_put(folio); ++ xas_reset(xas); + break; + } + + max_pages -= nr_pages; +- psize = folio_size(folio); +- len += psize; ++ len = folio_size(folio); + stop = false; +- if (max_pages <= 0 || len >= max_len || *_count <= 0) +- stop = true; + + index += nr_pages; ++ *_count -= nr_pages; ++ *_len += len; ++ if (max_pages <= 0 || *_len >= max_len || *_count <= 0) ++ stop = true; ++ + if (!folio_batch_add(&batch, folio)) + break; + if (stop) + break; + } + +- if (!stop) +- xas_pause(&xas); ++ xas_pause(xas); + rcu_read_unlock(); + + /* Now, if we obtained any pages, we can shift them to being +@@ -2712,16 +2722,12 @@ static void cifs_extend_writeback(struct address_space *mapping, + if (!folio_clear_dirty_for_io(folio)) + WARN_ON(1); + folio_start_writeback(folio); +- +- *_count -= folio_nr_pages(folio); + folio_unlock(folio); + } + + folio_batch_release(&batch); + cond_resched(); + } while (!stop); +- +- *_len = len; + } + + /* +@@ -2729,8 +2735,10 @@ static void cifs_extend_writeback(struct address_space *mapping, + */ + static ssize_t cifs_write_back_from_locked_folio(struct address_space *mapping, + struct writeback_control *wbc, ++ struct xa_state *xas, + struct folio *folio, +- loff_t start, loff_t end) ++ unsigned long long start, ++ unsigned long long end) + { + struct inode *inode = mapping->host; + struct TCP_Server_Info *server; +@@ -2739,17 +2747,18 @@ static ssize_t cifs_write_back_from_locked_folio(struct address_space *mapping, + struct cifs_credits credits_on_stack; + struct cifs_credits *credits = &credits_on_stack; + struct cifsFileInfo *cfile = NULL; +- unsigned int xid, wsize, len; +- loff_t i_size = i_size_read(inode); +- size_t max_len; ++ unsigned long long i_size = i_size_read(inode), max_len; ++ unsigned int xid, wsize; ++ size_t len = folio_size(folio); + long count = wbc->nr_to_write; + int rc; + + /* The folio should be locked, dirty and not undergoing writeback. */ ++ if (!folio_clear_dirty_for_io(folio)) ++ WARN_ON_ONCE(1); + folio_start_writeback(folio); + + count -= folio_nr_pages(folio); +- len = folio_size(folio); + + xid = get_xid(); + server = cifs_pick_channel(cifs_sb_master_tcon(cifs_sb)->ses); +@@ -2779,9 +2788,10 @@ static ssize_t cifs_write_back_from_locked_folio(struct address_space *mapping, + wdata->server = server; + cfile = NULL; + +- /* Find all consecutive lockable dirty pages, stopping when we find a +- * page that is not immediately lockable, is not dirty or is missing, +- * or we reach the end of the range. ++ /* Find all consecutive lockable dirty pages that have contiguous ++ * written regions, stopping when we find a page that is not ++ * immediately lockable, is not dirty or is missing, or we reach the ++ * end of the range. + */ + if (start < i_size) { + /* Trim the write to the EOF; the extra data is ignored. Also +@@ -2801,19 +2811,18 @@ static ssize_t cifs_write_back_from_locked_folio(struct address_space *mapping, + max_pages -= folio_nr_pages(folio); + + if (max_pages > 0) +- cifs_extend_writeback(mapping, &count, start, ++ cifs_extend_writeback(mapping, xas, &count, start, + max_pages, max_len, &len); + } +- len = min_t(loff_t, len, max_len); + } +- +- wdata->bytes = len; ++ len = min_t(unsigned long long, len, i_size - start); + + /* We now have a contiguous set of dirty pages, each with writeback + * set; the first page is still locked at this point, but all the rest + * have been unlocked. + */ + folio_unlock(folio); ++ wdata->bytes = len; + + if (start < i_size) { + iov_iter_xarray(&wdata->iter, ITER_SOURCE, &mapping->i_pages, +@@ -2864,102 +2873,118 @@ static ssize_t cifs_write_back_from_locked_folio(struct address_space *mapping, + /* + * write a region of pages back to the server + */ +-static int cifs_writepages_region(struct address_space *mapping, +- struct writeback_control *wbc, +- loff_t start, loff_t end, loff_t *_next) ++static ssize_t cifs_writepages_begin(struct address_space *mapping, ++ struct writeback_control *wbc, ++ struct xa_state *xas, ++ unsigned long long *_start, ++ unsigned long long end) + { +- struct folio_batch fbatch; ++ struct folio *folio; ++ unsigned long long start = *_start; ++ ssize_t ret; + int skips = 0; + +- folio_batch_init(&fbatch); +- do { +- int nr; +- pgoff_t index = start / PAGE_SIZE; ++search_again: ++ /* Find the first dirty page. */ ++ rcu_read_lock(); + +- nr = filemap_get_folios_tag(mapping, &index, end / PAGE_SIZE, +- PAGECACHE_TAG_DIRTY, &fbatch); +- if (!nr) ++ for (;;) { ++ folio = xas_find_marked(xas, end / PAGE_SIZE, PAGECACHE_TAG_DIRTY); ++ if (xas_retry(xas, folio) || xa_is_value(folio)) ++ continue; ++ if (!folio) + break; + +- for (int i = 0; i < nr; i++) { +- ssize_t ret; +- struct folio *folio = fbatch.folios[i]; ++ if (!folio_try_get_rcu(folio)) { ++ xas_reset(xas); ++ continue; ++ } + +-redo_folio: +- start = folio_pos(folio); /* May regress with THPs */ ++ if (unlikely(folio != xas_reload(xas))) { ++ folio_put(folio); ++ xas_reset(xas); ++ continue; ++ } + +- /* At this point we hold neither the i_pages lock nor the +- * page lock: the page may be truncated or invalidated +- * (changing page->mapping to NULL), or even swizzled +- * back from swapper_space to tmpfs file mapping +- */ +- if (wbc->sync_mode != WB_SYNC_NONE) { +- ret = folio_lock_killable(folio); +- if (ret < 0) +- goto write_error; +- } else { +- if (!folio_trylock(folio)) +- goto skip_write; +- } ++ xas_pause(xas); ++ break; ++ } ++ rcu_read_unlock(); ++ if (!folio) ++ return 0; + +- if (folio->mapping != mapping || +- !folio_test_dirty(folio)) { +- start += folio_size(folio); +- folio_unlock(folio); +- continue; +- } ++ start = folio_pos(folio); /* May regress with THPs */ + +- if (folio_test_writeback(folio) || +- folio_test_fscache(folio)) { +- folio_unlock(folio); +- if (wbc->sync_mode == WB_SYNC_NONE) +- goto skip_write; ++ /* At this point we hold neither the i_pages lock nor the page lock: ++ * the page may be truncated or invalidated (changing page->mapping to ++ * NULL), or even swizzled back from swapper_space to tmpfs file ++ * mapping ++ */ ++lock_again: ++ if (wbc->sync_mode != WB_SYNC_NONE) { ++ ret = folio_lock_killable(folio); ++ if (ret < 0) ++ return ret; ++ } else { ++ if (!folio_trylock(folio)) ++ goto search_again; ++ } + +- folio_wait_writeback(folio); ++ if (folio->mapping != mapping || ++ !folio_test_dirty(folio)) { ++ start += folio_size(folio); ++ folio_unlock(folio); ++ goto search_again; ++ } ++ ++ if (folio_test_writeback(folio) || ++ folio_test_fscache(folio)) { ++ folio_unlock(folio); ++ if (wbc->sync_mode != WB_SYNC_NONE) { ++ folio_wait_writeback(folio); + #ifdef CONFIG_CIFS_FSCACHE +- folio_wait_fscache(folio); ++ folio_wait_fscache(folio); + #endif +- goto redo_folio; +- } +- +- if (!folio_clear_dirty_for_io(folio)) +- /* We hold the page lock - it should've been dirty. */ +- WARN_ON(1); +- +- ret = cifs_write_back_from_locked_folio(mapping, wbc, folio, start, end); +- if (ret < 0) +- goto write_error; +- +- start += ret; +- continue; +- +-write_error: +- folio_batch_release(&fbatch); +- *_next = start; +- return ret; ++ goto lock_again; ++ } + +-skip_write: +- /* +- * Too many skipped writes, or need to reschedule? +- * Treat it as a write error without an error code. +- */ ++ start += folio_size(folio); ++ if (wbc->sync_mode == WB_SYNC_NONE) { + if (skips >= 5 || need_resched()) { + ret = 0; +- goto write_error; ++ goto out; + } +- +- /* Otherwise, just skip that folio and go on to the next */ + skips++; +- start += folio_size(folio); +- continue; + } ++ goto search_again; ++ } + +- folio_batch_release(&fbatch); +- cond_resched(); +- } while (wbc->nr_to_write > 0); ++ ret = cifs_write_back_from_locked_folio(mapping, wbc, xas, folio, start, end); ++out: ++ if (ret > 0) ++ *_start = start + ret; ++ return ret; ++} + +- *_next = start; +- return 0; ++/* ++ * Write a region of pages back to the server ++ */ ++static int cifs_writepages_region(struct address_space *mapping, ++ struct writeback_control *wbc, ++ unsigned long long *_start, ++ unsigned long long end) ++{ ++ ssize_t ret; ++ ++ XA_STATE(xas, &mapping->i_pages, *_start / PAGE_SIZE); ++ ++ do { ++ ret = cifs_writepages_begin(mapping, wbc, &xas, _start, end); ++ if (ret > 0 && wbc->nr_to_write > 0) ++ cond_resched(); ++ } while (ret > 0 && wbc->nr_to_write > 0); ++ ++ return ret > 0 ? 0 : ret; + } + + /* +@@ -2968,7 +2993,7 @@ static int cifs_writepages_region(struct address_space *mapping, + static int cifs_writepages(struct address_space *mapping, + struct writeback_control *wbc) + { +- loff_t start, next; ++ loff_t start, end; + int ret; + + /* We have to be careful as we can end up racing with setattr() +@@ -2976,28 +3001,34 @@ static int cifs_writepages(struct address_space *mapping, + * to prevent it. + */ + +- if (wbc->range_cyclic) { ++ if (wbc->range_cyclic && mapping->writeback_index) { + start = mapping->writeback_index * PAGE_SIZE; +- ret = cifs_writepages_region(mapping, wbc, start, LLONG_MAX, &next); +- if (ret == 0) { +- mapping->writeback_index = next / PAGE_SIZE; +- if (start > 0 && wbc->nr_to_write > 0) { +- ret = cifs_writepages_region(mapping, wbc, 0, +- start, &next); +- if (ret == 0) +- mapping->writeback_index = +- next / PAGE_SIZE; +- } ++ ret = cifs_writepages_region(mapping, wbc, &start, LLONG_MAX); ++ if (ret < 0) ++ goto out; ++ ++ if (wbc->nr_to_write <= 0) { ++ mapping->writeback_index = start / PAGE_SIZE; ++ goto out; + } ++ ++ start = 0; ++ end = mapping->writeback_index * PAGE_SIZE; ++ mapping->writeback_index = 0; ++ ret = cifs_writepages_region(mapping, wbc, &start, end); ++ if (ret == 0) ++ mapping->writeback_index = start / PAGE_SIZE; + } else if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) { +- ret = cifs_writepages_region(mapping, wbc, 0, LLONG_MAX, &next); ++ start = 0; ++ ret = cifs_writepages_region(mapping, wbc, &start, LLONG_MAX); + if (wbc->nr_to_write > 0 && ret == 0) +- mapping->writeback_index = next / PAGE_SIZE; ++ mapping->writeback_index = start / PAGE_SIZE; + } else { +- ret = cifs_writepages_region(mapping, wbc, +- wbc->range_start, wbc->range_end, &next); ++ start = wbc->range_start; ++ ret = cifs_writepages_region(mapping, wbc, &start, wbc->range_end); + } + ++out: + return ret; + } + +-- +2.43.0 + diff --git a/queue-6.8/clk-fix-clk_core_get-null-dereference.patch b/queue-6.8/clk-fix-clk_core_get-null-dereference.patch new file mode 100644 index 00000000000..55c9da18b41 --- /dev/null +++ b/queue-6.8/clk-fix-clk_core_get-null-dereference.patch @@ -0,0 +1,56 @@ +From 10941e6e75fe130654deae0c139bf2bd97639828 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 Mar 2024 00:52:14 +0000 +Subject: clk: Fix clk_core_get NULL dereference + +From: Bryan O'Donoghue + +[ Upstream commit e97fe4901e0f59a0bfd524578fe3768f8ca42428 ] + +It is possible for clk_core_get to dereference a NULL in the following +sequence: + +clk_core_get() + of_clk_get_hw_from_clkspec() + __of_clk_get_hw_from_provider() + __clk_get_hw() + +__clk_get_hw() can return NULL which is dereferenced by clk_core_get() at +hw->core. + +Prior to commit dde4eff47c82 ("clk: Look for parents with clkdev based +clk_lookups") the check IS_ERR_OR_NULL() was performed which would have +caught the NULL. + +Reading the description of this function it talks about returning NULL but +that cannot be so at the moment. + +Update the function to check for hw before dereferencing it and return NULL +if hw is NULL. + +Fixes: dde4eff47c82 ("clk: Look for parents with clkdev based clk_lookups") +Signed-off-by: Bryan O'Donoghue +Link: https://lore.kernel.org/r/20240302-linux-next-24-03-01-simple-clock-fixes-v1-1-25f348a5982b@linaro.org +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/clk.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c +index 2253c154a8248..20c4b28fed061 100644 +--- a/drivers/clk/clk.c ++++ b/drivers/clk/clk.c +@@ -418,6 +418,9 @@ static struct clk_core *clk_core_get(struct clk_core *core, u8 p_index) + if (IS_ERR(hw)) + return ERR_CAST(hw); + ++ if (!hw) ++ return NULL; ++ + return hw->core; + } + +-- +2.43.0 + diff --git a/queue-6.8/clk-hisilicon-hi3519-release-the-correct-number-of-g.patch b/queue-6.8/clk-hisilicon-hi3519-release-the-correct-number-of-g.patch new file mode 100644 index 00000000000..9e7d05b586b --- /dev/null +++ b/queue-6.8/clk-hisilicon-hi3519-release-the-correct-number-of-g.patch @@ -0,0 +1,39 @@ +From bb8d664f1a424146bed3a036bdf95321128ae12f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 10 Jan 2024 19:58:21 +0100 +Subject: clk: hisilicon: hi3519: Release the correct number of gates in + hi3519_clk_unregister() + +From: Christophe JAILLET + +[ Upstream commit 74e39f526d95c0c119ada1874871ee328c59fbee ] + +The gates are stored in 'hi3519_gate_clks', not 'hi3519_mux_clks'. +This is also in line with how hisi_clk_register_gate() is called in the +probe. + +Fixes: 224b3b262c52 ("clk: hisilicon: hi3519: add driver remove path and fix some issues") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/c3f1877c9a0886fa35c949c8f0ef25547f284f18.1704912510.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/hisilicon/clk-hi3519.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/hisilicon/clk-hi3519.c b/drivers/clk/hisilicon/clk-hi3519.c +index b871872d9960d..141b727ff60d6 100644 +--- a/drivers/clk/hisilicon/clk-hi3519.c ++++ b/drivers/clk/hisilicon/clk-hi3519.c +@@ -130,7 +130,7 @@ static void hi3519_clk_unregister(struct platform_device *pdev) + of_clk_del_provider(pdev->dev.of_node); + + hisi_clk_unregister_gate(hi3519_gate_clks, +- ARRAY_SIZE(hi3519_mux_clks), ++ ARRAY_SIZE(hi3519_gate_clks), + crg->clk_data); + hisi_clk_unregister_mux(hi3519_mux_clks, + ARRAY_SIZE(hi3519_mux_clks), +-- +2.43.0 + diff --git a/queue-6.8/clk-hisilicon-hi3559a-fix-an-erroneous-devm_kfree.patch b/queue-6.8/clk-hisilicon-hi3559a-fix-an-erroneous-devm_kfree.patch new file mode 100644 index 00000000000..ab5ef184f0b --- /dev/null +++ b/queue-6.8/clk-hisilicon-hi3559a-fix-an-erroneous-devm_kfree.patch @@ -0,0 +1,42 @@ +From 987c738a8928ac283245d8169cd958cd6904b676 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 21 Jan 2024 16:16:24 +0100 +Subject: clk: hisilicon: hi3559a: Fix an erroneous devm_kfree() + +From: Christophe JAILLET + +[ Upstream commit 64c6a38136b74a2f18c42199830975edd9fbc379 ] + +'p_clk' is an array allocated just before the for loop for all clk that +need to be registered. +It is incremented at each loop iteration. + +If a clk_register() call fails, 'p_clk' may point to something different +from what should be freed. + +The best we can do, is to avoid this wrong release of memory. + +Fixes: 6c81966107dc ("clk: hisilicon: Add clock driver for hi3559A SoC") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/773fc8425c3b8f5b0ca7c1d89f15b65831a85ca9.1705850155.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/hisilicon/clk-hi3559a.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/clk/hisilicon/clk-hi3559a.c b/drivers/clk/hisilicon/clk-hi3559a.c +index ff4ca0edce06a..4623befafaec4 100644 +--- a/drivers/clk/hisilicon/clk-hi3559a.c ++++ b/drivers/clk/hisilicon/clk-hi3559a.c +@@ -491,7 +491,6 @@ static void hisi_clk_register_pll(struct hi3559av100_pll_clock *clks, + + clk = clk_register(NULL, &p_clk->hw); + if (IS_ERR(clk)) { +- devm_kfree(dev, p_clk); + dev_err(dev, "%s: failed to register clock %s\n", + __func__, clks[i].name); + continue; +-- +2.43.0 + diff --git a/queue-6.8/clk-imx-imx8mp-fix-sai_mclk_sel-definition.patch b/queue-6.8/clk-imx-imx8mp-fix-sai_mclk_sel-definition.patch new file mode 100644 index 00000000000..ee9d38bc134 --- /dev/null +++ b/queue-6.8/clk-imx-imx8mp-fix-sai_mclk_sel-definition.patch @@ -0,0 +1,62 @@ +From 0d079c69e826f05cc542f70c84a321f8e6358e98 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Feb 2024 18:15:51 +0800 +Subject: clk: imx: imx8mp: Fix SAI_MCLK_SEL definition + +From: Shengjiu Wang + +[ Upstream commit 13269dc6c70444528f0093585e3559cd2f38850a ] + +There is SAI1, SAI2, SAI3, SAI5, SAI6, SAI7 existing in this block +control, the order is discontinuous. The definition of SAI_MCLK_SEL(n) +is not match with the usage of CLK_SAIn(n). + +So define SAI##n##_MCLK_SEL separately to fix the issue. + +Fixes: 6cd95f7b151c ("clk: imx: imx8mp: Add audiomix block control") +Signed-off-by: Shengjiu Wang +Reviewed-by: Abel Vesa +Link: https://lore.kernel.org/r/1708683351-8504-1-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Abel Vesa +Signed-off-by: Sasha Levin +--- + drivers/clk/imx/clk-imx8mp-audiomix.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c +index e4300df88f1ac..55ed211a5e0b1 100644 +--- a/drivers/clk/imx/clk-imx8mp-audiomix.c ++++ b/drivers/clk/imx/clk-imx8mp-audiomix.c +@@ -18,7 +18,12 @@ + + #define CLKEN0 0x000 + #define CLKEN1 0x004 +-#define SAI_MCLK_SEL(n) (0x300 + 4 * (n)) /* n in 0..5 */ ++#define SAI1_MCLK_SEL 0x300 ++#define SAI2_MCLK_SEL 0x304 ++#define SAI3_MCLK_SEL 0x308 ++#define SAI5_MCLK_SEL 0x30C ++#define SAI6_MCLK_SEL 0x310 ++#define SAI7_MCLK_SEL 0x314 + #define PDM_SEL 0x318 + #define SAI_PLL_GNRL_CTL 0x400 + +@@ -95,13 +100,13 @@ static const struct clk_parent_data clk_imx8mp_audiomix_pll_bypass_sels[] = { + IMX8MP_CLK_AUDIOMIX_SAI##n##_MCLK1_SEL, {}, \ + clk_imx8mp_audiomix_sai##n##_mclk1_parents, \ + ARRAY_SIZE(clk_imx8mp_audiomix_sai##n##_mclk1_parents), \ +- SAI_MCLK_SEL(n), 1, 0 \ ++ SAI##n##_MCLK_SEL, 1, 0 \ + }, { \ + "sai"__stringify(n)"_mclk2_sel", \ + IMX8MP_CLK_AUDIOMIX_SAI##n##_MCLK2_SEL, {}, \ + clk_imx8mp_audiomix_sai_mclk2_parents, \ + ARRAY_SIZE(clk_imx8mp_audiomix_sai_mclk2_parents), \ +- SAI_MCLK_SEL(n), 4, 1 \ ++ SAI##n##_MCLK_SEL, 4, 1 \ + }, { \ + "sai"__stringify(n)"_ipg_cg", \ + IMX8MP_CLK_AUDIOMIX_SAI##n##_IPG, \ +-- +2.43.0 + diff --git a/queue-6.8/clk-mediatek-mt7622-apmixedsys-fix-an-error-handling.patch b/queue-6.8/clk-mediatek-mt7622-apmixedsys-fix-an-error-handling.patch new file mode 100644 index 00000000000..ebaf7e2477f --- /dev/null +++ b/queue-6.8/clk-mediatek-mt7622-apmixedsys-fix-an-error-handling.patch @@ -0,0 +1,41 @@ +From ec5e359db79cefd4be0e3c33abcb5e19ea110189 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Jan 2024 09:29:28 +0100 +Subject: clk: mediatek: mt7622-apmixedsys: Fix an error handling path in + clk_mt8135_apmixed_probe() + +From: Christophe JAILLET + +[ Upstream commit a32e88f2b20259f5fe4f8eed598bbc85dc4879ed ] + +'clk_data' is allocated with mtk_devm_alloc_clk_data(). So calling +mtk_free_clk_data() explicitly in the remove function would lead to a +double-free. + +Remove the redundant call. + +Fixes: c50e2ea6507b ("clk: mediatek: mt7622-apmixedsys: Add .remove() callback for module build") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/2c553c2a5077757e4f7af0bb895acc43881cf62c.1704616152.git.christophe.jaillet@wanadoo.fr +Reviewed-by: AngeloGioacchino Del Regno +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/mediatek/clk-mt7622-apmixedsys.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/clk/mediatek/clk-mt7622-apmixedsys.c b/drivers/clk/mediatek/clk-mt7622-apmixedsys.c +index 9cffd278e9a43..1b8f859b6b6cc 100644 +--- a/drivers/clk/mediatek/clk-mt7622-apmixedsys.c ++++ b/drivers/clk/mediatek/clk-mt7622-apmixedsys.c +@@ -127,7 +127,6 @@ static void clk_mt7622_apmixed_remove(struct platform_device *pdev) + of_clk_del_provider(node); + mtk_clk_unregister_gates(apmixed_clks, ARRAY_SIZE(apmixed_clks), clk_data); + mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); +- mtk_free_clk_data(clk_data); + } + + static const struct of_device_id of_match_clk_mt7622_apmixed[] = { +-- +2.43.0 + diff --git a/queue-6.8/clk-mediatek-mt7981-topckgen-flag-sgm_reg_sel-as-cri.patch b/queue-6.8/clk-mediatek-mt7981-topckgen-flag-sgm_reg_sel-as-cri.patch new file mode 100644 index 00000000000..dd9a3549edc --- /dev/null +++ b/queue-6.8/clk-mediatek-mt7981-topckgen-flag-sgm_reg_sel-as-cri.patch @@ -0,0 +1,44 @@ +From bd478cfe46371e8fd8a2edc007e0335b1fa94af0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 18 Feb 2024 03:11:15 +0000 +Subject: clk: mediatek: mt7981-topckgen: flag SGM_REG_SEL as critical + +From: Daniel Golle + +[ Upstream commit aa690050c00a251ab69e3c5204d582833d0b958c ] + +Without the SGM_REG_SEL clock enabled the cpu freezes if trying to +access registers used by MT7981 clock drivers itself. +Mark SGM_REG_SEL as critical to make sure it is always enabled to +prevent freezes on boot even if the Ethernet driver which prepares +and enables the clock is not loaded or probed at a later point. + +Fixes: 813c3b53b55b ("clk: mediatek: add MT7981 clock support") +Signed-off-by: Daniel Golle +Link: https://lore.kernel.org/r/fc157139e6b7f8dfb6430ac7191ba754027705e8.1708221995.git.daniel@makrotopia.org +Reviewed-by: AngeloGioacchino Del Regno +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/mediatek/clk-mt7981-topckgen.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/mediatek/clk-mt7981-topckgen.c b/drivers/clk/mediatek/clk-mt7981-topckgen.c +index 682f4ca9e89ad..493aa11d3a175 100644 +--- a/drivers/clk/mediatek/clk-mt7981-topckgen.c ++++ b/drivers/clk/mediatek/clk-mt7981-topckgen.c +@@ -357,8 +357,9 @@ static const struct mtk_mux top_muxes[] = { + MUX_GATE_CLR_SET_UPD(CLK_TOP_SGM_325M_SEL, "sgm_325m_sel", + sgm_325m_parents, 0x050, 0x054, 0x058, 8, 1, 15, + 0x1C0, 21), +- MUX_GATE_CLR_SET_UPD(CLK_TOP_SGM_REG_SEL, "sgm_reg_sel", sgm_reg_parents, +- 0x050, 0x054, 0x058, 16, 1, 23, 0x1C0, 22), ++ MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_SGM_REG_SEL, "sgm_reg_sel", sgm_reg_parents, ++ 0x050, 0x054, 0x058, 16, 1, 23, 0x1C0, 22, ++ CLK_IS_CRITICAL | CLK_SET_RATE_PARENT), + MUX_GATE_CLR_SET_UPD(CLK_TOP_EIP97B_SEL, "eip97b_sel", eip97b_parents, + 0x050, 0x054, 0x058, 24, 3, 31, 0x1C0, 23), + /* CLK_CFG_6 */ +-- +2.43.0 + diff --git a/queue-6.8/clk-mediatek-mt8135-fix-an-error-handling-path-in-cl.patch b/queue-6.8/clk-mediatek-mt8135-fix-an-error-handling-path-in-cl.patch new file mode 100644 index 00000000000..662e27385c0 --- /dev/null +++ b/queue-6.8/clk-mediatek-mt8135-fix-an-error-handling-path-in-cl.patch @@ -0,0 +1,48 @@ +From 6a79b4088a76c65992c00977bf0c8520c522a3bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Jan 2024 09:12:17 +0100 +Subject: clk: mediatek: mt8135: Fix an error handling path in + clk_mt8135_apmixed_probe() + +From: Christophe JAILLET + +[ Upstream commit 03c1c51eba6be49b42816af9db114553131af6c8 ] + +If an error occurs after mtk_alloc_clk_data(), mtk_free_clk_data() should +be called, as already done in the remove function. + +Fixes: 54b7026f011e ("clk: mediatek: mt8135-apmixedsys: Convert to platform_driver and module") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/6cd6af61e5a91598068227f1f68cfcfde1507453.1704615011.git.christophe.jaillet@wanadoo.fr +Reviewed-by: AngeloGioacchino Del Regno +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/mediatek/clk-mt8135-apmixedsys.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/clk/mediatek/clk-mt8135-apmixedsys.c b/drivers/clk/mediatek/clk-mt8135-apmixedsys.c +index d1239b4b3db74..41bb2d2e2ea74 100644 +--- a/drivers/clk/mediatek/clk-mt8135-apmixedsys.c ++++ b/drivers/clk/mediatek/clk-mt8135-apmixedsys.c +@@ -59,7 +59,7 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev) + + ret = mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); + if (ret) +- return ret; ++ goto free_clk_data; + + ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); + if (ret) +@@ -69,6 +69,8 @@ static int clk_mt8135_apmixed_probe(struct platform_device *pdev) + + unregister_plls: + mtk_clk_unregister_plls(plls, ARRAY_SIZE(plls), clk_data); ++free_clk_data: ++ mtk_free_clk_data(clk_data); + + return ret; + } +-- +2.43.0 + diff --git a/queue-6.8/clk-mediatek-mt8183-correct-parent-of-clk_infra_sspm.patch b/queue-6.8/clk-mediatek-mt8183-correct-parent-of-clk_infra_sspm.patch new file mode 100644 index 00000000000..5df1d7c49a1 --- /dev/null +++ b/queue-6.8/clk-mediatek-mt8183-correct-parent-of-clk_infra_sspm.patch @@ -0,0 +1,42 @@ +From 43e6c8d45467e40b333e108f163c30fc410fd31c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 19 Feb 2024 18:51:24 +0800 +Subject: clk: mediatek: mt8183: Correct parent of CLK_INFRA_SSPM_32K_SELF + +From: Chen-Yu Tsai + +[ Upstream commit a65083fa663a335008e34f65e184041174a9dc7e ] + +CLK_INFRA_SSPM_32K_SELF has the "f_f26m_ck" clock assigned as its parent. +This is inconsistent as the clock is part of a group that are all gates +without dividers, and this makes the kernel think it runs at 26 MHz. + +After clarification from MediaTek engineers, the correct parent is +actually the system 32 KHz clock. + +Fixes: 1eb8d61ac5c9 ("clk: mediatek: mt8183: Add back SSPM related clocks") +Signed-off-by: Chen-Yu Tsai +Link: https://lore.kernel.org/r/20240219105125.956278-1-wenst@chromium.org +Reviewed-by: AngeloGioacchino Del Regno +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/mediatek/clk-mt8183.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/mediatek/clk-mt8183.c b/drivers/clk/mediatek/clk-mt8183.c +index 6e23461a04559..934d5a15acfc5 100644 +--- a/drivers/clk/mediatek/clk-mt8183.c ++++ b/drivers/clk/mediatek/clk-mt8183.c +@@ -790,7 +790,7 @@ static const struct mtk_gate infra_clks[] = { + /* infra_sspm_26m_self is main clock in co-processor, should not be closed in Linux. */ + GATE_INFRA3_FLAGS(CLK_INFRA_SSPM_26M_SELF, "infra_sspm_26m_self", "f_f26m_ck", 3, CLK_IS_CRITICAL), + /* infra_sspm_32k_self is main clock in co-processor, should not be closed in Linux. */ +- GATE_INFRA3_FLAGS(CLK_INFRA_SSPM_32K_SELF, "infra_sspm_32k_self", "f_f26m_ck", 4, CLK_IS_CRITICAL), ++ GATE_INFRA3_FLAGS(CLK_INFRA_SSPM_32K_SELF, "infra_sspm_32k_self", "clk32k", 4, CLK_IS_CRITICAL), + GATE_INFRA3(CLK_INFRA_UFS_AXI, "infra_ufs_axi", "axi_sel", 5), + GATE_INFRA3(CLK_INFRA_I2C6, "infra_i2c6", "i2c_sel", 6), + GATE_INFRA3(CLK_INFRA_AP_MSDC0, "infra_ap_msdc0", "msdc50_hclk_sel", 7), +-- +2.43.0 + diff --git a/queue-6.8/clk-meson-add-missing-clocks-to-axg_clk_regmaps.patch b/queue-6.8/clk-meson-add-missing-clocks-to-axg_clk_regmaps.patch new file mode 100644 index 00000000000..27ebfd74400 --- /dev/null +++ b/queue-6.8/clk-meson-add-missing-clocks-to-axg_clk_regmaps.patch @@ -0,0 +1,83 @@ +From dfd5fcde01590480478c67918fe9691d5e65b1b3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Feb 2024 17:25:48 +0300 +Subject: clk: meson: Add missing clocks to axg_clk_regmaps + +From: Igor Prusov + +[ Upstream commit ba535bce57e71463a86f8b33a0ea88c26e3a6418 ] + +Some clocks were missing from axg_clk_regmaps, which caused kernel panic +during cat /sys/kernel/debug/clk/clk_summary + +[ 57.349402] Unable to handle kernel NULL pointer dereference at virtual address 00000000000001fc +... +[ 57.430002] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) +[ 57.436900] pc : regmap_read+0x1c/0x88 +[ 57.440608] lr : clk_regmap_gate_is_enabled+0x3c/0xb0 +[ 57.445611] sp : ffff800082f1b690 +[ 57.448888] x29: ffff800082f1b690 x28: 0000000000000000 x27: ffff800080eb9a70 +[ 57.455961] x26: 0000000000000007 x25: 0000000000000016 x24: 0000000000000000 +[ 57.463033] x23: ffff800080e8b488 x22: 0000000000000015 x21: ffff00000e7e7000 +[ 57.470106] x20: ffff00000400ec00 x19: 0000000000000000 x18: ffffffffffffffff +[ 57.477178] x17: 0000000000000000 x16: 0000000000000000 x15: ffff0000042a3000 +[ 57.484251] x14: 0000000000000000 x13: ffff0000042a2fec x12: 0000000005f5e100 +[ 57.491323] x11: abcc77118461cefd x10: 0000000000000020 x9 : ffff8000805e4b24 +[ 57.498396] x8 : ffff0000028063c0 x7 : ffff800082f1b710 x6 : ffff800082f1b710 +[ 57.505468] x5 : 00000000ffffffd0 x4 : ffff800082f1b6e0 x3 : 0000000000001000 +[ 57.512541] x2 : ffff800082f1b6e4 x1 : 000000000000012c x0 : 0000000000000000 +[ 57.519615] Call trace: +[ 57.522030] regmap_read+0x1c/0x88 +[ 57.525393] clk_regmap_gate_is_enabled+0x3c/0xb0 +[ 57.530050] clk_core_is_enabled+0x44/0x120 +[ 57.534190] clk_summary_show_subtree+0x154/0x2f0 +[ 57.538847] clk_summary_show_subtree+0x220/0x2f0 +[ 57.543505] clk_summary_show_subtree+0x220/0x2f0 +[ 57.548162] clk_summary_show_subtree+0x220/0x2f0 +[ 57.552820] clk_summary_show_subtree+0x220/0x2f0 +[ 57.557477] clk_summary_show_subtree+0x220/0x2f0 +[ 57.562135] clk_summary_show_subtree+0x220/0x2f0 +[ 57.566792] clk_summary_show_subtree+0x220/0x2f0 +[ 57.571450] clk_summary_show+0x84/0xb8 +[ 57.575245] seq_read_iter+0x1bc/0x4b8 +[ 57.578954] seq_read+0x8c/0xd0 +[ 57.582059] full_proxy_read+0x68/0xc8 +[ 57.585767] vfs_read+0xb0/0x268 +[ 57.588959] ksys_read+0x70/0x108 +[ 57.592236] __arm64_sys_read+0x24/0x38 +[ 57.596031] invoke_syscall+0x50/0x128 +[ 57.599740] el0_svc_common.constprop.0+0x48/0xf8 +[ 57.604397] do_el0_svc+0x28/0x40 +[ 57.607675] el0_svc+0x34/0xb8 +[ 57.610694] el0t_64_sync_handler+0x13c/0x158 +[ 57.615006] el0t_64_sync+0x190/0x198 +[ 57.618635] Code: a9bd7bfd 910003fd a90153f3 aa0003f3 (b941fc00) +[ 57.624668] ---[ end trace 0000000000000000 ]--- + +[jbrunet: add missing Fixes tag] +Signed-off-by: Igor Prusov +Link: https://lore.kernel.org/r/20240202172537.1.I64656c75d84284bc91e6126b50b33c502be7c42a@changeid +Fixes: 14ebb3154b8f ("clk: meson: axg: add Video Clocks") +Signed-off-by: Jerome Brunet +Signed-off-by: Sasha Levin +--- + drivers/clk/meson/axg.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/clk/meson/axg.c b/drivers/clk/meson/axg.c +index c12f81dfa6745..5f60f2bcca592 100644 +--- a/drivers/clk/meson/axg.c ++++ b/drivers/clk/meson/axg.c +@@ -2142,7 +2142,9 @@ static struct clk_regmap *const axg_clk_regmaps[] = { + &axg_vclk_input, + &axg_vclk2_input, + &axg_vclk_div, ++ &axg_vclk_div1, + &axg_vclk2_div, ++ &axg_vclk2_div1, + &axg_vclk_div2_en, + &axg_vclk_div4_en, + &axg_vclk_div6_en, +-- +2.43.0 + diff --git a/queue-6.8/clk-qcom-dispcc-sdm845-adjust-internal-gdsc-wait-tim.patch b/queue-6.8/clk-qcom-dispcc-sdm845-adjust-internal-gdsc-wait-tim.patch new file mode 100644 index 00000000000..7cc17ff3f65 --- /dev/null +++ b/queue-6.8/clk-qcom-dispcc-sdm845-adjust-internal-gdsc-wait-tim.patch @@ -0,0 +1,38 @@ +From f6ca8b75938833003f7f5b2d5f78e07a543ae90a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Jan 2024 21:20:18 +0100 +Subject: clk: qcom: dispcc-sdm845: Adjust internal GDSC wait times + +From: Konrad Dybcio + +[ Upstream commit 117e7dc697c2739d754db8fe0c1e2d4f1f5d5f82 ] + +SDM845 downstream uses non-default values for GDSC internal waits. +Program them accordingly to avoid surprises. + +Fixes: 81351776c9fb ("clk: qcom: Add display clock controller driver for SDM845") +Signed-off-by: Konrad Dybcio +Tested-by: Caleb Connolly # OnePlus 6 +Link: https://lore.kernel.org/r/20240103-topic-845gdsc-v1-1-368efbe1a61d@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + drivers/clk/qcom/dispcc-sdm845.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/clk/qcom/dispcc-sdm845.c b/drivers/clk/qcom/dispcc-sdm845.c +index 735adfefc3798..e792e0b130d33 100644 +--- a/drivers/clk/qcom/dispcc-sdm845.c ++++ b/drivers/clk/qcom/dispcc-sdm845.c +@@ -759,6 +759,8 @@ static struct clk_branch disp_cc_mdss_vsync_clk = { + + static struct gdsc mdss_gdsc = { + .gdscr = 0x3000, ++ .en_few_wait_val = 0x6, ++ .en_rest_wait_val = 0x5, + .pd = { + .name = "mdss_gdsc", + }, +-- +2.43.0 + diff --git a/queue-6.8/clk-qcom-gcc-ipq5018-fix-enable_reg-offset-of-gcc_gm.patch b/queue-6.8/clk-qcom-gcc-ipq5018-fix-enable_reg-offset-of-gcc_gm.patch new file mode 100644 index 00000000000..9c52a602a19 --- /dev/null +++ b/queue-6.8/clk-qcom-gcc-ipq5018-fix-enable_reg-offset-of-gcc_gm.patch @@ -0,0 +1,56 @@ +From 157cfa06cf3e6863055696a29170211e4dc11479 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Feb 2024 18:32:54 +0100 +Subject: clk: qcom: gcc-ipq5018: fix 'enable_reg' offset of + 'gcc_gmac0_sys_clk' + +From: Gabor Juhos + +[ Upstream commit f982adcc1b1c02a3114f68ac73c811cbfabe90fa ] + +The value of the 'enable_reg' field in the 'gcc_gmac0_sys_clk' +clock definition seems wrong as it is greater than the +'max_register' value defined in the regmap configuration. +Additionally, all other gmac specific branch clock definitions +within the driver uses the same value both for the 'enable_reg' +and for the 'halt_reg' fields. + +Due to the lack of documentation the correct value is not known. +Looking into the downstream driver does not help either, as that +uses the same (presumably wrong) value [1]. + +Nevertheless, change the 'enable_reg' field of 'gcc_gmac0_sys_clk' +to use the value from the 'halt_reg' field so it follows the pattern +used in other gmac clock definitions. The change is based on the +assumption that the register layout of this clock is the same +as the other gmac clocks. + +1. https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.4.r4/drivers/clk/qcom/gcc-ipq5018.c?ref_type=heads#L1889 + +Fixes: e3fdbef1bab8 ("clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018") +Signed-off-by: Gabor Juhos +Reviewed-by: Dmitry Baryshkov +Reviewed-by: Kathiravan Thirumoorthy +Link: https://lore.kernel.org/r/20240225-gcc-ipq5018-register-fixes-v1-1-3c191404d9f0@gmail.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + drivers/clk/qcom/gcc-ipq5018.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c +index 4aba47e8700d2..cef9a1e7c9fdb 100644 +--- a/drivers/clk/qcom/gcc-ipq5018.c ++++ b/drivers/clk/qcom/gcc-ipq5018.c +@@ -1754,7 +1754,7 @@ static struct clk_branch gcc_gmac0_sys_clk = { + .halt_check = BRANCH_HALT_DELAY, + .halt_bit = 31, + .clkr = { +- .enable_reg = 0x683190, ++ .enable_reg = 0x68190, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data) { + .name = "gcc_gmac0_sys_clk", +-- +2.43.0 + diff --git a/queue-6.8/clk-qcom-gcc-ipq5018-fix-halt_reg-offset-of-gcc_pcie.patch b/queue-6.8/clk-qcom-gcc-ipq5018-fix-halt_reg-offset-of-gcc_pcie.patch new file mode 100644 index 00000000000..df26f30cc08 --- /dev/null +++ b/queue-6.8/clk-qcom-gcc-ipq5018-fix-halt_reg-offset-of-gcc_pcie.patch @@ -0,0 +1,70 @@ +From 61e1a587d4a0f3c5948a01a02d817af3242c5b45 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Feb 2024 18:32:55 +0100 +Subject: clk: qcom: gcc-ipq5018: fix 'halt_reg' offset of 'gcc_pcie1_pipe_clk' + +From: Gabor Juhos + +[ Upstream commit 11b752ac5a07cbfd95592fac5237a02f45662926 ] + +The following table shows the values of the 'halt_reg' and the +'enable_reg' fields from the pcie clocks defined in the current +driver: + + clock halt_reg enable_reg + + gcc_pcie0_ahb_clk 0x75010 0x75010 + gcc_pcie0_aux_clk 0x75014 0x75014 + gcc_pcie0_axi_m_clk 0x75008 0x75008 + gcc_pcie0_axi_s_bridge_clk 0x75048 0x75048 + gcc_pcie0_axi_s_clk 0x7500c 0x7500c + gcc_pcie0_pipe_clk 0x75018 0x75018 + + gcc_pcie1_ahb_clk 0x76010 0x76010 + gcc_pcie1_aux_clk 0x76014 0x76014 + gcc_pcie1_axi_m_clk 0x76008 0x76008 + gcc_pcie1_axi_s_bridge_clk 0x76048 0x76048 + gcc_pcie1_axi_s_clk 0x7600c 0x7600c + gcc_pcie1_pipe_clk 8* 0x76018 + +Based on the table, it is quite likely that the pcie0 and the pci1 +clocks are using the same register layout, however it seems that +the value of the 'halt_reg' field in the 'gcc_pcie1_pipe_clk' clock +is wrong. + +In the downstream driver [1], the same '0x76018' value is used for +both the 'halt_reg' and for the 'enable_reg' fields of the +'gcc_pcie1_pipe_clk' clock. + +Update the current driver to use the same value used downstream as +probably that is the correct value. + +1. https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.4.r4/drivers/clk/qcom/gcc-ipq5018.c?ref_type=heads#L2316 + +Fixes: e3fdbef1bab8 ("clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018") +Signed-off-by: Gabor Juhos +Reviewed-by: Dmitry Baryshkov +Reviewed-by: Kathiravan Thirumoorthy +Link: https://lore.kernel.org/r/20240225-gcc-ipq5018-register-fixes-v1-2-3c191404d9f0@gmail.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + drivers/clk/qcom/gcc-ipq5018.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c +index cef9a1e7c9fdb..5e81cfa77293a 100644 +--- a/drivers/clk/qcom/gcc-ipq5018.c ++++ b/drivers/clk/qcom/gcc-ipq5018.c +@@ -2180,7 +2180,7 @@ static struct clk_branch gcc_pcie1_axi_s_clk = { + }; + + static struct clk_branch gcc_pcie1_pipe_clk = { +- .halt_reg = 8, ++ .halt_reg = 0x76018, + .halt_check = BRANCH_HALT_DELAY, + .halt_bit = 31, + .clkr = { +-- +2.43.0 + diff --git a/queue-6.8/clk-qcom-gcc-ipq5018-fix-register-offset-for-gcc_ubi.patch b/queue-6.8/clk-qcom-gcc-ipq5018-fix-register-offset-for-gcc_ubi.patch new file mode 100644 index 00000000000..4b7f6a71373 --- /dev/null +++ b/queue-6.8/clk-qcom-gcc-ipq5018-fix-register-offset-for-gcc_ubi.patch @@ -0,0 +1,47 @@ +From 13c14da9b77ad3b8247aa9b712f007284744cafe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 25 Feb 2024 18:32:56 +0100 +Subject: clk: qcom: gcc-ipq5018: fix register offset for GCC_UBI0_AXI_ARES + reset + +From: Gabor Juhos + +[ Upstream commit 7d474b43087aa356d714d39870c90d77fc6f1186 ] + +The current register offset used for the GCC_UBI0_AXI_ARES reset +seems wrong. Or at least, the downstream driver uses [1] the same +offset which is used for other the GCC_UBI0_*_ARES resets. + +Change the code to use the same offset used in the downstream +driver and also specify the reset bit explicitly to use the +same format as the followup entries. + +1. https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.4.r4/drivers/clk/qcom/gcc-ipq5018.c?ref_type=heads#L3773 + +Fixes: e3fdbef1bab8 ("clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018") +Signed-off-by: Gabor Juhos +Reviewed-by: Dmitry Baryshkov +Reviewed-by: Kathiravan Thirumoorthy +Link: https://lore.kernel.org/r/20240225-gcc-ipq5018-register-fixes-v1-3-3c191404d9f0@gmail.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + drivers/clk/qcom/gcc-ipq5018.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c +index 5e81cfa77293a..e2bd54826a4ce 100644 +--- a/drivers/clk/qcom/gcc-ipq5018.c ++++ b/drivers/clk/qcom/gcc-ipq5018.c +@@ -3632,7 +3632,7 @@ static const struct qcom_reset_map gcc_ipq5018_resets[] = { + [GCC_SYSTEM_NOC_BCR] = { 0x26000, 0 }, + [GCC_TCSR_BCR] = { 0x28000, 0 }, + [GCC_TLMM_BCR] = { 0x34000, 0 }, +- [GCC_UBI0_AXI_ARES] = { 0x680}, ++ [GCC_UBI0_AXI_ARES] = { 0x68010, 0 }, + [GCC_UBI0_AHB_ARES] = { 0x68010, 1 }, + [GCC_UBI0_NC_AXI_ARES] = { 0x68010, 2 }, + [GCC_UBI0_DBG_ARES] = { 0x68010, 3 }, +-- +2.43.0 + diff --git a/queue-6.8/clk-qcom-reset-commonize-the-de-assert-functions.patch b/queue-6.8/clk-qcom-reset-commonize-the-de-assert-functions.patch new file mode 100644 index 00000000000..3849dc59283 --- /dev/null +++ b/queue-6.8/clk-qcom-reset-commonize-the-de-assert-functions.patch @@ -0,0 +1,69 @@ +From 2172803a0d0dc62b7e4ad5776daf02f30da3308d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Feb 2024 19:43:35 +0100 +Subject: clk: qcom: reset: Commonize the de/assert functions + +From: Konrad Dybcio + +[ Upstream commit eda40d9c583e95e0b6ac69d2950eec10f802e0e8 ] + +They do the same thing, except the last argument of the last function +call differs. Commonize them. + +Reviewed-by: Bryan O'Donoghue +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240105-topic-venus_reset-v2-2-c37eba13b5ce@linaro.org +Signed-off-by: Bjorn Andersson +Stable-dep-of: 2f8cf2c3f3e3 ("clk: qcom: reset: Ensure write completion on reset de/assertion") +Signed-off-by: Sasha Levin +--- + drivers/clk/qcom/reset.c | 22 +++++++++------------- + 1 file changed, 9 insertions(+), 13 deletions(-) + +diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c +index e45e32804d2c7..20d1d35aaf229 100644 +--- a/drivers/clk/qcom/reset.c ++++ b/drivers/clk/qcom/reset.c +@@ -22,8 +22,8 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id) + return 0; + } + +-static int +-qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) ++static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, ++ unsigned long id, bool assert) + { + struct qcom_reset_controller *rst; + const struct qcom_reset_map *map; +@@ -33,21 +33,17 @@ qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) + map = &rst->reset_map[id]; + mask = map->bitmask ? map->bitmask : BIT(map->bit); + +- return regmap_update_bits(rst->regmap, map->reg, mask, mask); ++ return regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); + } + +-static int +-qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) ++static int qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) + { +- struct qcom_reset_controller *rst; +- const struct qcom_reset_map *map; +- u32 mask; +- +- rst = to_qcom_reset_controller(rcdev); +- map = &rst->reset_map[id]; +- mask = map->bitmask ? map->bitmask : BIT(map->bit); ++ return qcom_reset_set_assert(rcdev, id, true); ++} + +- return regmap_update_bits(rst->regmap, map->reg, mask, 0); ++static int qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) ++{ ++ return qcom_reset_set_assert(rcdev, id, false); + } + + const struct reset_control_ops qcom_reset_ops = { +-- +2.43.0 + diff --git a/queue-6.8/clk-qcom-reset-ensure-write-completion-on-reset-de-a.patch b/queue-6.8/clk-qcom-reset-ensure-write-completion-on-reset-de-a.patch new file mode 100644 index 00000000000..d18e27c0b60 --- /dev/null +++ b/queue-6.8/clk-qcom-reset-ensure-write-completion-on-reset-de-a.patch @@ -0,0 +1,45 @@ +From 465bdfef5b3fda6d593768f6982d3fcfe9794587 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Feb 2024 19:43:36 +0100 +Subject: clk: qcom: reset: Ensure write completion on reset de/assertion + +From: Konrad Dybcio + +[ Upstream commit 2f8cf2c3f3e3f7ef61bd19abb4b0bb797ad50aaf ] + +Trying to toggle the resets in a rapid fashion can lead to the changes +not actually arriving at the clock controller block when we expect them +to. This was observed at least on SM8250. + +Read back the value after regmap_update_bits to ensure write completion. + +Fixes: b36ba30c8ac6 ("clk: qcom: Add reset controller support") +Signed-off-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20240105-topic-venus_reset-v2-3-c37eba13b5ce@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Sasha Levin +--- + drivers/clk/qcom/reset.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c +index 20d1d35aaf229..d96c96a9089f4 100644 +--- a/drivers/clk/qcom/reset.c ++++ b/drivers/clk/qcom/reset.c +@@ -33,7 +33,12 @@ static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, + map = &rst->reset_map[id]; + mask = map->bitmask ? map->bitmask : BIT(map->bit); + +- return regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); ++ regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); ++ ++ /* Read back the register to ensure write completion, ignore the value */ ++ regmap_read(rst->regmap, map->reg, &mask); ++ ++ return 0; + } + + static int qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) +-- +2.43.0 + diff --git a/queue-6.8/clk-renesas-r8a779f0-correct-pfc-gpio-parent-clock.patch b/queue-6.8/clk-renesas-r8a779f0-correct-pfc-gpio-parent-clock.patch new file mode 100644 index 00000000000..214ef4c58b8 --- /dev/null +++ b/queue-6.8/clk-renesas-r8a779f0-correct-pfc-gpio-parent-clock.patch @@ -0,0 +1,43 @@ +From b96524aba8b00afdf0175e7789adaa458ecc96ba Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jan 2024 16:45:13 +0100 +Subject: clk: renesas: r8a779f0: Correct PFC/GPIO parent clock +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Geert Uytterhoeven + +[ Upstream commit d1b32a83a02d9433dbd8c5f4d6fc44aa597755bd ] + +According to the R-Car S4 Series Hardware User’s Manual Rev.0.81, the +parent clock of the Pin Function (PFC/GPIO) module clock is the CP +clock. + +As this clock is not documented to exist on R-Car S4, use the CPEX clock +instead. + +Fixes: 73421f2a48e6bd1d ("clk: renesas: r8a779f0: Add PFC clock") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/f88ec4aede0eaf0107c8bb7b28ba719ac6cd418f.1706197415.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/renesas/r8a779f0-cpg-mssr.c b/drivers/clk/renesas/r8a779f0-cpg-mssr.c +index f721835c7e212..cc06127406ab5 100644 +--- a/drivers/clk/renesas/r8a779f0-cpg-mssr.c ++++ b/drivers/clk/renesas/r8a779f0-cpg-mssr.c +@@ -161,7 +161,7 @@ static const struct mssr_mod_clk r8a779f0_mod_clks[] __initconst = { + DEF_MOD("cmt1", 911, R8A779F0_CLK_R), + DEF_MOD("cmt2", 912, R8A779F0_CLK_R), + DEF_MOD("cmt3", 913, R8A779F0_CLK_R), +- DEF_MOD("pfc0", 915, R8A779F0_CLK_CL16M), ++ DEF_MOD("pfc0", 915, R8A779F0_CLK_CPEX), + DEF_MOD("tsc", 919, R8A779F0_CLK_CL16M), + DEF_MOD("rswitch2", 1505, R8A779F0_CLK_RSW2), + DEF_MOD("ether-serdes", 1506, R8A779F0_CLK_S0D2_HSC), +-- +2.43.0 + diff --git a/queue-6.8/clk-renesas-r8a779g0-correct-pfc-gpio-parent-clocks.patch b/queue-6.8/clk-renesas-r8a779g0-correct-pfc-gpio-parent-clocks.patch new file mode 100644 index 00000000000..0b224bd0f08 --- /dev/null +++ b/queue-6.8/clk-renesas-r8a779g0-correct-pfc-gpio-parent-clocks.patch @@ -0,0 +1,78 @@ +From 2e33e30cbf30563f711d55883593bce78c56ea00 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 25 Jan 2024 16:43:26 +0100 +Subject: clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Geert Uytterhoeven + +[ Upstream commit abb3fa662b8f8eaed1590b0e7a4e19eda467cdd3 ] + +According to the R-Car V4H Series Hardware User’s Manual Rev.1.00, the +parent clock of the Pin Function (PFC/GPIO) module clocks is the CP +clock. + +Fix this by adding the missing CP clock, and correcting the PFC parents. + +Fixes: f2afa78d5a0c0b0b ("dt-bindings: clock: Add r8a779g0 CPG Core Clock Definitions") +Fixes: 36ff366033f0dde1 ("clk: renesas: r8a779g0: Add PFC/GPIO clocks") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/5401fccd204dc90b44f0013e7f53b9eff8df8214.1706197297.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + drivers/clk/renesas/r8a779g0-cpg-mssr.c | 11 ++++++----- + include/dt-bindings/clock/r8a779g0-cpg-mssr.h | 1 + + 2 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/drivers/clk/renesas/r8a779g0-cpg-mssr.c b/drivers/clk/renesas/r8a779g0-cpg-mssr.c +index 31b13c997a057..c4b1938db76b3 100644 +--- a/drivers/clk/renesas/r8a779g0-cpg-mssr.c ++++ b/drivers/clk/renesas/r8a779g0-cpg-mssr.c +@@ -22,7 +22,7 @@ + + enum clk_ids { + /* Core Clock Outputs exported to DT */ +- LAST_DT_CORE_CLK = R8A779G0_CLK_R, ++ LAST_DT_CORE_CLK = R8A779G0_CLK_CP, + + /* External Input Clocks */ + CLK_EXTAL, +@@ -141,6 +141,7 @@ static const struct cpg_core_clk r8a779g0_core_clks[] __initconst = { + DEF_FIXED("svd2_vip", R8A779G0_CLK_SVD2_VIP, CLK_SV_VIP, 2, 1), + DEF_FIXED("cbfusa", R8A779G0_CLK_CBFUSA, CLK_EXTAL, 2, 1), + DEF_FIXED("cpex", R8A779G0_CLK_CPEX, CLK_EXTAL, 2, 1), ++ DEF_FIXED("cp", R8A779G0_CLK_CP, CLK_EXTAL, 2, 1), + DEF_FIXED("viobus", R8A779G0_CLK_VIOBUS, CLK_VIO, 1, 1), + DEF_FIXED("viobusd2", R8A779G0_CLK_VIOBUSD2, CLK_VIO, 2, 1), + DEF_FIXED("vcbus", R8A779G0_CLK_VCBUS, CLK_VC, 1, 1), +@@ -232,10 +233,10 @@ static const struct mssr_mod_clk r8a779g0_mod_clks[] __initconst = { + DEF_MOD("cmt1", 911, R8A779G0_CLK_R), + DEF_MOD("cmt2", 912, R8A779G0_CLK_R), + DEF_MOD("cmt3", 913, R8A779G0_CLK_R), +- DEF_MOD("pfc0", 915, R8A779G0_CLK_CL16M), +- DEF_MOD("pfc1", 916, R8A779G0_CLK_CL16M), +- DEF_MOD("pfc2", 917, R8A779G0_CLK_CL16M), +- DEF_MOD("pfc3", 918, R8A779G0_CLK_CL16M), ++ DEF_MOD("pfc0", 915, R8A779G0_CLK_CP), ++ DEF_MOD("pfc1", 916, R8A779G0_CLK_CP), ++ DEF_MOD("pfc2", 917, R8A779G0_CLK_CP), ++ DEF_MOD("pfc3", 918, R8A779G0_CLK_CP), + DEF_MOD("tsc", 919, R8A779G0_CLK_CL16M), + DEF_MOD("tsn", 2723, R8A779G0_CLK_S0D4_HSC), + DEF_MOD("ssiu", 2926, R8A779G0_CLK_S0D6_PER), +diff --git a/include/dt-bindings/clock/r8a779g0-cpg-mssr.h b/include/dt-bindings/clock/r8a779g0-cpg-mssr.h +index 754c54a6eb06a..7850cdc62e285 100644 +--- a/include/dt-bindings/clock/r8a779g0-cpg-mssr.h ++++ b/include/dt-bindings/clock/r8a779g0-cpg-mssr.h +@@ -86,5 +86,6 @@ + #define R8A779G0_CLK_CPEX 74 + #define R8A779G0_CLK_CBFUSA 75 + #define R8A779G0_CLK_R 76 ++#define R8A779G0_CLK_CP 77 + + #endif /* __DT_BINDINGS_CLOCK_R8A779G0_CPG_MSSR_H__ */ +-- +2.43.0 + diff --git a/queue-6.8/clk-renesas-r8a779g0-fix-pcie-clock-name.patch b/queue-6.8/clk-renesas-r8a779g0-fix-pcie-clock-name.patch new file mode 100644 index 00000000000..ab88f07a989 --- /dev/null +++ b/queue-6.8/clk-renesas-r8a779g0-fix-pcie-clock-name.patch @@ -0,0 +1,36 @@ +From 314851a99b94ef57ab4cfeee65cbfabf1dd6a525 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jan 2024 10:47:49 +0100 +Subject: clk: renesas: r8a779g0: Fix PCIe clock name + +From: Geert Uytterhoeven + +[ Upstream commit 096311157d2a6bb8f06e28e1143e2a5de6a0183b ] + +Fix a typo in the name of the module clock for the second PCIe channel. + +Fixes: 5ab16198b431ca48 ("clk: renesas: r8a779g0: Add PCIe clocks") +Signed-off-by: Geert Uytterhoeven +Reviewed-by: Wolfram Sang +Link: https://lore.kernel.org/r/f582067564f357e2183d3db67b217084ecb51888.1706608032.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/renesas/r8a779g0-cpg-mssr.c b/drivers/clk/renesas/r8a779g0-cpg-mssr.c +index 5974adcef3eda..31b13c997a057 100644 +--- a/drivers/clk/renesas/r8a779g0-cpg-mssr.c ++++ b/drivers/clk/renesas/r8a779g0-cpg-mssr.c +@@ -193,7 +193,7 @@ static const struct mssr_mod_clk r8a779g0_mod_clks[] __initconst = { + DEF_MOD("msi4", 622, R8A779G0_CLK_MSO), + DEF_MOD("msi5", 623, R8A779G0_CLK_MSO), + DEF_MOD("pciec0", 624, R8A779G0_CLK_S0D2_HSC), +- DEF_MOD("pscie1", 625, R8A779G0_CLK_S0D2_HSC), ++ DEF_MOD("pciec1", 625, R8A779G0_CLK_S0D2_HSC), + DEF_MOD("pwm", 628, R8A779G0_CLK_SASYNCPERD4), + DEF_MOD("rpc-if", 629, R8A779G0_CLK_RPCD2), + DEF_MOD("scif0", 702, R8A779G0_CLK_SASYNCPERD4), +-- +2.43.0 + diff --git a/queue-6.8/clk-renesas-r9a07g04-34-use-sel_sdhi1_sts-status-con.patch b/queue-6.8/clk-renesas-r9a07g04-34-use-sel_sdhi1_sts-status-con.patch new file mode 100644 index 00000000000..334cf6d9eb2 --- /dev/null +++ b/queue-6.8/clk-renesas-r9a07g04-34-use-sel_sdhi1_sts-status-con.patch @@ -0,0 +1,53 @@ +From dd6b5c4a4580956dedc80a4a9c10d4412a8aed7e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 12:29:29 +0200 +Subject: clk: renesas: r9a07g04[34]: Use SEL_SDHI1_STS status configuration + for SD1 mux + +From: Claudiu Beznea + +[ Upstream commit 9b2a11c83859c06233049b134bd8ee974b284559 ] + +The status configuration for SD1 mux clock is SEL_SDHI1_STS. Fix it. + +Fixes: 16b86e5c03c5 ("clk: renesas: rzg2l: Refactor SD mux driver") +Reported-by: Hien Huynh +Signed-off-by: Claudiu Beznea +Reviewed-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/20240131102930.1841901-2-claudiu.beznea.uj@bp.renesas.com +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Sasha Levin +--- + drivers/clk/renesas/r9a07g043-cpg.c | 2 +- + drivers/clk/renesas/r9a07g044-cpg.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/renesas/r9a07g043-cpg.c b/drivers/clk/renesas/r9a07g043-cpg.c +index b70bb378ab469..075ade0925d45 100644 +--- a/drivers/clk/renesas/r9a07g043-cpg.c ++++ b/drivers/clk/renesas/r9a07g043-cpg.c +@@ -138,7 +138,7 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = { + DEF_FIXED("SPI1", R9A07G043_CLK_SPI1, CLK_DIV_PLL3_C, 1, 4), + DEF_SD_MUX("SD0", R9A07G043_CLK_SD0, SEL_SDHI0, SEL_SDHI0_STS, sel_shdi, + mtable_sdhi, 0, rzg2l_cpg_sd_clk_mux_notifier), +- DEF_SD_MUX("SD1", R9A07G043_CLK_SD1, SEL_SDHI1, SEL_SDHI0_STS, sel_shdi, ++ DEF_SD_MUX("SD1", R9A07G043_CLK_SD1, SEL_SDHI1, SEL_SDHI1_STS, sel_shdi, + mtable_sdhi, 0, rzg2l_cpg_sd_clk_mux_notifier), + DEF_FIXED("SD0_DIV4", CLK_SD0_DIV4, R9A07G043_CLK_SD0, 1, 4), + DEF_FIXED("SD1_DIV4", CLK_SD1_DIV4, R9A07G043_CLK_SD1, 1, 4), +diff --git a/drivers/clk/renesas/r9a07g044-cpg.c b/drivers/clk/renesas/r9a07g044-cpg.c +index 1047278c9079a..bc822b9fd7ce6 100644 +--- a/drivers/clk/renesas/r9a07g044-cpg.c ++++ b/drivers/clk/renesas/r9a07g044-cpg.c +@@ -178,7 +178,7 @@ static const struct { + DEF_FIXED("SPI1", R9A07G044_CLK_SPI1, CLK_DIV_PLL3_C, 1, 4), + DEF_SD_MUX("SD0", R9A07G044_CLK_SD0, SEL_SDHI0, SEL_SDHI0_STS, sel_shdi, + mtable_sdhi, 0, rzg2l_cpg_sd_clk_mux_notifier), +- DEF_SD_MUX("SD1", R9A07G044_CLK_SD1, SEL_SDHI1, SEL_SDHI0_STS, sel_shdi, ++ DEF_SD_MUX("SD1", R9A07G044_CLK_SD1, SEL_SDHI1, SEL_SDHI1_STS, sel_shdi, + mtable_sdhi, 0, rzg2l_cpg_sd_clk_mux_notifier), + DEF_FIXED("SD0_DIV4", CLK_SD0_DIV4, R9A07G044_CLK_SD0, 1, 4), + DEF_FIXED("SD1_DIV4", CLK_SD1_DIV4, R9A07G044_CLK_SD1, 1, 4), +-- +2.43.0 + diff --git a/queue-6.8/clk-samsung-exynos850-propagate-spi-ipclk-rate-chang.patch b/queue-6.8/clk-samsung-exynos850-propagate-spi-ipclk-rate-chang.patch new file mode 100644 index 00000000000..08939e5ba14 --- /dev/null +++ b/queue-6.8/clk-samsung-exynos850-propagate-spi-ipclk-rate-chang.patch @@ -0,0 +1,173 @@ +From dccfcbfb35b330c5b91ca0f57eb48765f16c06d0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jan 2024 19:38:56 -0600 +Subject: clk: samsung: exynos850: Propagate SPI IPCLK rate change + +From: Sam Protsenko + +[ Upstream commit 67c15187d4910ee353374676d4dddf09d8cb227e ] + +When SPI transfer is being prepared, the spi-s3c64xx driver will call +clk_set_rate() to change the rate of SPI source clock (IPCLK). But IPCLK +is a gate (leaf) clock, so it must propagate the rate change up the +clock tree, so that corresponding DIV clocks can actually change their +divider values. Add CLK_SET_RATE_PARENT flag to corresponding clocks for +all SPI instances in Exynos850 (spi_0, spi_1 and spi_2) to make it +possible. This change involves next clocks: + +usi_spi_0: + + Clock Block Div range + -------------------------------------------- + gout_spi0_ipclk CMU_PERI - + dout_peri_spi0 CMU_PERI /1..32 + mout_peri_spi_user CMU_PERI - + dout_peri_ip CMU_TOP /1..16 + +usi_cmgp0: + + Clock Block Div range + -------------------------------------------- + gout_cmgp_usi0_ipclk CMU_CMGP - + dout_cmgp_usi0 CMU_CMGP /1..32 + mout_cmgp_usi0 CMU_CMGP - + gout_clkcmu_cmgp_bus CMU_APM - + dout_apm_bus CMU_APM /1..8 + +usi_cmgp1: + + Clock Block Div range + -------------------------------------------- + gout_cmgp_usi1_ipclk CMU_CMGP - + dout_cmgp_usi1 CMU_CMGP /1..32 + mout_cmgp_usi1 CMU_CMGP - + gout_clkcmu_cmgp_bus CMU_APM - + dout_apm_bus CMU_APM /1..8 + +With input clock of 400 MHz, this scheme provides next IPCLK rate range, +for each SPI block: + + SPI0: 781 kHz ... 400 MHz + SPI1/2: 1.6 MHz ... 400 MHz + +Accounting for internal /4 divider in SPI blocks, and because the max +SPI frequency is limited at 50 MHz, it gives us next SPI SCK rates: + + SPI0: 200 kHz ... 49.9 MHz + SPI1/2: 400 kHz ... 49.9 MHz + +Which should cover all possible applications of SPI bus. Of course, +setting SPI frequency to values as low as 500 kHz will also affect the +common bus dividers (dout_apm_bus or dout_peri_ip), which in turn +effectively lowers the rates for all leaf bus clocks derived from those +dividers, like HSI2C and I3C clocks. But at least it gives the board +designer a choice, whether to keep all clocks (SPI/HSI2C/I3C) at high +frequencies, or make all those clocks have lower frequencies. Not +propagating the rate change to those common dividers would limit this +choice to "only high frequencies are allowed for SPI/HSI2C/I3C" option, +making the common dividers useless. This decision follows the "Worse is +better" approach, relying on the users/engineers to know the system +internals when working with such low-level features, instead of trying +to account for all possible use-cases. + +Fixes: 7dd05578198b ("clk: samsung: Introduce Exynos850 clock driver") +Signed-off-by: Sam Protsenko +Reviewed-by: Tudor Ambarus +Link: https://lore.kernel.org/r/20240125013858.3986-2-semen.protsenko@linaro.org +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Sasha Levin +--- + drivers/clk/samsung/clk-exynos850.c | 33 +++++++++++++++-------------- + 1 file changed, 17 insertions(+), 16 deletions(-) + +diff --git a/drivers/clk/samsung/clk-exynos850.c b/drivers/clk/samsung/clk-exynos850.c +index bdc1eef7d6e54..c7b0b9751307b 100644 +--- a/drivers/clk/samsung/clk-exynos850.c ++++ b/drivers/clk/samsung/clk-exynos850.c +@@ -605,7 +605,7 @@ static const struct samsung_div_clock apm_div_clks[] __initconst = { + + static const struct samsung_gate_clock apm_gate_clks[] __initconst = { + GATE(CLK_GOUT_CLKCMU_CMGP_BUS, "gout_clkcmu_cmgp_bus", "dout_apm_bus", +- CLK_CON_GAT_CLKCMU_CMGP_BUS, 21, 0, 0), ++ CLK_CON_GAT_CLKCMU_CMGP_BUS, 21, CLK_SET_RATE_PARENT, 0), + GATE(CLK_GOUT_CLKCMU_CHUB_BUS, "gout_clkcmu_chub_bus", + "mout_clkcmu_chub_bus", + CLK_CON_GAT_GATE_CLKCMU_CHUB_BUS, 21, 0, 0), +@@ -974,19 +974,19 @@ static const struct samsung_fixed_rate_clock cmgp_fixed_clks[] __initconst = { + static const struct samsung_mux_clock cmgp_mux_clks[] __initconst = { + MUX(CLK_MOUT_CMGP_ADC, "mout_cmgp_adc", mout_cmgp_adc_p, + CLK_CON_MUX_CLK_CMGP_ADC, 0, 1), +- MUX(CLK_MOUT_CMGP_USI0, "mout_cmgp_usi0", mout_cmgp_usi0_p, +- CLK_CON_MUX_MUX_CLK_CMGP_USI_CMGP0, 0, 1), +- MUX(CLK_MOUT_CMGP_USI1, "mout_cmgp_usi1", mout_cmgp_usi1_p, +- CLK_CON_MUX_MUX_CLK_CMGP_USI_CMGP1, 0, 1), ++ MUX_F(CLK_MOUT_CMGP_USI0, "mout_cmgp_usi0", mout_cmgp_usi0_p, ++ CLK_CON_MUX_MUX_CLK_CMGP_USI_CMGP0, 0, 1, CLK_SET_RATE_PARENT, 0), ++ MUX_F(CLK_MOUT_CMGP_USI1, "mout_cmgp_usi1", mout_cmgp_usi1_p, ++ CLK_CON_MUX_MUX_CLK_CMGP_USI_CMGP1, 0, 1, CLK_SET_RATE_PARENT, 0), + }; + + static const struct samsung_div_clock cmgp_div_clks[] __initconst = { + DIV(CLK_DOUT_CMGP_ADC, "dout_cmgp_adc", "gout_clkcmu_cmgp_bus", + CLK_CON_DIV_DIV_CLK_CMGP_ADC, 0, 4), +- DIV(CLK_DOUT_CMGP_USI0, "dout_cmgp_usi0", "mout_cmgp_usi0", +- CLK_CON_DIV_DIV_CLK_CMGP_USI_CMGP0, 0, 5), +- DIV(CLK_DOUT_CMGP_USI1, "dout_cmgp_usi1", "mout_cmgp_usi1", +- CLK_CON_DIV_DIV_CLK_CMGP_USI_CMGP1, 0, 5), ++ DIV_F(CLK_DOUT_CMGP_USI0, "dout_cmgp_usi0", "mout_cmgp_usi0", ++ CLK_CON_DIV_DIV_CLK_CMGP_USI_CMGP0, 0, 5, CLK_SET_RATE_PARENT, 0), ++ DIV_F(CLK_DOUT_CMGP_USI1, "dout_cmgp_usi1", "mout_cmgp_usi1", ++ CLK_CON_DIV_DIV_CLK_CMGP_USI_CMGP1, 0, 5, CLK_SET_RATE_PARENT, 0), + }; + + static const struct samsung_gate_clock cmgp_gate_clks[] __initconst = { +@@ -1001,12 +1001,12 @@ static const struct samsung_gate_clock cmgp_gate_clks[] __initconst = { + "gout_clkcmu_cmgp_bus", + CLK_CON_GAT_GOUT_CMGP_GPIO_PCLK, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_CMGP_USI0_IPCLK, "gout_cmgp_usi0_ipclk", "dout_cmgp_usi0", +- CLK_CON_GAT_GOUT_CMGP_USI_CMGP0_IPCLK, 21, 0, 0), ++ CLK_CON_GAT_GOUT_CMGP_USI_CMGP0_IPCLK, 21, CLK_SET_RATE_PARENT, 0), + GATE(CLK_GOUT_CMGP_USI0_PCLK, "gout_cmgp_usi0_pclk", + "gout_clkcmu_cmgp_bus", + CLK_CON_GAT_GOUT_CMGP_USI_CMGP0_PCLK, 21, 0, 0), + GATE(CLK_GOUT_CMGP_USI1_IPCLK, "gout_cmgp_usi1_ipclk", "dout_cmgp_usi1", +- CLK_CON_GAT_GOUT_CMGP_USI_CMGP1_IPCLK, 21, 0, 0), ++ CLK_CON_GAT_GOUT_CMGP_USI_CMGP1_IPCLK, 21, CLK_SET_RATE_PARENT, 0), + GATE(CLK_GOUT_CMGP_USI1_PCLK, "gout_cmgp_usi1_pclk", + "gout_clkcmu_cmgp_bus", + CLK_CON_GAT_GOUT_CMGP_USI_CMGP1_PCLK, 21, 0, 0), +@@ -1557,8 +1557,9 @@ static const struct samsung_mux_clock peri_mux_clks[] __initconst = { + mout_peri_uart_user_p, PLL_CON0_MUX_CLKCMU_PERI_UART_USER, 4, 1), + MUX(CLK_MOUT_PERI_HSI2C_USER, "mout_peri_hsi2c_user", + mout_peri_hsi2c_user_p, PLL_CON0_MUX_CLKCMU_PERI_HSI2C_USER, 4, 1), +- MUX(CLK_MOUT_PERI_SPI_USER, "mout_peri_spi_user", mout_peri_spi_user_p, +- PLL_CON0_MUX_CLKCMU_PERI_SPI_USER, 4, 1), ++ MUX_F(CLK_MOUT_PERI_SPI_USER, "mout_peri_spi_user", ++ mout_peri_spi_user_p, PLL_CON0_MUX_CLKCMU_PERI_SPI_USER, 4, 1, ++ CLK_SET_RATE_PARENT, 0), + }; + + static const struct samsung_div_clock peri_div_clks[] __initconst = { +@@ -1568,8 +1569,8 @@ static const struct samsung_div_clock peri_div_clks[] __initconst = { + CLK_CON_DIV_DIV_CLK_PERI_HSI2C_1, 0, 5), + DIV(CLK_DOUT_PERI_HSI2C2, "dout_peri_hsi2c2", "gout_peri_hsi2c2", + CLK_CON_DIV_DIV_CLK_PERI_HSI2C_2, 0, 5), +- DIV(CLK_DOUT_PERI_SPI0, "dout_peri_spi0", "mout_peri_spi_user", +- CLK_CON_DIV_DIV_CLK_PERI_SPI_0, 0, 5), ++ DIV_F(CLK_DOUT_PERI_SPI0, "dout_peri_spi0", "mout_peri_spi_user", ++ CLK_CON_DIV_DIV_CLK_PERI_SPI_0, 0, 5, CLK_SET_RATE_PARENT, 0), + }; + + static const struct samsung_gate_clock peri_gate_clks[] __initconst = { +@@ -1611,7 +1612,7 @@ static const struct samsung_gate_clock peri_gate_clks[] __initconst = { + "mout_peri_bus_user", + CLK_CON_GAT_GOUT_PERI_PWM_MOTOR_PCLK, 21, 0, 0), + GATE(CLK_GOUT_SPI0_IPCLK, "gout_spi0_ipclk", "dout_peri_spi0", +- CLK_CON_GAT_GOUT_PERI_SPI_0_IPCLK, 21, 0, 0), ++ CLK_CON_GAT_GOUT_PERI_SPI_0_IPCLK, 21, CLK_SET_RATE_PARENT, 0), + GATE(CLK_GOUT_SPI0_PCLK, "gout_spi0_pclk", "mout_peri_bus_user", + CLK_CON_GAT_GOUT_PERI_SPI_0_PCLK, 21, 0, 0), + GATE(CLK_GOUT_SYSREG_PERI_PCLK, "gout_sysreg_peri_pclk", +-- +2.43.0 + diff --git a/queue-6.8/clk-zynq-prevent-null-pointer-dereference-caused-by-.patch b/queue-6.8/clk-zynq-prevent-null-pointer-dereference-caused-by-.patch new file mode 100644 index 00000000000..5c4e235a73f --- /dev/null +++ b/queue-6.8/clk-zynq-prevent-null-pointer-dereference-caused-by-.patch @@ -0,0 +1,74 @@ +From e4c8ebd6bcfeecaed414fd9e784651b321e76e93 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 1 Mar 2024 16:44:37 +0800 +Subject: clk: zynq: Prevent null pointer dereference caused by kmalloc failure + +From: Duoming Zhou + +[ Upstream commit 7938e9ce39d6779d2f85d822cc930f73420e54a6 ] + +The kmalloc() in zynq_clk_setup() will return null if the +physical memory has run out. As a result, if we use snprintf() +to write data to the null address, the null pointer dereference +bug will happen. + +This patch uses a stack variable to replace the kmalloc(). + +Fixes: 0ee52b157b8e ("clk: zynq: Add clock controller driver") +Suggested-by: Michal Simek +Suggested-by: Stephen Boyd +Signed-off-by: Duoming Zhou +Link: https://lore.kernel.org/r/20240301084437.16084-1-duoming@zju.edu.cn +Acked-by: Michal Simek +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/zynq/clkc.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c +index 7bdeaff2bfd68..c28d3dacf0fb2 100644 +--- a/drivers/clk/zynq/clkc.c ++++ b/drivers/clk/zynq/clkc.c +@@ -42,6 +42,7 @@ static void __iomem *zynq_clkc_base; + #define SLCR_SWDT_CLK_SEL (zynq_clkc_base + 0x204) + + #define NUM_MIO_PINS 54 ++#define CLK_NAME_LEN 16 + + #define DBG_CLK_CTRL_CLKACT_TRC BIT(0) + #define DBG_CLK_CTRL_CPU_1XCLKACT BIT(1) +@@ -215,7 +216,7 @@ static void __init zynq_clk_setup(struct device_node *np) + int i; + u32 tmp; + int ret; +- char *clk_name; ++ char clk_name[CLK_NAME_LEN]; + unsigned int fclk_enable = 0; + const char *clk_output_name[clk_max]; + const char *cpu_parents[4]; +@@ -426,12 +427,10 @@ static void __init zynq_clk_setup(struct device_node *np) + "gem1_emio_mux", CLK_SET_RATE_PARENT, + SLCR_GEM1_CLK_CTRL, 0, 0, &gem1clk_lock); + +- tmp = strlen("mio_clk_00x"); +- clk_name = kmalloc(tmp, GFP_KERNEL); + for (i = 0; i < NUM_MIO_PINS; i++) { + int idx; + +- snprintf(clk_name, tmp, "mio_clk_%2.2d", i); ++ snprintf(clk_name, CLK_NAME_LEN, "mio_clk_%2.2d", i); + idx = of_property_match_string(np, "clock-names", clk_name); + if (idx >= 0) + can_mio_mux_parents[i] = of_clk_get_parent_name(np, +@@ -439,7 +438,6 @@ static void __init zynq_clk_setup(struct device_node *np) + else + can_mio_mux_parents[i] = dummy_nm; + } +- kfree(clk_name); + clk_register_mux(NULL, "can_mux", periph_parents, 4, + CLK_SET_RATE_NO_REPARENT, SLCR_CAN_CLK_CTRL, 4, 2, 0, + &canclk_lock); +-- +2.43.0 + diff --git a/queue-6.8/cpufreq-brcmstb-avs-cpufreq-add-check-for-cpufreq_cp.patch b/queue-6.8/cpufreq-brcmstb-avs-cpufreq-add-check-for-cpufreq_cp.patch new file mode 100644 index 00000000000..5439afe605d --- /dev/null +++ b/queue-6.8/cpufreq-brcmstb-avs-cpufreq-add-check-for-cpufreq_cp.patch @@ -0,0 +1,39 @@ +From c13dee43fe75e2780198d476e37cbf9c61e42c3f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 17 Jan 2024 10:12:20 +0300 +Subject: cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return + value + +From: Anastasia Belova + +[ Upstream commit f661017e6d326ee187db24194cabb013d81bc2a6 ] + +cpufreq_cpu_get may return NULL. To avoid NULL-dereference check it +and return 0 in case of error. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Fixes: de322e085995 ("cpufreq: brcmstb-avs-cpufreq: AVS CPUfreq driver for Broadcom STB SoCs") +Signed-off-by: Anastasia Belova +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/brcmstb-avs-cpufreq.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c +index 35fb3a559ea97..1a1857b0a6f48 100644 +--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c ++++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c +@@ -481,6 +481,8 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv) + static unsigned int brcm_avs_cpufreq_get(unsigned int cpu) + { + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); ++ if (!policy) ++ return 0; + struct private_data *priv = policy->driver_data; + + cpufreq_cpu_put(policy); +-- +2.43.0 + diff --git a/queue-6.8/cpufreq-mediatek-hw-don-t-error-out-if-supply-is-not.patch b/queue-6.8/cpufreq-mediatek-hw-don-t-error-out-if-supply-is-not.patch new file mode 100644 index 00000000000..1397b663e60 --- /dev/null +++ b/queue-6.8/cpufreq-mediatek-hw-don-t-error-out-if-supply-is-not.patch @@ -0,0 +1,48 @@ +From 0d895dc524dddc7710f172abf45537a566f9f6c7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Jan 2024 17:31:43 -0300 +Subject: cpufreq: mediatek-hw: Don't error out if supply is not found +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nícolas F. R. A. Prado + +[ Upstream commit eaffb10b51bf74415c9252fd8fb4dd77122501ee ] + +devm_regulator_get_optional() returns -ENODEV if no supply can be found. +By introducing its usage, commit 788715b5f21c ("cpufreq: mediatek-hw: +Wait for CPU supplies before probing") caused the driver to fail probe +if no supply was present in any of the CPU DT nodes. + +Use devm_regulator_get() instead since the CPUs do require supplies +even if not described in the DT. It will gracefully return a dummy +regulator if none is found in the DT node, allowing probe to succeed. + +Fixes: 788715b5f21c ("cpufreq: mediatek-hw: Wait for CPU supplies before probing") +Reported-by: kernelci.org bot +Closes: https://linux.kernelci.org/test/case/id/65b0b169710edea22852a3fa/ +Signed-off-by: Nícolas F. R. A. Prado +Reviewed-by: AngeloGioacchino Del Regno +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/mediatek-cpufreq-hw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/cpufreq/mediatek-cpufreq-hw.c b/drivers/cpufreq/mediatek-cpufreq-hw.c +index a1aa9385980ae..8d097dcddda47 100644 +--- a/drivers/cpufreq/mediatek-cpufreq-hw.c ++++ b/drivers/cpufreq/mediatek-cpufreq-hw.c +@@ -312,7 +312,7 @@ static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev) + return dev_err_probe(&pdev->dev, -EPROBE_DEFER, + "Failed to get cpu%d device\n", cpu); + +- cpu_reg = devm_regulator_get_optional(cpu_dev, "cpu"); ++ cpu_reg = devm_regulator_get(cpu_dev, "cpu"); + if (IS_ERR(cpu_reg)) + return dev_err_probe(&pdev->dev, PTR_ERR(cpu_reg), + "CPU%d regulator get failed\n", cpu); +-- +2.43.0 + diff --git a/queue-6.8/cpufreq-mediatek-hw-wait-for-cpu-supplies-before-pro.patch b/queue-6.8/cpufreq-mediatek-hw-wait-for-cpu-supplies-before-pro.patch new file mode 100644 index 00000000000..50055ac5ab1 --- /dev/null +++ b/queue-6.8/cpufreq-mediatek-hw-wait-for-cpu-supplies-before-pro.patch @@ -0,0 +1,72 @@ +From d5f181718703454f10c4d768e7527c454badd666 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 10 Jan 2024 11:23:02 -0300 +Subject: cpufreq: mediatek-hw: Wait for CPU supplies before probing +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nícolas F. R. A. Prado + +[ Upstream commit 788715b5f21c6455264fe00a1779e61bec407fe2 ] + +Before proceeding with the probe and enabling frequency scaling for the +CPUs, make sure that all supplies feeding the CPUs have probed. + +This fixes an issue observed on MT8195-Tomato where if the +mediatek-cpufreq-hw driver enabled the hardware (by writing to +REG_FREQ_ENABLE) before the SPMI controller driver (spmi-mtk-pmif), +behind which lies the big CPU supply, probed the platform would hang +shortly after with "rcu: INFO: rcu_preempt detected stalls on +CPUs/tasks" being printed in the log. + +Fixes: 4855e26bcf4d ("cpufreq: mediatek-hw: Add support for CPUFREQ HW") +Signed-off-by: Nícolas F. R. A. Prado +Reviewed-by: AngeloGioacchino Del Regno +Reviewed-by: Matthias Brugger +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/mediatek-cpufreq-hw.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/drivers/cpufreq/mediatek-cpufreq-hw.c b/drivers/cpufreq/mediatek-cpufreq-hw.c +index d46afb3c00923..a1aa9385980ae 100644 +--- a/drivers/cpufreq/mediatek-cpufreq-hw.c ++++ b/drivers/cpufreq/mediatek-cpufreq-hw.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + + #define LUT_MAX_ENTRIES 32U +@@ -300,7 +301,23 @@ static struct cpufreq_driver cpufreq_mtk_hw_driver = { + static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev) + { + const void *data; +- int ret; ++ int ret, cpu; ++ struct device *cpu_dev; ++ struct regulator *cpu_reg; ++ ++ /* Make sure that all CPU supplies are available before proceeding. */ ++ for_each_possible_cpu(cpu) { ++ cpu_dev = get_cpu_device(cpu); ++ if (!cpu_dev) ++ return dev_err_probe(&pdev->dev, -EPROBE_DEFER, ++ "Failed to get cpu%d device\n", cpu); ++ ++ cpu_reg = devm_regulator_get_optional(cpu_dev, "cpu"); ++ if (IS_ERR(cpu_reg)) ++ return dev_err_probe(&pdev->dev, PTR_ERR(cpu_reg), ++ "CPU%d regulator get failed\n", cpu); ++ } ++ + + data = of_device_get_match_data(&pdev->dev); + if (!data) +-- +2.43.0 + diff --git a/queue-6.8/cpufreq-qcom-hw-add-config_common_clk-dependency.patch b/queue-6.8/cpufreq-qcom-hw-add-config_common_clk-dependency.patch new file mode 100644 index 00000000000..eb0cc9af416 --- /dev/null +++ b/queue-6.8/cpufreq-qcom-hw-add-config_common_clk-dependency.patch @@ -0,0 +1,47 @@ +From 698f41656f7d30592b1a343ff9b0a0c5aac9446c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Feb 2024 09:33:14 +0100 +Subject: cpufreq: qcom-hw: add CONFIG_COMMON_CLK dependency + +From: Arnd Bergmann + +[ Upstream commit 3093fa33539b54db77171d2919352ad4f044a1c5 ] + +It is still possible to compile-test a kernel without CONFIG_COMMON_CLK +for some ancient ARM boards or other architectures, but this causes a +link failure in the qcom-cpufreq-hw driver: + +ERROR: modpost: "devm_clk_hw_register" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined! +ERROR: modpost: "devm_of_clk_add_hw_provider" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined! +ERROR: modpost: "of_clk_hw_onecell_get" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined! + +Add a Kconfig dependency here to make sure this always work. Apparently +this bug has been in the kernel for a while without me running into it +on randconfig builds as COMMON_CLK is almost always enabled. + +I have cross-checked by building an allmodconfig kernel with COMMON_CLK +disabled, which showed no other driver having this problem. + +Fixes: 4370232c727b ("cpufreq: qcom-hw: Add CPU clock provider support") +Signed-off-by: Arnd Bergmann +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/Kconfig.arm | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm +index f911606897b8d..a0ebad77666e3 100644 +--- a/drivers/cpufreq/Kconfig.arm ++++ b/drivers/cpufreq/Kconfig.arm +@@ -173,6 +173,7 @@ config ARM_QCOM_CPUFREQ_NVMEM + config ARM_QCOM_CPUFREQ_HW + tristate "QCOM CPUFreq HW driver" + depends on ARCH_QCOM || COMPILE_TEST ++ depends on COMMON_CLK + help + Support for the CPUFreq HW driver. + Some QCOM chipsets have a HW engine to offload the steps +-- +2.43.0 + diff --git a/queue-6.8/crypto-arm-sha-fix-function-cast-warnings.patch b/queue-6.8/crypto-arm-sha-fix-function-cast-warnings.patch new file mode 100644 index 00000000000..8d96f3d4ee6 --- /dev/null +++ b/queue-6.8/crypto-arm-sha-fix-function-cast-warnings.patch @@ -0,0 +1,115 @@ +From 1eb9f76ac2c5ebaee09bb265d8759d100924440d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 14:49:46 +0100 +Subject: crypto: arm/sha - fix function cast warnings + +From: Arnd Bergmann + +[ Upstream commit 53cc9baeb9bc2a187eb9c9790d30995148852b12 ] + +clang-16 warns about casting between incompatible function types: + +arch/arm/crypto/sha256_glue.c:37:5: error: cast from 'void (*)(u32 *, const void *, unsigned int)' (aka 'void (*)(unsigned int *, const void *, unsigned int)') to 'sha256_block_fn *' (aka 'void (*)(struct sha256_state *, const unsigned char *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] + 37 | (sha256_block_fn *)sha256_block_data_order); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +arch/arm/crypto/sha512-glue.c:34:3: error: cast from 'void (*)(u64 *, const u8 *, int)' (aka 'void (*)(unsigned long long *, const unsigned char *, int)') to 'sha512_block_fn *' (aka 'void (*)(struct sha512_state *, const unsigned char *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] + 34 | (sha512_block_fn *)sha512_block_data_order); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Fix the prototypes for the assembler functions to match the typedef. +The code already relies on the digest being the first part of the +state structure, so there is no change in behavior. + +Fixes: c80ae7ca3726 ("crypto: arm/sha512 - accelerated SHA-512 using ARM generic ASM and NEON") +Fixes: b59e2ae3690c ("crypto: arm/sha256 - move SHA-224/256 ASM/NEON implementation to base layer") +Signed-off-by: Arnd Bergmann +Reviewed-by: Ard Biesheuvel +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + arch/arm/crypto/sha256_glue.c | 13 +++++-------- + arch/arm/crypto/sha512-glue.c | 12 +++++------- + 2 files changed, 10 insertions(+), 15 deletions(-) + +diff --git a/arch/arm/crypto/sha256_glue.c b/arch/arm/crypto/sha256_glue.c +index 433ee4ddce6c8..f85933fdec75f 100644 +--- a/arch/arm/crypto/sha256_glue.c ++++ b/arch/arm/crypto/sha256_glue.c +@@ -24,8 +24,8 @@ + + #include "sha256_glue.h" + +-asmlinkage void sha256_block_data_order(u32 *digest, const void *data, +- unsigned int num_blks); ++asmlinkage void sha256_block_data_order(struct sha256_state *state, ++ const u8 *data, int num_blks); + + int crypto_sha256_arm_update(struct shash_desc *desc, const u8 *data, + unsigned int len) +@@ -33,23 +33,20 @@ int crypto_sha256_arm_update(struct shash_desc *desc, const u8 *data, + /* make sure casting to sha256_block_fn() is safe */ + BUILD_BUG_ON(offsetof(struct sha256_state, state) != 0); + +- return sha256_base_do_update(desc, data, len, +- (sha256_block_fn *)sha256_block_data_order); ++ return sha256_base_do_update(desc, data, len, sha256_block_data_order); + } + EXPORT_SYMBOL(crypto_sha256_arm_update); + + static int crypto_sha256_arm_final(struct shash_desc *desc, u8 *out) + { +- sha256_base_do_finalize(desc, +- (sha256_block_fn *)sha256_block_data_order); ++ sha256_base_do_finalize(desc, sha256_block_data_order); + return sha256_base_finish(desc, out); + } + + int crypto_sha256_arm_finup(struct shash_desc *desc, const u8 *data, + unsigned int len, u8 *out) + { +- sha256_base_do_update(desc, data, len, +- (sha256_block_fn *)sha256_block_data_order); ++ sha256_base_do_update(desc, data, len, sha256_block_data_order); + return crypto_sha256_arm_final(desc, out); + } + EXPORT_SYMBOL(crypto_sha256_arm_finup); +diff --git a/arch/arm/crypto/sha512-glue.c b/arch/arm/crypto/sha512-glue.c +index 0635a65aa488b..1be5bd498af36 100644 +--- a/arch/arm/crypto/sha512-glue.c ++++ b/arch/arm/crypto/sha512-glue.c +@@ -25,27 +25,25 @@ MODULE_ALIAS_CRYPTO("sha512"); + MODULE_ALIAS_CRYPTO("sha384-arm"); + MODULE_ALIAS_CRYPTO("sha512-arm"); + +-asmlinkage void sha512_block_data_order(u64 *state, u8 const *src, int blocks); ++asmlinkage void sha512_block_data_order(struct sha512_state *state, ++ u8 const *src, int blocks); + + int sha512_arm_update(struct shash_desc *desc, const u8 *data, + unsigned int len) + { +- return sha512_base_do_update(desc, data, len, +- (sha512_block_fn *)sha512_block_data_order); ++ return sha512_base_do_update(desc, data, len, sha512_block_data_order); + } + + static int sha512_arm_final(struct shash_desc *desc, u8 *out) + { +- sha512_base_do_finalize(desc, +- (sha512_block_fn *)sha512_block_data_order); ++ sha512_base_do_finalize(desc, sha512_block_data_order); + return sha512_base_finish(desc, out); + } + + int sha512_arm_finup(struct shash_desc *desc, const u8 *data, + unsigned int len, u8 *out) + { +- sha512_base_do_update(desc, data, len, +- (sha512_block_fn *)sha512_block_data_order); ++ sha512_base_do_update(desc, data, len, sha512_block_data_order); + return sha512_arm_final(desc, out); + } + +-- +2.43.0 + diff --git a/queue-6.8/crypto-ccp-avoid-discarding-errors-in-psp_send_platf.patch b/queue-6.8/crypto-ccp-avoid-discarding-errors-in-psp_send_platf.patch new file mode 100644 index 00000000000..7cd2d7c4818 --- /dev/null +++ b/queue-6.8/crypto-ccp-avoid-discarding-errors-in-psp_send_platf.patch @@ -0,0 +1,56 @@ +From 3691094a0d5eda6514758469e2a08f2124c9b38d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 11:34:28 -0600 +Subject: crypto: ccp - Avoid discarding errors in + psp_send_platform_access_msg() + +From: Mario Limonciello + +[ Upstream commit 0e8fca2f12ceb77c3a6b6f210135031f264aa612 ] + +Errors can potentially occur in the "processing" of PSP commands or +commands can be processed successfully but still return an error code in +the header. + +This second case was being discarded because PSP communication worked but +the command returned an error code in the payload header. + +Capture both cases and return them to the caller as -EIO for the caller +to investigate. The caller can detect the latter by looking at +`req->header->status`. + +Reported-and-tested-by: Tim Van Patten +Fixes: 7ccc4f4e2e50 ("crypto: ccp - Add support for an interface for platform features") +Signed-off-by: Mario Limonciello +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/ccp/platform-access.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/crypto/ccp/platform-access.c b/drivers/crypto/ccp/platform-access.c +index 94367bc49e35b..1b8ed33897332 100644 +--- a/drivers/crypto/ccp/platform-access.c ++++ b/drivers/crypto/ccp/platform-access.c +@@ -118,9 +118,16 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg msg, + goto unlock; + } + +- /* Store the status in request header for caller to investigate */ ++ /* ++ * Read status from PSP. If status is non-zero, it indicates an error ++ * occurred during "processing" of the command. ++ * If status is zero, it indicates the command was "processed" ++ * successfully, but the result of the command is in the payload. ++ * Return both cases to the caller as -EIO to investigate. ++ */ + cmd_reg = ioread32(cmd); +- req->header.status = FIELD_GET(PSP_CMDRESP_STS, cmd_reg); ++ if (FIELD_GET(PSP_CMDRESP_STS, cmd_reg)) ++ req->header.status = FIELD_GET(PSP_CMDRESP_STS, cmd_reg); + if (req->header.status) { + ret = -EIO; + goto unlock; +-- +2.43.0 + diff --git a/queue-6.8/crypto-jitter-fix-crypto_jitterentropy-help-text.patch b/queue-6.8/crypto-jitter-fix-crypto_jitterentropy-help-text.patch new file mode 100644 index 00000000000..260f10fe165 --- /dev/null +++ b/queue-6.8/crypto-jitter-fix-crypto_jitterentropy-help-text.patch @@ -0,0 +1,51 @@ +From 85c7c9fb46445146173515bf2cf525526b14e3f6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 17 Feb 2024 08:55:13 -0800 +Subject: crypto: jitter - fix CRYPTO_JITTERENTROPY help text + +From: Randy Dunlap + +[ Upstream commit e63df1ec9a16dd9e13e9068243e64876de06f795 ] + +Correct various small problems in the help text: +a. change 2 spaces to ", " +b. finish an incomplete sentence +c. change non-working URL to working URL + +Fixes: a9a98d49da52 ("crypto: Kconfig - simplify compression/RNG entries") +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218458 +Signed-off-by: Randy Dunlap +Cc: Bagas Sanjaya +Cc: Robert Elliott +Cc: Christoph Biedl +Cc: Herbert Xu +Cc: "David S. Miller" +Cc: linux-crypto@vger.kernel.org +Acked-by: Bagas Sanjaya +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + crypto/Kconfig | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/crypto/Kconfig b/crypto/Kconfig +index 7d156c75f15f2..44661c2e30ca5 100644 +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -1269,10 +1269,11 @@ config CRYPTO_JITTERENTROPY + + A non-physical non-deterministic ("true") RNG (e.g., an entropy source + compliant with NIST SP800-90B) intended to provide a seed to a +- deterministic RNG (e.g. per NIST SP800-90C). ++ deterministic RNG (e.g., per NIST SP800-90C). + This RNG does not perform any cryptographic whitening of the generated ++ random numbers. + +- See https://www.chronox.de/jent.html ++ See https://www.chronox.de/jent/ + + if CRYPTO_JITTERENTROPY + if CRYPTO_FIPS && EXPERT +-- +2.43.0 + diff --git a/queue-6.8/crypto-qat-avoid-division-by-zero.patch b/queue-6.8/crypto-qat-avoid-division-by-zero.patch new file mode 100644 index 00000000000..7f2df436f8a --- /dev/null +++ b/queue-6.8/crypto-qat-avoid-division-by-zero.patch @@ -0,0 +1,45 @@ +From bf50a38ecc3f80adedac0ea4cb2e0f3d3fa32a5d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 15:19:57 +0000 +Subject: crypto: qat - avoid division by zero + +From: Adam Guerin + +[ Upstream commit f99fb7d660f7c818105803f1f1915396a14d18ad ] + +Check if delta_us is not zero and return -EINVAL if it is. +delta_us is unlikely to be zero as there is a sleep between the reads of +the two timestamps. + +This is to fix the following warning when compiling the QAT driver +using clang scan-build: + drivers/crypto/intel/qat/qat_common/adf_clock.c:87:9: warning: Division by zero [core.DivideZero] + 87 | temp = DIV_ROUND_CLOSEST_ULL(temp, delta_us); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Fixes: e2980ba57e79 ("crypto: qat - add measure clock frequency") +Signed-off-by: Adam Guerin +Reviewed-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/intel/qat/qat_common/adf_clock.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/crypto/intel/qat/qat_common/adf_clock.c b/drivers/crypto/intel/qat/qat_common/adf_clock.c +index 01e0a389e462b..cf89f57de2a70 100644 +--- a/drivers/crypto/intel/qat/qat_common/adf_clock.c ++++ b/drivers/crypto/intel/qat/qat_common/adf_clock.c +@@ -83,6 +83,9 @@ static int measure_clock(struct adf_accel_dev *accel_dev, u32 *frequency) + } + + delta_us = timespec_to_us(&ts3) - timespec_to_us(&ts1); ++ if (!delta_us) ++ return -EINVAL; ++ + temp = (timestamp2 - timestamp1) * ME_CLK_DIVIDER * 10; + temp = DIV_ROUND_CLOSEST_ULL(temp, delta_us); + /* +-- +2.43.0 + diff --git a/queue-6.8/crypto-qat-avoid-memcpy-overflow-warning.patch b/queue-6.8/crypto-qat-avoid-memcpy-overflow-warning.patch new file mode 100644 index 00000000000..2f00f63bbe2 --- /dev/null +++ b/queue-6.8/crypto-qat-avoid-memcpy-overflow-warning.patch @@ -0,0 +1,56 @@ +From 9754fa3740b68b6ecd5188171636b2f49308eec1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Jan 2024 17:26:02 +0100 +Subject: crypto: qat - avoid memcpy() overflow warning + +From: Arnd Bergmann + +[ Upstream commit 23a22e831ed4e6aa0831312e8cc8b7c60a657f60 ] + +The use of array_size() leads gcc to assume the memcpy() can have a larger +limit than actually possible, which triggers a string fortification warning: + +In file included from include/linux/string.h:296, + from include/linux/bitmap.h:12, + from include/linux/cpumask.h:12, + from include/linux/sched.h:16, + from include/linux/delay.h:23, + from include/linux/iopoll.h:12, + from drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c:3: +In function 'fortify_memcpy_chk', + inlined from 'adf_gen4_init_thd2arb_map' at drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c:401:3: +include/linux/fortify-string.h:579:4: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] + 579 | __write_overflow_field(p_size_field, size); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +include/linux/fortify-string.h:588:4: error: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning] + 588 | __read_overflow2_field(q_size_field, size); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Add an explicit range check to avoid this. + +Fixes: 5da6a2d5353e ("crypto: qat - generate dynamically arbiter mappings") +Signed-off-by: Arnd Bergmann +Acked-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c b/drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c +index 9985683056d5f..f752653ccb47e 100644 +--- a/drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c ++++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.c +@@ -398,6 +398,9 @@ int adf_gen4_init_thd2arb_map(struct adf_accel_dev *accel_dev) + ADF_GEN4_ADMIN_ACCELENGINES; + + if (srv_id == SVC_DCC) { ++ if (ae_cnt > ICP_QAT_HW_AE_DELIMITER) ++ return -EINVAL; ++ + memcpy(thd2arb_map, thrd_to_arb_map_dcc, + array_size(sizeof(*thd2arb_map), ae_cnt)); + return 0; +-- +2.43.0 + diff --git a/queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-420xx.patch b/queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-420xx.patch new file mode 100644 index 00000000000..7c4301dbf55 --- /dev/null +++ b/queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-420xx.patch @@ -0,0 +1,56 @@ +From e466900f7ac74afab94542e768965b85785026d3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 18:21:55 +0100 +Subject: crypto: qat - fix ring to service map for dcc in 420xx + +From: Damian Muszynski + +[ Upstream commit a20a6060e0dd57fecaf55487985aef28bd08c6bf ] + +If a device is configured for data compression chaining (dcc), half of the +engines are loaded with the symmetric crypto image and the rest are loaded +with the compression image. +However, in such configuration all rings can handle compression requests. + +Fix the ring to service mapping so that when a device is configured for +dcc, the ring to service mapping reports that all rings in a bank can +be used for compression. + +Fixes: fcf60f4bcf54 ("crypto: qat - add support for 420xx devices") +Signed-off-by: Damian Muszynski +Reviewed-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c b/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c +index a87d29ae724fe..7909b51e97c30 100644 +--- a/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c ++++ b/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c +@@ -372,6 +372,13 @@ static u16 get_ring_to_svc_map(struct adf_accel_dev *accel_dev) + if (!fw_config) + return 0; + ++ /* If dcc, all rings handle compression requests */ ++ if (adf_get_service_enabled(accel_dev) == SVC_DCC) { ++ for (i = 0; i < RP_GROUP_COUNT; i++) ++ rps[i] = COMP; ++ goto set_mask; ++ } ++ + for (i = 0; i < RP_GROUP_COUNT; i++) { + switch (fw_config[i].ae_mask) { + case ADF_AE_GROUP_0: +@@ -400,6 +407,7 @@ static u16 get_ring_to_svc_map(struct adf_accel_dev *accel_dev) + } + } + ++set_mask: + ring_to_svc_map = rps[RP_GROUP_0] << ADF_CFG_SERV_RING_PAIR_0_SHIFT | + rps[RP_GROUP_1] << ADF_CFG_SERV_RING_PAIR_1_SHIFT | + rps[RP_GROUP_0] << ADF_CFG_SERV_RING_PAIR_2_SHIFT | +-- +2.43.0 + diff --git a/queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-4xxx.patch b/queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-4xxx.patch new file mode 100644 index 00000000000..1bd56e8b418 --- /dev/null +++ b/queue-6.8/crypto-qat-fix-ring-to-service-map-for-dcc-in-4xxx.patch @@ -0,0 +1,56 @@ +From b6128bd81720567bbabfc6c561d73b8ca88b65b2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 18:21:54 +0100 +Subject: crypto: qat - fix ring to service map for dcc in 4xxx + +From: Damian Muszynski + +[ Upstream commit df018f82002a8b4dc407bc9a6f416b9241d14415 ] + +If a device is configured for data compression chaining (dcc), half of the +engines are loaded with the symmetric crypto image and the rest are loaded +with the compression image. +However, in such configuration all rings can handle compression requests. + +Fix the ring to service mapping so that when a device is configured for +dcc, the ring to service mapping reports that all rings in a bank can +be used for compression. + +Fixes: a238487f7965 ("crypto: qat - fix ring to service map for QAT GEN4") +Signed-off-by: Damian Muszynski +Reviewed-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c +index 94a0ebb03d8c9..e171cddf6f025 100644 +--- a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c ++++ b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c +@@ -331,6 +331,13 @@ static u16 get_ring_to_svc_map(struct adf_accel_dev *accel_dev) + if (!fw_config) + return 0; + ++ /* If dcc, all rings handle compression requests */ ++ if (adf_get_service_enabled(accel_dev) == SVC_DCC) { ++ for (i = 0; i < RP_GROUP_COUNT; i++) ++ rps[i] = COMP; ++ goto set_mask; ++ } ++ + for (i = 0; i < RP_GROUP_COUNT; i++) { + switch (fw_config[i].ae_mask) { + case ADF_AE_GROUP_0: +@@ -359,6 +366,7 @@ static u16 get_ring_to_svc_map(struct adf_accel_dev *accel_dev) + } + } + ++set_mask: + ring_to_svc_map = rps[RP_GROUP_0] << ADF_CFG_SERV_RING_PAIR_0_SHIFT | + rps[RP_GROUP_1] << ADF_CFG_SERV_RING_PAIR_1_SHIFT | + rps[RP_GROUP_0] << ADF_CFG_SERV_RING_PAIR_2_SHIFT | +-- +2.43.0 + diff --git a/queue-6.8/crypto-qat-remove-double-initialization-of-value.patch b/queue-6.8/crypto-qat-remove-double-initialization-of-value.patch new file mode 100644 index 00000000000..b2a27ce33bb --- /dev/null +++ b/queue-6.8/crypto-qat-remove-double-initialization-of-value.patch @@ -0,0 +1,56 @@ +From 6ec62d43fcb72a6df5d9ba0ee818620dfcf36ecf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 15:19:58 +0000 +Subject: crypto: qat - remove double initialization of value + +From: Adam Guerin + +[ Upstream commit a66cf93ab33853f17b8cc33a99263dd0a383a1a1 ] + +Remove double initialization of the reg variable. + +This is to fix the following warning when compiling the QAT driver +using clang scan-build: + drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c:1010:6: warning: Value stored to 'reg' during its initialization is never read [deadcode.DeadStores] + 1010 | u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SSMCPPERR); + | ^~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c:1109:6: warning: Value stored to 'reg' during its initialization is never read [deadcode.DeadStores] + 1109 | u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SER_ERR_SSMSH); + | ^~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Fixes: 99b1c9826e48 ("crypto: qat - count QAT GEN4 errors") +Signed-off-by: Adam Guerin +Reviewed-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c b/drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c +index 048c246079390..2dd3772bf58a6 100644 +--- a/drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c ++++ b/drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c +@@ -1007,8 +1007,7 @@ static bool adf_handle_spppar_err(struct adf_accel_dev *accel_dev, + static bool adf_handle_ssmcpppar_err(struct adf_accel_dev *accel_dev, + void __iomem *csr, u32 iastatssm) + { +- u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SSMCPPERR); +- u32 bits_num = BITS_PER_REG(reg); ++ u32 reg, bits_num = BITS_PER_REG(reg); + bool reset_required = false; + unsigned long errs_bits; + u32 bit_iterator; +@@ -1106,8 +1105,7 @@ static bool adf_handle_rf_parr_err(struct adf_accel_dev *accel_dev, + static bool adf_handle_ser_err_ssmsh(struct adf_accel_dev *accel_dev, + void __iomem *csr, u32 iastatssm) + { +- u32 reg = ADF_CSR_RD(csr, ADF_GEN4_SER_ERR_SSMSH); +- u32 bits_num = BITS_PER_REG(reg); ++ u32 reg, bits_num = BITS_PER_REG(reg); + bool reset_required = false; + unsigned long errs_bits; + u32 bit_iterator; +-- +2.43.0 + diff --git a/queue-6.8/crypto-qat-remove-unused-macros-in-qat_comp_alg.c.patch b/queue-6.8/crypto-qat-remove-unused-macros-in-qat_comp_alg.c.patch new file mode 100644 index 00000000000..3b17116ecd1 --- /dev/null +++ b/queue-6.8/crypto-qat-remove-unused-macros-in-qat_comp_alg.c.patch @@ -0,0 +1,71 @@ +From 0cd0d04b6149a7ed511d19d7555960855898ed9d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 15:19:55 +0000 +Subject: crypto: qat - remove unused macros in qat_comp_alg.c + +From: Adam Guerin + +[ Upstream commit dfff0e35fa5dd84ae75052ba129b0219d83e46dc ] + +As a result of the removal of qat_zlib_deflate, some defines where not +removed. Remove them. + +This is to fix the following warning when compiling the QAT driver +using the clang compiler with CC=clang W=2: + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:21:9: warning: macro is not used [-Wunused-macros] + 21 | #define QAT_RFC_1950_CM_OFFSET 4 + | ^ + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:16:9: warning: macro is not used [-Wunused-macros] + 16 | #define QAT_RFC_1950_HDR_SIZE 2 + | ^ + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:17:9: warning: macro is not used [-Wunused-macros] + 17 | #define QAT_RFC_1950_FOOTER_SIZE 4 + | ^ + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:22:9: warning: macro is not used [-Wunused-macros] + 22 | #define QAT_RFC_1950_DICT_MASK 0x20 + | ^ + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:18:9: warning: macro is not used [-Wunused-macros] + 18 | #define QAT_RFC_1950_CM_DEFLATE 8 + | ^ + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:20:9: warning: macro is not used [-Wunused-macros] + 20 | #define QAT_RFC_1950_CM_MASK 0x0f + | ^ + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:23:9: warning: macro is not used [-Wunused-macros] + 23 | #define QAT_RFC_1950_COMP_HDR 0x785e + | ^ + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c:19:9: warning: macro is not used [-Wunused-macros] + 19 | #define QAT_RFC_1950_CM_DEFLATE_CINFO_32K 7 + | ^ + +Fixes: e9dd20e0e5f6 ("crypto: qat - Remove zlib-deflate") +Signed-off-by: Adam Guerin +Reviewed-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/intel/qat/qat_common/qat_comp_algs.c | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c b/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c +index bf8c0ee629175..2ba4aa22e0927 100644 +--- a/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c ++++ b/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c +@@ -13,15 +13,6 @@ + #include "qat_compression.h" + #include "qat_algs_send.h" + +-#define QAT_RFC_1950_HDR_SIZE 2 +-#define QAT_RFC_1950_FOOTER_SIZE 4 +-#define QAT_RFC_1950_CM_DEFLATE 8 +-#define QAT_RFC_1950_CM_DEFLATE_CINFO_32K 7 +-#define QAT_RFC_1950_CM_MASK 0x0f +-#define QAT_RFC_1950_CM_OFFSET 4 +-#define QAT_RFC_1950_DICT_MASK 0x20 +-#define QAT_RFC_1950_COMP_HDR 0x785e +- + static DEFINE_MUTEX(algs_lock); + static unsigned int active_devs; + +-- +2.43.0 + diff --git a/queue-6.8/crypto-qat-removed-unused-macro-in-adf_cnv_dbgfs.c.patch b/queue-6.8/crypto-qat-removed-unused-macro-in-adf_cnv_dbgfs.c.patch new file mode 100644 index 00000000000..2266a045553 --- /dev/null +++ b/queue-6.8/crypto-qat-removed-unused-macro-in-adf_cnv_dbgfs.c.patch @@ -0,0 +1,41 @@ +From 16640b8329ae5eccbe974d481597bcbbf11a1da4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Feb 2024 15:19:56 +0000 +Subject: crypto: qat - removed unused macro in adf_cnv_dbgfs.c + +From: Adam Guerin + +[ Upstream commit 9a5dcada14d5e027856a1bc38443e54111438da6 ] + +This macro was added but never used, remove it. + +This is to fix the following warning when compiling the QAT driver +using the clang compiler with CC=clang W=2: + drivers/crypto/intel/qat/qat_common/adf_cnv_dbgfs.c:19:9: warning: macro is not used [-Wunused-macros] + 19 | #define CNV_SLICE_ERR_MASK GENMASK(7, 0) + | ^ + +Fixes: d807f0240c71 ("crypto: qat - add cnv_errors debugfs file") +Signed-off-by: Adam Guerin +Reviewed-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/intel/qat/qat_common/adf_cnv_dbgfs.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/crypto/intel/qat/qat_common/adf_cnv_dbgfs.c b/drivers/crypto/intel/qat/qat_common/adf_cnv_dbgfs.c +index 07119c487da01..627953a72d478 100644 +--- a/drivers/crypto/intel/qat/qat_common/adf_cnv_dbgfs.c ++++ b/drivers/crypto/intel/qat/qat_common/adf_cnv_dbgfs.c +@@ -16,7 +16,6 @@ + + #define CNV_ERR_INFO_MASK GENMASK(11, 0) + #define CNV_ERR_TYPE_MASK GENMASK(15, 12) +-#define CNV_SLICE_ERR_MASK GENMASK(7, 0) + #define CNV_SLICE_ERR_SIGN_BIT_INDEX 7 + #define CNV_DELTA_ERR_SIGN_BIT_INDEX 11 + +-- +2.43.0 + diff --git a/queue-6.8/crypto-xilinx-call-finalize-with-bh-disabled.patch b/queue-6.8/crypto-xilinx-call-finalize-with-bh-disabled.patch new file mode 100644 index 00000000000..4ad129e85b3 --- /dev/null +++ b/queue-6.8/crypto-xilinx-call-finalize-with-bh-disabled.patch @@ -0,0 +1,72 @@ +From 613f589bc2523d5764cd390ac3cdc72dbcf383ad Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jan 2024 12:29:06 +0800 +Subject: crypto: xilinx - call finalize with bh disabled + +From: Quanyang Wang + +[ Upstream commit a853450bf4c752e664abab0b2fad395b7ad7701c ] + +When calling crypto_finalize_request, BH should be disabled to avoid +triggering the following calltrace: + + ------------[ cut here ]------------ + WARNING: CPU: 2 PID: 74 at crypto/crypto_engine.c:58 crypto_finalize_request+0xa0/0x118 + Modules linked in: cryptodev(O) + CPU: 2 PID: 74 Comm: firmware:zynqmp Tainted: G O 6.8.0-rc1-yocto-standard #323 + Hardware name: ZynqMP ZCU102 Rev1.0 (DT) + pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) + pc : crypto_finalize_request+0xa0/0x118 + lr : crypto_finalize_request+0x104/0x118 + sp : ffffffc085353ce0 + x29: ffffffc085353ce0 x28: 0000000000000000 x27: ffffff8808ea8688 + x26: ffffffc081715038 x25: 0000000000000000 x24: ffffff880100db00 + x23: ffffff880100da80 x22: 0000000000000000 x21: 0000000000000000 + x20: ffffff8805b14000 x19: ffffff880100da80 x18: 0000000000010450 + x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 + x14: 0000000000000003 x13: 0000000000000000 x12: ffffff880100dad0 + x11: 0000000000000000 x10: ffffffc0832dcd08 x9 : ffffffc0812416d8 + x8 : 00000000000001f4 x7 : ffffffc0830d2830 x6 : 0000000000000001 + x5 : ffffffc082091000 x4 : ffffffc082091658 x3 : 0000000000000000 + x2 : ffffffc7f9653000 x1 : 0000000000000000 x0 : ffffff8802d20000 + Call trace: + crypto_finalize_request+0xa0/0x118 + crypto_finalize_aead_request+0x18/0x30 + zynqmp_handle_aes_req+0xcc/0x388 + crypto_pump_work+0x168/0x2d8 + kthread_worker_fn+0xfc/0x3a0 + kthread+0x118/0x138 + ret_from_fork+0x10/0x20 + irq event stamp: 40 + hardirqs last enabled at (39): [] _raw_spin_unlock_irqrestore+0x70/0xb0 + hardirqs last disabled at (40): [] el1_dbg+0x28/0x90 + softirqs last enabled at (36): [] kernel_neon_begin+0x8c/0xf0 + softirqs last disabled at (34): [] kernel_neon_begin+0x60/0xf0 + ---[ end trace 0000000000000000 ]--- + +Fixes: 4d96f7d48131 ("crypto: xilinx - Add Xilinx AES driver") +Signed-off-by: Quanyang Wang +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/xilinx/zynqmp-aes-gcm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/crypto/xilinx/zynqmp-aes-gcm.c b/drivers/crypto/xilinx/zynqmp-aes-gcm.c +index 3c205324b22b6..e614057188409 100644 +--- a/drivers/crypto/xilinx/zynqmp-aes-gcm.c ++++ b/drivers/crypto/xilinx/zynqmp-aes-gcm.c +@@ -231,7 +231,10 @@ static int zynqmp_handle_aes_req(struct crypto_engine *engine, + err = zynqmp_aes_aead_cipher(areq); + } + ++ local_bh_disable(); + crypto_finalize_aead_request(engine, areq, err); ++ local_bh_enable(); ++ + return 0; + } + +-- +2.43.0 + diff --git a/queue-6.8/cxl-fix-the-incorrect-assignment-of-sslbis-entry-poi.patch b/queue-6.8/cxl-fix-the-incorrect-assignment-of-sslbis-entry-poi.patch new file mode 100644 index 00000000000..40d1904f7cd --- /dev/null +++ b/queue-6.8/cxl-fix-the-incorrect-assignment-of-sslbis-entry-poi.patch @@ -0,0 +1,112 @@ +From 96d125d11d0c61e3ce63257ca8a3dec50f28b3c5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 1 Mar 2024 14:09:48 -0700 +Subject: cxl: Fix the incorrect assignment of SSLBIS entry pointer initial + location + +From: Dave Jiang + +[ Upstream commit 99b52aac2d40203d0f6468325018f68e2c494c24 ] + +The 'entry' pointer in cdat_sslbis_handler() is set to header + +sizeof(common header). However, the math missed the addition of the SSLBIS +main header. It should be header + sizeof(common header) + sizeof(*sslbis). +Use a defined struct for all the SSLBIS parts in order to avoid pointer +math errors. + +The bug causes incorrect parsing of the SSLBIS table and introduces incorrect +performance values to the access_coordinates during the CXL access_coordinate +calculation path if there are CXL switches present in the topology. + +The issue was found during testing of new code being added to add additional +checks for invalid CDAT values during CXL access_coordinate calculation. The +testing was done on qemu with a CXL topology including a CXL switch. + +Fixes: 80aa780dda20 ("cxl: Add callback to parse the SSLBIS subtable from CDAT") +Signed-off-by: Dave Jiang +Reviewed-by: Jonathan Cameron +Reviewed-by: Fan Ni +Link: https://lore.kernel.org/r/20240301210948.1298075-1-dave.jiang@intel.com +Signed-off-by: Dan Williams +Signed-off-by: Sasha Levin +--- + drivers/cxl/core/cdat.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c +index 08fd0baea7a0e..0363ca434ef45 100644 +--- a/drivers/cxl/core/cdat.c ++++ b/drivers/cxl/core/cdat.c +@@ -389,36 +389,38 @@ EXPORT_SYMBOL_NS_GPL(cxl_endpoint_parse_cdat, CXL); + static int cdat_sslbis_handler(union acpi_subtable_headers *header, void *arg, + const unsigned long end) + { ++ struct acpi_cdat_sslbis_table { ++ struct acpi_cdat_header header; ++ struct acpi_cdat_sslbis sslbis_header; ++ struct acpi_cdat_sslbe entries[]; ++ } *tbl = (struct acpi_cdat_sslbis_table *)header; ++ int size = sizeof(header->cdat) + sizeof(tbl->sslbis_header); + struct acpi_cdat_sslbis *sslbis; +- int size = sizeof(header->cdat) + sizeof(*sslbis); + struct cxl_port *port = arg; + struct device *dev = &port->dev; +- struct acpi_cdat_sslbe *entry; + int remain, entries, i; + u16 len; + + len = le16_to_cpu((__force __le16)header->cdat.length); + remain = len - size; +- if (!remain || remain % sizeof(*entry) || ++ if (!remain || remain % sizeof(tbl->entries[0]) || + (unsigned long)header + len > end) { + dev_warn(dev, "Malformed SSLBIS table length: (%u)\n", len); + return -EINVAL; + } + +- /* Skip common header */ +- sslbis = (struct acpi_cdat_sslbis *)((unsigned long)header + +- sizeof(header->cdat)); +- ++ sslbis = &tbl->sslbis_header; + /* Unrecognized data type, we can skip */ + if (sslbis->data_type > ACPI_HMAT_WRITE_BANDWIDTH) + return 0; + +- entries = remain / sizeof(*entry); +- entry = (struct acpi_cdat_sslbe *)((unsigned long)header + sizeof(*sslbis)); ++ entries = remain / sizeof(tbl->entries[0]); ++ if (struct_size(tbl, entries, entries) != len) ++ return -EINVAL; + + for (i = 0; i < entries; i++) { +- u16 x = le16_to_cpu((__force __le16)entry->portx_id); +- u16 y = le16_to_cpu((__force __le16)entry->porty_id); ++ u16 x = le16_to_cpu((__force __le16)tbl->entries[i].portx_id); ++ u16 y = le16_to_cpu((__force __le16)tbl->entries[i].porty_id); + __le64 le_base; + __le16 le_val; + struct cxl_dport *dport; +@@ -448,8 +450,8 @@ static int cdat_sslbis_handler(union acpi_subtable_headers *header, void *arg, + break; + } + +- le_base = (__force __le64)sslbis->entry_base_unit; +- le_val = (__force __le16)entry->latency_or_bandwidth; ++ le_base = (__force __le64)tbl->sslbis_header.entry_base_unit; ++ le_val = (__force __le16)tbl->entries[i].latency_or_bandwidth; + + if (check_mul_overflow(le64_to_cpu(le_base), + le16_to_cpu(le_val), &val)) +@@ -462,8 +464,6 @@ static int cdat_sslbis_handler(union acpi_subtable_headers *header, void *arg, + sslbis->data_type, + val); + } +- +- entry++; + } + + return 0; +-- +2.43.0 + diff --git a/queue-6.8/devlink-fix-length-of-eswitch-inline-mode.patch b/queue-6.8/devlink-fix-length-of-eswitch-inline-mode.patch new file mode 100644 index 00000000000..a833601c342 --- /dev/null +++ b/queue-6.8/devlink-fix-length-of-eswitch-inline-mode.patch @@ -0,0 +1,58 @@ +From f0803e4ce0d884cb903aad8a370b9f30284d6eb1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 10 Mar 2024 18:45:47 +0200 +Subject: devlink: Fix length of eswitch inline-mode + +From: William Tu + +[ Upstream commit 8f4cd89bf10607de08231d6d91a73dd63336808e ] + +Set eswitch inline-mode to be u8, not u16. Otherwise, errors below + +$ devlink dev eswitch set pci/0000:08:00.0 mode switchdev \ + inline-mode network + Error: Attribute failed policy validation. + kernel answers: Numerical result out of rang + netlink: 'devlink': attribute type 26 has an invalid length. + +Fixes: f2f9dd164db0 ("netlink: specs: devlink: add the remaining command to generate complete split_ops") +Signed-off-by: William Tu +Reviewed-by: Jiri Pirko +Reviewed-by: Simon Horman +Link: https://lore.kernel.org/r/20240310164547.35219-1-witu@nvidia.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + Documentation/netlink/specs/devlink.yaml | 2 +- + net/devlink/netlink_gen.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml +index cf6eaa0da821b..09fbb4c03fc8d 100644 +--- a/Documentation/netlink/specs/devlink.yaml ++++ b/Documentation/netlink/specs/devlink.yaml +@@ -290,7 +290,7 @@ attribute-sets: + enum: eswitch-mode + - + name: eswitch-inline-mode +- type: u16 ++ type: u8 + enum: eswitch-inline-mode + - + name: dpipe-tables +diff --git a/net/devlink/netlink_gen.c b/net/devlink/netlink_gen.c +index c81cf2dd154f3..f9786d51f68f9 100644 +--- a/net/devlink/netlink_gen.c ++++ b/net/devlink/netlink_gen.c +@@ -198,7 +198,7 @@ static const struct nla_policy devlink_eswitch_set_nl_policy[DEVLINK_ATTR_ESWITC + [DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, }, + [DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, }, + [DEVLINK_ATTR_ESWITCH_MODE] = NLA_POLICY_MAX(NLA_U16, 1), +- [DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U16, 3), ++ [DEVLINK_ATTR_ESWITCH_INLINE_MODE] = NLA_POLICY_MAX(NLA_U8, 3), + [DEVLINK_ATTR_ESWITCH_ENCAP_MODE] = NLA_POLICY_MAX(NLA_U8, 1), + }; + +-- +2.43.0 + diff --git a/queue-6.8/dm-call-the-resume-method-on-internal-suspend.patch b/queue-6.8/dm-call-the-resume-method-on-internal-suspend.patch new file mode 100644 index 00000000000..ddbc8479c55 --- /dev/null +++ b/queue-6.8/dm-call-the-resume-method-on-internal-suspend.patch @@ -0,0 +1,123 @@ +From 2842d62307162235aeee176d3d467869a331c3ba Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 11 Mar 2024 15:06:39 +0100 +Subject: dm: call the resume method on internal suspend + +From: Mikulas Patocka + +[ Upstream commit 65e8fbde64520001abf1c8d0e573561b4746ef38 ] + +There is this reported crash when experimenting with the lvm2 testsuite. +The list corruption is caused by the fact that the postsuspend and resume +methods were not paired correctly; there were two consecutive calls to the +origin_postsuspend function. The second call attempts to remove the +"hash_list" entry from a list, while it was already removed by the first +call. + +Fix __dm_internal_resume so that it calls the preresume and resume +methods of the table's targets. + +If a preresume method of some target fails, we are in a tricky situation. +We can't return an error because dm_internal_resume isn't supposed to +return errors. We can't return success, because then the "resume" and +"postsuspend" methods would not be paired correctly. So, we set the +DMF_SUSPENDED flag and we fake normal suspend - it may confuse userspace +tools, but it won't cause a kernel crash. + +------------[ cut here ]------------ +kernel BUG at lib/list_debug.c:56! +invalid opcode: 0000 [#1] PREEMPT SMP +CPU: 1 PID: 8343 Comm: dmsetup Not tainted 6.8.0-rc6 #4 +Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 +RIP: 0010:__list_del_entry_valid_or_report+0x77/0xc0 + +RSP: 0018:ffff8881b831bcc0 EFLAGS: 00010282 +RAX: 000000000000004e RBX: ffff888143b6eb80 RCX: 0000000000000000 +RDX: 0000000000000001 RSI: ffffffff819053d0 RDI: 00000000ffffffff +RBP: ffff8881b83a3400 R08: 00000000fffeffff R09: 0000000000000058 +R10: 0000000000000000 R11: ffffffff81a24080 R12: 0000000000000001 +R13: ffff88814538e000 R14: ffff888143bc6dc0 R15: ffffffffa02e4bb0 +FS: 00000000f7c0f780(0000) GS:ffff8893f0a40000(0000) knlGS:0000000000000000 +CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 +CR2: 0000000057fb5000 CR3: 0000000143474000 CR4: 00000000000006b0 +Call Trace: + + ? die+0x2d/0x80 + ? do_trap+0xeb/0xf0 + ? __list_del_entry_valid_or_report+0x77/0xc0 + ? do_error_trap+0x60/0x80 + ? __list_del_entry_valid_or_report+0x77/0xc0 + ? exc_invalid_op+0x49/0x60 + ? __list_del_entry_valid_or_report+0x77/0xc0 + ? asm_exc_invalid_op+0x16/0x20 + ? table_deps+0x1b0/0x1b0 [dm_mod] + ? __list_del_entry_valid_or_report+0x77/0xc0 + origin_postsuspend+0x1a/0x50 [dm_snapshot] + dm_table_postsuspend_targets+0x34/0x50 [dm_mod] + dm_suspend+0xd8/0xf0 [dm_mod] + dev_suspend+0x1f2/0x2f0 [dm_mod] + ? table_deps+0x1b0/0x1b0 [dm_mod] + ctl_ioctl+0x300/0x5f0 [dm_mod] + dm_compat_ctl_ioctl+0x7/0x10 [dm_mod] + __x64_compat_sys_ioctl+0x104/0x170 + do_syscall_64+0x184/0x1b0 + entry_SYSCALL_64_after_hwframe+0x46/0x4e +RIP: 0033:0xf7e6aead + +---[ end trace 0000000000000000 ]--- + +Fixes: ffcc39364160 ("dm: enhance internal suspend and resume interface") +Signed-off-by: Mikulas Patocka +Signed-off-by: Mike Snitzer +Signed-off-by: Sasha Levin +--- + drivers/md/dm.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/drivers/md/dm.c b/drivers/md/dm.c +index 8dcabf84d866e..0dc3650c7f4ca 100644 +--- a/drivers/md/dm.c ++++ b/drivers/md/dm.c +@@ -2945,6 +2945,9 @@ static void __dm_internal_suspend(struct mapped_device *md, unsigned int suspend + + static void __dm_internal_resume(struct mapped_device *md) + { ++ int r; ++ struct dm_table *map; ++ + BUG_ON(!md->internal_suspend_count); + + if (--md->internal_suspend_count) +@@ -2953,12 +2956,23 @@ static void __dm_internal_resume(struct mapped_device *md) + if (dm_suspended_md(md)) + goto done; /* resume from nested suspend */ + +- /* +- * NOTE: existing callers don't need to call dm_table_resume_targets +- * (which may fail -- so best to avoid it for now by passing NULL map) +- */ +- (void) __dm_resume(md, NULL); +- ++ map = rcu_dereference_protected(md->map, lockdep_is_held(&md->suspend_lock)); ++ r = __dm_resume(md, map); ++ if (r) { ++ /* ++ * If a preresume method of some target failed, we are in a ++ * tricky situation. We can't return an error to the caller. We ++ * can't fake success because then the "resume" and ++ * "postsuspend" methods would not be paired correctly, and it ++ * would break various targets, for example it would cause list ++ * corruption in the "origin" target. ++ * ++ * So, we fake normal suspend here, to make sure that the ++ * "resume" and "postsuspend" methods will be paired correctly. ++ */ ++ DMERR("Preresume method failed: %d", r); ++ set_bit(DMF_SUSPENDED, &md->flags); ++ } + done: + clear_bit(DMF_SUSPENDED_INTERNALLY, &md->flags); + smp_mb__after_atomic(); +-- +2.43.0 + diff --git a/queue-6.8/dm-raid-fix-false-positive-for-requeue-needed-during.patch b/queue-6.8/dm-raid-fix-false-positive-for-requeue-needed-during.patch new file mode 100644 index 00000000000..8826e47c649 --- /dev/null +++ b/queue-6.8/dm-raid-fix-false-positive-for-requeue-needed-during.patch @@ -0,0 +1,46 @@ +From 43fb8b0d11a9824e4179eb1966a821cd276cecd8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 11 Mar 2024 13:42:55 -0400 +Subject: dm raid: fix false positive for requeue needed during reshape + +From: Ming Lei + +[ Upstream commit b25b8f4b8ecef0f48c05f0c3572daeabefe16526 ] + +An empty flush doesn't have a payload, so it should never be looked at +when considering to possibly requeue a bio for the case when a reshape +is in progress. + +Fixes: 9dbd1aa3a81c ("dm raid: add reshaping support to the target") +Reported-by: Patrick Plenefisch +Signed-off-by: Ming Lei +Signed-off-by: Mike Snitzer +Signed-off-by: Sasha Levin +--- + drivers/md/dm-raid.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c +index eb009d6bb03a1..13eb47b997f94 100644 +--- a/drivers/md/dm-raid.c ++++ b/drivers/md/dm-raid.c +@@ -3329,14 +3329,14 @@ static int raid_map(struct dm_target *ti, struct bio *bio) + struct mddev *mddev = &rs->md; + + /* +- * If we're reshaping to add disk(s)), ti->len and ++ * If we're reshaping to add disk(s), ti->len and + * mddev->array_sectors will differ during the process + * (ti->len > mddev->array_sectors), so we have to requeue + * bios with addresses > mddev->array_sectors here or + * there will occur accesses past EOD of the component + * data images thus erroring the raid set. + */ +- if (unlikely(bio_end_sector(bio) > mddev->array_sectors)) ++ if (unlikely(bio_has_data(bio) && bio_end_sector(bio) > mddev->array_sectors)) + return DM_MAPIO_REQUEUE; + + md_handle_request(mddev, bio); +-- +2.43.0 + diff --git a/queue-6.8/dmaengine-tegra210-adma-update-dependency-to-arch_te.patch b/queue-6.8/dmaengine-tegra210-adma-update-dependency-to-arch_te.patch new file mode 100644 index 00000000000..e1ddefa4663 --- /dev/null +++ b/queue-6.8/dmaengine-tegra210-adma-update-dependency-to-arch_te.patch @@ -0,0 +1,60 @@ +From c0c576e0b7fecf8f037dfa5fab8c32c0e8499824 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 12 Jan 2024 09:32:56 +0000 +Subject: dmaengine: tegra210-adma: Update dependency to ARCH_TEGRA + +From: Peter Robinson + +[ Upstream commit 33b7db45533af240fe44e809f9dc4d604cf82d07 ] + +Update the architecture dependency to be the generic Tegra +because the driver works on the four latest Tegra generations +not just T210, if you build a kernel with a specific +ARCH_TEGRA_xxx_SOC option that excludes 210 you don't get +this driver. + +Fixes: 433de642a76c9 ("dmaengine: tegra210-adma: add support for Tegra186/Tegra194") +Signed-off-by: Peter Robinson +Cc: Jon Hunter +Cc: Thierry Reding +Cc: Sameer Pujar +Cc: Laxman Dewangan +Reviewed-by: Jon Hunter +Link: https://lore.kernel.org/r/20240112093310.329642-2-pbrobinson@gmail.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/Kconfig | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig +index e928f2ca0f1e9..002a5ec806207 100644 +--- a/drivers/dma/Kconfig ++++ b/drivers/dma/Kconfig +@@ -643,16 +643,16 @@ config TEGRA20_APB_DMA + + config TEGRA210_ADMA + tristate "NVIDIA Tegra210 ADMA support" +- depends on (ARCH_TEGRA_210_SOC || COMPILE_TEST) ++ depends on (ARCH_TEGRA || COMPILE_TEST) + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + help +- Support for the NVIDIA Tegra210 ADMA controller driver. The +- DMA controller has multiple DMA channels and is used to service +- various audio clients in the Tegra210 audio processing engine +- (APE). This DMA controller transfers data from memory to +- peripheral and vice versa. It does not support memory to +- memory data transfer. ++ Support for the NVIDIA Tegra210/Tegra186/Tegra194/Tegra234 ADMA ++ controller driver. The DMA controller has multiple DMA channels ++ and is used to service various audio clients in the Tegra210 ++ audio processing engine (APE). This DMA controller transfers ++ data from memory to peripheral and vice versa. It does not ++ support memory to memory data transfer. + + config TIMB_DMA + tristate "Timberdale FPGA DMA support" +-- +2.43.0 + diff --git a/queue-6.8/do_sys_name_to_handle-use-kzalloc-to-fix-kernel-info.patch b/queue-6.8/do_sys_name_to_handle-use-kzalloc-to-fix-kernel-info.patch new file mode 100644 index 00000000000..2ffa8922fa2 --- /dev/null +++ b/queue-6.8/do_sys_name_to_handle-use-kzalloc-to-fix-kernel-info.patch @@ -0,0 +1,72 @@ +From 1abeb6f00936dad1cea929fc81affc9132d05504 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Jan 2024 07:39:06 -0800 +Subject: do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak + +From: Nikita Zhandarovich + +[ Upstream commit 3948abaa4e2be938ccdfc289385a27342fb13d43 ] + +syzbot identified a kernel information leak vulnerability in +do_sys_name_to_handle() and issued the following report [1]. + +[1] +"BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline] +BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x100 lib/usercopy.c:40 + instrument_copy_to_user include/linux/instrumented.h:114 [inline] + _copy_to_user+0xbc/0x100 lib/usercopy.c:40 + copy_to_user include/linux/uaccess.h:191 [inline] + do_sys_name_to_handle fs/fhandle.c:73 [inline] + __do_sys_name_to_handle_at fs/fhandle.c:112 [inline] + __se_sys_name_to_handle_at+0x949/0xb10 fs/fhandle.c:94 + __x64_sys_name_to_handle_at+0xe4/0x140 fs/fhandle.c:94 + ... + +Uninit was created at: + slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768 + slab_alloc_node mm/slub.c:3478 [inline] + __kmem_cache_alloc_node+0x5c9/0x970 mm/slub.c:3517 + __do_kmalloc_node mm/slab_common.c:1006 [inline] + __kmalloc+0x121/0x3c0 mm/slab_common.c:1020 + kmalloc include/linux/slab.h:604 [inline] + do_sys_name_to_handle fs/fhandle.c:39 [inline] + __do_sys_name_to_handle_at fs/fhandle.c:112 [inline] + __se_sys_name_to_handle_at+0x441/0xb10 fs/fhandle.c:94 + __x64_sys_name_to_handle_at+0xe4/0x140 fs/fhandle.c:94 + ... + +Bytes 18-19 of 20 are uninitialized +Memory access of size 20 starts at ffff888128a46380 +Data copied to user address 0000000020000240" + +Per Chuck Lever's suggestion, use kzalloc() instead of kmalloc() to +solve the problem. + +Fixes: 990d6c2d7aee ("vfs: Add name to file handle conversion support") +Suggested-by: Chuck Lever III +Reported-and-tested-by: +Signed-off-by: Nikita Zhandarovich +Link: https://lore.kernel.org/r/20240119153906.4367-1-n.zhandarovich@fintech.ru +Reviewed-by: Jan Kara +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + fs/fhandle.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/fhandle.c b/fs/fhandle.c +index 18b3ba8dc8ead..57a12614addfd 100644 +--- a/fs/fhandle.c ++++ b/fs/fhandle.c +@@ -36,7 +36,7 @@ static long do_sys_name_to_handle(const struct path *path, + if (f_handle.handle_bytes > MAX_HANDLE_SZ) + return -EINVAL; + +- handle = kmalloc(sizeof(struct file_handle) + f_handle.handle_bytes, ++ handle = kzalloc(sizeof(struct file_handle) + f_handle.handle_bytes, + GFP_KERNEL); + if (!handle) + return -ENOMEM; +-- +2.43.0 + diff --git a/queue-6.8/dpll-fix-dpll_xa_ref_-_del-for-multiple-registration.patch b/queue-6.8/dpll-fix-dpll_xa_ref_-_del-for-multiple-registration.patch new file mode 100644 index 00000000000..2a060cf04a0 --- /dev/null +++ b/queue-6.8/dpll-fix-dpll_xa_ref_-_del-for-multiple-registration.patch @@ -0,0 +1,63 @@ +From a8280457ffa4aa327593afb0164c09f90296b80e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Mar 2024 16:12:40 +0100 +Subject: dpll: fix dpll_xa_ref_*_del() for multiple registrations + +From: Jiri Pirko + +[ Upstream commit b446631f355ece73b13c311dd712c47381a23172 ] + +Currently, if there are multiple registrations of the same pin on the +same dpll device, following warnings are observed: +WARNING: CPU: 5 PID: 2212 at drivers/dpll/dpll_core.c:143 dpll_xa_ref_pin_del.isra.0+0x21e/0x230 +WARNING: CPU: 5 PID: 2212 at drivers/dpll/dpll_core.c:223 __dpll_pin_unregister+0x2b3/0x2c0 + +The problem is, that in both dpll_xa_ref_dpll_del() and +dpll_xa_ref_pin_del() registration is only removed from list in case the +reference count drops to zero. That is wrong, the registration has to +be removed always. + +To fix this, remove the registration from the list and free +it unconditionally, instead of doing it only when the ref reference +counter reaches zero. + +Fixes: 9431063ad323 ("dpll: core: Add DPLL framework base functions") +Signed-off-by: Jiri Pirko +Reviewed-by: Rahul Rameshbabu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/dpll/dpll_core.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c +index 7f686d179fc93..c751a87c7a8e6 100644 +--- a/drivers/dpll/dpll_core.c ++++ b/drivers/dpll/dpll_core.c +@@ -129,9 +129,9 @@ static int dpll_xa_ref_pin_del(struct xarray *xa_pins, struct dpll_pin *pin, + reg = dpll_pin_registration_find(ref, ops, priv); + if (WARN_ON(!reg)) + return -EINVAL; ++ list_del(®->list); ++ kfree(reg); + if (refcount_dec_and_test(&ref->refcount)) { +- list_del(®->list); +- kfree(reg); + xa_erase(xa_pins, i); + WARN_ON(!list_empty(&ref->registration_list)); + kfree(ref); +@@ -209,9 +209,9 @@ dpll_xa_ref_dpll_del(struct xarray *xa_dplls, struct dpll_device *dpll, + reg = dpll_pin_registration_find(ref, ops, priv); + if (WARN_ON(!reg)) + return; ++ list_del(®->list); ++ kfree(reg); + if (refcount_dec_and_test(&ref->refcount)) { +- list_del(®->list); +- kfree(reg); + xa_erase(xa_dplls, i); + WARN_ON(!list_empty(&ref->registration_list)); + kfree(ref); +-- +2.43.0 + diff --git a/queue-6.8/dpll-spec-use-proper-enum-for-pin-capabilities-attri.patch b/queue-6.8/dpll-spec-use-proper-enum-for-pin-capabilities-attri.patch new file mode 100644 index 00000000000..500c3c829de --- /dev/null +++ b/queue-6.8/dpll-spec-use-proper-enum-for-pin-capabilities-attri.patch @@ -0,0 +1,48 @@ +From 89be98beae594bcaf8a7c3c44708e160dd0c6817 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Mar 2024 13:07:39 +0100 +Subject: dpll: spec: use proper enum for pin capabilities attribute + +From: Jiri Pirko + +[ Upstream commit 5c497a64820ef9f10962a9c37607df45d6395fa5 ] + +The enum is defined, however the pin capabilities attribute does +refer to it. Add this missing enum field. + +This fixes ynl cli output: + +Example current output: +$ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml --do pin-get --json '{"id": 0}' +{'capabilities': 4, + ... +Example new output: +$ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml --do pin-get --json '{"id": 0}' +{'capabilities': {'state-can-change'}, + ... + +Fixes: 3badff3a25d8 ("dpll: spec: Add Netlink spec in YAML") +Signed-off-by: Jiri Pirko +Reviewed-by: Jakub Kicinski +Link: https://lore.kernel.org/r/20240306120739.1447621-1-jiri@resnulli.us +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + Documentation/netlink/specs/dpll.yaml | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Documentation/netlink/specs/dpll.yaml b/Documentation/netlink/specs/dpll.yaml +index 3dcc9ece272aa..d0c821c202036 100644 +--- a/Documentation/netlink/specs/dpll.yaml ++++ b/Documentation/netlink/specs/dpll.yaml +@@ -274,6 +274,7 @@ attribute-sets: + - + name: capabilities + type: u32 ++ enum: pin-capabilities + - + name: parent-device + type: nest +-- +2.43.0 + diff --git a/queue-6.8/drivers-ps3-select-video-to-provide-cmdline-function.patch b/queue-6.8/drivers-ps3-select-video-to-provide-cmdline-function.patch new file mode 100644 index 00000000000..4b5dc243fe6 --- /dev/null +++ b/queue-6.8/drivers-ps3-select-video-to-provide-cmdline-function.patch @@ -0,0 +1,52 @@ +From 2e7739c5f8c1400d12af27575226ec5649a070df Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Feb 2024 08:13:22 -0800 +Subject: drivers/ps3: select VIDEO to provide cmdline functions + +From: Randy Dunlap + +[ Upstream commit 7edd06233958d9086a9e3eb723a8768d3c5a9ce1 ] + +When VIDEO is not set, there is a build error. Fix that by selecting +VIDEO for PS3_PS3AV. + +ERROR: modpost: ".video_get_options" [drivers/ps3/ps3av_mod.ko] undefined! + +Fixes: dae7fbf43fd0 ("driver/ps3: Include