ARM: OMAP2+: hwmod: Add of_node_put() before break
Subsystems (22)
Sasha Levin
maintainerPATCH 23/33 soc: aspeed: lpc-ctrl: Block error printing on probe defer cases
In reply to Sasha LevinFrom: Jae Hyun Yoo <[email protected]>
[ Upstream commit 301a5d3ad2432d7829f59432ca0a93a6defbb9a1 ]
Add a checking code when it gets -EPROBE_DEFER while getting a clock resource. In this case, it doesn't need to print out an error message because the probing will be re-visited.
--- drivers/soc/aspeed/aspeed-lpc-ctrl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/soc/aspeed/aspeed-lpc-ctrl.c +3 -4
@@ -306,10 +306,9 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev) } lpc_ctrl->clk =devm_clk_get (dev,NULL ); -if (IS_ERR (lpc_ctrl->clk)) { -dev_err (dev,"couldn't get clock\n" ); -return PTR_ERR (lpc_ctrl->clk); - } +if (IS_ERR (lpc_ctrl->clk)) +return dev_err_probe (dev,PTR_ERR (lpc_ctrl->clk), +"couldn't get clock\n" ); rc =clk_prepare_enable (lpc_ctrl->clk);if (rc) {dev_err (dev,"couldn't enable clock\n" );
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 4/33 staging: vc04_services: Fix RCU dereference check
In reply to Sasha LevinFrom: Padmanabha Srinivasaiah <[email protected]>
[ Upstream commit 0cea730cac824edf78ffd3302938ed5fe2b9d50d ]
In service_callback path RCU dereferenced pointer struct vchiq_service need to be accessed inside rcu read-critical section.
Also userdata/user_service part of vchiq_service is accessed around different synchronization mechanism, getting an extra reference to a pointer keeps sematics simpler and avoids prolonged graceperiod.
Accessing vchiq_service with rcu_read_[lock/unlock] fixes below issue.
[ 32.201659] ============================= [ 32.201664] WARNING: suspicious RCU usage [ 32.201670] 5.15.11-rt24-v8+ #3 Not tainted [ 32.201680] ----------------------------- [ 32.201685] drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h:529 suspicious rcu_dereference_check() usage! [ 32.201695] [ 32.201695] other info that might help us debug this: [ 32.201695] [ 32.201700] [ 32.201700] rcu_scheduler_active = 2, debug_locks = 1 [ 32.201708] no locks held by vchiq-slot/0/98. [ 32.201715] [ 32.201715] stack backtrace: [ 32.201723] CPU: 1 PID: 98 Comm: vchiq-slot/0 Not tainted 5.15.11-rt24-v8+ #3 [ 32.201733] Hardware name: Raspberry Pi 4 Model B Rev 1.4 (DT) [ 32.201739] Call trace: [ 32.201742] dump_backtrace+0x0/0x1b8 [ 32.201772] show_stack+0x20/0x30 [ 32.201784] dump_stack_lvl+0x8c/0xb8 [ 32.201799] dump_stack+0x18/0x34 [ 32.201808] lockdep_rcu_suspicious+0xe4/0xf8 [ 32.201817] service_callback+0x124/0x400 [ 32.201830] slot_handler_func+0xf60/0x1e20 [ 32.201839] kthread+0x19c/0x1a8 [ 32.201849] ret_from_fork+0x10/0x20
--- .../interface/vchiq_arm/vchiq_arm.c | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +18 -2
@@ -1033,15 +1033,27 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header,DEBUG_TRACE (SERVICE_CALLBACK_LINE ); +rcu_read_lock (); service =handle_to_service (handle); -if (WARN_ON (!service)) +if (WARN_ON (!service)) { +rcu_read_unlock ();return VCHIQ_SUCCESS ; + } user_service = (struct user_service *)service->base.userdata; instance = user_service->instance; -if (!instance || instance->closing) +if (!instance || instance->closing) { +rcu_read_unlock ();return VCHIQ_SUCCESS ; + } + +/* +* As hopping around different synchronization mechanism, +* taking an extra reference results in simpler implementation. +*/ +vchiq_service_get (service); +rcu_read_unlock (); vchiq_log_trace(vchiq_arm_log_level, "%s - service %lx(%d,%p), reason %d, header %lx, instance %lx, bulk_userdata %lx",
@@ -1074,6 +1086,7 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header, NULL, user_service, bulk_userdata);if (status !=VCHIQ_SUCCESS ) {DEBUG_TRACE (SERVICE_CALLBACK_LINE ); +vchiq_service_put (service);return status; } }
@@ -1084,11 +1097,13 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header,vchiq_log_info (vchiq_arm_log_level,"%s interrupted" , __func__);DEBUG_TRACE (SERVICE_CALLBACK_LINE ); +vchiq_service_put (service);return VCHIQ_RETRY ; }else if (instance->closing) {vchiq_log_info (vchiq_arm_log_level,"%s closing" , __func__);DEBUG_TRACE (SERVICE_CALLBACK_LINE ); +vchiq_service_put (service);return VCHIQ_ERROR ; }DEBUG_TRACE (SERVICE_CALLBACK_LINE );
@@ -1117,6 +1132,7 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header, header =NULL ; }DEBUG_TRACE (SERVICE_CALLBACK_LINE ); +vchiq_service_put (service);if (skip_completion)return VCHIQ_SUCCESS ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 16/33 selftests: fixup build warnings in pidfd / clone3 tests
In reply to Sasha LevinFrom: Axel Rasmussen <[email protected]>
[ Upstream commit e2aa5e650b07693477dff554053605976789fd68 ]
These are some trivial fixups, which were needed to build the tests with clang and -Werror. The following issues are fixed:
- Remove various unused variables.
- In child_poll_leader_exit_test, clang isn't smart enough to realize syscall(SYS_exit, 0) won't return, so it complains we never return from a non-void function. Add an extra exit(0) to appease it.
- In test_pidfd_poll_leader_exit, ret may be branched on despite being uninitialized, if we have !use_waitpid. Initialize it to zero to get the right behavior in that case.
--- tools/testing/selftests/clone3/clone3.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 6 +++--- tools/testing/selftests/pidfd/pidfd_wait.c | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-)
tools/testing/selftests/clone3/clone3.c +0 -2
@@ -126,8 +126,6 @@ static void test_clone3(uint64_t flags, size_t size, int expected,int main (int argc,char *argv[]) { -pid_t pid; -uid_t uid =getuid ();ksft_print_header ();
tools/testing/selftests/pidfd/pidfd_test.c +3 -3
@@ -441,7 +441,6 @@ static void test_pidfd_poll_exec(int use_waitpid) {int pid, pidfd =0 ;int status, ret; -pthread_t t1;time_t prog_start =time (NULL );const char *test_name ="pidfd_poll check for premature notification on child thread exec" ;
@@ -500,13 +499,14 @@ static int child_poll_leader_exit_test(void *args)*/ *child_exit_secs =time (NULL );syscall (SYS_exit,0 ); +/* Never reached, but appeases compiler thinking we should return. */ +exit (0 ); }static void test_pidfd_poll_leader_exit (int use_waitpid) {int pid, pidfd =0 ; -int status, ret; -time_t prog_start =time (NULL ); +int status, ret =0 ;const char *test_name ="pidfd_poll check for premature notification on non-empty" "group leader exit" ;
tools/testing/selftests/pidfd/pidfd_wait.c +2 -3
@@ -39,7 +39,7 @@ static int sys_waitid(int which, pid_t pid, siginfo_t *info, int options,TEST (wait_simple) { -int pidfd =-1 , status =0 ; +int pidfd =-1 ;pid_t parent_tid =-1 ;struct clone_args args = { .parent_tid =ptr_to_u64 (&parent_tid),
@@ -47,7 +47,6 @@ TEST(wait_simple) .flags = CLONE_PIDFD | CLONE_PARENT_SETTID, .exit_signal = SIGCHLD, }; -int ret;pid_t pid;siginfo_t info = { .si_signo =0 ,
@@ -88,7 +87,7 @@ TEST(wait_simple)TEST (wait_states) { -int pidfd =-1 , status =0 ; +int pidfd =-1 ;pid_t parent_tid =-1 ;struct clone_args args = { .parent_tid =ptr_to_u64 (&parent_tid),
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 25/33 drm/rockchip: dw_hdmi: Do not leave clock enabled in error case
In reply to Sasha LevinFrom: Sascha Hauer <[email protected]>
[ Upstream commit c0cfbb122275da1b726481de5a8cffeb24e6322b ]
The driver returns an error when devm_phy_optional_get() fails leaving the previously enabled clock turned on. Change order and enable the clock only after the phy has been acquired.
--- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +7 -7
@@ -529,13 +529,6 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,return ret; } - ret =clk_prepare_enable (hdmi->vpll_clk); -if (ret) { -DRM_DEV_ERROR (hdmi->dev,"Failed to enable HDMI vpll: %d\n" , - ret); -return ret; - } - hdmi->phy =devm_phy_optional_get (dev,"hdmi" );if (IS_ERR (hdmi->phy)) { ret =PTR_ERR (hdmi->phy);
@@ -544,6 +537,13 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,return ret; } + ret =clk_prepare_enable (hdmi->vpll_clk); +if (ret) { +DRM_DEV_ERROR (hdmi->dev,"Failed to enable HDMI vpll: %d\n" , + ret); +return ret; + } +drm_encoder_helper_add (encoder, &dw_hdmi_rockchip_encoder_helper_funcs);drm_simple_encoder_init (drm, encoder,DRM_MODE_ENCODER_TMDS );
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 28/33 display/amd: decrease message verbosity about watermarks table failure
In reply to Sasha LevinFrom: Mario Limonciello <[email protected]>
[ Upstream commit 03ad3093c7c069d6ab4403730009ebafeea9ee37 ]
A number of BIOS versions have a problem with the watermarks table not being configured properly. This manifests as a very scary looking warning during resume from s0i3. This should be harmless in most cases and is well understood, so decrease the assertion to a clearer warning about the problem.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c +5 -1
@@ -120,7 +120,11 @@ int dcn31_smu_send_msg_with_param( result =dcn31_smu_wait_for_response (clk_mgr,10 ,200000 );if (result == VBIOSSMC_Result_Failed) { -ASSERT (0 ); +if (msg_id == VBIOSSMC_MSG_TransferTableDram2Smu && + param ==TABLE_WATERMARKS ) +DC_LOG_WARNING ("Watermarks table not configured properly by SMU" ); +else +ASSERT (0 );REG_WRITE (MP1_SMN_C2PMSG_91 , VBIOSSMC_Result_OK);return -1 ; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 29/33 drm/amd/display: Cap pflip irqs per max otg number
In reply to Sasha LevinFrom: Roman Li <[email protected]>
[ Upstream commit 328e34a5ad227399391891d454043e5d73e598d2 ]
[Why]
pflip interrupt order are mapped 1 to 1 to otg id.
e.g. if irq_src=26 corresponds to otg0 then 27->otg1, 28->otg2...
Linux DM registers pflip interrupts per number of crtcs. In fused pipe case crtc numbers can be less than otg id.
e.g. if one pipe out of 3(otg#0-2) is fused adev->mode_info.num_crtc=2 so DM only registers irq_src 26,27.
This is a bug since if pipe#2 remains unfused DM never gets otg2 pflip interrupt (irq_src=28)
That may results in gfx failure due to pflip timeout.
[How]
Register pflip interrupts per max num of otg instead of num_crtc
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -3230,7 +3230,7 @@ static int dcn10_register_irq_handlers(struct amdgpu_device *adev)/* Use GRPH_PFLIP interrupt */ for (i =DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT ; - i <=DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT + adev->mode_info.num_crtc -1 ; + i <=DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT + dc->caps.max_otg_num -1 ; i++) { r =amdgpu_irq_add_id (adev,SOC15_IH_CLIENTID_DCE , i, &adev->pageflip_irq);if (r) {
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -0
@@ -1118,6 +1118,8 @@ struct dc *dc_create(const struct dc_init_data *init_params) dc->caps.max_dp_protocol_version =DP_VERSION_1_4 ; + dc->caps.max_otg_num = dc->res_pool->res_cap->num_timing_generator; +if (dc->res_pool->dmcu !=NULL ) dc->versions.dmcu_version = dc->res_pool->dmcu->dmcu_version; }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -185,6 +185,7 @@ struct dc_caps {struct dc_color_caps color;bool vbios_lttpr_aware;bool vbios_lttpr_enable; +uint32_t max_otg_num; };struct dc_bug_wa {
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 30/33 drm/amd/display: fix yellow carp wm clamping
In reply to Sasha LevinFrom: Dmytro Laktyushkin <[email protected]>
[ Upstream commit 60fdf98a774eee244a4e00c34a9e7729b61d0f44 ]
Fix clamping to match register field size
--- .../drm/amd/display/dc/dcn31/dcn31_hubbub.c | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c +32 -29
@@ -138,8 +138,11 @@ static uint32_t convert_and_clamp( ret_val = wm_ns * refclk_mhz; ret_val /=1000 ; -if (ret_val > clamp_value) +if (ret_val > clamp_value) { +/* clamping WMs is abnormal, unexpected and may lead to underflow*/ +ASSERT (0 ); ret_val = clamp_value; + }return ret_val; }
@@ -159,7 +162,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->a.urgent_ns > hubbub2->watermarks.a.urgent_ns) { hubbub2->watermarks.a.urgent_ns = watermarks->a.urgent_ns; prog_wm_value =convert_and_clamp (watermarks->a.urgent_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A ,0 ,DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A , prog_wm_value);
@@ -193,7 +196,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->a.urgent_latency_ns > hubbub2->watermarks.a.urgent_latency_ns) { hubbub2->watermarks.a.urgent_latency_ns = watermarks->a.urgent_latency_ns; prog_wm_value =convert_and_clamp (watermarks->a.urgent_latency_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_A ,0 ,DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_A , prog_wm_value); }else if (watermarks->a.urgent_latency_ns < hubbub2->watermarks.a.urgent_latency_ns)
@@ -203,7 +206,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->b.urgent_ns > hubbub2->watermarks.b.urgent_ns) { hubbub2->watermarks.b.urgent_ns = watermarks->b.urgent_ns; prog_wm_value =convert_and_clamp (watermarks->b.urgent_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B ,0 ,DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B , prog_wm_value);
@@ -237,7 +240,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->b.urgent_latency_ns > hubbub2->watermarks.b.urgent_latency_ns) { hubbub2->watermarks.b.urgent_latency_ns = watermarks->b.urgent_latency_ns; prog_wm_value =convert_and_clamp (watermarks->b.urgent_latency_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_B ,0 ,DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_B , prog_wm_value); }else if (watermarks->b.urgent_latency_ns < hubbub2->watermarks.b.urgent_latency_ns)
@@ -247,7 +250,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->c.urgent_ns > hubbub2->watermarks.c.urgent_ns) { hubbub2->watermarks.c.urgent_ns = watermarks->c.urgent_ns; prog_wm_value =convert_and_clamp (watermarks->c.urgent_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_C ,0 ,DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_C , prog_wm_value);
@@ -281,7 +284,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->c.urgent_latency_ns > hubbub2->watermarks.c.urgent_latency_ns) { hubbub2->watermarks.c.urgent_latency_ns = watermarks->c.urgent_latency_ns; prog_wm_value =convert_and_clamp (watermarks->c.urgent_latency_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_C ,0 ,DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_C , prog_wm_value); }else if (watermarks->c.urgent_latency_ns < hubbub2->watermarks.c.urgent_latency_ns)
@@ -291,7 +294,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->d.urgent_ns > hubbub2->watermarks.d.urgent_ns) { hubbub2->watermarks.d.urgent_ns = watermarks->d.urgent_ns; prog_wm_value =convert_and_clamp (watermarks->d.urgent_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_D ,0 ,DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_D , prog_wm_value);
@@ -325,7 +328,7 @@ static bool hubbub31_program_urgent_watermarks(if (safe_to_lower || watermarks->d.urgent_latency_ns > hubbub2->watermarks.d.urgent_latency_ns) { hubbub2->watermarks.d.urgent_latency_ns = watermarks->d.urgent_latency_ns; prog_wm_value =convert_and_clamp (watermarks->d.urgent_latency_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0x3fff );REG_SET (DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_D ,0 ,DCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_D , prog_wm_value); }else if (watermarks->d.urgent_latency_ns < hubbub2->watermarks.d.urgent_latency_ns)
@@ -351,7 +354,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->a.cstate_pstate.cstate_enter_plus_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->a.cstate_pstate.cstate_enter_plus_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_A calculated =%d\n"
@@ -367,7 +370,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->a.cstate_pstate.cstate_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->a.cstate_pstate.cstate_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_A calculated =%d\n"
@@ -383,7 +386,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->a.cstate_pstate.cstate_enter_plus_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->a.cstate_pstate.cstate_enter_plus_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_A ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_A , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_A calculated =%d\n"
@@ -399,7 +402,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->a.cstate_pstate.cstate_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->a.cstate_pstate.cstate_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_A ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_A , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_A calculated =%d\n"
@@ -416,7 +419,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_B calculated =%d\n"
@@ -432,7 +435,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->b.cstate_pstate.cstate_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->b.cstate_pstate.cstate_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_B calculated =%d\n"
@@ -448,7 +451,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->b.cstate_pstate.cstate_enter_plus_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->b.cstate_pstate.cstate_enter_plus_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_B ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_B , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_B calculated =%d\n"
@@ -464,7 +467,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->b.cstate_pstate.cstate_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->b.cstate_pstate.cstate_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_B ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_B , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_B calculated =%d\n"
@@ -481,7 +484,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_C calculated =%d\n"
@@ -497,7 +500,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->c.cstate_pstate.cstate_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->c.cstate_pstate.cstate_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_C calculated =%d\n"
@@ -513,7 +516,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->c.cstate_pstate.cstate_enter_plus_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->c.cstate_pstate.cstate_enter_plus_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_C ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_C , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_C calculated =%d\n"
@@ -529,7 +532,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->c.cstate_pstate.cstate_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->c.cstate_pstate.cstate_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_C ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_C , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_C calculated =%d\n"
@@ -546,7 +549,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_EXIT_WATERMARK_D calculated =%d\n"
@@ -562,7 +565,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->d.cstate_pstate.cstate_exit_ns; prog_wm_value =convert_and_clamp ( watermarks->d.cstate_pstate.cstate_exit_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_D calculated =%d\n"
@@ -578,7 +581,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->d.cstate_pstate.cstate_enter_plus_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->d.cstate_pstate.cstate_enter_plus_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_D ,0 ,DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_Z8_D , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_ENTER_WATERMARK_Z8_D calculated =%d\n"
@@ -594,7 +597,7 @@ static bool hubbub31_program_stutter_watermarks( watermarks->d.cstate_pstate.cstate_exit_z8_ns; prog_wm_value =convert_and_clamp ( watermarks->d.cstate_pstate.cstate_exit_z8_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_D ,0 ,DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_Z8_D , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("SR_EXIT_WATERMARK_Z8_D calculated =%d\n"
@@ -625,7 +628,7 @@ static bool hubbub31_program_pstate_watermarks( watermarks->a.cstate_pstate.pstate_change_ns; prog_wm_value =convert_and_clamp ( watermarks->a.cstate_pstate.pstate_change_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_A ,0 ,DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_A , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_A calculated =%d\n"
@@ -642,7 +645,7 @@ static bool hubbub31_program_pstate_watermarks( watermarks->b.cstate_pstate.pstate_change_ns; prog_wm_value =convert_and_clamp ( watermarks->b.cstate_pstate.pstate_change_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_B ,0 ,DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_B , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_B calculated =%d\n"
@@ -659,7 +662,7 @@ static bool hubbub31_program_pstate_watermarks( watermarks->c.cstate_pstate.pstate_change_ns; prog_wm_value =convert_and_clamp ( watermarks->c.cstate_pstate.pstate_change_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_C ,0 ,DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_C , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_C calculated =%d\n"
@@ -676,7 +679,7 @@ static bool hubbub31_program_pstate_watermarks( watermarks->d.cstate_pstate.pstate_change_ns; prog_wm_value =convert_and_clamp ( watermarks->d.cstate_pstate.pstate_change_ns, - refclk_mhz,0x1fffff ); + refclk_mhz,0xffff );REG_SET (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D ,0 ,DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D , prog_wm_value); DC_LOG_BANDWIDTH_CALCS("DRAM_CLK_CHANGE_WATERMARK_D calculated =%d\n"
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 2/33 ARM: OMAP2+: adjust the location of put_device() call in omapdss_init_of
In reply to Sasha LevinFrom: Ye Guojin <[email protected]>
[ Upstream commit 34596ba380b03d181e24efd50e2f21045bde3696 ]
This was found by coccicheck:./arch/arm/mach-omap2/display.c, 272, 1-7, ERROR missing put_device; call of_find_device_by_node on line 258, but without a corresponding object release within this function.
Move the put_device() call before the if judgment.
--- arch/arm/mach-omap2/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/display.c +1 -1
@@ -263,9 +263,9 @@ static int __init omapdss_init_of(void) } r =of_platform_populate (node,NULL ,NULL , &pdev->dev); +put_device (&pdev->dev);if (r) {pr_err ("Unable to populate DSS submodule devices\n" ); -put_device (&pdev->dev);return r; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 1/33 ARM: OMAP2+: hwmod: Add of_node_put() before break
From: Wan Jiabing <[email protected]>
[ Upstream commit 80c469a0a03763f814715f3d12b6f3964c7423e8 ]
Fix following coccicheck warning:
./arch/arm/mach-omap2/omap_hwmod.c:753:1-23: WARNING: Function for_each_matching_node should have of_node_put() before break
Early exits from for_each_matching_node should decrement the node reference counter.
--- arch/arm/mach-omap2/omap_hwmod.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/omap_hwmod.c +3 -1
@@ -752,8 +752,10 @@ static int __init _init_clkctrl_providers(void)for_each_matching_node (np, ti_clkctrl_match_table) { ret =_setup_clkctrl_provider (np); -if (ret) +if (ret) { +of_node_put (np);break ; + } }return ret;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 3/33 phy: usb: Leave some clocks running during suspend
From: Al Cooper <[email protected]>
[ Upstream commit 42fed57046fc74586d7058bd51a1c10ac9c690cb ]
The PHY client driver does a phy_exit() call on suspend or rmmod and the PHY driver needs to know the difference because some clocks need to be kept running for suspend but can be shutdown on unbind/rmmod (or if there are no PHY clients at all).
The fix is to use a PM notifier so the driver can tell if a PHY client is calling exit() because of a system suspend or a driver unbind/rmmod.
--- drivers/phy/broadcom/phy-brcm-usb.c | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
drivers/phy/broadcom/phy-brcm-usb.c +38 -0
@@ -18,6 +18,7 @@#include <linux/soc/brcmstb/brcmstb.h> #include <dt-bindings/phy/phy.h> #include <linux/mfd/syscon.h> +#include <linux/suspend.h> #include "phy-brcm-usb-init.h"
@@ -70,12 +71,35 @@ struct brcm_usb_phy_data {int init_count;int wake_irq;struct brcm_usb_phy phys[BRCM_USB_PHY_ID_MAX ]; +struct notifier_block pm_notifier; +bool pm_active; };static s8 *node_reg_names[BRCM_REGS_MAX ] = {"crtl" ,"xhci_ec" ,"xhci_gbl" ,"usb_phy" ,"usb_mdio" ,"bdc_ec" }; +static int brcm_pm_notifier (struct notifier_block *notifier, +unsigned long pm_event, +void *unused) +{ +struct brcm_usb_phy_data *priv = + container_of(notifier, struct brcm_usb_phy_data, pm_notifier); + +switch (pm_event) { +case PM_HIBERNATION_PREPARE : +case PM_SUSPEND_PREPARE : + priv->pm_active = true; +break ; +case PM_POST_RESTORE : +case PM_POST_HIBERNATION : +case PM_POST_SUSPEND : + priv->pm_active = false; +break ; + } +return NOTIFY_DONE ; +} +static irqreturn_t brcm_usb_phy_wake_isr (int irq,void *dev_id) {struct phy *gphy = dev_id;
@@ -91,6 +115,9 @@ static int brcm_usb_phy_init(struct phy *gphy)struct brcm_usb_phy_data *priv = container_of(phy, struct brcm_usb_phy_data, phys[phy->id]); +if (priv->pm_active) +return 0 ; +/* * Use a lock to make sure a second caller waits until * the base phy is inited before using it.
@@ -120,6 +147,9 @@ static int brcm_usb_phy_exit(struct phy *gphy)struct brcm_usb_phy_data *priv = container_of(phy, struct brcm_usb_phy_data, phys[phy->id]); +if (priv->pm_active) +return 0 ; +dev_dbg (&gphy->dev,"EXIT\n" );if (phy->id ==BRCM_USB_PHY_2_0 )brcm_usb_uninit_eohci (&priv->ini);
@@ -488,6 +518,9 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)if (err)return err; + priv->pm_notifier.notifier_call = brcm_pm_notifier; +register_pm_notifier (&priv->pm_notifier); +mutex_init (&priv->mutex);/* make sure invert settings are correct */
@@ -528,7 +561,10 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)static int brcm_usb_phy_remove (struct platform_device *pdev) { +struct brcm_usb_phy_data *priv =dev_get_drvdata (&pdev->dev); +sysfs_remove_group (&pdev->dev.kobj, &brcm_usb_phy_group); +unregister_pm_notifier (&priv->pm_notifier);return 0 ; }
@@ -539,6 +575,7 @@ static int brcm_usb_phy_suspend(struct device *dev)struct brcm_usb_phy_data *priv =dev_get_drvdata (dev);if (priv->init_count) { +dev_dbg (dev,"SUSPEND\n" ); priv->ini.wake_enabled =device_may_wakeup (dev);if (priv->phys[BRCM_USB_PHY_3_0 ].inited)brcm_usb_uninit_xhci (&priv->ini);
@@ -578,6 +615,7 @@ static int brcm_usb_phy_resume(struct device *dev)* Uninitialize anything that wasn't previously initialized. */ if (priv->init_count) { +dev_dbg (dev,"RESUME\n" );if (priv->wake_irq >=0 )disable_irq_wake (priv->wake_irq);brcm_usb_init_common (&priv->ini);
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 5/33 phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy
In reply to Sasha LevinFrom: Wan Jiabing <[email protected]>
[ Upstream commit 46e994717807f4b935c44d81dde9dd8bcd9a4f5d ]
Fix following coccicheck warning:
./drivers/phy/mediatek/phy-mtk-tphy.c:994:6-29: duplicated argument to && or ||
The efuse_rx_imp is duplicate. Here should be efuse_tx_imp.
--- drivers/phy/mediatek/phy-mtk-tphy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/mediatek/phy-mtk-tphy.c +1 -1
@@ -1125,7 +1125,7 @@ static int phy_efuse_get(struct mtk_tphy *tphy, struct mtk_phy_instance *instanc/* no efuse, ignore it */ if (!instance->efuse_intr && !instance->efuse_rx_imp && - !instance->efuse_rx_imp) { + !instance->efuse_tx_imp) {dev_warn (dev,"no u3 intr efuse, but dts enable it\n" ); instance->efuse_sw_en =0 ;break ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 6/33 usb: usb251xb: add boost-up property support
In reply to Sasha LevinFrom: Tommaso Merciai <[email protected]>
[ Upstream commit 5c2b9c61ae5d8ad0a196d33b66ce44543be22281 ]
Add support for boost-up register of usb251xb hub. boost-up property control USB electrical drive strength This register can be set:
- Normal mode -> 0x00
- Low -> 0x01 - Medium -> 0x10 - High -> 0x11
(Normal Default)
References:
- http://www.mouser.com/catalog/specsheets/2514.pdf p29
--- drivers/usb/misc/usb251xb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/misc/usb251xb.c +3 -1
@@ -543,6 +543,9 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,if (of_property_read_u16_array (np,"language-id" , &hub->lang_id,1 )) hub->lang_id =USB251XB_DEF_LANGUAGE_ID ; +if (of_property_read_u8 (np,"boost-up" , &hub->boost_up)) + hub->boost_up =USB251XB_DEF_BOOST_UP ; + cproperty_char =of_get_property (np,"manufacturer" ,NULL );strlcpy (str, cproperty_char ? :USB251XB_DEF_MANUFACTURER_STRING ,sizeof (str));
@@ -584,7 +587,6 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,* may be as soon as needed. */ hub->bat_charge_en =USB251XB_DEF_BATTERY_CHARGING_ENABLE ; - hub->boost_up =USB251XB_DEF_BOOST_UP ; hub->boost_57 =USB251XB_DEF_BOOST_57 ; hub->boost_14 =USB251XB_DEF_BOOST_14 ; hub->port_map12 =USB251XB_DEF_PORT_MAP_12 ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 7/33 irqchip/sifive-plic: Add missing thead,c900-plic match string
In reply to Sasha LevinFrom: Guo Ren <[email protected]>
[ Upstream commit 1d4df649cbb4b26d19bea38ecff4b65b10a1bbca ]
The thead,c900-plic has been used in opensbi to distinguish PLIC [1]. Although PLICs have the same behaviors in Linux, they are different hardware with some custom initializing in firmware(opensbi).
Qute opensbi patch commit-msg by Samuel:
The T-HEAD PLIC implementation requires setting a delegation bit to allow access from S-mode. Now that the T-HEAD PLIC has its own compatible string, set this bit automatically from the PLIC driver, instead of reaching into the PLIC's MMIO space from another driver.
[1]: https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd62653b9fb31623a42ced45f38ea6
--- drivers/irqchip/irq-sifive-plic.c | 1 + 1 file changed, 1 insertion(+)
drivers/irqchip/irq-sifive-plic.c +1 -0
@@ -398,3 +398,4 @@ static int __init plic_init(struct device_node *node,IRQCHIP_DECLARE (sifive_plic,"sifive,plic-1.0.0" , plic_init);IRQCHIP_DECLARE (riscv_plic0,"riscv,plic0" , plic_init);/* for legacy systems */ +IRQCHIP_DECLARE (thead_c900_plic,"thead,c900-plic" , plic_init);/* for firmware driver */
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 8/33 x86/bug: Merge annotate_reachable() into _BUG_FLAGS() asm
In reply to Sasha LevinFrom: Nick Desaulniers <[email protected]>
[ Upstream commit bfb1a7c91fb7758273b4a8d735313d9cc388b502 ]
In __WARN_FLAGS(), we had two asm statements (abbreviated):
asm volatile("ud2");
asm volatile(".pushsection .discard.reachable");These pair of statements are used to trigger an exception, but then help objtool understand that for warnings, control flow will be restored immediately afterwards.
The problem is that volatile is not a compiler barrier. GCC explicitly documents this:
Quoted 2 lines
Note that the compiler can move even volatile asm instructions relative to other code, including across jump instructions.
Also, no clobbers are specified to prevent instructions from subsequent statements from being scheduled by compiler before the second asm statement. This can lead to instructions from subsequent statements being emitted by the compiler before the second asm statement.
Providing a scheduling model such as via -march= options enables the compiler to better schedule instructions with known latencies to hide latencies from data hazards compared to inline asm statements in which latencies are not estimated.
If an instruction gets scheduled by the compiler between the two asm statements, then objtool will think that it is not reachable, producing a warning.
To prevent instructions from being scheduled in between the two asm statements, merge them.
Also remove an unnecessary unreachable() asm annotation from BUG() in favor of __builtin_unreachable(). objtool is able to track that the ud2 from BUG() terminates control flow within the function.
--- arch/x86/include/asm/bug.h | 20 +++++++++++--------- include/linux/compiler.h | 21 +++++---------------- 2 files changed, 16 insertions(+), 25 deletions(-)
arch/x86/include/asm/bug.h +11 -9
@@ -22,7 +22,7 @@#ifdef CONFIG_DEBUG_BUGVERBOSE -#define _BUG_FLAGS (ins, flags) \ +#define _BUG_FLAGS (ins, flags, extra) \ do { \ asm_inline volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"aw\"\n" \
@@ -31,7 +31,8 @@ do { \"\t.word %c1" "\t# bug_entry::line\n" \"\t.word %c2" "\t# bug_entry::flags\n" \"\t.org 2b+%c3\n" \ -".popsection" \ +".popsection\n" \ + extra \ : : "i" (__FILE__), "i" (__LINE__), \"i" (flags), \ "i" (sizeof(struct bug_entry))); \
@@ -39,14 +40,15 @@ do { \#else /* !CONFIG_DEBUG_BUGVERBOSE */ -#define _BUG_FLAGS (ins, flags) \ +#define _BUG_FLAGS (ins, flags, extra) \ do { \ asm_inline volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"aw\"\n" \ "2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n" \ "\t.word %c0" "\t# bug_entry::flags\n" \ "\t.org 2b+%c1\n" \ - ".popsection" \ + ".popsection\n" \ + extra \ : : "i" (flags), \ "i" (sizeof(struct bug_entry))); \ } while (0)
@@ -55,7 +57,7 @@ do { \#else -#define _BUG_FLAGS (ins, flags) asm volatile(ins) +#define _BUG_FLAGS (ins, flags, extra) asm volatile(ins)#endif /* CONFIG_GENERIC_BUG */
@@ -63,8 +65,8 @@ do { \#define BUG () \ do { \ instrumentation_begin(); \ - _BUG_FLAGS(ASM_UD2, 0); \ - unreachable(); \ + _BUG_FLAGS(ASM_UD2, 0, ""); \ + __builtin_unreachable(); \ } while (0)/*
@@ -75,9 +77,9 @@ do { \*/ #define __WARN_FLAGS (flags) \ do { \ + __auto_type f = BUGFLAG_WARNING|(flags); \ instrumentation_begin(); \ - _BUG_FLAGS(ASM_UD2, BUGFLAG_WARNING|(flags)); \ - annotate_reachable(); \ + _BUG_FLAGS(ASM_UD2, f, ASM_REACHABLE); \ instrumentation_end(); \ } while (0)
include/linux/compiler.h +5 -16
@@ -117,14 +117,6 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,*/ #define __stringify_label (n) #n -#define __annotate_reachable (c) ({ \ - asm volatile(__stringify_label(c) ":\n\t" \ - ".pushsection .discard.reachable\n\t" \ - ".long " __stringify_label(c) "b - .\n\t" \ - ".popsection\n\t" : : "i" (c)); \ -}) -#define annotate_reachable () __annotate_reachable(__COUNTER__) -#define __annotate_unreachable (c) ({ \ asm volatile(__stringify_label(c) ":\n\t" \ ".pushsection .discard.unreachable\n\t" \
@@ -133,24 +125,21 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, })#define annotate_unreachable () __annotate_unreachable(__COUNTER__) -#define ASM_UNREACHABLE \ - "999:\n\t" \ - ".pushsection .discard.unreachable\n\t" \ - ".long 999b - .\n\t" \ +#define ASM_REACHABLE \ + "998:\n\t" \ + ".pushsection .discard.reachable\n\t" \ + ".long 998b - .\n\t" \ ".popsection\n\t"/* Annotate a C jump table to allow objtool to follow the code flow */ #define __annotate_jump_table __section(".rodata..c_jump_table")#else -#define annotate_reachable ()#define annotate_unreachable () +# define ASM_REACHABLE #define __annotate_jump_table#endif -#ifndef ASM_UNREACHABLE -# define ASM_UNREACHABLE -#endif #ifndef unreachable# define unreachable () do { \ annotate_unreachable(); \
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 10/33 ksmbd: fix same UniqueId for dot and dotdot entries
In reply to Sasha LevinFrom: Namjae Jeon <[email protected]>
[ Upstream commit 97550c7478a2da93e348d8c3075d92cddd473a78 ]
ksmbd sets the inode number to UniqueId. However, the same UniqueId for dot and dotdot entry is set to the inode number of the parent inode. This patch set them using the current inode and parent inode.
--- fs/ksmbd/smb_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/ksmbd/smb_common.c +4 -1
@@ -308,14 +308,17 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level, for (i = 0; i < 2; i++) { struct kstat kstat; struct ksmbd_kstat ksmbd_kstat; + struct dentry *dentry; if (!dir->dot_dotdot[i]) { /* fill dot entry info */ if (i == 0) { d_info->name = "."; d_info->name_len = 1; + dentry = dir->filp->f_path.dentry; } else { d_info->name = ".."; d_info->name_len = 2; + dentry = dir->filp->f_path.dentry->d_parent; } if (!match_pattern(d_info->name, d_info->name_len,
@@ -327,7 +330,7 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level, ksmbd_kstat.kstat = &kstat;ksmbd_vfs_fill_dentry_attrs (work, user_ns, - dir->filp->f_path.dentry->d_parent, + dentry, &ksmbd_kstat); rc =fn (conn, info_level, d_info, &ksmbd_kstat);if (rc)
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 19/33 kconfig: let 'shell' return enough output for deep path names
In reply to Sasha LevinFrom: Brenda Streiff <[email protected]>
[ Upstream commit 8a4c5b2a6d8ea079fa36034e8167de87ab6f8880 ]
The 'shell' built-in only returns the first 256 bytes of the command's output. In some cases, 'shell' is used to return a path; by bumping up the buffer size to 4096 this lets us capture up to PATH_MAX.
The specific case where I ran into this was due to commit 1e860048c53e ("gcc-plugins: simplify GCC plugin-dev capability test"). After this change, we now use $(shell,$(CC) -print-file-name=plugin) to return a path; if the gcc path is particularly long, then the path ends up truncated at the 256 byte mark, which makes the HAVE_GCC_PLUGINS depends test always fail.
--- scripts/kconfig/preprocess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kconfig/preprocess.c +1 -1
@@ -141,7 +141,7 @@ static char *do_lineno(int argc, char *argv[])static char *do_shell (int argc,char *argv[]) {FILE *p; -char buf[256 ]; +char buf[4096 ];char *cmd;size_t nread;int i;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 20/33 scsi: lpfc: Remove NVMe support if kernel has NVME_FC disabled
In reply to Sasha LevinFrom: James Smart <[email protected]>
[ Upstream commit c80b27cfd93ba9f5161383f798414609e84729f3 ]
The driver is initiating NVMe PRLIs to determine device NVMe support. This should not be occurring if CONFIG_NVME_FC support is disabled.
Correct this by changing the default value for FC4 support. Currently it defaults to FCP and NVMe. With change, when NVME_FC support is not enabled in the kernel, the default value is just FCP.
--- drivers/scsi/lpfc/lpfc.h | 13 ++++++++++--- drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/scsi/lpfc/lpfc.h +10 -3
@@ -1163,6 +1163,16 @@ struct lpfc_hba {uint32_t cfg_hostmem_hgp;uint32_t cfg_log_verbose;uint32_t cfg_enable_fc4_type; +#define LPFC_ENABLE_FCP 1 +#define LPFC_ENABLE_NVME 2 +#define LPFC_ENABLE_BOTH 3 +#if (IS_ENABLED (CONFIG_NVME_FC )) +#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_BOTH +#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_BOTH +#else +#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_FCP +#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_FCP +#endif uint32_t cfg_aer_support;uint32_t cfg_sriov_nr_virtfn;uint32_t cfg_request_firmware_upgrade;
@@ -1184,9 +1194,6 @@ struct lpfc_hba {uint32_t cfg_ras_fwlog_func;uint32_t cfg_enable_bbcr;/* Enable BB Credit Recovery */ uint32_t cfg_enable_dpp;/* Enable Direct Packet Push */ -#define LPFC_ENABLE_FCP 1 -#define LPFC_ENABLE_NVME 2 -#define LPFC_ENABLE_BOTH 3uint32_t cfg_enable_pbde;uint32_t cfg_enable_mi;struct nvmet_fc_target_port *targetport;
drivers/scsi/lpfc/lpfc_attr.c +2 -2
@@ -3978,8 +3978,8 @@ LPFC_ATTR_R(nvmet_mrq_post,* 3 - register both FCP and NVME * Supported values are [1,3]. Default value is 3 */ -LPFC_ATTR_R (enable_fc4_type,LPFC_ENABLE_BOTH , -LPFC_ENABLE_FCP ,LPFC_ENABLE_BOTH , +LPFC_ATTR_R (enable_fc4_type,LPFC_DEF_ENBL_FC4_TYPE , +LPFC_ENABLE_FCP ,LPFC_MAX_ENBL_FC4_TYPE ,"Enable FC4 Protocol support - FCP / NVME" );/*
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 9/33 netfilter: conntrack: don't refresh sctp entries in closed state
In reply to Sasha LevinFrom: Florian Westphal <[email protected]>
[ Upstream commit 77b337196a9d87f3d6bb9b07c0436ecafbffda1e ]
Vivek Thrivikraman reported:
An SCTP server application which is accessed continuously by client application.
When the session disconnects the client retries to establish a connection. After restart of SCTP server application the session is not established because of stale conntrack entry with connection state CLOSED as below.
(removing this entry manually established new connection):
sctp 9 CLOSED src=10.141.189.233 [..] [ASSURED]
Just skip timeout update of closed entries, we don't want them to stay around forever.
--- net/netfilter/nf_conntrack_proto_sctp.c | 9 +++++++++ 1 file changed, 9 insertions(+)
net/netfilter/nf_conntrack_proto_sctp.c +9 -0
@@ -489,6 +489,15 @@ int nf_conntrack_sctp_packet(struct nf_conn *ct,pr_debug ("Setting vtag %x for dir %d\n" , ih->init_tag, !dir); ct->proto.sctp.vtag[!dir] = ih->init_tag; + +/* don't renew timeout on init retransmit so +* port reuse by client or NAT middlebox cannot +* keep entry alive indefinitely (incl. nat info). +*/ +if (new_state ==SCTP_CONNTRACK_CLOSED && + old_state ==SCTP_CONNTRACK_CLOSED && +nf_ct_is_confirmed (ct)) + ignore = true; } ct->proto.sctp.state = new_state;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 14/33 arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610
In reply to Sasha LevinFrom: Christian Hewitt <[email protected]>
[ Upstream commit f26573e2bc9dfd551a0d5c6971f18cc546543312 ]
The BL32/TEE reserved-memory region is now inherited from the common family dtsi (meson-g12-common) so we can drop it from board files.
--- arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 8 -------- arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts | 8 -------- 2 files changed, 16 deletions(-)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +0 -8
@@ -157,14 +157,6 @@ vddio_ao1v8: regulator-vddio_ao1v8 { regulator-always-on; }; - reserved-memory { - /* TEE Reserved Memory */ - bl32_reserved: bl32@5000000 { - reg = <0x0 0x05300000 0x0 0x2000000>; - no-map; - }; - }; - sdio_pwrseq: sdio-pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +0 -8
@@ -203,14 +203,6 @@ vddio_ao1v8: regulator-vddio_ao1v8 { regulator-always-on; }; - reserved-memory { - /* TEE Reserved Memory */ - bl32_reserved: bl32@5000000 { - reg = <0x0 0x05300000 0x0 0x2000000>; - no-map; - }; - }; - sdio_pwrseq: sdio-pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 15/33 pidfd: fix test failure due to stack overflow on some arches
In reply to Sasha LevinFrom: Axel Rasmussen <[email protected]>
[ Upstream commit 4cbd93c3c110447adc66cb67c08af21f939ae2d7 ]
When running the pidfd_fdinfo_test on arm64, it fails for me. After some digging, the reason is that the child exits due to SIGBUS, because it overflows the 1024 byte stack we've reserved for it.
To fix the issue, increase the stack size to 8192 bytes (this number is somewhat arbitrary, and was arrived at through experimentation -- I kept doubling until the failure no longer occurred).
Also, let's make the issue easier to debug. wait_for_pid() returns an ambiguous value: it may return -1 in all of these cases:
1. waitpid() itself returned -1
2. waitpid() returned success, but we found !WIFEXITED(status).
3. The child process exited, but it did so with a -1 exit code.
There's no way for the caller to tell the difference. So, at least log which occurred, so the test runner can debug things.
While debugging this, I found that we had !WIFEXITED(), because the child exited due to a signal. This seems like a reasonably common case, so also print out whether or not we have WIFSIGNALED(), and the associated WTERMSIG() (if any). This lets us see the SIGBUS I'm fixing clearly when it occurs.
Finally, I'm suspicious of allocating the child's stack on our stack. man clone(2) suggests that the correct way to do this is with mmap(), and in particular by setting MAP_STACK. So, switch to doing it that way instead.
--- tools/testing/selftests/pidfd/pidfd.h | 13 ++++++++--- .../selftests/pidfd/pidfd_fdinfo_test.c | 22 +++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-)
tools/testing/selftests/pidfd/pidfd.h +10 -3
@@ -68,7 +68,7 @@#define PIDFD_SKIP 3#define PIDFD_XFAIL 4 -int wait_for_pid (pid_t pid) +static inline int wait_for_pid (pid_t pid) {int status, ret;
@@ -78,13 +78,20 @@ int wait_for_pid(pid_t pid)if (errno ==EINTR ) goto again; +ksft_print_msg ("waitpid returned -1, errno=%d\n" , errno);return -1 ; } -if (!WIFEXITED (status)) +if (!WIFEXITED (status)) { +ksft_print_msg ( +"waitpid !WIFEXITED, WIFSIGNALED=%d, WTERMSIG=%d\n" , +WIFSIGNALED (status),WTERMSIG (status));return -1 ; + } -return WEXITSTATUS (status); + ret =WEXITSTATUS (status); +ksft_print_msg ("waitpid WEXITSTATUS=%d\n" , ret); +return ret; }static inline int sys_pidfd_open (pid_t pid,unsigned int flags)
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +18 -4
@@ -12,6 +12,7 @@#include <string.h> #include <syscall.h> #include <sys/wait.h> +#include <sys/mman.h> #include "pidfd.h" #include "../kselftest.h"
@@ -80,7 +81,10 @@ static inline int error_check(struct error *err, const char *test_name)return err->code; } +#define CHILD_STACK_SIZE 8192 +struct child { +char *stack;pid_t pid;int fd; };
@@ -89,17 +93,22 @@ static struct child clone_newns(int (*fn)(void *), void *args, struct error *err) {static int flags =CLONE_PIDFD |CLONE_NEWPID |CLONE_NEWNS |SIGCHLD ; -size_t stack_size =1024 ; -char *stack[1024 ] = {0 };struct child ret;if (!(flags &CLONE_NEWUSER ) &&geteuid () !=0 ) flags |=CLONE_NEWUSER ; + ret.stack =mmap (NULL ,CHILD_STACK_SIZE ,PROT_READ |PROT_WRITE , +MAP_PRIVATE |MAP_ANONYMOUS |MAP_STACK ,-1 ,0 ); +if (ret.stack ==MAP_FAILED ) { +error_set (err,-1 ,"mmap of stack failed (errno %d)" , errno); +return ret; + } +#ifdef __ia64__ - ret.pid =__clone2 (fn, stack, stack_size, flags, args, &ret.fd); + ret.pid =__clone2 (fn, ret.stack,CHILD_STACK_SIZE , flags, args, &ret.fd);#else - ret.pid =clone (fn, stack + stack_size, flags, args, &ret.fd); + ret.pid =clone (fn, ret.stack +CHILD_STACK_SIZE , flags, args, &ret.fd);#endif if (ret.pid <0 ) {
@@ -129,6 +138,11 @@ static inline int child_join(struct child *child, struct error *err)else if (r >0 )error_set (err, r,"child %d reported: %d" , child->pid, r); +if (munmap (child->stack,CHILD_STACK_SIZE )) { +error_set (err,-1 ,"munmap of child stack failed (errno %d)" , errno); + r =-1 ; + } +return r; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 17/33 mm: io_uring: allow oom-killer from io_uring_setup
In reply to Sasha LevinFrom: Shakeel Butt <[email protected]>
[ Upstream commit 0a3f1e0beacf6cc8ae5f846b0641c1df476e83d6 ]
On an overcommitted system which is running multiple workloads of varying priorities, it is preferred to trigger an oom-killer to kill a low priority workload than to let the high priority workload receiving ENOMEMs. On our memory overcommitted systems, we are seeing a lot of ENOMEMs instead of oom-kills because io_uring_setup callchain is using __GFP_NORETRY gfp flag which avoids the oom-killer. Let's remove it and allow the oom-killer to kill a lower priority job.
--- fs/io_uring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/io_uring.c +2 -3
@@ -8820,10 +8820,9 @@ static void io_mem_free(void *ptr)static void *io_mem_alloc (size_t size) { -gfp_t gfp_flags =GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP | - __GFP_NORETRY | __GFP_ACCOUNT; +gfp_t gfp =GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP; -return (void *)__get_free_pages (gfp_flags,get_order (size)); +return (void *)__get_free_pages (gfp,get_order (size)); } static unsigned long rings_size(unsigned sq_entries, unsigned cq_entries,
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 24/33 xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create
In reply to Sasha LevinFrom: Dan Aloni <[email protected]>
[ Upstream commit a9c10b5b3b67b3750a10c8b089b2e05f5e176e33 ]
If there are failures then we must not leave the non-NULL pointers with the error value, otherwise rpcrdma_ep_destroy gets confused and tries free them, resulting in an Oops.
--- net/sunrpc/xprtrdma/verbs.c | 3 +++ 1 file changed, 3 insertions(+)
net/sunrpc/xprtrdma/verbs.c +3 -0
@@ -438,6 +438,7 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt) IB_POLL_WORKQUEUE);if (IS_ERR (ep->re_attr.send_cq)) { rc =PTR_ERR (ep->re_attr.send_cq); + ep->re_attr.send_cq =NULL ; goto out_destroy; }
@@ -446,6 +447,7 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt) IB_POLL_WORKQUEUE);if (IS_ERR (ep->re_attr.recv_cq)) { rc =PTR_ERR (ep->re_attr.recv_cq); + ep->re_attr.recv_cq =NULL ; goto out_destroy; } ep->re_receive_count =0 ;
@@ -484,6 +486,7 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt) ep->re_pd =ib_alloc_pd (device,0 );if (IS_ERR (ep->re_pd)) { rc =PTR_ERR (ep->re_pd); + ep->re_pd =NULL ; goto out_destroy; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 12/33 arm64: dts: meson-gx: add ATF BL32 reserved-memory region
In reply to Sasha LevinFrom: Christian Hewitt <[email protected]>
[ Upstream commit 76577c9137456febb05b0e17d244113196a98968 ]
Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.
--- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6 -0
@@ -49,6 +49,12 @@ secmon_reserved_alt: secmon@5000000 { no-map; }; + /* 32 MiB reserved for ARM Trusted Firmware (BL32) */ + secmon_reserved_bl32: secmon@5300000 { + reg = <0x0 0x05300000 0x0 0x2000000>; + no-map; + }; + linux,cma { compatible = "shared-dma-pool"; reusable;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 11/33 ksmbd: don't align last entry offset in smb2 query directory
In reply to Sasha LevinFrom: Namjae Jeon <[email protected]>
[ Upstream commit 04e260948a160d3b7d622bf4c8a96fa4577c09bd ]
When checking smb2 query directory packets from other servers, OutputBufferLength is different with ksmbd. Other servers add an unaligned next offset to OutputBufferLength for the last entry.
--- fs/ksmbd/smb2pdu.c | 7 ++++--- fs/ksmbd/vfs.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-)
fs/ksmbd/smb2pdu.c +4 -3
@@ -3422,9 +3422,9 @@ static int smb2_populate_readdir_entry(struct ksmbd_conn *conn, int info_level, goto free_conv_name; } - struct_sz =readdir_info_level_struct_sz (info_level); - next_entry_offset =ALIGN (struct_sz -1 + conv_len, -KSMBD_DIR_INFO_ALIGNMENT ); + struct_sz =readdir_info_level_struct_sz (info_level) -1 + conv_len; + next_entry_offset =ALIGN (struct_sz,KSMBD_DIR_INFO_ALIGNMENT ); + d_info->last_entry_off_align = next_entry_offset - struct_sz;if (next_entry_offset > d_info->out_buf_len) { d_info->out_buf_len =0 ;
@@ -3976,6 +3976,7 @@ int smb2_query_dir(struct ksmbd_work *work) ((struct file_directory_info *) ((char *)rsp->Buffer + d_info.last_entry_offset)) ->NextEntryOffset =0 ; + d_info.data_count -= d_info.last_entry_off_align; rsp->StructureSize =cpu_to_le16 (9 ); rsp->OutputBufferOffset =cpu_to_le16 (72 );
fs/ksmbd/vfs.h +1 -0
@@ -86,6 +86,7 @@ struct ksmbd_dir_info {int last_entry_offset;bool hide_dot_file;int flags; +int last_entry_off_align; };struct ksmbd_readdir_data {
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 13/33 arm64: dts: meson-g12: add ATF BL32 reserved-memory region
In reply to Sasha LevinFrom: Christian Hewitt <[email protected]>
[ Upstream commit 08982a1b3aa2611c9c711d24825c9002d28536f4 ]
Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot.
--- arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +6 -0
@@ -107,6 +107,12 @@ secmon_reserved: secmon@5000000 { no-map; }; + /* 32 MiB reserved for ARM Trusted Firmware (BL32) */ + secmon_reserved_bl32: secmon@5300000 { + reg = <0x0 0x05300000 0x0 0x2000000>; + no-map; + }; + linux,cma { compatible = "shared-dma-pool"; reusable;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 18/33 ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems"
In reply to Sasha LevinFrom: Mario Limonciello <[email protected]>
[ Upstream commit d6ebb17ccc7b37872a32bc25b4a21f1e5af8c7e3 ]
Testing on various upcoming OEM systems shows commit 7b167c4cb48e ("ACPI:
PM: Only mark EC GPE for wakeup on Intel systems") was short sighted and the symptoms were indicative of other problems. Some OEMs do have the dedicated GPIOs for the power button but also rely upon an interrupt to the EC SCI to let the lid work.
The original commit showed spurious activity on Lenovo systems:
* On both Lenovo T14 and P14s the keyboard wakeup doesn't work, and sometimes the power button event doesn't work.
This was confirmed on my end at that time.
However further development in the kernel showed that the issue was actually the IRQ for the GPIO controller was also shared with the EC SCI. This was actually fixed by commit 2d54067fcd23 ("pinctrl: amd: Fix wakeups when IRQ is shared with SCI").
The original commit also showed problems with AC adapter:
* On HP 635 G7 detaching or attaching AC during suspend will cause the system not to wakeup
* On Asus vivobook to prevent detaching AC causing resume problems
* On Lenovo 14ARE05 to prevent detaching AC causing resume problems
* On HP ENVY x360 to prevent detaching AC causing resume problems
Detaching AC adapter causing problems appears to have been a problem because the EC SCI went off to notify the OS of the power adapter change but the SCI was ignored and there was no other way to wake up this system since GPIO controller wasn't properly enabled. The wakeups were fixed by enabling the GPIO controller in commit acd47b9f28e5 ("pinctrl: amd: Handle wake-up interrupt").
I've confirmed on a variety of OEM notebooks with the following test
1) echo 1 | sudo tee /sys/power/pm_debug_messages
2) sudo systemctl suspend
3) unplug AC adapter, make sure system is still asleep
4) wake system from lid (which is provided by ACPI SCI on some of them)
5) dmesg
a) see the EC GPE dispatched, timekeeping for X seconds (matching ~time until AC adapter plug out)
b) see timekeeping for Y seconds until woke (matching ~time from AC adapter until lid event)
6) Look at /sys/kernel/debug/amd_pmc/s0ix_stats
"Time (in us) in S0i3" = X + Y - firmware processing time
--- drivers/acpi/x86/s2idle.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/acpi/x86/s2idle.c +4 -8
@@ -424,15 +424,11 @@ static int lps0_device_attach(struct acpi_device *adev, mem_sleep_current =PM_SUSPEND_TO_IDLE ;/* -* Some Intel based LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U don't -* use intel-hid or intel-vbtn but require the EC GPE to be enabled while -* suspended for certain wakeup devices to work, so mark it as wakeup-capable. -* -* Only enable on !AMD as enabling this universally causes problems for a number -* of AMD based systems. +* Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the +* EC GPE to be enabled while suspended for certain wakeup devices to +* work, so mark it as wakeup-capable. */ -if (!acpi_s2idle_vendor_amd ()) -acpi_ec_mark_gpe_for_wake (); +acpi_ec_mark_gpe_for_wake ();return 0 ; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 21/33 scsi: lpfc: Reduce log messages seen after firmware download
In reply to Sasha LevinFrom: James Smart <[email protected]>
[ Upstream commit 5852ed2a6a39c862c8a3fdf646e1f4e01b91d710 ]
Messages around firmware download were incorrectly tagged as being related to discovery trace events. Thus, firmware download status ended up dumping the trace log as well as the firmware update message. As there were a couple of log messages in this state, the trace log was dumped multiple times.
Resolve this by converting from trace events to SLI events.
--- drivers/scsi/lpfc/lpfc_init.c | 2 +- drivers/scsi/lpfc/lpfc_sli.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_init.c +1 -1
@@ -2055,7 +2055,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) }if (reg_err1 ==SLIPORT_ERR1_REG_ERR_CODE_2 && reg_err2 ==SLIPORT_ERR2_REG_FW_RESTART ) { -lpfc_printf_log (phba,KERN_ERR ,LOG_TRACE_EVENT , +lpfc_printf_log (phba,KERN_ERR ,LOG_SLI ,"3143 Port Down: Firmware Update " "Detected\n" ); en_rn_msg = false;
drivers/scsi/lpfc/lpfc_sli.c +7 -1
@@ -13366,6 +13366,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *phba)uint32_t uerr_sta_hi, uerr_sta_lo;uint32_t if_type, portsmphr;struct lpfc_register portstat_reg; +u32 logmask;/* * For now, use the SLI4 device internal unrecoverable error
@@ -13416,7 +13417,12 @@ lpfc_sli4_eratt_read(struct lpfc_hba *phba)readl (phba->sli4_hba.u.if_type2.ERR1regaddr); phba->work_status[1 ] =readl (phba->sli4_hba.u.if_type2.ERR2regaddr); -lpfc_printf_log (phba,KERN_ERR ,LOG_TRACE_EVENT , + logmask =LOG_TRACE_EVENT ; +if (phba->work_status[0 ] == +SLIPORT_ERR1_REG_ERR_CODE_2 && + phba->work_status[1 ] ==SLIPORT_ERR2_REG_FW_RESTART ) + logmask =LOG_SLI ; +lpfc_printf_log (phba,KERN_ERR , logmask,"2885 Port Status Event: " "port status reg 0x%x, " "port smphr reg 0x%x, "
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 22/33 ata: libata-core: Disable TRIM on M88V29
In reply to Sasha LevinFrom: Zoltán Böszörményi <[email protected]>
[ Upstream commit c8ea23d5fa59f28302d4e3370c75d9c308e64410 ]
This device is a CF card, or possibly an SSD in CF form factor. It supports NCQ and high speed DMA.
While it also advertises TRIM support, I/O errors are reported when the discard mount option fstrim is used. TRIM also fails when disabling NCQ and not just as an NCQ command.
TRIM must be disabled for this device.
--- drivers/ata/libata-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/libata-core.c +1 -0
@@ -4014,6 +4014,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {/* devices that don't properly handle TRIM commands */ { "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, }, + { "M88V29*", NULL, ATA_HORKAGE_NOTRIM, },/* * As defined, the DRAT (Deterministic Read After Trim) and RZAT
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 27/33 NFSD: Fix offset type in I/O trace points
In reply to Sasha LevinFrom: Chuck Lever <[email protected]>
[ Upstream commit 6a4d333d540041d244b2fca29b8417bfde20af81 ]
NFSv3 and NFSv4 use u64 offset values on the wire. Record these values verbatim without the implicit type case to loff_t.
--- fs/nfsd/trace.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
fs/nfsd/trace.h +7 -7
@@ -319,14 +319,14 @@ TRACE_EVENT(nfsd_export_update, DECLARE_EVENT_CLASS(nfsd_io_class, TP_PROTO(struct svc_rqst *rqstp, struct svc_fh *fhp, - loff_t offset, - unsigned long len), + u64 offset, + u32 len), TP_ARGS(rqstp, fhp, offset, len), TP_STRUCT__entry( __field(u32, xid) __field(u32, fh_hash) - __field(loff_t, offset) - __field(unsigned long, len) + __field(u64, offset) + __field(u32, len) ), TP_fast_assign( __entry->xid = be32_to_cpu(rqstp->rq_xid);
@@ -334,7 +334,7 @@ DECLARE_EVENT_CLASS(nfsd_io_class, __entry->offset = offset; __entry->len = len; ), -TP_printk ("xid=0x%08x fh_hash=0x%08x offset=%lld len=%lu" , +TP_printk ("xid=0x%08x fh_hash=0x%08x offset=%llu len=%u" , __entry->xid, __entry->fh_hash, __entry->offset, __entry->len) )
@@ -343,8 +343,8 @@ DECLARE_EVENT_CLASS(nfsd_io_class, DEFINE_EVENT(nfsd_io_class, nfsd_##name, \ TP_PROTO(struct svc_rqst *rqstp, \ struct svc_fh *fhp, \ - loff_t offset, \ - unsigned long len), \ + u64 offset, \ + u32 len), \ TP_ARGS(rqstp, fhp, offset, len))DEFINE_NFSD_IO_EVENT (read_start);
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 26/33 tracing: Fix tp_printk option related with tp_printk_stop_on_boot
In reply to Sasha LevinFrom: JaeSang Yoo <[email protected]>
[ Upstream commit 3203ce39ac0b2a57a84382ec184c7d4a0bede175 ]
The kernel parameter "tp_printk_stop_on_boot" starts with "tp_printk" which is the same as another kernel parameter "tp_printk". If "tp_printk" setup is called before the "tp_printk_stop_on_boot", it will override the latter and keep it from being set.
This is similar to other kernel parameter issues, such as:
Commit 745a600cf1a6 ("um: console: Ignore console= option")
or init/do_mounts.c:45 (setup function of "ro" kernel param)
Fix it by checking for a "_" right after the "tp_printk" and if that exists do not process the parameter.
--- kernel/trace/trace.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/trace/trace.c +4 -0
@@ -252,6 +252,10 @@ __setup("trace_clock=", set_trace_boot_clock);static int __init set_tracepoint_printk (char *str) { +/* Ignore the "tp_printk_stop_on_boot" param */ +if (*str =='_' ) +return 0 ; +if ((strcmp (str,"=0" ) !=0 &&strcmp (str,"=off" ) !=0 )) tracepoint_printk =1 ;return 1 ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 31/33 net: usb: qmi_wwan: Add support for Dell DW5829e
In reply to Sasha LevinFrom: Slark Xiao <[email protected]>
[ Upstream commit 8ecbb179286cbc91810c16caeb3396e06305cd0c ]
Dell DW5829e same as DW5821e except the CAT level. DW5821e supports CAT16 but DW5829e supports CAT9. Also, DW5829e includes normal and eSIM type. Please see below test evidence:
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e6 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 7 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e4 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e-eSIM Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
--- drivers/net/usb/qmi_wwan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/usb/qmi_wwan.c +2 -0
@@ -1395,6 +1395,8 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/ + {QMI_FIXED_INTF(0x413c, 0x81e4, 0)}, /* Dell Wireless 5829e with eSIM support*/ + {QMI_FIXED_INTF(0x413c, 0x81e6, 0)}, /* Dell Wireless 5829e */ {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 32/33 net: macb: Align the dma and coherent dma masks
In reply to Sasha LevinFrom: Marc St-Amand <[email protected]>
[ Upstream commit 37f7860602b5b2d99fc7465f6407f403f5941988 ]
Single page and coherent memory blocks can use different DMA masks when the macb accesses physical memory directly. The kernel is clever enough to allocate pages that fit into the requested address width.
When using the ARM SMMU, the DMA mask must be the same for single pages and big coherent memory blocks. Otherwise the translation tables turn into one big mess.
[ 74.959909] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK [ 74.959989] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1 [ 75.173939] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK [ 75.173955] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1
Since using the same DMA mask does not hurt direct 1:1 physical memory mappings, this commit always aligns DMA and coherent masks.
--- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +1 -1
@@ -4739,7 +4739,7 @@ static int macb_probe(struct platform_device *pdev)#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT if (GEM_BFEXT (DAW64 ,gem_readl (bp,DCFG6 ))) { -dma_set_mask (&pdev->dev,DMA_BIT_MASK (44 )); +dma_set_mask_and_coherent (&pdev->dev,DMA_BIT_MASK (44 )); bp->hw_dma_cap |=HW_DMA_CAP_64B ; }#endif
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 33/33 kconfig: fix failing to generate auto.conf
In reply to Sasha LevinFrom: Jing Leng <[email protected]>
[ Upstream commit 1b9e740a81f91ae338b29ed70455719804957b80 ]
When the KCONFIG_AUTOCONFIG is specified (e.g. export \
KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of include/config/ will not be created, so kconfig can't create deps files in it and auto.conf can't be generated.
--- scripts/kconfig/confdata.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
scripts/kconfig/confdata.c +9 -4
@@ -983,14 +983,19 @@ static int conf_write_dep(const char *name)static int conf_touch_deps (void ) { -const char *name; +const char *name, *tmp;struct symbol *sym;int res, i; -strcpy (depfile_path,"include/config/" ); - depfile_prefix_len =strlen (depfile_path); - name =conf_get_autoconfig_name (); + tmp =strrchr (name,'/' ); + depfile_prefix_len = tmp ? tmp - name +1 :0 ; +if (depfile_prefix_len +1 >sizeof (depfile_path)) +return -1 ; + +strncpy (depfile_path, name, depfile_prefix_len); + depfile_path[depfile_prefix_len] =0 ; +conf_read_simple (name,S_DEF_AUTO );sym_calc_value (modules_sym);
Signature · 1 line
2.34.1