drm/bridge: tc358762: Instruct DSI host to generate HSE packets
Subsystems (7)
Sasha Levin
maintainerPATCH 1/31 drm/bridge: tc358762: Instruct DSI host to generate HSE packets
From: Marek Vasut <[email protected]>
[ Upstream commit 362fa8f6e6a05089872809f4465bab9d011d05b3 ]
This bridge seems to need the HSE packet, otherwise the image is shifted up and corrupted at the bottom. This makes the bridge work with Samsung DSIM on i.MX8MM and i.MX8MP.
--- drivers/gpu/drm/bridge/tc358762.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358762.c +1 -1
@@ -216,7 +216,7 @@ static int tc358762_probe(struct mipi_dsi_device *dsi) dsi->lanes =1 ; dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->mode_flags =MIPI_DSI_MODE_VIDEO |MIPI_DSI_MODE_VIDEO_SYNC_PULSE | -MIPI_DSI_MODE_LPM ; +MIPI_DSI_MODE_LPM |MIPI_DSI_MODE_VIDEO_HSE ; ret =tc358762_parse_dt (ctx);if (ret <0 )
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 2/31 drm/edid: Add quirk for OSVR HDK 2.0
From: Ralph Campbell <[email protected]>
[ Upstream commit 98d4cb705bc00afd4a9a71cc1e84f7111682639a ]
The OSVR virtual reality headset HDK 2.0 uses a different EDID vendor and device identifier than the HDK 1.1 - 1.4 headsets. Add the HDK 2.0 vendor and device identifier to the quirks table so that window managers do not try to display the desktop screen on the headset display.
--- drivers/gpu/drm/drm_edid.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_edid.c +1 -0
@@ -230,6 +230,7 @@ static const struct edid_quirk {/* OSVR HDK and HDK2 VR Headsets */ EDID_QUIRK ('S' ,'V' ,'R' ,0x1019 ,EDID_QUIRK_NON_DESKTOP ), + EDID_QUIRK('A', 'U', 'O', 0x1111, EDID_QUIRK_NON_DESKTOP), };/*
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 3/31 drm: bridge: samsung-dsim: Drain command transfer FIFO before transfer
In reply to Sasha LevinFrom: Marek Vasut <[email protected]>
[ Upstream commit 14806c6415820b1c4bc317655c40784d050a2edb ]
Wait until the command transfer FIFO is empty before loading in the next command. The previous behavior where the code waited until command transfer FIFO was not full suffered from transfer corruption, where the last command in the FIFO could be overwritten in case the FIFO indicates not full, but also does not have enough space to store another transfer yet.
--- drivers/gpu/drm/bridge/samsung-dsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/samsung-dsim.c +1 -1
@@ -932,7 +932,7 @@ static int samsung_dsim_wait_for_hdr_fifo(struct samsung_dsim *dsi) do { u32 reg = samsung_dsim_read(dsi, DSIM_FIFOCTRL_REG); - if (!(reg & DSIM_SFR_HEADER_FULL)) + if (reg & DSIM_SFR_HEADER_EMPTY) return 0; if (!cond_resched())
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 10/31 drm/amd/display: Add stream overhead in BW calculations for 128b/132b
In reply to Sasha LevinFrom: George Shen <[email protected]>
[ Upstream commit 974764180838516f80a13257da67a1ec6afb87d4 ]
[Why]
Current BW calculations do not account for the additional padding added for uncompressed pixel-to-symbol packing.
This results in X.Y being too low for 128b/132b SST streams in certain scenarios. If X.Y is too low, end user can observe image corruption.
[How]
Add function to calculate stream overhead to timing BW calculation for 128b/132b SST cases.
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 + drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 42 +++++++++++++++++++++ 2 files changed, 44 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -1375,6 +1375,8 @@ struct dc_plane_state *dc_get_surface_for_mpcc(struct dc *dc,uint32_t dc_get_opp_for_plane (struct dc *dc,struct dc_plane_state *plane); +void dc_set_disable_128b_132b_stream_overhead (bool disable); +/* The function returns minimum bandwidth required to drive a given timing * return - minimum required timing bandwidth in kbps. */
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +42 -0
60 lines not on this page · raw message
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 9/31 arm64: dts: qcom: sm8250-edo: correct ramoops pmsg-size
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 7dc3606f91427414d00a2fb09e6e0e32c14c2093 ]
There is no 'msg-size' property in ramoops, so assume intention was for 'pmsg-size':
sm8250-sony-xperia-edo-pdx206.dtb: ramoops@ffc00000: Unevaluated properties are not allowed ('msg-size' was unexpected)
--- arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi +1 -1
@@ -112,7 +112,7 @@ ramoops@ffc00000 { reg = <0x0 0xffc00000 0x0 0x100000>; record-size = <0x1000>; console-size = <0x40000>; - msg-size = <0x20000 0x20000>; + pmsg-size = <0x20000>; ecc-size = <16>; no-map; };
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 12/31 drm/amd/display: Read down-spread percentage from lut to adjust dprefclk.
In reply to Sasha LevinFrom: Martin Tsai <[email protected]>
[ Upstream commit 6917b0b711713b9d84d7e0844e9aa613997a51b2 ]
[Why]
Panels show corruption with high refresh rate timings when ss is enabled.
[How]
Read down-spread percentage from lut to adjust dprefclk.
--- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 33 +++++++++++++++++-- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.h | 7 ++++ 2 files changed, 38 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +31 -2
@@ -87,6 +87,14 @@ static const struct IP_BASE CLK_BASE = { { { { 0x00016C00, 0x02401800, 0, 0, 0,#define CLK1_CLK_PLL_REQ__PllSpineDiv_MASK 0x0000F000L#define CLK1_CLK_PLL_REQ__FbMult_frac_MASK 0xFFFF0000L +#define regCLK1_CLK2_BYPASS_CNTL 0x029c +#define regCLK1_CLK2_BYPASS_CNTL_BASE_IDX 0 + +#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL__SHIFT 0x0 +#define CLK1_CLK2_BYPASS_CNTL__LK2_BYPASS_DIV__SHIFT 0x10 +#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL_MASK 0x00000007L +#define CLK1_CLK2_BYPASS_CNTL__LK2_BYPASS_DIV_MASK 0x000F0000L +#define REG (reg_name) \ (CLK_BASE.instance[0].segment[reg ## reg_name ## _BASE_IDX] + reg ## reg_name)
@@ -440,6 +448,11 @@ static DpmClocks314_t dummy_clocks;static struct dcn314_watermarks dummy_wms = {0 }; +static struct dcn314_ss_info_table ss_info_table = { + .ss_divider =1000 , + .ss_percentage = {0 ,0 ,375 ,375 ,375 } +}; +static void dcn314_build_watermark_ranges (struct clk_bw_params *bw_params,struct dcn314_watermarks *table) {int i, num_valid_sets;
@@ -719,6 +732,20 @@ static struct clk_mgr_funcs dcn314_funcs = { };extern struct clk_mgr_funcs dcn3_fpga_funcs; +static void dcn314_read_ss_info_from_lut (struct clk_mgr_internal *clk_mgr) +{ +uint32_t clock_source; + +REG_GET (CLK1_CLK2_BYPASS_CNTL ,CLK2_BYPASS_SEL , &clock_source); + + clk_mgr->dprefclk_ss_percentage = ss_info_table.ss_percentage[clock_source]; + +if (clk_mgr->dprefclk_ss_percentage !=0 ) { + clk_mgr->ss_on_dprefclk = true; + clk_mgr->dprefclk_ss_divider = ss_info_table.ss_divider; + } +} + void dcn314_clk_mgr_construct( struct dc_context *ctx, struct clk_mgr_dcn314 *clk_mgr,
@@ -791,9 +818,11 @@ void dcn314_clk_mgr_construct( clk_mgr->base.base.dprefclk_khz =600000 ; clk_mgr->base.base.clks.ref_dtbclk_khz =600000 ; -dce_clock_read_ss_info (&clk_mgr->base); + +dcn314_read_ss_info_from_lut (&clk_mgr->base);/*if bios enabled SS, driver needs to adjust dtb clock, only enable with correct bios*/ -//clk_mgr->base.dccg->ref_dtbclk_khz = dce_adjust_dp_ref_freq_for_ss(clk_mgr_internal, clk_mgr->base.base.dprefclk_khz); + clk_mgr->base.base.dprefclk_khz = +dce_adjust_dp_ref_freq_for_ss (&clk_mgr->base, clk_mgr->base.base.dprefclk_khz); clk_mgr->base.base.bw_params = &dcn314_bw_params;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.h +7 -0
@@ -28,6 +28,8 @@#define __DCN314_CLK_MGR_H__#include "clk_mgr_internal.h" +#define NUM_CLOCK_SOURCES 5 +struct dcn314_watermarks ;struct dcn314_smu_watermark_set {
@@ -40,6 +42,11 @@ struct clk_mgr_dcn314 {struct dcn314_smu_watermark_set smu_wm_set; }; +struct dcn314_ss_info_table { +uint32_t ss_divider; +uint32_t ss_percentage[NUM_CLOCK_SOURCES ]; +}; +bool dcn314_are_clock_states_equal (struct dc_clocks *a,struct dc_clocks *b);
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 13/31 drm/amd/display: Fix underflow issue on 175hz timing
In reply to Sasha LevinFrom: Leo Ma <[email protected]>
[ Upstream commit 735688eb905db529efea0c78466fccc1461c3fde ]
[Why]
Screen underflows happen on 175hz timing for 3 plane overlay case.
[How]
Based on dst y prefetch value clamp to equ or oto for bandwidth calculation.
--- .../amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +6 -1
@@ -3463,6 +3463,7 @@ bool dml32_CalculatePrefetchSchedule(double TimeForFetchingMetaPTE =0 ;double TimeForFetchingRowInVBlank =0 ;double LinesToRequestPrefetchPixelData =0 ; +double LinesForPrefetchBandwidth =0 ;unsigned int HostVMDynamicLevelsTrips;double trip_to_mem;double Tvm_trips;
@@ -3892,11 +3893,15 @@ bool dml32_CalculatePrefetchSchedule( TimeForFetchingMetaPTE = Tvm_oto; TimeForFetchingRowInVBlank = Tr0_oto; *PrefetchBandwidth = prefetch_bw_oto; +/* Clamp to oto for bandwidth calculation */ + LinesForPrefetchBandwidth = dst_y_prefetch_oto; }else { *DestinationLinesForPrefetch = dst_y_prefetch_equ; TimeForFetchingMetaPTE = Tvm_equ; TimeForFetchingRowInVBlank = Tr0_equ; *PrefetchBandwidth = prefetch_bw_equ; +/* Clamp to equ for bandwidth calculation */ + LinesForPrefetchBandwidth = dst_y_prefetch_equ; } *DestinationLinesToRequestVMInVBlank =dml_ceil (4.0 * TimeForFetchingMetaPTE / LineTime,1.0 ) /4.0 ;
@@ -3904,7 +3909,7 @@ bool dml32_CalculatePrefetchSchedule( *DestinationLinesToRequestRowInVBlank =dml_ceil (4.0 * TimeForFetchingRowInVBlank / LineTime,1.0 ) /4.0 ; - LinesToRequestPrefetchPixelData = *DestinationLinesForPrefetch - + LinesToRequestPrefetchPixelData = LinesForPrefetchBandwidth - *DestinationLinesToRequestVMInVBlank -2 * *DestinationLinesToRequestRowInVBlank;#ifdef __DML_VBA_DEBUG__
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 14/31 drm/vkms: Fix race-condition between the hrtimer and the atomic commit
In reply to Sasha LevinFrom: Maíra Canal <[email protected]>
[ Upstream commit a0e6a017ab56936c0405fe914a793b241ed25ee0 ]
Currently, it is possible for the composer to be set as enabled and then as disabled without a proper call for the vkms_vblank_simulate(). This is problematic, because the driver would skip one CRC output, causing CRC tests to fail. Therefore, we need to make sure that, for each time the composer is set as enabled, a composer job is added to the queue.
In order to provide this guarantee, add a mutex that will lock before the composer is set as enabled and will unlock only after the composer job is added to the queue. This way, we can have a guarantee that the driver won't skip a CRC entry.
This race-condition is affecting the IGT test "writeback-check-output", making the test fail and also, leaking writeback framebuffers, as the writeback job is queued, but it is not signaled. This patch avoids both problems.
[v2]:
* Create a new mutex and keep the spinlock across the atomic commit in order to avoid interrupts that could result in deadlocks.
--- drivers/gpu/drm/vkms/vkms_composer.c | 9 +++++++-- drivers/gpu/drm/vkms/vkms_crtc.c | 9 +++++---- drivers/gpu/drm/vkms/vkms_drv.h | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-)
drivers/gpu/drm/vkms/vkms_composer.c +7 -2
@@ -296,10 +296,15 @@ void vkms_set_composer(struct vkms_output *out, bool enabled)if (enabled)drm_crtc_vblank_get (&out->crtc); -spin_lock_irq (&out->lock); +mutex_lock (&out->enabled_lock); old_enabled = out->composer_enabled; out->composer_enabled = enabled; -spin_unlock_irq (&out->lock); + +/* the composition wasn't enabled, so unlock the lock to make sure the lock +* will be balanced even if we have a failed commit +*/ +if (!out->composer_enabled) +mutex_unlock (&out->enabled_lock);if (old_enabled)drm_crtc_vblank_put (&out->crtc);
drivers/gpu/drm/vkms/vkms_crtc.c +5 -4
@@ -16,7 +16,7 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)struct drm_crtc *crtc = &output->crtc;struct vkms_crtc_state *state;u64 ret_overrun; -bool ret, fence_cookie; +bool ret, fence_cookie, composer_enabled; fence_cookie =dma_fence_begin_signalling ();
@@ -25,15 +25,15 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)if (ret_overrun !=1 )pr_warn ("%s: vblank timer overrun\n" , __func__); -spin_lock (&output->lock); ret =drm_crtc_handle_vblank (crtc);if (!ret)DRM_ERROR ("vkms failure on handling vblank" ); state = output->composer_state; -spin_unlock (&output->lock); + composer_enabled = output->composer_enabled; +mutex_unlock (&output->enabled_lock); -if (state && output->composer_enabled) { +if (state && composer_enabled) {u64 frame =drm_crtc_accurate_vblank_count (crtc);/* update frame_start only if a queued vkms_composer_worker()
@@ -293,6 +293,7 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,spin_lock_init (&vkms_out->lock);spin_lock_init (&vkms_out->composer_lock); +mutex_init (&vkms_out->enabled_lock); vkms_out->composer_workq =alloc_ordered_workqueue ("vkms_composer" ,0 );if (!vkms_out->composer_workq)
drivers/gpu/drm/vkms/vkms_drv.h +3 -1
@@ -98,8 +98,10 @@ struct vkms_output {struct workqueue_struct *composer_workq;/* protects concurrent access to composer */ spinlock_t lock; +/* guarantees that if the composer is enabled, a job will be queued */ +struct mutex enabled_lock; -/* protected by @lock */ +/* protected by @enabled_lock */ bool composer_enabled;struct vkms_crtc_state *composer_state;
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 15/31 ASoC: SOF: topology: simplify code to prevent static analysis warnings
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 55cb3dc271d81f1982c949a2ac483a6daf613b92 ]
make KCFLAGS='-fanalyzer' sound/soc/sof/intel/ reports a possible NULL pointer dereference.
sound/soc/sof/topology.c:1136:21: error: dereference of NULL ‘w’ [CWE-476] [-Werror=analyzer-null-dereference]
1136 | strcmp(w->sname, rtd->dai_link->stream_name))
The code is rather confusing and can be simplified to make static analysis happy. No functionality change.
--- sound/soc/sof/topology.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/sof/topology.c +3 -2
@@ -1117,10 +1117,11 @@ static void sof_disconnect_dai_widget(struct snd_soc_component *scomp, {struct snd_soc_card *card = scomp->card;struct snd_soc_pcm_runtime *rtd; +const char *sname = w->sname;struct snd_soc_dai *cpu_dai;int i, stream; -if (!w->sname) +if (!sname)return ;if (w->id == snd_soc_dapm_dai_out)
@@ -1133,7 +1134,7 @@ static void sof_disconnect_dai_widget(struct snd_soc_component *scomp,list_for_each_entry (rtd, &card->rtd_list, list) {/* does stream match DAI link ? */ if (!rtd->dai_link->stream_name || -strcmp (w->sname, rtd->dai_link->stream_name)) +strcmp (sname, rtd->dai_link->stream_name))continue ;for_each_rtd_cpu_dais (rtd, i, cpu_dai)
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 18/31 drm/amd/display: Use DTBCLK as refclk instead of DPREFCLK
In reply to Sasha LevinFrom: Austin Zheng <[email protected]>
[ Upstream commit 4a30cc2bd281fa176a68b5305cd3695d636152ad ]
[Why]
Flash of corruption observed when UCLK switching after transitioning from DTBCLK to DPREFCLK on subVP(DP) + subVP(HDMI) config Scenario where DPREFCLK is required instead of DTBCLK is not expected
[How]
Always set the DTBCLK source as DTBCLK0
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +2 -1
@@ -290,7 +290,8 @@ static void dccg32_set_dpstreamclk(struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);/* set the dtbclk_p source */ -dccg32_set_dtbclk_p_src (dccg, src, otg_inst); +/* always program refclk as DTBCLK. No use-case expected to require DPREFCLK as refclk */ +dccg32_set_dtbclk_p_src (dccg,DTBCLK0 , otg_inst);/* enabled to select one of the DTBCLKs for pipe */ switch (dp_hpo_inst) {
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 4/31 ASoC: amd: vangogh: Use dmi_first_match() for DMI quirk handling
In reply to Sasha LevinFrom: Cristian Ciocaltea <[email protected]>
[ Upstream commit 3dd26e27ccb4f18b4d25c0a49e1888eca9c6a724 ]
In preparation for supporting ACPI probing, move DMI quirk handling logic at the probe's top, to be able to return as quickly as possible in case there is no DMI matching.
Additionally, simplify the code by replacing dmi_check_system() and related callback with dmi_first_match(). While at it, also drop a few unnecessary empty lines.
--- sound/soc/amd/vangogh/acp5x-mach.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-)
sound/soc/amd/vangogh/acp5x-mach.c +7 -21
@@ -22,7 +22,6 @@#define DRV_NAME "acp5x_mach"#define DUAL_CHANNEL 2 -#define VG_JUPITER 1#define ACP5X_NAU8821_BCLK 3072000#define ACP5X_NAU8821_FREQ_OUT 12288000#define ACP5X_NAU8821_COMP_NAME "i2c-NVTN2020:00"
@@ -31,7 +30,6 @@#define ACP5X_CS35L41_COMP_RNAME "spi-VLV1776:01"#define ACP5X_CS35L41_DAI_NAME "cs35l41-pcm" -static unsigned long acp5x_machine_id;static struct snd_soc_jack vg_headset;SND_SOC_DAILINK_DEF (platform,DAILINK_COMP_ARRAY (COMP_PLATFORM ("acp5x_i2s_dma.0" )));
@@ -242,7 +240,6 @@ static int acp5x_cs35l41_hw_params(struct snd_pcm_substream *substream, }return 0 ; - }static const struct snd_soc_ops acp5x_cs35l41_play_ops = {
@@ -292,8 +289,6 @@ static struct snd_soc_dai_link acp5x_8821_35l41_dai[] = { }, }; - -static const struct snd_soc_dapm_widget acp5x_8821_35l41_widgets[] = {SND_SOC_DAPM_HP ("Headphone" ,NULL ),SND_SOC_DAPM_MIC ("Headset Mic" ,NULL ),
@@ -331,16 +326,8 @@ static struct snd_soc_card acp5x_8821_35l41_card = { .num_controls = ARRAY_SIZE(acp5x_8821_controls), }; -static int acp5x_vg_quirk_cb (const struct dmi_system_id *id) -{ - acp5x_machine_id =VG_JUPITER ; - -return 1 ; -} -static const struct dmi_system_id acp5x_vg_quirk_table[] = { { - .callback = acp5x_vg_quirk_cb, .matches = {DMI_EXACT_MATCH (DMI_BOARD_VENDOR ,"Valve" ),DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"Jupiter" ),
@@ -351,23 +338,22 @@ static const struct dmi_system_id acp5x_vg_quirk_table[] = {static int acp5x_probe (struct platform_device *pdev) { +const struct dmi_system_id *dmi_id;struct acp5x_platform_info *machine;struct device *dev = &pdev->dev;struct snd_soc_card *card;int ret; + dmi_id =dmi_first_match (acp5x_vg_quirk_table); +if (!dmi_id) +return -ENODEV ; + + card = &acp5x_8821_35l41_card; + machine =devm_kzalloc (dev,sizeof (*machine),GFP_KERNEL );if (!machine)return -ENOMEM ; -dmi_check_system (acp5x_vg_quirk_table); -switch (acp5x_machine_id) { -case VG_JUPITER : - card = &acp5x_8821_35l41_card; -break ; -default : -return -ENODEV ; - } card->dev = dev;platform_set_drvdata (pdev, card);snd_soc_card_set_drvdata (card, machine);
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 5/31 arm64: dts: qcom: sm6125-pdx201: correct ramoops pmsg-size
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit c42f5452de6ad2599c6e5e2a64c180a4ac835d27 ]
There is no 'msg-size' property in ramoops, so assume intention was for 'pmsg-size':
sm6125-sony-xperia-seine-pdx201.dtb: ramoops@ffc00000: Unevaluated properties are not allowed ('msg-size' was unexpected)
--- arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts +1 -1
@@ -79,7 +79,7 @@ pstore_mem: ramoops@ffc00000 { reg = <0x0 0xffc40000 0x0 0xc0000>; record-size = <0x1000>; console-size = <0x40000>; - msg-size = <0x20000 0x20000>; + pmsg-size = <0x20000>; }; cmdline_mem: memory@ffd00000 {
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 19/31 drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN31
In reply to Sasha LevinFrom: Leo Chen <[email protected]>
[ Upstream commit 026a71babf48efb6b9884a3a66fa31aec9e1ea54 ]
[Why & How]
HDMI TMDS does not have ODM support. Filtering 420 modes that exceed the 4096 FMT limitation on DCN31 will resolve intermittent corruptions issues.
--- .../gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +3 -1
@@ -4135,7 +4135,9 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l }if (v->OutputFormat[k] == dm_420 && v->HActive[k] >DCN31_MAX_FMT_420_BUFFER_WIDTH && v->ODMCombineEnablePerState[i][k] != dm_odm_combine_mode_4to1) { -if (v->HActive[k] /2 >DCN31_MAX_FMT_420_BUFFER_WIDTH ) { +if (v->Output[k] == dm_hdmi) { + FMTBufferExceeded = true; + }else if (v->HActive[k] /2 >DCN31_MAX_FMT_420_BUFFER_WIDTH ) { v->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_4to1; v->PlaneRequiredDISPCLK = v->PlaneRequiredDISPCLKWithODMCombine4To1;
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 22/31 io_uring: annotate the struct io_kiocb slab for appropriate user copy
In reply to Sasha LevinFrom: Jens Axboe <[email protected]>
[ Upstream commit b97f96e22f051d59d07a527dbd7d90408b661ca8 ]
When compiling the kernel with clang and having HARDENED_USERCOPY enabled, the liburing openat2.t test case fails during request setup:
usercopy: Kernel memory overwrite attempt detected to SLUB object 'io_kiocb' (offset 24, size 24)!
------------[ cut here ]------------ kernel BUG at mm/usercopy.c:102! invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC CPU: 3 PID: 413 Comm: openat2.t Tainted: G N 6.4.3-g6995e2de6891-dirty #19 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.1-0-g3208b098f51a-prebuilt.qemu.org 04/01/2014 RIP: 0010:usercopy_abort+0x84/0x90 Code: ce 49 89 ce 48 c7 c3 68 48 98 82 48 0f 44 de 48 c7 c7 56 c6 94 82 4c 89 de 48 89 c1 41 52 41 56 53 e8 e0 51 c5 00 48 83 c4 18 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 41 57 41 56 RSP: 0018:ffffc900016b3da0 EFLAGS: 00010296 RAX: 0000000000000062 RBX: ffffffff82984868 RCX: 4e9b661ac6275b00 RDX: ffff8881b90ec580 RSI: ffffffff82949a64 RDI: 00000000ffffffff RBP: 0000000000000018 R08: 0000000000000000 R09: 0000000000000000 R10: ffffc900016b3c88 R11: ffffc900016b3c30 R12: 00007ffe549659e0 R13: ffff888119014000 R14: 0000000000000018 R15: 0000000000000018 FS: 00007f862e3ca680(0000) GS:ffff8881b90c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005571483542a8 CR3: 0000000118c11000 CR4: 00000000003506e0 Call Trace: <TASK> ? __die_body+0x63/0xb0 ? die+0x9d/0xc0 ? do_trap+0xa7/0x180 ? usercopy_abort+0x84/0x90 ? do_error_trap+0xc6/0x110 ? usercopy_abort+0x84/0x90 ? handle_invalid_op+0x2c/0x40 ? usercopy_abort+0x84/0x90 ? exc_invalid_op+0x2f/0x40 ? asm_exc_invalid_op+0x16/0x20 ? usercopy_abort+0x84/0x90 __check_heap_object+0xe2/0x110 __check_object_size+0x142/0x3d0 io_openat2_prep+0x68/0x140 io_submit_sqes+0x28a/0x680 __se_sys_io_uring_enter+0x120/0x580 do_syscall_64+0x3d/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x55714834de26 Code: ca 01 0f b6 82 d0 00 00 00 8b ba cc 00 00 00 45 31 c0 31 d2 41 b9 08 00 00 00 83 e0 01 c1 e0 04 41 09 c2 b8 aa 01 00 00 0f 05 <c3> 66 0f 1f 84 00 00 00 00 00 89 30 eb 89 0f 1f 40 00 8b 00 a8 06 RSP: 002b:00007ffe549659c8 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007ffe54965a50 RCX: 000055714834de26 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000008 R10: 0000000000000000 R11: 0000000000000246 R12: 000055714834f057 R13: 00007ffe54965a50 R14: 0000000000000001 R15: 0000557148351dd8 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]---
when it tries to copy struct open_how from userspace into the per-command space in the io_kiocb. There's nothing wrong with the copy, but we're missing the appropriate annotations for allowing user copies to/from the io_kiocb slab.
Allow copies in the per-command area, which is from the 'file' pointer to when 'opcode' starts. We do have existing user copies there, but they are not all annotated like the one that openat2_prep() uses, copy_struct_from_user(). But in practice opcodes should be allowed to copy data into their per-command area in the io_kiocb.
--- io_uring/io_uring.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
io_uring/io_uring.c +14 -2
@@ -4591,8 +4591,20 @@ static int __init io_uring_init(void)io_uring_optable_init (); - req_cachep =KMEM_CACHE (io_kiocb,SLAB_HWCACHE_ALIGN |SLAB_PANIC | -SLAB_ACCOUNT |SLAB_TYPESAFE_BY_RCU ); +/* +* Allow user copy in the per-command field, which starts after the +* file in io_kiocb and until the opcode field. The openat2 handling +* requires copying in user memory into the io_kiocb object in that +* range, and HARDENED_USERCOPY will complain if we haven't +* correctly annotated this range. +*/ + req_cachep =kmem_cache_create_usercopy ("io_kiocb" , +sizeof (struct io_kiocb ),0 , +SLAB_HWCACHE_ALIGN |SLAB_PANIC | +SLAB_ACCOUNT |SLAB_TYPESAFE_BY_RCU , + offsetof(struct io_kiocb, cmd.data), + sizeof_field(struct io_kiocb, cmd.data), NULL); +return 0 ; };__initcall (io_uring_init);
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 21/31 drm/exynos: fix a possible null-pointer dereference due to data race in exynos_drm_crtc_atomic_disable()
In reply to Sasha LevinFrom: Tuo Li <[email protected]>
[ Upstream commit 2e63972a2de14482d0eae1a03a73e379f1c3f44c ]
The variable crtc->state->event is often protected by the lock crtc->dev->event_lock when is accessed. However, it is accessed as a condition of an if statement in exynos_drm_crtc_atomic_disable() without holding the lock:
if (crtc->state->event && !crtc->state->active)
However, if crtc->state->event is changed to NULL by another thread right after the conditions of the if statement is checked to be true, a null-pointer dereference can occur in drm_crtc_send_vblank_event():
e->pipe = pipe;
To fix this possible null-pointer dereference caused by data race, the spin lock coverage is extended to protect the if statement as well as the function call to drm_crtc_send_vblank_event().
Added relevant link.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +2 -3
@@ -39,13 +39,12 @@ static void exynos_drm_crtc_atomic_disable(struct drm_crtc *crtc,if (exynos_crtc->ops->atomic_disable) exynos_crtc->ops->atomic_disable (exynos_crtc); +spin_lock_irq (&crtc->dev->event_lock);if (crtc->state->event && !crtc->state->active) { -spin_lock_irq (&crtc->dev->event_lock);drm_crtc_send_vblank_event (crtc, crtc->state->event); -spin_unlock_irq (&crtc->dev->event_lock); - crtc->state->event =NULL ; } +spin_unlock_irq (&crtc->dev->event_lock); } static int exynos_crtc_atomic_check(struct drm_crtc *crtc,
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 20/31 drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN314
In reply to Sasha LevinFrom: Leo Chen <[email protected]>
[ Upstream commit 4c6107a653ccf361cb1b6ba35d558a1a5e6e57ac ]
[Why & How]
HDMI TMDS does not have ODM support. Filtering 420 modes that exceed the 4096 FMT limitation on DCN314 will resolve intermittent corruptions issues.
--- .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +3 -1
@@ -4227,7 +4227,9 @@ void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_ }if (v->OutputFormat[k] == dm_420 && v->HActive[k] >DCN314_MAX_FMT_420_BUFFER_WIDTH && v->ODMCombineEnablePerState[i][k] != dm_odm_combine_mode_4to1) { -if (v->HActive[k] /2 >DCN314_MAX_FMT_420_BUFFER_WIDTH ) { +if (v->Output[k] == dm_hdmi) { + FMTBufferExceeded = true; + }else if (v->HActive[k] /2 >DCN314_MAX_FMT_420_BUFFER_WIDTH ) { v->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_4to1; v->PlaneRequiredDISPCLK = v->PlaneRequiredDISPCLKWithODMCombine4To1;
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 23/31 drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer()
In reply to Sasha LevinFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit fd70e2019bfbcb0ed90c5e23839bf510ce6acf8f ]
Change logging from drm_{err,info}() to dev_{err,info}() in functions mtk_dp_aux_transfer() and mtk_dp_aux_do_transfer(): this will be essential to avoid getting NULL pointer kernel panics if any kind of error happens during AUX transfers happening before the bridge is attached.
This may potentially start happening in a later commit implementing aux-bus support, as AUX transfers will be triggered from the panel driver (for EDID) before the mtk-dp bridge gets attached, and it's done in preparation for the same.
--- drivers/gpu/drm/mediatek/mtk_dp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_dp.c +3 -3
@@ -847,7 +847,7 @@ static int mtk_dp_aux_do_transfer(struct mtk_dp *mtk_dp, bool is_read, u8 cmd,u32 phy_status =mtk_dp_read (mtk_dp,MTK_DP_AUX_P0_3628 ) &AUX_RX_PHY_STATE_AUX_TX_P0_MASK ;if (phy_status !=AUX_RX_PHY_STATE_AUX_TX_P0_RX_IDLE ) { -drm_err (mtk_dp->drm_dev, +dev_err (mtk_dp->dev,"AUX Rx Aux hang, need SW reset\n" );return -EIO ; }
@@ -2057,7 +2057,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, is_read = true;break ;default : -drm_err (mtk_aux->drm_dev,"invalid aux cmd = %d\n" , +dev_err (mtk_dp->dev,"invalid aux cmd = %d\n" , msg->request); ret = -EINVAL ; goto err;
@@ -2073,7 +2073,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, to_access, &msg->reply);if (ret) { -drm_info (mtk_dp->drm_dev, +dev_info (mtk_dp->dev,"Failed to do AUX transfer: %d\n" , ret); goto err; }
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 16/31 ASoC: Intel: sof_sdw: Update BT offload config for soundwire config
In reply to Sasha LevinFrom: Uday M Bhat <[email protected]>
[ Upstream commit a14aded9299187bb17ef90700eb2cf1120ef5885 ]
For soundwire config, SSP1 is used for BT offload. This is enabled in sof_sdw_quirk_table
--- sound/soc/intel/boards/sof_sdw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/intel/boards/sof_sdw.c +3 -1
@@ -439,7 +439,9 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {DMI_MATCH (DMI_SYS_VENDOR ,"Google" ), DMI_MATCH(DMI_PRODUCT_NAME, "Rex"), }, - .driver_data = (void *)(SOF_SDW_PCH_DMIC), + .driver_data = (void *)(SOF_SDW_PCH_DMIC | +SOF_BT_OFFLOAD_SSP (1 ) | + SOF_SSP_BT_OFFLOAD_PRESENT), }, /* LunarLake devices */ {
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 7/31 arm64: dts: qcom: sm6350: correct ramoops pmsg-size
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit c86b97a72065e06eacb993dc71fa9febc93422af ]
There is no 'msg-size' property in ramoops, so assume intention was for 'pmsg-size':
sm6350-sony-xperia-lena-pdx213.dtb: ramoops@ffc00000: Unevaluated properties are not allowed ('msg-size' was unexpected)
--- arch/arm64/boot/dts/qcom/sm6350.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm6350.dtsi +1 -1
@@ -513,7 +513,7 @@ ramoops: ramoops@ffc00000 { reg = <0 0xffc00000 0 0x100000>; record-size = <0x1000>; console-size = <0x40000>; - msg-size = <0x20000 0x20000>; + pmsg-size = <0x20000>; ecc-size = <16>; no-map; };
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 11/31 samples/hw_breakpoint: Fix kernel BUG 'invalid opcode: 0000'
In reply to Sasha LevinFrom: Rong Tao <[email protected]>
[ Upstream commit 910e230d5f1bb72c54532e94fbb1705095c7bab6 ]
Macro symbol_put() is defined as __symbol_put(__stringify(x))
ksym_name = "jiffies"
symbol_put(ksym_name)
will be resolved as
__symbol_put("ksym_name")which is clearly wrong. So symbol_put must be replaced with __symbol_put.
When we uninstall hw_breakpoint.ko (rmmod), a kernel bug occurs with the following error:
[11381.854152] kernel BUG at kernel/module/main.c:779! [11381.854159] invalid opcode: 0000 [#2] PREEMPT SMP PTI [11381.854163] CPU: 8 PID: 59623 Comm: rmmod Tainted: G D OE 6.2.9-200.fc37.x86_64 #1 [11381.854167] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./B360M-HDV, BIOS P3.20 10/23/2018 [11381.854169] RIP: 0010:__symbol_put+0xa2/0xb0 [11381.854175] Code: 00 e8 92 d2 f7 ff 65 8b 05 c3 2f e6 78 85 c0 74 1b 48 8b 44 24 30 65 48 2b 04 25 28 00 00 00 75 12 48 83 c4 38 c3 cc cc cc cc <0f> 0b 0f 1f 44 00 00 eb de e8 c0 df d8 00 90 90 90 90 90 90 90 90 [11381.854178] RSP: 0018:ffffad8ec6ae7dd0 EFLAGS: 00010246 [11381.854181] RAX: 0000000000000000 RBX: ffffffffc1fd1240 RCX: 000000000000000c [11381.854184] RDX: 000000000000006b RSI: ffffffffc02bf7c7 RDI: ffffffffc1fd001c [11381.854186] RBP: 000055a38b76e7c8 R08: ffffffff871ccfe0 R09: 0000000000000000 [11381.854188] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [11381.854190] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [11381.854192] FS: 00007fbf7c62c740(0000) GS:ffff8c5badc00000(0000) knlGS:0000000000000000 [11381.854195] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [11381.854197] CR2: 000055a38b7793f8 CR3: 0000000363e1e001 CR4: 00000000003726e0 [11381.854200] DR0: ffffffffb3407980 DR1: 0000000000000000 DR2: 0000000000000000 [11381.854202] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [11381.854204] Call Trace: [11381.854207] <TASK> [11381.854212] s_module_exit+0xc/0xff0 [symbol_getput] [11381.854219] __do_sys_delete_module.constprop.0+0x198/0x2f0 [11381.854225] do_syscall_64+0x58/0x80 [11381.854231] ? exit_to_user_mode_prepare+0x180/0x1f0 [11381.854237] ? syscall_exit_to_user_mode+0x17/0x40 [11381.854241] ? do_syscall_64+0x67/0x80 [11381.854245] ? syscall_exit_to_user_mode+0x17/0x40 [11381.854248] ? do_syscall_64+0x67/0x80 [11381.854252] ? exc_page_fault+0x70/0x170 [11381.854256] entry_SYSCALL_64_after_hwframe+0x72/0xdc
--- samples/hw_breakpoint/data_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/hw_breakpoint/data_breakpoint.c +1 -1
@@ -70,7 +70,7 @@ static int __init hw_break_module_init(void) static void __exit hw_break_module_exit(void) {unregister_wide_hw_breakpoint (sample_hbp); -symbol_put (ksym_name); +__symbol_put (ksym_name);printk (KERN_INFO "HW Breakpoint for %s write uninstalled\n" , ksym_name); }
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 25/31 arm64: dts: qcom: sc8280xp-x13s: Add camera activity LED
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 1c63dd1c5fdafa8854526d7d60d2b741c813678d ]
Disappointigly, the camera activity LED is implemented in software. Hook it up as a gpio-led and (until we have camera *and* a "camera on" LED trigger) configure it as a panic indicator.
--- .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +16 -0
@@ -12,6 +12,7 @@ #include <dt-bindings/iio/qcom,spmi-adc7-pmr735a.h> #include <dt-bindings/input/gpio-keys.h> #include <dt-bindings/input/input.h> +#include <dt-bindings/leds/common.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include "sc8280xp.dtsi"
@@ -78,6 +79,21 @@ switch-lid { }; }; + leds { + compatible = "gpio-leds"; + + led-camera-indicator { + label = "white:camera-indicator"; + function = LED_FUNCTION_INDICATOR; + color = <LED_COLOR_ID_WHITE>; + gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "none"; + default-state = "off"; + /* Reuse as a panic indicator until we get a "camera on" trigger */ + panic-indicator; + }; + }; + pmic-glink { compatible = "qcom,sc8280xp-pmic-glink", "qcom,pmic-glink";
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 27/31 md: raid1: fix potential OOB in raid1_remove_disk()
In reply to Sasha LevinFrom: Zhang Shurong <[email protected]>
[ Upstream commit 8b0472b50bcf0f19a5119b00a53b63579c8e1e4d ]
If rddev->raid_disk is greater than mddev->raid_disks, there will be an out-of-bounds in raid1_remove_disk(). We have already found similar reports as follows:
1) commit d17f744e883b ("md-raid10: fix KASAN warning")
2) commit 1ebc2cec0b7d ("dm raid: fix KASAN warning in raid5_remove_disk")
Fix this bug by checking whether the "number" variable is valid.
--- drivers/md/raid1.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/md/raid1.c +4 -0
@@ -1826,6 +1826,10 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)struct r1conf *conf = mddev->private;int err =0 ;int number = rdev->raid_disk; + +if (unlikely (number >= conf->raid_disks)) + goto abort; +struct raid1_info *p = conf->mirrors + number;if (rdev != p->rdev)
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 17/31 ALSA: hda: intel-dsp-cfg: add LunarLake support
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit d2852b8c045ebd31d753b06f2810df5be30ed56a ]
One more PCI ID for the road.
--- sound/hda/intel-dsp-config.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/hda/intel-dsp-config.c +8 -0
@@ -481,6 +481,14 @@ static const struct config_entry config_table[] = { },#endif +/* Lunar Lake */ +#if IS_ENABLED (CONFIG_SND_SOC_SOF_LUNARLAKE ) +/* Lunarlake-P */ + { + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, + .device = PCI_DEVICE_ID_INTEL_HDA_LNL_P, + }, +#endif };static const struct config_entry *snd_intel_dsp_find_config
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 29/31 blk-mq: fix tags leak when shrink nr_hw_queues
In reply to Sasha LevinFrom: Chengming Zhou <[email protected]>
[ Upstream commit e1dd7bc93029024af5688253b0c05181d6e01f8e ]
Although we don't need to realloc set->tags[] when shrink nr_hw_queues, we need to free them. Or these tags will be leaked.
How to reproduce:
1. mount -t configfs configfs /mnt
2. modprobe null_blk nr_devices=0 submit_queues=8
3. mkdir /mnt/nullb/nullb0
4. echo 1 > /mnt/nullb/nullb0/power
5. echo 4 > /mnt/nullb/nullb0/submit_queues
6. rmdir /mnt/nullb/nullb0
In step 4, will alloc 9 tags (8 submit queues and 1 poll queue), then in step 5, new_nr_hw_queues = 5 (4 submit queues and 1 poll queue). At last in step 6, only these 5 tags are freed, the other 4 tags leaked.
--- block/blk-mq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
block/blk-mq.c +5 -1
@@ -4385,9 +4385,13 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set, int new_nr_hw_queues) {struct blk_mq_tags **new_tags; +int i; -if (set->nr_hw_queues >= new_nr_hw_queues) +if (set->nr_hw_queues >= new_nr_hw_queues) { +for (i = new_nr_hw_queues; i < set->nr_hw_queues; i++) +__blk_mq_free_map_and_rqs (set, i); goto done; + } new_tags =kcalloc_node (new_nr_hw_queues,sizeof (struct blk_mq_tags *),GFP_KERNEL , set->numa_node);
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 30/31 ASoC: SOF: amd: clear panic mask status when panic occurs
In reply to Sasha LevinFrom: Vijendar Mukunda <[email protected]>
[ Upstream commit 3d02e1c439b4140215b624d423aa3c7554b17a5a ]
Due to scratch memory persistence, Once the DSP panic is reported, need to clear the panic mask after handling DSP panic. Otherwise, It results in DSP panic on next reboot.
--- sound/soc/sof/amd/acp-ipc.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/sof/amd/acp-ipc.c +4 -0
@@ -161,6 +161,8 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context)if ((status &SOF_IPC_PANIC_MAGIC_MASK ) ==SOF_IPC_PANIC_MAGIC ) {snd_sof_dsp_panic (sdev, sdev->dsp_box.offset +sizeof (status), true); + status =0 ; +acp_mailbox_write (sdev, sdev->dsp_box.offset, &status,sizeof (status));return IRQ_HANDLED ; }snd_sof_ipc_msgs_rx (sdev);
@@ -190,6 +192,8 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context)acp_mailbox_read (sdev, sdev->debug_box.offset, &status,sizeof (u32));if ((status &SOF_IPC_PANIC_MAGIC_MASK ) ==SOF_IPC_PANIC_MAGIC ) {snd_sof_dsp_panic (sdev, sdev->dsp_oops_offset, true); + status =0 ; +acp_mailbox_write (sdev, sdev->debug_box.offset, &status,sizeof (status));return IRQ_HANDLED ; }
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 8/31 arm64: dts: qcom: sm8150-kumano: correct ramoops pmsg-size
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 4e6b942f092653ebcdbbc0819b2d1f08ab415bdc ]
There is no 'msg-size' property in ramoops, so assume intention was for 'pmsg-size':
sm8150-sony-xperia-kumano-griffin.dtb: ramoops@ffc00000: Unevaluated properties are not allowed ('msg-size' was unexpected)
--- arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi +1 -1
@@ -161,7 +161,7 @@ ramoops@ffc00000 { reg = <0x0 0xffc00000 0x0 0x100000>; record-size = <0x1000>; console-size = <0x40000>; - msg-size = <0x20000 0x20000>; + pmsg-size = <0x20000>; ecc-size = <16>; no-map; };
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 6/31 arm64: dts: qcom: sm6125-sprout: correct ramoops pmsg-size
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 2951e7e7611a3ea04de98d0f1bfc4e7ec609ef29 ]
There is no 'msg-size' property in ramoops, so assume intention was for 'pmsg-size':
sm6125-xiaomi-laurel-sprout.dtb: ramoops@ffc00000: Unevaluated properties are not allowed ('msg-size' was unexpected)
--- arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts +1 -1
@@ -52,7 +52,7 @@ pstore_mem: ramoops@ffc00000 { reg = <0x0 0xffc40000 0x0 0xc0000>; record-size = <0x1000>; console-size = <0x40000>; - msg-size = <0x20000 0x20000>; + pmsg-size = <0x20000>; }; cmdline_mem: memory@ffd00000 {
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 31/31 x86: bring back rep movsq for user access on CPUs without ERMS
In reply to Sasha LevinFrom: Mateusz Guzik <[email protected]>
[ Upstream commit ca96b162bfd21a5d55e3cd6099e4ee357a0eeb68 ]
Intel CPUs ship with ERMS for over a decade, but this is not true for AMD. In particular one reasonably recent uarch (EPYC 7R13) does not have it (or at least the bit is inactive when running on the Amazon EC2 cloud -- I found rather conflicting information about AMD CPUs vs the extension).
Hand-rolled mov loops executing in this case are quite pessimal compared to rep movsq for bigger sizes. While the upper limit depends on uarch, everyone is well south of 1KB AFAICS and sizes bigger than that are common.
While technically ancient CPUs may be suffering from rep usage, gcc has been emitting it for years all over kernel code, so I don't think this is a legitimate concern.
Sample result from read1_processes from will-it-scale (4KB reads/s):
before: 1507021
after: 1721828 (+14%)
Note that the cutoff point for rep usage is set to 64 bytes, which is way too conservative but I'm sticking to what was done in 47ee3f1dd93b ("x86: re-introduce support for ERMS copies for user space accesses"). That is to say *some* copies will now go slower, which is fixable but beyond the scope of this patch.
--- arch/x86/include/asm/uaccess_64.h | 2 +- arch/x86/lib/copy_user_64.S | 57 +++++++------------------------ 2 files changed, 14 insertions(+), 45 deletions(-)
arch/x86/include/asm/uaccess_64.h +1 -1
@@ -116,7 +116,7 @@ copy_user_generic(void *to, const void *from, unsigned long len)"2:\n" _ASM_EXTABLE_UA(1b ,2b ) :"+c" (len), "+D" (to), "+S" (from), ASM_CALL_CONSTRAINT - : : "memory", "rax", "r8", "r9", "r10", "r11"); + : : "memory", "rax"); clac();return len; }
arch/x86/lib/copy_user_64.S +13 -44
75 lines not on this page · raw message
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 24/31 bus: ti-sysc: Configure uart quirks for k3 SoC
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 03a711d3cb83692733f865312f49e665c49de6de ]
Enable the uart quirks similar to the earlier SoCs. Let's assume we are likely going to need a k3 specific quirk mask separate from the earlier SoCs, so let's not start changing the revision register mask at this point.
Note that SYSC_QUIRK_LEGACY_IDLE will be needed until we can remove the need for pm_runtime_irq_safe() from 8250_omap driver.
--- drivers/bus/ti-sysc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bus/ti-sysc.c +2 -0
@@ -1525,6 +1525,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),SYSC_QUIRK ("uart" ,0 ,0x50 ,0x54 ,0x58 ,0x47422e03 ,0xffffffff ,SYSC_QUIRK_SWSUP_SIDLE |SYSC_QUIRK_LEGACY_IDLE ), +SYSC_QUIRK ("uart" ,0 ,0x50 ,0x54 ,0x58 ,0x47424e03 ,0xffffffff , +SYSC_QUIRK_SWSUP_SIDLE |SYSC_QUIRK_LEGACY_IDLE ),/* Quirks that need to be set based on the module address */ SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -ENODEV, 0x50000800, 0xffffffff,
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 26/31 block: Allow bio_iov_iter_get_pages() with bio->bi_bdev unset
In reply to Sasha LevinFrom: Kent Overstreet <[email protected]>
[ Upstream commit 168145f617d57bf4e474901b7ffa869337a802e6 ]
bio_iov_iter_get_pages() trims the IO based on the block size of the block device the IO will be issued to.
However, bcachefs is a multi device filesystem; when we're creating the bio we don't yet know which block device the bio will be submitted to - we have to handle the alignment checks elsewhere.
Thus this is needed to avoid a null ptr deref.
--- block/bio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
block/bio.c +6 -4
@@ -1245,7 +1245,7 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)struct page **pages = (struct page **)bv;ssize_t size, left;unsigned len, i =0 ; -size_t offset, trim; +size_t offset;int ret =0 ;/*
@@ -1274,10 +1274,12 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) nr_pages =DIV_ROUND_UP (offset + size,PAGE_SIZE ); - trim = size & (bdev_logical_block_size (bio->bi_bdev) -1 ); -iov_iter_revert (iter, trim); +if (bio->bi_bdev) { +size_t trim = size & (bdev_logical_block_size (bio->bi_bdev) -1 ); +iov_iter_revert (iter, trim); + size -= trim; + } - size -= trim;if (unlikely (!size)) { ret = -EFAULT ; goto out;
Signature · 1 line
2.40.1
Sasha Levin
maintainerPATCH 28/31 ext2: fix datatype of block number in ext2_xattr_set2()
In reply to Sasha LevinFrom: Georg Ottinger <[email protected]>
[ Upstream commit e88076348425b7d0491c8c98d8732a7df8de7aa3 ]
I run a small server that uses external hard drives for backups. The backup software I use uses ext2 filesystems with 4KiB block size and the server is running SELinux and therefore relies on xattr. I recently upgraded the hard drives from 4TB to 12TB models. I noticed that after transferring some TBs I got a filesystem error "Freeing blocks not in datazone - block = 18446744071529317386, count = 1" and the backup process stopped. Trying to fix the fs with e2fsck resulted in a completely corrupted fs. The error probably came from ext2_free_blocks(), and because of the large number 18e19 this problem immediately looked like some kind of integer overflow. Whereas the 4TB fs was about 1e9 blocks, the new 12TB is about 3e9 blocks. So, searching the ext2 code, I came across the line in fs/ext2/xattr.c:745 where ext2_new_block() is called and the resulting block number is stored in the variable block as an int datatype. If a block with a block number greater than INT32_MAX is returned, this variable overflows and the call to sb_getblk() at line fs/ext2/xattr.c:750 fails, then the call to ext2_free_blocks() produces the error.
Message-Id: <[email protected]>
--- fs/ext2/xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext2/xattr.c +2 -2
@@ -742,10 +742,10 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,/* We need to allocate a new block */ ext2_fsblk_t goal =ext2_group_first_block_no (sb,EXT2_I (inode)->i_block_group); -int block =ext2_new_block (inode, goal, &error); +ext2_fsblk_t block =ext2_new_block (inode, goal, &error);if (error) goto cleanup; -ea_idebug (inode,"creating block %d" , block); +ea_idebug (inode,"creating block %lu" , block); new_bh =sb_getblk (sb, block);if (unlikely (!new_bh)) {
Signature · 1 line
2.40.1
Re: [PATCH AUTOSEL 6.4 04/31] ASoC: amd: vangogh: Use dmi_first_match() for DMI quirk handling
In reply to Sasha LevinQuoted 7 lines · Sasha Levin
From: Cristian Ciocaltea <[email protected]>
[ Upstream commit
3dd26e27ccb4f18b4d25c0a49e1888eca9c6a724]In preparation for supporting ACPI probing, move DMI quirk handling logic at the probe's top, to be able to return as quickly as possible in case there is no DMI matching.
As the changelog clearly says this is preparatory work for a new feature and therefore not stable material.
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.4 04/31] ASoC: amd: vangogh: Use dmi_first_match() for DMI quirk handling
Quoted 11 lines · Mark Brown
Quoted 7 lines · Sasha Levin
From: Cristian Ciocaltea <[email protected]>
[ Upstream commit
3dd26e27ccb4f18b4d25c0a49e1888eca9c6a724]In preparation for supporting ACPI probing, move DMI quirk handling logic at the probe's top, to be able to return as quickly as possible in case there is no DMI matching.
As the changelog clearly says this is preparatory work for a new feature and therefore not stable material.
Dropped, thanks!
Signature · 2 lines
Thanks, Sasha