6.10.3-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 264/809 tcp: Dont access uninit tcp_rsk(req)->ao_keyid in tcp_create_openreq_child().
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 3f45181358e4df50a40ea1bb51b00a1f295f915e ]
syzkaller reported KMSAN splat in tcp_create_openreq_child(). [0]
The uninit variable is tcp_rsk(req)->ao_keyid.
tcp_rsk(req)->ao_keyid is initialised only when tcp_conn_request() finds a valid TCP AO option in SYN. Then, tcp_rsk(req)->used_tcp_ao is set accordingly.
Let's not read tcp_rsk(req)->ao_keyid when tcp_rsk(req)->used_tcp_ao is false.
[0]:
BUG: KMSAN: uninit-value in tcp_create_openreq_child+0x198b/0x1ff0 net/ipv4/tcp_minisocks.c:610 tcp_create_openreq_child+0x198b/0x1ff0 net/ipv4/tcp_minisocks.c:610 tcp_v4_syn_recv_sock+0x18e/0x2170 net/ipv4/tcp_ipv4.c:1754 tcp_check_req+0x1a3e/0x20c0 net/ipv4/tcp_minisocks.c:852 tcp_v4_rcv+0x26a4/0x53a0 net/ipv4/tcp_ipv4.c:2265 ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:460 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline] ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639 ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674 __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline] __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751 __netif_receive_skb_list net/core/dev.c:5803 [inline] netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895 gro_normal_list include/net/gro.h:515 [inline] napi_complete_done+0x3f2/0x990 net/core/dev.c:6246 e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808 __napi_poll+0xd9/0x990 net/core/dev.c:6771 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0x90f/0x17e0 net/core/dev.c:6962 handle_softirqs+0x152/0x6b0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649 common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 __msan_instrument_asm_store+0xd6/0xe0 arch_atomic_inc arch/x86/include/asm/atomic.h:53 [inline] raw_atomic_inc include/linux/atomic/atomic-arch-fallback.h:992 [inline] atomic_inc include/linux/atomic/atomic-instrumented.h:436 [inline] page_ref_inc include/linux/page_ref.h:153 [inline] folio_ref_inc include/linux/page_ref.h:160 [inline] filemap_map_order0_folio mm/filemap.c:3596 [inline] filemap_map_pages+0x11c7/0x2270 mm/filemap.c:3644 do_fault_around mm/memory.c:4879 [inline] do_read_fault mm/memory.c:4912 [inline] do_fault mm/memory.c:5051 [inline] do_pte_missing mm/memory.c:3897 [inline] handle_pte_fault mm/memory.c:5381 [inline] __handle_mm_fault mm/memory.c:5524 [inline] handle_mm_fault+0x3677/0x6f00 mm/memory.c:5689 do_user_addr_fault+0x1373/0x2b20 arch/x86/mm/fault.c:1338 handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x54/0xc0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
Uninit was stored to memory at:
tcp_create_openreq_child+0x1984/0x1ff0 net/ipv4/tcp_minisocks.c:611 tcp_v4_syn_recv_sock+0x18e/0x2170 net/ipv4/tcp_ipv4.c:1754 tcp_check_req+0x1a3e/0x20c0 net/ipv4/tcp_minisocks.c:852 tcp_v4_rcv+0x26a4/0x53a0 net/ipv4/tcp_ipv4.c:2265 ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:460 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline] ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639 ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674 __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline] __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751 __netif_receive_skb_list net/core/dev.c:5803 [inline] netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895 gro_normal_list include/net/gro.h:515 [inline] napi_complete_done+0x3f2/0x990 net/core/dev.c:6246 e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808 __napi_poll+0xd9/0x990 net/core/dev.c:6771 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0x90f/0x17e0 net/core/dev.c:6962 handle_softirqs+0x152/0x6b0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649 common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
Uninit was created at:
__alloc_pages_noprof+0x82d/0xcb0 mm/page_alloc.c:4706 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page mm/slub.c:2265 [inline] allocate_slab mm/slub.c:2428 [inline] new_slab+0x2af/0x14e0 mm/slub.c:2481 ___slab_alloc+0xf73/0x3150 mm/slub.c:3667 __slab_alloc mm/slub.c:3757 [inline] __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] kmem_cache_alloc_noprof+0x53a/0x9f0 mm/slub.c:4009 reqsk_alloc_noprof net/ipv4/inet_connection_sock.c:920 [inline] inet_reqsk_alloc+0x63/0x700 net/ipv4/inet_connection_sock.c:951 tcp_conn_request+0x339/0x4860 net/ipv4/tcp_input.c:7177 tcp_v4_conn_request+0x13b/0x190 net/ipv4/tcp_ipv4.c:1719 tcp_rcv_state_process+0x2dd/0x4a10 net/ipv4/tcp_input.c:6711 tcp_v4_do_rcv+0xbee/0x10d0 net/ipv4/tcp_ipv4.c:1932 tcp_v4_rcv+0x3fad/0x53a0 net/ipv4/tcp_ipv4.c:2334 ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:460 [inline] ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline] ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline] ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639 ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674 __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline] __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751 __netif_receive_skb_list net/core/dev.c:5803 [inline] netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895 gro_normal_list include/net/gro.h:515 [inline] napi_complete_done+0x3f2/0x990 net/core/dev.c:6246 e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808 __napi_poll+0xd9/0x990 net/core/dev.c:6771 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0x90f/0x17e0 net/core/dev.c:6962 handle_softirqs+0x152/0x6b0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649 common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 CPU: 0 PID: 239 Comm: modprobe Tainted: G B 6.10.0-rc7-01816-g852e42cc2dd4 #3 1107521f0c7b55c9309062382d0bda9f604dbb6d Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
--- net/ipv4/tcp_minisocks.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
net/ipv4/tcp_minisocks.c +8 -7
@@ -515,9 +515,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,const struct tcp_sock *oldtp;struct tcp_sock *newtp;u32 seq; -#ifdef CONFIG_TCP_AO -struct tcp_ao_key *ao_key; -#endif if (!newsk)return NULL ;
@@ -608,10 +605,14 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,#endif #ifdef CONFIG_TCP_AO newtp->ao_info =NULL ; - ao_key = treq->af_specific->ao_lookup (sk, req, -tcp_rsk (req)->ao_keyid,-1 ); -if (ao_key) - newtp->tcp_header_len +=tcp_ao_len_aligned (ao_key); + +if (tcp_rsk_used_ao (req)) { +struct tcp_ao_key *ao_key; + + ao_key = treq->af_specific->ao_lookup (sk, req,tcp_rsk (req)->ao_keyid,-1 ); +if (ao_key) + newtp->tcp_header_len +=tcp_ao_len_aligned (ao_key); + }#endif if (skb->len >=TCP_MSS_DEFAULT + newtp->tcp_header_len) newicsk->icsk_ack.last_seg_size = skb->len - newtp->tcp_header_len;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 265/809 drm/rockchip: vop2: Fix the port mux of VP2
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Yan <[email protected]>
[ Upstream commit 2bdb481bf7a93c22b9fea8daefa2834aab23a70f ]
The port mux of VP2 should be RK3568_OVL_PORT_SET__PORT2_MUX.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +1 -1
@@ -2344,7 +2344,7 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp) port_sel |=FIELD_PREP (RK3568_OVL_PORT_SET__PORT2_MUX , (vp2->nlayers + vp1->nlayers + vp0->nlayers -1 )); else - port_sel |= FIELD_PREP(RK3568_OVL_PORT_SET__PORT1_MUX, 8); + port_sel |= FIELD_PREP(RK3568_OVL_PORT_SET__PORT2_MUX, 8); layer_sel =vop2_readl (vop2,RK3568_OVL_LAYER_SEL );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 266/809 drm/arm/komeda: Fix komeda probe failing if there are no links in the secondary pipeline
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Faiz Abbas <[email protected]>
[ Upstream commit 9054c46d479b55768adae31031a1afa1b7d62228 ]
Since commit 4cfe5cc02e3f ("drm/arm/komeda: Remove component framework and add a simple encoder"), the devm_drm_of_get_bridge() call happens regardless of whether any remote nodes are available on the pipeline. Fix this by moving the bridge attach to its own function and calling it conditional on there being an output link.
--- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +32 -11
@@ -5,6 +5,7 @@* */ #include <linux/clk.h> +#include <linux/of.h> #include <linux/pm_runtime.h> #include <linux/spinlock.h>
@@ -610,12 +611,34 @@ get_crtc_primary(struct komeda_kms_dev *kms, struct komeda_crtc *crtc)return NULL ; } +static int komeda_attach_bridge (struct device *dev, +struct komeda_pipeline *pipe, +struct drm_encoder *encoder) +{ +struct drm_bridge *bridge; +int err; + + bridge =devm_drm_of_get_bridge (dev, pipe->of_node, +KOMEDA_OF_PORT_OUTPUT ,0 ); +if (IS_ERR (bridge)) +return dev_err_probe (dev,PTR_ERR (bridge),"remote bridge not found for pipe: %s\n" , +of_node_full_name (pipe->of_node)); + + err =drm_bridge_attach (encoder, bridge,NULL ,0 ); +if (err) +dev_err (dev,"bridge_attach() failed for pipe: %s\n" , +of_node_full_name (pipe->of_node)); + +return err; +} +static int komeda_crtc_add (struct komeda_kms_dev *kms,struct komeda_crtc *kcrtc) {struct drm_crtc *crtc = &kcrtc->base;struct drm_device *base = &kms->base; -struct drm_bridge *bridge; +struct komeda_pipeline *pipe = kcrtc->master; +struct drm_encoder *encoder = &kcrtc->encoder;int err; err = drm_crtc_init_with_planes(base, crtc,
@@ -626,27 +649,25 @@ static int komeda_crtc_add(struct komeda_kms_dev *kms,drm_crtc_helper_add (crtc, &komeda_crtc_helper_funcs); - crtc->port = kcrtc->master->of_output_port; + crtc->port = pipe->of_output_port;/* Construct an encoder for each pipeline and attach it to the remote * bridge */ kcrtc->encoder.possible_crtcs =drm_crtc_mask (crtc); - err =drm_simple_encoder_init (base, &kcrtc->encoder, -DRM_MODE_ENCODER_TMDS ); + err =drm_simple_encoder_init (base, encoder,DRM_MODE_ENCODER_TMDS );if (err)return err; - bridge =devm_drm_of_get_bridge (base->dev, kcrtc->master->of_node, -KOMEDA_OF_PORT_OUTPUT ,0 ); -if (IS_ERR (bridge)) -return PTR_ERR (bridge); - - err =drm_bridge_attach (&kcrtc->encoder, bridge,NULL ,0 ); +if (pipe->of_output_links[0 ]) { + err =komeda_attach_bridge (base->dev, pipe, encoder); +if (err) +return err; + }drm_crtc_enable_color_mgmt (crtc,0 , true,KOMEDA_COLOR_LUT_SIZE ); -return err; +return 0 ; }int komeda_kms_add_crtcs (struct komeda_kms_dev *kms,struct komeda_dev *mdev)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 267/809 drm/amdkfd: Fix CU Masking for GFX 9.4.3
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mukul Joshi <[email protected]>
[ Upstream commit 85cf43c554e438e2e12b0fe109688c9533e4d93f ]
We are incorrectly passing the first XCC's MQD when updating CU masks for other XCCs in the partition. Fix this by passing the MQD for the XCC currently being updated with CU mask to update_cu_mask function.
--- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +1 -1
@@ -713,7 +713,7 @@ static void update_mqd_v9_4_3(struct mqd_manager *mm, void *mqd, m =get_mqd (mqd + size * xcc);update_mqd (mm, m, q, minfo); -update_cu_mask (mm, mqd, minfo, xcc); +update_cu_mask (mm, m, minfo, xcc);if (q->format ==KFD_QUEUE_FORMAT_AQL ) {switch (xcc) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 268/809 drm/i915/psr: Rename has_psr2 as has_sel_update
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <[email protected]>
[ Upstream commit 1e52db8a439b147f314681129f9ee33f16900767 ]
We are going to reuse has_psr2 for panel_replay as well. Rename it as has_sel_update to avoid confusion.
v3: do not add has_psr check into psr2 case in intel_dp_compute_vsc_sdp
v2: Rebase
Stable-dep-of: d07a578703db ("drm/i915/display: Do not print "psr: enabled" for on Panel Replay")
--- drivers/gpu/drm/i915/display/intel_crtc_state_dump.c | 4 ++-- drivers/gpu/drm/i915/display/intel_display.c | 2 +- drivers/gpu/drm/i915/display/intel_display_types.h | 2 +- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 10 +++++----- 6 files changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +2 -2
@@ -251,9 +251,9 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,drm_printf (&p,"sdp split: %s\n" ,str_enabled_disabled (pipe_config->sdp_split_enable)); -drm_printf (&p,"psr: %s, psr2: %s, panel replay: %s, selective fetch: %s\n" , +drm_printf (&p,"psr: %s, selective update: %s, panel replay: %s, selective fetch: %s\n" ,str_enabled_disabled (pipe_config->has_psr), -str_enabled_disabled (pipe_config->has_psr2), +str_enabled_disabled (pipe_config->has_sel_update),str_enabled_disabled (pipe_config->has_panel_replay),str_enabled_disabled (pipe_config->enable_psr2_sel_fetch)); }
drivers/gpu/drm/i915/display/intel_display.c +1 -1
@@ -5320,7 +5320,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,*/ if (current_config->has_panel_replay || pipe_config->has_panel_replay) {PIPE_CONF_CHECK_BOOL (has_psr); -PIPE_CONF_CHECK_BOOL (has_psr2); +PIPE_CONF_CHECK_BOOL (has_sel_update);PIPE_CONF_CHECK_BOOL (enable_psr2_sel_fetch);PIPE_CONF_CHECK_BOOL (enable_psr2_su_region_et);PIPE_CONF_CHECK_BOOL (has_panel_replay);
drivers/gpu/drm/i915/display/intel_display_types.h +1 -1
@@ -1189,7 +1189,7 @@ struct intel_crtc_state {/* PSR is supported but might not be enabled due the lack of enabled planes */ bool has_psr; -bool has_psr2; +bool has_sel_update;bool enable_psr2_sel_fetch;bool enable_psr2_su_region_et;bool req_psr2_sdp_prior_scanline;
drivers/gpu/drm/i915/display/intel_dp.c +1 -1
@@ -2664,7 +2664,7 @@ static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,if (intel_dp_needs_vsc_sdp (crtc_state, conn_state)) {intel_dp_compute_vsc_colorimetry (crtc_state, conn_state, vsc); - }else if (crtc_state->has_psr2) { + }else if (crtc_state->has_sel_update) {/* * [PSR2 without colorimetry] * Prepare VSC Header for SU as per eDP 1.4 spec, Table 6-11
drivers/gpu/drm/i915/display/intel_fbc.c +1 -1
@@ -1251,7 +1251,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,* Recommendation is to keep this combination disabled * Bspec: 50422 HSD: 14010260002 */ -if (IS_DISPLAY_VER (i915,12 ,14 ) && crtc_state->has_psr2) { +if (IS_DISPLAY_VER (i915,12 ,14 ) && crtc_state->has_sel_update) { plane_state->no_fbc_reason ="PSR2 enabled" ;return 0 ; }
drivers/gpu/drm/i915/display/intel_psr.c +5 -5
@@ -651,7 +651,7 @@ void intel_psr_enable_sink(struct intel_dp *intel_dp,struct drm_i915_private *dev_priv =dp_to_i915 (intel_dp);u8 dpcd_val =DP_PSR_ENABLE ; -if (crtc_state->has_psr2) { +if (crtc_state->has_sel_update) {/* Enable ALPM at sink for psr2 */ if (!crtc_state->has_panel_replay) { drm_dp_dpcd_writeb(&intel_dp->aux,
@@ -1639,7 +1639,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,if (!crtc_state->has_psr)return ; - crtc_state->has_psr2 =intel_psr2_config_valid (intel_dp, crtc_state); + crtc_state->has_sel_update =intel_psr2_config_valid (intel_dp, crtc_state); } void intel_psr_get_config(struct intel_encoder *encoder,
@@ -1672,7 +1672,7 @@ void intel_psr_get_config(struct intel_encoder *encoder, pipe_config->has_psr = true; } - pipe_config->has_psr2 = intel_dp->psr.psr2_enabled; + pipe_config->has_sel_update = intel_dp->psr.psr2_enabled; pipe_config->infoframes.enable |=intel_hdmi_infoframe_enable (DP_SDP_VSC );if (!intel_dp->psr.psr2_enabled)
@@ -1960,7 +1960,7 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,drm_WARN_ON (&dev_priv->drm, intel_dp->psr.enabled); - intel_dp->psr.psr2_enabled = crtc_state->has_psr2; + intel_dp->psr.psr2_enabled = crtc_state->has_sel_update; intel_dp->psr.panel_replay_enabled = crtc_state->has_panel_replay; intel_dp->psr.busy_frontbuffer_bits =0 ; intel_dp->psr.pipe =to_intel_crtc (crtc_state->uapi.crtc)->pipe;
@@ -2688,7 +2688,7 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state, needs_to_disable |=intel_crtc_needs_modeset (new_crtc_state); needs_to_disable |= !new_crtc_state->has_psr; needs_to_disable |= !new_crtc_state->active_planes; - needs_to_disable |= new_crtc_state->has_psr2 != psr->psr2_enabled; + needs_to_disable |= new_crtc_state->has_sel_update != psr->psr2_enabled; needs_to_disable |=DISPLAY_VER (i915) <11 && new_crtc_state->wm_level_disabled;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 269/809 drm/i915/display: Do not print "psr: enabled" for on Panel Replay
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <[email protected]>
[ Upstream commit d07a578703dbf839ea39bffc425fba2321f45543 ]
After setting has_psr for panel replay as well crtc state dump is improperly printing "psr: enabled" for Panel Replay as well. Fix this by checking also has_panel_replay.
--- drivers/gpu/drm/i915/display/intel_crtc_state_dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +2 -1
@@ -252,7 +252,8 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config, str_enabled_disabled(pipe_config->sdp_split_enable));drm_printf (&p,"psr: %s, selective update: %s, panel replay: %s, selective fetch: %s\n" , -str_enabled_disabled (pipe_config->has_psr), +str_enabled_disabled (pipe_config->has_psr && + !pipe_config->has_panel_replay),str_enabled_disabled (pipe_config->has_sel_update),str_enabled_disabled (pipe_config->has_panel_replay),str_enabled_disabled (pipe_config->enable_psr2_sel_fetch));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 270/809 drm/mipi-dsi: Fix theoretical int overflow in mipi_dsi_dcs_write_seq()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 0b03829fdece47beba9ecb7dbcbde4585ee3663e ]
The mipi_dsi_dcs_write_seq() macro makes a call to mipi_dsi_dcs_write_buffer() which returns a type ssize_t. The macro then stores it in an int and checks to see if it's negative. This could theoretically be a problem if "ssize_t" is larger than "int".
To see the issue, imagine that "ssize_t" is 32-bits and "int" is 16-bits, you could see a problem if there was some code out there that looked like:
mipi_dsi_dcs_write_seq(dsi, cmd, <32767 bytes as arguments>);
...since we'd get back that 32768 bytes were transferred and 32768 stored in a 16-bit int would look negative.
Though there are no callsites where we'd actually hit this (even if "int" was only 16-bit), it's cleaner to make the types match so let's fix it.
--- include/drm/drm_mipi_dsi.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
include/drm/drm_mipi_dsi.h +12 -12
@@ -333,18 +333,18 @@ int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi,* @cmd: Command * @seq: buffer containing data to be transmitted */ -#define mipi_dsi_dcs_write_seq(dsi, cmd, seq...) \ - do { \ - static const u8 d[] = { cmd, seq }; \ - struct device *dev = &dsi->dev; \ - int ret; \ - ret = mipi_dsi_dcs_write_buffer(dsi, d, ARRAY_SIZE(d)); \ - if (ret < 0) { \ - dev_err_ratelimited( \ - dev, "sending command %#02x failed: %d\n", \ - cmd, ret); \ - return ret; \ - } \ +#define mipi_dsi_dcs_write_seq(dsi, cmd, seq...) \ + do { \ + static const u8 d[] = { cmd, seq }; \ + struct device *dev = &dsi->dev; \ + ssize_t ret; \ + ret = mipi_dsi_dcs_write_buffer(dsi, d, ARRAY_SIZE(d)); \ + if (ret < 0) { \ + dev_err_ratelimited( \ + dev, "sending command %#02x failed: %zd\n", \ + cmd, ret); \ + return ret; \ + } \ } while (0)/**
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 271/809 drm/mipi-dsi: Fix theoretical int overflow in mipi_dsi_generic_write_seq()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 24acbcce5cc673886c2f4f9b3f6f89a9c6a53b7e ]
The mipi_dsi_generic_write_seq() macro makes a call to mipi_dsi_generic_write() which returns a type ssize_t. The macro then stores it in an int and checks to see if it's negative. This could theoretically be a problem if "ssize_t" is larger than "int".
To see the issue, imagine that "ssize_t" is 32-bits and "int" is 16-bits, you could see a problem if there was some code out there that looked like:
mipi_dsi_generic_write_seq(dsi, <32768 bytes as arguments>);
...since we'd get back that 32768 bytes were transferred and 32768 stored in a 16-bit int would look negative.
Though there are no callsites where we'd actually hit this (even if "int" was only 16-bit), it's cleaner to make the types match so let's fix it.
--- include/drm/drm_mipi_dsi.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
include/drm/drm_mipi_dsi.h +11 -11
@@ -314,17 +314,17 @@ int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi,* @dsi: DSI peripheral device * @seq: buffer containing the payload */ -#define mipi_dsi_generic_write_seq(dsi, seq...) \ - do { \ - static const u8 d[] = { seq }; \ - struct device *dev = &dsi->dev; \ - int ret; \ - ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \ - if (ret < 0) { \ - dev_err_ratelimited(dev, "transmit data failed: %d\n", \ - ret); \ - return ret; \ - } \ +#define mipi_dsi_generic_write_seq(dsi, seq...) \ + do { \ + static const u8 d[] = { seq }; \ + struct device *dev = &dsi->dev; \ + ssize_t ret; \ + ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \ + if (ret < 0) { \ + dev_err_ratelimited(dev, "transmit data failed: %zd\n", \ + ret); \ + return ret; \ + } \ } while (0)/**
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 272/809 drm/panel: lg-sw43408: add missing error handling
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 51f9183e4af8c7f00e81180cbb9ee4a98a0f0aa1 ]
Add missing error handling for the mipi_dsi_ functions that actually return error code instead of silently ignoring it.
--- drivers/gpu/drm/panel/panel-lg-sw43408.c | 33 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-)
drivers/gpu/drm/panel/panel-lg-sw43408.c +27 -6
@@ -62,16 +62,25 @@ static int sw43408_program(struct drm_panel *panel) {struct sw43408_panel *ctx =to_panel_info (panel);struct drm_dsc_picture_parameter_set pps; +int ret;mipi_dsi_dcs_write_seq (ctx->link,MIPI_DCS_SET_GAMMA_CURVE ,0x02 ); -mipi_dsi_dcs_set_tear_on (ctx->link,MIPI_DSI_DCS_TEAR_MODE_VBLANK ); + ret =mipi_dsi_dcs_set_tear_on (ctx->link,MIPI_DSI_DCS_TEAR_MODE_VBLANK ); +if (ret <0 ) { +dev_err (panel->dev,"Failed to set tearing: %d\n" , ret); +return ret; + }mipi_dsi_dcs_write_seq (ctx->link,0x53 ,0x0c ,0x30 );mipi_dsi_dcs_write_seq (ctx->link,0x55 ,0x00 ,0x70 ,0xdf ,0x00 ,0x70 ,0xdf );mipi_dsi_dcs_write_seq (ctx->link,0xf7 ,0x01 ,0x49 ,0x0c ); -mipi_dsi_dcs_exit_sleep_mode (ctx->link); + ret =mipi_dsi_dcs_exit_sleep_mode (ctx->link); +if (ret <0 ) { +dev_err (panel->dev,"Failed to exit sleep mode: %d\n" , ret); +return ret; + }msleep (135 );
@@ -97,14 +106,22 @@ static int sw43408_program(struct drm_panel *panel)mipi_dsi_dcs_write_seq (ctx->link,0x55 ,0x04 ,0x61 ,0xdb ,0x04 ,0x70 ,0xdb );mipi_dsi_dcs_write_seq (ctx->link,0xb0 ,0xca ); -mipi_dsi_dcs_set_display_on (ctx->link); + ret =mipi_dsi_dcs_set_display_on (ctx->link); +if (ret <0 ) { +dev_err (panel->dev,"Failed to set display on: %d\n" , ret); +return ret; + }msleep (50 ); ctx->link->mode_flags &= ~MIPI_DSI_MODE_LPM ;drm_dsc_pps_payload_pack (&pps, ctx->link->dsc); -mipi_dsi_picture_parameter_set (ctx->link, &pps); + ret =mipi_dsi_picture_parameter_set (ctx->link, &pps); +if (ret <0 ) { +dev_err (panel->dev,"Failed to set PPS: %d\n" , ret); +return ret; + } ctx->link->mode_flags |=MIPI_DSI_MODE_LPM ;
@@ -113,8 +130,12 @@ static int sw43408_program(struct drm_panel *panel)* PPS 1 if pps_identifier is 0 * PPS 2 if pps_identifier is 1 */ -mipi_dsi_compression_mode_ext (ctx->link, true, -MIPI_DSI_COMPRESSION_DSC ,1 ); + ret =mipi_dsi_compression_mode_ext (ctx->link, true, +MIPI_DSI_COMPRESSION_DSC ,1 ); +if (ret <0 ) { +dev_err (panel->dev,"Failed to set compression mode: %d\n" , ret); +return ret; + }return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 273/809 drm/amd/pm: Fix aldebaran pcie speed reporting
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
[ Upstream commit b6420021e17e262c57bb289d0556ee181b014f9c ]
Fix the field definitions for LC_CURRENT_DATA_RATE.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -2
@@ -79,8 +79,8 @@ MODULE_FIRMWARE("amdgpu/smu_13_0_10.bin");#define PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD_MASK 0x00000070L#define PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD__SHIFT 0x4#define smnPCIE_LC_SPEED_CNTL 0x11140290 -#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK 0xC000 -#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT 0xE +#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK 0xE0 +#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT 0x5#define ENABLE_IMU_ARG_GFXOFF_ENABLE 1
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 274/809 drm/amdgpu: Fix memory range calculation
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
[ Upstream commit ce798376ef6764de51d8f4684ae525b55df295fa ]
Consider the 16M reserved region also before range calculation for GMC 9.4.3 SOCs.
--- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -1
@@ -1910,7 +1910,7 @@ gmc_v9_0_init_sw_mem_ranges(struct amdgpu_device *adev,break ; } - size = adev->gmc.real_vram_size >>AMDGPU_GPU_PAGE_SHIFT ; + size = (adev->gmc.real_vram_size +SZ_16M ) >>AMDGPU_GPU_PAGE_SHIFT ; size /= adev->gmc.num_mem_partitions;for (i =0 ; i < adev->gmc.num_mem_partitions; ++i) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 275/809 drm/amdgpu: Check if NBIO funcs are NULL in amdgpu_device_baco_exit
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Friedrich Vock <[email protected]>
[ Upstream commit 0cdb3f9740844b9d95ca413e3fcff11f81223ecf ]
The special case for VM passthrough doesn't check adev->nbio.funcs before dereferencing it. If GPUs that don't have an NBIO block are passed through, this leads to a NULL pointer dereference on startup.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -6173,7 +6173,7 @@ int amdgpu_device_baco_exit(struct drm_device *dev) adev->nbio.funcs->enable_doorbell_interrupt) adev->nbio.funcs->enable_doorbell_interrupt(adev, true); -if (amdgpu_passthrough (adev) && +if (amdgpu_passthrough (adev) && adev->nbio.funcs && adev->nbio.funcs->clear_doorbell_interrupt) adev->nbio.funcs->clear_doorbell_interrupt (adev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 276/809 drm/amdgpu: Remove GC HW IP 9.3.0 from noretry=1
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Van Patten <[email protected]>
[ Upstream commit 1446226d32a45bb7c4f63195a59be8c08defe658 ]
The following commit updated gmc->noretry from 0 to 1 for GC HW IP 9.3.0:
commit 5f3854f1f4e2 ("drm/amdgpu: add more cases to noretry=1")This causes the device to hang when a page fault occurs, until the device is rebooted. Instead, revert back to gmc->noretry=0 so the device is still responsive.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -1
@@ -878,7 +878,6 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev)struct amdgpu_gmc *gmc = &adev->gmc;uint32_t gc_ver =amdgpu_ip_version (adev,GC_HWIP ,0 ); bool noretry_default = (gc_ver == IP_VERSION(9, 0, 1) || - gc_ver == IP_VERSION(9, 3, 0) || gc_ver == IP_VERSION(9, 4, 0) || gc_ver == IP_VERSION(9, 4, 1) || gc_ver == IP_VERSION(9, 4, 2) ||
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 277/809 drm/panel: himax-hx8394: Handle errors from mipi_dsi_dcs_set_display_on() better
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit cc2db2ef8d9eebc0df03808ac0dadbdb96733499 ]
If mipi_dsi_dcs_set_display_on() returned an error then we'd store that in the "ret" variable and jump to error handling. We'd then attempt an orderly poweroff. Unfortunately we then blew away the value stored in "ret". That means that if the orderly poweroff actually worked then we're return 0 (no error) from hx8394_enable() even though the panel wasn't enabled.
Fix this by not blowing away "ret".
Found by code inspection.
--- drivers/gpu/drm/panel/panel-himax-hx8394.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-himax-hx8394.c +1 -2
@@ -370,8 +370,7 @@ static int hx8394_enable(struct drm_panel *panel) sleep_in:/* This will probably fail, but let's try orderly power off anyway. */ - ret =mipi_dsi_dcs_enter_sleep_mode (dsi); -if (!ret) +if (!mipi_dsi_dcs_enter_sleep_mode (dsi))msleep (50 );return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 278/809 drm/panel: boe-tv101wum-nl6: If prepare fails, disable GPIO before regulators
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 587c48f622374e5d47b1d515c6006a4df4dee882 ]
The enable GPIO should clearly be set low before turning off regulators. That matches both the inverse order that things were enabled and also the order in unprepare().
--- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +1 -1
@@ -1528,13 +1528,13 @@ static int boe_panel_prepare(struct drm_panel *panel)return 0 ; poweroff: +gpiod_set_value (boe->enable_gpio,0 );regulator_disable (boe->avee); poweroffavdd:regulator_disable (boe->avdd); poweroff1v8:usleep_range (5000 ,7000 );regulator_disable (boe->pp1800); -gpiod_set_value (boe->enable_gpio,0 );return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 279/809 drm/panel: boe-tv101wum-nl6: Check for errors on the NOP in prepare()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 6320b9199dd99622668649c234d4e8a99e44a9c8 ]
The mipi_dsi_dcs_nop() function returns an error but we weren't checking it in boe_panel_prepare(). Add a check. This is highly unlikely to matter in practice. If the NOP failed then likely later MIPI commands would fail too.
Found by code inspection.
--- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +5 -1
@@ -1507,7 +1507,11 @@ static int boe_panel_prepare(struct drm_panel *panel)usleep_range (10000 ,11000 );if (boe->desc->lp11_before_reset) { -mipi_dsi_dcs_nop (boe->dsi); + ret =mipi_dsi_dcs_nop (boe->dsi); +if (ret <0 ) { +dev_err (&boe->dsi->dev,"Failed to send NOP: %d\n" , ret); + goto poweroff; + }usleep_range (1000 ,2000 ); }gpiod_set_value (boe->enable_gpio,1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 280/809 drm/panel: ilitek-ili9882t: If prepare fails, disable GPIO before regulators
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 554c00181968d43426bfe68c86541b89265075de ]
The enable GPIO should clearly be set low before turning off regulators. That matches both the inverse order that things were enabled and also the order in unprepare().
--- drivers/gpu/drm/panel/panel-ilitek-ili9882t.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ilitek-ili9882t.c +1 -1
@@ -579,13 +579,13 @@ static int ili9882t_prepare(struct drm_panel *panel)return 0 ; poweroff: +gpiod_set_value (ili->enable_gpio,0 );regulator_disable (ili->avee); poweroffavdd:regulator_disable (ili->avdd); poweroff1v8:usleep_range (5000 ,7000 );regulator_disable (ili->pp1800); -gpiod_set_value (ili->enable_gpio,0 );return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 281/809 drm/panel: ilitek-ili9882t: Check for errors on the NOP in prepare()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 6a7bd6cde73f0fb7e5faa964dbdeb45b55c64698 ]
The mipi_dsi_dcs_nop() function returns an error but we weren't checking it in ili9882t_prepare(). Add a check. This is highly unlikely to matter in practice. If the NOP failed then likely later MIPI commands would fail too.
Found by code inspection.
--- drivers/gpu/drm/panel/panel-ilitek-ili9882t.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ilitek-ili9882t.c +5 -1
@@ -560,7 +560,11 @@ static int ili9882t_prepare(struct drm_panel *panel)usleep_range (10000 ,11000 );// MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high -mipi_dsi_dcs_nop (ili->dsi); + ret =mipi_dsi_dcs_nop (ili->dsi); +if (ret <0 ) { +dev_err (&ili->dsi->dev,"Failed to send NOP: %d\n" , ret); + goto poweroff; + }usleep_range (1000 ,2000 );gpiod_set_value (ili->enable_gpio,1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 282/809 drm/bridge: it6505: fix hibernate to resume no display issue
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuro Chung <[email protected]>
[ Upstream commit 484436ec5c2bffe8f346a09ae1cbc4cbf5e50005 ]
When the system power resumes, the TTL input of IT6505 may experience some noise before the video signal stabilizes, necessitating a video reset. This patch is implemented to prevent a loop of video error interrupts, which can occur when a video reset in the video FIFO error interrupt triggers another such interrupt. The patch processes the SCDT and FIFO error interrupts simultaneously and ignores any video FIFO error interrupts caused by a video reset.
--- drivers/gpu/drm/bridge/ite-it6505.c | 73 +++++++++++++++++++---------- 1 file changed, 49 insertions(+), 24 deletions(-)
drivers/gpu/drm/bridge/ite-it6505.c +49 -24
@@ -1307,9 +1307,15 @@ static void it6505_video_reset(struct it6505 *it6505)it6505_link_reset_step_train (it6505);it6505_set_bits (it6505,REG_DATA_MUTE_CTRL ,EN_VID_MUTE ,EN_VID_MUTE );it6505_set_bits (it6505,REG_INFOFRAME_CTRL ,EN_VID_CTRL_PKT ,0x00 ); -it6505_set_bits (it6505,REG_RESET_CTRL ,VIDEO_RESET ,VIDEO_RESET ); + +it6505_set_bits (it6505,REG_VID_BUS_CTRL1 ,TX_FIFO_RESET ,TX_FIFO_RESET ); +it6505_set_bits (it6505,REG_VID_BUS_CTRL1 ,TX_FIFO_RESET ,0x00 ); +it6505_set_bits (it6505,REG_501_FIFO_CTRL ,RST_501_FIFO ,RST_501_FIFO );it6505_set_bits (it6505,REG_501_FIFO_CTRL ,RST_501_FIFO ,0x00 ); + +it6505_set_bits (it6505,REG_RESET_CTRL ,VIDEO_RESET ,VIDEO_RESET ); +usleep_range (1000 ,2000 );it6505_set_bits (it6505,REG_RESET_CTRL ,VIDEO_RESET ,0x00 ); }
@@ -2245,12 +2251,11 @@ static void it6505_link_training_work(struct work_struct *work)if (ret) { it6505->auto_train_retry =AUTO_TRAIN_RETRY ;it6505_link_train_ok (it6505); -return ; }else { it6505->auto_train_retry--; +it6505_dump (it6505); } -it6505_dump (it6505); }static void it6505_plugged_status_to_codec (struct it6505 *it6505)
@@ -2471,31 +2476,53 @@ static void it6505_irq_link_train_fail(struct it6505 *it6505)schedule_work (&it6505->link_works); } -static void it6505_irq_video_fifo_error (struct it6505 *it6505) +static bool it6505_test_bit (unsigned int bit,const unsigned int *addr) { -struct device *dev = it6505->dev; - -DRM_DEV_DEBUG_DRIVER (dev,"video fifo overflow interrupt" ); - it6505->auto_train_retry =AUTO_TRAIN_RETRY ; -flush_work (&it6505->link_works); -it6505_stop_hdcp (it6505); -it6505_video_reset (it6505); +return 1 & (addr[bit /BITS_PER_BYTE ] >> (bit %BITS_PER_BYTE )); } -static void it6505_irq_io_latch_fifo_overflow (struct it6505 *it6505) +static void it6505_irq_video_handler (struct it6505 *it6505,const int *int_status) {struct device *dev = it6505->dev; +int reg_0d, reg_int03; -DRM_DEV_DEBUG_DRIVER (dev,"IO latch fifo overflow interrupt" ); - it6505->auto_train_retry =AUTO_TRAIN_RETRY ; -flush_work (&it6505->link_works); -it6505_stop_hdcp (it6505); -it6505_video_reset (it6505); -} +/* +* When video SCDT change with video not stable, +* Or video FIFO error, need video reset +*/ -static bool it6505_test_bit (unsigned int bit,const unsigned int *addr) -{ -return 1 & (addr[bit /BITS_PER_BYTE ] >> (bit %BITS_PER_BYTE )); +if ((!it6505_get_video_status (it6505) && + (it6505_test_bit (INT_SCDT_CHANGE , (unsigned int *)int_status))) || + (it6505_test_bit (BIT_INT_IO_FIFO_OVERFLOW , + (unsigned int *)int_status)) || + (it6505_test_bit (BIT_INT_VID_FIFO_ERROR , + (unsigned int *)int_status))) { + it6505->auto_train_retry =AUTO_TRAIN_RETRY ; +flush_work (&it6505->link_works); +it6505_stop_hdcp (it6505); +it6505_video_reset (it6505); + +usleep_range (10000 ,11000 ); + +/* +* Clear FIFO error IRQ to prevent fifo error -> reset loop +* HW will trigger SCDT change IRQ again when video stable +*/ + + reg_int03 =it6505_read (it6505,INT_STATUS_03 ); + reg_0d =it6505_read (it6505,REG_SYSTEM_STS ); + + reg_int03 &= (BIT (INT_VID_FIFO_ERROR ) |BIT (INT_IO_LATCH_FIFO_OVERFLOW )); +it6505_write (it6505,INT_STATUS_03 , reg_int03); + +DRM_DEV_DEBUG_DRIVER (dev,"reg08 = 0x%02x" , reg_int03); +DRM_DEV_DEBUG_DRIVER (dev,"reg0D = 0x%02x" , reg_0d); + +return ; + } + +if (it6505_test_bit (INT_SCDT_CHANGE , (unsigned int *)int_status)) +it6505_irq_scdt (it6505); }static irqreturn_t it6505_int_threaded_handler (int unused,void *data)
@@ -2508,15 +2535,12 @@ static irqreturn_t it6505_int_threaded_handler(int unused, void *data) } irq_vec[] = { { BIT_INT_HPD, it6505_irq_hpd }, { BIT_INT_HPD_IRQ, it6505_irq_hpd_irq }, - { BIT_INT_SCDT, it6505_irq_scdt }, { BIT_INT_HDCP_FAIL, it6505_irq_hdcp_fail }, { BIT_INT_HDCP_DONE, it6505_irq_hdcp_done }, { BIT_INT_AUX_CMD_FAIL, it6505_irq_aux_cmd_fail }, { BIT_INT_HDCP_KSV_CHECK, it6505_irq_hdcp_ksv_check }, { BIT_INT_AUDIO_FIFO_ERROR, it6505_irq_audio_fifo_error }, { BIT_INT_LINK_TRAIN_FAIL, it6505_irq_link_train_fail }, - { BIT_INT_VID_FIFO_ERROR, it6505_irq_video_fifo_error }, - { BIT_INT_IO_FIFO_OVERFLOW, it6505_irq_io_latch_fifo_overflow }, }; int int_status[3], i;
@@ -2546,6 +2570,7 @@ static irqreturn_t it6505_int_threaded_handler(int unused, void *data)if (it6505_test_bit (irq_vec[i].bit, (unsigned int *)int_status)) irq_vec[i].handler (it6505); } +it6505_irq_video_handler (it6505, (unsigned int *)int_status); }pm_runtime_put_sync (dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 283/809 drm/amdgpu: Fix snprintf usage in amdgpu_gfx_kiq_init_ring
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
[ Upstream commit 0ea55445554209913a72eab86b60f5788776c4d6 ]
This commit fixes a format truncation issue arosed by the snprintf function potentially writing more characters into the ring->name buffer than it can hold, in the amdgpu_gfx_kiq_init_ring function
The issue occurred because the '%d' format specifier could write between 1 and 10 bytes into a region of size between 0 and 8, depending on the values of xcc_id, ring->me, ring->pipe, and ring->queue. The snprintf function could output between 12 and 41 bytes into a destination of size 16, leading to potential truncation.
To resolve this, the snprintf line was modified to use the '%hhu' format specifier for xcc_id, ring->me, ring->pipe, and ring->queue. The '%hhu' specifier is used for unsigned char variables and ensures that these values are printed as unsigned decimal integers.
Fixes the below with gcc W=1:drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function ‘amdgpu_gfx_kiq_init_ring’:drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:332:61: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 8 [-Wformat-truncation=]
332 | snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
| ^~drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:332:50: note: directive argument in the range [0, 2147483647]
332 | snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
| ^~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:332:9: note: ‘snprintf’ output between 12 and 41 bytes into a destination of size 16
332 | snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333 | xcc_id, ring->me, ring->pipe, ring->queue);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -1
@@ -329,7 +329,7 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev, int xcc_id) ring->eop_gpu_addr = kiq->eop_gpu_addr; ring->no_scheduler = true; -snprintf (ring->name,sizeof (ring->name),"kiq_%d.%d.%d.%d" , +snprintf (ring->name,sizeof (ring->name),"kiq_%hhu.%hhu.%hhu.%hhu" , xcc_id, ring->me, ring->pipe, ring->queue); r =amdgpu_ring_init (adev, ring,1024 , irq,AMDGPU_CP_KIQ_IRQ_DRIVER0 ,AMDGPU_RING_PRIO_DEFAULT ,NULL );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 284/809 drm/amd/display: dynamically allocate dml2_configuration_options structures
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 88c61827cedc14cd305d4266dc18ff0fdb3f8d4c ]
This structure is too large to fit on a stack, as shown by the newly introduced warnings from a recent code change:
drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn32/dcn32_resource.c: In function 'dcn32_update_bw_bounding_box':drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn32/dcn32_resource.c:2019:1: error: the frame size of 1180 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn321/dcn321_resource.c: In function 'dcn321_update_bw_bounding_box':drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn321/dcn321_resource.c:1597:1: error: the frame size of 1180 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_state.c: In function 'dc_state_create':drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_state.c:219:1: error: the frame size of 1184 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
Instead of open-coding the assignment of a large structure to a stack variable, use an explicit kmemdup() in each case to move it off the stack.
--- .../display/dc/resource/dcn32/dcn32_resource.c | 16 +++++++++++----- .../display/dc/resource/dcn321/dcn321_resource.c | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +11 -5
@@ -2006,21 +2006,27 @@ void dcn32_calculate_wm_and_dlg(struct dc *dc, struct dc_state *context,static void dcn32_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) { -struct dml2_configuration_options dml2_opt = dc->dml2_options; +struct dml2_configuration_options *dml2_opt; + + dml2_opt =kmemdup (&dc->dml2_options,sizeof (dc->dml2_options),GFP_KERNEL ); +if (!dml2_opt) +return ;DC_FP_START ();dcn32_update_bw_bounding_box_fpu (dc, bw_params); - dml2_opt.use_clock_dc_limits = false; + dml2_opt->use_clock_dc_limits = false;if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2) -dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2); +dml2_reinit (dc, dml2_opt, &dc->current_state->bw_ctx.dml2); - dml2_opt.use_clock_dc_limits = true; + dml2_opt->use_clock_dc_limits = true;if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2_dc_power_source) -dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source); +dml2_reinit (dc, dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source);DC_FP_END (); + +kfree (dml2_opt); }static struct resource_funcs dcn32_res_pool_funcs = {
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +11 -5
@@ -1581,21 +1581,27 @@ static struct dc_cap_funcs cap_funcs = {static void dcn321_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) { -struct dml2_configuration_options dml2_opt = dc->dml2_options; +struct dml2_configuration_options *dml2_opt; + + dml2_opt =kmemdup (&dc->dml2_options,sizeof (dc->dml2_options),GFP_KERNEL ); +if (!dml2_opt) +return ;DC_FP_START ();dcn321_update_bw_bounding_box_fpu (dc, bw_params); - dml2_opt.use_clock_dc_limits = false; + dml2_opt->use_clock_dc_limits = false;if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2) -dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2); +dml2_reinit (dc, dml2_opt, &dc->current_state->bw_ctx.dml2); - dml2_opt.use_clock_dc_limits = true; + dml2_opt->use_clock_dc_limits = true;if (dc->debug.using_dml2 && dc->current_state && dc->current_state->bw_ctx.dml2_dc_power_source) -dml2_reinit (dc, &dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source); +dml2_reinit (dc, dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source);DC_FP_END (); + +kfree (dml2_opt); }static struct resource_funcs dcn321_res_pool_funcs = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 285/809 drm/amd/display: fix graphics_object_id size
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 6d438caaeaa1a7fae7b523e7bc4cee262b9f101a ]
The graphics_object_id structure is meant to fit into 32 bits, as it's passed by value in and out of functions. A recent change increased the size to 128 bits, so it's now always passed by reference, which is clearly not intended and ends up producing a compile-time warning:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c: In function 'construct_phy':drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c:743:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
Add back the bitfields to revert to the original size, while keeping the 'enum' type change.
--- drivers/gpu/drm/amd/display/include/grph_object_id.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/include/grph_object_id.h +2 -2
@@ -226,8 +226,8 @@ enum dp_alt_mode {struct graphics_object_id {uint32_t id:8 ; -enum object_enum_id enum_id; -enum object_type type; +enum object_enum_id enum_id :4 ; +enum object_type type :4 ;uint32_t reserved:16 ;/* for padding. total size should be u32 */ };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 286/809 drm/amd/display: Move struct scaler_data off stack
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit f8718c482572181ca364ffca3c27365cc83cfe9e ]
The scaler_data structure is implicitly copied onto the stack twice by being returned from a function. This is usually a bad idea, but it was not flagged by the compiler until a recent addition that pushed it over the 1024 byte function stack limit:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_translation_helper.c: In function 'populate_dml_plane_cfg_from_plane_state':drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_translation_helper.c:1075:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
Use an explicit kzalloc() and memcpy() instead here to keep it off the stack.
--- .../display/dc/dml2/dml2_translation_helper.c | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +31 -25
@@ -804,7 +804,7 @@ static void populate_dml_surface_cfg_from_plane_state(enum dml_project_id dml2_p } } -static struct scaler_data get_scaler_data_for_plane (const struct dc_plane_state *in,struct dc_state *context) +static void get_scaler_data_for_plane (const struct dc_plane_state *in,struct dc_state *context,struct scaler_data *out) {int i;struct pipe_ctx *temp_pipe = &context->res_ctx.temp_pipe;
@@ -825,7 +825,7 @@ static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state }ASSERT (i <MAX_PIPES ); -return temp_pipe->plane_res.scl_data; +memcpy (out, &temp_pipe->plane_res.scl_data,sizeof (*out)); }static void populate_dummy_dml_plane_cfg (struct dml_plane_cfg_st *out,unsigned int location,const struct dc_stream_state *in)
@@ -884,27 +884,31 @@ static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsignedstatic void populate_dml_plane_cfg_from_plane_state (struct dml_plane_cfg_st *out,unsigned int location,const struct dc_plane_state *in,struct dc_state *context) { -const struct scaler_data scaler_data =get_scaler_data_for_plane (in, context); +struct scaler_data *scaler_data =kzalloc (sizeof (*scaler_data),GFP_KERNEL ); +if (!scaler_data) +return ; + +get_scaler_data_for_plane (in, context, scaler_data); out->CursorBPP[location] = dml_cur_32bit; out->CursorWidth[location] =256 ; out->GPUVMMinPageSizeKBytes[location] =256 ; - out->ViewportWidth[location] = scaler_data.viewport.width; - out->ViewportHeight[location] = scaler_data.viewport.height; - out->ViewportWidthChroma[location] = scaler_data.viewport_c.width; - out->ViewportHeightChroma[location] = scaler_data.viewport_c.height; - out->ViewportXStart[location] = scaler_data.viewport.x; - out->ViewportYStart[location] = scaler_data.viewport.y; - out->ViewportXStartC[location] = scaler_data.viewport_c.x; - out->ViewportYStartC[location] = scaler_data.viewport_c.y; + out->ViewportWidth[location] = scaler_data->viewport.width; + out->ViewportHeight[location] = scaler_data->viewport.height; + out->ViewportWidthChroma[location] = scaler_data->viewport_c.width; + out->ViewportHeightChroma[location] = scaler_data->viewport_c.height; + out->ViewportXStart[location] = scaler_data->viewport.x; + out->ViewportYStart[location] = scaler_data->viewport.y; + out->ViewportXStartC[location] = scaler_data->viewport_c.x; + out->ViewportYStartC[location] = scaler_data->viewport_c.y; out->ViewportStationary[location] = false; - out->ScalerEnabled[location] = scaler_data.ratios.horz.value != dc_fixpt_one.value || - scaler_data.ratios.horz_c.value != dc_fixpt_one.value || - scaler_data.ratios.vert.value != dc_fixpt_one.value || - scaler_data.ratios.vert_c.value != dc_fixpt_one.value; + out->ScalerEnabled[location] = scaler_data->ratios.horz.value != dc_fixpt_one.value || + scaler_data->ratios.horz_c.value != dc_fixpt_one.value || + scaler_data->ratios.vert.value != dc_fixpt_one.value || + scaler_data->ratios.vert_c.value != dc_fixpt_one.value;/* Current driver code base uses LBBitPerPixel as 57. There is a discrepancy * from the HW/DML teams about this value. Initialize LBBitPerPixel with the
@@ -920,25 +924,25 @@ static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out out->VRatioChroma[location] =1 ; }else {/* Follow the original dml_wrapper.c code direction to fix scaling issues */ - out->HRatio[location] = (dml_float_t )scaler_data.ratios.horz.value / (1ULL <<32 ); - out->HRatioChroma[location] = (dml_float_t )scaler_data.ratios.horz_c.value / (1ULL <<32 ); - out->VRatio[location] = (dml_float_t )scaler_data.ratios.vert.value / (1ULL <<32 ); - out->VRatioChroma[location] = (dml_float_t )scaler_data.ratios.vert_c.value / (1ULL <<32 ); + out->HRatio[location] = (dml_float_t )scaler_data->ratios.horz.value / (1ULL <<32 ); + out->HRatioChroma[location] = (dml_float_t )scaler_data->ratios.horz_c.value / (1ULL <<32 ); + out->VRatio[location] = (dml_float_t )scaler_data->ratios.vert.value / (1ULL <<32 ); + out->VRatioChroma[location] = (dml_float_t )scaler_data->ratios.vert_c.value / (1ULL <<32 ); } -if (!scaler_data.taps.h_taps) { +if (!scaler_data->taps.h_taps) { out->HTaps[location] =1 ; out->HTapsChroma[location] =1 ; }else { - out->HTaps[location] = scaler_data.taps.h_taps; - out->HTapsChroma[location] = scaler_data.taps.h_taps_c; + out->HTaps[location] = scaler_data->taps.h_taps; + out->HTapsChroma[location] = scaler_data->taps.h_taps_c; } -if (!scaler_data.taps.v_taps) { +if (!scaler_data->taps.v_taps) { out->VTaps[location] =1 ; out->VTapsChroma[location] =1 ; }else { - out->VTaps[location] = scaler_data.taps.v_taps; - out->VTapsChroma[location] = scaler_data.taps.v_taps_c; + out->VTaps[location] = scaler_data->taps.v_taps; + out->VTapsChroma[location] = scaler_data->taps.v_taps_c; } out->SourceScan[location] = (enum dml_rotation_angle )in->rotation;
@@ -949,6 +953,8 @@ static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out out->DynamicMetadataTransmittedBytes[location] =0 ; out->NumberOfCursors[location] =1 ; + +kfree (scaler_data); } static unsigned int map_stream_to_dml_display_cfg(const struct dml2_context *dml2,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 287/809 media: pci: ivtv: Add check for DMA map result
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Kobuk <[email protected]>
[ Upstream commit 629913d6d79508b166c66e07e4857e20233d85a9 ]
In case DMA fails, 'dma->SG_length' is 0. This value is later used to access 'dma->SGarray[dma->SG_length - 1]', which will cause out of bounds access.
Add check to return early on invalid value. Adjust warnings accordingly.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/media/pci/ivtv/ivtv-udma.c | 8 ++++++++ drivers/media/pci/ivtv/ivtv-yuv.c | 6 ++++++ drivers/media/pci/ivtv/ivtvfb.c | 6 +++--- 3 files changed, 17 insertions(+), 3 deletions(-)
drivers/media/pci/ivtv/ivtv-udma.c +8 -0
@@ -131,6 +131,8 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,/* Fill SG List with new values */ if (ivtv_udma_fill_sg_list (dma, &user_dma,0 ) <0 ) { +IVTV_DEBUG_WARN ("%s: could not allocate bounce buffers for highmem userspace buffers\n" , + __func__);unpin_user_pages (dma->map, dma->page_count); dma->page_count =0 ;return -ENOMEM ;
@@ -139,6 +141,12 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,/* Map SG List */ dma->SG_length =dma_map_sg (&itv->pdev->dev, dma->SGlist, dma->page_count,DMA_TO_DEVICE ); +if (!dma->SG_length) { +IVTV_DEBUG_WARN ("%s: DMA map error, SG_length is 0\n" , __func__); +unpin_user_pages (dma->map, dma->page_count); + dma->page_count =0 ; +return -EINVAL ; + }/* Fill SG Array with new values */ ivtv_udma_fill_sg_array (dma, ivtv_dest_addr,0 ,-1 );
drivers/media/pci/ivtv/ivtv-yuv.c +6 -0
@@ -114,6 +114,12 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma, } dma->SG_length =dma_map_sg (&itv->pdev->dev, dma->SGlist, dma->page_count,DMA_TO_DEVICE ); +if (!dma->SG_length) { +IVTV_DEBUG_WARN ("%s: DMA map error, SG_length is 0\n" , __func__); +unpin_user_pages (dma->map, dma->page_count); + dma->page_count =0 ; +return -EINVAL ; + }/* Fill SG Array with new values */ ivtv_udma_fill_sg_array (dma, y_buffer_offset, uv_buffer_offset, y_size);
drivers/media/pci/ivtv/ivtvfb.c +3 -3
@@ -281,10 +281,10 @@ static int ivtvfb_prep_dec_dma_to_device(struct ivtv *itv,/* Map User DMA */ if (ivtv_udma_setup (itv, ivtv_dest_addr, userbuf, size_in_bytes) <=0 ) {mutex_unlock (&itv->udma.lock); -IVTVFB_WARN ("ivtvfb_prep_dec_dma_to_device, Error with pin_user_pages: %d bytes, %d pages returned\n" , - size_in_bytes, itv->udma.page_count); +IVTVFB_WARN ("%s, Error in ivtv_udma_setup: %d bytes, %d pages returned\n" , + __func__, size_in_bytes, itv->udma.page_count); -/* pin_user_pages must have failed completely */ +/* pin_user_pages or DMA must have failed completely */ return -EIO ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 288/809 media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit 2052138b7da52ad5ccaf74f736d00f39a1c9198c ]
Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)
Looking into the codes, there is a loop in dvb_usb_read_remote_control(), that is in rc_core_dvb_usb_remote_init() create a work that will call dvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively call dvb_usb_read_remote_control(), see following code snippet:
rc_core_dvb_usb_remote_init() {
...
INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control);
schedule_delayed_work(&d->rc_query_work,
msecs_to_jiffies(rc_interval));
...
}
dvb_usb_read_remote_control() {
...
err = d->props.rc.core.rc_query(d);
if (err)
err(...) // Did not return even if query failed
schedule_delayed_work(&d->rc_query_work,
msecs_to_jiffies(rc_interval));
}When the infinite log printing occurs, the query callback 'd->props.rc.core.rc_query' is cxusb_rc_query(). And the log is due to the failure of finding a valid 'generic_bulk_ctrl_endpoint' in usb_bulk_msg(), see following code snippet:
cxusb_rc_query() {
cxusb_ctrl_msg() {
dvb_usb_generic_rw() {
ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev,
d->props.generic_bulk_ctrl_endpoint),...);
if (ret)
err("bulk message failed: %d (%d/%d)",ret,wlen,actlen);
...
}
...
}By analyzing the corresponding USB descriptor, it shows that the bNumEndpoints is 0 in its interface descriptor, but
the 'generic_bulk_ctrl_endpoint' is 1, that means user don't configure a valid endpoint for 'generic_bulk_ctrl_endpoint', therefore this 'invalid' USB device should be rejected before it calls into dvb_usb_read_remote_control().
To fix it, we need to add endpoint check for 'generic_bulk_ctrl_endpoint'. And as Sean suggested, the same check and clear halts should be done for 'generic_bulk_ctrl_endpoint_response'. So introduce dvb_usb_check_bulk_endpoint() to do it for both of them.
--- drivers/media/usb/dvb-usb/dvb-usb-init.c | 35 +++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-)
drivers/media/usb/dvb-usb/dvb-usb-init.c +31 -4
@@ -23,11 +23,40 @@ static int dvb_usb_force_pid_filter_usage;module_param_named (force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int,0444 );MODULE_PARM_DESC (force_pid_filter_usage,"force all dvb-usb-devices to use a PID filter, if any (default: 0)." ); +static int dvb_usb_check_bulk_endpoint (struct dvb_usb_device *d,u8 endpoint) +{ +if (endpoint) { +int ret; + + ret =usb_pipe_type_check (d->udev,usb_sndbulkpipe (d->udev, endpoint)); +if (ret) +return ret; + ret =usb_pipe_type_check (d->udev,usb_rcvbulkpipe (d->udev, endpoint)); +if (ret) +return ret; + } +return 0 ; +} + +static void dvb_usb_clear_halt (struct dvb_usb_device *d,u8 endpoint) +{ +if (endpoint) { +usb_clear_halt (d->udev,usb_sndbulkpipe (d->udev, endpoint)); +usb_clear_halt (d->udev,usb_rcvbulkpipe (d->udev, endpoint)); + } +} +static int dvb_usb_adapter_init (struct dvb_usb_device *d,short *adapter_nrs) {struct dvb_usb_adapter *adap;int ret, n, o; + ret =dvb_usb_check_bulk_endpoint (d, d->props.generic_bulk_ctrl_endpoint); +if (ret) +return ret; + ret =dvb_usb_check_bulk_endpoint (d, d->props.generic_bulk_ctrl_endpoint_response); +if (ret) +return ret;for (n =0 ; n < d->props.num_adapters; n++) { adap = &d->adapter[n]; adap->dev = d;
@@ -103,10 +132,8 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)* when reloading the driver w/o replugging the device * sometimes a timeout occurs, this helps */ -if (d->props.generic_bulk_ctrl_endpoint !=0 ) { -usb_clear_halt (d->udev,usb_sndbulkpipe (d->udev, d->props.generic_bulk_ctrl_endpoint)); -usb_clear_halt (d->udev,usb_rcvbulkpipe (d->udev, d->props.generic_bulk_ctrl_endpoint)); - } +dvb_usb_clear_halt (d, d->props.generic_bulk_ctrl_endpoint); +dvb_usb_clear_halt (d, d->props.generic_bulk_ctrl_endpoint_response);return 0 ;
Signature · 1 line
2.43.0
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Hi
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)
Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
broken, v6.10.3-rc3:
$ dmesg | grep -i -e dvb -e dw21 -e usb\ 4 [ 0.999122] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 1.023123] usb 4-1: new high-speed USB device number 2 using ehci-pci [ 1.130247] usb 1-1: New USB device found, idVendor=9022, idProduct=d482, bcdDevice= 0.01 [ 1.130257] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.152323] usb 4-1: New USB device found, idVendor=9022, idProduct=d481, bcdDevice= 0.01 [ 1.152329] usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 6.701033] dvb-usb: found a 'TeVii S480.2 USB' in cold state, will try to load a firmware [ 6.701178] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 6.701179] dw2102: start downloading DW210X firmware [ 6.703715] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold state, will try to load a firmware [ 6.703974] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw' [ 6.756432] usb 1-1: USB disconnect, device number 2 [ 6.862119] dvb-usb: found a 'TeVii S480.2 USB' in warm state. [ 6.862194] dvb-usb: TeVii S480.2 USB error while loading driver (-22) [ 6.862209] dvb-usb: found a 'TeVii S480.1 USB' in cold state, will try to load a firmware [ 6.862244] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 6.862245] dw2102: start downloading DW210X firmware [ 6.914811] usb 4-1: USB disconnect, device number 2 [ 7.014131] dvb-usb: found a 'TeVii S480.1 USB' in warm state. [ 7.014487] dvb-usb: TeVii S480.1 USB error while loading driver (-22) [ 7.014538] usbcore: registered new interface driver dw2102 [ 7.278244] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in warm state. [ 7.278403] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 7.278915] dvbdev: DVB: registering new adapter (Microsoft Xbox One Digital TV Tuner) [ 7.279137] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 7.460377] usb 6-5: DVB: registering adapter 0 frontend 0 (Panasonic MN88472)... [ 7.460389] dvbdev: dvb_create_media_entity: media entity 'Panasonic MN88472' registered. [ 7.460822] dvb-usb: Microsoft Xbox One Digital TV Tuner successfully initialized and connected. [ 7.460998] usbcore: registered new interface driver dvb_usb_dib0700 [ 8.496278] usb 1-1: new high-speed USB device number 3 using ehci-pci [ 8.625238] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 8.626608] usb 1-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 8.626613] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 8.626616] usb 1-1: Product: DVBS2BOX [ 8.626618] usb 1-1: Manufacturer: TBS-Tech [ 8.627027] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 8.627079] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 8.627081] dw2102: start downloading DW210X firmware [ 8.655186] usb 4-1: new high-speed USB device number 3 using ehci-pci [ 8.781321] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 8.781775] dvb-usb: TeVii S660 USB error while loading driver (-22) [ 8.784340] usb 4-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 8.785705] usb 4-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 8.785714] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 8.785718] usb 4-1: Product: DVBS2BOX [ 8.785721] usb 4-1: Manufacturer: TBS-Tech [ 8.786247] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 8.786299] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 8.786301] dw2102: start downloading DW210X firmware [ 8.941215] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 8.941532] dvb-usb: TeVii S660 USB error while loading driver (-22) [ 16.107993] mn88472 12-0018: downloading firmware from file 'dvb-demod-mn88472-02.fw'
working, v6.10.3-rc3 with this patch reverted:
$ dmesg | grep -i -e dvb -e dw21 -e usb\ 4 [ 1.136231] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 1.161156] usb 4-1: new high-speed USB device number 2 using ehci-pci [ 1.267579] usb 1-1: New USB device found, idVendor=9022, idProduct=d482, bcdDevice= 0.01 [ 1.267588] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.291329] usb 4-1: New USB device found, idVendor=9022, idProduct=d481, bcdDevice= 0.01 [ 1.291338] usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 3.135217] dvb-usb: found a 'TeVii S480.2 USB' in cold state, will try to load a firmware [ 3.135430] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 3.135432] dw2102: start downloading DW210X firmware [ 3.166588] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold state, will try to load a firmware [ 3.167079] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw' [ 3.188357] usb 1-1: USB disconnect, device number 2 [ 3.287145] dvb-usb: found a 'TeVii S480.2 USB' in warm state. [ 3.287222] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.287254] dvbdev: DVB: registering new adapter (TeVii S480.2 USB) [ 3.287258] usb 1-1: media controller created [ 3.287355] dvb-usb: MAC address: 01:01:01:01:01:01 [ 3.287499] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.290759] dvb-usb: no frontend was attached by 'TeVii S480.2 USB' [ 3.315441] rc rc0: lirc_dev: driver dw2102 registered at minor = 0, scancode receiver, no transmitter [ 3.315640] dvb-usb: schedule remote query interval to 150 msecs. [ 3.315646] dvb-usb: TeVii S480.2 USB successfully initialized and connected. [ 3.315730] dvb-usb: found a 'TeVii S480.1 USB' in cold state, will try to load a firmware [ 3.315786] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 3.315790] dw2102: start downloading DW210X firmware [ 3.340783] dvb-usb: TeVii S480.2 USB successfully deinitialized and disconnected. [ 3.369557] usb 4-1: USB disconnect, device number 2 [ 3.470172] dvb-usb: found a 'TeVii S480.1 USB' in warm state. [ 3.470320] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.470371] dvbdev: DVB: registering new adapter (TeVii S480.1 USB) [ 3.470377] usb 4-1: media controller created [ 3.470516] dvb-usb: MAC address: a1:a1:a1:a1:a1:a1 [ 3.470724] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.472540] dvb-usb: no frontend was attached by 'TeVii S480.1 USB' [ 3.474008] rc rc1: lirc_dev: driver dw2102 registered at minor = 0, scancode receiver, no transmitter [ 3.474268] dvb-usb: schedule remote query interval to 150 msecs. [ 3.474274] dvb-usb: TeVii S480.1 USB successfully initialized and connected. [ 3.474331] usbcore: registered new interface driver dw2102 [ 3.511730] dvb-usb: TeVii S480.1 USB successfully deinitialized and disconnected. [ 3.743260] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in warm state. [ 3.743496] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.744132] dvbdev: DVB: registering new adapter (Microsoft Xbox One Digital TV Tuner) [ 3.744363] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.924797] usb 6-5: DVB: registering adapter 0 frontend 0 (Panasonic MN88472)... [ 3.924805] dvbdev: dvb_create_media_entity: media entity 'Panasonic MN88472' registered. [ 3.925073] dvb-usb: Microsoft Xbox One Digital TV Tuner successfully initialized and connected. [ 3.925220] usbcore: registered new interface driver dvb_usb_dib0700 [ 4.928291] usb 1-1: new high-speed USB device number 3 using ehci-pci [ 5.057227] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 5.060100] usb 1-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 5.060106] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 5.060109] usb 1-1: Product: DVBS2BOX [ 5.060112] usb 1-1: Manufacturer: TBS-Tech [ 5.060517] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 5.060560] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 5.060562] dw2102: start downloading DW210X firmware [ 5.105152] usb 4-1: new high-speed USB device number 3 using ehci-pci [ 5.214345] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 5.214663] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 5.215024] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.215031] usb 1-1: media controller created [ 5.234371] usb 4-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 5.235622] usb 4-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 5.235632] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 5.235635] usb 4-1: Product: DVBS2BOX [ 5.235638] usb 4-1: Manufacturer: TBS-Tech [ 5.236096] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 5.236154] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 5.236157] dw2102: start downloading DW210X firmware [ 5.390220] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 5.390437] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 5.390831] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.390837] usb 4-1: media controller created [ 5.457940] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 5.458189] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.559308] dw2102: Attached ds3000+ts2020! [ 5.559318] usb 1-1: DVB: registering adapter 1 frontend 0 (Montage Technology DS3000)... [ 5.559327] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.560578] rc rc1: lirc_dev: driver dw2102 registered at minor = 1, scancode receiver, no transmitter [ 5.560745] dvb-usb: schedule remote query interval to 150 msecs. [ 5.560748] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 5.643009] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 5.643244] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.756627] dw2102: Attached ds3000+ts2020! [ 5.756632] usb 4-1: DVB: registering adapter 2 frontend 0 (Montage Technology DS3000)... [ 5.756641] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.758025] rc rc2: lirc_dev: driver dw2102 registered at minor = 2, scancode receiver, no transmitter [ 5.758194] dvb-usb: schedule remote query interval to 150 msecs. [ 5.758197] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 12.578584] mn88472 12-0018: downloading firmware from file 'dvb-demod-mn88472-02.fw' [ 12.732107] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.338071] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.339290] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.970274] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)...
The https://www.linuxtv.org/wiki/index.php/TeVii_S480 is a PCIe card which combines a USB host controller with two onboard TeVii s660 USB DVB-S2 cards.
07:00.0 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
07:00.1 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
07:00.2 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
07:00.3 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
07:00.4 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
07:00.5 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
07:00.6 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
07:00.7 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M
|__ Port 001: Dev 003, If 0, Class=Vendor Specific Class, Driver=dw2102, 480M
/: Bus 002.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M
/: Bus 003.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M
/: Bus 004.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M
|__ Port 001: Dev 003, If 0, Class=Vendor Specific Class, Driver=dw2102, 480MBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660
Regards
Stefan Lippers-Hollmann
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Hi
Quoted 26 lines · Stefan Lippers-Hollmann
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:
Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
[...]
Btw. I can also reproduce this (both breakage and 'fix' by reverting this patch) on a another x86_64 system that only has a single TeVii s480 dual DVB-S2 card (and no further v4l devices) installed. So I'm seeing this on both sandy-bridge and raptor-lake x86_64 systems.
Regards
Stefan Lippers-Hollmann
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Hi
Quoted 33 lines · Stefan Lippers-Hollmann
Quoted 26 lines · Stefan Lippers-Hollmann
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Quoted 6 lines
[...]
Btw. I can also reproduce this (both breakage and 'fix' by reverting this patch) on a another
x86_64system that only has a single TeVii s480 dual DVB-S2 card (and no further v4l devices) installed. So I'm seeing this on both sandy-bridge and raptor-lakex86_64systems.
This issue is also present in current linux HEAD (as of this moment, v6.11-rc1-63-g21b136cc63d2).
A clean revert of this commit 2052138b7da52ad5ccaf74f736d00f39a1c9198c "media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()" avoids the problem for v6.11~ as well.
Regards
Stefan Lippers-Hollmann
Greg Kroah-Hartman
maintainerRe: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Quoted 43 lines · Stefan Lippers-Hollmann
Hi
Quoted 33 lines · Stefan Lippers-Hollmann
Quoted 26 lines · Stefan Lippers-Hollmann
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Quoted 6 lines
[...]
Btw. I can also reproduce this (both breakage and 'fix' by reverting this patch) on a another
x86_64system that only has a single TeVii s480 dual DVB-S2 card (and no further v4l devices) installed. So I'm seeing this on both sandy-bridge and raptor-lakex86_64systems.
Quoted 6 lines
This issue is also present in current linux HEAD (as of this moment, v6.11-rc1-63-g21b136cc63d2).
A clean revert of this commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c"media: dvb-usb: Fix unexpected infinite loop indvb_usb_read_remote_control()" avoids the problem for v6.11~ as well.
As this issue is in Linus's tree, please work to get it resolved there first and then we will gladly take the changes here.
thanks,
greg k-h
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Quoted 47 lines · Greg Kroah-Hartman
Quoted 46 lines · Stefan Lippers-Hollmann
Hi
Quoted 33 lines · Stefan Lippers-Hollmann
Quoted 26 lines · Stefan Lippers-Hollmann
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Quoted 6 lines
[...]
Btw. I can also reproduce this (both breakage and 'fix' by reverting this patch) on a another
x86_64system that only has a single TeVii s480 dual DVB-S2 card (and no further v4l devices) installed. So I'm seeing this on both sandy-bridge and raptor-lakex86_64systems.This issue is also present in current linux HEAD (as of this moment, v6.11-rc1-63-g21b136cc63d2).
Quoted 6 lines
Quoted 3 lines
A clean revert of this commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c"media: dvb-usb: Fix unexpected infinite loop indvb_usb_read_remote_control()" avoids the problem for v6.11~ as well.As this issue is in Linus's tree, please work to get it resolved there first and then we will gladly take the changes here
Sean, I assume you'll look into this?
Regards,
Hans
(Added a Cc to the linux-media ML)
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
In reply to Stefan Lippers-HollmannQuoted 50 lines · Stefan Lippers-Hollmann
Hi
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ... ... dvb-usb: schedule remote query interval to 100 msecs. dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ... dvb-usb: bulk message failed: -22 (1/0) dvb-usb: bulk message failed: -22 (1/0) dvb-usb: bulk message failed: -22 (1/0) ... dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
broken, v6.10.3-rc3:
$ dmesg | grep -i -e dvb -e dw21 -e usb\ 4 [ 0.999122] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 1.023123] usb 4-1: new high-speed USB device number 2 using ehci-pci [ 1.130247] usb 1-1: New USB device found, idVendor=9022, idProduct=d482, bcdDevice= 0.01 [ 1.130257] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.152323] usb 4-1: New USB device found, idVendor=9022, idProduct=d481, bcdDevice= 0.01 [ 1.152329] usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 6.701033] dvb-usb: found a 'TeVii S480.2 USB' in cold state, will try to load a firmware [ 6.701178] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 6.701179] dw2102: start downloading DW210X firmware [ 6.703715] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold state, will try to load a firmware [ 6.703974] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw' [ 6.756432] usb 1-1: USB disconnect, device number 2
Quoted 8 lines
[ 6.862119] dvb-usb: found a 'TeVii S480.2 USB' in warm state. [ 6.862194] dvb-usb: TeVii S480.2 USB error while loading driver (-22) [ 6.862209] dvb-usb: found a 'TeVii S480.1 USB' in cold state, will try to load a firmware [ 6.862244] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 6.862245] dw2102: start downloading DW210X firmware [ 6.914811] usb 4-1: USB disconnect, device number 2 [ 7.014131] dvb-usb: found a 'TeVii S480.1 USB' in warm state. [ 7.014487] dvb-usb: TeVii S480.1 USB error while loading driver (-22)
Hi, Sean and Hans!
The device properties of TeVii S480.1 that fail to be loaded should be 's660_properties' in drivers/media/usb/dvb-usb/dw2102.c:
static struct dvb_usb_device_properties s660_properties = {
...
.generic_bulk_ctrl_endpoint = 0x81,
...
.devices = {
{"TeVii S660 USB",
{&dw2102_table[TEVII_S660], NULL},
{NULL},
},
{"TeVii S480.1 USB",
{&dw2102_table[TEVII_S480_1], NULL},
{NULL},
},
{"TeVii S480.2 USB",
&dw2102_table[TEVII_S480_2], NULL},
{NULL},
},
...
}The 'generic_bulk_ctrl_endpoint' is 0x81, so it should be caused by the failure after run:
ret = dvb_usb_check_bulk_endpoint(d, d->props.generic_bulk_ctrl_endpoint);
Refer to the comment in drivers/media/usb/dvb-usb/dvb-usb.h:
* @generic_bulk_ctrl_endpoint: most of the DVB USB devices have a generic
* endpoint which received control messages with bulk transfers. When this * is non-zero, one can use dvb_usb_generic_rw and dvb_usb_generic_write- * helper functions.
The user can configure a non-zero 'generic_bulk_ctrl_endpoint', but not use it to do bulk transfers, is it right? If that's the case, does that mean that it can't compulsorily check bulk endpoint? Or, is it possible that the bulk endpoint check is in the wrong place?
I'm a complete newbie for dvb_usb and don't have a dvb device :(
Quoted 185 lines
[ 7.014538] usbcore: registered new interface driver dw2102 [ 7.278244] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in warm state. [ 7.278403] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 7.278915] dvbdev: DVB: registering new adapter (Microsoft Xbox One Digital TV Tuner) [ 7.279137] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 7.460377] usb 6-5: DVB: registering adapter 0 frontend 0 (Panasonic MN88472)... [ 7.460389] dvbdev: dvb_create_media_entity: media entity 'Panasonic MN88472' registered. [ 7.460822] dvb-usb: Microsoft Xbox One Digital TV Tuner successfully initialized and connected. [ 7.460998] usbcore: registered new interface driver dvb_usb_dib0700 [ 8.496278] usb 1-1: new high-speed USB device number 3 using ehci-pci [ 8.625238] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 8.626608] usb 1-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 8.626613] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 8.626616] usb 1-1: Product: DVBS2BOX [ 8.626618] usb 1-1: Manufacturer: TBS-Tech [ 8.627027] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 8.627079] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 8.627081] dw2102: start downloading DW210X firmware [ 8.655186] usb 4-1: new high-speed USB device number 3 using ehci-pci [ 8.781321] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 8.781775] dvb-usb: TeVii S660 USB error while loading driver (-22) [ 8.784340] usb 4-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 8.785705] usb 4-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 8.785714] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 8.785718] usb 4-1: Product: DVBS2BOX [ 8.785721] usb 4-1: Manufacturer: TBS-Tech [ 8.786247] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 8.786299] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 8.786301] dw2102: start downloading DW210X firmware [ 8.941215] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 8.941532] dvb-usb: TeVii S660 USB error while loading driver (-22) [ 16.107993] mn88472 12-0018: downloading firmware from file 'dvb-demod-mn88472-02.fw'working, v6.10.3-rc3 with this patch reverted:
$ dmesg | grep -i -e dvb -e dw21 -e usb\ 4 [ 1.136231] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 1.161156] usb 4-1: new high-speed USB device number 2 using ehci-pci [ 1.267579] usb 1-1: New USB device found, idVendor=9022, idProduct=d482, bcdDevice= 0.01 [ 1.267588] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.291329] usb 4-1: New USB device found, idVendor=9022, idProduct=d481, bcdDevice= 0.01 [ 1.291338] usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 3.135217] dvb-usb: found a 'TeVii S480.2 USB' in cold state, will try to load a firmware [ 3.135430] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 3.135432] dw2102: start downloading DW210X firmware [ 3.166588] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold state, will try to load a firmware [ 3.167079] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw' [ 3.188357] usb 1-1: USB disconnect, device number 2 [ 3.287145] dvb-usb: found a 'TeVii S480.2 USB' in warm state. [ 3.287222] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.287254] dvbdev: DVB: registering new adapter (TeVii S480.2 USB) [ 3.287258] usb 1-1: media controller created [ 3.287355] dvb-usb: MAC address: 01:01:01:01:01:01 [ 3.287499] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.290759] dvb-usb: no frontend was attached by 'TeVii S480.2 USB' [ 3.315441] rc rc0: lirc_dev: driver dw2102 registered at minor = 0, scancode receiver, no transmitter [ 3.315640] dvb-usb: schedule remote query interval to 150 msecs. [ 3.315646] dvb-usb: TeVii S480.2 USB successfully initialized and connected. [ 3.315730] dvb-usb: found a 'TeVii S480.1 USB' in cold state, will try to load a firmware [ 3.315786] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 3.315790] dw2102: start downloading DW210X firmware [ 3.340783] dvb-usb: TeVii S480.2 USB successfully deinitialized and disconnected. [ 3.369557] usb 4-1: USB disconnect, device number 2 [ 3.470172] dvb-usb: found a 'TeVii S480.1 USB' in warm state. [ 3.470320] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.470371] dvbdev: DVB: registering new adapter (TeVii S480.1 USB) [ 3.470377] usb 4-1: media controller created [ 3.470516] dvb-usb: MAC address: a1:a1:a1:a1:a1:a1 [ 3.470724] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.472540] dvb-usb: no frontend was attached by 'TeVii S480.1 USB' [ 3.474008] rc rc1: lirc_dev: driver dw2102 registered at minor = 0, scancode receiver, no transmitter [ 3.474268] dvb-usb: schedule remote query interval to 150 msecs. [ 3.474274] dvb-usb: TeVii S480.1 USB successfully initialized and connected. [ 3.474331] usbcore: registered new interface driver dw2102 [ 3.511730] dvb-usb: TeVii S480.1 USB successfully deinitialized and disconnected. [ 3.743260] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in warm state. [ 3.743496] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.744132] dvbdev: DVB: registering new adapter (Microsoft Xbox One Digital TV Tuner) [ 3.744363] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.924797] usb 6-5: DVB: registering adapter 0 frontend 0 (Panasonic MN88472)... [ 3.924805] dvbdev: dvb_create_media_entity: media entity 'Panasonic MN88472' registered. [ 3.925073] dvb-usb: Microsoft Xbox One Digital TV Tuner successfully initialized and connected. [ 3.925220] usbcore: registered new interface driver dvb_usb_dib0700 [ 4.928291] usb 1-1: new high-speed USB device number 3 using ehci-pci [ 5.057227] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 5.060100] usb 1-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 5.060106] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 5.060109] usb 1-1: Product: DVBS2BOX [ 5.060112] usb 1-1: Manufacturer: TBS-Tech [ 5.060517] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 5.060560] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 5.060562] dw2102: start downloading DW210X firmware [ 5.105152] usb 4-1: new high-speed USB device number 3 using ehci-pci [ 5.214345] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 5.214663] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 5.215024] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.215031] usb 1-1: media controller created [ 5.234371] usb 4-1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 2 [ 5.235622] usb 4-1: New USB device found, idVendor=9022, idProduct=d660, bcdDevice= 0.00 [ 5.235632] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 5.235635] usb 4-1: Product: DVBS2BOX [ 5.235638] usb 4-1: Manufacturer: TBS-Tech [ 5.236096] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 5.236154] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 5.236157] dw2102: start downloading DW210X firmware [ 5.390220] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 5.390437] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 5.390831] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.390837] usb 4-1: media controller created [ 5.457940] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 5.458189] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.559308] dw2102: Attached ds3000+ts2020! [ 5.559318] usb 1-1: DVB: registering adapter 1 frontend 0 (Montage Technology DS3000)... [ 5.559327] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.560578] rc rc1: lirc_dev: driver dw2102 registered at minor = 1, scancode receiver, no transmitter [ 5.560745] dvb-usb: schedule remote query interval to 150 msecs. [ 5.560748] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 5.643009] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 5.643244] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.756627] dw2102: Attached ds3000+ts2020! [ 5.756632] usb 4-1: DVB: registering adapter 2 frontend 0 (Montage Technology DS3000)... [ 5.756641] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.758025] rc rc2: lirc_dev: driver dw2102 registered at minor = 2, scancode receiver, no transmitter [ 5.758194] dvb-usb: schedule remote query interval to 150 msecs. [ 5.758197] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 12.578584] mn88472 12-0018: downloading firmware from file 'dvb-demod-mn88472-02.fw' [ 12.732107] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.338071] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.339290] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.970274] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)...The https://www.linuxtv.org/wiki/index.php/TeVii_S480 is a PCIe card which combines a USB host controller with two onboard TeVii s660 USB DVB-S2 cards.
07:00.0 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules:ohci_pci
07:00.1 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules:ehci_pci
07:00.2 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules:ohci_pci
07:00.3 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules:ehci_pci
07:00.4 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules:ohci_pci
07:00.5 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules:ehci_pci
07:00.6 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ohci-pci
Kernel modules:ohci_pci
07:00.7 USB controller [0c03]: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller [9710:9990]
Subsystem: Asix Electronics Corporation (Wrong ID) Device [a000:4000]
Kernel driver in use: ehci-pci
Kernel modules:ehci_pci: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M
|__ Port 001: Dev 003, If 0, Class=Vendor Specific Class, Driver=dw2102, 480M /: Bus 002.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M /: Bus 003.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M /: Bus 004.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/1p, 480M |__ Port 001: Dev 003, If 0, Class=Vendor Specific Class, Driver=dw2102, 480MBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660
Regards
Stefan Lippers-Hollmann
Signature · 2 lines
Thanks, Zheng Yejian
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
In reply to Stefan Lippers-HollmannQuoted 28 lines · Stefan Lippers-Hollmann
Hi
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:
Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Thanks for reporting this ...
So looking at the commit, it must be that one of the usb endpoints is neither a send/receiver bulk endpoint. Would you mind sending a lusb -v of the device, I think something like:
lsusb -v -d 9022:d482
Should do it, or -d 9022::d481
Either we find a fix for this quickly or revert the entire commit.
Thanks,
Sean
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Hi
Quoted 38 lines · Sean Young
Quoted 28 lines · Stefan Lippers-Hollmann
Hi
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Thanks for reporting this ...
Quoted 7 lines
So looking at the commit, it must be that one of the usb endpoints is neither a send/receiver bulk endpoint. Would you mind sending a lusb -v of the device, I think something like:
lsusb -v -d 9022:d482Should do it, or -d 9022::d481
It doesn't show up as 9022:d482 or 9022:d481, but as two 9022:d660.
system 1, raptor-lake:
# lsusb -v -d 9022:d660
Bus 001 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660 Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x9022 TeVii Technology Ltd. idProduct 0xd660 DVB-S2 S660 bcdDevice 0.00 iManufacturer 1 TBS-Tech iProduct 2 DVBS2BOX iSerial 0 bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
Bus 002 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660 Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x9022 TeVii Technology Ltd. idProduct 0xd660 DVB-S2 S660 bcdDevice 0.00 iManufacturer 1 TBS-Tech iProduct 2 DVBS2BOX iSerial 0 bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
# lspci -vvv -d 9710:9990
07:00.0 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 178
IOMMU group: 23
Region 0: Memory at 85407000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee00998 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Capabilities: [100 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
Status: NegoPending- InProgress-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci07:00.1 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 174
IOMMU group: 23
Region 0: Memory at 85406000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee008d8 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
07:00.2 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin B routed to IRQ 190
IOMMU group: 23
Region 0: Memory at 85405000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee009f8 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
07:00.3 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin B routed to IRQ 173
IOMMU group: 23
Region 0: Memory at 85404000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee008b8 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
07:00.4 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin C routed to IRQ 191
IOMMU group: 23
Region 0: Memory at 85403000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee00b18 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
07:00.5 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin C routed to IRQ 176
IOMMU group: 23
Region 0: Memory at 85402000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee00938 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
07:00.6 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin D routed to IRQ 192
IOMMU group: 23
Region 0: Memory at 85401000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee00b38 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
07:00.7 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin D routed to IRQ 175
IOMMU group: 23
Region 0: Memory at 85400000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee00918 Data: 0000
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
########
system 2, sandy-bridge:
# lsusb -v -d 9022:d660
Bus 003 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660 Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x9022 TeVii Technology Ltd. idProduct 0xd660 DVB-S2 S660 bcdDevice 0.00 iManufacturer 1 TBS-Tech iProduct 2 DVBS2BOX iSerial 0 bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
Bus 006 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660 Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x9022 TeVii Technology Ltd. idProduct 0xd660 DVB-S2 S660 bcdDevice 0.00 iManufacturer 1 TBS-Tech iProduct 2 DVBS2BOX iSerial 0 bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
# lspci -vvv -d 9710:9990
01:00.0 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 29
Region 0: Memory at f7b07000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee20004 Data: 0021
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Capabilities: [100 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
Status: NegoPending- InProgress-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci01:00.1 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 27
Region 0: Memory at f7b06000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee04004 Data: 0021
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
01:00.2 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin B routed to IRQ 32
Region 0: Memory at f7b05000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee01004 Data: 0021
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
01:00.3 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin B routed to IRQ 24
Region 0: Memory at f7b04000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee40004 Data: 0020
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
01:00.4 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin C routed to IRQ 33
Region 0: Memory at f7b03000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee02004 Data: 0022
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
01:00.5 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin C routed to IRQ 25
Region 0: Memory at f7b02000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee80004 Data: 0020
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
01:00.6 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 10 [OHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin D routed to IRQ 34
Region 0: Memory at f7b01000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee04004 Data: 0022
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ohci-pci
Kernel modules: ohci_pci
01:00.7 USB controller: MosChip Semiconductor Technology Ltd. MCS9990 PCIe to 4-Port USB 2.0 Host Controller (prog-if 20 [EHCI])
Subsystem: Asix Electronics Corporation (Wrong ID) Device 4000
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin D routed to IRQ 26
Region 0: Memory at f7b00000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee01004 Data: 0020
Capabilities: [78] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] Express (v1) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 25W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM not supported
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1
TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
I hope this helps a little.
Regards
Stefan Lippers-Hollmann
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Quoted 49 lines · Stefan Lippers-Hollmann
Hi
Quoted 38 lines · Sean Young
Quoted 28 lines · Stefan Lippers-Hollmann
Hi
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Thanks for reporting this ...
Quoted 7 lines
So looking at the commit, it must be that one of the usb endpoints is neither a send/receiver bulk endpoint. Would you mind sending a lusb -v of the device, I think something like:
lsusb -v -d 9022:d482Should do it, or -d 9022::d481
Quoted 7 lines
It doesn't show up as 9022:d482 or 9022:d481, but as two 9022:d660.
system 1, raptor-lake:
# lsusb -v -d 9022:d660Bus 001 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660
-snip-
Quoted 12 lines
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress0x82EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize0x02001x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
Quoted 8 lines
bDescriptorType 5
bEndpointAddress0x81EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize0x00021x 2 bytes
bInterval 0
For this device, we do both a bulk snd/rcv to endpoint 1, but the descriptor says it's an IN endpoint only. So, commit 2052138b7da52ad5ccaf74f736d00f39a1c9198c rejects the device as being invalid.
At the moment, I'm not sure why this works without the patch, surely a bulk send to endpoint 1 should fail; there is no out entry.
I'm poking around in the usb code, in the mean time if anyone has any ideas, that would be appreciated.
Sean
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
In reply to Stefan Lippers-Hollmann(Resend with the relevant lists CC'ed)
Quoted 47 lines · Stefan Lippers-Hollmann
Quoted 38 lines · Sean Young
Quoted 28 lines · Stefan Lippers-Hollmann
Hi
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Thanks for reporting this ...
Quoted 7 lines
So looking at the commit, it must be that one of the usb endpoints is neither a send/receiver bulk endpoint. Would you mind sending a lusb -v of the device, I think something like:
lsusb -v -d 9022:d482Should do it, or -d 9022::d481
Quoted 7 lines
It doesn't show up as 9022:d482 or 9022:d481, but as two 9022:d660.
system 1, raptor-lake:
# lsusb -v -d 9022:d660Bus 001 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660
-snip-
Quoted 22 lines
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress0x82EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize0x02001x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
Quoted 8 lines
bDescriptorType 5
bEndpointAddress0x81EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize0x00021x 2 bytes
bInterval 0
For this device, we do both a bulk snd/rcv to endpoint 1, but the descriptor says it's an IN endpoint only. So, commit 2052138b7da52ad5ccaf74f736d00f39a1c9198c rejects the device as being invalid.
At the moment, I'm not sure why this works without the patch, surely a bulk send to endpoint 1 should fail; there is no out entry.
I'm poking around in the usb code, in the mean time if anyone has any ideas, that would be appreciated.
Sean
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
In reply to Stefan Lippers-HollmannHi Stefan,
Quoted 47 lines · Stefan Lippers-Hollmann
Quoted 38 lines · Sean Young
Quoted 28 lines · Stefan Lippers-Hollmann
Hi
Quoted 20 lines · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit
2052138b7da52ad5ccaf74f736d00f39a1c9198c]Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Quoted 5 lines
Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:Quoted 6 lines
[...]
This patch, as part of v6.10.3-rc3 breaks my TeVii s480 dual DVB-S2 card, reverting just this patch from v6.10-rc3 fixes the situation again (a co-installed Microsoft Xbox One Digital TV DVB-T2 Tuner keeps working).
Thanks for reporting this ...
Quoted 7 lines
So looking at the commit, it must be that one of the usb endpoints is neither a send/receiver bulk endpoint. Would you mind sending a lusb -v of the device, I think something like:
lsusb -v -d 9022:d482Should do it, or -d 9022::d481
Quoted 7 lines
It doesn't show up as 9022:d482 or 9022:d481, but as two 9022:d660.
system 1, raptor-lake:
# lsusb -v -d 9022:d660Bus 001 Device 003: ID 9022:d660 TeVii Technology Ltd. DVB-S2 S660
-snip-
Quoted 12 lines
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress0x82EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize0x02001x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
Quoted 8 lines
bDescriptorType 5
bEndpointAddress0x81EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize0x00021x 2 bytes
bInterval 0
I don't think this drivers uses the bulk endpoint, and it is missing the corresponding out bulk endpoint.
Please could you test the patch below please - that would be very helpful in narrowing down this issue.
Thank you!
Sean
From adda4b83a6b800d4b35bbd12b9a198fb6a085f58 Mon Sep 17 00:00:00 2001
From: Sean Young <[email protected]>
Date: Tue, 6 Aug 2024 16:31:02 +0100
Subject: [PATCH] media: dw2102: TeVii DVB-S2 S660 does not have bulk endpoint
Since commit 2052138b7da5 ("media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()"), we check that the bulk endpoints exist. This device does have them and then errors out during initialization.
--- drivers/media/usb/dvb-usb/dw2102.c | 1 - 1 file changed, 1 deletion(-)
drivers/media/usb/dvb-usb/dw2102.c +0 -1
@@ -2250,7 +2250,6 @@ static struct dvb_usb_device_properties s660_properties = { .rc_query = dw2102_rc_query, }, - .generic_bulk_ctrl_endpoint = 0x81, .num_adapters = 1, .download_firmware = dw2102_load_firmware, .read_mac_address = s6x0_read_mac_address,
Signature · 1 line
2.45.2
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Hi
Quoted 5 lines · Sean Young
Quoted 4 lines · Stefan Lippers-Hollmann
Quoted 3 lines · Sean Young
Quoted 2 lines · Stefan Lippers-Hollmann
Quoted 1 line · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
[...]
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:
[...]
Quoted 5 lines
I don't think this drivers uses the bulk endpoint, and it is missing the corresponding out bulk endpoint.
Please could you test the patch below please - that would be very helpful in narrowing down this issue.
[...]
After applying this patch, the TeVii s480 works again on both of my systems, but there seems to be a new error message in the log
ds3000_writereg: writereg error(err == -11, reg == 0xa2, value == 0xb7)ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12)ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12)ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02)ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02)
The card/ driver is not totally silent otherwise, but I can reproduce this over 5+ reboots with each kernel. Logs below from the sandy-bridge x86_64 system (only TeVii s480 installed).
Old behaviour (v6.10.3 with "media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()" reverted):
$ dmesg | grep -i -e dvb -e dw2102 -e ds3000 -e ts2020 [ 1.684825] usb 2-1: Product: DVBS2BOX [ 1.701050] usb 4-1: Product: DVBS2BOX [ 4.435989] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 4.436923] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 4.436927] dw2102: start downloading DW210X firmware [ 4.608568] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 4.608641] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 4.609001] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 4.840630] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 4.840769] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 4.849470] DS3000 chip version: 0.192 attached. [ 4.910145] ts2020 9-0060: Montage Technology TS2020 successfully identified [ 4.910468] dw2102: Attached ds3000+ts2020! [ 4.910474] usb 2-1: DVB: registering adapter 0 frontend 0 (Montage Technology DS3000)... [ 4.910489] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 4.936777] rc rc1: lirc_dev: driver dw2102 registered at minor = 1, scancode receiver, no transmitter [ 4.936958] dvb-usb: schedule remote query interval to 150 msecs. [ 4.936964] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 4.937039] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 4.937094] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 4.937097] dw2102: start downloading DW210X firmware [ 5.096566] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 5.096612] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 5.096960] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.345567] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 5.345825] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.349193] DS3000 chip version: 0.192 attached. [ 5.361941] ts2020 10-0060: Montage Technology TS2020 successfully identified [ 5.362312] dw2102: Attached ds3000+ts2020! [ 5.362318] usb 4-1: DVB: registering adapter 1 frontend 0 (Montage Technology DS3000)... [ 5.362326] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.363534] rc rc2: lirc_dev: driver dw2102 registered at minor = 2, scancode receiver, no transmitter [ 5.363692] dvb-usb: schedule remote query interval to 150 msecs. [ 5.363696] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 5.363739] usbcore: registered new interface driver dw2102 [ 8.691350] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 8.691642] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 9.299494] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 9.299530] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 9.301416] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 9.301424] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 9.904482] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 9.904505] ds3000_firmware_ondemand: Waiting for firmware upload(2)...
New behaviour (v6.10.3 with this patch, "media: dw2102: TeVii DVB-S2 S660 does not have bulk endpoint", applied):
$ dmesg | grep -i -e dvb -e dw2102 -e ds3000 -e ts2020 [ 1.638632] usb 5-1: Product: DVBS2BOX [ 1.653420] usb 7-1: Product: DVBS2BOX [ 4.228845] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 4.236973] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 4.236989] dw2102: start downloading DW210X firmware [ 4.400024] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 4.400090] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 4.400441] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 4.636293] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 4.636422] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 4.644701] DS3000 chip version: 0.192 attached. [ 4.706119] ts2020 9-0060: Montage Technology TS2020 successfully identified [ 4.706726] dw2102: Attached ds3000+ts2020! [ 4.706735] usb 5-1: DVB: registering adapter 0 frontend 0 (Montage Technology DS3000)... [ 4.706749] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 4.732248] rc rc1: lirc_dev: driver dw2102 registered at minor = 1, scancode receiver, no transmitter [ 4.732428] dvb-usb: schedule remote query interval to 150 msecs. [ 4.732433] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 4.732501] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 4.732548] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 4.732552] dw2102: start downloading DW210X firmware [ 4.896029] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 4.896090] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 4.896447] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.146200] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 5.146449] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.149849] DS3000 chip version: 0.192 attached. [ 5.208491] ts2020 10-0060: Montage Technology TS2020 successfully identified [ 5.208972] dw2102: Attached ds3000+ts2020! [ 5.208978] usb 7-1: DVB: registering adapter 1 frontend 0 (Montage Technology DS3000)... [ 5.208986] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.209659] rc rc2: lirc_dev: driver dw2102 registered at minor = 2, scancode receiver, no transmitter [ 5.209872] dvb-usb: schedule remote query interval to 150 msecs. [ 5.209878] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 5.209950] usbcore: registered new interface driver dw2102 [ 8.477890] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 8.478405] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 9.076264] ds3000_writereg: writereg error(err == -11, reg == 0xa2, value == 0xb7) [ 9.076296] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12) [ 9.076313] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12) [ 9.076331] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02) [ 9.076346] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02) [ 9.080866] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 9.080899] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 9.081898] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 9.081902] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 9.677938] ds3000_writereg: writereg error(err == -11, reg == 0xa2, value == 0xb7) [ 9.677999] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12) [ 9.678040] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12) [ 9.678079] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02) [ 9.678122] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02) [ 9.682856] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 9.682884] ds3000_firmware_ondemand: Waiting for firmware upload(2)...
Same new error message on the raptor-lake system:
$ dmesg | grep -i -e dvb -e dw2102 -e ds3000 -e ts2020 [ 3.105834] dvb-usb: found a 'TeVii S480.2 USB' in cold state, will try to load a firmware [ 3.105982] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 3.105984] dw2102: start downloading DW210X firmware [ 3.261142] dvb-usb: found a 'TeVii S480.2 USB' in warm state. [ 3.261268] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.261289] dvbdev: DVB: registering new adapter (TeVii S480.2 USB) [ 3.261339] dvb-usb: MAC address: 8b:8b:8b:8b:8b:8b [ 3.261422] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.263774] Invalid probe, probably not a DS3000 [ 3.264382] dvb-usb: no frontend was attached by 'TeVii S480.2 USB' [ 3.289229] rc rc0: lirc_dev: driver dw2102 registered at minor = 0, scancode receiver, no transmitter [ 3.301371] dvb-usb: schedule remote query interval to 150 msecs. [ 3.301382] dvb-usb: TeVii S480.2 USB successfully initialized and connected. [ 3.301479] dvb-usb: found a 'TeVii S480.1 USB' in cold state, will try to load a firmware [ 3.301534] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 3.301538] dw2102: start downloading DW210X firmware [ 3.344870] dvb-usb: TeVii S480.2 USB successfully deinitialized and disconnected. [ 3.453179] dvb-usb: found a 'TeVii S480.1 USB' in warm state. [ 3.453437] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 3.453507] dvbdev: DVB: registering new adapter (TeVii S480.1 USB) [ 3.453738] dvb-usb: MAC address: b3:b3:b3:b3:b3:b3 [ 3.454071] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 3.454698] Invalid probe, probably not a DS3000 [ 3.456655] dvb-usb: no frontend was attached by 'TeVii S480.1 USB' [ 3.458763] rc rc0: lirc_dev: driver dw2102 registered at minor = 0, scancode receiver, no transmitter [ 3.458896] dvb-usb: schedule remote query interval to 150 msecs. [ 3.458900] dvb-usb: TeVii S480.1 USB successfully initialized and connected. [ 3.458953] usbcore: registered new interface driver dw2102 [ 3.497370] dvb-usb: TeVii S480.1 USB successfully deinitialized and disconnected. [ 3.510918] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold state, will try to load a firmware [ 3.511231] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw' [ 4.102223] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in warm state. [ 4.102420] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 4.102965] dvbdev: DVB: registering new adapter (Microsoft Xbox One Digital TV Tuner) [ 4.103265] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 4.282575] usb 6-5: DVB: registering adapter 0 frontend 0 (Panasonic MN88472)... [ 4.282586] dvbdev: dvb_create_media_entity: media entity 'Panasonic MN88472' registered. [ 4.282871] dvb-usb: Microsoft Xbox One Digital TV Tuner successfully initialized and connected. [ 4.283033] usbcore: registered new interface driver dvb_usb_dib0700 [ 5.033690] usb 1-1: Product: DVBS2BOX [ 5.034104] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 5.034139] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 5.034141] dw2102: start downloading DW210X firmware [ 5.189199] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 5.189490] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 5.189857] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.226403] usb 3-1: Product: DVBS2BOX [ 5.226870] dvb-usb: found a 'TeVii S660 USB' in cold state, will try to load a firmware [ 5.226912] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 5.226915] dw2102: start downloading DW210X firmware [ 5.381171] dvb-usb: found a 'TeVii S660 USB' in warm state. [ 5.381417] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 5.381861] dvbdev: DVB: registering new adapter (TeVii S660 USB) [ 5.436278] dvb-usb: MAC address: 00:18:bd:XX:XX:XX [ 5.436503] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.439527] DS3000 chip version: 0.192 attached. [ 5.533899] ts2020 13-0060: Montage Technology TS2020 successfully identified [ 5.534271] dw2102: Attached ds3000+ts2020! [ 5.534277] usb 1-1: DVB: registering adapter 1 frontend 0 (Montage Technology DS3000)... [ 5.534287] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.534895] rc rc1: lirc_dev: driver dw2102 registered at minor = 1, scancode receiver, no transmitter [ 5.535069] dvb-usb: schedule remote query interval to 150 msecs. [ 5.535072] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 5.624792] dvb-usb: MAC address: 00:18:bd:XX:XX:xx [ 5.624993] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. [ 5.628417] DS3000 chip version: 0.192 attached. [ 5.695664] ts2020 14-0060: Montage Technology TS2020 successfully identified [ 5.696037] dw2102: Attached ds3000+ts2020! [ 5.696042] usb 3-1: DVB: registering adapter 2 frontend 0 (Montage Technology DS3000)... [ 5.696051] dvbdev: dvb_create_media_entity: media entity 'Montage Technology DS3000' registered. [ 5.696598] rc rc2: lirc_dev: driver dw2102 registered at minor = 2, scancode receiver, no transmitter [ 5.696764] dvb-usb: schedule remote query interval to 150 msecs. [ 5.696767] dvb-usb: TeVii S660 USB successfully initialized and connected. [ 12.622893] mn88472 12-0018: downloading firmware from file 'dvb-demod-mn88472-02.fw' [ 12.778138] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 12.778301] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 13.375913] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.375968] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 13.377005] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.377018] ds3000_firmware_ondemand: Waiting for firmware upload(2)... [ 13.972206] ds3000_writereg: writereg error(err == -11, reg == 0xa2, value == 0x07) [ 13.972225] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12) [ 13.972232] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x12) [ 13.972238] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02) [ 13.972242] ds3000_writereg: writereg error(err == -11, reg == 0x03, value == 0x02) [ 13.976900] ds3000_firmware_ondemand: Waiting for firmware upload (dvb-fe-ds3000.fw)... [ 13.976978] ds3000_firmware_ondemand: Waiting for firmware upload(2)...
Technically, the card does work now on both systems, vdr 2.6.0 starts up and I can use both frontends concurrently.
Thanks a lot for looking into this and sorry for the delay, but I just got home to my system(s).
Regards
Stefan Lippers-Hollmann
--
$ md5sum -b *.fw a32d17910c4f370073f9346e71d34b80 *dvb-fe-ds3000.fw 3d88c577b7a1ef370cef039cec3f665f *dvb-usb-dw2102.fw 2946e99fe3a4973ba905fcf59111cf40 *dvb-usb-s660.fw
$ sha256sum -b *.fw ad8c23bfb51642f48d31fe4f797182352bb13a4d4b7247b25aea18e208e0e882 *dvb-fe-ds3000.fw 96560cd6e04b187dad1d6079716a8970273f3729f3e0342a609d5d3fc6dce30b *dvb-usb-dw2102.fw 454a93c4c6604e9b5e33b2dc9afe49194f4d8471a3e37863ac04af7245ca2f59 *dvb-usb-s660.fw
Re: [PATCH 6.10 288/809] media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()
Quoted 32 lines · Stefan Lippers-Hollmann
Quoted 5 lines · Sean Young
Quoted 4 lines · Stefan Lippers-Hollmann
Quoted 3 lines · Sean Young
Quoted 2 lines · Stefan Lippers-Hollmann
Quoted 1 line · Greg Kroah-Hartman
6.10-stable review patch. If anyone has any objections, please let me know.
[...]
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Infinite log printing occurs during fuzz test:
rc rc1: DViCO FusionHDTV DVB-T USB (LGZ201) as ...
...
dvb-usb: schedule remote query interval to 100 msecs.
dvb-usb: DViCO FusionHDTV DVB-T USB (LGZ201) successfully initialized ...
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
dvb-usb: bulk message failed: -22 (1/0)
...
dvb-usb: bulk message failed: -22 (1/0)Looking into the codes, there is a loop in
dvb_usb_read_remote_control(), that is inrc_core_dvb_usb_remote_init()create a work that will calldvb_usb_read_remote_control(), and this work will reschedule itself at 'rc_interval' intervals to recursively calldvb_usb_read_remote_control(), see following code snippet:[...]
Quoted 5 lines
I don't think this drivers uses the bulk endpoint, and it is missing the corresponding out bulk endpoint.
Please could you test the patch below please - that would be very helpful in narrowing down this issue.
[...]
Quoted 8 lines
After applying this patch, the TeVii s480 works again on both of my systems, but there seems to be a new error message in the log
ds3000_writereg: writeregerror(err == -11, reg == 0xa2, value == 0xb7)ds3000_writereg: writeregerror(err == -11, reg == 0x03, value == 0x12)ds3000_writereg: writeregerror(err == -11, reg == 0x03, value == 0x12)ds3000_writereg: writeregerror(err == -11, reg == 0x03, value == 0x02)ds3000_writereg: writeregerror(err == -11, reg == 0x03, value == 0x02)
I've spent of a lot time reading various code paths, and I don't understand where this is coming from, which also makes it difficult to add debug printks too. Without the hardware to debug this, I think we have to revert the commit.
The only idea I've had so far is that we are no longer clearing a halt on the bulk endpoint, but that seems pretty unlikely for a device that has just been plugged in.
Stefan, thank you for reporting the issue and testing my patch.
Sean
Greg Kroah-Hartman
maintainerPATCH 289/809 media: imon: Fix race getting ictx->lock
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit 24147897507cd3a7d63745d1518a638bf4132238 ]
Lets fix a race between mutex_is_lock() and mutex_lock().
<-mutex is not locked
if (!mutex_is_locked(&ictx->lock)) {
unlock = true; <- mutex is locked externaly
mutex_lock(&ictx->lock);
}Let's use mutex_trylock() that does mutex_is_lock() and mutex_lock() atomically.
Fix the following cocci warning:
drivers/media/rc/imon.c:1167:1-7: preceding lock on line 1153
--- drivers/media/rc/imon.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/media/rc/imon.c +1 -4
@@ -1148,10 +1148,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto)memcpy (ictx->usb_tx_buf, &ir_proto_packet,sizeof (ir_proto_packet)); -if (!mutex_is_locked (&ictx->lock)) { - unlock = true; -mutex_lock (&ictx->lock); - } + unlock =mutex_trylock (&ictx->lock); retval =send_packet (ictx);if (retval)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 290/809 drm/i915/psr: Use enable boolean from intel_crtc_state for Early Transport
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <[email protected]>
[ Upstream commit 0a8c581ce01c84214b8221fcc5d52b45c09d0007 ]
When enabling Early Transport use intel_crtc_state->enable_psr2_su_region_et instead of psr2_su_region_et_valid.
--- drivers/gpu/drm/i915/display/intel_psr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_psr.c +1 -1
@@ -659,7 +659,7 @@ void intel_psr_enable_sink(struct intel_dp *intel_dp,DP_ALPM_ENABLE | DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE); -if (psr2_su_region_et_valid (intel_dp)) +if (crtc_state->enable_psr2_su_region_et) dpcd_val |=DP_PSR_ENABLE_SU_REGION_ET ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 291/809 media: i2c: Fix imx412 exposure control
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryan O'Donoghue <[email protected]>
[ Upstream commit a1956bf53a2774014ee1768b484af2c38c633a25 ]
Currently we have the following algorithm to calculate what value should be written to the exposure control of imx412.
lpfr = imx412->vblank + imx412->cur_mode->height;
shutter = lpfr - exposure;
The 'shutter' value is given to IMX412_REG_EXPOSURE_CIT however, the above algorithm will result in the value given to IMX412_REG_EXPOSURE_CIT decreasing as the requested exposure value from user-space goes up.
e.g.
[ 2255.713989] imx412 20-001a: Received exp 1608, analog gain 0 [ 2255.714002] imx412 20-001a: Set exp 1608, analog gain 0, shutter 1938, lpfr 3546 [ 2256.302770] imx412 20-001a: Received exp 2586, analog gain 100 [ 2256.302800] imx412 20-001a: Set exp 2586, analog gain 100, shutter 960, lpfr 3546 [ 2256.753755] imx412 20-001a: Received exp 3524, analog gain 110 [ 2256.753772] imx412 20-001a: Set exp 3524, analog gain 110, shutter 22, lpfr 3546
This behaviour results in the image having less exposure as the requested exposure value from user-space increases.
Other sensor drivers such as ov5675, imx218, hid556 and others take the requested exposure value and use the value directly.
Take the example of the above cited sensor drivers and directly apply the requested exposure value from user-space. The 'lpfr' variable still functions as before but the 'shutter' variable can be dispensed with as a result.
Once done a similar run of the test application requesting higher exposure looks like this, with 'exp' written directly to the sensor.
[ 133.207884] imx412 20-001a: Received exp 1608, analog gain 0 [ 133.207899] imx412 20-001a: Set exp 1608, analog gain 0, lpfr 3546 [ 133.905309] imx412 20-001a: Received exp 2844, analog gain 100 [ 133.905344] imx412 20-001a: Set exp 2844, analog gain 100, lpfr 3546 [ 134.241705] imx412 20-001a: Received exp 3524, analog gain 110 [ 134.241775] imx412 20-001a: Set exp 3524, analog gain 110, lpfr 3546
The result is then setting the sensor exposure to lower values results in darker, less exposure images and vice versa with higher exposure values.
--- drivers/media/i2c/imx412.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/media/i2c/imx412.c +4 -5
@@ -542,14 +542,13 @@ static int imx412_update_controls(struct imx412 *imx412,*/ static int imx412_update_exp_gain (struct imx412 *imx412,u32 exposure,u32 gain) { -u32 lpfr, shutter; +u32 lpfr;int ret; lpfr = imx412->vblank + imx412->cur_mode->height; - shutter = lpfr - exposure; -dev_dbg (imx412->dev,"Set exp %u, analog gain %u, shutter %u, lpfr %u" , - exposure, gain, shutter, lpfr); +dev_dbg (imx412->dev,"Set exp %u, analog gain %u, lpfr %u" , + exposure, gain, lpfr); ret =imx412_write_reg (imx412,IMX412_REG_HOLD ,1 ,1 );if (ret)
@@ -559,7 +558,7 @@ static int imx412_update_exp_gain(struct imx412 *imx412, u32 exposure, u32 gain)if (ret) goto error_release_group_hold; - ret =imx412_write_reg (imx412,IMX412_REG_EXPOSURE_CIT ,2 , shutter); + ret =imx412_write_reg (imx412,IMX412_REG_EXPOSURE_CIT ,2 , exposure);if (ret) goto error_release_group_hold;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 292/809 media: i2c: hi846: Fix V4L2_SUBDEV_FORMAT_TRY get_selection()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit 984abe0b5794a2aca359bb61555351d2ec520d2a ]
The current code does not return anything to the user.
Although the code looks a bit dangerous (using a pointer without checking if it is valid), it should be fine. The core validates that sel->pad has a valid value.
Fix the following smatch error:drivers/media/i2c/hi846.c:1854 hi846_get_selection() warn: statement has no effect 31
--- drivers/media/i2c/hi846.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/hi846.c +1 -1
@@ -1851,7 +1851,7 @@ static int hi846_get_selection(struct v4l2_subdev *sd,mutex_lock (&hi846->mutex);switch (sel->which) {case V4L2_SUBDEV_FORMAT_TRY : -v4l2_subdev_state_get_crop (sd_state, sel->pad); + sel->r = *v4l2_subdev_state_get_crop (sd_state, sel->pad);break ;case V4L2_SUBDEV_FORMAT_ACTIVE : sel->r = hi846->cur_mode->crop;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 293/809 media: v4l: async: Fix NULL pointer dereference in adding ancillary links
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: ChiYuan Huang <[email protected]>
[ Upstream commit 9b4667ea67854f0b116fe22ad11ef5628c5b5b5f ]
In v4l2_async_create_ancillary_links(), ancillary links are created for lens and flash sub-devices. These are sub-device to sub-device links and if the async notifier is related to a V4L2 device, the source sub-device of the ancillary link is NULL, leading to a NULL pointer dereference. Check the notifier's sd field is non-NULL in v4l2_async_create_ancillary_links().
--- drivers/media/v4l2-core/v4l2-async.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/v4l2-core/v4l2-async.c +3 -0
@@ -323,6 +323,9 @@ static int v4l2_async_create_ancillary_links(struct v4l2_async_notifier *n, sd->entity.function != MEDIA_ENT_F_FLASH)return 0 ; +if (!n->sd) +return 0 ; + link =media_create_ancillary_link (&n->sd->entity, &sd->entity);return IS_ERR (link) ?PTR_ERR (link) :0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 294/809 drm/amdgpu: Fix type mismatch in amdgpu_gfx_kiq_init_ring
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
[ Upstream commit 745f7170db4ffd2f2e9751a2c719a97c9a5fc438 ]
This commit fixes a type mismatch in the amdgpu_gfx_kiq_init_ring function triggered by the snprintf function expecting unsigned char arguments due to the '%hhu' format specifier, but receiving int and u32 arguments.
The issue occurred because the arguments xcc_id, ring->me, ring->pipe, and ring->queue were of type int and u32, not unsigned char. This led to a type mismatch when these arguments were passed to snprintf.
To resolve this, the snprintf line was modified to cast these arguments to unsigned char. This ensures that the arguments are of the correct type for the '%hhu' format specifier and resolves the warning.
Fixes the below:
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
xcc_id, ring->me, ring->pipe, ring->queue);
^~~~~~Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:12: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
xcc_id, ring->me, ring->pipe, ring->queue);
^~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:22: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
xcc_id, ring->me, ring->pipe, ring->queue);
^~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:34: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
xcc_id, ring->me, ring->pipe, ring->queue);
^~~~~~~~~~~4 warnings generated.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -1
@@ -330,7 +330,8 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev, int xcc_id) ring->eop_gpu_addr = kiq->eop_gpu_addr; ring->no_scheduler = true;snprintf (ring->name,sizeof (ring->name),"kiq_%hhu.%hhu.%hhu.%hhu" , - xcc_id, ring->me, ring->pipe, ring->queue); + (unsigned char )xcc_id, (unsigned char )ring->me, + (unsigned char )ring->pipe, (unsigned char )ring->queue); r =amdgpu_ring_init (adev, ring,1024 , irq,AMDGPU_CP_KIQ_IRQ_DRIVER0 ,AMDGPU_RING_PRIO_DEFAULT ,NULL );if (r)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 295/809 s390/uv: Dont call folio_wait_writeback() without a folio reference
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <[email protected]>
[ Upstream commit 3f29f6537f54d74e64bac0a390fb2e26da25800d ]
folio_wait_writeback() requires that no spinlocks are held and that a folio reference is held, as documented. After we dropped the PTL, the folio could get freed concurrently. So grab a temporary reference.
--- arch/s390/kernel/uv.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/s390/kernel/uv.c +8 -0
@@ -318,6 +318,13 @@ int gmap_make_secure(struct gmap *gmap, unsigned long gaddr, void *uvcb) rc =make_folio_secure (folio, uvcb);folio_unlock (folio); } + +/* +* Once we drop the PTL, the folio may get unmapped and +* freed immediately. We need a temporary reference. +*/ +if (rc == -EAGAIN ) +folio_get (folio); } unlock:pte_unmap_unlock (ptep, ptelock);
@@ -330,6 +337,7 @@ int gmap_make_secure(struct gmap *gmap, unsigned long gaddr, void *uvcb)* completion, this is just a useless check, but it is safe. */ folio_wait_writeback (folio); +folio_put (folio); }else if (rc == -EBUSY ) {/* * If we have tried a local drain and the folio refcount
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 296/809 drm/msm/dpu: fix encoder irq wait skip
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Barnabás Czémán <[email protected]>
[ Upstream commit e42d518511871ae625b5ff699853a05af1ccccf7 ]
The irq_idx is unsigned so it cannot be lower than zero, better to change the condition to check if it is equal with zero. It could not cause any issue because a valid irq index starts from one.
Patchwork: https://patchwork.freedesktop.org/patch/596853/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +1 -1
@@ -428,7 +428,7 @@ int dpu_encoder_helper_wait_for_irq(struct dpu_encoder_phys *phys_enc,return -EWOULDBLOCK ; } -if (irq_idx <0 ) { +if (irq_idx ==0 ) {DRM_DEBUG_KMS ("skip irq wait id=%u, callback=%ps\n" ,DRMID (phys_enc->parent), func);return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 297/809 Revert "drm/msm/dpu: drop dpu_encoder_phys_ops.atomic_mode_set"
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 35322c39a653c775670f0713fb96ccc2cd91a747 ]
In the DPU driver blank IRQ handling is called from a vblank worker and can happen outside of the irq_enable / irq_disable pair. Using the worker makes that completely asynchronous with the rest of the code. Revert commit d13f638c9b88 ("drm/msm/dpu: drop dpu_encoder_phys_ops.atomic_mode_set") to fix vblank IRQ assignment for CMD DSI panels.
Call trace: dpu_encoder_phys_cmd_control_vblank_irq+0x218/0x294 dpu_encoder_toggle_vblank_for_crtc+0x160/0x194 dpu_crtc_vblank+0xbc/0x228 dpu_kms_enable_vblank+0x18/0x24 vblank_ctrl_worker+0x34/0x6c process_one_work+0x218/0x620 worker_thread+0x1ac/0x37c kthread+0x114/0x118 ret_from_fork+0x10/0x20
Patchwork: https://patchwork.freedesktop.org/patch/595065/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 ++ .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 5 +++ .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 32 +++++++++++-------- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 13 ++++++-- .../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 11 ++++++- 5 files changed, 46 insertions(+), 17 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2 -0
@@ -1200,6 +1200,8 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, phys->hw_ctl =to_dpu_hw_ctl (hw_ctl[i]); phys->cached_mode = crtc_state->adjusted_mode; +if (phys->ops.atomic_mode_set) + phys->ops.atomic_mode_set (phys, crtc_state, conn_state); } }
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +5 -0
@@ -69,6 +69,8 @@ struct dpu_encoder_phys;* @is_master: Whether this phys_enc is the current master * encoder. Can be switched at enable time. Based * on split_role and current mode (CMD/VID). +* @atomic_mode_set: DRM Call. Set a DRM mode. +* This likely caches the mode, for use at enable. * @enable: DRM Call. Enable a DRM mode. * @disable: DRM Call. Disable mode. * @control_vblank_irq Register/Deregister for VBLANK IRQ
@@ -93,6 +95,9 @@ struct dpu_encoder_phys;struct dpu_encoder_phys_ops {void (*prepare_commit)(struct dpu_encoder_phys *encoder);bool (*is_master)(struct dpu_encoder_phys *encoder); +void (*atomic_mode_set)(struct dpu_encoder_phys *encoder, +struct drm_crtc_state *crtc_state, +struct drm_connector_state *conn_state);void (*enable)(struct dpu_encoder_phys *encoder);void (*disable)(struct dpu_encoder_phys *encoder);int (*control_vblank_irq)(struct dpu_encoder_phys *enc,bool enable);
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +18 -14
@@ -142,6 +142,23 @@ static void dpu_encoder_phys_cmd_underrun_irq(void *arg)dpu_encoder_underrun_callback (phys_enc->parent, phys_enc); } +static void dpu_encoder_phys_cmd_atomic_mode_set ( +struct dpu_encoder_phys *phys_enc, +struct drm_crtc_state *crtc_state, +struct drm_connector_state *conn_state) +{ + phys_enc->irq[INTR_IDX_CTL_START ] = phys_enc->hw_ctl->caps->intr_start; + + phys_enc->irq[INTR_IDX_PINGPONG ] = phys_enc->hw_pp->caps->intr_done; + +if (phys_enc->has_intf_te) + phys_enc->irq[INTR_IDX_RDPTR ] = phys_enc->hw_intf->cap->intr_tear_rd_ptr; +else + phys_enc->irq[INTR_IDX_RDPTR ] = phys_enc->hw_pp->caps->intr_rdptr; + + phys_enc->irq[INTR_IDX_UNDERRUN ] = phys_enc->hw_intf->cap->intr_underrun; +} +static int _dpu_encoder_phys_cmd_handle_ppdone_timeout (struct dpu_encoder_phys *phys_enc) {
@@ -280,14 +297,6 @@ static void dpu_encoder_phys_cmd_irq_enable(struct dpu_encoder_phys *phys_enc) phys_enc->hw_pp->idx -PINGPONG_0 , phys_enc->vblank_refcount); - phys_enc->irq[INTR_IDX_CTL_START ] = phys_enc->hw_ctl->caps->intr_start; - phys_enc->irq[INTR_IDX_PINGPONG ] = phys_enc->hw_pp->caps->intr_done; - -if (phys_enc->has_intf_te) - phys_enc->irq[INTR_IDX_RDPTR ] = phys_enc->hw_intf->cap->intr_tear_rd_ptr; -else - phys_enc->irq[INTR_IDX_RDPTR ] = phys_enc->hw_pp->caps->intr_rdptr; - dpu_core_irq_register_callback(phys_enc->dpu_kms, phys_enc->irq[INTR_IDX_PINGPONG], dpu_encoder_phys_cmd_pp_tx_done_irq,
@@ -318,10 +327,6 @@ static void dpu_encoder_phys_cmd_irq_disable(struct dpu_encoder_phys *phys_enc)dpu_core_irq_unregister_callback (phys_enc->dpu_kms, phys_enc->irq[INTR_IDX_UNDERRUN ]);dpu_encoder_phys_cmd_control_vblank_irq (phys_enc, false);dpu_core_irq_unregister_callback (phys_enc->dpu_kms, phys_enc->irq[INTR_IDX_PINGPONG ]); - - phys_enc->irq[INTR_IDX_CTL_START ] =0 ; - phys_enc->irq[INTR_IDX_PINGPONG ] =0 ; - phys_enc->irq[INTR_IDX_RDPTR ] =0 ; } static void dpu_encoder_phys_cmd_tearcheck_config(
@@ -698,6 +703,7 @@ static void dpu_encoder_phys_cmd_init_ops( struct dpu_encoder_phys_ops *ops) { ops->is_master = dpu_encoder_phys_cmd_is_master; + ops->atomic_mode_set = dpu_encoder_phys_cmd_atomic_mode_set; ops->enable = dpu_encoder_phys_cmd_enable; ops->disable = dpu_encoder_phys_cmd_disable; ops->control_vblank_irq = dpu_encoder_phys_cmd_control_vblank_irq;
@@ -736,8 +742,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(struct drm_device *dev,dpu_encoder_phys_cmd_init_ops (&phys_enc->ops); phys_enc->intf_mode =INTF_MODE_CMD ; - phys_enc->irq[INTR_IDX_UNDERRUN ] = phys_enc->hw_intf->cap->intr_underrun; - cmd_enc->stream_sel =0 ;if (!phys_enc->hw_intf) {
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +11 -2
@@ -356,6 +356,16 @@ static bool dpu_encoder_phys_vid_needs_single_flush(return phys_enc->split_role !=ENC_ROLE_SOLO ; } +static void dpu_encoder_phys_vid_atomic_mode_set ( +struct dpu_encoder_phys *phys_enc, +struct drm_crtc_state *crtc_state, +struct drm_connector_state *conn_state) +{ + phys_enc->irq[INTR_IDX_VSYNC ] = phys_enc->hw_intf->cap->intr_vsync; + + phys_enc->irq[INTR_IDX_UNDERRUN ] = phys_enc->hw_intf->cap->intr_underrun; +} +static int dpu_encoder_phys_vid_control_vblank_irq (struct dpu_encoder_phys *phys_enc,bool enable)
@@ -699,6 +709,7 @@ static int dpu_encoder_phys_vid_get_frame_count(static void dpu_encoder_phys_vid_init_ops (struct dpu_encoder_phys_ops *ops) { ops->is_master = dpu_encoder_phys_vid_is_master; + ops->atomic_mode_set = dpu_encoder_phys_vid_atomic_mode_set; ops->enable = dpu_encoder_phys_vid_enable; ops->disable = dpu_encoder_phys_vid_disable; ops->control_vblank_irq = dpu_encoder_phys_vid_control_vblank_irq;
@@ -737,8 +748,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(struct drm_device *dev,dpu_encoder_phys_vid_init_ops (&phys_enc->ops); phys_enc->intf_mode =INTF_MODE_VIDEO ; - phys_enc->irq[INTR_IDX_VSYNC ] = phys_enc->hw_intf->cap->intr_vsync; - phys_enc->irq[INTR_IDX_UNDERRUN ] = phys_enc->hw_intf->cap->intr_underrun;DPU_DEBUG_VIDENC (phys_enc,"created intf idx:%d\n" , p->hw_intf->idx);
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +10 -1
@@ -404,6 +404,15 @@ static void dpu_encoder_phys_wb_irq_disable(struct dpu_encoder_phys *phys)dpu_core_irq_unregister_callback (phys->dpu_kms, phys->irq[INTR_IDX_WB_DONE ]); } +static void dpu_encoder_phys_wb_atomic_mode_set ( +struct dpu_encoder_phys *phys_enc, +struct drm_crtc_state *crtc_state, +struct drm_connector_state *conn_state) +{ + + phys_enc->irq[INTR_IDX_WB_DONE ] = phys_enc->hw_wb->caps->intr_wb_done; +} +static void _dpu_encoder_phys_wb_handle_wbdone_timeout (struct dpu_encoder_phys *phys_enc) {
@@ -640,6 +649,7 @@ static bool dpu_encoder_phys_wb_is_valid_for_commit(struct dpu_encoder_phys *phystatic void dpu_encoder_phys_wb_init_ops (struct dpu_encoder_phys_ops *ops) { ops->is_master = dpu_encoder_phys_wb_is_master; + ops->atomic_mode_set = dpu_encoder_phys_wb_atomic_mode_set; ops->enable = dpu_encoder_phys_wb_enable; ops->disable = dpu_encoder_phys_wb_disable; ops->wait_for_commit_done = dpu_encoder_phys_wb_wait_for_commit_done;
@@ -685,7 +695,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_wb_init(struct drm_device *dev,dpu_encoder_phys_wb_init_ops (&phys_enc->ops); phys_enc->intf_mode =INTF_MODE_WB_LINE ; - phys_enc->irq[INTR_IDX_WB_DONE ] = phys_enc->hw_wb->caps->intr_wb_done;atomic_set (&wb_enc->wbirq_refcount,0 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 298/809 drm/msm/dpu: drop duplicate drm formats from wb2_formats arrays
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junhao Xie <[email protected]>
[ Upstream commit 6ed817592638348e83facfe6a4deedb8d5e83357 ]
There are duplicate items in wb2_formats_rgb and wb2_formats_rgb_yuv, which cause weston assertions failed.
weston: libweston/drm-formats.c:131: weston_drm_format_array_add_format:
Assertion `!weston_drm_format_array_find_format(formats, format)' failed.
Patchwork: https://patchwork.freedesktop.org/patch/596847/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +0 -6
@@ -220,12 +220,9 @@ static const u32 wb2_formats_rgb[] = {DRM_FORMAT_RGBA4444 ,DRM_FORMAT_RGBX4444 ,DRM_FORMAT_XRGB4444 , -DRM_FORMAT_BGR565 ,DRM_FORMAT_BGR888 , -DRM_FORMAT_ABGR8888 ,DRM_FORMAT_BGRA8888 ,DRM_FORMAT_BGRX8888 , -DRM_FORMAT_XBGR8888 ,DRM_FORMAT_ABGR1555 ,DRM_FORMAT_BGRA5551 , DRM_FORMAT_XBGR1555,
@@ -254,12 +251,9 @@ static const u32 wb2_formats_rgb_yuv[] = {DRM_FORMAT_RGBA4444 ,DRM_FORMAT_RGBX4444 ,DRM_FORMAT_XRGB4444 , -DRM_FORMAT_BGR565 ,DRM_FORMAT_BGR888 , -DRM_FORMAT_ABGR8888 ,DRM_FORMAT_BGRA8888 ,DRM_FORMAT_BGRX8888 , -DRM_FORMAT_XBGR8888 ,DRM_FORMAT_ABGR1555 ,DRM_FORMAT_BGRA5551 , DRM_FORMAT_XBGR1555,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 299/809 drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit aeacc39e2088a15ee31c8af4f68c84981fa08eb7 ]
The function dp_wait_hpd_asserted() uses pm_runtime_get_sync() and doesn't care about the return value. Potentially this can lead to unclocked access if for some reason resuming of the DP controller fails.
Change the function to use pm_runtime_resume_and_get() and return an error if resume fails.
Patchwork: https://patchwork.freedesktop.org/patch/580137/
--- drivers/gpu/drm/msm/dp/dp_aux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_aux.c +4 -1
@@ -513,7 +513,10 @@ static int dp_wait_hpd_asserted(struct drm_dp_aux *dp_aux, aux = container_of(dp_aux, struct dp_aux_private, dp_aux); -pm_runtime_get_sync (aux->dev); + ret =pm_runtime_resume_and_get (aux->dev); +if (ret) +return ret; + ret =dp_catalog_aux_wait_for_hpd_connect_state (aux->catalog, wait_us);pm_runtime_put_sync (aux->dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 300/809 perf maps: Fix use after free in __maps__fixup_overlap_and_insert
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <[email protected]>
[ Upstream commit 0b90dfda222e38b7ca8dad6e098e36f5186f0b94 ]
In the case 'before' and 'after' are broken out from pos, maps_by_address may be changed by __maps__insert, as such it needs re-reading.
Don't ignore the return value from __maps_insert.
--- tools/perf/util/maps.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
tools/perf/util/maps.c +5 -4
@@ -741,7 +741,6 @@ static unsigned int first_ending_after(struct maps *maps, const struct map *map)*/ static int __maps__fixup_overlap_and_insert (struct maps *maps,struct map *new) { -struct map **maps_by_address;int err =0 ;FILE *fp =debug_file ();
@@ -749,12 +748,12 @@ static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)if (!maps__maps_by_address_sorted (maps))__maps__sort_by_address (maps); - maps_by_address =maps__maps_by_address (maps);/* * Iterate through entries where the end of the existing entry is * greater-than the new map's start. */ for (unsigned int i =first_ending_after (maps, new); i <maps__nr_maps (maps); ) { +struct map **maps_by_address =maps__maps_by_address (maps);struct map *pos = maps_by_address[i];struct map *before =NULL , *after =NULL ;
@@ -821,8 +820,10 @@ static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)/* Maps are still ordered, go to next one. */ i++;if (after) { -__maps__insert (maps, after); + err =__maps__insert (maps, after);map__put (after); +if (err) + goto out_err;if (!maps__maps_by_address_sorted (maps)) {/* * Sorting broken so invariants don't
@@ -851,7 +852,7 @@ static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)check_invariants (maps); }/* Add the map. */ -__maps__insert (maps, new); + err =__maps__insert (maps, new); out_err:return err; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 301/809 media: mediatek: vcodec: Handle invalid decoder vsi
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Irui Wang <[email protected]>
[ Upstream commit 59d438f8e02ca641c58d77e1feffa000ff809e9f ]
Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi is valid for future use.
--- .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c +6 -0
@@ -233,6 +233,12 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)mtk_vdec_debug (vpu->ctx,"vdec_inst=%p" , vpu); err =vcodec_vpu_send_msg (vpu, (void *)&msg,sizeof (msg)); + +if (IS_ERR_OR_NULL (vpu->vsi)) { +mtk_vdec_err (vpu->ctx,"invalid vdec vsi, status=%d" , err); +return -EINVAL ; + } +mtk_vdec_debug (vpu->ctx,"- ret=%d" , err);return err; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 302/809 media: mediatek: vcodec: Fix unreasonable data conversion
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunfei Dong <[email protected]>
[ Upstream commit 48d85de244047eabe07c5040af12dfa736d61d6c ]
Both 'bs_dma' and 'dma_addr' are integers. No need to convert the type from dma_addr_t to uint64_t again.
--- .../media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c +1 -1
@@ -449,7 +449,7 @@ static int vdec_vp8_decode(void *h_vdec, struct mtk_vcodec_mem *bs, inst->frm_cnt, y_fb_dma, c_fb_dma, fb); inst->cur_fb = fb; - dec->bs_dma = (uint64_t )bs->dma_addr; + dec->bs_dma = bs->dma_addr; dec->bs_sz = bs->size; dec->cur_y_fb_dma = y_fb_dma; dec->cur_c_fb_dma = c_fb_dma;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 303/809 drm/bridge: samsung-dsim: Set P divider based on min/max of fin pll
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Ford <[email protected]>
[ Upstream commit 78c4c0011bb577a29906d8ca135795af2293c49e ]
The P divider should be set based on the min and max values of the fin pll which may vary between different platforms. These ranges are defined per platform, but hard-coded values were used instead which resulted in a smaller range available on the i.MX8M[MNP] than what was possible.
As noted by Frieder, there are descripencies between the reference manuals of the Mini, Nano and Plus, so I reached out to my NXP rep and got the following response regarding the varing notes in the documentation.
"Yes it is definitely wrong, the one that is part of the NOTE in MIPI_DPHY_M_PLLPMS register table against PMS_P, PMS_M and PMS_S is not correct. I will report this to Doc team, the one customer should be take into account is the Table 13-40 DPHY PLL Parameters and the Note above."
With this patch, the clock rates now match the values used in NXP's downstream kernel.
--- drivers/gpu/drm/bridge/samsung-dsim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/samsung-dsim.c +2 -2
@@ -574,8 +574,8 @@ static unsigned long samsung_dsim_pll_find_pms(struct samsung_dsim *dsi,u16 _m, best_m;u8 _s, best_s; - p_min =DIV_ROUND_UP (fin, (12 *MHZ )); - p_max = fin / (6 *MHZ ); + p_min =DIV_ROUND_UP (fin, (driver_data->pll_fin_max *MHZ )); + p_max = fin / (driver_data->pll_fin_min *MHZ );for (_p = p_min; _p <= p_max; ++_p) {for (_s =0 ; _s <=5 ; ++_s) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 304/809 drm/i915/display: Skip Panel Replay on pipe comparison if no active planes
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <[email protected]>
[ Upstream commit 955446ed6e822b86751993bd69022d347b43a99e ]
Panel Replay is not enabled if there are no active planes. Do not compare it on pipe comparison. Otherwise we get pipe mismatch.
--- drivers/gpu/drm/i915/display/intel_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display.c +3 -1
@@ -5318,7 +5318,9 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,* Panel replay has to be enabled before link training. PSR doesn't have * this requirement -> check these only if using panel replay */ -if (current_config->has_panel_replay || pipe_config->has_panel_replay) { +if (current_config->active_planes && + (current_config->has_panel_replay || + pipe_config->has_panel_replay)) {PIPE_CONF_CHECK_BOOL (has_psr);PIPE_CONF_CHECK_BOOL (has_sel_update);PIPE_CONF_CHECK_BOOL (enable_psr2_sel_fetch);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 305/809 drm/i915/psr: Print Panel Replay status instead of frame lock status
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <[email protected]>
[ Upstream commit 51ee1f29a9aceb8a52037ba4759d44c70e966fe5 ]
Currently Panel Replay status printout is printing frame lock status. It should print Panel Replay status instead. Panel Replay status register field follows PSR status register field. Use existing PSR code for that.
--- drivers/gpu/drm/i915/display/intel_psr.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/display/intel_psr.c +5 -17
@@ -3694,16 +3694,9 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data)"reserved" , "sink internal error", }; -static const char *const panel_replay_status[] = { -"Sink device frame is locked to the Source device" , -"Sink device is coasting, using the VTotal target" , -"Sink device is governing the frame rate (frame rate unlock is granted)" , -"Sink device in the process of re-locking with the Source device" , - };const char *str;int ret;u8 status, error_status; -u32 idx;if (!(CAN_PSR (intel_dp) ||CAN_PANEL_REPLAY (intel_dp))) {seq_puts (m,"PSR/Panel-Replay Unsupported\n" );
@@ -3717,16 +3710,11 @@ static int i915_psr_sink_status_show(struct seq_file *m, void *data)if (ret)return ret; - str ="unknown" ; -if (intel_dp->psr.panel_replay_enabled) { - idx = (status &DP_SINK_FRAME_LOCKED_MASK ) >>DP_SINK_FRAME_LOCKED_SHIFT ; -if (idx <ARRAY_SIZE (panel_replay_status)) - str = panel_replay_status[idx]; - }else if (intel_dp->psr.enabled) { - idx = status &DP_PSR_SINK_STATE_MASK ; -if (idx <ARRAY_SIZE (sink_status)) - str = sink_status[idx]; - } + status &=DP_PSR_SINK_STATE_MASK ; +if (status <ARRAY_SIZE (sink_status)) + str = sink_status[status]; +else + str ="unknown" ;seq_printf (m,"Sink %s status: 0x%x [%s]\n" ,psr_mode_str (intel_dp), status, str);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 306/809 x86/shstk: Make return uprobe work with shadow stack
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <[email protected]>
[ Upstream commit 1713b63a07a28a475de94664f783b4cfd2e4fa90 ]
Currently the application with enabled shadow stack will crash if it sets up return uprobe. The reason is the uretprobe kernel code changes the user space task's stack, but does not update shadow stack accordingly.
Adding new functions to update values on shadow stack and using them in uprobe code to keep shadow stack in sync with uretprobe changes to user stack.
--- arch/x86/include/asm/shstk.h | 2 ++ arch/x86/kernel/shstk.c | 11 +++++++++++ arch/x86/kernel/uprobes.c | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-)
arch/x86/include/asm/shstk.h +2 -0
@@ -21,6 +21,7 @@ unsigned long shstk_alloc_thread_stack(struct task_struct *p, unsigned long clonvoid shstk_free (struct task_struct *p);int setup_signal_shadow_stack (struct ksignal *ksig);int restore_signal_shadow_stack (void ); +int shstk_update_last_frame (unsigned long val);#else static inline long shstk_prctl (struct task_struct *task,int option,unsigned long arg2) {return -EINVAL ; }
@@ -31,6 +32,7 @@ static inline unsigned long shstk_alloc_thread_stack(struct task_struct *p,static inline void shstk_free (struct task_struct *p) {}static inline int setup_signal_shadow_stack (struct ksignal *ksig) {return 0 ; }static inline int restore_signal_shadow_stack (void ) {return 0 ; } +static inline int shstk_update_last_frame (unsigned long val) {return 0 ; }#endif /* CONFIG_X86_USER_SHADOW_STACK */ #endif /* __ASSEMBLY__ */
arch/x86/kernel/shstk.c +11 -0
@@ -577,3 +577,14 @@ long shstk_prctl(struct task_struct *task, int option, unsigned long arg2)return wrss_control (true);return -EINVAL ; } + +int shstk_update_last_frame (unsigned long val) +{ +unsigned long ssp; + +if (!features_enabled (ARCH_SHSTK_SHSTK )) +return 0 ; + + ssp =get_user_shstk_addr (); +return write_user_shstk_64 ((u64 __user *)ssp, (u64 )val); +}
arch/x86/kernel/uprobes.c +6 -1
@@ -1076,8 +1076,13 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regsreturn orig_ret_vaddr; nleft =copy_to_user ((void __user *)regs->sp, &trampoline_vaddr, rasize); -if (likely (!nleft)) +if (likely (!nleft)) { +if (shstk_update_last_frame (trampoline_vaddr)) { +force_sig (SIGSEGV ); +return -1 ; + }return orig_ret_vaddr; + }if (nleft != rasize) { pr_err("return address clobbered: pid=%d, %%sp=%#lx, %%ip=%#lx\n",
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 307/809 ipmi: ssif_bmc: prevent integer overflow on 32bit systems
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 0627cef36145c9ff9845bdfd7ddf485bbac1f981 ]
There are actually two bugs here. First, we need to ensure that count is at least sizeof(u32) or msg.len will be uninitialized data.
The "msg.len" variable is a u32 that comes from the user. On 32bit systems the "sizeof_field(struct ipmi_ssif_msg, len) + msg.len" addition can overflow if "msg.len" is greater than U32_MAX - 4.
Valid lengths for "msg.len" are 1-254. Add a check for that to prevent the integer overflow.
Message-Id: <[email protected]>
--- drivers/char/ipmi/ssif_bmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/char/ipmi/ssif_bmc.c +4 -2
@@ -177,13 +177,15 @@ static ssize_t ssif_bmc_write(struct file *file, const char __user *buf, size_tunsigned long flags;ssize_t ret; -if (count >sizeof (struct ipmi_ssif_msg )) +if (count <sizeof (msg.len) || + count >sizeof (struct ipmi_ssif_msg ))return -EINVAL ;if (copy_from_user (&msg, buf, count))return -EFAULT ; - if (!msg.len || count < sizeof_field(struct ipmi_ssif_msg, len) + msg.len) +if (!msg.len || msg.len >IPMI_SSIF_PAYLOAD_MAX || + count < sizeof_field(struct ipmi_ssif_msg, len) + msg.len)return -EINVAL ;spin_lock_irqsave (&ssif_bmc->lock, flags);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 308/809 drm/amd/display: use pre-allocated temp structure for bounding box
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit afe9555e79fcd0d758e3796ad00fd6292d99361b ]
This mirrors what the driver does for older DCN generations.
Should fix:
BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 449, name: kworker/u64:8preempt_count: 2, expected: 0
RCU nest depth: 0, expected: 0
Preemption disabled at:ffffffffc0ce1580>] dc_fpu_begin+0x30/0xd0 [amdgpu]
CPU: 5 PID: 449 Comm: kworker/u64:8 Tainted: G W 6.8.0+ #35 Hardware name: System manufacturer System Product Name/ROG STRIX X570-E GAMING WIFI II, BIOS 4204 02/24/2022 Workqueue: events_unbound async_run_entry_fn
v2: drop extra memcpy
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 8 ++------ .../drm/amd/display/dc/resource/dcn321/dcn321_resource.c | 8 ++------ 3 files changed, 5 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1392,6 +1392,7 @@ struct dc { } scratch;struct dml2_configuration_options dml2_options; +struct dml2_configuration_options dml2_tmp;enum dc_acpi_cm_power_state power_state; };
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +2 -6
@@ -2006,11 +2006,9 @@ void dcn32_calculate_wm_and_dlg(struct dc *dc, struct dc_state *context,static void dcn32_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) { -struct dml2_configuration_options *dml2_opt; +struct dml2_configuration_options *dml2_opt = &dc->dml2_tmp; - dml2_opt =kmemdup (&dc->dml2_options,sizeof (dc->dml2_options),GFP_KERNEL ); -if (!dml2_opt) -return ; +memcpy (dml2_opt, &dc->dml2_options,sizeof (dc->dml2_options));DC_FP_START ();
@@ -2025,8 +2023,6 @@ static void dcn32_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bwdml2_reinit (dc, dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source);DC_FP_END (); - -kfree (dml2_opt); }static struct resource_funcs dcn32_res_pool_funcs = {
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +2 -6
@@ -1581,11 +1581,9 @@ static struct dc_cap_funcs cap_funcs = {static void dcn321_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) { -struct dml2_configuration_options *dml2_opt; +struct dml2_configuration_options *dml2_opt = &dc->dml2_tmp; - dml2_opt =kmemdup (&dc->dml2_options,sizeof (dc->dml2_options),GFP_KERNEL ); -if (!dml2_opt) -return ; +memcpy (dml2_opt, &dc->dml2_options,sizeof (dc->dml2_options));DC_FP_START ();
@@ -1600,8 +1598,6 @@ static void dcn321_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bdml2_reinit (dc, dml2_opt, &dc->current_state->bw_ctx.dml2_dc_power_source);DC_FP_END (); - -kfree (dml2_opt); }static struct resource_funcs dcn321_res_pool_funcs = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 309/809 saa7134: Unchecked i2c_transfer function result fixed
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Burakov <[email protected]>
[ Upstream commit 9d8683b3fd93f0e378f24dc3d9604e5d7d3e0a17 ]
Return value of function 'i2c_transfer' is not checked that may cause undefined behaviour.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/media/pci/saa7134/saa7134-dvb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/media/pci/saa7134/saa7134-dvb.c +6 -2
@@ -466,7 +466,9 @@ static int philips_europa_tuner_sleep(struct dvb_frontend *fe)/* switch the board to analog mode */ if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl (fe,1 ); -i2c_transfer (&dev->i2c_adap, &analog_msg,1 ); +if (i2c_transfer (&dev->i2c_adap, &analog_msg,1 ) !=1 ) +return -EIO ; +return 0 ; }
@@ -1018,7 +1020,9 @@ static int md8800_set_voltage2(struct dvb_frontend *fe,else wbuf[1 ] = rbuf &0xef ; msg[0 ].len =2 ; -i2c_transfer (&dev->i2c_adap, msg,1 ); +if (i2c_transfer (&dev->i2c_adap, msg,1 ) !=1 ) +return -EIO ; +return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 310/809 media: c8sectpfe: Add missing parameter names
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit abb7a73b687dc82202f0203a112ef435fb598aa6 ]
clang 19 complains about the missing parameter name. Let's add it.
drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-debugfs.h:19:62: warning: omitting the parameter name in a function definition is a C23 extension [-Wc23-extensions]
--- drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-debugfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-debugfs.h +2 -2
@@ -16,8 +16,8 @@void c8sectpfe_debugfs_init (struct c8sectpfei *);void c8sectpfe_debugfs_exit (struct c8sectpfei *);#else -static inline void c8sectpfe_debugfs_init (struct c8sectpfei *) {}; -static inline void c8sectpfe_debugfs_exit (struct c8sectpfei *) {}; +static inline void c8sectpfe_debugfs_init (struct c8sectpfei *fei) {}; +static inline void c8sectpfe_debugfs_exit (struct c8sectpfei *fei) {};#endif #endif /* __C8SECTPFE_DEBUG_H */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 311/809 media: i2c: imx219: fix msr access command sequence
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Conor Dooley <[email protected]>
[ Upstream commit 3cdc776e0a5f1784c3ae5d3371b64215c228bf1f ]
It was reported to me that the imx219 didn't work on one of our development kits partly because the access sequence is incorrect. The datasheet I could find [1] for this camera has the access sequence:
Seq. No. Address (Hex) data
1 30EB 05 2 30EB 0C 3 300A FF 4 300B FF 5 30EB 05 6 30EB 09
but the driver swaps the first two elements. Laurent pointed out on IRC that the original code used the correct sequence for 1920x1080 but the current sequence for 3280x2464 and 1640x1232. During refactoring of the init sequence the current order was used for all formats.
Switch to using the documented sequence.
--- drivers/media/i2c/imx219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/imx219.c +1 -1
@@ -162,8 +162,8 @@ static const struct cci_reg_sequence imx219_common_regs[] = { { IMX219_REG_MODE_SELECT, 0x00 }, /* Mode Select *//* To Access Addresses 3000-5fff, send the following commands */ - { CCI_REG8(0x30eb), 0x0c }, { CCI_REG8(0x30eb), 0x05 }, + { CCI_REG8(0x30eb), 0x0c }, { CCI_REG8(0x300a), 0xff }, { CCI_REG8(0x300b), 0xff }, { CCI_REG8(0x30eb), 0x05 },
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 312/809 media: uvcvideo: Quirk for invalid dev_sof in Logitech C922
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit 9183c6f1a21e0da4415762c504e2d7f784304d12 ]
Logitech C922 internal SOF does not increases at a stable rate of 1kHz. This causes that the device_sof and the host_sof run at different rates, breaking the clock domain conversion algorithm. Eg:
30 (6) [-] none 30 614400 B 21.245557 21.395214 34.133 fps ts mono/SoE 31 (7) [-] none 31 614400 B 21.275327 21.427246 33.591 fps ts mono/SoE 32 (0) [-] none 32 614400 B 21.304739 21.459256 34.000 fps ts mono/SoE 33 (1) [-] none 33 614400 B 21.334324 21.495274 33.801 fps ts mono/SoE
* 34 (2) [-] none 34 614400 B 21.529237 21.527297 5.130 fps ts mono/SoE
* 35 (3) [-] none 35 614400 B 21.649416 21.559306 8.321 fps ts mono/SoE 36 (4) [-] none 36 614400 B 21.678789 21.595320 34.045 fps ts mono/SoE
...
99 (3) [-] none 99 614400 B 23.542226 23.696352 33.541 fps ts mono/SoE 100 (4) [-] none 100 614400 B 23.571578 23.728404 34.069 fps ts mono/SoE 101 (5) [-] none 101 614400 B 23.601425 23.760420 33.504 fps ts mono/SoE
* 102 (6) [-] none 102 614400 B 23.798324 23.796428 5.079 fps ts mono/SoE
* 103 (7) [-] none 103 614400 B 23.916271 23.828450 8.478 fps ts mono/SoE 104 (0) [-] none 104 614400 B 23.945720 23.860479 33.957 fps ts mono/SoE
Instead of disabling completely the hardware timestamping for such hardware we take the assumption that the packet handling jitter is under 2ms and use the host_sof as dev_sof.
We can think of the UVC hardware clock as a system with a coarse clock (the SOF) and a fine clock (the PTS). The coarse clock can be replaced with a clock on the same frequency, if the jitter of such clock is smaller than its sampling rate. That way we can save some of the precision of the fine clock.
To probe this point we have run three experiments on the Logitech C922. On that experiment we run the camera at 33fps and we analyse the difference in msec between a frame and its predecessor. If we display the histogram of that value, a thinner histogram will mean a better meassurement. The results for:
- original hw timestamp: https://ibb.co/D1HJJ4x
- pure software timestamp: https://ibb.co/QC9MgVK
- modified hw timestamp: https://ibb.co/8s9dBdk
This bug in the camera firmware has been confirmed by the vendor.
lsusb -v
Bus 001 Device 044: ID 046d:085c Logitech, Inc. C922 Pro Stream Webcam Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x046d Logitech, Inc.
idProduct 0x085c C922 Pro Stream Webcam
bcdDevice 0.16
iManufacturer 0 iProduct 2 C922 Pro Stream Webcam iSerial 1 80B912DF bNumConfigurations 1
Stable-dep-of: 85fbe91a7c92 ("media: uvcvideo: Add quirk for invalid dev_sof in Logitech C920")
--- drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++ drivers/media/usb/uvc/uvc_video.c | 11 +++++++++++ drivers/media/usb/uvc/uvcvideo.h | 1 + 3 files changed, 21 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +9 -0
@@ -2581,6 +2581,15 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) }, +/* Logitech HD Pro Webcam C922 */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x046d, + .idProduct = 0x085c, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_INVALID_DEVICE_SOF) }, /* Logitech Rally Bar Huddle */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
drivers/media/usb/uvc/uvc_video.c +11 -0
@@ -529,6 +529,17 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf, stream->clock.last_sof = dev_sof; host_sof =usb_get_current_frame_number (stream->dev->udev); + +/* +* On some devices, like the Logitech C922, the device SOF does not run +* at a stable rate of 1kHz. For those devices use the host SOF instead. +* In the tests performed so far, this improves the timestamp precision. +* This is probably explained by a small packet handling jitter from the +* host, but the exact reason hasn't been fully determined. +*/ +if (stream->dev->quirks &UVC_QUIRK_INVALID_DEVICE_SOF ) + dev_sof = host_sof; + time =uvc_video_get_time ();/*
drivers/media/usb/uvc/uvcvideo.h +1 -0
@@ -75,6 +75,7 @@#define UVC_QUIRK_WAKE_AUTOSUSPEND 0x00002000#define UVC_QUIRK_NO_RESET_RESUME 0x00004000#define UVC_QUIRK_DISABLE_AUTOSUSPEND 0x00008000 +#define UVC_QUIRK_INVALID_DEVICE_SOF 0x00010000/* Format flags */ #define UVC_FMT_FLAG_COMPRESSED 0x00000001
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 313/809 media: uvcvideo: Add quirk for invalid dev_sof in Logitech C920
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleksandr Natalenko <[email protected]>
[ Upstream commit 85fbe91a7c9210bb30638846b551fa5d3cb7bc4c ]
Similarly to Logitech C922, C920 seems to also suffer from a firmware bug that breaks hardware timestamping.
Add a quirk for this camera model too.
Before applying the quirk:
``` 100 (4) [-] none 100 200717 B 212.919114 213.079004 33.727 fps ts mono/SoE 101 (5) [-] none 101 200889 B 213.003703 213.114996 11.822 fps ts mono/SoE 102 (6) [-] none 102 200926 B 213.035571 213.146999 31.379 fps ts mono/SoE 103 (7) [-] none 103 200839 B 213.067424 213.179003 31.394 fps ts mono/SoE 104 (0) [-] none 104 200692 B 213.293180 213.214991 4.430 fps ts mono/SoE 105 (1) [-] none 105 200937 B 213.322374 213.247001 34.254 fps ts mono/SoE 106 (2) [-] none 106 201013 B 213.352228 213.279005 33.496 fps ts mono/SoE … ```
After applying the quirk:
``` 154 (2) [-] none 154 192417 B 42.199823 42.207788 27.779 fps ts mono/SoE 155 (3) [-] none 155 192040 B 42.231834 42.239791 31.239 fps ts mono/SoE 156 (4) [-] none 156 192213 B 42.263823 42.271822 31.261 fps ts mono/SoE 157 (5) [-] none 157 191981 B 42.299824 42.303827 27.777 fps ts mono/SoE 158 (6) [-] none 158 191953 B 42.331835 42.339811 31.239 fps ts mono/SoE 159 (7) [-] none 159 191904 B 42.363824 42.371813 31.261 fps ts mono/SoE 160 (0) [-] none 160 192210 B 42.399834 42.407801 27.770 fps ts mono/SoE ```
--- drivers/media/usb/uvc/uvc_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/usb/uvc/uvc_driver.c +2 -1
@@ -2580,7 +2580,8 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceClass = USB_CLASS_VIDEO, .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, - .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) }, + .driver_info =UVC_INFO_QUIRK (UVC_QUIRK_RESTORE_CTRLS_ON_INIT + | UVC_QUIRK_INVALID_DEVICE_SOF) }, /* Logitech HD Pro Webcam C922 */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 314/809 media: uvcvideo: Override default flags
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Schaefer <[email protected]>
[ Upstream commit 86419686e66da5b90a07fb8a40ab138fe97189b5 ]
When the UVC device has a control that is readonly it doesn't set the SET_CUR flag. For example the privacy control has SET_CUR flag set in the defaults in the uvc_ctrls variable. Even if the device does not have it set, it's not cleared by uvc_ctrl_get_flags().
Originally written with assignment in commit 859086ae3636 ("media:
uvcvideo: Apply flags from device to actual properties"). But changed to |= in commit 0dc68cabdb62 ("media: uvcvideo: Prevent setting unavailable flags"). It would not clear the default flags.
With this patch applied the correct flags are reported to user space. Tested with:
``` > v4l2-ctl --list-ctrls | grep privacy privacy 0x009a0910 (bool) : default=0 value=0 flags=read-only ```
--- drivers/media/usb/uvc/uvc_ctrl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/media/usb/uvc/uvc_ctrl.c +8 -1
@@ -2031,7 +2031,13 @@ static int uvc_ctrl_get_flags(struct uvc_device *dev,else ret =uvc_query_ctrl (dev,UVC_GET_INFO , ctrl->entity->id, dev->intfnum, info->selector, data,1 ); -if (!ret) + +if (!ret) { + info->flags &= ~(UVC_CTRL_FLAG_GET_CUR | +UVC_CTRL_FLAG_SET_CUR | +UVC_CTRL_FLAG_AUTO_UPDATE | +UVC_CTRL_FLAG_ASYNCHRONOUS ); + info->flags |= (data[0 ] &UVC_CONTROL_CAP_GET ?UVC_CTRL_FLAG_GET_CUR :0 ) | (data[0] & UVC_CONTROL_CAP_SET ?
@@ -2040,6 +2046,7 @@ static int uvc_ctrl_get_flags(struct uvc_device *dev, UVC_CTRL_FLAG_AUTO_UPDATE : 0) | (data[0 ] &UVC_CONTROL_CAP_ASYNCHRONOUS ?UVC_CTRL_FLAG_ASYNCHRONOUS :0 ); + }kfree (data);return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 315/809 drm: zynqmp_dpsub: Fix an error handling path in zynqmp_dpsub_probe()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 4ea3deda1341fef7b923ad9cfe5dd46b1b51bfa8 ]
If zynqmp_dpsub_drm_init() fails, we must undo the previous drm_bridge_add() call.
--- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/xlnx/zynqmp_dpsub.c +1 -0
@@ -269,6 +269,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)return 0 ; err_disp: +drm_bridge_remove (dpsub->bridge);zynqmp_disp_remove (dpsub); err_dp:zynqmp_dp_remove (dpsub);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 316/809 drm: zynqmp_kms: Fix AUX bus not getting unregistered
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Anderson <[email protected]>
[ Upstream commit 0743dafefd3f2b92116213f2225ea355001b7948 ]
drm_encoder_cleanup is responsible for calling drm_bridge_detach for each bridge attached to the encoder. zynqmp_dp_bridge_detach is in turn responsible for unregistering the AUX bus. However, we never ended up calling drm_encoder_cleanup in the remove or error paths, so the AUX bus would stick around after the rest of the driver had been removed.
I don't really understand why drm_mode_config_cleanup doesn't call drm_encoder_cleanup for us. It will call destroy (which for simple_encoder is drm_encoder_cleanup) on encoders in the mode_config's encoder_list.
Should drm_encoder_cleanup get called before or after drm_atomic_helper_shutdown?
--- drivers/gpu/drm/xlnx/zynqmp_kms.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/xlnx/zynqmp_kms.c +9 -3
@@ -433,23 +433,28 @@ static int zynqmp_dpsub_kms_init(struct zynqmp_dpsub *dpsub) DRM_BRIDGE_ATTACH_NO_CONNECTOR);if (ret) {dev_err (dpsub->dev,"failed to attach bridge to encoder\n" ); -return ret; + goto err_encoder; }/* Create the connector for the chain of bridges. */ connector =drm_bridge_connector_init (&dpsub->drm->dev, encoder);if (IS_ERR (connector)) {dev_err (dpsub->dev,"failed to created connector\n" ); -return PTR_ERR (connector); + ret =PTR_ERR (connector); + goto err_encoder; } ret =drm_connector_attach_encoder (connector, encoder);if (ret <0 ) {dev_err (dpsub->dev,"failed to attach connector to encoder\n" ); -return ret; + goto err_encoder; }return 0 ; + +err_encoder: +drm_encoder_cleanup (encoder); +return ret; }static void zynqmp_dpsub_drm_release (struct drm_device *drm,void *res)
@@ -529,5 +534,6 @@ void zynqmp_dpsub_drm_cleanup(struct zynqmp_dpsub *dpsub)drm_dev_unregister (drm);drm_atomic_helper_shutdown (drm); +drm_encoder_cleanup (&dpsub->drm->encoder);drm_kms_helper_poll_fini (drm); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 317/809 drm/i915/psr: Set SU area width as pipe src width
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <[email protected]>
[ Upstream commit 97db7348640ececd60a0bfd85b6c0a3a0f81459a ]
Currently SU area width is set as MAX_INT. This is causing problems. Instead set it as pipe src width.
--- drivers/gpu/drm/i915/display/intel_psr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_psr.c +1 -1
@@ -2484,7 +2484,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state, crtc_state->psr2_su_area.x1 =0 ; crtc_state->psr2_su_area.y1 =-1 ; - crtc_state->psr2_su_area.x2 =INT_MAX ; + crtc_state->psr2_su_area.x2 =drm_rect_width (&crtc_state->pipe_src); crtc_state->psr2_su_area.y2 =-1 ;/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 318/809 media: rcar-vin: Fix YUYV8_1X16 handling for CSI-2
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacopo Mondi <[email protected]>
[ Upstream commit 9caf253e8ad6f4c66f5591bac900f9f68b6b6620 ]
The YUYV8_1X16 and UYVY8_1X16 formats are treated as 'ITU-R BT.601/BT.1358 16-bit YCbCr-422 input' (YUV16 - 0x5) in the R-Car VIN driver and are thus disallowed when capturing frames from the R-Car CSI-2 interface according to the hardware manual.
As the 1X16 format variants are meant to be used with serial busses they have to be treated as 'YCbCr-422 8-bit data input' (0x1) when capturing from CSI-2, which is a valid setting for CSI-2.
Commit 78b3f9d75a62 ("media: rcar-vin: Add check that input interface and format are valid") disallowed capturing YUV16 when using the CSI-2 interface. Fix this by using YUV8_BT601 for YCbCr422 when CSI-2 is in use.
--- .../media/platform/renesas/rcar-vin/rcar-dma.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/media/platform/renesas/rcar-vin/rcar-dma.c +13 -3
@@ -742,12 +742,22 @@ static int rvin_setup(struct rvin_dev *vin)*/ switch (vin->mbus_code) {case MEDIA_BUS_FMT_YUYV8_1X16 : -/* BT.601/BT.1358 16bit YCbCr422 */ - vnmc |=VNMC_INF_YUV16 ; +if (vin->is_csi) +/* YCbCr422 8-bit */ + vnmc |=VNMC_INF_YUV8_BT601 ; +else +/* BT.601/BT.1358 16bit YCbCr422 */ + vnmc |=VNMC_INF_YUV16 ; input_is_yuv = true;break ;case MEDIA_BUS_FMT_UYVY8_1X16 : - vnmc |=VNMC_INF_YUV16 |VNMC_YCAL ; +if (vin->is_csi) +/* YCbCr422 8-bit */ + vnmc |=VNMC_INF_YUV8_BT601 ; +else +/* BT.601/BT.1358 16bit YCbCr422 */ + vnmc |=VNMC_INF_YUV16 ; + vnmc |=VNMC_YCAL ; input_is_yuv = true;break ;case MEDIA_BUS_FMT_UYVY8_2X8 :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 319/809 media: rcar-csi2: Disable runtime_pm in probe error
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacopo Mondi <[email protected]>
[ Upstream commit e306183628f7c2e95f9bf853d8fcb86288f606de ]
Disable pm_runtime in the probe() function error path.
--- drivers/media/platform/renesas/rcar-csi2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/renesas/rcar-csi2.c +3 -1
@@ -1914,12 +1914,14 @@ static int rcsi2_probe(struct platform_device *pdev) ret =v4l2_async_register_subdev (&priv->subdev);if (ret <0 ) - goto error_async; + goto error_pm_runtime;dev_info (priv->dev,"%d lanes found\n" , priv->lanes);return 0 ; +error_pm_runtime: +pm_runtime_disable (&pdev->dev); error_async:v4l2_async_nf_unregister (&priv->notifier);v4l2_async_nf_cleanup (&priv->notifier);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 320/809 media: rcar-csi2: Cleanup subdevice in remove()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacopo Mondi <[email protected]>
[ Upstream commit f6d64d0d2897ed4e85ac00afe43e45c8b8fc0c44 ]
Cleanup the V4L2 subdevice in the driver's remove function to ensure its async connection are freed, and guarantee in future that the subdev active state is cleaned up.
--- drivers/media/platform/renesas/rcar-csi2.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/renesas/rcar-csi2.c +1 -0
@@ -1938,6 +1938,7 @@ static void rcsi2_remove(struct platform_device *pdev)v4l2_async_nf_unregister (&priv->notifier);v4l2_async_nf_cleanup (&priv->notifier);v4l2_async_unregister_subdev (&priv->subdev); +v4l2_subdev_cleanup (&priv->subdev);pm_runtime_disable (&pdev->dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 321/809 media: renesas: vsp1: Fix _irqsave and _irq mix
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit 57edbbcf5258c378a9b9d0c80d33b03a010b22c8 ]
The histogram support mixes _irqsave and _irq, causing the following smatch warning:
drivers/media/platform/renesas/vsp1/vsp1_histo.c:153 histo_stop_streaming()
warn: mixing irqsave and irq
The histo_stop_streaming() calls spin_lock_irqsave() followed by wait_event_lock_irq(). The former hints that interrupts may be disabled by the caller, while the latter reenables interrupts unconditionally. This doesn't cause any real bug, as the function is always called with interrupts enabled, but the pattern is still incorrect.
Fix the problem by using spin_lock_irq() instead of spin_lock_irqsave() in histo_stop_streaming(). While at it, switch to spin_lock_irq() and spin_lock() as appropriate elsewhere.
--- .../media/platform/renesas/vsp1/vsp1_histo.c | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/media/platform/renesas/vsp1/vsp1_histo.c +8 -12
@@ -36,9 +36,8 @@ struct vsp1_histogram_buffer * vsp1_histogram_buffer_get(struct vsp1_histogram *histo) {struct vsp1_histogram_buffer *buf =NULL ; -unsigned long flags; -spin_lock_irqsave (&histo->irqlock, flags); +spin_lock (&histo->irqlock);if (list_empty (&histo->irqqueue)) goto done;
@@ -49,7 +48,7 @@ vsp1_histogram_buffer_get(struct vsp1_histogram *histo) histo->readout = true; done: -spin_unlock_irqrestore (&histo->irqlock, flags); +spin_unlock (&histo->irqlock);return buf; }
@@ -58,7 +57,6 @@ void vsp1_histogram_buffer_complete(struct vsp1_histogram *histo, size_t size) {struct vsp1_pipeline *pipe = histo->entity.pipe; -unsigned long flags;/* * The pipeline pointer is guaranteed to be valid as this function is
@@ -70,10 +68,10 @@ void vsp1_histogram_buffer_complete(struct vsp1_histogram *histo,vb2_set_plane_payload (&buf->buf.vb2_buf,0 , size);vb2_buffer_done (&buf->buf.vb2_buf,VB2_BUF_STATE_DONE ); -spin_lock_irqsave (&histo->irqlock, flags); +spin_lock (&histo->irqlock); histo->readout = false;wake_up (&histo->wait_queue); -spin_unlock_irqrestore (&histo->irqlock, flags); +spin_unlock (&histo->irqlock); }/* -----------------------------------------------------------------------------
@@ -124,11 +122,10 @@ static void histo_buffer_queue(struct vb2_buffer *vb)struct vb2_v4l2_buffer *vbuf =to_vb2_v4l2_buffer (vb);struct vsp1_histogram *histo =vb2_get_drv_priv (vb->vb2_queue);struct vsp1_histogram_buffer *buf =to_vsp1_histogram_buffer (vbuf); -unsigned long flags; -spin_lock_irqsave (&histo->irqlock, flags); +spin_lock_irq (&histo->irqlock);list_add_tail (&buf->queue, &histo->irqqueue); -spin_unlock_irqrestore (&histo->irqlock, flags); +spin_unlock_irq (&histo->irqlock); }static int histo_start_streaming (struct vb2_queue *vq,unsigned int count)
@@ -140,9 +137,8 @@ static void histo_stop_streaming(struct vb2_queue *vq) {struct vsp1_histogram *histo =vb2_get_drv_priv (vq);struct vsp1_histogram_buffer *buffer; -unsigned long flags; -spin_lock_irqsave (&histo->irqlock, flags); +spin_lock_irq (&histo->irqlock);/* Remove all buffers from the IRQ queue. */ list_for_each_entry (buffer, &histo->irqqueue, queue)
@@ -152,7 +148,7 @@ static void histo_stop_streaming(struct vb2_queue *vq)/* Wait for the buffer being read out (if any) to complete. */ wait_event_lock_irq (histo->wait_queue, !histo->readout, histo->irqlock); -spin_unlock_irqrestore (&histo->irqlock, flags); +spin_unlock_irq (&histo->irqlock); }static const struct vb2_ops histo_video_queue_qops = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 322/809 media: renesas: vsp1: Store RPF partition configuration per RPF instance
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit a213bc09b1025c771ee722ee341af1d84375db8a ]
The vsp1_partition structure stores the RPF partition configuration in a single field for all RPF instances, while each RPF can have its own configuration. Fix it by storing the configuration separately for each RPF instance.
--- drivers/media/platform/renesas/vsp1/vsp1_pipe.h | 2 +- drivers/media/platform/renesas/vsp1/vsp1_rpf.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/media/platform/renesas/vsp1/vsp1_pipe.h +1 -1
@@ -73,7 +73,7 @@ struct vsp1_partition_window {* @wpf: The WPF partition window configuration */ struct vsp1_partition { -struct vsp1_partition_window rpf; +struct vsp1_partition_window rpf[VSP1_MAX_RPF ];struct vsp1_partition_window uds_sink;struct vsp1_partition_window uds_source;struct vsp1_partition_window sru;
drivers/media/platform/renesas/vsp1/vsp1_rpf.c +5 -3
@@ -315,8 +315,8 @@ static void rpf_configure_partition(struct vsp1_entity *entity,* 'width' need to be adjusted. */ if (pipe->partitions >1 ) { - crop.width = pipe->partition->rpf.width; - crop.left += pipe->partition->rpf.left; + crop.width = pipe->partition->rpf[rpf->entity.index].width; + crop.left += pipe->partition->rpf[rpf->entity.index].left; }if (pipe->interlaced) {
@@ -371,7 +371,9 @@ static void rpf_partition(struct vsp1_entity *entity,unsigned int partition_idx, struct vsp1_partition_window *window) { - partition->rpf = *window; + struct vsp1_rwpf *rpf = to_rwpf(&entity->subdev); + + partition->rpf[rpf->entity.index] = *window; } static const struct vsp1_entity_operations rpf_entity_ops = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 323/809 drm/ttm/tests: Let ttm_bo_test consider different ww_mutex implementation.
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit f85376c890ef470b64a7fea22eea5af18822f05c ]
PREEMPT_RT has a different locking implementation for ww_mutex. The base mutex of struct ww_mutex is declared as struct WW_MUTEX_BASE. The latter is defined as mutex' for non-PREEMPT_RT builds and rt_mutex' for PREEMPT_RT builds.
Using mutex_lock() directly on the base mutex in ttm_bo_reserve_deadlock() leads to compile error on PREEMPT_RT.
The locking-selftest has its own defines to deal with this and it is probably best to defines the needed one within the test program since their usefulness is limited outside of well known selftests.
Provide ww_mutex_base_lock() which points to the correct function for PREEMPT_RT and non-PREEMPT_RT builds.
--- drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/tests/ttm_bo_test.c +7 -1
@@ -18,6 +18,12 @@#define BO_SIZE SZ_8K +#ifdef CONFIG_PREEMPT_RT +#define ww_mutex_base_lock (b) rt_mutex_lock(b) +#else +#define ww_mutex_base_lock (b) mutex_lock(b) +#endif +struct ttm_bo_test_case {const char *description;bool interruptible;
@@ -142,7 +148,7 @@ static void ttm_bo_reserve_deadlock(struct kunit *test) bo2 =ttm_bo_kunit_init (test, test->priv,BO_SIZE );ww_acquire_init (&ctx1, &reservation_ww_class); -mutex_lock (&bo2->base.resv->lock.base); +ww_mutex_base_lock (&bo2->base.resv->lock.base);/* The deadlock will be caught by WW mutex, don't warn about it */ lock_release (&bo2->base.resv->lock.base.dep_map,1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 324/809 drm/mediatek: Add missing plane settings when async update
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 86b89dc669c400576dc23aa923bcf302f99e8e3a ]
Fix an issue that plane coordinate was not saved when calling async update.
--- drivers/gpu/drm/mediatek/mtk_plane.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/mediatek/mtk_plane.c +2 -0
@@ -227,6 +227,8 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane, plane->state->src_y = new_state->src_y; plane->state->src_h = new_state->src_h; plane->state->src_w = new_state->src_w; + plane->state->dst.x1 = new_state->dst.x1; + plane->state->dst.y1 = new_state->dst.y1;mtk_plane_update_new_state (new_state, new_plane_state);swap (plane->state->fb, new_state->fb);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 325/809 drm/mediatek: Use 8-bit alpha in ETHDR
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 231c020141cb150a59f5b28379cad82ff7bad899 ]
9-bit alpha (max=0x100) is designed for special HDR related calculation, which should be disabled by default. Change the alpha value from 0x100 to 0xff in 8-bit form.
--- drivers/gpu/drm/mediatek/mtk_ethdr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/mediatek/mtk_ethdr.c +1 -2
@@ -50,7 +50,6 @@#define MIXER_INX_MODE_BYPASS 0#define MIXER_INX_MODE_EVEN_EXTEND 1 -#define DEFAULT_9BIT_ALPHA 0x100#define MIXER_ALPHA_AEN BIT(8)#define MIXER_ALPHA 0xff#define ETHDR_CLK_NUM 13
@@ -169,7 +168,7 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx, alpha_con =MIXER_ALPHA_AEN |MIXER_ALPHA ;mtk_mmsys_mixer_in_config (priv->mmsys_dev, idx +1 , alpha_con ? false : true, -DEFAULT_9BIT_ALPHA , +MIXER_ALPHA , pending->x &1 ?MIXER_INX_MODE_EVEN_EXTEND :MIXER_INX_MODE_BYPASS , align_width /2 -1 , cmdq_pkt);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 326/809 drm/mediatek: Fix XRGB setting error in OVL
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 765f284f1fe172573021056f7e337ee53f252969 ]
CONST_BLD must be enabled for XRGB formats although the alpha channel can be ignored, or OVL will still read the value from memory. This error only affects CRC generation.
--- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +12 -2
@@ -38,6 +38,7 @@#define DISP_REG_OVL_PITCH_MSB (n) (0x0040 + 0x20 * (n))#define OVL_PITCH_MSB_2ND_SUBBUF BIT(16)#define DISP_REG_OVL_PITCH (n) (0x0044 + 0x20 * (n)) +#define OVL_CONST_BLEND BIT(28)#define DISP_REG_OVL_RDMA_CTRL (n) (0x00c0 + 0x20 * (n))#define DISP_REG_OVL_RDMA_GMC (n) (0x00c8 + 0x20 * (n))#define DISP_REG_OVL_ADDR_MT2701 0x0040
@@ -407,6 +408,7 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,unsigned int fmt = pending->format;unsigned int offset = (pending->y <<16 ) | pending->x;unsigned int src_size = (pending->height <<16 ) | pending->width; +unsigned int ignore_pixel_alpha =0 ;unsigned int con;bool is_afbc = pending->modifier !=DRM_FORMAT_MOD_LINEAR ;union overlay_pitch {
@@ -428,6 +430,14 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,if (state->base.fb && state->base.fb->format->has_alpha) con |=OVL_CON_AEN |OVL_CON_ALPHA ; +/* CONST_BLD must be enabled for XRGB formats although the alpha channel +* can be ignored, or OVL will still read the value from memory. +* For RGB888 related formats, whether CONST_BLD is enabled or not won't +* affect the result. Therefore we use !has_alpha as the condition. +*/ +if (state->base.fb && !state->base.fb->format->has_alpha) + ignore_pixel_alpha =OVL_CONST_BLEND ; +if (pending->rotation &DRM_MODE_REFLECT_Y ) { con |=OVL_CON_VIRT_FLIP ; addr += (pending->height -1 ) * pending->pitch;
@@ -443,8 +453,8 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,mtk_ddp_write_relaxed (cmdq_pkt, con, &ovl->cmdq_reg, ovl->regs,DISP_REG_OVL_CON (idx)); -mtk_ddp_write_relaxed (cmdq_pkt, overlay_pitch.split_pitch.lsb, &ovl->cmdq_reg, ovl->regs, -DISP_REG_OVL_PITCH (idx)); +mtk_ddp_write_relaxed (cmdq_pkt, overlay_pitch.split_pitch.lsb | ignore_pixel_alpha, + &ovl->cmdq_reg, ovl->regs,DISP_REG_OVL_PITCH (idx));mtk_ddp_write_relaxed (cmdq_pkt, src_size, &ovl->cmdq_reg, ovl->regs,DISP_REG_OVL_SRC_SIZE (idx)); mtk_ddp_write_relaxed(cmdq_pkt, offset, &ovl->cmdq_reg, ovl->regs,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 327/809 drm/mediatek: Fix XRGB setting error in Mixer
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 8e418bee401b7cfd0bc40d187afea2c6b08b44ec ]
Although the alpha channel in XRGB formats can be ignored, ALPHA_CON must be configured accordingly when using XRGB formats or it will still affects CRC generation.
--- drivers/gpu/drm/mediatek/mtk_ethdr.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_ethdr.c +10 -1
@@ -153,6 +153,7 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,unsigned int offset = (pending->x &1 ) <<31 | pending->y <<16 | pending->x;unsigned int align_width =ALIGN_DOWN (pending->width,2 );unsigned int alpha_con =0 ; +bool replace_src_a = false;dev_dbg (dev,"%s+ idx:%d" , __func__, idx);
@@ -167,7 +168,15 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,if (state->base.fb && state->base.fb->format->has_alpha) alpha_con =MIXER_ALPHA_AEN |MIXER_ALPHA ; -mtk_mmsys_mixer_in_config (priv->mmsys_dev, idx +1 , alpha_con ? false : true, +if (state->base.fb && !state->base.fb->format->has_alpha) { +/* +* Mixer doesn't support CONST_BLD mode, +* use a trick to make the output equivalent +*/ + replace_src_a = true; + } + +mtk_mmsys_mixer_in_config (priv->mmsys_dev, idx +1 , replace_src_a,MIXER_ALPHA , pending->x &1 ?MIXER_INX_MODE_EVEN_EXTEND :MIXER_INX_MODE_BYPASS , align_width /2 -1 , cmdq_pkt);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 328/809 drm/mediatek: Fix destination alpha error in OVL
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 31c0fbf67c8c0bb38d7fb21d404ea3dbd619d99e ]
The formula of Coverage alpha blending is:
dst.a = dst.a * (0xff - src.a * SCA / 0xff) / 0xff
+ src.a * SCA / 0xff
dst.a: destination alpha
src.a: pixel alpha
SCA : plane alpha
When SCA = 0xff, the formula becomes:
dst.a = dst.a * (0xff - src.a) + src.a
This patch is to set the destination alpha (background) to 0xff:
- When dst.a = 0 (before), dst.a = src.a
- When dst.a = 0xff (after) , dst.a = 0xff * (0xff - src.a) + src.a
According to the fomula above:
- When src.a = 0 , dst.a = 0
- When src.a = 0xff, dst.a = 0xff
This two cases are just still correct. But when src.a is between 0 and 0xff, the difference starts to appear
--- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +9 -1
@@ -72,6 +72,8 @@#define OVL_CON_VIRT_FLIP BIT(9)#define OVL_CON_HORZ_FLIP BIT(10) +#define OVL_COLOR_ALPHA GENMASK(31, 24) +static const u32 mt8173_formats[] = {DRM_FORMAT_XRGB8888 ,DRM_FORMAT_ARGB8888 ,
@@ -274,7 +276,13 @@ void mtk_ovl_config(struct device *dev, unsigned int w,if (w !=0 && h !=0 )mtk_ddp_write_relaxed (cmdq_pkt, h <<16 | w, &ovl->cmdq_reg, ovl->regs,DISP_REG_OVL_ROI_SIZE ); -mtk_ddp_write_relaxed (cmdq_pkt,0x0 , &ovl->cmdq_reg, ovl->regs,DISP_REG_OVL_ROI_BGCLR ); + +/* +* The background color must be opaque black (ARGB), +* otherwise the alpha blending will have no effect +*/ +mtk_ddp_write_relaxed (cmdq_pkt,OVL_COLOR_ALPHA , &ovl->cmdq_reg, + ovl->regs,DISP_REG_OVL_ROI_BGCLR );mtk_ddp_write (cmdq_pkt,0x1 , &ovl->cmdq_reg, ovl->regs,DISP_REG_OVL_RST );mtk_ddp_write (cmdq_pkt,0x0 , &ovl->cmdq_reg, ovl->regs,DISP_REG_OVL_RST );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 329/809 drm/mediatek: Turn off the layers with zero width or height
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 6b9946f4550d8dad8bc1af2db97286ca449af786 ]
We found that IGT (Intel GPU Tool) will try to commit layers with zero width or height and lead to undefined behaviors in hardware. Disable the layers in such a situation.
--- drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 2 +- drivers/gpu/drm/mediatek/mtk_ethdr.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c +1 -1
@@ -158,7 +158,7 @@ void mtk_ovl_adaptor_layer_config(struct device *dev, unsigned int idx, merge = ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_MERGE0 + idx]; ethdr = ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0 ]; -if (!pending->enable) { +if (!pending->enable || !pending->width || !pending->height) {mtk_merge_stop_cmdq (merge, cmdq_pkt);mtk_mdp_rdma_stop (rdma_l, cmdq_pkt);mtk_mdp_rdma_stop (rdma_r, cmdq_pkt);
drivers/gpu/drm/mediatek/mtk_ethdr.c +6 -1
@@ -160,7 +160,12 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,if (idx >=4 )return ; -if (!pending->enable) { +if (!pending->enable || !pending->width || !pending->height) { +/* +* instead of disabling layer with MIX_SRC_CON directly +* set the size to 0 to avoid screen shift due to mixer +* mode switch (hardware behavior) +*/ mtk_ddp_write (cmdq_pkt,0 , &mixer->cmdq_base, mixer->regs,MIX_L_SRC_SIZE (idx));return ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 330/809 drm/mediatek: Add OVL compatible name for MT8195
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 6fb7a0985fd16868b5d72eb3e3de7524a6000e6e ]
Add OVL compatible name for MT8195.
Without this commit, DRM won't work after modifying the device tree.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +2 -0
@@ -743,6 +743,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = { .data = (void *)MTK_DISP_OVL }, { .compatible = "mediatek,mt8192-disp-ovl", .data = (void *)MTK_DISP_OVL }, + { .compatible = "mediatek,mt8195-disp-ovl", + .data = (void *)MTK_DISP_OVL }, { .compatible = "mediatek,mt8183-disp-ovl-2l", .data = (void *)MTK_DISP_OVL_2L }, { .compatible = "mediatek,mt8192-disp-ovl-2l",
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 331/809 drm/mediatek: Add DRM_MODE_ROTATE_0 to rotation property
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 74608d8feefd1675388f23362aac8df4ac3af931 ]
Always add DRM_MODE_ROTATE_0 to rotation property to meet IGT's (Intel GPU Tools) requirement.
--- drivers/gpu/drm/mediatek/mtk_ddp_comp.h | 6 +++++- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 17 +++++------------ drivers/gpu/drm/mediatek/mtk_plane.c | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-)
drivers/gpu/drm/mediatek/mtk_ddp_comp.h +5 -1
@@ -192,7 +192,11 @@ unsigned int mtk_ddp_comp_supported_rotations(struct mtk_ddp_comp *comp)if (comp->funcs && comp->funcs->supported_rotations)return comp->funcs->supported_rotations (comp->dev); -return 0 ; +/* +* In order to pass IGT tests, DRM_MODE_ROTATE_0 is required when +* rotation is not supported. +*/ +return DRM_MODE_ROTATE_0 ; }static inline unsigned int mtk_ddp_comp_layer_nr (struct mtk_ddp_comp *comp)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +5 -12
@@ -305,27 +305,20 @@ int mtk_ovl_layer_check(struct device *dev, unsigned int idx, struct mtk_plane_state *mtk_state) {struct drm_plane_state *state = &mtk_state->base; -unsigned int rotation =0 ; - rotation =drm_rotation_simplify (state->rotation, -DRM_MODE_ROTATE_0 | -DRM_MODE_REFLECT_X | -DRM_MODE_REFLECT_Y ); - rotation &= ~DRM_MODE_ROTATE_0 ; - -/* We can only do reflection, not rotation */ -if ((rotation &DRM_MODE_ROTATE_MASK ) !=0 ) +/* check if any unsupported rotation is set */ +if (state->rotation & ~mtk_ovl_supported_rotations (dev))return -EINVAL ;/* * TODO: Rotating/reflecting YUV buffers is not supported at this time. * Only RGB[AX] variants are supported. +* Since DRM_MODE_ROTATE_0 means "no rotation", we should not +* reject layers with this property. */ -if (state->fb->format->is_yuv && rotation !=0 ) +if (state->fb->format->is_yuv && (state->rotation & ~DRM_MODE_ROTATE_0 ))return -EINVAL ; - state->rotation = rotation; -return 0 ; }
drivers/gpu/drm/mediatek/mtk_plane.c +1 -1
@@ -338,7 +338,7 @@ int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,return err; } -if (supported_rotations & ~DRM_MODE_ROTATE_0 ) { +if (supported_rotations) { err =drm_plane_create_rotation_property (plane,DRM_MODE_ROTATE_0 , supported_rotations);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 332/809 drm/mediatek: Set DRM mode configs accordingly
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit a4c9410b31cac463599898edb5111ca9bc0810bd ]
Set DRM mode configs limitation according to the hardware capabilities and pass the IGT checks as below:
- The test "graphics.IgtKms.kms_plane" requires a frame buffer with width of 4512 pixels (> 4096).
- The test "graphics.IgtKms.kms_cursor_crc" checks if the cursor size is defined, and run the test with cursor size from 1x1 to 512x512.
Please notice that the test conditions may change as IGT is updated.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 22 ++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_drm_drv.h | 4 ++++ 2 files changed, 26 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +22 -0
@@ -294,6 +294,9 @@ static const struct mtk_mmsys_driver_data mt8188_vdosys0_driver_data = { .conn_routes = mt8188_mtk_ddp_main_routes, .num_conn_routes = ARRAY_SIZE(mt8188_mtk_ddp_main_routes), .mmsys_dev_num = 2, + .max_width = 8191, + .min_width = 1, + .min_height = 1, };static const struct mtk_mmsys_driver_data mt8192_mmsys_driver_data = {
@@ -308,6 +311,9 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys0_driver_data = { .main_path = mt8195_mtk_ddp_main, .main_len = ARRAY_SIZE(mt8195_mtk_ddp_main), .mmsys_dev_num = 2, + .max_width = 8191, + .min_width = 1, + .min_height = 1, };static const struct mtk_mmsys_driver_data mt8195_vdosys1_driver_data = {
@@ -315,6 +321,9 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys1_driver_data = { .ext_len = ARRAY_SIZE(mt8195_mtk_ddp_ext), .mmsys_id = 1, .mmsys_dev_num = 2, + .max_width = 8191, + .min_width = 2, /* 2-pixel align when ethdr is bypassed */ + .min_height = 1, };static const struct of_device_id mtk_drm_of_ids[] = {
@@ -493,6 +502,15 @@ static int mtk_drm_kms_init(struct drm_device *drm)for (j =0 ; j < private->data->mmsys_dev_num; j++) { priv_n = private->all_drm_private[j]; +if (priv_n->data->max_width) + drm->mode_config.max_width = priv_n->data->max_width; + +if (priv_n->data->min_width) + drm->mode_config.min_width = priv_n->data->min_width; + +if (priv_n->data->min_height) + drm->mode_config.min_height = priv_n->data->min_height; +if (i ==CRTC_MAIN && priv_n->data->main_len) { ret = mtk_crtc_create(drm, priv_n->data->main_path, priv_n->data->main_len, j,
@@ -520,6 +538,10 @@ static int mtk_drm_kms_init(struct drm_device *drm) } } +/* IGT will check if the cursor size is configured */ + drm->mode_config.cursor_width = drm->mode_config.max_width; + drm->mode_config.cursor_height = drm->mode_config.max_height; +/* Use OVL device for all DMA memory allocations */ crtc =drm_crtc_from_index (drm,0 );if (crtc)
drivers/gpu/drm/mediatek/mtk_drm_drv.h +4 -0
@@ -46,6 +46,10 @@ struct mtk_mmsys_driver_data {bool shadow_register;unsigned int mmsys_id;unsigned int mmsys_dev_num; + +u16 max_width; +u16 min_width; +u16 min_height; };struct mtk_drm_private {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 333/809 drm/msm/a6xx: use __unused__ to fix compiler warnings for gen7_* includes
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abhinav Kumar <[email protected]>
[ Upstream commit 71d9b458b2bfe79197194d914aa9bada46fb9e14 ]
GCC diagnostic pragma method throws below warnings in some of the versions
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:16:9: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
#pragma GCC diagnostic ignored "-Wunused-const-variable"
^
In file included from drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:18:0:
drivers/gpu/drm/msm/adreno/adreno_gen7_0_0_snapshot.h:924:19: warning:
'gen7_0_0_external_core_regs' defined but not used [-Wunused-variable]
static const u32 *gen7_0_0_external_core_regs[] = {
^
In file included from drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:19:0:
drivers/gpu/drm/msm/adreno/adreno_gen7_2_0_snapshot.h:748:19: warning:
'gen7_2_0_external_core_regs' defined but not used [-Wunused-variable]
static const u32 *gen7_2_0_external_core_regs[] = {
^
In file included from drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:20:0:
drivers/gpu/drm/msm/adreno/adreno_gen7_9_0_snapshot.h:1188:43: warning:
'gen7_9_0_sptp_clusters' defined but not used [-Wunused-variable]
static struct gen7_sptp_cluster_registers gen7_9_0_sptp_clusters[] = {
^drivers/gpu/drm/msm/adreno/adreno_gen7_9_0_snapshot.h:1438:19: warning:
'gen7_9_0_external_core_regs' defined but not used [-Wunused-variable]
static const u32 *gen7_9_0_external_core_regs[] = {
Remove GCC version dependency by using __unused__ for the unused gen7_* includes.
Changes in v2:
- Fix the warnings in the commit text
- Use __attribute((__unused__)) instead of local assignment
changes in v3:
- drop the Link from the auto add
changes in v4:
- replace __attribute((__unused__)) with __always_unused
Patchwork: https://patchwork.freedesktop.org/patch/597265/
--- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +5 -8
@@ -8,19 +8,16 @@#include "a6xx_gpu_state.h" #include "a6xx_gmu.xml.h" -/* Ignore diagnostics about register tables that we aren't using yet. We don't -* want to modify these headers too much from their original source. -*/ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic ignored "-Wunused-const-variable" +static const unsigned int *gen7_0_0_external_core_regs[]__always_unused ; +static const unsigned int *gen7_2_0_external_core_regs[]__always_unused ; +static const unsigned int *gen7_9_0_external_core_regs[]__always_unused ; +static struct gen7_sptp_cluster_registers gen7_9_0_sptp_clusters[]__always_unused ; +static const u32 gen7_9_0_cx_debugbus_blocks[]__always_unused ;#include "adreno_gen7_0_0_snapshot.h" #include "adreno_gen7_2_0_snapshot.h" #include "adreno_gen7_9_0_snapshot.h" -#pragma GCC diagnostic pop -struct a6xx_gpu_state_obj {const void *handle;u32 *data;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 334/809 drm/msm/a6xx: Fix A702 UBWC mode
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 593f1dd4c81f6932042508a80186dbdea90312a5 ]
UBWC_MODE is a one-bit-wide field, so a value of 2 is obviously bogus.
Replace it with the correct value (0).
Patchwork: https://patchwork.freedesktop.org/patch/597359/
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 -1
@@ -1409,7 +1409,7 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu)if (adreno_is_a702 (gpu)) { gpu->ubwc_config.highest_bank_bit =14 ; gpu->ubwc_config.min_acc_len =1 ; - gpu->ubwc_config.ubwc_mode =2 ; + gpu->ubwc_config.ubwc_mode =0 ; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 335/809 media: imx-jpeg: Drop initial source change event if capture has been setup
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Qian <[email protected]>
[ Upstream commit a8fb5fce7a441d37d106c82235e1f1b57f70f5b9 ]
In section 4.5.1.5. Initialization, the step 4 may be skipped and continue with the Capture Setup sequence, so if the capture has been setup, there is no need to trigger the initial source change event, just start decoding, and follow the dynamic resolution change flow if the configured values do not match those parsed by the decoder.
And it won't fail the gstreamer pipeline.
--- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +3 -0
@@ -1634,6 +1634,9 @@ static int mxc_jpeg_start_streaming(struct vb2_queue *q, unsigned int count)dev_dbg (ctx->mxc_jpeg->dev,"Start streaming ctx=%p" , ctx); q_data->sequence =0 ; +if (V4L2_TYPE_IS_CAPTURE (q->type)) + ctx->need_initial_source_change_evt = false; + ret =pm_runtime_resume_and_get (ctx->mxc_jpeg->dev);if (ret <0 ) {dev_err (ctx->mxc_jpeg->dev,"Failed to power up jpeg\n" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 336/809 leds: trigger: Unregister sysfs attributes before calling deactivate()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit c0dc9adf9474ecb7106e60e5472577375aedaed3 ]
Triggers which have trigger specific sysfs attributes typically store related data in trigger-data allocated by the activate() callback and freed by the deactivate() callback.
Calling device_remove_groups() after calling deactivate() leaves a window where the sysfs attributes show/store functions could be called after deactivation and then operate on the just freed trigger-data.
Move the device_remove_groups() call to before deactivate() to close this race window.
This also makes the deactivation path properly do things in reverse order of the activation path which calls the activate() callback before calling device_add_groups().
--- drivers/leds/led-triggers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/led-triggers.c +1 -1
@@ -179,9 +179,9 @@ int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)cancel_work_sync (&led_cdev->set_brightness_work);led_stop_software_blink (led_cdev); +device_remove_groups (led_cdev->dev, led_cdev->trigger->groups);if (led_cdev->trigger->deactivate) led_cdev->trigger->deactivate (led_cdev); -device_remove_groups (led_cdev->dev, led_cdev->trigger->groups); led_cdev->trigger =NULL ; led_cdev->trigger_data =NULL ; led_cdev->activated = false;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 337/809 drm/msm/dsi: set video mode widebus enable bit when widebus is enabled
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonathan Marek <[email protected]>
[ Upstream commit 007870b8eaf54739c7b417ddaf90bf364b7e4bc8 ]
The value returned by msm_dsi_wide_bus_enabled() doesn't match what the driver is doing in video mode. Fix that by actually enabling widebus for video mode.
Patchwork: https://patchwork.freedesktop.org/patch/596232/
--- drivers/gpu/drm/msm/dsi/dsi_host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +2 -1
@@ -754,6 +754,8 @@ static void dsi_ctrl_enable(struct msm_dsi_host *msm_host, data |=DSI_VID_CFG0_TRAFFIC_MODE (dsi_get_traffic_mode (flags)); data |=DSI_VID_CFG0_DST_FORMAT (dsi_get_vid_fmt (mipi_fmt)); data |=DSI_VID_CFG0_VIRT_CHANNEL (msm_host->channel); +if (msm_dsi_host_is_wide_bus_enabled (&msm_host->base)) + data |=DSI_VID_CFG0_DATABUS_WIDEN ;dsi_write (msm_host,REG_DSI_VID_CFG0 , data);/* Do not swap RGB colors */
@@ -778,7 +780,6 @@ static void dsi_ctrl_enable(struct msm_dsi_host *msm_host,if (cfg_hnd->minor >=MSM_DSI_6G_VER_MINOR_V1_3 ) data |=DSI_CMD_MODE_MDP_CTRL2_BURST_MODE ; -/* TODO: Allow for video-mode support once tested/fixed */ if (msm_dsi_host_is_wide_bus_enabled (&msm_host->base)) data |=DSI_CMD_MODE_MDP_CTRL2_DATABUS_WIDEN ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 338/809 drm/msm/dsi: set VIDEO_COMPRESSION_MODE_CTRL_WC
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonathan Marek <[email protected]>
[ Upstream commit 9ecd0ddd223b68b4603e4766a1d51f6c6cda346e ]
Video mode DSC won't work if this field is not set correctly. Set it to fix video mode DSC (for slice_per_pkt==1 cases at least).
Patchwork: https://patchwork.freedesktop.org/patch/596234/
--- drivers/gpu/drm/msm/dsi/dsi_host.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/msm/dsi/dsi_host.c +3 -0
@@ -857,6 +857,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_modu32 slice_per_intf, total_bytes_per_intf;u32 pkt_per_line;u32 eol_byte_num; +u32 bytes_per_pkt;/* first calculate dsc parameters and then program * compress mode registers
@@ -864,6 +865,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod slice_per_intf =msm_dsc_get_slices_per_intf (dsc, hdisplay); total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf; + bytes_per_pkt = dsc->slice_chunk_size;/* * slice_per_pkt; */ eol_byte_num = total_bytes_per_intf %3 ;
@@ -901,6 +903,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_moddsi_write (msm_host,REG_DSI_COMMAND_COMPRESSION_MODE_CTRL , reg_ctrl);dsi_write (msm_host,REG_DSI_COMMAND_COMPRESSION_MODE_CTRL2 , reg_ctrl2); }else { + reg |=DSI_VIDEO_COMPRESSION_MODE_CTRL_WC (bytes_per_pkt);dsi_write (msm_host,REG_DSI_VIDEO_COMPRESSION_MODE_CTRL , reg); } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 339/809 drm/msm/dpu: drop validity checks for clear_pending_flush() ctl op
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abhinav Kumar <[email protected]>
[ Upstream commit 3d68e3dedd4b48f0358bdc187277e3315d8aa559 ]
clear_pending_flush() ctl op is always assigned irrespective of the DPU hardware revision. Hence there is no needed to check whether the op has been assigned before calling it.
Drop the checks across the driver for clear_pending_flush() and also update its documentation that it is always expected to be assigned.
changes in v2:
- instead of adding more validity checks just drop the one for clear_pending_flush
- update the documentation for clear_pending_flush() ctl op
- update the commit text reflecting these changes
changes in v3:
- simplify the documentation of clear_pending_flush
Patchwork: https://patchwork.freedesktop.org/patch/600241/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +1 -2
@@ -1743,8 +1743,7 @@ void dpu_encoder_trigger_kickoff_pending(struct drm_encoder *drm_enc) phys = dpu_enc->phys_encs[i]; ctl = phys->hw_ctl; -if (ctl->ops.clear_pending_flush) - ctl->ops.clear_pending_flush (ctl); + ctl->ops.clear_pending_flush (ctl);/* update only for command mode primary ctl */ if ((phys == dpu_enc->cur_master) &&
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +1 -2
@@ -538,8 +538,7 @@ static void dpu_encoder_phys_wb_disable(struct dpu_encoder_phys *phys_enc) }/* reset h/w before final flush */ -if (phys_enc->hw_ctl->ops.clear_pending_flush) - phys_enc->hw_ctl->ops.clear_pending_flush (phys_enc->hw_ctl); + phys_enc->hw_ctl->ops.clear_pending_flush (phys_enc->hw_ctl);/* * New CTL reset sequence from 5.0 MDP onwards.
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h +2 -1
@@ -83,7 +83,8 @@ struct dpu_hw_ctl_ops {/** * Clear the value of the cached pending_flush_mask -* No effect on hardware +* No effect on hardware. +* Required to be implemented. * @ctx : ctl path ctx pointer */ void (*clear_pending_flush)(struct dpu_hw_ctl *ctx);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 340/809 drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karolina Stolarek <[email protected]>
[ Upstream commit 588c4c8d58c413b52c68193bdb741cfbf1040a77 ]
BOs in a bulk move have to share the same reservation object. That is not the case in the ttm_bo_unreserve_bulk subtest. Update ttm_bo_kunit_init() helper to accept dma_resv object so we can define buffer objects that share the same resv. Update calls to that helper accordingly.
--- drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 40 +++++++++++-------- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 7 +++- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 3 +- drivers/gpu/drm/ttm/tests/ttm_pool_test.c | 4 +- drivers/gpu/drm/ttm/tests/ttm_resource_test.c | 2 +- drivers/gpu/drm/ttm/tests/ttm_tt_test.c | 20 +++++----- 6 files changed, 45 insertions(+), 31 deletions(-)
drivers/gpu/drm/ttm/tests/ttm_bo_test.c +24 -16
@@ -62,7 +62,7 @@ static void ttm_bo_reserve_optimistic_no_ticket(struct kunit *test)struct ttm_buffer_object *bo;int err; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_bo_reserve (bo, params->interruptible, params->no_wait,NULL );KUNIT_ASSERT_EQ (test, err,0 );
@@ -77,7 +77,7 @@ static void ttm_bo_reserve_locked_no_sleep(struct kunit *test)bool no_wait = true;int err; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL );/* Let's lock it beforehand */ dma_resv_lock (bo->base.resv,NULL );
@@ -98,7 +98,7 @@ static void ttm_bo_reserve_no_wait_ticket(struct kunit *test)ww_acquire_init (&ctx, &reservation_ww_class); - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_bo_reserve (bo, interruptible, no_wait, &ctx);KUNIT_ASSERT_EQ (test, err, -EBUSY );
@@ -116,7 +116,7 @@ static void ttm_bo_reserve_double_resv(struct kunit *test)ww_acquire_init (&ctx, &reservation_ww_class); - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_bo_reserve (bo, interruptible, no_wait, &ctx);KUNIT_ASSERT_EQ (test, err,0 );
@@ -144,8 +144,8 @@ static void ttm_bo_reserve_deadlock(struct kunit *test)bool no_wait = false;int err; - bo1 =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); - bo2 =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo1 =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); + bo2 =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL );ww_acquire_init (&ctx1, &reservation_ww_class);ww_mutex_base_lock (&bo2->base.resv->lock.base);
@@ -214,7 +214,7 @@ static void ttm_bo_reserve_interrupted(struct kunit *test)struct task_struct *task;int err; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); task =kthread_create (threaded_ttm_bo_reserve, bo,"ttm-bo-reserve" );
@@ -255,7 +255,7 @@ static void ttm_bo_unreserve_basic(struct kunit *test)KUNIT_ASSERT_EQ (test, err,0 ); priv->ttm_dev = ttm_dev; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); bo->priority = bo_prio; err =ttm_resource_alloc (bo, place, &res1);
@@ -294,7 +294,7 @@ static void ttm_bo_unreserve_pinned(struct kunit *test)KUNIT_ASSERT_EQ (test, err,0 ); priv->ttm_dev = ttm_dev; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); place =ttm_place_kunit_init (test, mem_type,0 );dma_resv_lock (bo->base.resv,NULL );
@@ -327,6 +327,7 @@ static void ttm_bo_unreserve_bulk(struct kunit *test)struct ttm_resource *res1, *res2;struct ttm_device *ttm_dev;struct ttm_place *place; +struct dma_resv *resv;uint32_t mem_type =TTM_PL_SYSTEM ;unsigned int bo_priority =0 ;int err;
@@ -338,12 +339,17 @@ static void ttm_bo_unreserve_bulk(struct kunit *test) ttm_dev =kunit_kzalloc (test,sizeof (*ttm_dev),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, ttm_dev); + resv =kunit_kzalloc (test,sizeof (*resv),GFP_KERNEL ); +KUNIT_ASSERT_NOT_NULL (test, ttm_dev); + err =ttm_device_kunit_init (priv, ttm_dev, false, false);KUNIT_ASSERT_EQ (test, err,0 ); priv->ttm_dev = ttm_dev; - bo1 =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); - bo2 =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); +dma_resv_init (resv); + + bo1 =ttm_bo_kunit_init (test, test->priv,BO_SIZE , resv); + bo2 =ttm_bo_kunit_init (test, test->priv,BO_SIZE , resv);dma_resv_lock (bo1->base.resv,NULL );ttm_bo_set_bulk_move (bo1, &lru_bulk_move);
@@ -369,6 +375,8 @@ static void ttm_bo_unreserve_bulk(struct kunit *test)ttm_resource_free (bo1, &res1);ttm_resource_free (bo2, &res2); + +dma_resv_fini (resv); }static void ttm_bo_put_basic (struct kunit *test)
@@ -390,7 +398,7 @@ static void ttm_bo_put_basic(struct kunit *test)KUNIT_ASSERT_EQ (test, err,0 ); priv->ttm_dev = ttm_dev; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); bo->type = ttm_bo_type_device; err =ttm_resource_alloc (bo, place, &res);
@@ -451,7 +459,7 @@ static void ttm_bo_put_shared_resv(struct kunit *test)dma_fence_signal (fence); - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); bo->type = ttm_bo_type_device; bo->base.resv = external_resv;
@@ -473,7 +481,7 @@ static void ttm_bo_pin_basic(struct kunit *test)KUNIT_ASSERT_EQ (test, err,0 ); priv->ttm_dev = ttm_dev; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL );for (int i =0 ; i < no_pins; i++) {dma_resv_lock (bo->base.resv,NULL );
@@ -508,7 +516,7 @@ static void ttm_bo_pin_unpin_resource(struct kunit *test)KUNIT_ASSERT_EQ (test, err,0 ); priv->ttm_dev = ttm_dev; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_resource_alloc (bo, place, &res);KUNIT_ASSERT_EQ (test, err,0 );
@@ -559,7 +567,7 @@ static void ttm_bo_multiple_pin_one_unpin(struct kunit *test)KUNIT_ASSERT_EQ (test, err,0 ); priv->ttm_dev = ttm_dev; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_resource_alloc (bo, place, &res);KUNIT_ASSERT_EQ (test, err,0 );
drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c +6 -1
@@ -51,7 +51,8 @@ EXPORT_SYMBOL_GPL(ttm_device_kunit_init);struct ttm_buffer_object *ttm_bo_kunit_init (struct kunit *test,struct ttm_test_devices *devs, -size_t size) +size_t size, +struct dma_resv *obj) {struct drm_gem_object gem_obj = { };struct ttm_buffer_object *bo;
@@ -61,6 +62,10 @@ struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test,KUNIT_ASSERT_NOT_NULL (test, bo); bo->base = gem_obj; + +if (obj) + bo->base.resv = obj; + err =drm_gem_object_init (devs->drm, &bo->base, size);KUNIT_ASSERT_EQ (test, err,0 );
drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h +2 -1
@@ -28,7 +28,8 @@ int ttm_device_kunit_init(struct ttm_test_devices *priv, bool use_dma32);struct ttm_buffer_object *ttm_bo_kunit_init (struct kunit *test,struct ttm_test_devices *devs, -size_t size); +size_t size, +struct dma_resv *obj);struct ttm_place *ttm_place_kunit_init (struct kunit *test,uint32_t mem_type,uint32_t flags);
drivers/gpu/drm/ttm/tests/ttm_pool_test.c +2 -2
@@ -57,7 +57,7 @@ static struct ttm_tt *ttm_tt_kunit_init(struct kunit *test,struct ttm_tt *tt;int err; - bo =ttm_bo_kunit_init (test, priv->devs, size); + bo =ttm_bo_kunit_init (test, priv->devs, size,NULL );KUNIT_ASSERT_NOT_NULL (test, bo); priv->mock_bo = bo;
@@ -209,7 +209,7 @@ static void ttm_pool_alloc_basic_dma_addr(struct kunit *test) tt =kunit_kzalloc (test,sizeof (*tt),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, tt); - bo =ttm_bo_kunit_init (test, devs, size); + bo =ttm_bo_kunit_init (test, devs, size,NULL );KUNIT_ASSERT_NOT_NULL (test, bo); err =ttm_sg_tt_init (tt, bo,0 , caching);
drivers/gpu/drm/ttm/tests/ttm_resource_test.c +1 -1
@@ -54,7 +54,7 @@ static void ttm_init_test_mocks(struct kunit *test,/* Make sure we have what we need for a good BO mock */ KUNIT_ASSERT_NOT_NULL (test, priv->devs->ttm_dev); - priv->bo =ttm_bo_kunit_init (test, priv->devs, size); + priv->bo =ttm_bo_kunit_init (test, priv->devs, size,NULL ); priv->place =ttm_place_kunit_init (test, mem_type, flags); }
drivers/gpu/drm/ttm/tests/ttm_tt_test.c +10 -10
@@ -63,7 +63,7 @@ static void ttm_tt_init_basic(struct kunit *test) tt =kunit_kzalloc (test,sizeof (*tt),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, tt); - bo =ttm_bo_kunit_init (test, test->priv, params->size); + bo =ttm_bo_kunit_init (test, test->priv, params->size,NULL ); err =ttm_tt_init (tt, bo, page_flags, caching, extra_pages);KUNIT_ASSERT_EQ (test, err,0 );
@@ -89,7 +89,7 @@ static void ttm_tt_init_misaligned(struct kunit *test) tt =kunit_kzalloc (test,sizeof (*tt),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, tt); - bo =ttm_bo_kunit_init (test, test->priv, size); + bo =ttm_bo_kunit_init (test, test->priv, size,NULL );/* Make the object size misaligned */ bo->base.size +=1 ;
@@ -110,7 +110,7 @@ static void ttm_tt_fini_basic(struct kunit *test) tt =kunit_kzalloc (test,sizeof (*tt),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, tt); - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_tt_init (tt, bo,0 , caching,0 );KUNIT_ASSERT_EQ (test, err,0 );
@@ -130,7 +130,7 @@ static void ttm_tt_fini_sg(struct kunit *test) tt =kunit_kzalloc (test,sizeof (*tt),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, tt); - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_sg_tt_init (tt, bo,0 , caching);KUNIT_ASSERT_EQ (test, err,0 );
@@ -151,7 +151,7 @@ static void ttm_tt_fini_shmem(struct kunit *test) tt =kunit_kzalloc (test,sizeof (*tt),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, tt); - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_tt_init (tt, bo,0 , caching,0 );KUNIT_ASSERT_EQ (test, err,0 );
@@ -168,7 +168,7 @@ static void ttm_tt_create_basic(struct kunit *test)struct ttm_buffer_object *bo;int err; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); bo->type = ttm_bo_type_device;dma_resv_lock (bo->base.resv,NULL );
@@ -187,7 +187,7 @@ static void ttm_tt_create_invalid_bo_type(struct kunit *test)struct ttm_buffer_object *bo;int err; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); bo->type = ttm_bo_type_sg +1 ;dma_resv_lock (bo->base.resv,NULL );
@@ -208,7 +208,7 @@ static void ttm_tt_create_ttm_exists(struct kunit *test) tt =kunit_kzalloc (test,sizeof (*tt),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, tt); - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL ); err =ttm_tt_init (tt, bo,0 , caching,0 );KUNIT_ASSERT_EQ (test, err,0 );
@@ -239,7 +239,7 @@ static void ttm_tt_create_failed(struct kunit *test)struct ttm_buffer_object *bo;int err; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL );/* Update ttm_device_funcs so we don't alloc ttm_tt */ devs->ttm_dev->funcs = &ttm_dev_empty_funcs;
@@ -257,7 +257,7 @@ static void ttm_tt_destroy_basic(struct kunit *test)struct ttm_buffer_object *bo;int err; - bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ); + bo =ttm_bo_kunit_init (test, test->priv,BO_SIZE ,NULL );dma_resv_lock (bo->base.resv,NULL ); err =ttm_tt_create (bo, false);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 341/809 drm/panic: only draw the foreground color in drm_panic_blit()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jocelyn Falempe <[email protected]>
[ Upstream commit eef5a55af31792fc7a2082dbebac68a7df4d7643 ]
The whole framebuffer is cleared, so it's useless to rewrite the background colored pixels. It allows to simplify the drawing functions, and prepare the work for the set_pixel() callback.
v2:
* keep fg16/fg24/fg32 as variable name for the blit function.
* add drm_panic_is_pixel_fg() to avoid code duplication. both suggested by Javier Martinez Canillas
Stable-dep-of: 94ff11d3bd32 ("drm/panic: Fix off-by-one logo size checks")
--- drivers/gpu/drm/drm_panic.c | 67 +++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 36 deletions(-)
drivers/gpu/drm/drm_panic.c +31 -36
@@ -194,40 +194,42 @@ static u32 convert_from_xrgb8888(u32 color, u32 format)/* * Blit & Fill */ +/* check if the pixel at coord x,y is 1 (foreground) or 0 (background) */ +static bool drm_panic_is_pixel_fg (const u8 *sbuf8,unsigned int spitch,int x,int y) +{ +return (sbuf8[(y * spitch) + x /8 ] & (0x80 >> (x %8 ))) !=0 ; +} +static void drm_panic_blit16 (struct iosys_map *dmap,unsigned int dpitch,const u8 *sbuf8,unsigned int spitch,unsigned int height,unsigned int width, -u16 fg16,u16 bg16) +u16 fg16) {unsigned int y, x; -u16 val16; -for (y =0 ; y < height; y++) { -for (x =0 ; x < width; x++) { - val16 = (sbuf8[(y * spitch) + x /8 ] & (0x80 >> (x %8 ))) ? fg16 : bg16; -iosys_map_wr (dmap, y * dpitch + x *sizeof (u16), u16, val16); - } - } +for (y =0 ; y < height; y++) +for (x =0 ; x < width; x++) +if (drm_panic_is_pixel_fg (sbuf8, spitch, x, y)) +iosys_map_wr (dmap, y * dpitch + x *sizeof (u16), u16, fg16); }static void drm_panic_blit24 (struct iosys_map *dmap,unsigned int dpitch,const u8 *sbuf8,unsigned int spitch,unsigned int height,unsigned int width, -u32 fg32,u32 bg32) +u32 fg32) {unsigned int y, x; -u32 val32;for (y =0 ; y < height; y++) {for (x =0 ; x < width; x++) {u32 off = y * dpitch + x *3 ; - val32 = (sbuf8[(y * spitch) + x /8 ] & (0x80 >> (x %8 ))) ? fg32 : bg32; - -/* write blue-green-red to output in little endianness */ -iosys_map_wr (dmap, off, u8, (val32 &0x000000FF ) >>0 ); -iosys_map_wr (dmap, off +1 , u8, (val32 &0x0000FF00 ) >>8 ); -iosys_map_wr (dmap, off +2 , u8, (val32 &0x00FF0000 ) >>16 ); +if (drm_panic_is_pixel_fg (sbuf8, spitch, x, y)) { +/* write blue-green-red to output in little endianness */ +iosys_map_wr (dmap, off, u8, (fg32 &0x000000FF ) >>0 ); +iosys_map_wr (dmap, off +1 , u8, (fg32 &0x0000FF00 ) >>8 ); +iosys_map_wr (dmap, off +2 , u8, (fg32 &0x00FF0000 ) >>16 ); + } } } }
@@ -235,17 +237,14 @@ static void drm_panic_blit24(struct iosys_map *dmap, unsigned int dpitch,static void drm_panic_blit32 (struct iosys_map *dmap,unsigned int dpitch,const u8 *sbuf8,unsigned int spitch,unsigned int height,unsigned int width, -u32 fg32,u32 bg32) +u32 fg32) {unsigned int y, x; -u32 val32; -for (y =0 ; y < height; y++) { -for (x =0 ; x < width; x++) { - val32 = (sbuf8[(y * spitch) + x /8 ] & (0x80 >> (x %8 ))) ? fg32 : bg32; -iosys_map_wr (dmap, y * dpitch + x *sizeof (u32), u32, val32); - } - } +for (y =0 ; y < height; y++) +for (x =0 ; x < width; x++) +if (drm_panic_is_pixel_fg (sbuf8, spitch, x, y)) +iosys_map_wr (dmap, y * dpitch + x *sizeof (u32), u32, fg32); }/*
@@ -257,7 +256,6 @@ static void drm_panic_blit32(struct iosys_map *dmap, unsigned int dpitch,* @height: height of the image to copy, in pixels * @width: width of the image to copy, in pixels * @fg_color: foreground color, in destination format -* @bg_color: background color, in destination format * @pixel_width: pixel width in bytes. * * This can be used to draw a font character, which is a monochrome image, to a
@@ -266,21 +264,20 @@ static void drm_panic_blit32(struct iosys_map *dmap, unsigned int dpitch,static void drm_panic_blit (struct iosys_map *dmap,unsigned int dpitch,const u8 *sbuf8,unsigned int spitch,unsigned int height,unsigned int width, -u32 fg_color,u32 bg_color, -unsigned int pixel_width) +u32 fg_color,unsigned int pixel_width) {switch (pixel_width) {case 2 :drm_panic_blit16 (dmap, dpitch, sbuf8, spitch, - height, width, fg_color, bg_color); + height, width, fg_color);break ;case 3 :drm_panic_blit24 (dmap, dpitch, sbuf8, spitch, - height, width, fg_color, bg_color); + height, width, fg_color);break ;case 4 :drm_panic_blit32 (dmap, dpitch, sbuf8, spitch, - height, width, fg_color, bg_color); + height, width, fg_color);break ;default :WARN_ONCE (1 ,"Can't blit with pixel width %d\n" , pixel_width);
@@ -381,8 +378,7 @@ static void draw_txt_rectangle(struct drm_scanout_buffer *sb,unsigned int msg_lines, bool centered, struct drm_rect *clip, - u32 fg_color, - u32 bg_color) + u32 color) { int i, j;const u8 *src;
@@ -404,8 +400,7 @@ static void draw_txt_rectangle(struct drm_scanout_buffer *sb,for (j =0 ; j < line_len; j++) { src =get_char_bitmap (font, msg[i].txt[j], font_pitch);drm_panic_blit (&dst, sb->pitch[0 ], src, font_pitch, - font->height, font->width, - fg_color, bg_color, px_width); + font->height, font->width, color, px_width);iosys_map_incr (&dst, font->width * px_width); } }
@@ -445,9 +440,9 @@ static void draw_panic_static(struct drm_scanout_buffer *sb)if ((r_msg.x1 >=drm_rect_width (&r_logo) || r_msg.y1 >=drm_rect_height (&r_logo)) &&drm_rect_width (&r_logo) < sb->width &&drm_rect_height (&r_logo) < sb->height) { -draw_txt_rectangle (sb, font, logo, logo_lines, false, &r_logo, fg_color, bg_color); +draw_txt_rectangle (sb, font, logo, logo_lines, false, &r_logo, fg_color); } -draw_txt_rectangle (sb, font, panic_msg, msg_lines, true, &r_msg, fg_color, bg_color); +draw_txt_rectangle (sb, font, panic_msg, msg_lines, true, &r_msg, fg_color); }/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 342/809 drm/panic: Fix off-by-one logo size checks
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 94ff11d3bd32506710ca43569d38420e7fc790c1 ]
Logos that are either just as wide or just as high as the display work fine.
--- drivers/gpu/drm/drm_panic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic.c +1 -1
@@ -439,7 +439,7 @@ static void draw_panic_static(struct drm_scanout_buffer *sb) bg_color, sb->format->cpp[0]);if ((r_msg.x1 >=drm_rect_width (&r_logo) || r_msg.y1 >=drm_rect_height (&r_logo)) && -drm_rect_width (&r_logo) < sb->width &&drm_rect_height (&r_logo) < sb->height) { +drm_rect_width (&r_logo) <= sb->width &&drm_rect_height (&r_logo) <= sb->height) {draw_txt_rectangle (sb, font, logo, logo_lines, false, &r_logo, fg_color); }draw_txt_rectangle (sb, font, panic_msg, msg_lines, true, &r_msg, fg_color);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 343/809 platform/arm64: build drivers even on non-ARM64 platforms
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 13bbe1c83bc401c2538c758228d27b4042b08341 ]
The Kconfig for platforms/arm64 has 'depends on ARM64 || COMPILE_TEST'. However due to Makefile having just obj-$(CONFIG_ARM64) the subdir will not be descended for !ARM64 platforms and thus the drivers won't get built. This breaks modular builds of other driver drivers which depend on arm64 platform drivers.
--- drivers/platform/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/Makefile +1 -1
@@ -11,4 +11,4 @@ obj-$(CONFIG_OLPC_EC) += olpc/ obj-$(CONFIG_GOLDFISH) += goldfish/ obj-$(CONFIG_CHROME_PLATFORMS) += chrome/ obj-$(CONFIG_SURFACE_PLATFORMS) += surface/ -obj-$(CONFIG_ARM64) += arm64/ +obj-$(CONFIG_ARM64_PLATFORM_DEVICES) += arm64/
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 344/809 perf test: Make test_arm_callgraph_fp.sh more robust
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Clark <[email protected]>
[ Upstream commit ff16aeb9b83441b8458d4235496cf320189a0c60 ]
The 2 second sleep can cause the test to fail on very slow network file systems because Perf ends up being killed before it finishes starting up.
Fix it by making the leafloop workload end after a fixed time like the other workloads so there is no need to kill it after 2 seconds.
Also remove the 1 second start sampling delay because it is similarly fragile. Instead, search through all samples for a matching one, rather than just checking the first sample and hoping it's in the right place.
--- .../perf/tests/shell/test_arm_callgraph_fp.sh | 27 +++++++------------ tools/perf/tests/workloads/leafloop.c | 20 +++++++++++--- 2 files changed, 26 insertions(+), 21 deletions(-)
tools/perf/tests/shell/test_arm_callgraph_fp.sh +10 -17
@@ -28,28 +28,21 @@ cleanup_files() trap cleanup_files EXIT TERM INT -# Add a 1 second delay to skip samples that are not in the leaf() function # shellcheck disable=SC2086 -perf record -o "$PERF_DATA" --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null & -PID=$! +perf record -o "$PERF_DATA" --call-graph fp -e cycles//u --user-callchains -- $TEST_PROGRAM -echo " + Recording (PID=$PID)..." -sleep 2 -echo " + Stopping perf-record..." - -kill $PID -wait $PID +# Try opening the file so any immediate errors are visible in the log +perf script -i "$PERF_DATA" -F comm,ip,sym | head -n4 -# expected perf-script output: +# expected perf-script output if 'leaf' has been inserted correctly: # -# program +# perf # 728 leaf # 753 parent # 76c leafloop -# ... +# ... remaining stack to main() ... -perf script -i "$PERF_DATA" -F comm,ip,sym | head -n4 -perf script -i "$PERF_DATA" -F comm,ip,sym | head -n4 | \ - awk '{ if ($2 != "") sym[i++] = $2 } END { if (sym[0] != "leaf" || - sym[1] != "parent" || - sym[2] != "leafloop") exit 1 }' +# Each frame is separated by a tab, some spaces and an address +SEP="[[:space:]]+ [[:xdigit:]]+" +perf script -i "$PERF_DATA" -F comm,ip,sym | tr '\n' ' ' | \ + grep -E -q "perf $SEP leaf $SEP parent $SEP leafloop"
tools/perf/tests/workloads/leafloop.c +16 -4
@@ -1,6 +1,8 @@/* SPDX-License-Identifier: GPL-2.0 */ +#include <signal.h> #include <stdlib.h> #include <linux/compiler.h> +#include <unistd.h> #include "../tests.h" /* We want to check these symbols in perf script */
@@ -8,10 +10,16 @@ noinline void leaf(volatile int b); noinline void parent(volatile int b);static volatile int a; +static volatile sig_atomic_t done; + +static void sighandler (int sig__maybe_unused ) +{ + done =1 ; +} noinline void leaf(volatile int b) { -for (;;) +while (!done) a += b; }
@@ -22,12 +30,16 @@ noinline void parent(volatile int b)static int leafloop (int argc,const char **argv) { -int c =1 ; +int sec =1 ;if (argc >0 ) - c =atoi (argv[0 ]); + sec =atoi (argv[0 ]); + +signal (SIGINT , sighandler); +signal (SIGALRM , sighandler); +alarm (sec); -parent (c); +parent (sec);return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 345/809 tools/perf: Fix the string match for "/tmp/perf-$PID.map" files in dso__load
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Athira Rajeev <[email protected]>
[ Upstream commit b0979f008f1352a44cd3c8877e3eb8a1e3e1c6f3 ]
Perf test for perf probe of function from different CU fails as below:
./perf test -vv "test perf probe of function from different CU" 116: test perf probe of function from different CU:
--- start ---
test child forked, pid 2679
Failed to find symbol foo in /tmp/perf-uprobe-different-cu-sh.Msa7iy89bx/testfile
Error: Failed to add events.
--- Cleaning up ---
"foo" does not hit any event.
Error: Failed to delete events.
---- end(-1) ----
116: test perf probe of function from different CU : FAILED!
The test does below to probe function "foo" :
# gcc -g -Og -flto -c /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile-foo.c -o /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile-foo.o # gcc -g -Og -c /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile-main.c -o /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile-main.o # gcc -g -Og -o /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile-foo.o /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile-main.o
# ./perf probe -x /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile foo Failed to find symbol foo in /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7/testfile Error: Failed to add events.
Perf probe fails to find symbol foo in the executable placed in /tmp/perf-uprobe-different-cu-sh.XniNxNEVT7
Simple reproduce:
# mktemp -d /tmp/perf-checkXXXXXXXXXX /tmp/perf-checkcWpuLRQI8j
# gcc -g -o test test.c # cp test /tmp/perf-checkcWpuLRQI8j/ # nm /tmp/perf-checkcWpuLRQI8j/test | grep foo 00000000100006bc T foo
# ./perf probe -x /tmp/perf-checkcWpuLRQI8j/test foo
Failed to find symbol foo in /tmp/perf-checkcWpuLRQI8j/test
Error: Failed to add events.But it works with any files like /tmp/perf/test. Only for patterns with "/tmp/perf-", this fails.
Further debugging, commit 80d496be89ed ("perf report: Add support for profiling JIT generated code") added support for profiling JIT generated code. This patch handles dso's of form "/tmp/perf-$PID.map" .
The check used "if (strncmp(self->name, "/tmp/perf-", 10) == 0)" to match "/tmp/perf-$PID.map". With this commit, any dso in /tmp/perf- folder will be considered separately for processing (not only JIT created map files ). Fix this by changing the string pattern to check for "/tmp/perf-%d.map". Add a helper function is_perf_pid_map_name to do this check. In "struct dso", dso->long_name holds the long name of the dso file. Since the /tmp/perf-$PID.map check uses the complete name, use dso___long_name for the string name.
With the fix,
# ./perf test "test perf probe of function from different CU" 117: test perf probe of function from different CU : Ok
--- tools/perf/util/dso.c | 12 ++++++++++++ tools/perf/util/dso.h | 4 ++++ tools/perf/util/symbol.c | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-)
tools/perf/util/dso.c +12 -0
@@ -1652,3 +1652,15 @@ int dso__strerror_load(struct dso *dso, char *buf, size_t buflen)scnprintf (buf, buflen,"%s" , dso_load__error_str[idx]);return 0 ; } + +bool perf_pid_map_tid (const char *dso_name,int *tid) +{ +return sscanf (dso_name,"/tmp/perf-%d.map" , tid) ==1 ; +} + +bool is_perf_pid_map_name (const char *dso_name) +{ +int tid; + +return perf_pid_map_tid (dso_name, &tid); +}
tools/perf/util/dso.h +4 -0
@@ -809,4 +809,8 @@ void reset_fd_limit(void);u64 dso__find_global_type (struct dso *dso,u64 addr);u64 dso__findnew_global_type (struct dso *dso,u64 addr,u64 offset); +/* Check if dso name is of format "/tmp/perf-%d.map" */ +bool perf_pid_map_tid (const char *dso_name,int *tid); +bool is_perf_pid_map_name (const char *dso_name); +#endif /* __PERF_DSO */
tools/perf/util/symbol.c +2 -1
@@ -1799,7 +1799,8 @@ int dso__load(struct dso *dso, struct map *map)const char *map_path =dso__long_name (dso);mutex_lock (dso__lock (dso)); - perfmap =strncmp (dso__name (dso),"/tmp/perf-" ,10 ) ==0 ; + perfmap =is_perf_pid_map_name (map_path); +if (perfmap) { if (dso__nsinfo(dso) && (dso__find_perf_map(newmapname, sizeof(newmapname),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 346/809 perf pmus: Fixes always false when compare duplicates aliases
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junhao He <[email protected]>
[ Upstream commit dd9a426eade634bf794c7e0f1b0c6659f556942f ]
In the previous loop, all the members in the aliases[j-1] have been freed and set to NULL. But in this loop, the function pmu_alias_is_duplicate() compares the aliases[j] with the aliases[j-1] that has already been disposed, so the function will always return false and duplicate aliases will never be discarded.
If we find duplicate aliases, it skips the zfree aliases[j], which is accompanied by a memory leak.
We can use the next aliases[j+1] to theck for duplicate aliases to fixes the aliases NULL pointer dereference, then goto zfree code snippet to release it.
After patch testing:
$ perf list --unit=hisi_sicl,cpa pmu
uncore cpa:
cpa_p0_rd_dat_32b
[Number of read ops transmitted by the P0 port which size is 32 bytes.
Unit: hisi_sicl,cpa]
cpa_p0_rd_dat_64b
[Number of read ops transmitted by the P0 port which size is 64 bytes.
Unit: hisi_sicl,cpa]
--- tools/perf/util/pmus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/util/pmus.c +3 -2
@@ -477,8 +477,8 @@ void perf_pmus__print_pmu_events(const struct print_callbacks *print_cb, void *pqsort (aliases, len,sizeof (struct sevent ), cmp_sevent);for (int j =0 ; j < len; j++) {/* Skip duplicates */ -if (j >0 &&pmu_alias_is_duplicate (&aliases[j], &aliases[j -1 ])) -continue ; +if (j < len -1 &&pmu_alias_is_duplicate (&aliases[j], &aliases[j +1 ])) + goto free; print_cb->print_event(print_state, aliases[j].pmu_name,
@@ -491,6 +491,7 @@ void perf_pmus__print_pmu_events(const struct print_callbacks *print_cb, void *p aliases[j].desc, aliases[j].long_desc, aliases[j].encoding_desc); +free:zfree (&aliases[j].name);zfree (&aliases[j].alias);zfree (&aliases[j].scale_unit);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 347/809 perf report: Fix condition in sort__sym_cmp()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
[ Upstream commit cb39d05e67dc24985ff9f5150e71040fa4d60ab8 ]
It's expected that both hist entries are in the same hists when comparing two. But the current code in the function checks one without dso sort key and other with the key. This would make the condition true in any case.
I guess the intention of the original commit was to add '!' for the right side too. But as it should be the same, let's just remove it.
--- tools/perf/util/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/sort.c +1 -1
@@ -334,7 +334,7 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)* comparing symbol address alone is not enough since it's a * relative address within a dso. */ -if (!hists__has (left->hists, dso) ||hists__has (right->hists, dso)) { +if (!hists__has (left->hists, dso)) { ret =sort__dso_cmp (left, right);if (ret !=0 )return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 348/809 drm/etnaviv: fix DMA direction handling for cached RW buffers
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lucas Stach <[email protected]>
[ Upstream commit 58979ad6330a70450ed78837be3095107d022ea9 ]
The dma sync operation needs to be done with DMA_BIDIRECTIONAL when the BO is prepared for both read and write operations.
--- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_gem.c +4 -2
@@ -355,9 +355,11 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)static inline enum dma_data_direction etnaviv_op_to_dma_dir (u32 op) { -if (op &ETNA_PREP_READ ) + op &=ETNA_PREP_READ |ETNA_PREP_WRITE ; + +if (op ==ETNA_PREP_READ )return DMA_FROM_DEVICE ; -else if (op &ETNA_PREP_WRITE ) +else if (op ==ETNA_PREP_WRITE )return DMA_TO_DEVICE ;else return DMA_BIDIRECTIONAL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 349/809 drm/qxl: Add check for drm_cvt_mode
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ni <[email protected]>
[ Upstream commit 7bd09a2db0f617377027a2bb0b9179e6959edff3 ]
Add check for the return value of drm_cvt_mode() and return the error if it fails in order to avoid NULL pointer dereference.
--- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/qxl/qxl_display.c +3 -0
@@ -236,6 +236,9 @@ static int qxl_add_mode(struct drm_connector *connector,return 0 ; mode =drm_cvt_mode (dev, width, height,60 , false, false, false); +if (!mode) +return 0 ; +if (preferred) mode->type |=DRM_MODE_TYPE_PREFERRED ; mode->hdisplay = width;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 350/809 leds: rgb: leds-qcom-lpg: Add PPG check for setting/clearing PBS triggers
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anjelique Melendez <[email protected]>
[ Upstream commit 7e776e21255bf4c271e0df0a7d289a4963580e61 ]
Currently, all LED LPG devices will call lpg_{set,clear}_pbs_trigger() when setting brightness regardless of if they support PPG and have PBS triggers. Check if device supports PPG before setting/clearing PBS triggers.
--- drivers/leds/rgb/leds-qcom-lpg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/leds/rgb/leds-qcom-lpg.c +7 -1
@@ -2,7 +2,7 @@/* * Copyright (c) 2017-2022 Linaro Ltd * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. -* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/bits.h> #include <linux/bitfield.h>
@@ -254,6 +254,9 @@ static int lpg_clear_pbs_trigger(struct lpg *lpg, unsigned int lut_mask)u8 val =0 ;int rc; +if (!lpg->lpg_chan_sdam) +return 0 ; + lpg->pbs_en_bitmap &= (~lut_mask);if (!lpg->pbs_en_bitmap) { rc =nvmem_device_write (lpg->lpg_chan_sdam,SDAM_REG_PBS_SEQ_EN ,1 , &val);
@@ -276,6 +279,9 @@ static int lpg_set_pbs_trigger(struct lpg *lpg, unsigned int lut_mask)u8 val =PBS_SW_TRIG_BIT ;int rc; +if (!lpg->lpg_chan_sdam) +return 0 ; +if (!lpg->pbs_en_bitmap) { rc =nvmem_device_write (lpg->lpg_chan_sdam,SDAM_REG_PBS_SEQ_EN ,1 , &val);if (rc <0 )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 351/809 Revert "leds: led-core: Fix refcount leak in of_led_get()"
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Ceresoli <[email protected]>
[ Upstream commit 940b27161afc6ec53fc66245a4fb3518394cdc92 ]
This reverts commit da1afe8e6099980fe1e2fd7436dca284af9d3f29.
Commit 699a8c7c4bd3 ("leds: Add of_led_get() and led_put()"), introduced in 5.5, added of_led_get() and led_put() but missed a put_device() in led_put(), thus creating a leak in case the consumer device is removed.
Arguably device removal was not very popular, so this went apparently unnoticed until 2022. In January 2023 two different patches got merged to fix the same bug:
- commit da1afe8e6099 ("leds: led-core: Fix refcount leak in of_led_get()")
- commit 445110941eb9 ("leds: led-class: Add missing put_device() to led_put()")
They fix the bug in two different ways, which creates no patch conflicts, and both were merged in v6.2. The result is that now there is one more put_device() than get_device()s, instead of one less.
Arguably device removal is not very popular yet, so this apparently hasn't been noticed as well up to now. But it blew up here while I'm working with device tree overlay insertion and removal. The symptom is an apparently unrelated list of oopses on device removal, with reasons:
kernfs: can not remove 'uevent', no directory
kernfs: can not remove 'brightness', no directory
kernfs: can not remove 'max_brightness', no directory
...
Here sysfs fails removing attribute files, which is because the device name changed and so the sysfs path. This is because the device name string got corrupted, which is because it got freed too early and its memory reused.
Different symptoms could appear in different use cases.
Fix by removing one of the two fixes.
The choice was to remove commit da1afe8e6099 because:
* it is calling put_device() inside of_led_get() just after getting the device, thus it is basically not refcounting the LED device at all during its entire lifetime
* it does not add a corresponding put_device() in led_get(), so it fixes only the OF case
The other fix (445110941eb9) is adding the put_device() in led_put() so it covers the entire lifetime, and it works even in the non-DT case.
--- drivers/leds/led-class.c | 1 - 1 file changed, 1 deletion(-)
drivers/leds/led-class.c +0 -1
@@ -258,7 +258,6 @@ struct led_classdev *of_led_get(struct device_node *np, int index) led_dev =class_find_device_by_of_node (&leds_class, led_node);of_node_put (led_node); -put_device (led_dev);return led_module_get (led_dev); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 352/809 drm/panic: depends on !VT_CONSOLE
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jocelyn Falempe <[email protected]>
[ Upstream commit 1ac6ac9ec069ed0cfdb1c207ae23f6c40ac57437 ]
The race condition between fbcon and drm_panic can only occurs if VT_CONSOLE is set. So update drm_panic dependency accordingly. This will make it easier for Linux distributions to enable drm_panic by disabling VT_CONSOLE, and keeping fbcon terminal.
The only drawback is that fbcon won't display the boot kmsg, so it should rely on userspace to do that.
At least plymouth already handle this case with
https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/224
Stable-dep-of: e044e707fc97 ("drm/panic: Do not select DRM_KMS_HELPER")
--- drivers/gpu/drm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/Kconfig +1 -1
@@ -106,7 +106,7 @@ config DRM_KMS_HELPER config DRM_PANIC bool "Display a user-friendly message when a kernel panic occurs" - depends on DRM && !FRAMEBUFFER_CONSOLE + depends on DRM && !(FRAMEBUFFER_CONSOLE && VT_CONSOLE) select DRM_KMS_HELPER select FONT_SUPPORT help
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 353/809 drm/panic: Do not select DRM_KMS_HELPER
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit e044e707fc97dac693691178cdf41fe1a8da928f ]
DRM core code cannot call into DRM helper code, as this would lead to circular references in the modular case. Hence drop the selection of DRM_KMS_HELPER. It was unused anyway, as v10 switched from using the DRM format helpers to its own color format conversion, cfr. commit 9544309775c3 ("drm/panic: Add support for color format conversion").
Remove the unneeded include of <drm/drm_format_helper.h>.
--- drivers/gpu/drm/Kconfig | 1 - drivers/gpu/drm/drm_panic.c | 1 - 2 files changed, 2 deletions(-)
drivers/gpu/drm/Kconfig +0 -1
@@ -107,7 +107,6 @@ config DRM_KMS_HELPER config DRM_PANIC bool "Display a user-friendly message when a kernel panic occurs" depends on DRM && !(FRAMEBUFFER_CONSOLE && VT_CONSOLE) - select DRM_KMS_HELPER select FONT_SUPPORT help Enable a drm panic handler, which will display a user-friendly message
drivers/gpu/drm/drm_panic.c +0 -1
@@ -15,7 +15,6 @@#include <linux/types.h> #include <drm/drm_drv.h> -#include <drm/drm_format_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include <drm/drm_modeset_helper_vtables.h>
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 354/809 drm/mediatek: Remove less-than-zero comparison of an unsigned value
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsiao Chien Sung <[email protected]>
[ Upstream commit 4ed9dd7fde22ed614384c03f8049723cbe7e6a58 ]
Fix a Coverity error that less-than-zero comparison of an unsigned value is never true.
--- drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_ddp_comp.c +1 -1
@@ -593,7 +593,7 @@ int mtk_ddp_comp_init(struct device_node *node, struct mtk_ddp_comp *comp,int ret;#endif -if (comp_id <0 || comp_id >=DDP_COMPONENT_DRM_ID_MAX ) +if (comp_id >=DDP_COMPONENT_DRM_ID_MAX )return -EINVAL ; type = mtk_ddp_matches[comp_id].type;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 355/809 ext4: fix infinite loop when replaying fast_commit
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luis Henriques (SUSE) <[email protected]>
[ Upstream commit 907c3fe532253a6ef4eb9c4d67efb71fab58c706 ]
When doing fast_commit replay an infinite loop may occur due to an uninitialized extent_status struct. ext4_ext_determine_insert_hole() does not detect the replay and calls ext4_es_find_extent_range(), which will return immediately without initializing the 'es' variable.
Because 'es' contains garbage, an integer overflow may happen causing an infinite loop in this function, easily reproducible using fstest generic/039.
This commit fixes this issue by unconditionally initializing the structure in function ext4_es_find_extent_range().
Thanks to Zhang Yi, for figuring out the real problem!
--- fs/ext4/extents_status.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ext4/extents_status.c +2 -0
@@ -310,6 +310,8 @@ void ext4_es_find_extent_range(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t end, struct extent_status *es) { + es->es_lblk = es->es_len = es->es_pblk = 0; +if (EXT4_SB (inode->i_sb)->s_mount_state &EXT4_FC_REPLAY )return ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 356/809 drm/amd/display: Add null check before access structs
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Ke <[email protected]>
[ Upstream commit c96140000915b610d86f941450e15ca552de154a ]
In enable_phantom_plane, we should better check null pointer before accessing various structs.
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c +2 -0
@@ -750,6 +750,8 @@ static void enable_phantom_plane(struct dml2_context *ctx, ctx->config.svp_pstate.callbacks.dc, state, curr_pipe->plane_state); +if (!phantom_plane) +return ; }memcpy (&phantom_plane->address, &curr_pipe->plane_state->address,sizeof (phantom_plane->address));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 357/809 perf tests: Add some pmu core functionality tests
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <[email protected]>
[ Upstream commit 678be1ca30cc939e0180c85b4cc9150b3d5ef0c8 ]
Test behavior of PMU names and comparisons wrt suffixes using Intel uncore_cha, marvell mrvl_ddr_pmu and S390's cpum_cf as examples.
Stable-dep-of: 3e0bf9fde298 ("perf pmu: Restore full PMU name wildcard support")
--- tools/perf/tests/pmu.c | 99 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+)
tools/perf/tests/pmu.c +99 -0
@@ -3,6 +3,7 @@#include "evsel.h" #include "parse-events.h" #include "pmu.h" +#include "pmus.h" #include "tests.h" #include "debug.h" #include "fncache.h"
@@ -340,10 +341,108 @@ static int test__pmu_event_names(struct test_suite *test __maybe_unused,return ret; } +static const char *const uncore_chas[] = { +"uncore_cha_0" , +"uncore_cha_1" , +"uncore_cha_2" , +"uncore_cha_3" , +"uncore_cha_4" , +"uncore_cha_5" , +"uncore_cha_6" , +"uncore_cha_7" , +"uncore_cha_8" , +"uncore_cha_9" , +"uncore_cha_10" , +"uncore_cha_11" , +"uncore_cha_12" , +"uncore_cha_13" , +"uncore_cha_14" , +"uncore_cha_15" , +"uncore_cha_16" , +"uncore_cha_17" , +"uncore_cha_18" , +"uncore_cha_19" , +"uncore_cha_20" , +"uncore_cha_21" , +"uncore_cha_22" , +"uncore_cha_23" , +"uncore_cha_24" , +"uncore_cha_25" , +"uncore_cha_26" , +"uncore_cha_27" , +"uncore_cha_28" , +"uncore_cha_29" , +"uncore_cha_30" , +"uncore_cha_31" , +}; + +static const char *const mrvl_ddrs[] = { +"mrvl_ddr_pmu_87e1b0000000" , +"mrvl_ddr_pmu_87e1b1000000" , +"mrvl_ddr_pmu_87e1b2000000" , +"mrvl_ddr_pmu_87e1b3000000" , +"mrvl_ddr_pmu_87e1b4000000" , +"mrvl_ddr_pmu_87e1b5000000" , +"mrvl_ddr_pmu_87e1b6000000" , +"mrvl_ddr_pmu_87e1b7000000" , +"mrvl_ddr_pmu_87e1b8000000" , +"mrvl_ddr_pmu_87e1b9000000" , +"mrvl_ddr_pmu_87e1ba000000" , +"mrvl_ddr_pmu_87e1bb000000" , +"mrvl_ddr_pmu_87e1bc000000" , +"mrvl_ddr_pmu_87e1bd000000" , +"mrvl_ddr_pmu_87e1be000000" , +"mrvl_ddr_pmu_87e1bf000000" , +}; + +static int test__name_len (struct test_suite *test__maybe_unused ,int subtest__maybe_unused ) +{ +TEST_ASSERT_VAL ("cpu" ,pmu_name_len_no_suffix ("cpu" ) ==strlen ("cpu" )); +TEST_ASSERT_VAL ("i915" ,pmu_name_len_no_suffix ("i915" ) ==strlen ("i915" )); +TEST_ASSERT_VAL ("cpum_cf" ,pmu_name_len_no_suffix ("cpum_cf" ) ==strlen ("cpum_cf" )); +for (size_t i =0 ; i <ARRAY_SIZE (uncore_chas); i++) { +TEST_ASSERT_VAL ("Strips uncore_cha suffix" , +pmu_name_len_no_suffix (uncore_chas[i]) == +strlen ("uncore_cha" )); + } +for (size_t i =0 ; i <ARRAY_SIZE (mrvl_ddrs); i++) { +TEST_ASSERT_VAL ("Strips mrvl_ddr_pmu suffix" , +pmu_name_len_no_suffix (mrvl_ddrs[i]) == +strlen ("mrvl_ddr_pmu" )); + } +return TEST_OK ; +} + +static int test__name_cmp (struct test_suite *test__maybe_unused ,int subtest__maybe_unused ) +{ +TEST_ASSERT_EQUAL ("cpu" ,pmu_name_cmp ("cpu" ,"cpu" ),0 ); +TEST_ASSERT_EQUAL ("i915" ,pmu_name_cmp ("i915" ,"i915" ),0 ); +TEST_ASSERT_EQUAL ("cpum_cf" ,pmu_name_cmp ("cpum_cf" ,"cpum_cf" ),0 ); +TEST_ASSERT_VAL ("i915" ,pmu_name_cmp ("cpu" ,"i915" ) <0 ); +TEST_ASSERT_VAL ("i915" ,pmu_name_cmp ("i915" ,"cpu" ) >0 ); +TEST_ASSERT_VAL ("cpum_cf" ,pmu_name_cmp ("cpum_cf" ,"cpum_ce" ) >0 ); +TEST_ASSERT_VAL ("cpum_cf" ,pmu_name_cmp ("cpum_cf" ,"cpum_d0" ) <0 ); +for (size_t i =1 ; i <ARRAY_SIZE (uncore_chas); i++) { +TEST_ASSERT_VAL ("uncore_cha suffixes ordered lt" , +pmu_name_cmp (uncore_chas[i-1 ], uncore_chas[i]) <0 ); +TEST_ASSERT_VAL ("uncore_cha suffixes ordered gt" , +pmu_name_cmp (uncore_chas[i], uncore_chas[i-1 ]) >0 ); + } +for (size_t i =1 ; i <ARRAY_SIZE (mrvl_ddrs); i++) { +TEST_ASSERT_VAL ("mrvl_ddr_pmu suffixes ordered lt" , +pmu_name_cmp (mrvl_ddrs[i-1 ], mrvl_ddrs[i]) <0 ); +TEST_ASSERT_VAL ("mrvl_ddr_pmu suffixes ordered gt" , +pmu_name_cmp (mrvl_ddrs[i], mrvl_ddrs[i-1 ]) >0 ); + } +return TEST_OK ; +} +static struct test_case tests__pmu[] = {TEST_CASE ("Parsing with PMU format directory" , pmu_format),TEST_CASE ("Parsing with PMU event" , pmu_events),TEST_CASE ("PMU event names" , pmu_event_names), +TEST_CASE ("PMU name combining" , name_len), +TEST_CASE ("PMU name comparison" , name_cmp), { .name =NULL , } };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 358/809 perf pmu: Restore full PMU name wildcard support
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Clark <[email protected]>
[ Upstream commit 3e0bf9fde29844694ad9912aa290fbdb2c3fa767 ]
Commit b2b9d3a3f021 ("perf pmu: Support wildcards on pmu name in dynamic pmu events") gives the following example for wildcarding a subset of PMUs:
E.g., in a system with the following dynamic pmus:
mypmu_0
mypmu_1
mypmu_2
mypmu_4perf stat -e mypmu_[01]/<config>/
Since commit f91fa2ae6360 ("perf pmu: Refactor perf_pmu__match()"), only "*" has been supported, removing the ability to subset PMUs, even though parse-events.l still supports ? and [] characters.
Fix it by using fnmatch() when any glob character is detected and add a test which covers that and other scenarios of perf_pmu__match_ignoring_suffix().
--- tools/perf/tests/pmu.c | 78 ++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/pmu.c | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-)
tools/perf/tests/pmu.c +78 -0
@@ -437,12 +437,90 @@ static int test__name_cmp(struct test_suite *test __maybe_unused, int subtest __return TEST_OK ; } +/** +* Test perf_pmu__match() that's used to search for a PMU given a name passed +* on the command line. The name that's passed may also be a filename type glob +* match. +*/ +static int test__pmu_match (struct test_suite *test__maybe_unused ,int subtest__maybe_unused ) +{ +struct perf_pmu test_pmu; + + test_pmu.name ="pmuname" ; +TEST_ASSERT_EQUAL ("Exact match" ,perf_pmu__match (&test_pmu,"pmuname" ), true); +TEST_ASSERT_EQUAL ("Longer token" ,perf_pmu__match (&test_pmu,"longertoken" ), false); +TEST_ASSERT_EQUAL ("Shorter token" ,perf_pmu__match (&test_pmu,"pmu" ), false); + + test_pmu.name ="pmuname_10" ; +TEST_ASSERT_EQUAL ("Diff suffix_" ,perf_pmu__match (&test_pmu,"pmuname_2" ), false); +TEST_ASSERT_EQUAL ("Sub suffix_" ,perf_pmu__match (&test_pmu,"pmuname_1" ), true); +TEST_ASSERT_EQUAL ("Same suffix_" ,perf_pmu__match (&test_pmu,"pmuname_10" ), true); +TEST_ASSERT_EQUAL ("No suffix_" ,perf_pmu__match (&test_pmu,"pmuname" ), true); +TEST_ASSERT_EQUAL ("Underscore_" ,perf_pmu__match (&test_pmu,"pmuname_" ), true); +TEST_ASSERT_EQUAL ("Substring_" ,perf_pmu__match (&test_pmu,"pmuna" ), false); + + test_pmu.name ="pmuname_ab23" ; +TEST_ASSERT_EQUAL ("Diff suffix hex_" ,perf_pmu__match (&test_pmu,"pmuname_2" ), false); +TEST_ASSERT_EQUAL ("Sub suffix hex_" ,perf_pmu__match (&test_pmu,"pmuname_ab" ), true); +TEST_ASSERT_EQUAL ("Same suffix hex_" ,perf_pmu__match (&test_pmu,"pmuname_ab23" ), true); +TEST_ASSERT_EQUAL ("No suffix hex_" ,perf_pmu__match (&test_pmu,"pmuname" ), true); +TEST_ASSERT_EQUAL ("Underscore hex_" ,perf_pmu__match (&test_pmu,"pmuname_" ), true); +TEST_ASSERT_EQUAL ("Substring hex_" ,perf_pmu__match (&test_pmu,"pmuna" ), false); + + test_pmu.name ="pmuname10" ; +TEST_ASSERT_EQUAL ("Diff suffix" ,perf_pmu__match (&test_pmu,"pmuname2" ), false); +TEST_ASSERT_EQUAL ("Sub suffix" ,perf_pmu__match (&test_pmu,"pmuname1" ), true); +TEST_ASSERT_EQUAL ("Same suffix" ,perf_pmu__match (&test_pmu,"pmuname10" ), true); +TEST_ASSERT_EQUAL ("No suffix" ,perf_pmu__match (&test_pmu,"pmuname" ), true); +TEST_ASSERT_EQUAL ("Underscore" ,perf_pmu__match (&test_pmu,"pmuname_" ), false); +TEST_ASSERT_EQUAL ("Substring" ,perf_pmu__match (&test_pmu,"pmuna" ), false); + + test_pmu.name ="pmunameab23" ; +TEST_ASSERT_EQUAL ("Diff suffix hex" ,perf_pmu__match (&test_pmu,"pmuname2" ), false); +TEST_ASSERT_EQUAL ("Sub suffix hex" ,perf_pmu__match (&test_pmu,"pmunameab" ), true); +TEST_ASSERT_EQUAL ("Same suffix hex" ,perf_pmu__match (&test_pmu,"pmunameab23" ), true); +TEST_ASSERT_EQUAL ("No suffix hex" ,perf_pmu__match (&test_pmu,"pmuname" ), true); +TEST_ASSERT_EQUAL ("Underscore hex" ,perf_pmu__match (&test_pmu,"pmuname_" ), false); +TEST_ASSERT_EQUAL ("Substring hex" ,perf_pmu__match (&test_pmu,"pmuna" ), false); + +/* +* 2 hex chars or less are not considered suffixes so it shouldn't be +* possible to wildcard by skipping the suffix. Therefore there are more +* false results here than above. +*/ + test_pmu.name ="pmuname_a3" ; +TEST_ASSERT_EQUAL ("Diff suffix 2 hex_" ,perf_pmu__match (&test_pmu,"pmuname_2" ), false); +/* +* This one should be false, but because pmuname_a3 ends in 3 which is +* decimal, it's not possible to determine if it's a short hex suffix or +* a normal decimal suffix following text. And we want to match on any +* length of decimal suffix. Run the test anyway and expect the wrong +* result. And slightly fuzzy matching shouldn't do too much harm. +*/ +TEST_ASSERT_EQUAL ("Sub suffix 2 hex_" ,perf_pmu__match (&test_pmu,"pmuname_a" ), true); +TEST_ASSERT_EQUAL ("Same suffix 2 hex_" ,perf_pmu__match (&test_pmu,"pmuname_a3" ), true); +TEST_ASSERT_EQUAL ("No suffix 2 hex_" ,perf_pmu__match (&test_pmu,"pmuname" ), false); +TEST_ASSERT_EQUAL ("Underscore 2 hex_" ,perf_pmu__match (&test_pmu,"pmuname_" ), false); +TEST_ASSERT_EQUAL ("Substring 2 hex_" ,perf_pmu__match (&test_pmu,"pmuna" ), false); + + test_pmu.name ="pmuname_5" ; +TEST_ASSERT_EQUAL ("Glob 1" ,perf_pmu__match (&test_pmu,"pmu*" ), true); +TEST_ASSERT_EQUAL ("Glob 2" ,perf_pmu__match (&test_pmu,"nomatch*" ), false); +TEST_ASSERT_EQUAL ("Seq 1" ,perf_pmu__match (&test_pmu,"pmuname_[12345]" ), true); +TEST_ASSERT_EQUAL ("Seq 2" ,perf_pmu__match (&test_pmu,"pmuname_[67890]" ), false); +TEST_ASSERT_EQUAL ("? 1" ,perf_pmu__match (&test_pmu,"pmuname_?" ), true); +TEST_ASSERT_EQUAL ("? 2" ,perf_pmu__match (&test_pmu,"pmuname_1?" ), false); + +return TEST_OK ; +} +static struct test_case tests__pmu[] = {TEST_CASE ("Parsing with PMU format directory" , pmu_format),TEST_CASE ("Parsing with PMU event" , pmu_events),TEST_CASE ("PMU event names" , pmu_event_names),TEST_CASE ("PMU name combining" , name_len),TEST_CASE ("PMU name comparison" , name_cmp), +TEST_CASE ("PMU cmdline match" , pmu_match), { .name =NULL , } };
tools/perf/util/pmu.c +1 -1
@@ -2143,7 +2143,7 @@ void perf_pmu__warn_invalid_config(struct perf_pmu *pmu, __u64 config,bool perf_pmu__match (const struct perf_pmu *pmu,const char *tok) {const char *name = pmu->name; -bool need_fnmatch =strchr (tok,'*' ) !=NULL ; +bool need_fnmatch =strisglob (tok);if (!strncmp (tok,"uncore_" ,7 )) tok +=7 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 359/809 drm/mediatek: dpi/dsi: Fix possible_crtcs calculation
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Walle <[email protected]>
[ Upstream commit 9ff6df49e6cbcc9834865870d7c4f3059b0891d3 ]
mtk_find_possible_crtcs() assumes that the main path will always have the CRTC with id 0, the ext id 1 and the third id 2. This is only true if the paths are all available. But paths are optional (see also comment in mtk_drm_kms_init()), e.g. the main path might not be enabled or available at all. Then the CRTC IDs will shift one up, e.g. ext will be 0 and the third path will be 1.
To fix that, dynamically calculate the IDs by the presence of the paths.
While at it, make the return code a signed one and return -ENODEV if no path is found and handle the error in the callers.
--- drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 107 ++++++++++++++++-------- drivers/gpu/drm/mediatek/mtk_ddp_comp.h | 2 +- drivers/gpu/drm/mediatek/mtk_dpi.c | 5 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 5 +- 4 files changed, 80 insertions(+), 39 deletions(-)
drivers/gpu/drm/mediatek/mtk_ddp_comp.c +71 -36
@@ -514,29 +514,42 @@ static bool mtk_ddp_comp_find(struct device *dev,return false; } -static unsigned int mtk_ddp_comp_find_in_route (struct device *dev, -const struct mtk_drm_route *routes, -unsigned int num_routes, -struct mtk_ddp_comp *ddp_comp) +static int mtk_ddp_comp_find_in_route (struct device *dev, +const struct mtk_drm_route *routes, +unsigned int num_routes, +struct mtk_ddp_comp *ddp_comp) { -int ret;unsigned int i; -if (!routes) { - ret = -EINVAL ; - goto err; - } +if (!routes) +return -EINVAL ;for (i =0 ; i < num_routes; i++)if (dev == ddp_comp[routes[i].route_ddp].dev)return BIT (routes[i].crtc_id); - ret = -ENODEV ; -err: +return -ENODEV ; +} -DRM_INFO ("Failed to find comp in ddp table, ret = %d\n" , ret); +static bool mtk_ddp_path_available (const unsigned int *path, +unsigned int path_len, +struct device_node **comp_node) +{ +unsigned int i; -return 0 ; +if (!path || !path_len) +return false; + +for (i =0U ; i < path_len; i++) { +/* OVL_ADAPTOR doesn't have a device node */ +if (path[i] ==DDP_COMPONENT_DRM_OVL_ADAPTOR ) +continue ; + +if (!comp_node[path[i]]) +return false; + } + +return true; } int mtk_ddp_comp_get_id(struct device_node *node,
@@ -554,31 +567,53 @@ int mtk_ddp_comp_get_id(struct device_node *node,return -EINVAL ; } -unsigned int mtk_find_possible_crtcs (struct drm_device *drm,struct device *dev) +int mtk_find_possible_crtcs (struct drm_device *drm,struct device *dev) {struct mtk_drm_private *private = drm->dev_private; -unsigned int ret =0 ; - -if (mtk_ddp_comp_find (dev, - private->data->main_path, - private->data->main_len, - private->ddp_comp)) - ret =BIT (0 ); -else if (mtk_ddp_comp_find (dev, - private->data->ext_path, - private->data->ext_len, - private->ddp_comp)) - ret =BIT (1 ); -else if (mtk_ddp_comp_find (dev, - private->data->third_path, - private->data->third_len, - private->ddp_comp)) - ret =BIT (2 ); -else - ret =mtk_ddp_comp_find_in_route (dev, - private->data->conn_routes, - private->data->num_conn_routes, - private->ddp_comp); +const struct mtk_mmsys_driver_data *data; +struct mtk_drm_private *priv_n; +int i =0 , j; +int ret; + +for (j =0 ; j < private->data->mmsys_dev_num; j++) { + priv_n = private->all_drm_private[j]; + data = priv_n->data; + +if (mtk_ddp_path_available (data->main_path, data->main_len, + priv_n->comp_node)) { +if (mtk_ddp_comp_find (dev, data->main_path, + data->main_len, + priv_n->ddp_comp)) +return BIT (i); + i++; + } + +if (mtk_ddp_path_available (data->ext_path, data->ext_len, + priv_n->comp_node)) { +if (mtk_ddp_comp_find (dev, data->ext_path, + data->ext_len, + priv_n->ddp_comp)) +return BIT (i); + i++; + } + +if (mtk_ddp_path_available (data->third_path, data->third_len, + priv_n->comp_node)) { +if (mtk_ddp_comp_find (dev, data->third_path, + data->third_len, + priv_n->ddp_comp)) +return BIT (i); + i++; + } + } + + ret =mtk_ddp_comp_find_in_route (dev, + private->data->conn_routes, + private->data->num_conn_routes, + private->ddp_comp); + +if (ret <0 ) +DRM_INFO ("Failed to find comp in ddp table, ret = %d\n" , ret);return ret; }
drivers/gpu/drm/mediatek/mtk_ddp_comp.h +1 -1
@@ -330,7 +330,7 @@ static inline void mtk_ddp_comp_encoder_index_set(struct mtk_ddp_comp *comp)int mtk_ddp_comp_get_id (struct device_node *node,enum mtk_ddp_comp_type comp_type); -unsigned int mtk_find_possible_crtcs (struct drm_device *drm,struct device *dev); +int mtk_find_possible_crtcs (struct drm_device *drm,struct device *dev);int mtk_ddp_comp_init (struct device_node *comp_node,struct mtk_ddp_comp *comp,unsigned int comp_id);enum mtk_ddp_comp_type mtk_ddp_comp_get_type (unsigned int comp_id);
drivers/gpu/drm/mediatek/mtk_dpi.c +4 -1
@@ -805,7 +805,10 @@ static int mtk_dpi_bind(struct device *dev, struct device *master, void *data)return ret; } - dpi->encoder.possible_crtcs =mtk_find_possible_crtcs (drm_dev, dpi->dev); + ret =mtk_find_possible_crtcs (drm_dev, dpi->dev); +if (ret <0 ) + goto err_cleanup; + dpi->encoder.possible_crtcs = ret; ret =drm_bridge_attach (&dpi->encoder, &dpi->bridge,NULL ,DRM_BRIDGE_ATTACH_NO_CONNECTOR );
drivers/gpu/drm/mediatek/mtk_dsi.c +4 -1
@@ -837,7 +837,10 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)return ret; } - dsi->encoder.possible_crtcs =mtk_find_possible_crtcs (drm, dsi->host.dev); + ret =mtk_find_possible_crtcs (drm, dsi->host.dev); +if (ret <0 ) + goto err_cleanup_encoder; + dsi->encoder.possible_crtcs = ret; ret =drm_bridge_attach (&dsi->encoder, &dsi->bridge,NULL ,DRM_BRIDGE_ATTACH_NO_CONNECTOR );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 360/809 drm/mediatek/dp: Fix spurious kfree()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Walle <[email protected]>
[ Upstream commit 8ad49a92cff4bab13eb2f2725243f5f31eff3f3b ]
drm_edid_to_sad() might return an error or just zero. If that is the case, we must not free the SADs because there was no allocation in the first place.
--- drivers/gpu/drm/mediatek/mtk_dp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/mediatek/mtk_dp.c +8 -2
@@ -2073,9 +2073,15 @@ static const struct drm_edid *mtk_dp_edid_read(struct drm_bridge *bridge,*/ const struct edid *edid =drm_edid_raw (drm_edid);struct cea_sad *sads; +int ret; - audio_caps->sad_count =drm_edid_to_sad (edid, &sads); -kfree (sads); + ret =drm_edid_to_sad (edid, &sads); +/* Ignore any errors */ +if (ret <0 ) + ret =0 ; +if (ret) +kfree (sads); + audio_caps->sad_count = ret;/* * FIXME: This should use connector->display_info.has_audio from
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 361/809 perf stat: Fix a segfault with --per-cluster --metric-only
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
[ Upstream commit caa463bb79a82ac5fce05a0dcf7893d94c84fc5e ]
The new --per-cluster option was added recently but it forgot to update the aggr_header fields which are used for --metric-only option. And it resulted in a segfault due to NULL string in fputs().
--- tools/perf/util/stat-display.c | 3 +++ 1 file changed, 3 insertions(+)
tools/perf/util/stat-display.c +3 -0
@@ -38,6 +38,7 @@static int aggr_header_lens[] = { [AGGR_CORE ] =18 , [AGGR_CACHE ] =22 , + [AGGR_CLUSTER ] =20 , [AGGR_DIE ] =12 , [AGGR_SOCKET ] =6 , [AGGR_NODE ] =6 ,
@@ -49,6 +50,7 @@ static int aggr_header_lens[] = {static const char *aggr_header_csv[] = { [AGGR_CORE ] ="core,cpus," , [AGGR_CACHE ] ="cache,cpus," , + [AGGR_CLUSTER ] ="cluster,cpus," , [AGGR_DIE ] ="die,cpus," , [AGGR_SOCKET ] ="socket,cpus," , [AGGR_NONE ] ="cpu," ,
@@ -60,6 +62,7 @@ static const char *aggr_header_csv[] = {static const char *aggr_header_std[] = { [AGGR_CORE ] ="core" , [AGGR_CACHE ] ="cache" , + [AGGR_CLUSTER ] ="cluster" , [AGGR_DIE ] ="die" , [AGGR_SOCKET ] ="socket" , [AGGR_NONE ] ="cpu" ,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 362/809 media: venus: flush all buffers in output plane streamoff
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dikshita Agarwal <[email protected]>
[ Upstream commit e750a4b1224142bd8dd057b0d5adf8a5608b7e77 ]
For scenarios, when source change is followed by VIDIOC_STREAMOFF on output plane, driver should discard any queued OUTPUT buffers, which are not decoded or dequeued.
Flush with HFI_FLUSH_INPUT does not have any actual impact. So, fix it, by invoking HFI_FLUSH_ALL, which will flush all queued buffers.
--- drivers/media/platform/qcom/venus/vdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/vdec.c +1 -1
@@ -1255,7 +1255,7 @@ static int vdec_stop_output(struct venus_inst *inst)break ;case VENUS_DEC_STATE_INIT :case VENUS_DEC_STATE_CAPTURE_SETUP : - ret =hfi_session_flush (inst,HFI_FLUSH_INPUT , true); + ret =hfi_session_flush (inst,HFI_FLUSH_ALL , true);break ;default :break ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 363/809 perf intel-pt: Fix aux_watermark calculation for 64-bit size
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
[ Upstream commit 36b4cd990a8fd3f5b748883050e9d8c69fe6398d ]
aux_watermark is a u32. For a 64-bit size, cap the aux_watermark calculation at UINT_MAX instead of truncating it to 32-bits.
--- tools/perf/arch/x86/util/intel-pt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/arch/x86/util/intel-pt.c +2 -1
@@ -758,7 +758,8 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, }if (!opts->auxtrace_snapshot_mode && !opts->auxtrace_sample_mode) { -u32 aux_watermark = opts->auxtrace_mmap_pages * page_size /4 ; +size_t aw = opts->auxtrace_mmap_pages * (size_t )page_size /4 ; +u32 aux_watermark = aw >UINT_MAX ?UINT_MAX : aw; intel_pt_evsel->core.attr.aux_watermark = aux_watermark; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 364/809 perf intel-pt: Fix exclude_guest setting
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
[ Upstream commit b40934ae32232140e85dc7dc1c3ea0e296986723 ]
In the past, the exclude_guest setting has had no effect on Intel PT tracing, but that may not be the case in the future.
Set the flag correctly based upon whether KVM is using Intel PT "Host/Guest" mode, which is determined by the kvm_intel module parameter pt_mode:
pt_mode=0 System-wide mode : host and guest output to host buffer
pt_mode=1 Host/Guest mode : host/guest output to host/guest
buffers respectively
--- tools/perf/arch/x86/util/intel-pt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tools/perf/arch/x86/util/intel-pt.c +12 -0
@@ -32,6 +32,7 @@#include "../../../util/tsc.h" #include <internal/lib.h> // page_size #include "../../../util/intel-pt.h" +#include <api/fs/fs.h> #define KiB (x) ((x) * 1024)#define MiB (x) ((x) * 1024 * 1024)
@@ -428,6 +429,16 @@ static int intel_pt_track_switches(struct evlist *evlist) }#endif +static bool intel_pt_exclude_guest (void ) +{ +int pt_mode; + +if (sysfs__read_int ("module/kvm_intel/parameters/pt_mode" , &pt_mode)) + pt_mode =0 ; + +return pt_mode ==1 ; +} +static void intel_pt_valid_str (char *str,size_t len,u64 valid) {unsigned int val, last =0 , state =1 ;
@@ -620,6 +631,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, } evsel->core.attr.freq =0 ; evsel->core.attr.sample_period =1 ; + evsel->core.attr.exclude_guest =intel_pt_exclude_guest (); evsel->no_aux_samples = true; evsel->needs_auxtrace_mmap = true; intel_pt_evsel = evsel;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 365/809 drm/panthor: Record devfreq busy as soon as a job is started
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Price <[email protected]>
[ Upstream commit 896868eded124059023be0af92d68cdaf9b4de70 ]
If a queue is already assigned to the hardware, then a newly submitted job can start straight away without waiting for the tick. However in this case the devfreq infrastructure isn't notified that the GPU is busy. By the time the tick happens the job might well have finished and no time will be accounted for the GPU being busy.
Fix this by recording the GPU as busy directly in queue_run_job() in the case where there is a CSG assigned and therefore we just ring the doorbell.
--- drivers/gpu/drm/panthor/panthor_sched.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/panthor/panthor_sched.c +1 -0
@@ -2939,6 +2939,7 @@ queue_run_job(struct drm_sched_job *sched_job)pm_runtime_get (ptdev->base.dev); sched->pm.has_ref = true; } +panthor_devfreq_record_busy (sched->ptdev); }/* Update the last fence. */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 366/809 mfd: rsmu: Split core code into separate module
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit c879a8c39dd55e7fabdd8d13341f7bc5200db377 ]
Linking a file into two modules can have unintended side-effects and produces a W=1 warning:
scripts/Makefile.build:236: drivers/mfd/Makefile: rsmu_core.o is added to multiple modules: rsmu-i2c rsmu-spi
Make this one a separate module instead.
--- drivers/mfd/Makefile | 6 ++---- drivers/mfd/rsmu_core.c | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/Makefile +2 -4
@@ -280,7 +280,5 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI) += intel-m10-bmc-pmci.o obj-$(CONFIG_MFD_ATC260X) += atc260x-core.o obj-$(CONFIG_MFD_ATC260X_I2C) += atc260x-i2c.o -rsmu-i2c-objs := rsmu_core.o rsmu_i2c.o -rsmu-spi-objs := rsmu_core.o rsmu_spi.o -obj-$(CONFIG_MFD_RSMU_I2C) += rsmu-i2c.o -obj-$(CONFIG_MFD_RSMU_SPI) += rsmu-spi.o +obj-$(CONFIG_MFD_RSMU_I2C) += rsmu_i2c.o rsmu_core.o +obj-$(CONFIG_MFD_RSMU_SPI) += rsmu_spi.o rsmu_core.o
drivers/mfd/rsmu_core.c +2 -0
@@ -78,11 +78,13 @@ int rsmu_core_init(struct rsmu_ddata *rsmu)return ret; } +EXPORT_SYMBOL_GPL (rsmu_core_init);void rsmu_core_exit (struct rsmu_ddata *rsmu) {mutex_destroy (&rsmu->lock); } +EXPORT_SYMBOL_GPL (rsmu_core_exit);MODULE_DESCRIPTION ("Renesas SMU core driver" );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 367/809 mfd: omap-usb-tll: Use struct_size to allocate tll
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <[email protected]>
[ Upstream commit 40176714c818b0b6a2ca8213cdb7654fbd49b742 ]
Commit 16c2004d9e4d ("mfd: omap-usb-tll: Allocate driver data at once") changed the memory allocation of 'tll' to consolidate it into a single allocation, introducing an incorrect size calculation.
In particular, the allocation for the array of pointers was converted into a single-pointer allocation.
The memory allocation used to occur in two steps:
tll = devm_kzalloc(dev, sizeof(struct usbtll_omap), GFP_KERNEL); tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch,
GFP_KERNEL);
And it turned that into the following allocation:
tll = devm_kzalloc(dev, sizeof(*tll) + sizeof(tll->ch_clk[nch]),
GFP_KERNEL);
sizeof(tll->ch_clk[nch]) returns the size of a single pointer instead of the expected nch pointers.
This bug went unnoticed because the allocation size was small enough to fit within the minimum size of a memory allocation for this particular case [1].
The complete allocation can still be done at once with the struct_size macro, which comes in handy for structures with a trailing flexible array.
Fix the memory allocation to obtain the original size again.
--- drivers/mfd/omap-usb-tll.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mfd/omap-usb-tll.c +1 -2
@@ -230,8 +230,7 @@ static int usbtll_omap_probe(struct platform_device *pdev)break ; } - tll =devm_kzalloc (dev,sizeof (*tll) +sizeof (tll->ch_clk[nch]), -GFP_KERNEL ); + tll =devm_kzalloc (dev,struct_size (tll, ch_clk, nch),GFP_KERNEL );if (!tll) {pm_runtime_put_sync (dev);pm_runtime_disable (dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 368/809 xprtrdma: Fix rpcrdma_reqs_reset()
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
[ Upstream commit acd9f2dd23c632568156217aac7a05f5a0313152 ]
Avoid FastReg operations getting MW_BIND_ERR after a reconnect.
rpcrdma_reqs_reset() is called on transport tear-down to get each rpcrdma_req back into a clean state.
MRs on req->rl_registered are waiting for a FastReg, are already registered, or are waiting for invalidation. If the transport is being torn down when reqs_reset() is called, the matching LocalInv might never be posted. That leaves these MR registered /and/ on req->rl_free_mrs, where they can be re-used for the next connection.
Since xprtrdma does not keep specific track of the MR state, it's not possible to know what state these MRs are in, so the only safe thing to do is release them immediately.
--- net/sunrpc/xprtrdma/frwr_ops.c | 3 ++- net/sunrpc/xprtrdma/verbs.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-)
net/sunrpc/xprtrdma/frwr_ops.c +2 -1
@@ -92,7 +92,8 @@ static void frwr_mr_put(struct rpcrdma_mr *mr)rpcrdma_mr_push (mr, &mr->mr_req->rl_free_mrs); } -/* frwr_reset - Place MRs back on the free list +/** +* frwr_reset - Place MRs back on @req's free list * @req: request to reset * * Used after a failed marshal. For FRWR, this means the MRs
net/sunrpc/xprtrdma/verbs.c +15 -1
@@ -897,6 +897,8 @@ static int rpcrdma_reqs_setup(struct rpcrdma_xprt *r_xprt)static void rpcrdma_req_reset (struct rpcrdma_req *req) { +struct rpcrdma_mr *mr; +/* Credits are valid for only one connection */ req->rl_slot.rq_cong =0 ;
@@ -906,7 +908,19 @@ static void rpcrdma_req_reset(struct rpcrdma_req *req)rpcrdma_regbuf_dma_unmap (req->rl_sendbuf);rpcrdma_regbuf_dma_unmap (req->rl_recvbuf); -frwr_reset (req); +/* The verbs consumer can't know the state of an MR on the +* req->rl_registered list unless a successful completion +* has occurred, so they cannot be re-used. +*/ +while ((mr =rpcrdma_mr_pop (&req->rl_registered))) { +struct rpcrdma_buffer *buf = &mr->mr_xprt->rx_buf; + +spin_lock (&buf->rb_lock); +list_del (&mr->mr_all); +spin_unlock (&buf->rb_lock); + +frwr_mr_release (mr); + } }/* ASSUMPTION: the rb_allreqs list is stable for the duration,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 369/809 SUNRPC: avoid soft lockup when transmitting UDP to reachable server.
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
[ Upstream commit 6258cf25d5e3155c3219ab5a79b970eef7996356 ]
Prior to the commit identified below, call_transmit_status() would handle -EPERM and other errors related to an unreachable server by falling through to call_status() which added a 3-second delay and handled the failure as a timeout.
Since that commit, call_transmit_status() falls through to handle_bind(). For UDP this moves straight on to handle_connect() and handle_transmit() so we immediately retransmit - and likely get the same error.
This results in an indefinite loop in __rpc_execute() which triggers a soft-lockup warning.
For the errors that indicate an unreachable server, call_transmit_status() should fall back to call_status() as it did before. This cannot cause the thundering herd that the previous patch was avoiding, as the call_status() will insert a delay.
--- net/sunrpc/clnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sunrpc/clnt.c +2 -1
@@ -2326,12 +2326,13 @@ call_transmit_status(struct rpc_task *task) task->tk_action = call_transmit; task->tk_status =0 ;break ; -case -ECONNREFUSED :case -EHOSTDOWN :case -ENETDOWN :case -EHOSTUNREACH :case -ENETUNREACH :case -EPERM : +break ; +case -ECONNREFUSED :if (RPC_IS_SOFTCONN (task)) {if (!task->tk_msg.rpc_proc->p_proc) trace_xprt_ping(task->tk_xprt,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 370/809 NFSv4.1 another fix for EXCHGID4_FLAG_USE_PNFS_DS for DS server
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olga Kornievskaia <[email protected]>
[ Upstream commit 4840c00003a2275668a13b82c9f5b1aed80183aa ]
Previously in order to mark the communication with the DS server, we tried to use NFS_CS_DS in cl_flags. However, this flag would only be saved for the DS server and in case where DS equals MDS, the client would not find a matching nfs_client in nfs_match_client that represents the MDS (but is also a DS).
Instead, don't rely on the NFS_CS_DS but instead use NFS_CS_PNFS.
--- fs/nfs/nfs4client.c | 6 ++---- fs/nfs/nfs4proc.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
fs/nfs/nfs4client.c +2 -4
@@ -231,9 +231,8 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)__set_bit (NFS_CS_INFINITE_SLOTS , &clp->cl_flags);__set_bit (NFS_CS_DISCRTRY , &clp->cl_flags);__set_bit (NFS_CS_NO_RETRANS_TIMEOUT , &clp->cl_flags); - -if (test_bit (NFS_CS_DS , &cl_init->init_flags)) -__set_bit (NFS_CS_DS , &clp->cl_flags); +if (test_bit (NFS_CS_PNFS , &cl_init->init_flags)) +__set_bit (NFS_CS_PNFS , &clp->cl_flags);/* * Set up the connection to the server before we add add to the * global list.
@@ -1013,7 +1012,6 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,if (mds_srv->flags &NFS_MOUNT_NORESVPORT )__set_bit (NFS_CS_NORESVPORT , &cl_init.init_flags); -__set_bit (NFS_CS_DS , &cl_init.init_flags);__set_bit (NFS_CS_PNFS , &cl_init.init_flags); cl_init.max_connect =NFS_MAX_TRANSPORTS ;/*
fs/nfs/nfs4proc.c +1 -1
@@ -8840,7 +8840,7 @@ nfs4_run_exchange_id(struct nfs_client *clp, const struct cred *cred,#ifdef CONFIG_NFS_V4_1_MIGRATION calldata->args.flags |=EXCHGID4_FLAG_SUPP_MOVED_MIGR ;#endif -if (test_bit (NFS_CS_DS , &clp->cl_flags)) +if (test_bit (NFS_CS_PNFS , &clp->cl_flags)) calldata->args.flags |=EXCHGID4_FLAG_USE_PNFS_DS ; msg.rpc_argp = &calldata->args; msg.rpc_resp = &calldata->res;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 371/809 ext4: dont track ranges in fast_commit if inode has inlined data
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luis Henriques (SUSE) <[email protected]>
[ Upstream commit 7882b0187bbeb647967a7b5998ce4ad26ef68a9a ]
When fast-commit needs to track ranges, it has to handle inodes that have inlined data in a different way because ext4_fc_write_inode_data(), in the actual commit path, will attempt to map the required blocks for the range. However, inodes that have inlined data will have it's data stored in inode->i_block and, eventually, in the extended attribute space.
Unfortunately, because fast commit doesn't currently support extended attributes, the solution is to mark this commit as ineligible.
--- fs/ext4/fast_commit.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/ext4/fast_commit.c +6 -0
@@ -649,6 +649,12 @@ void ext4_fc_track_range(handle_t *handle, struct inode *inode, ext4_lblk_t starif (ext4_test_mount_flag (inode->i_sb,EXT4_MF_FC_INELIGIBLE ))return ; +if (ext4_has_inline_data (inode)) { +ext4_fc_mark_ineligible (inode->i_sb,EXT4_FC_REASON_XATTR , + handle); +return ; + } + args.start = start; args.end = end;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 372/809 ext4: avoid writing unitialized memory to disk in EA inodes
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
[ Upstream commit 65121eff3e4c8c90f8126debf3c369228691c591 ]
If the extended attribute size is not a multiple of block size, the last block in the EA inode will have uninitialized tail which will get written to disk. We will never expose the data to userspace but still this is not a good practice so just zero out the tail of the block as it isn't going to cause a noticeable performance overhead.
--- fs/ext4/xattr.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/ext4/xattr.c +6 -0
@@ -1433,6 +1433,12 @@ static int ext4_xattr_inode_write(handle_t *handle, struct inode *ea_inode, goto out;memcpy (bh->b_data, buf, csize); +/* +* Zero out block tail to avoid writing uninitialized memory +* to disk. +*/ +if (csize < blocksize) +memset (bh->b_data + csize,0 , blocksize - csize);set_buffer_uptodate (bh);ext4_handle_dirty_metadata (handle, ea_inode, bh);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 373/809 drm/qxl: Pin buffer objects for internal mappings
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit c537fb4e3d36e7cd1a0837dd577cd30d3d64f1bc ]
Add qxl_bo_pin_and_vmap() that pins and vmaps a buffer object in one step. Update callers of the regular qxl_bo_vmap(). Fixes a bug where qxl accesses an unpinned buffer object while it is being moved; such as with the monitor-description BO. An typical error is shown below.
[ 4.303586] [drm:drm_atomic_helper_commit_planes] *ERROR* head 1 wrong: 65376256x16777216+0+0 [ 4.586883] [drm:drm_atomic_helper_commit_planes] *ERROR* head 1 wrong: 65376256x16777216+0+0 [ 4.904036] [drm:drm_atomic_helper_commit_planes] *ERROR* head 1 wrong: 65335296x16777216+0+0 [ 5.374347] [drm:qxl_release_from_id_locked] *ERROR* failed to find id in release_idr
Commit b33651a5c98d ("drm/qxl: Do not pin buffer objects for vmap") removed the implicit pin operation from qxl's vmap code. This is the correct behavior for GEM and PRIME interfaces, but the pin is still needed for qxl internal operation.
Also add a corresponding function qxl_bo_vunmap_and_unpin() and remove the old qxl_bo_vmap() helpers.
Future directions: BOs should not be pinned or vmapped unnecessarily. The pin-and-vmap operation should be removed from the driver and a temporary mapping should be established with a vmap_local-like helper. See the client helper drm_client_buffer_vmap_local() for semantics.
v2:
- unreserve BO on errors in qxl_bo_pin_and_vmap() (Dmitry)
--- drivers/gpu/drm/qxl/qxl_display.c | 14 +++++++------- drivers/gpu/drm/qxl/qxl_object.c | 13 +++++++++++-- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- 3 files changed, 20 insertions(+), 11 deletions(-)
drivers/gpu/drm/qxl/qxl_display.c +7 -7
@@ -584,11 +584,11 @@ static struct qxl_bo *qxl_create_cursor(struct qxl_device *qdev,if (ret) goto err; - ret =qxl_bo_vmap (cursor_bo, &cursor_map); + ret =qxl_bo_pin_and_vmap (cursor_bo, &cursor_map);if (ret) goto err_unref; - ret =qxl_bo_vmap (user_bo, &user_map); + ret =qxl_bo_pin_and_vmap (user_bo, &user_map);if (ret) goto err_unmap;
@@ -614,12 +614,12 @@ static struct qxl_bo *qxl_create_cursor(struct qxl_device *qdev, user_map.vaddr, size); } -qxl_bo_vunmap (user_bo); -qxl_bo_vunmap (cursor_bo); +qxl_bo_vunmap_and_unpin (user_bo); +qxl_bo_vunmap_and_unpin (cursor_bo);return cursor_bo; err_unmap: -qxl_bo_vunmap (cursor_bo); +qxl_bo_vunmap_and_unpin (cursor_bo); err_unref:qxl_bo_unpin (cursor_bo);qxl_bo_unref (&cursor_bo);
@@ -1205,7 +1205,7 @@ int qxl_create_monitors_object(struct qxl_device *qdev) } qdev->monitors_config_bo =gem_to_qxl_bo (gobj); - ret =qxl_bo_vmap (qdev->monitors_config_bo, &map); + ret =qxl_bo_pin_and_vmap (qdev->monitors_config_bo, &map);if (ret)return ret;
@@ -1236,7 +1236,7 @@ int qxl_destroy_monitors_object(struct qxl_device *qdev) qdev->monitors_config =NULL ; qdev->ram_header->monitors_config =0 ; - ret =qxl_bo_vunmap (qdev->monitors_config_bo); + ret =qxl_bo_vunmap_and_unpin (qdev->monitors_config_bo);if (ret)return ret;
drivers/gpu/drm/qxl/qxl_object.c +11 -2
@@ -182,7 +182,7 @@ int qxl_bo_vmap_locked(struct qxl_bo *bo, struct iosys_map *map)return 0 ; } -int qxl_bo_vmap (struct qxl_bo *bo,struct iosys_map *map) +int qxl_bo_pin_and_vmap (struct qxl_bo *bo,struct iosys_map *map) {int r;
@@ -190,7 +190,15 @@ int qxl_bo_vmap(struct qxl_bo *bo, struct iosys_map *map)if (r)return r; + r =qxl_bo_pin_locked (bo); +if (r) { +qxl_bo_unreserve (bo); +return r; + } + r =qxl_bo_vmap_locked (bo, map); +if (r) +qxl_bo_unpin_locked (bo);qxl_bo_unreserve (bo);return r; }
@@ -241,7 +249,7 @@ void qxl_bo_vunmap_locked(struct qxl_bo *bo)ttm_bo_vunmap (&bo->tbo, &bo->map); } -int qxl_bo_vunmap (struct qxl_bo *bo) +int qxl_bo_vunmap_and_unpin (struct qxl_bo *bo) {int r;
@@ -250,6 +258,7 @@ int qxl_bo_vunmap(struct qxl_bo *bo)return r;qxl_bo_vunmap_locked (bo); +qxl_bo_unpin_locked (bo);qxl_bo_unreserve (bo);return 0 ; }
drivers/gpu/drm/qxl/qxl_object.h +2 -2
@@ -59,9 +59,9 @@ extern int qxl_bo_create(struct qxl_device *qdev,u32 priority, struct qxl_surface *surf, struct qxl_bo **bo_ptr); -int qxl_bo_vmap (struct qxl_bo *bo,struct iosys_map *map); +int qxl_bo_pin_and_vmap (struct qxl_bo *bo,struct iosys_map *map);int qxl_bo_vmap_locked (struct qxl_bo *bo,struct iosys_map *map); -int qxl_bo_vunmap (struct qxl_bo *bo); +int qxl_bo_vunmap_and_unpin (struct qxl_bo *bo);void qxl_bo_vunmap_locked (struct qxl_bo *bo);void *qxl_bo_kmap_atomic_page (struct qxl_device *qdev,struct qxl_bo *bo,int page_offset);void qxl_bo_kunmap_atomic_page (struct qxl_device *qdev,struct qxl_bo *bo,void *map);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 374/809 leds: flash: leds-qcom-flash: Test the correct variable in init
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 87e552ad654554be73e62dd43c923bcee215287d ]
This code was passing the incorrect pointer to PTR_ERR_OR_ZERO() so it always returned success. It should have been checking the array element instead of the array itself.
--- drivers/leds/flash/leds-qcom-flash.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/leds/flash/leds-qcom-flash.c +7 -3
@@ -505,6 +505,7 @@ qcom_flash_v4l2_init(struct device *dev, struct qcom_flash_led *led, struct fwnostruct qcom_flash_data *flash_data = led->flash_data;struct v4l2_flash_config v4l2_cfg = {0 };struct led_flash_setting *intensity = &v4l2_cfg.intensity; +struct v4l2_flash *v4l2_flash;if (!(led->flash.led_cdev.flags &LED_DEV_CAP_FLASH ))return 0 ;
@@ -523,9 +524,12 @@ qcom_flash_v4l2_init(struct device *dev, struct qcom_flash_led *led, struct fwnoLED_FAULT_OVER_TEMPERATURE |LED_FAULT_TIMEOUT ; - flash_data->v4l2_flash[flash_data->leds_count] = -v4l2_flash_init (dev, fwnode, &led->flash, &qcom_v4l2_flash_ops, &v4l2_cfg); -return PTR_ERR_OR_ZERO (flash_data->v4l2_flash); + v4l2_flash =v4l2_flash_init (dev, fwnode, &led->flash, &qcom_v4l2_flash_ops, &v4l2_cfg); +if (IS_ERR (v4l2_flash)) +return PTR_ERR (v4l2_flash); + + flash_data->v4l2_flash[flash_data->leds_count] = v4l2_flash; +return 0 ; }# else static int
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 375/809 sparc64: Fix incorrect function signature and add prototype for prom_cif_init
In reply to Greg Kroah-Hartman6.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Larsson <[email protected]>
[ Upstream commit a6c3ea1ec96307dbfbb2f16d96c674c5cc80f445 ]
Remove the unused cif_stack argument and add a protype in oplib_64.h Commit ef3e035c3a9b ("sparc64: Fix register corruption in top-most kernel stack frame during boot.") removed the cif_stack argument to prom_cif init in the declaration at the caller site and the usage of it within prom_cif_init, but not in the function signature of the function itself.
This also fixes the following warning:arch/sparc/prom/p1275.c:52:6: warning: no previous prototype for ‘prom_cif_init’
--- arch/sparc/include/asm/oplib_64.h | 1 + arch/sparc/prom/init_64.c | 3 --- arch/sparc/prom/p1275.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-)
arch/sparc/include/asm/oplib_64.h +1 -0
@@ -247,6 +247,7 @@ void prom_sun4v_guest_soft_state(void);int prom_ihandle2path (int handle,char *buffer,int bufsize);/* Client interface level routines. */ +void prom_cif_init (void *cif_handler);void p1275_cmd_direct (unsigned long *);#endif /* !(__SPARC64_OPLIB_H) */
arch/sparc/prom/init_64.c +0 -3
@@ -26,9 +26,6 @@ phandle prom_chosen_node;* routines in the prom library. * It gets passed the pointer to the PROM vector. */ - -extern void prom_cif_init (void *); -void __init prom_init (void *cif_handler) {phandle node;
arch/sparc/prom/p1275.c +1 -1
@@ -49,7 +49,7 @@ void p1275_cmd_direct(unsigned long *args)local_irq_restore (flags); } -void prom_cif_init (void *cif_handler,void *cif_stack) +void prom_cif_init (void *cif_handler) { p1275buf.prom_cif_handler = (void (*)(long *))cif_handler; }
Signature · 1 line
2.43.0