media: Revert "media: rkisp1: Drop IRQF_SHARED"
Subsystems (13)
Sasha Levin
maintainerPATCH 1/26 media: Revert "media: rkisp1: Drop IRQF_SHARED"
From: Tomi Valkeinen <[email protected]>
[ Upstream commit a107d643b2a3382e0a2d2c4ef08bf8c6bff4561d ]
This reverts commit 85d2a31fe4d9be1555f621ead7a520d8791e0f74.
The rkisp1 does share interrupt lines on some platforms, after all. Thus we need to revert this, and implement a fix for the rkisp1 shared irq handling in a follow-up patch.
--- drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +1 -1
@@ -559,7 +559,7 @@ static int rkisp1_probe(struct platform_device *pdev) rkisp1->irqs[il] = irq; } - ret =devm_request_irq (dev, irq, info->isrs[i].isr,0 , + ret =devm_request_irq (dev, irq, info->isrs[i].isr,IRQF_SHARED ,dev_driver_string (dev), dev);if (ret) {dev_err (dev,"request irq failed: %d\n" , ret);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/26 media: rkisp1: Fix IRQ handling due to shared interrupts
From: Tomi Valkeinen <[email protected]>
[ Upstream commit ffb635bb398fc07cb38f8a7b4a82cbe5f412f08e ]
The driver requests the interrupts as IRQF_SHARED, so the interrupt handlers can be called at any time. If such a call happens while the ISP is powered down, the SoC will hang as the driver tries to access the ISP registers.
This can be reproduced even without the platform sharing the IRQ line:
Enable CONFIG_DEBUG_SHIRQ and unload the driver, and the board will hang.
Fix this by adding a new field, 'irqs_enabled', which is used to bail out from the interrupt handler when the ISP is not operational.
--- .../platform/rockchip/rkisp1/rkisp1-capture.c | 3 +++ .../platform/rockchip/rkisp1/rkisp1-common.h | 2 ++ .../platform/rockchip/rkisp1/rkisp1-csi.c | 3 +++ .../platform/rockchip/rkisp1/rkisp1-dev.c | 22 +++++++++++++++++++ .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 +++ 5 files changed, 33 insertions(+)
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +3 -0
@@ -725,6 +725,9 @@ irqreturn_t rkisp1_capture_isr(int irq, void *ctx)unsigned int i;u32 status; +if (!rkisp1->irqs_enabled) +return IRQ_NONE ; + status =rkisp1_read (rkisp1,RKISP1_CIF_MI_MIS );if (!status)return IRQ_NONE ;
drivers/media/platform/rockchip/rkisp1/rkisp1-common.h +2 -0
@@ -449,6 +449,7 @@ struct rkisp1_debug {* @debug: debug params to be exposed on debugfs * @info: version-specific ISP information * @irqs: IRQ line numbers +* @irqs_enabled: the hardware is enabled and can cause interrupts */ struct rkisp1_device {void __iomem *base_addr;
@@ -470,6 +471,7 @@ struct rkisp1_device {struct rkisp1_debug debug;const struct rkisp1_info *info;int irqs[RKISP1_NUM_IRQS ]; +bool irqs_enabled; };/*
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c +3 -0
@@ -196,6 +196,9 @@ irqreturn_t rkisp1_csi_isr(int irq, void *ctx)struct rkisp1_device *rkisp1 =dev_get_drvdata (dev);u32 val, status; +if (!rkisp1->irqs_enabled) +return IRQ_NONE ; + status =rkisp1_read (rkisp1,RKISP1_CIF_MIPI_MIS );if (!status)return IRQ_NONE ;
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +22 -0
@@ -305,6 +305,24 @@ static int __maybe_unused rkisp1_runtime_suspend(struct device *dev) {struct rkisp1_device *rkisp1 =dev_get_drvdata (dev); + rkisp1->irqs_enabled = false; +/* Make sure the IRQ handler will see the above */ +mb (); + +/* +* Wait until any running IRQ handler has returned. The IRQ handler +* may get called even after this (as it's a shared interrupt line) +* but the 'irqs_enabled' flag will make the handler return immediately. +*/ +for (unsigned int il =0 ; il <ARRAY_SIZE (rkisp1->irqs); ++il) { +if (rkisp1->irqs[il] ==-1 ) +continue ; + +/* Skip if the irq line is the same as previous */ +if (il ==0 || rkisp1->irqs[il -1 ] != rkisp1->irqs[il]) +synchronize_irq (rkisp1->irqs[il]); + } +clk_bulk_disable_unprepare (rkisp1->clk_size, rkisp1->clks);return pinctrl_pm_select_sleep_state (dev); }
@@ -321,6 +339,10 @@ static int __maybe_unused rkisp1_runtime_resume(struct device *dev)if (ret)return ret; + rkisp1->irqs_enabled = true; +/* Make sure the IRQ handler will see the above */ +mb (); +return 0 ; }
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +3 -0
@@ -971,6 +971,9 @@ irqreturn_t rkisp1_isp_isr(int irq, void *ctx)struct rkisp1_device *rkisp1 =dev_get_drvdata (dev);u32 status, isp_err; +if (!rkisp1->irqs_enabled) +return IRQ_NONE ; + status =rkisp1_read (rkisp1,RKISP1_CIF_ISP_MIS );if (!status)return IRQ_NONE ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/26 Revert "drm/msm/gpu: Push gpu lock down past runpm"
In reply to Sasha LevinFrom: Rob Clark <[email protected]>
[ Upstream commit 917e9b7c2350e3e53162fcf5035e5f2d68e2cbed ]
This reverts commit abe2023b4cea192ab266b351fd38dc9dbd846df0.
Changing the locking order means that scheduler/msm_job_run() can race with the recovery kthread worker, with the result that the GPU gets an extra runpm get when we are trying to power it off. Leaving the GPU in an unrecovered state.
I'll need to come up with a different scheme for appeasing lockdep.
Patchwork: https://patchwork.freedesktop.org/patch/573835/
--- drivers/gpu/drm/msm/msm_gpu.c | 11 +++++------ drivers/gpu/drm/msm/msm_ringbuffer.c | 7 +++++-- 2 files changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/msm/msm_gpu.c +5 -6
@@ -749,12 +749,14 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)struct msm_ringbuffer *ring = submit->ring;unsigned long flags; -pm_runtime_get_sync (&gpu->pdev->dev); +WARN_ON (!mutex_is_locked (&gpu->lock)); -mutex_lock (&gpu->lock); +pm_runtime_get_sync (&gpu->pdev->dev);msm_gpu_hw_init (gpu); + submit->seqno = submit->hw_fence->seqno; +update_sw_cntrs (gpu);/*
@@ -779,11 +781,8 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) gpu->funcs->submit (gpu, submit); gpu->cur_ctx_seqno = submit->queue->ctx->seqno; -hangcheck_timer_reset (gpu); - -mutex_unlock (&gpu->lock); -pm_runtime_put (&gpu->pdev->dev); +hangcheck_timer_reset (gpu); }/*
drivers/gpu/drm/msm/msm_ringbuffer.c +5 -2
@@ -21,8 +21,6 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)msm_fence_init (submit->hw_fence, fctx); - submit->seqno = submit->hw_fence->seqno; -mutex_lock (&priv->lru.lock);for (i =0 ; i < submit->nr_bos; i++) {
@@ -34,8 +32,13 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)mutex_unlock (&priv->lru.lock); +/* TODO move submit path over to using a per-ring lock.. */ +mutex_lock (&gpu->lock); +msm_gpu_submit (gpu, submit); +mutex_unlock (&gpu->lock); +return dma_fence_get (submit->hw_fence); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/26 HID: logitech-hidpp: Do not flood kernel log
In reply to Sasha LevinFrom: Oleksandr Natalenko <[email protected]>
[ Upstream commit 411a20db905b44e18cc9129b745f1d5deba4eae5 ]
Since commit 680ee411a98e ("HID: logitech-hidpp: Fix connect event race") the following messages appear in the kernel log from time to time:
logitech-hidpp-device 0003:046D:408A.0005: HID++ 4.5 device connected. logitech-hidpp-device 0003:046D:408A.0005: HID++ 4.5 device connected. logitech-hidpp-device 0003:046D:4051.0006: Disconnected logitech-hidpp-device 0003:046D:408A.0005: Disconnected
As discussed, print the first per-device "device connected" message at info level, demoting subsequent messages to debug level. Also, demote the "Disconnected message" to debug level unconditionally.
--- drivers/hid/hid-logitech-hidpp.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/hid/hid-logitech-hidpp.c +10 -3
@@ -203,6 +203,8 @@ struct hidpp_device {struct hidpp_scroll_counter vertical_wheel_counter;u8 wireless_feature_index; + +bool connected_once; };/* HID++ 1.0 error codes */
@@ -988,8 +990,13 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp) hidpp->protocol_minor = response.rap.params[1 ]; print_version: -hid_info (hidpp->hid_dev,"HID++ %u.%u device connected.\n" , - hidpp->protocol_major, hidpp->protocol_minor); +if (!hidpp->connected_once) { +hid_info (hidpp->hid_dev,"HID++ %u.%u device connected.\n" , + hidpp->protocol_major, hidpp->protocol_minor); + hidpp->connected_once = true; + }else +hid_dbg (hidpp->hid_dev,"HID++ %u.%u device connected.\n" , + hidpp->protocol_major, hidpp->protocol_minor);return 0 ; }
@@ -4184,7 +4191,7 @@ static void hidpp_connect_event(struct work_struct *work)/* Get device version to check if it is connected */ ret =hidpp_root_get_protocol_version (hidpp);if (ret) { -hid_info (hidpp->hid_dev,"Disconnected\n" ); +hid_dbg (hidpp->hid_dev,"Disconnected\n" );if (hidpp->battery.ps) { hidpp->battery.online = false; hidpp->battery.status =POWER_SUPPLY_STATUS_UNKNOWN ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/26 ASoC: cs42l43: Handle error from devm_pm_runtime_enable
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit d1722057477a3786b8c0d60c28fc281f6ecf1cc3 ]
As devm_pm_runtime_enable can fail due to memory allocations, it is best to handle the error.
--- sound/soc/codecs/cs42l43.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/cs42l43.c +4 -1
@@ -2175,7 +2175,10 @@ static int cs42l43_codec_probe(struct platform_device *pdev)pm_runtime_use_autosuspend (priv->dev);pm_runtime_set_active (priv->dev);pm_runtime_get_noresume (priv->dev); -devm_pm_runtime_enable (priv->dev); + + ret =devm_pm_runtime_enable (priv->dev); +if (ret) + goto err_pm;for (i =0 ; i <ARRAY_SIZE (cs42l43_irqs); i++) { ret = cs42l43_request_irq(priv, dom, cs42l43_irqs[i].name,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 6/26 wifi: iwlwifi: mvm: use correct address 3 in A-MSDU
In reply to Sasha LevinFrom: Daniel Gabay <[email protected]>
[ Upstream commit 2e57b77583ca34fdb6e14f253172636c52f81cf2 ]
As described in IEEE sta 802.11-2020, table 9-30 (Address field contents), A-MSDU address 3 should contain the BSSID address.
In TX_CMD we copy the MAC header from skb, and skb address 3 holds the destination address, but it may not be identical to the BSSID.
Using the wrong destination address appears to work with (most) receivers without MLO, but in MLO some devices are checking for it carefully, perhaps as a consequence of link to MLD address translation.
Replace address 3 in the TX_CMD MAC header with the correct address while retaining the skb address 3 unchanged. This ensures that skb address 3 will be utilized later for constructing the A-MSDU subframes.
Note that we fill in the MLD address, but the firmware will do the necessary translation to link address after encryption.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 69 ++++++++++++++++++--- 1 file changed, 59 insertions(+), 10 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +59 -10
@@ -520,13 +520,24 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm, } } +static void iwl_mvm_copy_hdr (void *cmd,const void *hdr,int hdrlen, +const u8 *addr3_override) +{ +struct ieee80211_hdr *out_hdr = cmd; + +memcpy (cmd, hdr, hdrlen); +if (addr3_override) +memcpy (out_hdr->addr3, addr3_override,ETH_ALEN ); +} +/* * Allocates and sets the Tx cmd the driver data pointers in the skb */ static struct iwl_device_tx_cmd *iwl_mvm_set_tx_params (struct iwl_mvm *mvm,struct sk_buff *skb,struct ieee80211_tx_info *info,int hdrlen, -struct ieee80211_sta *sta,u8 sta_id) +struct ieee80211_sta *sta,u8 sta_id, +const u8 *addr3_override) {struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;struct iwl_device_tx_cmd *dev_cmd;
@@ -584,7 +595,7 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb, cmd->len =cpu_to_le16 ((u16 )skb->len);/* Copy MAC header from skb into command buffer */ -memcpy (cmd->hdr, hdr, hdrlen); +iwl_mvm_copy_hdr (cmd->hdr, hdr, hdrlen, addr3_override); cmd->flags =cpu_to_le16 (flags); cmd->rate_n_flags =cpu_to_le32 (rate_n_flags);
@@ -599,7 +610,7 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb, cmd->len =cpu_to_le16 ((u16 )skb->len);/* Copy MAC header from skb into command buffer */ -memcpy (cmd->hdr, hdr, hdrlen); +iwl_mvm_copy_hdr (cmd->hdr, hdr, hdrlen, addr3_override); cmd->flags =cpu_to_le32 (flags); cmd->rate_n_flags =cpu_to_le32 (rate_n_flags);
@@ -617,7 +628,7 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,iwl_mvm_set_tx_cmd_rate (mvm, tx_cmd, info, sta, hdr->frame_control);/* Copy MAC header from skb into command buffer */ -memcpy (tx_cmd->hdr, hdr, hdrlen); +iwl_mvm_copy_hdr (tx_cmd->hdr, hdr, hdrlen, addr3_override); out:return dev_cmd;
@@ -820,7 +831,8 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)IWL_DEBUG_TX (mvm,"station Id %d, queue=%d\n" , sta_id, queue); - dev_cmd =iwl_mvm_set_tx_params (mvm, skb, &info, hdrlen,NULL , sta_id); + dev_cmd =iwl_mvm_set_tx_params (mvm, skb, &info, hdrlen,NULL , sta_id, +NULL );if (!dev_cmd)return -1 ;
@@ -1140,7 +1152,8 @@ static int iwl_mvm_tx_pkt_queued(struct iwl_mvm *mvm,*/ static int iwl_mvm_tx_mpdu (struct iwl_mvm *mvm,struct sk_buff *skb,struct ieee80211_tx_info *info, -struct ieee80211_sta *sta) +struct ieee80211_sta *sta, +const u8 *addr3_override) {struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;struct iwl_mvm_sta *mvmsta;
@@ -1172,7 +1185,8 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,iwl_mvm_probe_resp_set_noa (mvm, skb); dev_cmd =iwl_mvm_set_tx_params (mvm, skb, info, hdrlen, - sta, mvmsta->deflink.sta_id); + sta, mvmsta->deflink.sta_id, + addr3_override);if (!dev_cmd) goto drop;
@@ -1294,9 +1308,11 @@ int iwl_mvm_tx_skb_sta(struct iwl_mvm *mvm, struct sk_buff *skb,struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta);struct ieee80211_tx_info info;struct sk_buff_head mpdus_skbs; +struct ieee80211_vif *vif;unsigned int payload_len;int ret;struct sk_buff *orig_skb = skb; +const u8 *addr3;if (WARN_ON_ONCE (!mvmsta))return -1 ;
@@ -1307,26 +1323,59 @@ int iwl_mvm_tx_skb_sta(struct iwl_mvm *mvm, struct sk_buff *skb,memcpy (&info, skb->cb,sizeof (info));if (!skb_is_gso (skb)) -return iwl_mvm_tx_mpdu (mvm, skb, &info, sta); +return iwl_mvm_tx_mpdu (mvm, skb, &info, sta,NULL ); payload_len =skb_tail_pointer (skb) -skb_transport_header (skb) -tcp_hdrlen (skb) + skb->data_len;if (payload_len <=skb_shinfo (skb)->gso_size) -return iwl_mvm_tx_mpdu (mvm, skb, &info, sta); +return iwl_mvm_tx_mpdu (mvm, skb, &info, sta,NULL );__skb_queue_head_init (&mpdus_skbs); + vif = info.control.vif; +if (!vif) +return -1 ; + ret =iwl_mvm_tx_tso (mvm, skb, &info, sta, &mpdus_skbs);if (ret)return ret;WARN_ON (skb_queue_empty (&mpdus_skbs)); +/* +* As described in IEEE sta 802.11-2020, table 9-30 (Address +* field contents), A-MSDU address 3 should contain the BSSID +* address. +* Pass address 3 down to iwl_mvm_tx_mpdu() and further to set it +* in the command header. We need to preserve the original +* address 3 in the skb header to correctly create all the +* A-MSDU subframe headers from it. +*/ +switch (vif->type) { +case NL80211_IFTYPE_STATION : + addr3 = vif->cfg.ap_addr; +break ; +case NL80211_IFTYPE_AP : + addr3 = vif->addr; +break ; +default : + addr3 =NULL ; +break ; + } +while (!skb_queue_empty (&mpdus_skbs)) { +struct ieee80211_hdr *hdr; +bool amsdu; + skb =__skb_dequeue (&mpdus_skbs); + hdr = (void *)skb->data; + amsdu =ieee80211_is_data_qos (hdr->frame_control) && + (*ieee80211_get_qos_ctl (hdr) & +IEEE80211_QOS_CTL_A_MSDU_PRESENT ); - ret =iwl_mvm_tx_mpdu (mvm, skb, &info, sta); + ret =iwl_mvm_tx_mpdu (mvm, skb, &info, sta, + amsdu ? addr3 :NULL );if (ret) {/* Free skbs created as part of TSO logic that have not yet been dequeued */ __skb_queue_purge (&mpdus_skbs);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/26 arm64: jump_label: use constraints "Si" instead of "i"
In reply to Sasha LevinFrom: Fangrui Song <[email protected]>
[ Upstream commit f9daab0ad01cf9d165dbbbf106ca4e61d06e7fe8 ]
The generic constraint "i" seems to be copied from x86 or arm (and with a redundant generic operand modifier "c"). It works with -fno-PIE but not with -fPIE/-fPIC in GCC's aarch64 port.
The machine constraint "S", which denotes a symbol or label reference with a constant offset, supports PIC and has been available in GCC since 2012 and in Clang since 7.0. However, Clang before 19 does not support "S" on a symbol with a constant offset [1] (e.g. static_key_false(&nf_hooks_needed[pf][hook]) in include/linux/netfilter.h), so we use "i" as a fallback.
--- arch/arm64/include/asm/jump_label.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
arch/arm64/include/asm/jump_label.h +8 -4
@@ -15,6 +15,10 @@#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE +/* +* Prefer the constraint "S" to support PIC with GCC. Clang before 19 does not +* support "S" on a symbol with a constant offset, so we use "i" as a fallback. +*/ static __always_inline bool arch_static_branch(struct static_key * const key,const bool branch) {
@@ -23,9 +27,9 @@ static __always_inline bool arch_static_branch(struct static_key * const key," .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" " .long 1b - ., %l[l_yes] - . \n\t" - " .quad %c0 - . \n\t" +" .quad (%[key] - .) + %[bit0] \n\t" " .popsection \n\t" - : : "i"(&((char *)key)[branch]) : : l_yes); + : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);return false; l_yes:
@@ -40,9 +44,9 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const ke" .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" " .long 1b - ., %l[l_yes] - . \n\t" - " .quad %c0 - . \n\t" +" .quad (%[key] - .) + %[bit0] \n\t" " .popsection \n\t" - : : "i"(&((char *)key)[branch]) : : l_yes); + : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);return false; l_yes:
Signature · 1 line
2.43.0
Re: [PATCH AUTOSEL 6.7 07/26] arm64: jump_label: use constraints "Si" instead of "i"
Quoted 3 lines · Sasha Levin
From: Fangrui Song <[email protected]>
[ Upstream commit
f9daab0ad01cf9d165dbbbf106ca4e61d06e7fe8]
That upstream patch caused issues and was subsequently reverted in commit:
a6b3eb304a82c29665a0ab947cfe276f6d29f523
("Revert "arm64: jump_label: use constraints "Si" instead of "i""")
Please drop this; it'll break stable in the same way, and it wasn't necessary to backport in the first place.
As an aside, that revert has been upstream since v6.8-rc4, ~2.5 weeks ago; it's unfortunate for the broken patch to be AUTOSEL'd now! It'd be good if something could automatically check for reverts in mainline...
Mark.
Quoted 64 lines
The generic constraint "i" seems to be copied from x86 or arm (and with a redundant generic operand modifier "c"). It works with -fno-PIE but not with -fPIE/-fPIC in GCC's aarch64 port.
The machine constraint "S", which denotes a symbol or label reference with a constant offset, supports PIC and has been available in GCC since 2012 and in Clang since 7.0. However, Clang before 19 does not support "S" on a symbol with a constant offset [1] (e.g.
static_key_false(&nf_hooks_needed[pf][hook])ininclude/linux/netfilter.h), so we use "i" as a fallback.Suggested-by Ard Biesheuvel <[email protected]>Signed-off-by Fangrui Song <[email protected]>Acked-by Mark Rutland <[email protected]>Signed-off-by Will Deacon <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- arch/arm64/include/asm/jump_label.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)arch/arm64/include/asm/jump_label.h +8
-4@@ -15,6 +15,10 @@#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE +/* +* Prefer the constraint "S" to support PIC with GCC. Clang before 19 does not +* support "S" on a symbol with a constant offset, so we use "i" as a fallback. +*/ static __always_inline bool arch_static_branch(struct static_key * const key,const bool branch) {@@ -23,9 +27,9 @@ static __always_inline bool arch_static_branch(struct static_key * const key," .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" " .long 1b - ., %l[l_yes] - . \n\t" - " .quad %c0 - . \n\t" +" .quad (%[key] - .) + %[bit0] \n\t" " .popsection \n\t" - : : "i"(&((char *)key)[branch]) : : l_yes); + : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);return false; l_yes:@@ -40,9 +44,9 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const ke" .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" " .long 1b - ., %l[l_yes] - . \n\t" - " .quad %c0 - . \n\t" +" .quad (%[key] - .) + %[bit0] \n\t" " .popsection \n\t" - : : "i"(&((char *)key)[branch]) : : l_yes); + : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);return false; l_yes:Signature · 1 line
2.43.0
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.7 07/26] arm64: jump_label: use constraints "Si" instead of "i"
Quoted 5 lines · Mark Rutland
Quoted 3 lines · Sasha Levin
From: Fangrui Song <[email protected]>
[ Upstream commit
f9daab0ad01cf9d165dbbbf106ca4e61d06e7fe8]
Quoted 7 lines
That upstream patch caused issues and was subsequently reverted in commit:
a6b3eb304a82c29665a0ab947cfe276f6d29f523
("Revert "arm64:jump_label: use constraints "Si" instead of "i""")Please drop this; it'll break stable in the same way, and it wasn't necessary to backport in the first place.
Will do.
Quoted 3 lines
As an aside, that revert has been upstream since v6.8-rc4, ~2.5 weeks ago; it's unfortunate for the broken patch to be AUTOSEL'd now! It'd be good if something could automatically check for reverts in mainline...
Sorry for the noise - usually the fixes/revert check happens before commits actually end up in the queue.
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 8/26 perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count)
In reply to Sasha LevinFrom: Ilkka Koskinen <[email protected]>
[ Upstream commit 50572064ec7109b00eef8880e905f55861c8b3de ]
AmpereOneX mesh implementation has a bug in HN-P nodes that makes them report incorrect child count. The failing crosspoints report 8 children while they only have two.
When the driver tries to access the inexistent child nodes, it believes it has reached an invalid node type and probing fails. The workaround is to ignore those incorrect child nodes and continue normally.
--- drivers/perf/arm-cmn.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/perf/arm-cmn.c +11 -0
@@ -2305,6 +2305,17 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)dev_dbg (cmn->dev,"ignoring external node %llx\n" , reg);continue ; } +/* +* AmpereOneX erratum AC04_MESH_1 makes some XPs report a bogus +* child count larger than the number of valid child pointers. +* A child offset of 0 can only occur on CMN-600; otherwise it +* would imply the root node being its own grandchild, which +* we can safely dismiss in general. +*/ +if (reg ==0 && cmn->part !=PART_CMN600 ) { +dev_dbg (cmn->dev,"bogus child pointer?\n" ); +continue ; + }arm_cmn_init_node_info (cmn, reg &CMN_CHILD_NODE_ADDR , dn);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/26 btrfs: add and use helper to check if block group is used
In reply to Sasha LevinFrom: Filipe Manana <[email protected]>
[ Upstream commit 1693d5442c458ae8d5b0d58463b873cd879569ed ]
Add a helper function to determine if a block group is being used and make use of it at btrfs_delete_unused_bgs(). This helper will also be used in future code changes.
--- fs/btrfs/block-group.c | 3 +-- fs/btrfs/block-group.h | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
fs/btrfs/block-group.c +1 -2
@@ -1524,8 +1524,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) }spin_lock (&block_group->lock); -if (block_group->reserved || block_group->pinned || - block_group->used || block_group->ro || +if (btrfs_is_block_group_used (block_group) || block_group->ro ||list_is_singular (&block_group->list)) {/* * We want to bail if we made new allocations or have
fs/btrfs/block-group.h +7 -0
@@ -255,6 +255,13 @@ static inline u64 btrfs_block_group_end(struct btrfs_block_group *block_group)return (block_group->start + block_group->length); } +static inline bool btrfs_is_block_group_used (const struct btrfs_block_group *bg) +{ +lockdep_assert_held (&bg->lock); + +return (bg->used >0 || bg->reserved >0 || bg->pinned >0 ); +} +static inline bool btrfs_is_block_group_data_only (struct btrfs_block_group *block_group) {
Signature · 1 line
2.43.0
Re: [PATCH AUTOSEL 6.7 09/26] btrfs: add and use helper to check if block group is used
Quoted 7 lines · Sasha Levin
From: Filipe Manana <[email protected]>
[ Upstream commit
1693d5442c458ae8d5b0d58463b873cd879569ed]Add a helper function to determine if a block group is being used and make use of it at
btrfs_delete_unused_bgs(). This helper will also be used in future code changes.
The patch is not a prerequisite for any other stable patch, right? Then please drop if from all versions, it's a simple cleanup.
Sasha Levin
maintainerPATCH 10/26 selftests: openvswitch: Add validation for the recursion test
In reply to Sasha LevinFrom: Aaron Conole <[email protected]>
[ Upstream commit bd128f62c365504e1268dc09fcccdfb1f091e93a ]
Add a test case into the netlink checks that will show the number of nested action recursions won't exceed 16. Going to 17 on a small clone call isn't enough to exhaust the stack on (most) systems, so it should be safe to run even on systems that don't have the fix applied.
--- .../selftests/net/openvswitch/openvswitch.sh | 13 ++++ .../selftests/net/openvswitch/ovs-dpctl.py | 71 +++++++++++++++---- 2 files changed, 69 insertions(+), 15 deletions(-)
tools/testing/selftests/net/openvswitch/openvswitch.sh +13 -0
@@ -502,7 +502,20 @@ test_netlink_checks () { wc -l) == 2 ] || \ return 1 + info "Checking clone depth" ERR_MSG="Flow actions may not be safe on all matching packets" + PRE_TEST=$(dmesg | grep -c "${ERR_MSG}") + ovs_add_flow "test_netlink_checks" nv0 \ + 'in_port(1),eth(),eth_type(0x800),ipv4()' \ + 'clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(drop)))))))))))))))))' \ + >/dev/null 2>&1 && return 1 + POST_TEST=$(dmesg | grep -c "${ERR_MSG}") + + if [ "$PRE_TEST" == "$POST_TEST" ]; then + info "failed - clone depth too large" + return 1 + fi + PRE_TEST=$(dmesg | grep -c "${ERR_MSG}") ovs_add_flow "test_netlink_checks" nv0 \ 'in_port(1),eth(),eth_type(0x0806),arp()' 'drop(0),2' \
tools/testing/selftests/net/openvswitch/ovs-dpctl.py +56 -15
137 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 11/26 net: tls: factor out tls_*crypt_async_wait()
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit c57ca512f3b68ddcd62bda9cc24a8f5584ab01b1 ]
Factor out waiting for async encrypt and decrypt to finish. There are already multiple copies and a subsequent fix will need more. No functional changes.
Note that crypto_wait_req() returns wait->err
--- net/tls/tls_sw.c | 96 +++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 51 deletions(-)
net/tls/tls_sw.c +45 -51
@@ -230,6 +230,20 @@ static void tls_decrypt_done(void *data, int err)spin_unlock_bh (&ctx->decrypt_compl_lock); } +static int tls_decrypt_async_wait (struct tls_sw_context_rx *ctx) +{ +int pending; + +spin_lock_bh (&ctx->decrypt_compl_lock); +reinit_completion (&ctx->async_wait.completion); + pending =atomic_read (&ctx->decrypt_pending); +spin_unlock_bh (&ctx->decrypt_compl_lock); +if (pending) +crypto_wait_req (-EINPROGRESS , &ctx->async_wait); + +return ctx->async_wait.err; +} + static int tls_do_decryption(struct sock *sk, struct scatterlist *sgin, struct scatterlist *sgout,
@@ -495,6 +509,28 @@ static void tls_encrypt_done(void *data, int err)schedule_delayed_work (&ctx->tx_work.work,1 ); } +static int tls_encrypt_async_wait (struct tls_sw_context_tx *ctx) +{ +int pending; + +spin_lock_bh (&ctx->encrypt_compl_lock); + ctx->async_notify = true; + + pending =atomic_read (&ctx->encrypt_pending); +spin_unlock_bh (&ctx->encrypt_compl_lock); +if (pending) +crypto_wait_req (-EINPROGRESS , &ctx->async_wait); +else +reinit_completion (&ctx->async_wait.completion); + +/* There can be no concurrent accesses, since we have no +* pending encrypt operations +*/ +WRITE_ONCE (ctx->async_notify, false); + +return ctx->async_wait.err; +} + static int tls_do_encryption(struct sock *sk, struct tls_context *tls_ctx, struct tls_sw_context_tx *ctx,
@@ -984,7 +1020,6 @@ static int tls_sw_sendmsg_locked(struct sock *sk, struct msghdr *msg,int num_zc =0 ;int orig_size;int ret =0 ; -int pending;if (!eor && (msg->msg_flags &MSG_EOR ))return -EINVAL ;
@@ -1163,24 +1198,12 @@ static int tls_sw_sendmsg_locked(struct sock *sk, struct msghdr *msg,if (!num_async) { goto send_end; }else if (num_zc) { -/* Wait for pending encryptions to get completed */ -spin_lock_bh (&ctx->encrypt_compl_lock); - ctx->async_notify = true; - - pending =atomic_read (&ctx->encrypt_pending); -spin_unlock_bh (&ctx->encrypt_compl_lock); -if (pending) -crypto_wait_req (-EINPROGRESS , &ctx->async_wait); -else -reinit_completion (&ctx->async_wait.completion); - -/* There can be no concurrent accesses, since we have no -* pending encrypt operations -*/ -WRITE_ONCE (ctx->async_notify, false); +int err; -if (ctx->async_wait.err) { - ret = ctx->async_wait.err; +/* Wait for pending encryptions to get completed */ + err =tls_encrypt_async_wait (ctx); +if (err) { + ret = err; copied =0 ; } }
@@ -1229,7 +1252,6 @@ void tls_sw_splice_eof(struct socket *sock)ssize_t copied =0 ;bool retrying = false;int ret =0 ; -int pending;if (!ctx->open_rec)return ;
@@ -1264,22 +1286,7 @@ void tls_sw_splice_eof(struct socket *sock) }/* Wait for pending encryptions to get completed */ -spin_lock_bh (&ctx->encrypt_compl_lock); - ctx->async_notify = true; - - pending =atomic_read (&ctx->encrypt_pending); -spin_unlock_bh (&ctx->encrypt_compl_lock); -if (pending) -crypto_wait_req (-EINPROGRESS , &ctx->async_wait); -else -reinit_completion (&ctx->async_wait.completion); - -/* There can be no concurrent accesses, since we have no pending -* encrypt operations -*/ -WRITE_ONCE (ctx->async_notify, false); - -if (ctx->async_wait.err) +if (tls_encrypt_async_wait (ctx)) goto unlock;/* Transmit if any encryptions have completed */
@@ -2109,16 +2116,10 @@ int tls_sw_recvmsg(struct sock *sk, recv_end:if (async) { -int ret, pending; +int ret;/* Wait for all previously submitted records to be decrypted */ -spin_lock_bh (&ctx->decrypt_compl_lock); -reinit_completion (&ctx->async_wait.completion); - pending =atomic_read (&ctx->decrypt_pending); -spin_unlock_bh (&ctx->decrypt_compl_lock); - ret =0 ; -if (pending) - ret =crypto_wait_req (-EINPROGRESS , &ctx->async_wait); + ret =tls_decrypt_async_wait (ctx);__skb_queue_purge (&ctx->async_hold);if (ret) {
@@ -2435,16 +2436,9 @@ void tls_sw_release_resources_tx(struct sock *sk)struct tls_context *tls_ctx =tls_get_ctx (sk);struct tls_sw_context_tx *ctx =tls_sw_ctx_tx (tls_ctx);struct tls_rec *rec, *tmp; -int pending;/* Wait for any pending async encryptions to complete */ -spin_lock_bh (&ctx->encrypt_compl_lock); - ctx->async_notify = true; - pending =atomic_read (&ctx->encrypt_pending); -spin_unlock_bh (&ctx->encrypt_compl_lock); - -if (pending) -crypto_wait_req (-EINPROGRESS , &ctx->async_wait); +tls_encrypt_async_wait (ctx);tls_tx_records (sk,-1 );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 12/26 selftests: tls: use exact comparison in recv_partial
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit 49d821064c44cb5ffdf272905236012ea9ce50e3 ]
This exact case was fail for async crypto and we weren't catching it.
--- tools/testing/selftests/net/tls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/net/tls.c +4 -4
@@ -988,12 +988,12 @@ TEST_F(tls, recv_partial)memset (recv_mem,0 ,sizeof (recv_mem));EXPECT_EQ (send (self->fd, test_str, send_len,0 ), send_len); -EXPECT_NE (recv (self->cfd, recv_mem,strlen (test_str_first), -MSG_WAITALL ),-1 ); +EXPECT_EQ (recv (self->cfd, recv_mem,strlen (test_str_first), +MSG_WAITALL ),strlen (test_str_first));EXPECT_EQ (memcmp (test_str_first, recv_mem,strlen (test_str_first)),0 );memset (recv_mem,0 ,sizeof (recv_mem)); -EXPECT_NE (recv (self->cfd, recv_mem,strlen (test_str_second), -MSG_WAITALL ),-1 ); +EXPECT_EQ (recv (self->cfd, recv_mem,strlen (test_str_second), +MSG_WAITALL ),strlen (test_str_second));EXPECT_EQ (memcmp (test_str_second, recv_mem,strlen (test_str_second)),0 ); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 13/26 ASoC: rt5645: Make LattePanda board DMI match more precise
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 551539a8606e28cb2a130f8ef3e9834235b456c4 ]
The DMI strings used for the LattePanda board DMI quirks are very generic.
Using the dmidecode database from https://linux-hardware.org/ shows that the chosen DMI strings also match the following 2 laptops which also have a rt5645 codec:
Insignia NS-P11W7100 https://linux-hardware.org/?computer=E092FFF8BA04
Insignia NS-P10W8100 https://linux-hardware.org/?computer=AFB6C0BF7934
All 4 hw revisions of the LattePanda board have "S70CR" in their BIOS version DMI strings:
DF-BI-7-S70CR100-*
DF-BI-7-S70CR110-*
DF-BI-7-S70CR200-*
LP-BS-7-S70CR700-*
See e.g. https://linux-hardware.org/?computer=D98250A817C0
Add a partial (non exact) DMI match on this string to make the LattePanda board DMI match more precise to avoid false-positive matches.
--- sound/soc/codecs/rt5645.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/soc/codecs/rt5645.c +10 -0
@@ -3828,6 +3828,16 @@ static const struct dmi_system_id dmi_platform_data[] = { DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), DMI_EXACT_MATCH(DMI_BOARD_VERSION, "Default string"), +/* +* Above strings are too generic, LattePanda BIOS versions for +* all 4 hw revisions are: +* DF-BI-7-S70CR100-* +* DF-BI-7-S70CR110-* +* DF-BI-7-S70CR200-* +* LP-BS-7-S70CR700-* +* Do a partial match for S70CR to avoid false positive matches. +*/ + DMI_MATCH(DMI_BIOS_VERSION, "S70CR"), }, .driver_data = (void *)&lattepanda_board_platform_data, },
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 14/26 spi: omap2-mcspi: Revert FIFO support without DMA
In reply to Sasha LevinFrom: Vaishnav Achath <[email protected]>
[ Upstream commit e56c671c2272d939d48a66be7e73b92b74c560c2 ]
MCSPI controller have few limitations regarding the transaction size when the FIFO buffer is enabled and the WCNT feature is used to find the end of word, in this case if WCNT is not a multiple of the FIFO Almost Empty Level (AEL), then the FIFO empty event is not generated correctly. In addition to this limitation, few other unknown sequence of events that causes the FIFO empty status to not reflect the exact status were found when FIFO is being used without DMA enabled during extended testing in AM65x platform. Till the exact root cause is found and fixed, revert the FIFO support without DMA.
See J721E Technical Reference Manual (SPRUI1C), section 12.1.5 for further details: http://www.ti.com/lit/pdf/spruil1
This reverts commit 75223bbea840e ("spi: omap2-mcspi: Add FIFO support without DMA")
--- drivers/spi/spi-omap2-mcspi.c | 137 ++-------------------------------- 1 file changed, 8 insertions(+), 129 deletions(-)
drivers/spi/spi-omap2-mcspi.c +8 -129
@@ -53,8 +53,6 @@/* per-register bitmasks: */ #define OMAP2_MCSPI_IRQSTATUS_EOW BIT(17) -#define OMAP2_MCSPI_IRQSTATUS_TX0_EMPTY BIT(0) -#define OMAP2_MCSPI_IRQSTATUS_RX0_FULL BIT(2)#define OMAP2_MCSPI_MODULCTRL_SINGLE BIT(0)#define OMAP2_MCSPI_MODULCTRL_MS BIT(2)
@@ -293,7 +291,7 @@ static void omap2_mcspi_set_mode(struct spi_controller *ctlr) }static void omap2_mcspi_set_fifo (const struct spi_device *spi, -struct spi_transfer *t,int enable,int dma_enabled) +struct spi_transfer *t,int enable) {struct spi_controller *ctlr = spi->controller;struct omap2_mcspi_cs *cs = spi->controller_state;
@@ -314,28 +312,20 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi, max_fifo_depth =OMAP2_MCSPI_MAX_FIFODEPTH /2 ; else max_fifo_depth =OMAP2_MCSPI_MAX_FIFODEPTH ; -if (dma_enabled) - wcnt = t->len / bytes_per_word; -else - wcnt =0 ; + + wcnt = t->len / bytes_per_word;if (wcnt >OMAP2_MCSPI_MAX_FIFOWCNT ) goto disable_fifo; xferlevel = wcnt <<16 ;if (t->rx_buf !=NULL ) { chconf |=OMAP2_MCSPI_CHCONF_FFER ; -if (dma_enabled) - xferlevel |= (bytes_per_word -1 ) <<8 ; -else - xferlevel |= (max_fifo_depth -1 ) <<8 ; + xferlevel |= (bytes_per_word -1 ) <<8 ; }if (t->tx_buf !=NULL ) { chconf |=OMAP2_MCSPI_CHCONF_FFET ; -if (dma_enabled) - xferlevel |= bytes_per_word -1 ; -else - xferlevel |= (max_fifo_depth -1 ); + xferlevel |= bytes_per_word -1 ; }mcspi_write_reg (ctlr,OMAP2_MCSPI_XFERLEVEL , xferlevel);
@@ -892,113 +882,6 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)return count - c; } -static unsigned -omap2_mcspi_txrx_piofifo (struct spi_device *spi,struct spi_transfer *xfer) -{ -struct omap2_mcspi_cs *cs = spi->controller_state; -struct omap2_mcspi *mcspi; -unsigned int count, c; -unsigned int iter, cwc; -int last_request; -void __iomem *base = cs->base; -void __iomem *tx_reg; -void __iomem *rx_reg; -void __iomem *chstat_reg; -void __iomem *irqstat_reg; -int word_len, bytes_per_word; -u8 *rx; -const u8 *tx; - - mcspi =spi_controller_get_devdata (spi->controller); - count = xfer->len; - c = count; - word_len = cs->word_len; - bytes_per_word =mcspi_bytes_per_word (word_len); - -/* -* We store the pre-calculated register addresses on stack to speed -* up the transfer loop. -*/ - tx_reg = base +OMAP2_MCSPI_TX0 ; - rx_reg = base +OMAP2_MCSPI_RX0 ; - chstat_reg = base +OMAP2_MCSPI_CHSTAT0 ; - irqstat_reg = base +OMAP2_MCSPI_IRQSTATUS ; - -if (c < (word_len >>3 )) -return 0 ; - - rx = xfer->rx_buf; - tx = xfer->tx_buf; - -do { -/* calculate number of words in current iteration */ - cwc =min ((unsigned int )mcspi->fifo_depth / bytes_per_word, - c / bytes_per_word); - last_request = cwc != (mcspi->fifo_depth / bytes_per_word); -if (tx) { -if (mcspi_wait_for_reg_bit (irqstat_reg, -OMAP2_MCSPI_IRQSTATUS_TX0_EMPTY ) <0 ) { -dev_err (&spi->dev,"TX Empty timed out\n" ); - goto out; - } -writel_relaxed (OMAP2_MCSPI_IRQSTATUS_TX0_EMPTY , irqstat_reg); - -for (iter =0 ; iter < cwc; iter++, tx += bytes_per_word) { -if (bytes_per_word ==1 ) -writel_relaxed (*tx, tx_reg); -else if (bytes_per_word ==2 ) -writel_relaxed (*((u16 *)tx), tx_reg); -else if (bytes_per_word ==4 ) -writel_relaxed (*((u32 *)tx), tx_reg); - } - } - -if (rx) { -if (!last_request && -mcspi_wait_for_reg_bit (irqstat_reg, -OMAP2_MCSPI_IRQSTATUS_RX0_FULL ) <0 ) { -dev_err (&spi->dev,"RX_FULL timed out\n" ); - goto out; - } -writel_relaxed (OMAP2_MCSPI_IRQSTATUS_RX0_FULL , irqstat_reg); - -for (iter =0 ; iter < cwc; iter++, rx += bytes_per_word) { -if (last_request && -mcspi_wait_for_reg_bit (chstat_reg, -OMAP2_MCSPI_CHSTAT_RXS ) <0 ) { -dev_err (&spi->dev,"RXS timed out\n" ); - goto out; - } -if (bytes_per_word ==1 ) - *rx =readl_relaxed (rx_reg); -else if (bytes_per_word ==2 ) - *((u16 *)rx) =readl_relaxed (rx_reg); -else if (bytes_per_word ==4 ) - *((u32 *)rx) =readl_relaxed (rx_reg); - } - } - -if (last_request) { -if (mcspi_wait_for_reg_bit (chstat_reg, -OMAP2_MCSPI_CHSTAT_EOT ) <0 ) { -dev_err (&spi->dev,"EOT timed out\n" ); - goto out; - } -if (mcspi_wait_for_reg_bit (chstat_reg, -OMAP2_MCSPI_CHSTAT_TXFFE ) <0 ) { -dev_err (&spi->dev,"TXFFE timed out\n" ); - goto out; - } -omap2_mcspi_set_enable (spi,0 ); - } - c -= cwc * bytes_per_word; - }while (c >= bytes_per_word); - -out: -omap2_mcspi_set_enable (spi,1 ); -return count - c; -} -static u32 omap2_mcspi_calc_divisor (u32 speed_hz,u32 ref_clk_hz) {u32 div;
@@ -1323,9 +1206,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr,if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) && ctlr->cur_msg_mapped && ctlr->can_dma (ctlr, spi, t)) -omap2_mcspi_set_fifo (spi, t,1 ,1 ); -else if (t->len >OMAP2_MCSPI_MAX_FIFODEPTH ) -omap2_mcspi_set_fifo (spi, t,1 ,0 ); +omap2_mcspi_set_fifo (spi, t,1 );omap2_mcspi_set_enable (spi,1 );
@@ -1338,8 +1219,6 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr, ctlr->cur_msg_mapped && ctlr->can_dma(ctlr, spi, t)) count =omap2_mcspi_txrx_dma (spi, t); - else if (mcspi->fifo_depth > 0) - count =omap2_mcspi_txrx_piofifo (spi, t); else count =omap2_mcspi_txrx_pio (spi, t);
@@ -1352,7 +1231,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr,omap2_mcspi_set_enable (spi,0 );if (mcspi->fifo_depth >0 ) -omap2_mcspi_set_fifo (spi, t,0 ,0 ); +omap2_mcspi_set_fifo (spi, t,0 ); out:/* Restore defaults if they were overriden */
@@ -1375,7 +1254,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr,omap2_mcspi_set_cs (spi, !(spi->mode &SPI_CS_HIGH ));if (mcspi->fifo_depth >0 && t) -omap2_mcspi_set_fifo (spi, t,0 ,0 ); +omap2_mcspi_set_fifo (spi, t,0 );return status; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 15/26 spi: intel-pci: Add support for Lunar Lake-M SPI serial flash
In reply to Sasha LevinFrom: Mika Westerberg <[email protected]>
[ Upstream commit 8f44e3808200c1434c26ef459722f88f48b306df ]
Add Intel Lunar Lake-M PCI ID to the driver list of supported devices. This is the same controller found in previous generations.
--- drivers/spi/spi-intel-pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-intel-pci.c +1 -0
@@ -84,6 +84,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = { { PCI_VDEVICE(INTEL, 0xa2a4), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa324), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa3a4), (unsigned long)&cnl_info }, + { PCI_VDEVICE(INTEL, 0xa823), (unsigned long)&cnl_info }, { }, };MODULE_DEVICE_TABLE (pci, intel_spi_pci_ids);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 16/26 regmap: kunit: Ensure that changed bytes are actually different
In reply to Sasha LevinFrom: Mark Brown <[email protected]>
[ Upstream commit 2f0dbb24f78a333433a2b875c0b76bf55c119cd4 ]
During the cache sync test we verify that values we expect to have been written only to the cache do not appear in the hardware. This works most of the time but since we randomly generate both the original and new values there is a low probability that these values may actually be the same. Wrap get_random_bytes() to ensure that the values are different, there are other tests which should have similar verification that we actually changed something.
While we're at it refactor the test to use three changed values rather than attempting to use one of them twice, that just complicates checking that our new values are actually new.
We use random generation to try to avoid data dependencies in the tests.
--- drivers/base/regmap/regmap-kunit.c | 54 +++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 16 deletions(-)
drivers/base/regmap/regmap-kunit.c +38 -16
@@ -9,6 +9,23 @@#define BLOCK_TEST_SIZE 12 +static void get_changed_bytes (void *orig,void *new,size_t size) +{ +char *o = orig; +char *n = new; +int i; + +get_random_bytes (new, size); + +/* +* This could be nicer and more efficient but we shouldn't +* super care. +*/ +for (i =0 ; i < size; i++) +while (n[i] == o[i]) +get_random_bytes (&n[i],1 ); +} +static const struct regmap_config test_regmap_config = { .max_register =BLOCK_TEST_SIZE , .reg_stride =1 ,
@@ -1192,7 +1209,7 @@ static void raw_sync(struct kunit *test)struct regmap *map;struct regmap_config config;struct regmap_ram_data *data; -u16 val[2 ]; +u16 val[3 ];u16 *hw_buf;unsigned int rval;int i;
@@ -1206,17 +1223,13 @@ static void raw_sync(struct kunit *test) hw_buf = (u16 *)data->vals; -get_random_bytes (&val,sizeof (val)); +get_changed_bytes (&hw_buf[2 ], &val[0 ],sizeof (val));/* Do a regular write and a raw write in cache only mode */ regcache_cache_only (map, true); -KUNIT_EXPECT_EQ (test,0 ,regmap_raw_write (map,2 , val,sizeof (val))); -if (config.val_format_endian ==REGMAP_ENDIAN_BIG ) -KUNIT_EXPECT_EQ (test,0 ,regmap_write (map,6 , -be16_to_cpu (val[0 ]))); -else -KUNIT_EXPECT_EQ (test,0 ,regmap_write (map,6 , -le16_to_cpu (val[0 ]))); +KUNIT_EXPECT_EQ (test,0 ,regmap_raw_write (map,2 , val, +sizeof (u16) *2 )); +KUNIT_EXPECT_EQ (test,0 ,regmap_write (map,4 , val[2 ]));/* We should read back the new values, and defaults for the rest */ for (i =0 ; i < config.max_register +1 ; i++) {
@@ -1225,24 +1238,34 @@ static void raw_sync(struct kunit *test)switch (i) {case 2 :case 3 : -case 6 :if (config.val_format_endian ==REGMAP_ENDIAN_BIG ) {KUNIT_EXPECT_EQ (test, rval, -be16_to_cpu (val[i %2 ])); +be16_to_cpu (val[i -2 ])); }else {KUNIT_EXPECT_EQ (test, rval, -le16_to_cpu (val[i %2 ])); +le16_to_cpu (val[i -2 ])); }break ; +case 4 : +KUNIT_EXPECT_EQ (test, rval, val[i -2 ]); +break ;default :KUNIT_EXPECT_EQ (test, config.reg_defaults[i].def, rval);break ; } } + +/* +* The value written via _write() was translated by the core, +* translate the original copy for comparison purposes. +*/ +if (config.val_format_endian ==REGMAP_ENDIAN_BIG ) + val[2 ] =cpu_to_be16 (val[2 ]); +else + val[2 ] =cpu_to_le16 (val[2 ]);/* The values should not appear in the "hardware" */ -KUNIT_EXPECT_MEMNEQ (test, &hw_buf[2 ], val,sizeof (val)); -KUNIT_EXPECT_MEMNEQ (test, &hw_buf[6 ], val,sizeof (u16)); +KUNIT_EXPECT_MEMNEQ (test, &hw_buf[2 ], &val[0 ],sizeof (val));for (i =0 ; i < config.max_register +1 ; i++) data->written[i] = false;
@@ -1253,8 +1276,7 @@ static void raw_sync(struct kunit *test)KUNIT_EXPECT_EQ (test,0 ,regcache_sync (map));/* The values should now appear in the "hardware" */ -KUNIT_EXPECT_MEMEQ (test, &hw_buf[2 ], val,sizeof (val)); -KUNIT_EXPECT_MEMEQ (test, &hw_buf[6 ], val,sizeof (u16)); +KUNIT_EXPECT_MEMEQ (test, &hw_buf[2 ], &val[0 ],sizeof (val));regmap_exit (map); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 17/26 ASoC: amd: yc: Fix non-functional mic on Lenovo 82UU
In reply to Sasha LevinFrom: Attila Tőkés <[email protected]>
[ Upstream commit f7fe85b229bc30cb5dc95b4e9015a601c9e3a8cd ]
Like many other models, the Lenovo 82UU (Yoga Slim 7 Pro 14ARH7) needs a quirk entry for the internal microphone to function.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -234,6 +234,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "82UG"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "82UU"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 18/26 x86/xen: Add some null pointer checking to smp.c
In reply to Sasha LevinFrom: Kunwu Chan <[email protected]>
[ Upstream commit 3693bb4465e6e32a204a5b86d3ec7e6b9f7e67c2 ]
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity.
--- arch/x86/xen/smp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/x86/xen/smp.c +12 -0
@@ -65,6 +65,8 @@ int xen_smp_intr_init(unsigned int cpu)char *resched_name, *callfunc_name, *debug_name; resched_name =kasprintf (GFP_KERNEL ,"resched%d" , cpu); +if (!resched_name) + goto fail_mem;per_cpu (xen_resched_irq, cpu).name = resched_name; rc = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR, cpu,
@@ -77,6 +79,8 @@ int xen_smp_intr_init(unsigned int cpu)per_cpu (xen_resched_irq, cpu).irq = rc; callfunc_name =kasprintf (GFP_KERNEL ,"callfunc%d" , cpu); +if (!callfunc_name) + goto fail_mem;per_cpu (xen_callfunc_irq, cpu).name = callfunc_name; rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR, cpu,
@@ -90,6 +94,9 @@ int xen_smp_intr_init(unsigned int cpu)if (!xen_fifo_events) { debug_name =kasprintf (GFP_KERNEL ,"debug%d" , cpu); +if (!debug_name) + goto fail_mem; +per_cpu (xen_debug_irq, cpu).name = debug_name; rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt,
@@ -101,6 +108,9 @@ int xen_smp_intr_init(unsigned int cpu) } callfunc_name =kasprintf (GFP_KERNEL ,"callfuncsingle%d" , cpu); +if (!callfunc_name) + goto fail_mem; +per_cpu (xen_callfuncsingle_irq, cpu).name = callfunc_name; rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR, cpu,
@@ -114,6 +124,8 @@ int xen_smp_intr_init(unsigned int cpu)return 0 ; + fail_mem: + rc = -ENOMEM ; fail:xen_smp_intr_free (cpu);return rc;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 19/26 MIPS: Clear Cause.BD in instruction_pointer_set
In reply to Sasha LevinFrom: Jiaxun Yang <[email protected]>
[ Upstream commit 9d6e21ddf20293b3880ae55b9d14de91c5891c59 ]
Clear Cause.BD after we use instruction_pointer_set to override EPC.
This can prevent exception_epc check against instruction code at new return address.
It won't be considered as "in delay slot" after epc being overridden anyway.
--- arch/mips/include/asm/ptrace.h | 1 + 1 file changed, 1 insertion(+)
arch/mips/include/asm/ptrace.h +1 -0
@@ -60,6 +60,7 @@ static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val) { regs->cp0_epc = val; + regs->cp0_cause &= ~CAUSEF_BD ; }/* Query offset/name of register from its name/offset */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 20/26 ceph: always queue a writeback when revoking the Fb caps
In reply to Sasha LevinFrom: Xiubo Li <[email protected]>
[ Upstream commit 902d6d013f75b68f31d208c6f3ff9cdca82648a7 ]
In case there is 'Fw' dirty caps and 'CHECK_CAPS_FLUSH' is set we will always ignore queue a writeback. Queue a writeback is very important because it will block kclient flushing the snapcaps to MDS and which will block MDS waiting for revoking the 'Fb' caps.
--- fs/ceph/caps.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-)
fs/ceph/caps.c +24 -24
@@ -2155,6 +2155,30 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags)ceph_cap_string (cap->implemented), ceph_cap_string(revoking)); +/* completed revocation? going down and there are no caps? */ +if (revoking) { +if ((revoking & cap_used) ==0 ) { +doutc (cl,"completed revocation of %s\n" , +ceph_cap_string (cap->implemented & ~cap->issued)); + goto ack; + } + +/* +* If the "i_wrbuffer_ref" was increased by mmap or generic +* cache write just before the ceph_check_caps() is called, +* the Fb capability revoking will fail this time. Then we +* must wait for the BDI's delayed work to flush the dirty +* pages and to release the "i_wrbuffer_ref", which will cost +* at most 5 seconds. That means the MDS needs to wait at +* most 5 seconds to finished the Fb capability's revocation. +* +* Let's queue a writeback for it. +*/ +if (S_ISREG (inode->i_mode) && ci->i_wrbuffer_ref && + (revoking &CEPH_CAP_FILE_BUFFER )) + queue_writeback = true; + } +if (cap == ci->i_auth_cap && (cap->issued &CEPH_CAP_FILE_WR )) {/* request larger max_size from MDS? */
@@ -2182,30 +2206,6 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags) } } -/* completed revocation? going down and there are no caps? */ -if (revoking) { -if ((revoking & cap_used) ==0 ) { -doutc (cl,"completed revocation of %s\n" , -ceph_cap_string (cap->implemented & ~cap->issued)); - goto ack; - } - -/* -* If the "i_wrbuffer_ref" was increased by mmap or generic -* cache write just before the ceph_check_caps() is called, -* the Fb capability revoking will fail this time. Then we -* must wait for the BDI's delayed work to flush the dirty -* pages and to release the "i_wrbuffer_ref", which will cost -* at most 5 seconds. That means the MDS needs to wait at -* most 5 seconds to finished the Fb capability's revocation. -* -* Let's queue a writeback for it. -*/ -if (S_ISREG (inode->i_mode) && ci->i_wrbuffer_ref && - (revoking &CEPH_CAP_FILE_BUFFER )) - queue_writeback = true; - } -/* want more caps from mds? */ if (want & ~cap->mds_wanted) {if (want & ~(cap->mds_wanted | cap->issued))
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 21/26 ceph: add ceph_cap_unlink_work to fire check_caps() immediately
In reply to Sasha LevinFrom: Xiubo Li <[email protected]>
[ Upstream commit dbc347ef7f0c53aa4a5383238a804d7ebbb0b5ca ]
When unlinking a file the check caps could be delayed for more than 5 seconds, but in MDS side it maybe waiting for the clients to release caps.
This will use the cap_wq work queue and a dedicated list to help fire the check_caps() and dirty buffer flushing immediately.
--- fs/ceph/caps.c | 17 +++++++++++++++- fs/ceph/mds_client.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ fs/ceph/mds_client.h | 5 +++++ 3 files changed, 69 insertions(+), 1 deletion(-)
fs/ceph/caps.c +16 -1
@@ -4777,7 +4777,22 @@ int ceph_drop_caps_for_unlink(struct inode *inode)if (__ceph_caps_dirty (ci)) {struct ceph_mds_client *mdsc =ceph_inode_to_fs_client (inode)->mdsc; -__cap_delay_requeue_front (mdsc, ci); + +doutc (mdsc->fsc->client,"%p %llx.%llx\n" , inode, +ceph_vinop (inode)); +spin_lock (&mdsc->cap_unlink_delay_lock); + ci->i_ceph_flags |=CEPH_I_FLUSH ; +if (!list_empty (&ci->i_cap_delay_list)) +list_del_init (&ci->i_cap_delay_list); +list_add_tail (&ci->i_cap_delay_list, + &mdsc->cap_unlink_delay_list); +spin_unlock (&mdsc->cap_unlink_delay_lock); + +/* +* Fire the work immediately, because the MDS maybe +* waiting for caps release. +*/ +ceph_queue_cap_unlink_work (mdsc); } }spin_unlock (&ci->i_ceph_lock);
fs/ceph/mds_client.c +48 -0
72 lines not on this page · raw message
fs/ceph/mds_client.h +5 -0
@@ -462,6 +462,8 @@ struct ceph_mds_client {unsigned long last_renew_caps;/* last time we renewed our caps */ struct list_head cap_delay_list;/* caps with delayed release */ spinlock_t cap_delay_lock;/* protects cap_delay_list */ +struct list_head cap_unlink_delay_list;/* caps with delayed release for unlink */ +spinlock_t cap_unlink_delay_lock;/* protects cap_unlink_delay_list */ struct list_head snap_flush_list;/* cap_snaps ready to flush */ spinlock_t snap_flush_lock;
@@ -475,6 +477,8 @@ struct ceph_mds_client {struct work_struct cap_reclaim_work;atomic_t cap_reclaim_pending; +struct work_struct cap_unlink_work; +/* * Cap reservations *
@@ -574,6 +578,7 @@ extern void ceph_flush_cap_releases(struct ceph_mds_client *mdsc, struct ceph_mds_session *session);extern void ceph_queue_cap_reclaim_work (struct ceph_mds_client *mdsc);extern void ceph_reclaim_caps_nr (struct ceph_mds_client *mdsc,int nr); +extern void ceph_queue_cap_unlink_work (struct ceph_mds_client *mdsc);extern int ceph_iterate_session_caps (struct ceph_mds_session *session,int (*cb)(struct inode *,int mds,void *),void *arg);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 22/26 HID: multitouch: Add required quirk for Synaptics 0xcddc device
In reply to Sasha LevinFrom: Manuel Fombuena <[email protected]>
[ Upstream commit 1741a8269e1c51fa08d4bfdf34667387a6eb10ec ]
Add support for the pointing stick (Accupoint) and 2 mouse buttons.
Present on some Toshiba/dynabook Portege X30 and X40 laptops.
It should close https://bugzilla.kernel.org/show_bug.cgi?id=205817
--- drivers/hid/hid-multitouch.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/hid/hid-multitouch.c +4 -0
@@ -2151,6 +2151,10 @@ static const struct hid_device_id mt_devices[] = {HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , USB_VENDOR_ID_SYNAPTICS, 0xcd7e) }, + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, +HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , + USB_VENDOR_ID_SYNAPTICS, 0xcddc) }, + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , USB_VENDOR_ID_SYNAPTICS, 0xce08) },
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 23/26 ASoC: SOF: ipc4-pcm: Workaround for crashed firmware on system suspend
In reply to Sasha LevinFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit c40aad7c81e5fba34b70123ed7ce3397fa62a4d2 ]
When the system is suspended while audio is active, the sof_ipc4_pcm_hw_free() is invoked to reset the pipelines since during suspend the DSP is turned off, streams will be re-started after resume.
If the firmware crashes during while audio is running (or when we reset the stream before suspend) then the sof_ipc4_set_multi_pipeline_state() will fail with IPC error and the state change is interrupted. This will cause misalignment between the kernel and firmware state on next DSP boot resulting errors returned by firmware for IPC messages, eventually failing the audio resume.
On stream close the errors are ignored so the kernel state will be corrected on the next DSP boot, so the second boot after the DSP panic.
If sof_ipc4_trigger_pipelines() is called from sof_ipc4_pcm_hw_free() then state parameter is SOF_IPC4_PIPE_RESET and only in this case.
Treat a forced pipeline reset similarly to how we treat a pcm_free by ignoring error on state sending to allow the kernel's state to be consistent with the state the firmware will have after the next boot.
--- sound/soc/sof/ipc4-pcm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
sound/soc/sof/ipc4-pcm.c +12 -1
@@ -413,7 +413,18 @@ static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component, ret =sof_ipc4_set_multi_pipeline_state (sdev, state, trigger_list);if (ret <0 ) {dev_err (sdev->dev,"failed to set final state %d for all pipelines\n" , state); - goto free; +/* +* workaround: if the firmware is crashed while setting the +* pipelines to reset state we must ignore the error code and +* reset it to 0. +* Since the firmware is crashed we will not send IPC messages +* and we are going to see errors printed, but the state of the +* widgets will be correct for the next boot. +*/ +if (sdev->fw_state !=SOF_FW_CRASHED || state !=SOF_IPC4_PIPE_RESET ) + goto free; + + ret =0 ; }/* update RUNNING/RESET state for all pipelines that were just triggered */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 24/26 ALSA: hda/realtek: cs35l41: Add internal speaker support for ASUS UM3402 with missing DSD
In reply to Sasha LevinFrom: Jean-Loïc Charroud <[email protected]>
[ Upstream commit 706c1fa1ab09f11a131fc4d699ce4c0224b1cb2d ]
Add the values for the missing DSD properties to the cs35l41 config table.
--- sound/pci/hda/cs35l41_hda_property.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/cs35l41_hda_property.c +2 -0
@@ -89,6 +89,7 @@ static const struct cs35l41_config cs35l41_config_table[] = { { "10431D1F", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 1000, 4500, 24 }, { "10431DA2", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 0, 0, 0 }, { "10431E02", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 0, 0, 0 }, + { "10431E12", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 }, { "10431EE2", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, -1, -1, 0, 0, 0 }, { "10431F12", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 1000, 4500, 24 }, { "10431F1F", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, -1, 0, 0, 0, 0 },
@@ -423,6 +424,7 @@ static const struct cs35l41_prop_model cs35l41_prop_model_table[] = { { "CSC3551", "10431D1F", generic_dsd_config }, { "CSC3551", "10431DA2", generic_dsd_config }, { "CSC3551", "10431E02", generic_dsd_config }, + { "CSC3551", "10431E12", generic_dsd_config }, { "CSC3551", "10431EE2", generic_dsd_config }, { "CSC3551", "10431F12", generic_dsd_config }, { "CSC3551", "10431F1F", generic_dsd_config },
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 25/26 gen_compile_commands: fix invalid escape sequence warning
In reply to Sasha LevinFrom: Andrew Ballance <[email protected]>
[ Upstream commit dae4a0171e25884787da32823b3081b4c2acebb2 ]
With python 3.12, '\#' results in this warning
SyntaxWarning: invalid escape sequence '\#'
--- scripts/clang-tools/gen_compile_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/clang-tools/gen_compile_commands.py +1 -1
@@ -170,7 +170,7 @@ def process_line(root_directory, command_prefix, file_path): # escape the pound sign '#', either as '\#' or '$(pound)' (depending on the # kernel version). The compile_commands.json file is not interepreted # by Make, so this code replaces the escaped version with '#'. - prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#') + prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#') # Return the canonical path, eliminating any symbolic links encountered in the path. abs_path = os.path.realpath(os.path.join(root_directory, file_path))
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 26/26 arm64/sve: Lower the maximum allocation for the SVE ptrace regset
In reply to Sasha LevinFrom: Mark Brown <[email protected]>
[ Upstream commit 2813926261e436d33bc74486b51cce60b76edf78 ]
Doug Anderson observed that ChromeOS crashes are being reported which include failing allocations of order 7 during core dumps due to ptrace allocating storage for regsets:
chrome: page allocation failure: order:7,
mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO),
nodemask=(null),cpuset=urgent,mems_allowed=0
...
regset_get_alloc+0x1c/0x28
elf_core_dump+0x3d8/0xd8c
do_coredump+0xeb8/0x1378with further investigation showing that this is:
[ 66.957385] DOUG: Allocating 279584 bytes
which is the maximum size of the SVE regset. As Doug observes it is not entirely surprising that such a large allocation of contiguous memory might fail on a long running system.
The SVE regset is currently sized to hold SVE registers with a VQ of SVE_VQ_MAX which is 512, substantially more than the architectural maximum of 16 which we might see even in a system emulating the limits of the architecture. Since we don't expose the size we tell the regset core externally let's define ARCH_SVE_VQ_MAX with the actual architectural maximum and use that for the regset, we'll still overallocate most of the time but much less so which will be helpful even if the core is fixed to not require contiguous allocations.
Specify ARCH_SVE_VQ_MAX in terms of the maximum value that can be written into ZCR_ELx.LEN (where this is set in the hardware). For consistency update the maximum SME vector length to be specified in the same style while we are at it.
We could also teach the ptrace core about runtime discoverable regset sizes but that would be a more invasive change and this is being observed in practical systems.
--- arch/arm64/include/asm/fpsimd.h | 12 ++++++------ arch/arm64/kernel/ptrace.c | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-)
arch/arm64/include/asm/fpsimd.h +6 -6
@@ -62,13 +62,13 @@ static inline void cpacr_restore(unsigned long cpacr)* When we defined the maximum SVE vector length we defined the ABI so * that the maximum vector length included all the reserved for future * expansion bits in ZCR rather than those just currently defined by -* the architecture. While SME follows a similar pattern the fact that -* it includes a square matrix means that any allocations that attempt -* to cover the maximum potential vector length (such as happen with -* the regset used for ptrace) end up being extremely large. Define -* the much lower actual limit for use in such situations. +* the architecture. Using this length to allocate worst size buffers +* results in excessively large allocations, and this effect is even +* more pronounced for SME due to ZA. Define more suitable VLs for +* these situations. */ -#define SME_VQ_MAX 16 +#define ARCH_SVE_VQ_MAX ((ZCR_ELx_LEN_MASK >> ZCR_ELx_LEN_SHIFT) + 1) +#define SME_VQ_MAX ((SMCR_ELx_LEN_MASK >> SMCR_ELx_LEN_SHIFT) + 1)struct task_struct ;
arch/arm64/kernel/ptrace.c +2 -1
@@ -1499,7 +1499,8 @@ static const struct user_regset aarch64_regsets[] = { #ifdef CONFIG_ARM64_SVE [REGSET_SVE ] = {/* Scalable Vector Extension */ .core_note_type =NT_ARM_SVE , - .n =DIV_ROUND_UP (SVE_PT_SIZE (SVE_VQ_MAX ,SVE_PT_REGS_SVE ), + .n =DIV_ROUND_UP (SVE_PT_SIZE (ARCH_SVE_VQ_MAX , +SVE_PT_REGS_SVE ),SVE_VQ_BYTES ), .size =SVE_VQ_BYTES , .align = SVE_VQ_BYTES,
Signature · 1 line
2.43.0