5.4.62-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 14/214 ALSA: pci: delete repeated words in comments
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit c7fabbc51352f50cc58242a6dc3b9c1a3599849b ]
Drop duplicated words in sound/pci/.
{and, the, at}
--- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/cs46xx/dsp_spos_scb_lib.c | 2 +- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_generic.c | 2 +- sound/pci/hda/patch_sigmatel.c | 2 +- sound/pci/ice1712/prodigy192.c | 2 +- sound/pci/oxygen/xonar_dg.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
sound/pci/cs46xx/cs46xx_lib.c +1 -1
@@ -766,7 +766,7 @@ static void snd_cs46xx_set_capture_sample_rate(struct snd_cs46xx *chip, unsigned rate =48000 /9 ;/* -* We can not capture at at rate greater than the Input Rate (48000). +* We can not capture at a rate greater than the Input Rate (48000). * Return an error if an attempt is made to stray outside that limit. */ if (rate >48000 )
sound/pci/cs46xx/dsp_spos_scb_lib.c +1 -1
@@ -1716,7 +1716,7 @@ int cs46xx_iec958_pre_open (struct snd_cs46xx *chip)struct dsp_spos_instance * ins = chip->dsp_spos_instance;if ( ins->spdif_status_out &DSP_SPDIF_STATUS_OUTPUT_ENABLED ) { -/* remove AsynchFGTxSCB and and PCMSerialInput_II */ +/* remove AsynchFGTxSCB and PCMSerialInput_II */ cs46xx_dsp_disable_spdif_out (chip);/* save state */
sound/pci/hda/hda_codec.c +1 -1
@@ -3420,7 +3420,7 @@ EXPORT_SYMBOL_GPL(snd_hda_set_power_save);* @nid: NID to check / update * * Check whether the given NID is in the amp list. If it's in the list, -* check the current AMP status, and update the the power-status according +* check the current AMP status, and update the power-status according * to the mute status. * * This function is supposed to be set or called from the check_power_status
sound/pci/hda/hda_generic.c +1 -1
@@ -813,7 +813,7 @@ static void activate_amp_in(struct hda_codec *codec, struct nid_path *path, } } -/* sync power of each widget in the the given path */ +/* sync power of each widget in the given path */ static hda_nid_t path_power_update (struct hda_codec *codec,struct nid_path *path,bool allow_powerdown)
sound/pci/hda/patch_sigmatel.c +1 -1
@@ -832,7 +832,7 @@ static int stac_auto_create_beep_ctls(struct hda_codec *codec,static struct snd_kcontrol_new beep_vol_ctl =HDA_CODEC_VOLUME (NULL ,0 ,0 ,0 ); -/* check for mute support for the the amp */ +/* check for mute support for the amp */ if ((caps &AC_AMPCAP_MUTE ) >>AC_AMPCAP_MUTE_SHIFT ) {const struct snd_kcontrol_new *temp;if (spec->anabeep_nid == nid)
sound/pci/ice1712/prodigy192.c +1 -1
@@ -32,7 +32,7 @@* Experimentally I found out that only a combination of * OCKS0=1, OCKS1=1 (128fs, 64fs output) and ice1724 - * VT1724_MT_I2S_MCLK_128X=0 (256fs input) yields correct -* sampling rate. That means the the FPGA doubles the +* sampling rate. That means that the FPGA doubles the * MCK01 rate. * * Copyright (c) 2003 Takashi Iwai <[email protected]>
sound/pci/oxygen/xonar_dg.c +1 -1
@@ -29,7 +29,7 @@* GPIO 4 <- headphone detect * GPIO 5 -> enable ADC analog circuit for the left channel * GPIO 6 -> enable ADC analog circuit for the right channel -* GPIO 7 -> switch green rear output jack between CS4245 and and the first +* GPIO 7 -> switch green rear output jack between CS4245 and the first * channel of CS4361 (mechanical relay) * GPIO 8 -> enable output to speakers *
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 107/214 nvme-fc: Fix wrong return value in __nvme_fc_init_request()
In reply to Greg Kroah-HartmanFrom: Tianjia Zhang <[email protected]>
[ Upstream commit f34448cd0dc697723fb5f4118f8431d9233b370d ]
On an error exit path, a negative error code should be returned instead of a positive return value.
--- drivers/nvme/host/fc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/fc.c +2 -2
@@ -1740,7 +1740,7 @@ __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl,if (fc_dma_mapping_error (ctrl->lport->dev, op->fcp_req.cmddma)) {dev_err (ctrl->dev,"FCP Op failed - cmdiu dma mapping failed.\n" ); - ret =EFAULT ; + ret = -EFAULT ; goto out_on_error; }
@@ -1750,7 +1750,7 @@ __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl,if (fc_dma_mapping_error (ctrl->lport->dev, op->fcp_req.rspdma)) {dev_err (ctrl->dev,"FCP Op failed - rspiu dma mapping failed.\n" ); - ret =EFAULT ; + ret = -EFAULT ; }atomic_set (&op->state,FCPOP_STATE_IDLE );
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 11/214 net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow
In reply to Greg Kroah-HartmanFrom: Alaa Hleihel <[email protected]>
[ Upstream commit eda814b97dfb8d9f4808eb2f65af9bd3705c4cae ]
tcf_ct_handle_fragments() shouldn't free the skb when ip_defrag() call fails. Otherwise, we will cause a double-free bug.
In such cases, just return the error to the caller.
--- net/sched/act_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/act_ct.c +1 -1
@@ -186,7 +186,7 @@ static int tcf_ct_handle_fragments(strucmemset (IP6CB (skb),0 ,sizeof (struct inet6_skb_parm )); err =nf_ct_frag6_gather (net, skb, user);if (err && err != -EINPROGRESS ) - goto out_free; +return err;#else err = -EOPNOTSUPP ; goto out_free;
Greg Kroah-Hartman
maintainerPATCH 93/214 PCI: qcom: Add missing ipq806x clocks in PCIe driver
In reply to Greg Kroah-HartmanFrom: Ansuel Smith <[email protected]>
[ Upstream commit 8b6f0330b5f9a7543356bfa9e76d580f03aa2c1e ]
Aux and Ref clk are missing in PCIe qcom driver. Add support for this optional clks for ipq8064/apq8064 SoC.
--- drivers/pci/controller/dwc/pcie-qcom.c | 38 ++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 5 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +33 -5
@@ -103,6 +103,8 @@ struct qcom_pcie_resources_2_1_0 {struct clk *iface_clk;struct clk *core_clk;struct clk *phy_clk; +struct clk *aux_clk; +struct clk *ref_clk;struct reset_control *pci_reset;struct reset_control *axi_reset;struct reset_control *ahb_reset;
@@ -253,6 +255,14 @@ static int qcom_pcie_get_resources_2_1_0(struct qcom_pcie *pcie)if (IS_ERR (res->phy_clk))return PTR_ERR (res->phy_clk); + res->aux_clk =devm_clk_get_optional (dev,"aux" ); +if (IS_ERR (res->aux_clk)) +return PTR_ERR (res->aux_clk); + + res->ref_clk =devm_clk_get_optional (dev,"ref" ); +if (IS_ERR (res->ref_clk)) +return PTR_ERR (res->ref_clk); + res->pci_reset =devm_reset_control_get_exclusive (dev,"pci" );if (IS_ERR (res->pci_reset))return PTR_ERR (res->pci_reset);
@@ -285,6 +295,8 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie)clk_disable_unprepare (res->iface_clk);clk_disable_unprepare (res->core_clk);clk_disable_unprepare (res->phy_clk); +clk_disable_unprepare (res->aux_clk); +clk_disable_unprepare (res->ref_clk);regulator_bulk_disable (ARRAY_SIZE (res->supplies), res->supplies); }
@@ -315,16 +327,28 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) goto err_assert_ahb; } + ret =clk_prepare_enable (res->core_clk); +if (ret) { +dev_err (dev,"cannot prepare/enable core clock\n" ); + goto err_clk_core; + } + ret =clk_prepare_enable (res->phy_clk);if (ret) {dev_err (dev,"cannot prepare/enable phy clock\n" ); goto err_clk_phy; } - ret =clk_prepare_enable (res->core_clk); + ret =clk_prepare_enable (res->aux_clk);if (ret) { -dev_err (dev,"cannot prepare/enable core clock\n" ); - goto err_clk_core; +dev_err (dev,"cannot prepare/enable aux clock\n" ); + goto err_clk_aux; + } + + ret =clk_prepare_enable (res->ref_clk); +if (ret) { +dev_err (dev,"cannot prepare/enable ref clock\n" ); + goto err_clk_ref; } ret =reset_control_deassert (res->ahb_reset);
@@ -400,10 +424,14 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)return 0 ; err_deassert_ahb: -clk_disable_unprepare (res->core_clk); -err_clk_core: +clk_disable_unprepare (res->ref_clk); +err_clk_ref: +clk_disable_unprepare (res->aux_clk); +err_clk_aux:clk_disable_unprepare (res->phy_clk); err_clk_phy: +clk_disable_unprepare (res->core_clk); +err_clk_core:clk_disable_unprepare (res->iface_clk); err_assert_ahb:regulator_bulk_disable (ARRAY_SIZE (res->supplies), res->supplies);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 104/214 hwmon: (nct7904) Correct divide by 0
In reply to Greg Kroah-HartmanFrom: Jason Baron <[email protected]>
[ Upstream commit 8aebbbb2d573d0b4afc08b90ac7d73dba2d9da97 ]
We hit a kernel panic due to a divide by 0 in nct7904_read_fan() for the hwmon_fan_min case. Extend the check to hwmon_fan_input case as well for safety.
[ 1656.545650] divide error: 0000 [#1] SMP PTI [ 1656.545779] CPU: 12 PID: 18010 Comm: sensors Not tainted 5.4.47 #1 [ 1656.546065] RIP: 0010:nct7904_read+0x1e9/0x510 [nct7904] ... [ 1656.546549] RAX: 0000000000149970 RBX: ffffbd6b86bcbe08 RCX: 0000000000000000 ... [ 1656.547548] Call Trace: [ 1656.547665] hwmon_attr_show+0x32/0xd0 [hwmon] [ 1656.547783] dev_attr_show+0x18/0x50 [ 1656.547898] sysfs_kf_seq_show+0x99/0x120 [ 1656.548013] seq_read+0xd8/0x3e0 [ 1656.548127] vfs_read+0x89/0x130 [ 1656.548234] ksys_read+0x7d/0xb0 [ 1656.548342] do_syscall_64+0x48/0x110 [ 1656.548451] entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- drivers/hwmon/nct7904.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/nct7904.c +2 -2
@@ -197,7 +197,7 @@ static int nct7904_read_fan(struct device *dev, u32 attr, int channel,if (ret <0 )return ret; cnt = ((ret &0xff00 ) >>3 ) | (ret &0x1f ); -if (cnt ==0x1fff ) +if (cnt ==0 || cnt ==0x1fff ) rpm =0 ;else rpm =1350000 / cnt;
@@ -209,7 +209,7 @@ static int nct7904_read_fan(struct device *dev, u32 attr, int channel,if (ret <0 )return ret; cnt = ((ret &0xff00 ) >>3 ) | (ret &0x1f ); -if (cnt ==0x1fff ) +if (cnt ==0 || cnt ==0x1fff ) rpm =0 ;else rpm =1350000 / cnt;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 66/214 arm64: Fix __cpu_logical_map undefined issue
In reply to Greg Kroah-HartmanFrom: Kefeng Wang <[email protected]>
[ Upstream commit eaecca9e7710281be7c31d892c9f447eafd7ddd9 ]
The __cpu_logical_map undefined issue occued when the new tegra194-cpufreq drvier building as a module.
ERROR: modpost: "__cpu_logical_map" [drivers/cpufreq/tegra194-cpufreq.ko] undefined!
The driver using cpu_logical_map() macro which will expand to __cpu_logical_map, we can't access it in a drvier. Let's turn cpu_logical_map() into a C wrapper and export it to fix the build issue.
Also create a function set_cpu_logical_map(cpu, hwid) when assign a value to cpu_logical_map(cpu).
--- arch/arm64/include/asm/smp.h | 7 ++++++- arch/arm64/kernel/setup.c | 8 +++++++- arch/arm64/kernel/smp.c | 6 +++--- 3 files changed, 16 insertions(+), 5 deletions(-)
arch/arm64/include/asm/smp.h +6 -1
@@ -46,7 +46,12 @@ DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);* Logical CPU mapping. */ extern u64 __cpu_logical_map[NR_CPUS ]; -#define cpu_logical_map (cpu) __cpu_logical_map[cpu] +extern u64 cpu_logical_map (int cpu); + +static inline void set_cpu_logical_map (int cpu,u64 hwid) +{ + __cpu_logical_map[cpu] = hwid; +}struct seq_file ;
arch/arm64/kernel/setup.c +7 -1
@@ -85,7 +85,7 @@ u64 __cacheline_aligned boot_args[4];void __init smp_setup_processor_id (void ) {u64 mpidr =read_cpuid_mpidr () &MPIDR_HWID_BITMASK ; -cpu_logical_map (0 ) = mpidr; +set_cpu_logical_map (0 , mpidr);/* * clear __my_cpu_offset on boot CPU to avoid hang caused by
@@ -276,6 +276,12 @@ arch_initcall(reserve_memblock_reserved_regions);u64 __cpu_logical_map[NR_CPUS ] = { [0 ...NR_CPUS -1 ] =INVALID_HWID }; +u64 cpu_logical_map (int cpu) +{ +return __cpu_logical_map[cpu]; +} +EXPORT_SYMBOL_GPL (cpu_logical_map); +void __init setup_arch (char **cmdline_p) { init_mm.start_code = (unsigned long ) _text;
arch/arm64/kernel/smp.c +3 -3
@@ -549,7 +549,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)return ;/* map the logical cpu id to cpu MPIDR */ -cpu_logical_map (cpu_count) = hwid; +set_cpu_logical_map (cpu_count, hwid); cpu_madt_gicc[cpu_count] = *processor;
@@ -663,7 +663,7 @@ static void __init of_parse_and_init_cpus(void) goto next;pr_debug ("cpu logical map 0x%llx\n" , hwid); -cpu_logical_map (cpu_count) = hwid; +set_cpu_logical_map (cpu_count, hwid);early_map_cpu_to_node (cpu_count,of_node_to_nid (dn)); next:
@@ -704,7 +704,7 @@ void __init smp_init_cpus(void)for (i =1 ; i < nr_cpu_ids; i++) {if (cpu_logical_map (i) !=INVALID_HWID ) {if (smp_cpu_setup (i)) -cpu_logical_map (i) =INVALID_HWID ; +set_cpu_logical_map (i,INVALID_HWID ); } } }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 90/214 EDAC: sb_edac: get rid of unused vars
In reply to Greg Kroah-HartmanFrom: Mauro Carvalho Chehab <[email protected]>
[ Upstream commit 323014d85d2699b2879ecb15cd06a15408e3e801 ]
There are several vars unused on this driver, probably because it was a modified copy of another driver. Get rid of them.
drivers/edac/sb_edac.c: In function ‘knl_get_dimm_capacity’:
drivers/edac/sb_edac.c:1343:16: warning: variable ‘sad_size’ set but not used [-Wunused-but-set-variable]
1343 | u64 sad_base, sad_size, sad_limit = 0;
| ^~~~~~~~
drivers/edac/sb_edac.c: In function ‘sbridge_mce_output_error’:
drivers/edac/sb_edac.c:2955:8: warning: variable ‘type’ set but not used [-Wunused-but-set-variable]
2955 | char *type, *optype, msg[256];
| ^~~~
drivers/edac/sb_edac.c: In function ‘sbridge_unregister_mci’:
drivers/edac/sb_edac.c:3203:22: warning: variable ‘pvt’ set but not used [-Wunused-but-set-variable]
3203 | struct sbridge_pvt *pvt;
| ^~~
At top level:
drivers/edac/sb_edac.c:266:18: warning: ‘correrrthrsld’ defined but not used [-Wunused-const-variable=]
266 | static const u32 correrrthrsld[] = {
| ^~~~~~~~~~~~~
drivers/edac/sb_edac.c:257:18: warning: ‘correrrcnt’ defined but not used [-Wunused-const-variable=]
257 | static const u32 correrrcnt[] = {
| ^~~~~~~~~~--- drivers/edac/sb_edac.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/edac/sb_edac.c +8 -13
@@ -254,18 +254,20 @@ static const u32 rir_offset[MAX_RIR_RANGES][MAX_RIR_WAY] = {* FIXME: Implement the error count reads directly */ -static const u32 correrrcnt[] = { -0x104 ,0x108 ,0x10c ,0x110 , -}; -#define RANK_ODD_OV (reg) GET_BITFIELD(reg, 31, 31)#define RANK_ODD_ERR_CNT (reg) GET_BITFIELD(reg, 16, 30)#define RANK_EVEN_OV (reg) GET_BITFIELD(reg, 15, 15)#define RANK_EVEN_ERR_CNT (reg) GET_BITFIELD(reg, 0, 14) +#if 0 /* Currently unused*/ +static const u32 correrrcnt[] = { +0x104 ,0x108 ,0x10c ,0x110 , +}; +static const u32 correrrthrsld[] = {0x11c ,0x120 ,0x124 ,0x128 , }; +#endif #define RANK_ODD_ERR_THRSLD (reg) GET_BITFIELD(reg, 16, 30)#define RANK_EVEN_ERR_THRSLD (reg) GET_BITFIELD(reg, 0, 14)
@@ -1340,7 +1342,7 @@ static void knl_show_mc_route(u32 reg, char *s)*/ static int knl_get_dimm_capacity (struct sbridge_pvt *pvt,u64 *mc_sizes) { -u64 sad_base, sad_size, sad_limit =0 ; +u64 sad_base, sad_limit =0 ;u64 tad_base, tad_size, tad_limit, tad_deadspace, tad_livespace;int sad_rule =0 ;int tad_rule =0 ;
@@ -1427,7 +1429,6 @@ static int knl_get_dimm_capacity(struct sbridge_pvt *pvt, u64 *mc_sizes) edram_only =KNL_EDRAM_ONLY (dram_rule); sad_limit = pvt->info.sad_limit (dram_rule)+1 ; - sad_size = sad_limit - sad_base;pci_read_config_dword (pvt->pci_sad0, pvt->info.interleave_list[sad_rule], &interleave_reg);
@@ -2952,7 +2953,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,struct mem_ctl_info *new_mci;struct sbridge_pvt *pvt = mci->pvt_info;enum hw_event_mc_err_type tp_event; -char *type, *optype, msg[256 ]; +char *optype, msg[256 ];bool ripv =GET_BITFIELD (m->mcgstatus,0 ,0 );bool overflow =GET_BITFIELD (m->status,62 ,62 );bool uncorrected_error =GET_BITFIELD (m->status,61 ,61 );
@@ -2981,14 +2982,11 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,if (uncorrected_error) { core_err_cnt =1 ;if (ripv) { - type ="FATAL" ; tp_event =HW_EVENT_ERR_FATAL ; }else { - type ="NON_FATAL" ; tp_event =HW_EVENT_ERR_UNCORRECTED ; } }else { - type ="CORRECTED" ; tp_event =HW_EVENT_ERR_CORRECTED ; }
@@ -3200,7 +3198,6 @@ static struct notifier_block sbridge_mce_dec = {static void sbridge_unregister_mci (struct sbridge_dev *sbridge_dev) {struct mem_ctl_info *mci = sbridge_dev->mci; -struct sbridge_pvt *pvt;if (unlikely (!mci || !mci->pvt_info)) {edac_dbg (0 ,"MC: dev = %p\n" , &sbridge_dev->pdev[0 ]->dev);
@@ -3209,8 +3206,6 @@ static void sbridge_unregister_mci(struct sbridge_dev *sbridge_dev)return ; } - pvt = mci->pvt_info; -edac_dbg (0 ,"MC: mci = %p, dev = %p\n" , mci, &sbridge_dev->pdev[0 ]->dev);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 86/214 drm/amd/display: Trigger modesets on MST DSC connectors
In reply to Greg Kroah-HartmanFrom: Mikita Lipski <[email protected]>
[ Upstream commit 44be939ff7ac5858f0dbd8a2a4af1fe198e14db1 ]
Whenever a connector on an MST network is attached, detached, or undergoes a modeset, the DSC configs for each stream on that topology will be recalculated. This can change their required bandwidth, requiring a full reprogramming, as though a modeset was performed, even if that stream did not change timing.
Therefore, whenever a crtc has drm_atomic_crtc_needs_modeset, for each crtc that shares a MST topology with that stream and supports DSC, add that crtc (and all affected connectors and planes) to the atomic state and set mode_changed on its state
v2: Do this check only on Navi and before adding connectors and planes on modesetting crtcs
v3: Call the drm_dp_mst_add_affected_dsc_crtcs() to update all affected CRTCs
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +33 -0
@@ -7230,6 +7230,29 @@ dm_determine_update_type_for_commit(struct amdgpu_display_manager *dm,return ret; } +static int add_affected_mst_dsc_crtcs (struct drm_atomic_state *state,struct drm_crtc *crtc) +{ +struct drm_connector *connector; +struct drm_connector_state *conn_state; +struct amdgpu_dm_connector *aconnector =NULL ; +int i; +for_each_new_connector_in_state (state, connector, conn_state, i) { +if (conn_state->crtc != crtc) +continue ; + + aconnector =to_amdgpu_dm_connector (connector); +if (!aconnector->port || !aconnector->mst_port) + aconnector =NULL ; +else +break ; + } + +if (!aconnector) +return 0 ; + +return drm_dp_mst_add_affected_dsc_crtcs (state, &aconnector->mst_port->mst_mgr); +} +/** * amdgpu_dm_atomic_check() - Atomic check implementation for AMDgpu DM. * @dev: The DRM device
@@ -7282,6 +7305,16 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,if (ret) goto fail; +if (adev->asic_type >=CHIP_NAVI10 ) { +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +if (drm_atomic_crtc_needs_modeset (new_crtc_state)) { + ret =add_affected_mst_dsc_crtcs (state, crtc); +if (ret) + goto fail; + } + } + } +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { if (!drm_atomic_crtc_needs_modeset(new_crtc_state) && !new_crtc_state->color_mgmt_changed &&
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 87/214 drm/amd/display: Add additional config guards for DCN
In reply to Greg Kroah-HartmanFrom: Aurabindo Pillai <[email protected]>
[ Upstream commit e10517b3cb93f90c8a790def6ae884d1e2b65ee7 ]
[Why&How]
Fix build error by protecting code with config guard to enable building amdgpu without CONFIG_DRM_AMD_DC_DCN enabled. This option is disabled by default for allmodconfig.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -2
@@ -7229,7 +7229,7 @@ dm_determine_update_type_for_commit(struct amdgpu_display_manager *dm, *out_type = update_type;return ret; } - +#if defined(CONFIG_DRM_AMD_DC_DCN )static int add_affected_mst_dsc_crtcs (struct drm_atomic_state *state,struct drm_crtc *crtc) {struct drm_connector *connector;
@@ -7252,6 +7252,7 @@ static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm return drm_dp_mst_add_affected_dsc_crtcs(state, &aconnector->mst_port->mst_mgr); } +#endif /** * amdgpu_dm_atomic_check() - Atomic check implementation for AMDgpu DM.
@@ -7305,6 +7306,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,if (ret) goto fail; +#if defined(CONFIG_DRM_AMD_DC_DCN )if (adev->asic_type >=CHIP_NAVI10 ) {for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {if (drm_atomic_crtc_needs_modeset (new_crtc_state)) {
@@ -7314,7 +7316,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, } } } - +#endif for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { if (!drm_atomic_crtc_needs_modeset(new_crtc_state) && !new_crtc_state->color_mgmt_changed &&
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 80/214 mm/shuffle: dont move pages between zones and dont read garbage memmaps
In reply to Greg Kroah-HartmanFrom: David Hildenbrand <[email protected]>
[ Upstream commit 4a93025cbe4a0b19d1a25a2d763a3d2018bad0d9 ]
Especially with memory hotplug, we can have offline sections (with a garbage memmap) and overlapping zones. We have to make sure to only touch initialized memmaps (online sections managed by the buddy) and that the zone matches, to not move pages between zones.
To test if this can actually happen, I added a simple
BUG_ON(page_zone(page_i) != page_zone(page_j));
right before the swap. When hotplugging a 256M DIMM to a 4G x86-64 VM and onlining the first memory block "online_movable" and the second memory block "online_kernel", it will trigger the BUG, as both zones (NORMAL and MOVABLE) overlap.
This might result in all kinds of weird situations (e.g., double allocations, list corruptions, unmovable allocations ending up in the movable zone).
--- mm/shuffle.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
mm/shuffle.c +9 -9
@@ -58,25 +58,25 @@ module_param_call(shuffle, shuffle_store, shuffle_show, &shuffle_param, 0400);* For two pages to be swapped in the shuffle, they must be free (on a * 'free_area' lru), have the same order, and have the same migratetype. */ -static struct page *__meminit shuffle_valid_page (unsigned long pfn,int order) +static struct page *__meminit shuffle_valid_page (struct zone *zone, +unsigned long pfn,int order) { -struct page *page; +struct page *page =pfn_to_online_page (pfn);/* * Given we're dealing with randomly selected pfns in a zone we * need to ask questions like... */ -/* ...is the pfn even in the memmap? */ -if (!pfn_valid_within (pfn)) +/* ... is the page managed by the buddy? */ +if (!page)return NULL ; -/* ...is the pfn in a present section or a hole? */ -if (!pfn_present (pfn)) +/* ... is the page assigned to the same zone? */ +if (page_zone (page) != zone)return NULL ;/* ...is the page free and currently on a free_area list? */ - page =pfn_to_page (pfn);if (!PageBuddy (page))return NULL ;
@@ -123,7 +123,7 @@ void __meminit __shuffle_zone(struct zone *z)* page_j randomly selected in the span @zone_start_pfn to * @spanned_pages. */ - page_i =shuffle_valid_page (i, order); + page_i =shuffle_valid_page (z, i, order);if (!page_i)continue ;
@@ -137,7 +137,7 @@ void __meminit __shuffle_zone(struct zone *z) j = z->zone_start_pfn +ALIGN_DOWN (get_random_long () % z->spanned_pages, order_pages); - page_j =shuffle_valid_page (j, order); + page_j =shuffle_valid_page (z, j, order);if (page_j && page_j != page_i)break ; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 78/214 btrfs: only commit the delayed inode when doing a full fsync
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
[ Upstream commit 8c8648dd1f6d62aeb912deeb788b6ac33cb782e7 ]
Commit 2c2c452b0cafdc ("Btrfs: fix fsync when extend references are added to an inode") forced a commit of the delayed inode when logging an inode in order to ensure we would end up logging the inode item during a full fsync. By committing the delayed inode, we updated the inode item in the fs/subvolume tree and then later when copying items from leafs modified in the current transaction into the log tree (with copy_inode_items_to_log()) we ended up copying the inode item from the fs/subvolume tree into the log tree. Logging an up to date version of the inode item is required to make sure at log replay time we get the link count fixup triggered among other things (replay xattr deletes, etc). The test case generic/040 from fstests exercises the bug which that commit fixed.
However for a fast fsync we don't need to commit the delayed inode because we always log an up to date version of the inode item based on the struct btrfs_inode we have in-memory. We started doing this for fast fsyncs since commit e4545de5b035c7 ("Btrfs: fix fsync data loss after append write").
So just stop committing the delayed inode if we are doing a fast fsync, we are only wasting time and adding contention on fs/subvolume tree.
This patch is part of a series that has the following patches:
1/4 btrfs: only commit the delayed inode when doing a full fsync 2/4 btrfs: only commit delayed items at fsync if we are logging a directory 3/4 btrfs: stop incremening log_batch for the log root tree when syncing log 4/4 btrfs: remove no longer needed use of log_writers for the log root tree
After the entire patchset applied I saw about 12% decrease on max latency reported by dbench. The test was done on a qemu vm, with 8 cores, 16Gb of ram, using kvm and using a raw NVMe device directly (no intermediary fs on the host). The test was invoked like the following:
mkfs.btrfs -f /dev/sdk
mount -o ssd -o nospace_cache /dev/sdk /mnt/sdk
dbench -D /mnt/sdk -t 300 8
umount /mnt/dsk
--- fs/btrfs/tree-log.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
fs/btrfs/tree-log.c +7 -5
@@ -5154,7 +5154,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,struct btrfs_key max_key;struct btrfs_root *log = root->log_root;int err =0 ; -int ret; +int ret =0 ;bool fast_search = false;u64 ino =btrfs_ino (inode);struct extent_map_tree *em_tree = &inode->extent_tree;
@@ -5191,14 +5191,16 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,/* * Only run delayed items if we are a dir or a new file. -* Otherwise commit the delayed inode only, which is needed in -* order for the log replay code to mark inodes for link count -* fixup (create temporary BTRFS_TREE_LOG_FIXUP_OBJECTID items). +* Otherwise commit the delayed inode only if the full sync flag is set, +* as we want to make sure an up to date version is in the subvolume +* tree so copy_inode_items_to_log() / copy_items() can find it and copy +* it to the log tree. For a non full sync, we always log the inode item +* based on the in-memory struct btrfs_inode which is always up to date. */ if (S_ISDIR (inode->vfs_inode.i_mode) || inode->generation > fs_info->last_trans_committed) ret =btrfs_commit_inode_delayed_items (trans, inode); -else +else if (test_bit (BTRFS_INODE_NEEDS_FULL_SYNC , &inode->runtime_flags)) ret =btrfs_commit_inode_delayed_inode (inode);if (ret) {
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 77/214 btrfs: factor out inode items copy loop from btrfs_log_inode()
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
[ Upstream commit da447009a25609327309f695b244710f12794471 ]
The function btrfs_log_inode() is quite large and so is its loop which iterates the inode items from the fs/subvolume tree and copies them into a log tree. Because this is a large loop inside a very large function and because an upcoming patch in this series needs to add some more logic inside that loop, move the loop into a helper function to make it a bit more manageable.
--- fs/btrfs/tree-log.c | 274 ++++++++++++++++++++++---------------------- 1 file changed, 138 insertions(+), 136 deletions(-)
fs/btrfs/tree-log.c +138 -136
@@ -4994,6 +4994,138 @@ static int log_conflicting_inodes(struct btrfs_trans_handle *trans,return ret; } +static int copy_inode_items_to_log (struct btrfs_trans_handle *trans, +struct btrfs_inode *inode, +struct btrfs_key *min_key, +const struct btrfs_key *max_key, +struct btrfs_path *path, +struct btrfs_path *dst_path, +const u64 logged_isize, +const bool recursive_logging, +const int inode_only, +struct btrfs_log_ctx *ctx, +bool *need_log_inode_item) +{ +struct btrfs_root *root = inode->root; +int ins_start_slot =0 ; +int ins_nr =0 ; +int ret; + +while (1 ) { + ret =btrfs_search_forward (root, min_key, path, trans->transid); +if (ret <0 ) +return ret; +if (ret >0 ) { + ret =0 ; +break ; + } +again: +/* Note, ins_nr might be > 0 here, cleanup outside the loop */ +if (min_key->objectid != max_key->objectid) +break ; +if (min_key->type > max_key->type) +break ; + +if (min_key->type ==BTRFS_INODE_ITEM_KEY ) + *need_log_inode_item = false; + +if ((min_key->type ==BTRFS_INODE_REF_KEY || + min_key->type ==BTRFS_INODE_EXTREF_KEY ) && + inode->generation == trans->transid && + !recursive_logging) { +u64 other_ino =0 ; +u64 other_parent =0 ; + + ret =btrfs_check_ref_name_override (path->nodes[0 ], + path->slots[0 ], min_key, inode, + &other_ino, &other_parent); +if (ret <0 ) { +return ret; + }else if (ret >0 && ctx && + other_ino !=btrfs_ino (BTRFS_I (ctx->inode))) { +if (ins_nr >0 ) { + ins_nr++; + }else { + ins_nr =1 ; + ins_start_slot = path->slots[0 ]; + } + ret =copy_items (trans, inode, dst_path, path, + ins_start_slot, ins_nr, + inode_only, logged_isize); +if (ret <0 ) +return ret; + ins_nr =0 ; + + ret =log_conflicting_inodes (trans, root, path, + ctx, other_ino, other_parent); +if (ret) +return ret; +btrfs_release_path (path); + goto next_key; + } + } + +/* Skip xattrs, we log them later with btrfs_log_all_xattrs() */ +if (min_key->type ==BTRFS_XATTR_ITEM_KEY ) { +if (ins_nr ==0 ) + goto next_slot; + ret =copy_items (trans, inode, dst_path, path, + ins_start_slot, + ins_nr, inode_only, logged_isize); +if (ret <0 ) +return ret; + ins_nr =0 ; + goto next_slot; + } + +if (ins_nr && ins_start_slot + ins_nr == path->slots[0 ]) { + ins_nr++; + goto next_slot; + }else if (!ins_nr) { + ins_start_slot = path->slots[0 ]; + ins_nr =1 ; + goto next_slot; + } + + ret =copy_items (trans, inode, dst_path, path, ins_start_slot, + ins_nr, inode_only, logged_isize); +if (ret <0 ) +return ret; + ins_nr =1 ; + ins_start_slot = path->slots[0 ]; +next_slot: + path->slots[0 ]++; +if (path->slots[0 ] <btrfs_header_nritems (path->nodes[0 ])) { +btrfs_item_key_to_cpu (path->nodes[0 ], min_key, + path->slots[0 ]); + goto again; + } +if (ins_nr) { + ret =copy_items (trans, inode, dst_path, path, + ins_start_slot, ins_nr, inode_only, + logged_isize); +if (ret <0 ) +return ret; + ins_nr =0 ; + } +btrfs_release_path (path); +next_key: +if (min_key->offset < (u64)-1 ) { + min_key->offset++; + }else if (min_key->type < max_key->type) { + min_key->type++; + min_key->offset =0 ; + }else { +break ; + } + } +if (ins_nr) + ret =copy_items (trans, inode, dst_path, path, ins_start_slot, + ins_nr, inode_only, logged_isize); + +return ret; +} +/* log a single inode in the tree log. * At least one parent directory for this inode must exist in the tree * or be logged already.
@@ -5023,9 +5155,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,struct btrfs_root *log = root->log_root;int err =0 ;int ret; -int nritems; -int ins_start_slot =0 ; -int ins_nr;bool fast_search = false;u64 ino =btrfs_ino (inode);struct extent_map_tree *em_tree = &inode->extent_tree;
@@ -5156,139 +5285,12 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, goto out_unlock; } -while (1 ) { - ins_nr =0 ; - ret =btrfs_search_forward (root, &min_key, - path, trans->transid); -if (ret <0 ) { - err = ret; - goto out_unlock; - } -if (ret !=0 ) -break ; -again: -/* note, ins_nr might be > 0 here, cleanup outside the loop */ -if (min_key.objectid != ino) -break ; -if (min_key.type > max_key.type) -break ; - -if (min_key.type ==BTRFS_INODE_ITEM_KEY ) - need_log_inode_item = false; - -if ((min_key.type ==BTRFS_INODE_REF_KEY || - min_key.type ==BTRFS_INODE_EXTREF_KEY ) && - inode->generation == trans->transid && - !recursive_logging) { -u64 other_ino =0 ; -u64 other_parent =0 ; - - ret =btrfs_check_ref_name_override (path->nodes[0 ], - path->slots[0 ], &min_key, inode, - &other_ino, &other_parent); -if (ret <0 ) { - err = ret; - goto out_unlock; - }else if (ret >0 && ctx && - other_ino !=btrfs_ino (BTRFS_I (ctx->inode))) { -if (ins_nr >0 ) { - ins_nr++; - }else { - ins_nr =1 ; - ins_start_slot = path->slots[0 ]; - } - ret =copy_items (trans, inode, dst_path, path, - ins_start_slot, - ins_nr, inode_only, - logged_isize); -if (ret <0 ) { - err = ret; - goto out_unlock; - } - ins_nr =0 ; - - err =log_conflicting_inodes (trans, root, path, - ctx, other_ino, other_parent); -if (err) - goto out_unlock; -btrfs_release_path (path); - goto next_key; - } - } - -/* Skip xattrs, we log them later with btrfs_log_all_xattrs() */ -if (min_key.type ==BTRFS_XATTR_ITEM_KEY ) { -if (ins_nr ==0 ) - goto next_slot; - ret =copy_items (trans, inode, dst_path, path, - ins_start_slot, - ins_nr, inode_only, logged_isize); -if (ret <0 ) { - err = ret; - goto out_unlock; - } - ins_nr =0 ; - goto next_slot; - } - -if (ins_nr && ins_start_slot + ins_nr == path->slots[0 ]) { - ins_nr++; - goto next_slot; - }else if (!ins_nr) { - ins_start_slot = path->slots[0 ]; - ins_nr =1 ; - goto next_slot; - } - - ret =copy_items (trans, inode, dst_path, path, - ins_start_slot, ins_nr, inode_only, - logged_isize); -if (ret <0 ) { - err = ret; - goto out_unlock; - } - ins_nr =1 ; - ins_start_slot = path->slots[0 ]; -next_slot: - - nritems =btrfs_header_nritems (path->nodes[0 ]); - path->slots[0 ]++; -if (path->slots[0 ] < nritems) { -btrfs_item_key_to_cpu (path->nodes[0 ], &min_key, - path->slots[0 ]); - goto again; - } -if (ins_nr) { - ret =copy_items (trans, inode, dst_path, path, - ins_start_slot, - ins_nr, inode_only, logged_isize); -if (ret <0 ) { - err = ret; - goto out_unlock; - } - ins_nr =0 ; - } -btrfs_release_path (path); -next_key: -if (min_key.offset < (u64)-1 ) { - min_key.offset++; - }else if (min_key.type < max_key.type) { - min_key.type++; - min_key.offset =0 ; - }else { -break ; - } - } -if (ins_nr) { - ret =copy_items (trans, inode, dst_path, path, - ins_start_slot, ins_nr, inode_only, - logged_isize); -if (ret <0 ) { - err = ret; - goto out_unlock; - } - ins_nr =0 ; - } + err =copy_inode_items_to_log (trans, inode, &min_key, &max_key, + path, dst_path, logged_isize, + recursive_logging, inode_only, ctx, + &need_log_inode_item); +if (err) + goto out_unlock;btrfs_release_path (path);btrfs_release_path (dst_path);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 76/214 s390/numa: set node distance to LOCAL_DISTANCE
In reply to Greg Kroah-Hartman[ Upstream commit 535e4fc623fab2e09a0653fc3a3e17f382ad0251 ]
The node distance is hardcoded to 0, which causes a trouble for some user-level applications. In particular, "libnuma" expects the distance of a node to itself as LOCAL_DISTANCE. This update removes the offending node distance override.
--- arch/s390/include/asm/numa.h | 1 - arch/s390/include/asm/topology.h | 2 -- arch/s390/numa/numa.c | 6 ------ 3 files changed, 9 deletions(-)
arch/s390/include/asm/numa.h +0 -1
@@ -17,7 +17,6 @@void numa_setup (void );int numa_pfn_to_nid (unsigned long pfn); -int __node_distance (int a,int b);void numa_update_cpu_topology (void );extern cpumask_t node_to_cpumask_map[MAX_NUMNODES ];
arch/s390/include/asm/topology.h +0 -2
@@ -83,8 +83,6 @@ static inline const struct cpumask *cpumask_of_node(int node)#define pcibus_to_node (bus) __pcibus_to_node(bus) -#define node_distance (a, b) __node_distance(a, b) -#else /* !CONFIG_NUMA */ #define numa_node_id numa_node_id
arch/s390/numa/numa.c +0 -6
@@ -49,12 +49,6 @@ void numa_update_cpu_topology(void) mode->update_cpu_topology (); } -int __node_distance (int a,int b) -{ -return mode->distance ? mode->distance (a, b) :0 ; -} -EXPORT_SYMBOL (__node_distance); -int numa_debug_enabled;/*
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 74/214 drm/xen: fix passing zero to PTR_ERR warning
In reply to Greg Kroah-HartmanFrom: Ding Xiang <[email protected]>
[ Upstream commit 4c1cb04e0e7ac4ba1ef5457929ef9b5671d9eed3 ]
Fix a static code checker warning:
drivers/gpu/drm/xen/xen_drm_front.c:404 xen_drm_drv_dumb_create()
warn: passing zero to 'PTR_ERR'
--- drivers/gpu/drm/xen/xen_drm_front.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xen/xen_drm_front.c +1 -1
@@ -401,7 +401,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp, obj =xen_drm_front_gem_create (dev, args->size);if (IS_ERR_OR_NULL (obj)) { - ret =PTR_ERR (obj); + ret =PTR_ERR_OR_ZERO (obj); goto fail; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 72/214 PM / devfreq: rk3399_dmc: Disable devfreq-event device when fails
In reply to Greg Kroah-HartmanFrom: Yangtao Li <[email protected]>
[ Upstream commit 39a6e4739c19d5334e552d71ceca544ed84f4b87 ]
The probe process may fail, but the devfreq event device remains enabled. Call devfreq_event_disable_edev on the error return path.
--- drivers/devfreq/rk3399_dmc.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/devfreq/rk3399_dmc.c +13 -5
@@ -364,7 +364,8 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)if (res.a0) {dev_err (dev,"Failed to set dram param: %ld\n" , res.a0); -return -EINVAL ; + ret = -EINVAL ; + goto err_edev; } } }
@@ -373,8 +374,10 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)if (node) { data->regmap_pmu =syscon_node_to_regmap (node);of_node_put (node); -if (IS_ERR (data->regmap_pmu)) -return PTR_ERR (data->regmap_pmu); +if (IS_ERR (data->regmap_pmu)) { + ret =PTR_ERR (data->regmap_pmu); + goto err_edev; + } }regmap_read (data->regmap_pmu,RK3399_PMUGRF_OS_REG2 , &val);
@@ -392,7 +395,8 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev) data->odt_dis_freq = data->timing.lpddr4_odt_dis_freq;break ;default : -return -EINVAL ; + ret = -EINVAL ; + goto err_edev; }; arm_smccc_smc(ROCKCHIP_SIP_DRAM_FREQ, 0, 0,
@@ -426,7 +430,8 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)*/ if (dev_pm_opp_of_add_table (dev)) {dev_err (dev,"Invalid operating-points in device tree.\n" ); -return -EINVAL ; + ret = -EINVAL ; + goto err_edev; } of_property_read_u32(np, "upthreshold",
@@ -466,6 +471,9 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev) err_free_opp:dev_pm_opp_of_remove_table (&pdev->dev); +err_edev: +devfreq_event_disable_edev (data->edev); +return ret; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 70/214 usb: cdns3: gadget: always zeroed TRB buffer when enable endpoint
In reply to Greg Kroah-Hartman[ Upstream commit 95f5acfc4f58f01a22b66d8c9c0ffb72aa96271c ]
During the endpoint dequeue operation, it changes dequeued TRB as link TRB, when the endpoint is disabled and re-enabled, the DMA fetches the TRB before the link TRB, after it handles current TRB, the DMA pointer will advance to the TRB after link TRB, but enqueue and dequene variables don't know it due to no hardware interrupt at the time, when the next TRB is added to link TRB position, the DMA will not handle this TRB due to its pointer is already at the next TRB. See the trace log like below:
file-storage-675 [001] d..1 86.585657: usb_ep_queue: ep0: req 00000000df9b3a4f length 0/0 sgs 0/0 stream 0 zsI status 0 --> 0
file-storage-675 [001] d..1 86.585663: cdns3_ep_queue: ep1out: req: 000000002ebce364, req buff 00000000f5bc96b4, length: 0/1024 zsi, status: -115, trb: [start:0, end:0: virt addr (null)], flags:0 SID: 0
file-storage-675 [001] d..1 86.585671: cdns3_prepare_trb: ep1out: trb 000000007f770303, dma buf: 0xbd195800, size: 1024, burst: 128 ctrl: 0x00000425 (C=1, T=0, ISP, IOC, Normal) SID:0 LAST_SID:0
file-storage-675 [001] d..1 86.585676: cdns3_ring:
Ring contents for ep1out:
Ring deq index: 0, trb: 000000007f770303 (virt), 0xc4003000 (dma)
Ring enq index: 1, trb: 0000000049c1ba21 (virt), 0xc400300c (dma)
free trbs: 38, CCS=1, PCS=1
@0x00000000c4003000 bd195800 80020400 00000425
@0x00000000c400300c c4003018 80020400 00001811
@0x00000000c4003018 bcfcc000 0000001f 00000426
@0x00000000c4003024 bcfce800 0000001f 00000426
... irq/144-5b13000-698 [000] d... 87.619286: usb_gadget_giveback_request: ep1in: req 0000000031b832eb length 13/13 sgs 0/0 stream 0 zsI status 0 --> 0
file-storage-675 [001] d..1 87.619287: cdns3_ep_queue: ep1out: req: 000000002ebce364, req buff 00000000f5bc96b4, length: 0/1024 zsi, status: -115, trb: [start:0, end:0: virt addr 0x80020400c400300c], flags:0 SID: 0
file-storage-675 [001] d..1 87.619294: cdns3_prepare_trb: ep1out: trb 0000000049c1ba21, dma buf: 0xbd198000, size: 1024, burst: 128 ctrl: 0x00000425 (C=1, T=0, ISP, IOC, Normal) SID:0 LAST_SID:0
file-storage-675 [001] d..1 87.619297: cdns3_ring:
Ring contents for ep1out:
Ring deq index: 1, trb: 0000000049c1ba21 (virt), 0xc400300c (dma)
Ring enq index: 2, trb: 0000000059b34b67 (virt), 0xc4003018 (dma)
free trbs: 38, CCS=1, PCS=1
@0x00000000c4003000 bd195800 0000001f 00000427
@0x00000000c400300c bd198000 80020400 00000425
@0x00000000c4003018 bcfcc000 0000001f 00000426
@0x00000000c4003024 bcfce800 0000001f 00000426
...
file-storage-675 [001] d..1 87.619305: cdns3_doorbell_epx: ep1out, ep_trbaddr c4003018
file-storage-675 [001] .... 87.619308: usb_ep_queue: ep1out: req 000000002ebce364 length 0/1024 sgs 0/0 stream 0 zsI status -115 --> 0
irq/144-5b13000-698 [000] d..1 87.619315: cdns3_epx_irq: IRQ for ep1out: 01000c80 TRBERR , ep_traddr: c4003018 ep_last_sid: 00000000 use_streams: 0
irq/144-5b13000-698 [000] d..1 87.619395: cdns3_usb_irq: IRQ 00000008 = Hot Reset--- drivers/usb/cdns3/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/cdns3/gadget.c +2 -2
@@ -189,10 +189,10 @@ int cdns3_allocate_trb_pool(struct cdns3_endpoint *priv_ep) GFP_DMA32 | GFP_ATOMIC);if (!priv_ep->trb_pool)return -ENOMEM ; - }else { -memset (priv_ep->trb_pool,0 , ring_size); } +memset (priv_ep->trb_pool,0 , ring_size); +if (!priv_ep->num)return 0 ;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 69/214 sched/uclamp: Fix a deadlock when enabling uclamp static key
In reply to Greg Kroah-HartmanFrom: Qais Yousef <[email protected]>
[ Upstream commit e65855a52b479f98674998cb23b21ef5a8144b04 ]
The following splat was caught when setting uclamp value of a task:
BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:49 cpus_read_lock+0x68/0x130 static_key_enable+0x1c/0x38 __sched_setscheduler+0x900/0xad8
Fix by ensuring we enable the key outside of the critical section in __sched_setscheduler()
--- kernel/sched/core.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
kernel/sched/core.c +9 -2
@@ -1249,6 +1249,15 @@ static int uclamp_validate(struct task_struct *p,if (upper_bound >SCHED_CAPACITY_SCALE )return -EINVAL ; +/* +* We have valid uclamp attributes; make sure uclamp is enabled. +* +* We need to do that here, because enabling static branches is a +* blocking operation which obviously cannot be done while holding +* scheduler locks. +*/ +static_branch_enable (&sched_uclamp_used); +return 0 ; }
@@ -1279,8 +1288,6 @@ static void __setscheduler_uclamp(struct task_struct *p,if (likely (!(attr->sched_flags &SCHED_FLAG_UTIL_CLAMP )))return ; -static_branch_enable (&sched_uclamp_used); -if (attr->sched_flags &SCHED_FLAG_UTIL_CLAMP_MIN ) {uclamp_se_set (&p->uclamp_req[UCLAMP_MIN ], attr->sched_util_min, true);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 26/214 mfd: intel-lpss: Add Intel Tiger Lake PCH-H PCI IDs
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit bb7fcad48d3804d814b97c785514e2d1657e157f ]
Intel Tiger Lake PCH-H has the same LPSS than Intel Broxton. Add the new IDs to the list of supported devices.
--- drivers/mfd/intel-lpss-pci.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/mfd/intel-lpss-pci.c +16 -0
@@ -228,6 +228,22 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x34ea), (kernel_ulong_t)&bxt_i2c_info }, { PCI_VDEVICE(INTEL, 0x34eb), (kernel_ulong_t)&bxt_i2c_info }, { PCI_VDEVICE(INTEL, 0x34fb), (kernel_ulong_t)&spt_info }, +/* TGL-H */ + { PCI_VDEVICE(INTEL, 0x43a7), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x43a8), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x43a9), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x43aa), (kernel_ulong_t)&bxt_info }, + { PCI_VDEVICE(INTEL, 0x43ab), (kernel_ulong_t)&bxt_info }, + { PCI_VDEVICE(INTEL, 0x43ad), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x43ae), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x43d8), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x43da), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x43e8), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x43e9), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x43ea), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x43eb), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x43fb), (kernel_ulong_t)&bxt_info }, + { PCI_VDEVICE(INTEL, 0x43fd), (kernel_ulong_t)&bxt_info },/* EHL */ { PCI_VDEVICE(INTEL, 0x4b28), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x4b29), (kernel_ulong_t)&bxt_uart_info },
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 35/214 xfs: Dont allow logging of XFS_ISTALE inodes
In reply to Greg Kroah-HartmanFrom: Dave Chinner <[email protected]>
[ Upstream commit 96355d5a1f0ee6dcc182c37db4894ec0c29f1692 ]
In tracking down a problem in this patchset, I discovered we are reclaiming dirty stale inodes. This wasn't discovered until inodes were always attached to the cluster buffer and then the rcu callback that freed inodes was assert failing because the inode still had an active pointer to the cluster buffer after it had been reclaimed.
Debugging the issue indicated that this was a pre-existing issue resulting from the way the inodes are handled in xfs_inactive_ifree. When we free a cluster buffer from xfs_ifree_cluster, all the inodes in cache are marked XFS_ISTALE. Those that are clean have nothing else done to them and so eventually get cleaned up by background reclaim. i.e. it is assumed we'll never dirty/relog an inode marked XFS_ISTALE.
On journal commit dirty stale inodes as are handled by both buffer and inode log items to run though xfs_istale_done() and removed from the AIL (buffer log item commit) or the log item will simply unpin it because the buffer log item will clean it. What happens to any specific inode is entirely dependent on which log item wins the commit race, but the result is the same - stale inodes are clean, not attached to the cluster buffer, and not in the AIL. Hence inode reclaim can just free these inodes without further care.
However, if the stale inode is relogged, it gets dirtied again and relogged into the CIL. Most of the time this isn't an issue, because relogging simply changes the inode's location in the current checkpoint. Problems arise, however, when the CIL checkpoints between two transactions in the xfs_inactive_ifree() deferops processing. This results in the XFS_ISTALE inode being redirtied and inserted into the CIL without any of the other stale cluster buffer infrastructure being in place.
Hence on journal commit, it simply gets unpinned, so it remains dirty in memory. Everything in inode writeback avoids XFS_ISTALE inodes so it can't be written back, and it is not tracked in the AIL so there's not even a trigger to attempt to clean the inode. Hence the inode just sits dirty in memory until inode reclaim comes along, sees that it is XFS_ISTALE, and goes to reclaim it. This reclaiming of a dirty inode caused use after free, list corruptions and other nasty issues later in this patchset.
Hence this patch addresses a violation of the "never log XFS_ISTALE inodes" caused by the deferops processing rolling a transaction and relogging a stale inode in xfs_inactive_free. It also adds a bunch of asserts to catch this problem in debug kernels so that we don't reintroduce this problem in future.
Reproducer for this issue was generic/558 on a v4 filesystem.
--- fs/xfs/libxfs/xfs_trans_inode.c | 2 ++ fs/xfs/xfs_icache.c | 3 ++- fs/xfs/xfs_inode.c | 25 ++++++++++++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-)
fs/xfs/libxfs/xfs_trans_inode.c +2 -0
@@ -36,6 +36,7 @@ xfs_trans_ijoin(ASSERT (iip->ili_lock_flags ==0 ); iip->ili_lock_flags = lock_flags; +ASSERT (!xfs_iflags_test (ip,XFS_ISTALE ));/* * Get a log_item_desc to point at the new item.
@@ -91,6 +92,7 @@ xfs_trans_log_inode(ASSERT (ip->i_itemp !=NULL );ASSERT (xfs_isilocked (ip,XFS_ILOCK_EXCL )); +ASSERT (!xfs_iflags_test (ip,XFS_ISTALE ));/* * Don't bother with i_lock for the I_DIRTY_TIME check here, as races
fs/xfs/xfs_icache.c +2 -1
@@ -1132,7 +1132,7 @@ restart: goto out_ifunlock;xfs_iunpin_wait (ip); } -if (xfs_iflags_test (ip,XFS_ISTALE ) ||xfs_inode_clean (ip)) { +if (xfs_inode_clean (ip)) {xfs_ifunlock (ip); goto reclaim; }
@@ -1219,6 +1219,7 @@ reclaim:xfs_ilock (ip,XFS_ILOCK_EXCL );xfs_qm_dqdetach (ip);xfs_iunlock (ip,XFS_ILOCK_EXCL ); +ASSERT (xfs_inode_clean (ip));__xfs_inode_free (ip);return error;
fs/xfs/xfs_inode.c +22 -3
@@ -1761,10 +1761,31 @@ xfs_inactive_ifree(return error; } +/* +* We do not hold the inode locked across the entire rolling transaction +* here. We only need to hold it for the first transaction that +* xfs_ifree() builds, which may mark the inode XFS_ISTALE if the +* underlying cluster buffer is freed. Relogging an XFS_ISTALE inode +* here breaks the relationship between cluster buffer invalidation and +* stale inode invalidation on cluster buffer item journal commit +* completion, and can result in leaving dirty stale inodes hanging +* around in memory. +* +* We have no need for serialising this inode operation against other +* operations - we freed the inode and hence reallocation is required +* and that will serialise on reallocating the space the deferops need +* to free. Hence we can unlock the inode on the first commit of +* the transaction rather than roll it right through the deferops. This +* avoids relogging the XFS_ISTALE inode. +* +* We check that xfs_ifree() hasn't grown an internal transaction roll +* by asserting that the inode is still locked when it returns. +*/ xfs_ilock (ip,XFS_ILOCK_EXCL ); -xfs_trans_ijoin (tp, ip,0 ); +xfs_trans_ijoin (tp, ip,XFS_ILOCK_EXCL ); error =xfs_ifree (tp, ip); +ASSERT (xfs_isilocked (ip,XFS_ILOCK_EXCL ));if (error) {/* * If we fail to free the inode, shut down. The cancel
@@ -1777,7 +1798,6 @@ xfs_inactive_ifree(xfs_force_shutdown (mp,SHUTDOWN_META_IO_ERROR ); }xfs_trans_cancel (tp); -xfs_iunlock (ip,XFS_ILOCK_EXCL );return error; }
@@ -1795,7 +1815,6 @@ xfs_inactive_ifree(xfs_notice (mp,"%s: xfs_trans_commit returned error %d" , __func__, error); -xfs_iunlock (ip,XFS_ILOCK_EXCL );return 0 ; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 34/214 scsi: lpfc: Fix shost refcount mismatch when deleting vport
In reply to Greg Kroah-HartmanFrom: Dick Kennedy <[email protected]>
[ Upstream commit 03dbfe0668e6692917ac278883e0586cd7f7d753 ]
When vports are deleted, it is observed that there is memory/kthread leakage as the vport isn't fully being released.
There is a shost reference taken in scsi_add_host_dma that is not released during scsi_remove_host. It was noticed that other drivers resolve this by doing a scsi_host_put after calling scsi_remove_host.
The vport_delete routine is taking two references one that corresponds to an access to the scsi_host in the vport_delete routine and another that is released after the adapter mailbox command completes that destroys the VPI that corresponds to the vport.
Remove one of the references taken such that the second reference that is put will complete the missing scsi_add_host_dma reference and the shost will be terminated.
--- drivers/scsi/lpfc/lpfc_vport.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
drivers/scsi/lpfc/lpfc_vport.c +8 -18
@@ -642,27 +642,16 @@ lpfc_vport_delete(struct fc_vport *fc_vport) vport->port_state < LPFC_VPORT_READY)return -EAGAIN ; } +/* -* This is a bit of a mess. We want to ensure the shost doesn't get -* torn down until we're done with the embedded lpfc_vport structure. -* -* Beyond holding a reference for this function, we also need a -* reference for outstanding I/O requests we schedule during delete -* processing. But once we scsi_remove_host() we can no longer obtain -* a reference through scsi_host_get(). -* -* So we take two references here. We release one reference at the -* bottom of the function -- after delinking the vport. And we -* release the other at the completion of the unreg_vpi that get's -* initiated after we've disposed of all other resources associated -* with the port. +* Take early refcount for outstanding I/O requests we schedule during +* delete processing for unreg_vpi. Always keep this before +* scsi_remove_host() as we can no longer obtain a reference through +* scsi_host_get() after scsi_host_remove as shost is set to SHOST_DEL. */ if (!scsi_host_get (shost))return VPORT_INVAL ; -if (!scsi_host_get (shost)) { -scsi_host_put (shost); -return VPORT_INVAL ; - } +lpfc_free_sysfs_attr (vport);lpfc_debugfs_terminate (vport);
@@ -809,8 +798,9 @@ skip_logo:if (!(vport->vpi_state &LPFC_VPI_REGISTERED ) ||lpfc_mbx_unreg_vpi (vport))scsi_host_put (shost); - }else + }else {scsi_host_put (shost); + }lpfc_free_vpi (phba, vport->vpi); vport->work_port_events =0 ;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 57/214 scsi: fcoe: Memory leak fix in fcoe_sysfs_fcf_del()
In reply to Greg Kroah-HartmanFrom: Javed Hasan <[email protected]>
[ Upstream commit e95b4789ff4380733006836d28e554dc296b2298 ]
In fcoe_sysfs_fcf_del(), we first deleted the fcf from the list and then freed it if ctlr_dev was not NULL. This was causing a memory leak.
Free the fcf even if ctlr_dev is NULL.
--- drivers/scsi/fcoe/fcoe_ctlr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/fcoe/fcoe_ctlr.c +1 -1
@@ -255,9 +255,9 @@ static void fcoe_sysfs_fcf_del(struct fcoe_fcf *new)WARN_ON (!fcf_dev); new->fcf_dev =NULL ;fcoe_fcf_device_delete (fcf_dev); -kfree (new);mutex_unlock (&cdev->lock); } +kfree (new); }/**
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 56/214 ceph: do not access the kiocb after aio requests
In reply to Greg Kroah-HartmanFrom: Xiubo Li <[email protected]>
[ Upstream commit d1d9655052606fd9078e896668ec90191372d513 ]
In aio case, if the completion comes very fast just before the ceph_read_iter() returns to fs/aio.c, the kiocb will be freed in the completion callback, then if ceph_read_iter() access again we will potentially hit the use-after-free bug.
[ jlayton: initialize direct_lock early, and use it everywhere ]
URL: https://tracker.ceph.com/issues/45649
--- fs/ceph/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ceph/file.c +3 -2
@@ -1260,6 +1260,7 @@ static ssize_t ceph_read_iter(struct kiocb *iocb, struct iov_iter *to)struct inode *inode =file_inode (filp);struct ceph_inode_info *ci =ceph_inode (inode);struct page *pinned_page =NULL ; +bool direct_lock = iocb->ki_flags &IOCB_DIRECT ;ssize_t ret;int want, got =0 ;int retry_op =0 , read =0 ;
@@ -1268,7 +1269,7 @@ again:dout ("aio_read %p %llx.%llx %llu~%u trying to get caps on %p\n" , inode,ceph_vinop (inode), iocb->ki_pos, (unsigned )len, inode); -if (iocb->ki_flags &IOCB_DIRECT ) +if (direct_lock)ceph_start_io_direct (inode);else ceph_start_io_read (inode);
@@ -1325,7 +1326,7 @@ again: }ceph_put_cap_refs (ci, got); -if (iocb->ki_flags &IOCB_DIRECT ) +if (direct_lock)ceph_end_io_direct (inode);else ceph_end_io_read (inode);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 53/214 btrfs: make btrfs_qgroup_check_reserved_leak take btrfs_inode
In reply to Greg Kroah-HartmanFrom: Nikolay Borisov <[email protected]>
[ Upstream commit cfdd45921571eb24073e0737fa0bd44b4218f914 ]
vfs_inode is used only for the inode number everything else requires btrfs_inode.
--- fs/btrfs/inode.c | 2 +- fs/btrfs/qgroup.c | 14 +++++++------- fs/btrfs/qgroup.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-)
fs/btrfs/inode.c +1 -1
@@ -9568,7 +9568,7 @@ void btrfs_destroy_inode(struct inode *inode)btrfs_put_ordered_extent (ordered); } } -btrfs_qgroup_check_reserved_leak (inode); +btrfs_qgroup_check_reserved_leak (BTRFS_I (inode));inode_tree_del (inode);btrfs_drop_extent_cache (BTRFS_I (inode),0 , (u64)-1 ,0 ); }
fs/btrfs/qgroup.c +7 -7
@@ -3769,7 +3769,7 @@ void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes)* Check qgroup reserved space leaking, normally at destroy inode * time */ -void btrfs_qgroup_check_reserved_leak (struct inode *inode) +void btrfs_qgroup_check_reserved_leak (struct btrfs_inode *inode) {struct extent_changeset changeset;struct ulist_node *unode;
@@ -3777,19 +3777,19 @@ void btrfs_qgroup_check_reserved_leak(struct inode *inode)int ret;extent_changeset_init (&changeset); - ret =clear_record_extent_bits (&BTRFS_I (inode)->io_tree,0 , (u64)-1 , + ret =clear_record_extent_bits (&inode->io_tree,0 , (u64)-1 ,EXTENT_QGROUP_RESERVED , &changeset);WARN_ON (ret <0 );if (WARN_ON (changeset.bytes_changed)) {ULIST_ITER_INIT (&iter);while ((unode =ulist_next (&changeset.range_changed, &iter))) { -btrfs_warn (BTRFS_I (inode)->root->fs_info, -"leaking qgroup reserved space, ino: %lu, start: %llu, end: %llu" , - inode->i_ino, unode->val, unode->aux); +btrfs_warn (inode->root->fs_info, +"leaking qgroup reserved space, ino: %llu, start: %llu, end: %llu" , +btrfs_ino (inode), unode->val, unode->aux); } -btrfs_qgroup_free_refroot (BTRFS_I (inode)->root->fs_info, -BTRFS_I (inode)->root->root_key.objectid, +btrfs_qgroup_free_refroot (inode->root->fs_info, + inode->root->root_key.objectid, changeset.bytes_changed,BTRFS_QGROUP_RSV_DATA ); }
fs/btrfs/qgroup.h +1 -1
@@ -399,7 +399,7 @@ void btrfs_qgroup_free_meta_all_pertrans(struct btrfs_root *root);*/ void btrfs_qgroup_convert_reserved_meta (struct btrfs_root *root,int num_bytes); -void btrfs_qgroup_check_reserved_leak (struct inode *inode); +void btrfs_qgroup_check_reserved_leak (struct btrfs_inode *inode);/* btrfs_qgroup_swapped_blocks related functions */ void btrfs_qgroup_init_swapped_blocks(
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 54/214 scsi: iscsi: Do not put host in iscsi_set_flashnode_param()
In reply to Greg Kroah-HartmanFrom: Jing Xiangfeng <[email protected]>
[ Upstream commit 68e12e5f61354eb42cfffbc20a693153fc39738e ]
If scsi_host_lookup() fails we will jump to put_host which may cause a panic. Jump to exit_set_fnode instead.
--- drivers/scsi/scsi_transport_iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_iscsi.c +1 -1
@@ -3174,7 +3174,7 @@ static int iscsi_set_flashnode_param(struct iscsi_transport *transport,pr_err ("%s could not find host no %u\n" , __func__, ev->u.set_flashnode.host_no); err = -ENODEV ; - goto put_host; + goto exit_set_fnode; } idx = ev->u.set_flashnode.flashnode_idx;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 51/214 locking/lockdep: Fix overflow in presentation of average lock-time
In reply to Greg Kroah-HartmanFrom: Chris Wilson <[email protected]>
[ Upstream commit a7ef9b28aa8d72a1656fa6f0a01bbd1493886317 ]
Though the number of lock-acquisitions is tracked as unsigned long, this is passed as the divisor to div_s64() which interprets it as a s32, giving nonsense values with more than 2 billion acquisitons. E.g.
acquisitions holdtime-min holdtime-max holdtime-total holdtime-avg
-------------------------------------------------------------------------
2350439395 0.07 353.38 649647067.36 0.-32
--- kernel/locking/lockdep_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/locking/lockdep_proc.c +1 -1
@@ -400,7 +400,7 @@ static void seq_lock_time(struct seq_file *m, struct lock_time *lt)seq_time (m, lt->min);seq_time (m, lt->max);seq_time (m, lt->total); -seq_time (m, lt->nr ?div_s64 (lt->total, lt->nr) :0 ); +seq_time (m, lt->nr ?div64_u64 (lt->total, lt->nr) :0 ); }static void seq_stats (struct seq_file *m,struct lock_stat_data *data)
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 50/214 drm/nouveau: Fix reference count leak in nouveau_connector_detect
In reply to Greg Kroah-HartmanFrom: Aditya Pakki <[email protected]>
[ Upstream commit 990a1162986e8eff7ca18cc5a0e03b4304392ae2 ]
nouveau_connector_detect() calls pm_runtime_get_sync and in turn increments the reference count. In case of failure, decrement the ref count before returning the error.
--- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_connector.c +3 -1
@@ -568,8 +568,10 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)pm_runtime_get_noresume (dev->dev); }else { ret =pm_runtime_get_sync (dev->dev); -if (ret <0 && ret != -EACCES ) +if (ret <0 && ret != -EACCES ) { +pm_runtime_put_autosuspend (dev->dev);return conn_status; + } } nv_encoder =nouveau_connector_ddc_detect (connector);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 48/214 drm/nouveau/drm/noveau: fix reference count leak in nouveau_fbcon_open
In reply to Greg Kroah-HartmanFrom: Aditya Pakki <[email protected]>
[ Upstream commit bfad51c7633325b5d4b32444efe04329d53297b2 ]
nouveau_fbcon_open() calls calls pm_runtime_get_sync() that increments the reference count. In case of failure, decrement the ref count before returning the error.
--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fbcon.c +3 -1
@@ -189,8 +189,10 @@ nouveau_fbcon_open(struct fb_info *info, int user)struct nouveau_fbdev *fbcon = info->par;struct nouveau_drm *drm =nouveau_drm (fbcon->helper.dev);int ret =pm_runtime_get_sync (drm->dev->dev); -if (ret <0 && ret != -EACCES ) +if (ret <0 && ret != -EACCES ) { +pm_runtime_put (drm->dev->dev);return ret; + }return 0 ; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 28/214 drm/amdkfd: Fix reference count leaks.
In reply to Greg Kroah-HartmanFrom: Qiushi Wu <[email protected]>
[ Upstream commit 20eca0123a35305e38b344d571cf32768854168c ]
kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object.
--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +15 -5
@@ -612,8 +612,10 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, ret =kobject_init_and_add (dev->kobj_node, &node_type, sys_props.kobj_nodes,"%d" , id); -if (ret <0 ) +if (ret <0 ) { +kobject_put (dev->kobj_node);return ret; + } dev->kobj_mem =kobject_create_and_add ("mem_banks" , dev->kobj_node);if (!dev->kobj_mem)
@@ -660,8 +662,10 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev,return -ENOMEM ; ret =kobject_init_and_add (mem->kobj, &mem_type, dev->kobj_mem,"%d" , i); -if (ret <0 ) +if (ret <0 ) { +kobject_put (mem->kobj);return ret; + } mem->attr.name ="properties" ; mem->attr.mode =KFD_SYSFS_FILE_MODE ;
@@ -679,8 +683,10 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev,return -ENOMEM ; ret =kobject_init_and_add (cache->kobj, &cache_type, dev->kobj_cache,"%d" , i); -if (ret <0 ) +if (ret <0 ) { +kobject_put (cache->kobj);return ret; + } cache->attr.name ="properties" ; cache->attr.mode =KFD_SYSFS_FILE_MODE ;
@@ -698,8 +704,10 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev,return -ENOMEM ; ret =kobject_init_and_add (iolink->kobj, &iolink_type, dev->kobj_iolink,"%d" , i); -if (ret <0 ) +if (ret <0 ) { +kobject_put (iolink->kobj);return ret; + } iolink->attr.name ="properties" ; iolink->attr.mode =KFD_SYSFS_FILE_MODE ;
@@ -779,8 +787,10 @@ static int kfd_topology_update_sysfs(void) ret =kobject_init_and_add (sys_props.kobj_topology, &sysprops_type, &kfd_device->kobj,"topology" ); -if (ret <0 ) +if (ret <0 ) { +kobject_put (sys_props.kobj_topology);return ret; + } sys_props.kobj_nodes =kobject_create_and_add ("nodes" , sys_props.kobj_topology);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 46/214 HID: quirks: add NOGET quirk for Logitech GROUP
In reply to Greg Kroah-HartmanFrom: Ikjoon Jang <[email protected]>
[ Upstream commit 68f775ddd2a6f513e225f9a565b054ab48fef142 ]
Add HID_QUIRK_NOGET for Logitech GROUP device.
Logitech GROUP is a compound with camera and audio. When the HID interface in an audio device is requested to get specific report id, all following control transfers are stalled and never be restored back.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-quirks.c | 1 + 2 files changed, 2 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -771,6 +771,7 @@#define USB_DEVICE_ID_LOGITECH_G27_WHEEL 0xc29b#define USB_DEVICE_ID_LOGITECH_WII_WHEEL 0xc29c#define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a +#define USB_DEVICE_ID_LOGITECH_GROUP_AUDIO 0x0882#define USB_DEVICE_ID_S510_RECEIVER 0xc50c#define USB_DEVICE_ID_S510_RECEIVER_2 0xc517#define USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500 0xc512
drivers/hid/hid-quirks.c +1 -0
@@ -179,6 +179,7 @@ static const struct hid_device_id hid_quirks[] = { { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET }, { 0 } };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 45/214 cec-api: prevent leaking memory through hole in structure
In reply to Greg Kroah-HartmanFrom: Hans Verkuil <[email protected]>
[ Upstream commit 6c42227c3467549ddc65efe99c869021d2f4a570 ]
Fix this smatch warning:
drivers/media/cec/core/cec-api.c:156 cec_adap_g_log_addrs() warn: check that 'log_addrs' doesn't leak information (struct has a hole after 'features')
--- drivers/media/cec/cec-api.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/media/cec/cec-api.c +7 -1
@@ -147,7 +147,13 @@ static long cec_adap_g_log_addrs(struct cec_adapter *adap,struct cec_log_addrs log_addrs;mutex_lock (&adap->lock); - log_addrs = adap->log_addrs; +/* +* We use memcpy here instead of assignment since there is a +* hole at the end of struct cec_log_addrs that an assignment +* might ignore. So when we do copy_to_user() we could leak +* one byte of memory. +*/ +memcpy (&log_addrs, &adap->log_addrs,sizeof (log_addrs));if (!adap->is_configured)memset (log_addrs.log_addr,CEC_LOG_ADDR_INVALID ,sizeof (log_addrs.log_addr));
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 44/214 ALSA: hda: Add support for Loongson 7A1000 controller
In reply to Greg Kroah-HartmanFrom: Kaige Li <[email protected]>
[ Upstream commit 61eee4a7fc406f94e441778c3cecbbed30373c89 ]
Add the new PCI ID 0x0014 0x7a07 to support Loongson 7A1000 controller.
--- sound/pci/hda/hda_intel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/hda_intel.c +2 -0
@@ -2671,6 +2671,8 @@ static const struct pci_device_id azx_ids[] = { .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_HDMI },/* Zhaoxin */ { PCI_DEVICE(0x1d17, 0x3288), .driver_data = AZX_DRIVER_ZHAOXIN }, + /* Loongson */ + { PCI_DEVICE(0x0014, 0x7a07), .driver_data = AZX_DRIVER_GENERIC }, { 0, } };MODULE_DEVICE_TABLE (pci, azx_ids);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 41/214 ARM: dts: ls1021a: output PPS signal on FIPER2
In reply to Greg Kroah-HartmanFrom: Yangbo Lu <[email protected]>
[ Upstream commit 5656bb3857c4904d1dec6e1b8f876c1c0337274e ]
The timer fixed interval period pulse generator register is used to generate periodic pulses. The down count register loads the value programmed in the fixed period interval (FIPER). At every tick of the timer accumulator overflow, the counter decrements by the value of TMR_CTRL[TCLK_PERIOD]. It generates a pulse when the down counter value reaches zero. It reloads the down counter in the cycle following a pulse.
To use the TMR_FIPER register to generate desired periodic pulses. The value should programmed is, desired_period - tclk_period
Current tmr-fiper2 value is to generate 100us periodic pulses. (But the value should have been 99995, not 99990. The tclk_period is 5.) This patch is to generate 1 second periodic pulses with value 999999995 programmed which is more desired by user.
--- arch/arm/boot/dts/ls1021a.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/ls1021a.dtsi +1 -1
@@ -753,7 +753,7 @@ fsl,tmr-prsc = <2>; fsl,tmr-add = <0xaaaaaaab>; fsl,tmr-fiper1 = <999999995>; - fsl,tmr-fiper2 = <99990>; + fsl,tmr-fiper2 = <999999995>; fsl,max-adj = <499999999>; fsl,extts-fifo; };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 52/214 btrfs: file: reserve qgroup space after the hole punch range is locked
In reply to Greg Kroah-HartmanFrom: Qu Wenruo <[email protected]>
[ Upstream commit a7f8b1c2ac21bf081b41264c9cfd6260dffa6246 ]
The incoming qgroup reserved space timing will move the data reservation to ordered extent completely.
However in btrfs_punch_hole_lock_range() will call btrfs_invalidate_page(), which will clear QGROUP_RESERVED bit for the range.
In current stage it's OK, but if we're making ordered extents handle the reserved space, then btrfs_punch_hole_lock_range() can clear the QGROUP_RESERVED bit before we submit ordered extent, leading to qgroup reserved space leakage.
So here change the timing to make reserve data space after btrfs_punch_hole_lock_range().
The new timing is fine for either current code or the new code.
--- fs/btrfs/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/btrfs/file.c +4 -4
@@ -3130,14 +3130,14 @@ reserve_space:if (ret <0 ) goto out; space_reserved = true; - ret =btrfs_qgroup_reserve_data (inode, &data_reserved, - alloc_start, bytes_to_reserve); -if (ret) - goto out; ret =btrfs_punch_hole_lock_range (inode, lockstart, lockend, &cached_state);if (ret) goto out; + ret =btrfs_qgroup_reserve_data (inode, &data_reserved, + alloc_start, bytes_to_reserve); +if (ret) + goto out; ret = btrfs_prealloc_file_range(inode, mode, alloc_start, alloc_end - alloc_start, i_blocksize(inode),
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 40/214 PCI: Fix pci_create_slot() reference count leak
In reply to Greg Kroah-HartmanFrom: Qiushi Wu <[email protected]>
[ Upstream commit 8a94644b440eef5a7b9c104ac8aa7a7f413e35e5 ]
kobject_init_and_add() takes a reference even when it fails. If it returns an error, kobject_put() must be called to clean up the memory associated with the object.
When kobject_init_and_add() fails, call kobject_put() instead of kfree().
b8eb718348b8 ("net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject") fixed a similar problem.
--- drivers/pci/slot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/pci/slot.c +4 -2
@@ -304,13 +304,16 @@ placeholder: slot_name =make_slot_name (name);if (!slot_name) { err = -ENOMEM ; +kfree (slot); goto err; } err =kobject_init_and_add (&slot->kobj, &pci_slot_ktype,NULL ,"%s" , slot_name); -if (err) +if (err) { +kobject_put (&slot->kobj); goto err; + }INIT_LIST_HEAD (&slot->list);list_add (&slot->list, &parent->slots);
@@ -329,7 +332,6 @@ out:mutex_unlock (&pci_slot_mutex);return slot; err: -kfree (slot); slot =ERR_PTR (err); goto out; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 39/214 omapfb: fix multiple reference count leaks due to pm_runtime_get_sync
In reply to Greg Kroah-HartmanFrom: Aditya Pakki <[email protected]>
[ Upstream commit 78c2ce9bde70be5be7e3615a2ae7024ed8173087 ]
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error.
--- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 7 +++++-- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 7 +++++-- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 7 +++++-- drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 5 +++-- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 5 +++-- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 7 +++++-- 6 files changed, 26 insertions(+), 12 deletions(-)
drivers/video/fbdev/omap2/omapfb/dss/dispc.c +5 -2
@@ -520,8 +520,11 @@ int dispc_runtime_get(void)DSSDBG ("dispc_runtime_get\n" ); r =pm_runtime_get_sync (&dispc.pdev->dev); -WARN_ON (r <0 ); -return r <0 ? r :0 ; +if (WARN_ON (r <0 )) { +pm_runtime_put_sync (&dispc.pdev->dev); +return r; + } +return 0 ; }EXPORT_SYMBOL (dispc_runtime_get);
drivers/video/fbdev/omap2/omapfb/dss/dsi.c +5 -2
@@ -1137,8 +1137,11 @@ static int dsi_runtime_get(struct platform_device *dsidev)DSSDBG ("dsi_runtime_get\n" ); r =pm_runtime_get_sync (&dsi->pdev->dev); -WARN_ON (r <0 ); -return r <0 ? r :0 ; +if (WARN_ON (r <0 )) { +pm_runtime_put_sync (&dsi->pdev->dev); +return r; + } +return 0 ; }static void dsi_runtime_put (struct platform_device *dsidev)
drivers/video/fbdev/omap2/omapfb/dss/dss.c +5 -2
@@ -768,8 +768,11 @@ int dss_runtime_get(void)DSSDBG ("dss_runtime_get\n" ); r =pm_runtime_get_sync (&dss.pdev->dev); -WARN_ON (r <0 ); -return r <0 ? r :0 ; +if (WARN_ON (r <0 )) { +pm_runtime_put_sync (&dss.pdev->dev); +return r; + } +return 0 ; }void dss_runtime_put (void )
drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +3 -2
@@ -39,9 +39,10 @@ static int hdmi_runtime_get(void)DSSDBG ("hdmi_runtime_get\n" ); r =pm_runtime_get_sync (&hdmi.pdev->dev); -WARN_ON (r <0 ); -if (r <0 ) +if (WARN_ON (r <0 )) { +pm_runtime_put_sync (&hdmi.pdev->dev);return r; + }return 0 ; }
drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +3 -2
@@ -43,9 +43,10 @@ static int hdmi_runtime_get(void)DSSDBG ("hdmi_runtime_get\n" ); r =pm_runtime_get_sync (&hdmi.pdev->dev); -WARN_ON (r <0 ); -if (r <0 ) +if (WARN_ON (r <0 )) { +pm_runtime_put_sync (&hdmi.pdev->dev);return r; + }return 0 ; }
drivers/video/fbdev/omap2/omapfb/dss/venc.c +5 -2
@@ -391,8 +391,11 @@ static int venc_runtime_get(void)DSSDBG ("venc_runtime_get\n" ); r =pm_runtime_get_sync (&venc.pdev->dev); -WARN_ON (r <0 ); -return r <0 ? r :0 ; +if (WARN_ON (r <0 )) { +pm_runtime_put_sync (&venc.pdev->dev); +return r; + } +return 0 ; }static void venc_runtime_put (void )
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 38/214 f2fs: fix error path in do_recover_data()
In reply to Greg Kroah-HartmanFrom: Chao Yu <[email protected]>
[ Upstream commit 9627a7b31f3c4ff8bc8f3be3683983ffe6eaebe6 ]
- don't panic kernel if f2fs_get_node_page() fails in f2fs_recover_inline_data() or f2fs_recover_inline_xattr();
- return error number of f2fs_truncate_blocks() to f2fs_recover_inline_data()'s caller;
--- fs/f2fs/f2fs.h | 4 ++-- fs/f2fs/inline.c | 19 ++++++++++++------- fs/f2fs/node.c | 6 ++++-- fs/f2fs/recovery.c | 10 ++++++++-- 4 files changed, 26 insertions(+), 13 deletions(-)
fs/f2fs/f2fs.h +2 -2
@@ -3061,7 +3061,7 @@ bool f2fs_alloc_nid(struct f2fs_sb_info *sbi, nid_t *nid);void f2fs_alloc_nid_done (struct f2fs_sb_info *sbi,nid_t nid);void f2fs_alloc_nid_failed (struct f2fs_sb_info *sbi,nid_t nid);int f2fs_try_to_free_nids (struct f2fs_sb_info *sbi,int nr_shrink); -void f2fs_recover_inline_xattr (struct inode *inode,struct page *page); +int f2fs_recover_inline_xattr (struct inode *inode,struct page *page);int f2fs_recover_xattr_data (struct inode *inode,struct page *page);int f2fs_recover_inode_page (struct f2fs_sb_info *sbi,struct page *page); int f2fs_restore_node_summary(struct f2fs_sb_info *sbi,
@@ -3487,7 +3487,7 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page);int f2fs_convert_inline_page (struct dnode_of_data *dn,struct page *page);int f2fs_convert_inline_inode (struct inode *inode);int f2fs_write_inline_data (struct inode *inode,struct page *page); -bool f2fs_recover_inline_data (struct inode *inode,struct page *npage); +int f2fs_recover_inline_data (struct inode *inode,struct page *npage);struct f2fs_dir_entry *f2fs_find_in_inline_dir (struct inode *dir,struct fscrypt_name *fname,struct page **res_page); int f2fs_make_empty_inline_dir(struct inode *inode, struct inode *parent,
fs/f2fs/inline.c +12 -7
@@ -252,7 +252,7 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page)return 0 ; } -bool f2fs_recover_inline_data (struct inode *inode,struct page *npage) +int f2fs_recover_inline_data (struct inode *inode,struct page *npage) {struct f2fs_sb_info *sbi =F2FS_I_SB (inode);struct f2fs_inode *ri =NULL ;
@@ -274,7 +274,8 @@ bool f2fs_recover_inline_data(struct inode *inode, struct page *npage) ri && (ri->i_inline & F2FS_INLINE_DATA)) { process_inline: ipage =f2fs_get_node_page (sbi, inode->i_ino); -f2fs_bug_on (sbi,IS_ERR (ipage)); +if (IS_ERR (ipage)) +return PTR_ERR (ipage);f2fs_wait_on_page_writeback (ipage,NODE , true, true);
@@ -287,21 +288,25 @@ process_inline:set_page_dirty (ipage);f2fs_put_page (ipage,1 ); -return true; +return 1 ; }if (f2fs_has_inline_data (inode)) { ipage =f2fs_get_node_page (sbi, inode->i_ino); -f2fs_bug_on (sbi,IS_ERR (ipage)); +if (IS_ERR (ipage)) +return PTR_ERR (ipage);f2fs_truncate_inline_inode (inode, ipage,0 );clear_inode_flag (inode,FI_INLINE_DATA );f2fs_put_page (ipage,1 ); }else if (ri && (ri->i_inline &F2FS_INLINE_DATA )) { -if (f2fs_truncate_blocks (inode,0 , false)) -return false; +int ret; + + ret =f2fs_truncate_blocks (inode,0 , false); +if (ret) +return ret; goto process_inline; } -return false; +return 0 ; } struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,
fs/f2fs/node.c +4 -2
@@ -2512,7 +2512,7 @@ int f2fs_try_to_free_nids(struct f2fs_sb_info *sbi, int nr_shrink)return nr - nr_shrink; } -void f2fs_recover_inline_xattr (struct inode *inode,struct page *page) +int f2fs_recover_inline_xattr (struct inode *inode,struct page *page) {void *src_addr, *dst_addr;size_t inline_size;
@@ -2520,7 +2520,8 @@ void f2fs_recover_inline_xattr(struct inode *inode, struct page *page)struct f2fs_inode *ri; ipage =f2fs_get_node_page (F2FS_I_SB (inode), inode->i_ino); -f2fs_bug_on (F2FS_I_SB (inode),IS_ERR (ipage)); +if (IS_ERR (ipage)) +return PTR_ERR (ipage); ri =F2FS_INODE (page);if (ri->i_inline &F2FS_INLINE_XATTR ) {
@@ -2539,6 +2540,7 @@ void f2fs_recover_inline_xattr(struct inode *inode, struct page *page) update_inode:f2fs_update_inode (inode, ipage);f2fs_put_page (ipage,1 ); +return 0 ; }int f2fs_recover_xattr_data (struct inode *inode,struct page *page)
fs/f2fs/recovery.c +8 -2
@@ -514,7 +514,9 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,/* step 1: recover xattr */ if (IS_INODE (page)) { -f2fs_recover_inline_xattr (inode, page); + err =f2fs_recover_inline_xattr (inode, page); +if (err) + goto out; }else if (f2fs_has_xattr_block (ofs_of_node (page))) { err =f2fs_recover_xattr_data (inode, page);if (!err)
@@ -523,8 +525,12 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode, }/* step 2: recover inline data */ -if (f2fs_recover_inline_data (inode, page)) + err =f2fs_recover_inline_data (inode, page); +if (err) { +if (err ==1 ) + err =0 ; goto out; + }/* step 3: recover data indices */ start =f2fs_start_bidx_of_node (ofs_of_node (page), inode);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 37/214 selftests/powerpc: Purge extra count_pmc() calls of ebb selftests
In reply to Greg Kroah-HartmanFrom: Desnes A. Nunes do Rosario <[email protected]>
[ Upstream commit 3337bf41e0dd70b4064cdf60acdfcdc2d050066c ]
An extra count on ebb_state.stats.pmc_count[PMC_INDEX(pmc)] is being per- formed when count_pmc() is used to reset PMCs on a few selftests. This extra pmc_count can occasionally invalidate results, such as the ones from cycles_test shown hereafter. The ebb_check_count() failed with an above the upper limit error due to the extra value on ebb_state.stats.pmc_count.
Furthermore, this extra count is also indicated by extra PMC1 trace_log on the output of the cycle test (as well as on pmc56_overflow_test):
==========
...
[21]: counter = 8
[22]: register SPRN_MMCR0 = 0x0000000080000080
[23]: register SPRN_PMC1 = 0x0000000080000004
[24]: counter = 9
[25]: register SPRN_MMCR0 = 0x0000000080000080
[26]: register SPRN_PMC1 = 0x0000000080000004
[27]: counter = 10
[28]: register SPRN_MMCR0 = 0x0000000080000080
[29]: register SPRN_PMC1 = 0x0000000080000004
Quoted 1 line
Quoted 1 line
[30]: register
SPRN_PMC1=0x000000004000051e
PMC1 count (0x280000546) above upper limit 0x2800003e8 (+0x15e) [FAIL] Test FAILED on line 52
failure: cycles
==========
--- .../selftests/powerpc/pmu/ebb/back_to_back_ebbs_test.c | 2 -- tools/testing/selftests/powerpc/pmu/ebb/cycles_test.c | 2 -- .../selftests/powerpc/pmu/ebb/cycles_with_freeze_test.c | 2 -- .../selftests/powerpc/pmu/ebb/cycles_with_mmcr2_test.c | 2 -- tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 2 -- .../selftests/powerpc/pmu/ebb/ebb_on_willing_child_test.c | 2 -- .../selftests/powerpc/pmu/ebb/lost_exception_test.c | 1 - .../testing/selftests/powerpc/pmu/ebb/multi_counter_test.c | 7 ------- .../selftests/powerpc/pmu/ebb/multi_ebb_procs_test.c | 2 -- .../testing/selftests/powerpc/pmu/ebb/pmae_handling_test.c | 2 -- .../selftests/powerpc/pmu/ebb/pmc56_overflow_test.c | 2 -- 11 files changed, 26 deletions(-)
tools/testing/selftests/powerpc/pmu/ebb/back_to_back_ebbs_test.c +0 -2
@@ -91,8 +91,6 @@ int back_to_back_ebbs(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_ebb_state ();event_close (&event);
tools/testing/selftests/powerpc/pmu/ebb/cycles_test.c +0 -2
@@ -42,8 +42,6 @@ int cycles(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_ebb_state ();event_close (&event);
tools/testing/selftests/powerpc/pmu/ebb/cycles_with_freeze_test.c +0 -2
@@ -99,8 +99,6 @@ int cycles_with_freeze(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_ebb_state ();printf ("EBBs while frozen %d\n" , ebbs_while_frozen);
tools/testing/selftests/powerpc/pmu/ebb/cycles_with_mmcr2_test.c +0 -2
@@ -71,8 +71,6 @@ int cycles_with_mmcr2(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_ebb_state ();event_close (&event);
tools/testing/selftests/powerpc/pmu/ebb/ebb.c +0 -2
@@ -396,8 +396,6 @@ int ebb_child(union pipe read_pipe, union pipe write_pipe)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_ebb_state ();event_close (&event);
tools/testing/selftests/powerpc/pmu/ebb/ebb_on_willing_child_test.c +0 -2
@@ -38,8 +38,6 @@ static int victim_child(union pipe read_pipe, union pipe write_pipe)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_ebb_state ();FAIL_IF (ebb_state.stats.ebb_count ==0 );
tools/testing/selftests/powerpc/pmu/ebb/lost_exception_test.c +0 -1
@@ -75,7 +75,6 @@ static int test_body(void)ebb_freeze_pmcs ();ebb_global_disable (); -count_pmc (4 , sample_period);mtspr (SPRN_PMC4 ,0xdead );dump_summary_ebb_state ();
tools/testing/selftests/powerpc/pmu/ebb/multi_counter_test.c +0 -7
@@ -70,13 +70,6 @@ int multi_counter(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -count_pmc (2 , sample_period); -count_pmc (3 , sample_period); -count_pmc (4 , sample_period); -count_pmc (5 , sample_period); -count_pmc (6 , sample_period); -dump_ebb_state ();for (i =0 ; i <6 ; i++)
tools/testing/selftests/powerpc/pmu/ebb/multi_ebb_procs_test.c +0 -2
@@ -61,8 +61,6 @@ static int cycles_child(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_summary_ebb_state ();event_close (&event);
tools/testing/selftests/powerpc/pmu/ebb/pmae_handling_test.c +0 -2
@@ -82,8 +82,6 @@ static int test_body(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (1 , sample_period); -dump_ebb_state ();if (mmcr0_mismatch)
tools/testing/selftests/powerpc/pmu/ebb/pmc56_overflow_test.c +0 -2
@@ -76,8 +76,6 @@ int pmc56_overflow(void)ebb_global_disable ();ebb_freeze_pmcs (); -count_pmc (2 , sample_period); -dump_ebb_state ();printf ("PMC5/6 overflow %d\n" , pmc56_overflowed);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 36/214 scsi: target: Fix xcopy sess release leak
In reply to Greg Kroah-HartmanFrom: Mike Christie <[email protected]>
[ Upstream commit 3c006c7d23aac928279f7cbe83bbac4361255d53 ]
transport_init_session can allocate memory via percpu_ref_init, and target_xcopy_release_pt never frees it. This adds a transport_uninit_session function to handle cleanup of resources allocated in the init function.
--- drivers/target/target_core_internal.h | 1 + drivers/target/target_core_transport.c | 7 ++++++- drivers/target/target_core_xcopy.c | 11 +++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-)
drivers/target/target_core_internal.h +1 -0
@@ -138,6 +138,7 @@ int init_se_kmem_caches(void);void release_se_kmem_caches (void );u32 scsi_get_new_index (scsi_index_t );void transport_subsystem_check_init (void ); +void transport_uninit_session (struct se_session *);unsigned char *transport_dump_cmd_direction (struct se_cmd *);void transport_dump_dev_state (struct se_device *,char *,int *); void transport_dump_dev_info(struct se_device *, struct se_lun *,
drivers/target/target_core_transport.c +6 -1
@@ -236,6 +236,11 @@ int transport_init_session(struct se_session *se_sess) }EXPORT_SYMBOL (transport_init_session); +void transport_uninit_session (struct se_session *se_sess) +{ +percpu_ref_exit (&se_sess->cmd_count); +} +/** * transport_alloc_session - allocate a session object and initialize it * @sup_prot_ops: bitmask that defines which T10-PI modes are supported.
@@ -579,7 +584,7 @@ void transport_free_session(struct se_session *se_sess)sbitmap_queue_free (&se_sess->sess_tag_pool);kvfree (se_sess->sess_cmd_map); } -percpu_ref_exit (&se_sess->cmd_count); +transport_uninit_session (se_sess);kmem_cache_free (se_sess_cache, se_sess); }EXPORT_SYMBOL (transport_free_session);
drivers/target/target_core_xcopy.c +9 -2
@@ -479,7 +479,7 @@ int target_xcopy_setup_pt(void)memset (&xcopy_pt_sess,0 ,sizeof (struct se_session )); ret =transport_init_session (&xcopy_pt_sess);if (ret <0 ) -return ret; + goto destroy_wq; xcopy_pt_nacl.se_tpg = &xcopy_pt_tpg; xcopy_pt_nacl.nacl_sess = &xcopy_pt_sess;
@@ -488,12 +488,19 @@ int target_xcopy_setup_pt(void) xcopy_pt_sess.se_node_acl = &xcopy_pt_nacl;return 0 ; + +destroy_wq: +destroy_workqueue (xcopy_wq); + xcopy_wq =NULL ; +return ret; }void target_xcopy_release_pt (void ) { -if (xcopy_wq) +if (xcopy_wq) {destroy_workqueue (xcopy_wq); +transport_uninit_session (&xcopy_pt_sess); + } }/*
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 27/214 iommu/iova: Dont BUG on invalid PFNs
In reply to Greg Kroah-HartmanFrom: Robin Murphy <[email protected]>
[ Upstream commit d3e3d2be688b4b5864538de61e750721a311e4fc ]
Unlike the other instances which represent a complete loss of consistency within the rcache mechanism itself, or a fundamental and obvious misconfiguration by an IOMMU driver, the BUG_ON() in iova_magazine_free_pfns() can be provoked at more or less any time in a "spooky action-at-a-distance" manner by any old device driver passing nonsense to dma_unmap_*() which then propagates through to queue_iova().
Not only is this well outside the IOVA layer's control, it's also nowhere near fatal enough to justify panicking anyway - all that really achieves is to make debugging the offending driver more difficult. Let's simply WARN and otherwise ignore bogus PFNs.
--- drivers/iommu/iova.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iommu/iova.c +3 -1
@@ -811,7 +811,9 @@ iova_magazine_free_pfns(struct iova_magazine *mag, struct iova_domain *iovad)for (i =0 ; i < mag->size; ++i) {struct iova *iova =private_find_iova (iovad, mag->pfns[i]); -BUG_ON (!iova); +if (WARN_ON (!iova)) +continue ; +private_free_iova (iovad, iova); }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainercover 5.4.62-rc1 review
This is the start of the stable review cycle for the 5.4.62 release. There are 214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 03 Sep 2020 15:09:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.62-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.4.62-rc1
Hector Martin <[email protected]>
ALSA: usb-audio: Update documentation comment for MS2109 quirk
Andrii Nakryiko <[email protected]>
libbpf: Fix build on ppc64le architecture
Peilin Ye <[email protected]>
HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage()
Denis Efremov <[email protected]>
kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables
Denis Efremov <[email protected]>
kbuild: add variables for compression tools
Masahiro Yamada <[email protected]>
kheaders: explain why include/config/autoconf.h is excluded from md5sum
Masahiro Yamada <[email protected]>
kheaders: remove the last bashism to allow sh to run it
Masahiro Yamada <[email protected]>
kheaders: optimize header copy for in-tree builds
Masahiro Yamada <[email protected]>
kheaders: optimize md5sum calculation for in-tree builds
Masahiro Yamada <[email protected]>
kheaders: remove unneeded 'cat' command piped to 'head' / 'tail'
Tetsuo Handa <[email protected]>
fbmem: pull fbcon_update_vcs() out of fb_set_var()
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Handle ZLP for sg requests
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Fix handling ZLP
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Don't setup more than requested
Mika Kuoppala <[email protected]>
drm/i915: Fix cmd parser desc matching with masks
Alan Stern <[email protected]>
usb: storage: Add unusual_uas entry for Sony PSZ drives
Tom Rix <[email protected]>
USB: cdc-acm: rework notification_buffer resizing
Andy Shevchenko <[email protected]>
USB: gadget: u_f: Unbreak offset calculation in VLAs
Brooke Basile <[email protected]>
USB: gadget: f_ncm: add bounds checks to ncm_unwrap_ntb()
Brooke Basile <[email protected]>
USB: gadget: u_f: add overflow checks to VLA macros
Tang Bin <[email protected]>
usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()
Cyril Roelandt <[email protected]>
USB: Ignore UAS for JMicron JMS567 ATA/ATAPI Bridge
Alan Stern <[email protected]>
USB: quirks: Ignore duplicate endpoint on Sound Devices MixPre-D
Kai-Heng Feng <[email protected]>
USB: quirks: Add no-lpm quirk for another Raydium touchscreen
Thinh Nguyen <[email protected]>
usb: uas: Add quirk for PNY Pro Elite
Alan Stern <[email protected]>
USB: yurex: Fix bad gfp argument
Evan Quan <[email protected]>
drm/amd/pm: correct the thermal alert temperature limit settings
Evan Quan <[email protected]>
drm/amd/pm: correct Vega20 swctf limit setting
Evan Quan <[email protected]>
drm/amd/pm: correct Vega12 swctf limit setting
Evan Quan <[email protected]>
drm/amd/pm: correct Vega10 swctf limit setting
Nicholas Kazlauskas <[email protected]>
drm/amd/powerplay: Fix hardmins not being sent to SMU for RV
Jiansong Chen <[email protected]>
drm/amdgpu/gfx10: refine mgcg setting
Alex Deucher <[email protected]>
drm/amdgpu: Fix buffer overflow in INFO ioctl
Ashok Raj <[email protected]>
x86/hotplug: Silence APIC only after all interrupts are migrated
qiuguorui1 <[email protected]>
irqchip/stm32-exti: Avoid losing interrupts due to clearing pending bits by mistake
Thomas Gleixner <[email protected]>
genirq/matrix: Deal with the sillyness of for_each_cpu() on UP
Herbert Xu <[email protected]>
crypto: af_alg - Work around empty control messages without MSG_MORE
Heikki Krogerus <[email protected]>
device property: Fix the secondary firmware node handling in set_primary_fwnode()
Alexey Kardashevskiy <[email protected]>
powerpc/perf: Fix crashes with generic_compat_pmu & BHRB
Rafael J. Wysocki <[email protected]>
PM: sleep: core: Fix the handling of pending runtime resume requests
Frank van der Linden <[email protected]>
arm64: vdso32: make vdso32 install conditional
Ding Hui <[email protected]>
xhci: Always restore EP_SOFT_CLEAR_TOGGLE even if ep reset failed
Kai-Heng Feng <[email protected]>
xhci: Do warm-reset when both CAS and XDEV_RESUME are set
Li Jun <[email protected]>
usb: host: xhci: fix ep context print mismatch in debugfs
Thomas Gleixner <[email protected]>
XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.
Jan Kara <[email protected]>
writeback: Fix sync livelock due to b_dirty_time processing
Jan Kara <[email protected]>
writeback: Avoid skipping inode writeback
Jan Kara <[email protected]>
writeback: Protect inode->i_io_list with inode->i_lock
Sergey Senozhatsky <[email protected]>
serial: 8250: change lock order in serial8250_do_startup()
Valmer Huhn <[email protected]>
serial: 8250_exar: Fix number of ports for Commtech PCIe cards
Holger Assmann <[email protected]>
serial: stm32: avoid kernel warning on absence of optional IRQ
Lukas Wunner <[email protected]>
serial: pl011: Don't leak amba_ports entry on driver register error
Lukas Wunner <[email protected]>
serial: pl011: Fix oops on -EPROBE_DEFER
Tamseel Shams <[email protected]>
serial: samsung: Removes the IRQ not found warning
George Kennedy <[email protected]>
vt_ioctl: change VT_RESIZEX ioctl to check for error return from vc_resize()
Tetsuo Handa <[email protected]>
vt: defer kfree() of vc_screenbuf in vc_do_resize()
Evgeny Novikov <[email protected]>
USB: lvtest: return proper error code in probe
George Kennedy <[email protected]>
fbcon: prevent user font height or width change from causing potential out-of-bounds access
Boris Burkov <[email protected]>
btrfs: detect nocow for swap after snapshot delete
Filipe Manana <[email protected]>
btrfs: fix space cache memory leak after transaction abort
Josef Bacik <[email protected]>
btrfs: check the right error variable in btrfs_del_dir_entries_in_log
Marcos Paulo de Souza <[email protected]>
btrfs: reset compression level for lzo on remount
Ming Lei <[email protected]>
blk-mq: order adding requests to hctx->dispatch and checking SCHED_RESTART
Hans de Goede <[email protected]>
HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands
Ming Lei <[email protected]>
block: loop: set discard granularity and alignment for block device backed loop
Keith Busch <[email protected]>
block: fix get_max_io_size()
Marc Zyngier <[email protected]>
arm64: Allow booting of late CPUs affected by erratum 1418040
Marc Zyngier <[email protected]>
arm64: Move handling of erratum 1418040 into C code
Athira Rajeev <[email protected]>
powerpc/perf: Fix soft lockups due to missed interrupt accounting
Sumera Priyadarsini <[email protected]>
net: gianfar: Add of_node_put() before goto statement
Alvin Šipraga <[email protected]>
macvlan: validate setting of multiple remote source MAC addresses
Saurav Kashyap <[email protected]>
Revert "scsi: qla2xxx: Fix crash on qla2x00_mailbox_command"
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix null pointer access during disconnect from subsystem
Saurav Kashyap <[email protected]>
scsi: qla2xxx: Check if FW supports MQ before enabling
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix login timeout
Stanley Chu <[email protected]>
scsi: ufs: Clean up completed request without interrupt notification
Adrian Hunter <[email protected]>
scsi: ufs: Improve interrupt handling for shared interrupts
Stanley Chu <[email protected]>
scsi: ufs: Fix possible infinite loop in ufshcd_hold
Mike Christie <[email protected]>
scsi: fcoe: Fix I/O path allocation
David Ahern <[email protected]>
selftests: disable rp_filter for icmp_redirect.sh
Sylwester Nawrocki <[email protected]>
ASoC: wm8994: Avoid attempts to read unreadable registers
Vineeth Vijayan <[email protected]>
s390/cio: add cond_resched() in the slow_eval_known_fn() loop
Mike Pozulp <[email protected]>
ALSA: hda/realtek: Add model alc298-samsung-headphone
Oleksij Rempel <[email protected]>
can: j1939: transport: j1939_xtp_rx_dat_one(): compare own packets to detect corruptions
Florian Westphal <[email protected]>
netfilter: avoid ipv6 -> nf_defrag_ipv6 module dependency
Jean-Philippe Brucker <[email protected]>
libbpf: Handle GCC built-in types for Arm NEON
Anthony Koo <[email protected]>
drm/amd/display: Switch to immediate mode for updating infopackets
Evan Quan <[email protected]>
drm/amd/powerplay: correct UVD/VCE PG state on custom pptable uploading
Evan Quan <[email protected]>
drm/amd/powerplay: correct Vega20 cached smu feature state
Alain Volmat <[email protected]>
spi: stm32: always perform registers configuration prior to transfer
Amelie Delaunay <[email protected]>
spi: stm32: fix stm32_spi_prepare_mbr in case of odd clk_rate
Amelie Delaunay <[email protected]>
spi: stm32: fix fifo threshold level in case of short transfer
Antonio Borneo <[email protected]>
spi: stm32h7: fix race condition at end of transfer
Xianting Tian <[email protected]>
fs: prevent BUG_ON in submit_bh_wbc()
Jan Kara <[email protected]>
ext4: correctly restore system zone info when remount fails
Jan Kara <[email protected]>
ext4: handle error of ext4_setup_system_zone() on remount
Lukas Czerner <[email protected]>
ext4: handle option set by mount flags correctly
zhangyi (F) <[email protected]>
jbd2: abort journal if free a async write error metadata buffer
Lukas Czerner <[email protected]>
ext4: handle read only external journal device
Jan Kara <[email protected]>
ext4: don't BUG on inconsistent journal feature
Lukas Czerner <[email protected]>
jbd2: make sure jh have b_transaction set in refile/unfile_buffer
Tobias Schramm <[email protected]>
spi: stm32: clear only asserted irq flags on interrupt
Christophe JAILLET <[email protected]>
usb: gadget: f_tcm: Fix some resource leaks in some error paths
Wolfram Sang <[email protected]>
i2c: rcar: in slave mode, clear NACK earlier
Andy Shevchenko <[email protected]>
i2c: core: Don't fail PRP0001 enumeration when no ID table exist
Hou Pu <[email protected]>
null_blk: fix passing of REQ_FUA flag in null_handle_rq
Martin Wilck <[email protected]>
nvme: multipath: round-robin: fix single non-optimized path case
Tianjia Zhang <[email protected]>
nvme-fc: Fix wrong return value in __nvme_fc_init_request()
Yufen Yu <[email protected]>
blkcg: fix memleak for iolatency
Ming Lei <[email protected]>
blk-mq: insert request not through ->queue_rq into sw/scheduler queue
Jason Baron <[email protected]>
hwmon: (nct7904) Correct divide by 0
Dmitry Monakhov <[email protected]>
bfq: fix blkio cgroup leakage v4
Matthew Wilcox (Oracle) <[email protected]>
block: Fix page_is_mergeable() for compound pages
Rob Clark <[email protected]>
drm/msm/adreno: fix updating ring fence
Ming Lei <[email protected]>
block: virtio_blk: fix handling single range discard request
Ming Lei <[email protected]>
block: respect queue limit of max discard segment
Sean Young <[email protected]>
media: gpio-ir-tx: improve precision of transmitted signal due to scheduling
Alexander Tsoy <[email protected]>
ALSA: usb-audio: Add capture support for Saffire 6 (USB 1.1)
Rafael J. Wysocki <[email protected]>
cpufreq: intel_pstate: Fix EPP setting via sysfs in active mode
Ansuel Smith <[email protected]>
PCI: qcom: Add missing reset for ipq806x
Abhishek Sahu <[email protected]>
PCI: qcom: Change duplicate PCI reset to phy reset
Ansuel Smith <[email protected]>
PCI: qcom: Add missing ipq806x clocks in PCIe driver
Tony Luck <[email protected]>
EDAC/{i7core,sb,pnd2,skx}: Fix error event severity
Mauro Carvalho Chehab <[email protected]>
EDAC: skx_common: get rid of unused type var
Mauro Carvalho Chehab <[email protected]>
EDAC: sb_edac: get rid of unused vars
Sasha Levin <[email protected]>
mm/vunmap: add cond_resched() in vunmap_pmd_range
Stylon Wang <[email protected]>
drm/amd/display: Fix dmesg warning from setting abm level
Aurabindo Pillai <[email protected]>
drm/amd/display: Add additional config guards for DCN
Mikita Lipski <[email protected]>
drm/amd/display: Trigger modesets on MST DSC connectors
Paul Cercueil <[email protected]>
drm/ingenic: Fix incorrect assumption about plane->index
Paul Cercueil <[email protected]>
gpu/drm: ingenic: Use the plane's src_[x,y] to configure DMA length
Mike Kravetz <[email protected]>
cma: don't quit at first error when activating reserved areas
Yunfeng Ye <[email protected]>
mm/cma.c: switch to bitmap_zalloc() for cma bitmap allocation
Peter Zijlstra <[email protected]>
mm: fix kthread_use_mm() vs TLB invalidate
David Hildenbrand <[email protected]>
mm/shuffle: don't move pages between zones and don't read garbage memmaps
Filipe Manana <[email protected]>
btrfs: only commit delayed items at fsync if we are logging a directory
Filipe Manana <[email protected]>
btrfs: only commit the delayed inode when doing a full fsync
Filipe Manana <[email protected]>
btrfs: factor out inode items copy loop from btrfs_log_inode()
Sasha Levin <[email protected]>
s390/numa: set node distance to LOCAL_DISTANCE
Oleksandr Andrushchenko <[email protected]>
drm/xen-front: Fix misused IS_ERR_OR_NULL checks
Ding Xiang <[email protected]>
drm/xen: fix passing zero to 'PTR_ERR' warning
Marc Zyngier <[email protected]>
PM / devfreq: rk3399_dmc: Fix kernel oops when rockchip,pmu is absent
Yangtao Li <[email protected]>
PM / devfreq: rk3399_dmc: Disable devfreq-event device when fails
Yangtao Li <[email protected]>
PM / devfreq: rk3399_dmc: Add missing of_node_put()
Sasha Levin <[email protected]>
usb: cdns3: gadget: always zeroed TRB buffer when enable endpoint
Qais Yousef <[email protected]>
sched/uclamp: Fix a deadlock when enabling uclamp static key
Qais Yousef <[email protected]>
sched/uclamp: Protect uclamp fast path code with static key
Zhi Chen <[email protected]>
Revert "ath10k: fix DMA related firmware crashes on multiple devices"
Kefeng Wang <[email protected]>
arm64: Fix __cpu_logical_map undefined issue
Andrey Konovalov <[email protected]>
efi: provide empty efi_enter_virtual_mode implementation
Nicolas Saenz Julienne <[email protected]>
brcmfmac: Set timeout value when configuring power save
Changming Liu <[email protected]>
USB: sisusbvga: Fix a potential UB casued by left shifting a negative value
Arnd Bergmann <[email protected]>
powerpc/spufs: add CONFIG_COREDUMP dependency
David Brazdil <[email protected]>
KVM: arm64: Fix symbol dependency in __hyp_call_panic_nvhe
Evgeny Novikov <[email protected]>
media: davinci: vpif_capture: fix potential double free
Mike Kravetz <[email protected]>
hugetlbfs: prevent filesystem stacking of hugetlbfs
Jason Baron <[email protected]>
EDAC/ie31200: Fallback if host bridge device is already initialized
Javed Hasan <[email protected]>
scsi: fcoe: Memory leak fix in fcoe_sysfs_fcf_del()
Xiubo Li <[email protected]>
ceph: do not access the kiocb after aio requests
Xiubo Li <[email protected]>
ceph: fix potential mdsc use-after-free crash
Jing Xiangfeng <[email protected]>
scsi: iscsi: Do not put host in iscsi_set_flashnode_param()
Nikolay Borisov <[email protected]>
btrfs: make btrfs_qgroup_check_reserved_leak take btrfs_inode
Qu Wenruo <[email protected]>
btrfs: file: reserve qgroup space after the hole punch range is locked
Chris Wilson <[email protected]>
locking/lockdep: Fix overflow in presentation of average lock-time
Aditya Pakki <[email protected]>
drm/nouveau: Fix reference count leak in nouveau_connector_detect
Aditya Pakki <[email protected]>
drm/nouveau: fix reference count leak in nv50_disp_atomic_commit
Aditya Pakki <[email protected]>
drm/nouveau/drm/noveau: fix reference count leak in nouveau_fbcon_open
Li Guifu <[email protected]>
f2fs: fix use-after-free issue
Ikjoon Jang <[email protected]>
HID: quirks: add NOGET quirk for Logitech GROUP
Hans Verkuil <[email protected]>
cec-api: prevent leaking memory through hole in structure
Kaige Li <[email protected]>
ALSA: hda: Add support for Loongson 7A1000 controller
Peng Fan <[email protected]>
mips/vdso: Fix resource leaks in genvdso.c
Reto Schneider <[email protected]>
rtlwifi: rtl8192cu: Prevent leaking urb
Yangbo Lu <[email protected]>
ARM: dts: ls1021a: output PPS signal on FIPER2
Qiushi Wu <[email protected]>
PCI: Fix pci_create_slot() reference count leak
Aditya Pakki <[email protected]>
omapfb: fix multiple reference count leaks due to pm_runtime_get_sync
Chao Yu <[email protected]>
f2fs: fix error path in do_recover_data()
Desnes A. Nunes do Rosario <[email protected]>
selftests/powerpc: Purge extra count_pmc() calls of ebb selftests
Mike Christie <[email protected]>
scsi: target: Fix xcopy sess release leak
Dave Chinner <[email protected]>
xfs: Don't allow logging of XFS_ISTALE inodes
Dick Kennedy <[email protected]>
scsi: lpfc: Fix shost refcount mismatch when deleting vport
Navid Emamdoost <[email protected]>
drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails
Navid Emamdoost <[email protected]>
drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config
Navid Emamdoost <[email protected]>
drm/amd/display: fix ref count leak in amdgpu_drm_ioctl
Navid Emamdoost <[email protected]>
drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms
Aditya Pakki <[email protected]>
drm/radeon: fix multiple reference count leak
Qiushi Wu <[email protected]>
drm/amdkfd: Fix reference count leaks.
Robin Murphy <[email protected]>
iommu/iova: Don't BUG on invalid PFNs
Andy Shevchenko <[email protected]>
mfd: intel-lpss: Add Intel Tiger Lake PCH-H PCI IDs
Bodo Stroesser <[email protected]>
scsi: target: tcmu: Fix crash on ARM during cmd completion
Luis Chamberlain <[email protected]>
blktrace: ensure our debugfs dir exists
Jia-Ju Bai <[email protected]>
media: pci: ttpci: av7110: fix possible buffer overflow caused by bad DMA value in debiirq()
Alexey Kardashevskiy <[email protected]>
powerpc/xive: Ignore kmemleak false positives
Stephan Gerhold <[email protected]>
arm64: dts: qcom: msm8916: Pull down PDM GPIOs during sleep
Andy Shevchenko <[email protected]>
mfd: intel-lpss: Add Intel Emmitsburg PCH PCI IDs
Qiushi Wu <[email protected]>
ASoC: tegra: Fix reference count leaks.
Qiushi Wu <[email protected]>
ASoC: img-parallel-out: Fix a reference count leak
Qiushi Wu <[email protected]>
ASoC: img: Fix a reference count leak in img_i2s_in_set_fmt
Kai-Heng Feng <[email protected]>
ALSA: hda/hdmi: Use force connectivity quirk on another HP desktop
Kai-Heng Feng <[email protected]>
ALSA: hda/realtek: Fix pin default on Intel NUC 8 Rugged
Randy Dunlap <[email protected]>
ALSA: pci: delete repeated words in comments
Kai-Heng Feng <[email protected]>
ALSA: hda/hdmi: Add quirk to force connectivity
Mahesh Bandewar <[email protected]>
ipvlan: fix device features
Alaa Hleihel <[email protected]>
net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flow
Shay Agroskin <[email protected]>
net: ena: Make missed_tx stat incremental
Cong Wang <[email protected]>
tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
Peilin Ye <[email protected]>
net/smc: Prevent kernel-infoleak in __smc_diag_dump()
David Laight <[email protected]>
net: sctp: Fix negotiation of the number of data streams.
Necip Fazil Yildiran <[email protected]>
net: qrtr: fix usage of idr in port assignment to socket
Nikolay Aleksandrov <[email protected]>
net: nexthop: don't allow empty NHA_GROUP
Miaohe Lin <[email protected]>
net: Fix potential wrong skb->protocol in skb_vlan_untag()
Mark Tomlinson <[email protected]>
gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
Max Filippov <[email protected]>
binfmt_flat: revert "binfmt_flat: don't offset the data start"
Michael Ellerman <[email protected]>
powerpc/64s: Don't init FSCR_DSCR in __init_FSCR()
-------------
Diffstat:
Makefile | 15 +- arch/arm/boot/deflate_xip_data.sh | 2 +- arch/arm/boot/dts/ls1021a.dtsi | 2 +- arch/arm64/Makefile | 3 +- arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 2 +- arch/arm64/include/asm/smp.h | 7 +- arch/arm64/kernel/cpu_errata.c | 2 + arch/arm64/kernel/process.c | 34 +++ arch/arm64/kernel/setup.c | 8 +- arch/arm64/kernel/smp.c | 6 +- arch/arm64/kvm/hyp/switch.c | 2 +- arch/ia64/Makefile | 2 +- arch/m68k/Makefile | 8 +- arch/mips/vdso/genvdso.c | 10 + arch/parisc/Makefile | 2 +- arch/powerpc/kernel/cpu_setup_power.S | 2 +- arch/powerpc/perf/core-book3s.c | 23 +- arch/powerpc/platforms/cell/Kconfig | 1 + arch/powerpc/sysdev/xive/native.c | 2 + arch/s390/include/asm/numa.h | 1 - arch/s390/include/asm/topology.h | 2 - arch/s390/numa/numa.c | 6 - arch/x86/kernel/smpboot.c | 26 +- block/bfq-cgroup.c | 2 +- block/bfq-iosched.h | 1 - block/bfq-wf2q.c | 12 +- block/bio.c | 10 +- block/blk-cgroup.c | 8 +- block/blk-merge.c | 13 +- block/blk-mq-sched.c | 9 + block/blk-mq.c | 12 +- crypto/af_alg.c | 13 +- drivers/base/core.c | 12 +- drivers/base/power/main.c | 16 +- drivers/block/loop.c | 33 ++- drivers/block/null_blk_main.c | 2 +- drivers/block/virtio_blk.c | 31 ++- drivers/cpufreq/intel_pstate.c | 18 +- drivers/devfreq/rk3399_dmc.c | 51 ++-- drivers/edac/i7core_edac.c | 4 +- drivers/edac/ie31200_edac.c | 50 +++- drivers/edac/pnd2_edac.c | 2 +- drivers/edac/sb_edac.c | 25 +- drivers/edac/skx_common.c | 9 +- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 16 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 20 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 58 ++++ .../amd/display/dc/dcn10/dcn10_stream_encoder.c | 16 +- .../amd/display/dc/dcn10/dcn10_stream_encoder.h | 14 + drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 9 +- .../gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 22 +- .../gpu/drm/amd/powerplay/hwmgr/vega12_thermal.c | 21 +- drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 44 ++- .../gpu/drm/amd/powerplay/hwmgr/vega20_thermal.c | 21 +- drivers/gpu/drm/i915/i915_cmd_parser.c | 14 +- drivers/gpu/drm/ingenic/ingenic-drm.c | 6 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 +- drivers/gpu/drm/radeon/radeon_connectors.c | 20 +- drivers/gpu/drm/xen/xen_drm_front.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_gem.c | 8 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-quirks.c | 1 + drivers/hid/i2c-hid/i2c-hid-core.c | 22 +- drivers/hid/usbhid/hiddev.c | 4 + drivers/hwmon/nct7904.c | 4 +- drivers/i2c/busses/i2c-rcar.c | 1 + drivers/i2c/i2c-core-base.c | 2 +- drivers/iommu/iova.c | 4 +- drivers/irqchip/irq-stm32-exti.c | 14 +- drivers/media/cec/cec-api.c | 8 +- drivers/media/pci/ttpci/av7110.c | 5 +- drivers/media/platform/davinci/vpif_capture.c | 2 - drivers/media/rc/gpio-ir-tx.c | 7 +- drivers/mfd/intel-lpss-pci.c | 19 ++ drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 +- drivers/net/ethernet/freescale/gianfar.c | 4 +- drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 2 +- drivers/net/ipvlan/ipvlan_main.c | 27 +- drivers/net/macvlan.c | 21 +- drivers/net/wireless/ath/ath10k/hw.h | 2 +- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 8 + drivers/net/wireless/realtek/rtlwifi/usb.c | 5 +- drivers/nvme/host/fc.c | 4 +- drivers/nvme/host/multipath.c | 15 +- drivers/pci/controller/dwc/pcie-qcom.c | 58 +++- drivers/pci/slot.c | 6 +- drivers/s390/cio/css.c | 5 + drivers/scsi/fcoe/fcoe_ctlr.c | 2 +- drivers/scsi/lpfc/lpfc_vport.c | 26 +- drivers/scsi/qla2xxx/qla_gs.c | 18 +- drivers/scsi/qla2xxx/qla_mbx.c | 8 - drivers/scsi/qla2xxx/qla_nvme.c | 5 + drivers/scsi/qla2xxx/qla_os.c | 5 + drivers/scsi/qla2xxx/qla_target.c | 2 +- drivers/scsi/scsi_transport_iscsi.c | 2 +- drivers/scsi/ufs/ufshcd.c | 14 +- drivers/spi/spi-stm32.c | 73 ++--- drivers/target/target_core_internal.h | 1 + drivers/target/target_core_transport.c | 7 +- drivers/target/target_core_user.c | 9 +- drivers/target/target_core_xcopy.c | 11 +- drivers/tty/serial/8250/8250_exar.c | 24 +- drivers/tty/serial/8250/8250_port.c | 9 +- drivers/tty/serial/amba-pl011.c | 16 +- drivers/tty/serial/samsung.c | 8 +- drivers/tty/serial/stm32-usart.c | 2 +- drivers/tty/vt/vt.c | 5 +- drivers/tty/vt/vt_ioctl.c | 12 +- drivers/usb/cdns3/gadget.c | 4 +- drivers/usb/class/cdc-acm.c | 22 +- drivers/usb/core/quirks.c | 7 + drivers/usb/dwc3/gadget.c | 104 +++++-- drivers/usb/gadget/function/f_ncm.c | 81 +++++- drivers/usb/gadget/function/f_tcm.c | 7 +- drivers/usb/gadget/u_f.h | 38 ++- drivers/usb/host/ohci-exynos.c | 5 +- drivers/usb/host/xhci-debugfs.c | 8 +- drivers/usb/host/xhci-hub.c | 19 +- drivers/usb/host/xhci.c | 3 +- drivers/usb/misc/lvstest.c | 2 +- drivers/usb/misc/sisusbvga/sisusb.c | 2 +- drivers/usb/misc/yurex.c | 2 +- drivers/usb/storage/unusual_devs.h | 2 +- drivers/usb/storage/unusual_uas.h | 14 + drivers/video/fbdev/core/fbcon.c | 25 +- drivers/video/fbdev/core/fbmem.c | 8 +- drivers/video/fbdev/core/fbsysfs.c | 4 +- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 7 +- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 7 +- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 7 +- drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 5 +- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 5 +- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 7 +- drivers/video/fbdev/ps3fb.c | 5 +- drivers/xen/events/events_base.c | 16 +- fs/binfmt_flat.c | 20 +- fs/btrfs/ctree.h | 4 +- fs/btrfs/disk-io.c | 1 + fs/btrfs/extent-tree.c | 17 +- fs/btrfs/file.c | 10 +- fs/btrfs/free-space-cache.c | 2 +- fs/btrfs/inode.c | 18 +- fs/btrfs/qgroup.c | 14 +- fs/btrfs/qgroup.h | 2 +- fs/btrfs/super.c | 1 + fs/btrfs/tree-log.c | 305 +++++++++++---------- fs/buffer.c | 9 + fs/ceph/file.c | 5 +- fs/ceph/mds_client.c | 14 +- fs/ext4/block_validity.c | 8 - fs/ext4/super.c | 175 ++++++++---- fs/f2fs/f2fs.h | 4 +- fs/f2fs/inline.c | 19 +- fs/f2fs/node.c | 6 +- fs/f2fs/recovery.c | 10 +- fs/f2fs/super.c | 5 +- fs/fs-writeback.c | 83 +++--- fs/hugetlbfs/inode.c | 6 + fs/jbd2/transaction.c | 26 ++ fs/xfs/libxfs/xfs_trans_inode.c | 2 + fs/xfs/xfs_icache.c | 3 +- fs/xfs/xfs_inode.c | 25 +- include/linux/efi.h | 4 + include/linux/fb.h | 2 - include/linux/fs.h | 8 +- include/linux/netfilter_ipv6.h | 18 -- include/trace/events/writeback.h | 13 +- kernel/Makefile | 2 +- kernel/gen_kheaders.sh | 66 +++-- kernel/irq/matrix.c | 7 + kernel/locking/lockdep_proc.c | 2 +- kernel/sched/core.c | 81 +++++- kernel/sched/cpufreq_schedutil.c | 2 +- kernel/sched/sched.h | 47 +++- kernel/trace/blktrace.c | 12 + mm/cma.c | 29 +- mm/mmu_context.c | 7 +- mm/shuffle.c | 18 +- mm/vmalloc.c | 2 + net/bridge/netfilter/nf_conntrack_bridge.c | 8 +- net/can/j1939/transport.c | 15 +- net/core/skbuff.c | 4 +- net/ipv4/nexthop.c | 5 +- net/ipv6/ip6_tunnel.c | 10 +- net/ipv6/netfilter.c | 3 - net/qrtr/qrtr.c | 20 +- net/sched/act_ct.c | 2 +- net/sctp/stream.c | 6 +- net/smc/smc_diag.c | 16 +- net/tipc/netlink_compat.c | 12 +- scripts/Makefile.lib | 12 +- scripts/Makefile.package | 8 +- scripts/package/buildtar | 6 +- scripts/xz_wrap.sh | 2 +- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/cs46xx/dsp_spos_scb_lib.c | 2 +- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_generic.c | 2 +- sound/pci/hda/hda_intel.c | 2 + sound/pci/hda/patch_hdmi.c | 17 +- sound/pci/hda/patch_realtek.c | 12 + sound/pci/hda/patch_sigmatel.c | 2 +- sound/pci/ice1712/prodigy192.c | 2 +- sound/pci/oxygen/xonar_dg.c | 2 +- sound/soc/codecs/wm8958-dsp2.c | 4 + sound/soc/img/img-i2s-in.c | 4 +- sound/soc/img/img-parallel-out.c | 4 +- sound/soc/tegra/tegra30_ahub.c | 4 +- sound/soc/tegra/tegra30_i2s.c | 4 +- sound/usb/quirks-table.h | 34 ++- tools/lib/bpf/btf_dump.c | 35 ++- tools/testing/selftests/net/icmp_redirect.sh | 2 + .../powerpc/pmu/ebb/back_to_back_ebbs_test.c | 2 - .../selftests/powerpc/pmu/ebb/cycles_test.c | 2 - .../powerpc/pmu/ebb/cycles_with_freeze_test.c | 2 - .../powerpc/pmu/ebb/cycles_with_mmcr2_test.c | 2 - tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 2 - .../powerpc/pmu/ebb/ebb_on_willing_child_test.c | 2 - .../powerpc/pmu/ebb/lost_exception_test.c | 1 - .../selftests/powerpc/pmu/ebb/multi_counter_test.c | 7 - .../powerpc/pmu/ebb/multi_ebb_procs_test.c | 2 - .../selftests/powerpc/pmu/ebb/pmae_handling_test.c | 2 - .../powerpc/pmu/ebb/pmc56_overflow_test.c | 2 - 231 files changed, 2150 insertions(+), 1015 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 9/214 tipc: fix uninit skb->data in tipc_nl_compat_dumpit()
From: Cong Wang <[email protected]>
[ Upstream commit 47733f9daf4fe4f7e0eb9e273f21ad3a19130487 ]
__tipc_nl_compat_dumpit() has two callers, and it expects them to pass a valid nlmsghdr via arg->data. This header is artificial and crafted just for __tipc_nl_compat_dumpit().
tipc_nl_compat_publ_dump() does so by putting a genlmsghdr as well as some nested attribute, TIPC_NLA_SOCK. But the other caller tipc_nl_compat_dumpit() does not, this leaves arg->data uninitialized on this call path.
Fix this by just adding a similar nlmsghdr without any payload in tipc_nl_compat_dumpit().
This bug exists since day 1, but the recent commit 6ea67769ff33 ("net: tipc: prepare attrs in __tipc_nl_compat_dumpit()") makes it easier to appear.
--- net/tipc/netlink_compat.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
net/tipc/netlink_compat.c +11 -1
@@ -255,8 +255,9 @@ err_out:static int tipc_nl_compat_dumpit (struct tipc_nl_compat_cmd_dump *cmd,struct tipc_nl_compat_msg *msg) { -int err; +struct nlmsghdr *nlh;struct sk_buff *arg; +int err;if (msg->req_type && (!msg->req_size || !TLV_CHECK_TYPE (msg->req, msg->req_type)))
@@ -285,6 +286,15 @@ static int tipc_nl_compat_dumpit(structreturn -ENOMEM ; } + nlh =nlmsg_put (arg,0 ,0 , tipc_genl_family.id,0 ,NLM_F_MULTI ); +if (!nlh) { +kfree_skb (arg); +kfree_skb (msg->rep); + msg->rep =NULL ; +return -EMSGSIZE ; + } +nlmsg_end (arg, nlh); + err =__tipc_nl_compat_dumpit (cmd, msg, arg);if (err) {kfree_skb (msg->rep);
Greg Kroah-Hartman
maintainerPATCH 8/214 net/smc: Prevent kernel-infoleak in __smc_diag_dump()
In reply to Greg Kroah-HartmanFrom: Peilin Ye <[email protected]>
[ Upstream commit ce51f63e63c52a4e1eee4dd040fb0ba0af3b43ab ]
__smc_diag_dump() is potentially copying uninitialized kernel stack memory into socket buffers, since the compiler may leave a 4-byte hole near the beginning of struct smcd_diag_dmbinfo. Fix it by initializing dinfo with memset().
--- net/smc/smc_diag.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
net/smc/smc_diag.c +9 -7
@@ -170,13 +170,15 @@ static int __smc_diag_dump(struct sock * (req->diag_ext & (1 << (SMC_DIAG_DMBINFO - 1))) && !list_empty(&smc->conn.lgr->list)) {struct smc_connection *conn = &smc->conn; -struct smcd_diag_dmbinfo dinfo = { - .linkid = *((u32 *)conn->lgr->id), - .peer_gid = conn->lgr->peer_gid, - .my_gid = conn->lgr->smcd->local_gid, - .token = conn->rmb_desc->token, - .peer_token = conn->peer_token - }; +struct smcd_diag_dmbinfo dinfo; + +memset (&dinfo,0 ,sizeof (dinfo)); + + dinfo.linkid = *((u32 *)conn->lgr->id); + dinfo.peer_gid = conn->lgr->peer_gid; + dinfo.my_gid = conn->lgr->smcd->local_gid; + dinfo.token = conn->rmb_desc->token; + dinfo.peer_token = conn->peer_token;if (nla_put (skb,SMC_DIAG_DMBINFO ,sizeof (dinfo), &dinfo) <0 ) goto errout;
Greg Kroah-Hartman
maintainerPATCH 6/214 net: qrtr: fix usage of idr in port assignment to socket
In reply to Greg Kroah-HartmanFrom: Necip Fazil Yildiran <[email protected]>
[ Upstream commit 8dfddfb79653df7c38a9c8c4c034f242a36acee9 ]
Passing large uint32 sockaddr_qrtr.port numbers for port allocation triggers a warning within idr_alloc() since the port number is cast to int, and thus interpreted as a negative number. This leads to the rejection of such valid port numbers in qrtr_port_assign() as idr_alloc() fails.
To avoid the problem, switch to idr_alloc_u32() instead.
--- net/qrtr/qrtr.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
net/qrtr/qrtr.c +11 -9
@@ -547,23 +547,25 @@ static void qrtr_port_remove(struct qrtr*/ static int qrtr_port_assign (struct qrtr_sock *ipc,int *port) { +u32 min_port;int rc;mutex_lock (&qrtr_port_lock);if (!*port) { - rc =idr_alloc (&qrtr_ports, ipc, -QRTR_MIN_EPH_SOCKET ,QRTR_MAX_EPH_SOCKET +1 , -GFP_ATOMIC ); -if (rc >=0 ) - *port = rc; + min_port =QRTR_MIN_EPH_SOCKET ; + rc =idr_alloc_u32 (&qrtr_ports, ipc, &min_port,QRTR_MAX_EPH_SOCKET ,GFP_ATOMIC ); +if (!rc) + *port = min_port; }else if (*port <QRTR_MIN_EPH_SOCKET && !capable (CAP_NET_ADMIN )) { rc = -EACCES ; }else if (*port ==QRTR_PORT_CTRL ) { - rc =idr_alloc (&qrtr_ports, ipc,0 ,1 ,GFP_ATOMIC ); + min_port =0 ; + rc =idr_alloc_u32 (&qrtr_ports, ipc, &min_port,0 ,GFP_ATOMIC ); }else { - rc =idr_alloc (&qrtr_ports, ipc, *port, *port +1 ,GFP_ATOMIC ); -if (rc >=0 ) - *port = rc; + min_port = *port; + rc =idr_alloc_u32 (&qrtr_ports, ipc, &min_port, *port,GFP_ATOMIC ); +if (!rc) + *port = min_port; }mutex_unlock (&qrtr_port_lock);
Greg Kroah-Hartman
maintainerPATCH 5/214 net: nexthop: dont allow empty NHA_GROUP
In reply to Greg Kroah-HartmanFrom: Nikolay Aleksandrov <[email protected]>
[ Upstream commit eeaac3634ee0e3f35548be35275efeca888e9b23 ]
Currently the nexthop code will use an empty NHA_GROUP attribute, but it requires at least 1 entry in order to function properly. Otherwise we end up derefencing null or random pointers all over the place due to not having any nh_grp_entry members allocated, nexthop code relies on having at least the first member present. Empty NHA_GROUP doesn't make any sense so just disallow it.
Also add a WARN_ON for any future users of nexthop_create_group().
BUG: kernel NULL pointer dereference, address: 0000000000000080 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP CPU: 0 PID: 558 Comm: ip Not tainted 5.9.0-rc1+ #93 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.fc32 04/01/2014 RIP: 0010:fib_check_nexthop+0x4a/0xaa Code: 0f 84 83 00 00 00 48 c7 02 80 03 f7 81 c3 40 80 fe fe 75 12 b8 ea ff ff ff 48 85 d2 74 6b 48 c7 02 40 03 f7 81 c3 48 8b 40 10 <48> 8b 80 80 00 00 00 eb 36 80 78 1a 00 74 12 b8 ea ff ff ff 48 85 RSP: 0018:ffff88807983ba00 EFLAGS: 00010213 RAX: 0000000000000000 RBX: ffff88807983bc00 RCX: 0000000000000000 RDX: ffff88807983bc00 RSI: 0000000000000000 RDI: ffff88807bdd0a80 RBP: ffff88807983baf8 R08: 0000000000000dc0 R09: 000000000000040a R10: 0000000000000000 R11: ffff88807bdd0ae8 R12: 0000000000000000 R13: 0000000000000000 R14: ffff88807bea3100 R15: 0000000000000001 FS: 00007f10db393700(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000080 CR3: 000000007bd0f004 CR4: 00000000003706f0 Call Trace: fib_create_info+0x64d/0xaf7 fib_table_insert+0xf6/0x581 ? __vma_adjust+0x3b6/0x4d4 inet_rtm_newroute+0x56/0x70 rtnetlink_rcv_msg+0x1e3/0x20d ? rtnl_calcit.isra.0+0xb8/0xb8 netlink_rcv_skb+0x5b/0xac netlink_unicast+0xfa/0x17b netlink_sendmsg+0x334/0x353 sock_sendmsg_nosec+0xf/0x3f ____sys_sendmsg+0x1a0/0x1fc ? copy_msghdr_from_user+0x4c/0x61 ___sys_sendmsg+0x63/0x84 ? handle_mm_fault+0xa39/0x11b5 ? sockfd_lookup_light+0x72/0x9a __sys_sendmsg+0x50/0x6e do_syscall_64+0x54/0xbe entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f10dacc0bb7 Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb cd 66 0f 1f 44 00 00 8b 05 9a 4b 2b 00 85 c0 75 2e 48 63 ff 48 63 d2 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 b1 f2 2a 00 f7 d8 64 89 02 48 RSP: 002b:00007ffcbe628bf8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007ffcbe628f80 RCX: 00007f10dacc0bb7 RDX: 0000000000000000 RSI: 00007ffcbe628c60 RDI: 0000000000000003 RBP: 000000005f41099c R08: 0000000000000001 R09: 0000000000000008 R10: 00000000000005e9 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ffcbe628d70 R15: 0000563a86c6e440 Modules linked in: CR2: 0000000000000080
--- net/ipv4/nexthop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/ipv4/nexthop.c +4 -1
@@ -403,7 +403,7 @@ static int nh_check_attr_group(struct nestruct nexthop_grp *nhg;unsigned int i, j; -if (len & (sizeof (struct nexthop_grp ) -1 )) { +if (!len || len & (sizeof (struct nexthop_grp ) -1 )) {NL_SET_ERR_MSG (extack,"Invalid length for nexthop group attribute" );return -EINVAL ;
@@ -1105,6 +1105,9 @@ static struct nexthop *nexthop_create_grstruct nexthop *nh;int i; +if (WARN_ON (!num_nh)) +return ERR_PTR (-EINVAL ); + nh =nexthop_alloc ();if (!nh)return ERR_PTR (-ENOMEM );
Greg Kroah-Hartman
maintainerPATCH 4/214 net: Fix potential wrong skb->protocol in skb_vlan_untag()
In reply to Greg Kroah-HartmanFrom: Miaohe Lin <[email protected]>
[ Upstream commit 55eff0eb7460c3d50716ed9eccf22257b046ca92 ]
We may access the two bytes after vlan_hdr in vlan_set_encap_proto(). So we should pull VLAN_HLEN + sizeof(unsigned short) in skb_vlan_untag() or we may access the wrong data.
--- net/core/skbuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/skbuff.c +2 -2
@@ -5317,8 +5317,8 @@ struct sk_buff *skb_vlan_untag(struct sk skb =skb_share_check (skb,GFP_ATOMIC );if (unlikely (!skb)) goto err_free; - -if (unlikely (!pskb_may_pull (skb,VLAN_HLEN ))) +/* We may access the two bytes after vlan_hdr in vlan_set_encap_proto(). */ +if (unlikely (!pskb_may_pull (skb,VLAN_HLEN +sizeof (unsigned short )))) goto err_free; vhdr = (struct vlan_hdr *)skb->data;
Greg Kroah-Hartman
maintainerPATCH 25/214 scsi: target: tcmu: Fix crash on ARM during cmd completion
In reply to Greg Kroah-HartmanFrom: Bodo Stroesser <[email protected]>
[ Upstream commit 5a0c256d96f020e4771f6fd5524b80f89a2d3132 ]
If tcmu_handle_completions() has to process a padding shorter than sizeof(struct tcmu_cmd_entry), the current call to tcmu_flush_dcache_range() with sizeof(struct tcmu_cmd_entry) as length param is wrong and causes crashes on e.g. ARM, because tcmu_flush_dcache_range() in this case calls flush_dcache_page(vmalloc_to_page(start)); with start being an invalid address above the end of the vmalloc'ed area.
The fix is to use the minimum of remaining ring space and sizeof(struct tcmu_cmd_entry) as the length param.
The patch was tested on kernel 4.19.118.
See https://bugzilla.kernel.org/show_bug.cgi?id=208045#c10
--- drivers/target/target_core_user.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/target/target_core_user.c +8 -1
@@ -1220,7 +1220,14 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev)struct tcmu_cmd_entry *entry = (void *) mb +CMDR_OFF + udev->cmdr_last_cleaned; -tcmu_flush_dcache_range (entry,sizeof (*entry)); +/* +* Flush max. up to end of cmd ring since current entry might +* be a padding that is shorter than sizeof(*entry) +*/ +size_t ring_left =head_to_end (udev->cmdr_last_cleaned, + udev->cmdr_size); +tcmu_flush_dcache_range (entry, ring_left <sizeof (*entry) ? + ring_left :sizeof (*entry));if (tcmu_hdr_get_op (entry->hdr.len_op) ==TCMU_OP_PAD ) { UPDATE_HEAD(udev->cmdr_last_cleaned,
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 3/214 gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY
In reply to Greg Kroah-HartmanFrom: Mark Tomlinson <[email protected]>
[ Upstream commit 272502fcb7cda01ab07fc2fcff82d1d2f73d43cc ]
When receiving an IPv4 packet inside an IPv6 GRE packet, and the IP6_TNL_F_RCV_DSCP_COPY flag is set on the tunnel, the IPv4 header would get corrupted. This is due to the common ip6_tnl_rcv() function assuming that the inner header is always IPv6. This patch checks the tunnel protocol for IPv4 inner packets, but still defaults to IPv6.
--- net/ipv6/ip6_tunnel.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
net/ipv6/ip6_tunnel.c +9 -1
@@ -860,7 +860,15 @@ int ip6_tnl_rcv(struct ip6_tnl *t, struc struct metadata_dst *tun_dst, bool log_ecn_err) { - return __ip6_tnl_rcv(t, skb, tpi, tun_dst, ip6ip6_dscp_ecn_decapsulate, +int (*dscp_ecn_decapsulate)(const struct ip6_tnl *t, +const struct ipv6hdr *ipv6h, +struct sk_buff *skb); + + dscp_ecn_decapsulate = ip6ip6_dscp_ecn_decapsulate; +if (tpi->proto ==htons (ETH_P_IP )) + dscp_ecn_decapsulate = ip4ip6_dscp_ecn_decapsulate; + +return __ip6_tnl_rcv (t, skb, tpi, tun_dst, dscp_ecn_decapsulate, log_ecn_err); }EXPORT_SYMBOL (ip6_tnl_rcv);
Greg Kroah-Hartman
maintainerPATCH 24/214 blktrace: ensure our debugfs dir exists
In reply to Greg Kroah-HartmanFrom: Luis Chamberlain <[email protected]>
[ Upstream commit b431ef837e3374da0db8ff6683170359aaa0859c ]
We make an assumption that a debugfs directory exists, but since this can fail ensure it exists before allowing blktrace setup to complete. Otherwise we end up stuffing blktrace files on the debugfs root directory. In the worst case scenario this *in theory* can create an eventual panic *iff* in the future a similarly named file is created prior on the debugfs root directory. This theoretical crash can happen due to a recursive removal followed by a specific dentry removal.
This doesn't fix any known crash, however I have seen the files go into the main debugfs root directory in cases where the debugfs directory was not created due to other internal bugs with blktrace now fixed.
blktrace is also completely useless without this directory, so this ensures to userspace we only setup blktrace if the kernel can stuff files where they are supposed to go into.
debugfs directory creations typically aren't checked for, and we have maintainers doing sweep removals of these checks, but since we need this check to ensure proper userspace blktrace functionality we make sure to annotate the justification for the check.
--- kernel/trace/blktrace.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
kernel/trace/blktrace.c +12 -0
@@ -535,6 +535,18 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,#endif bt->dir = dir =debugfs_create_dir (buts->name, blk_debugfs_root); +/* +* As blktrace relies on debugfs for its interface the debugfs directory +* is required, contrary to the usual mantra of not checking for debugfs +* files or directories. +*/ +if (IS_ERR_OR_NULL (dir)) { +pr_warn ("debugfs_dir not present for %s so skipping\n" , + buts->name); + ret = -ENOENT ; + goto err; + } + bt->dev = dev;atomic_set (&bt->dropped,0 );INIT_LIST_HEAD (&bt->running_list);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 23/214 media: pci: ttpci: av7110: fix possible buffer overflow caused by bad DMA value in debiirq()
In reply to Greg Kroah-HartmanFrom: Jia-Ju Bai <[email protected]>
[ Upstream commit 6499a0db9b0f1e903d52f8244eacc1d4be00eea2 ]
The value av7110->debi_virt is stored in DMA memory, and it is assigned to data, and thus data[0] can be modified at any time by malicious hardware. In this case, "if (data[0] < 2)" can be passed, but then data[0] can be changed into a large number, which may cause buffer overflow when the code "av7110->ci_slot[data[0]]" is used.
To fix this possible bug, data[0] is assigned to a local variable, which replaces the use of data[0].
--- drivers/media/pci/ttpci/av7110.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/pci/ttpci/av7110.c +3 -2
@@ -406,14 +406,15 @@ static void debiirq(unsigned long cookie)case DATA_CI_GET : {u8 *data = av7110->debi_virt; +u8 data_0 = data[0 ]; -if ((data[0 ] <2 ) && data[2 ] ==0xff ) { +if (data_0 <2 && data[2 ] ==0xff ) {int flags =0 ;if (data[5 ] >0 ) flags |=CA_CI_MODULE_PRESENT ;if (data[5 ] >5 ) flags |=CA_CI_MODULE_READY ; - av7110->ci_slot[data[0 ]].flags = flags; + av7110->ci_slot[data_0].flags = flags; }else ci_get_data(&av7110->ci_rbuffer, av7110->debi_virt,
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 22/214 powerpc/xive: Ignore kmemleak false positives
In reply to Greg Kroah-HartmanFrom: Alexey Kardashevskiy <[email protected]>
[ Upstream commit f0993c839e95dd6c7f054a1015e693c87e33e4fb ]
xive_native_provision_pages() allocates memory and passes the pointer to OPAL so kmemleak cannot find the pointer usage in the kernel memory and produces a false positive report (below) (even if the kernel did scan OPAL memory, it is unable to deal with __pa() addresses anyway).
This silences the warning.
unreferenced object 0xc000200350c40000 (size 65536):
comm "qemu-system-ppc", pid 2725, jiffies 4294946414 (age 70776.530s) hex dump (first 32 bytes):
02 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 ....P...........
01 00 08 07 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<0000000081ff046c>] xive_native_alloc_vp_block+0x120/0x250
[<00000000d555d524>] kvmppc_xive_compute_vp_id+0x248/0x350 [kvm]
[<00000000d69b9c9f>] kvmppc_xive_connect_vcpu+0xc0/0x520 [kvm]
[<000000006acbc81c>] kvm_arch_vcpu_ioctl+0x308/0x580 [kvm]
[<0000000089c69580>] kvm_vcpu_ioctl+0x19c/0xae0 [kvm]
[<00000000902ae91e>] ksys_ioctl+0x184/0x1b0
[<00000000f3e68bd7>] sys_ioctl+0x48/0xb0
[<0000000001b2c127>] system_call_exception+0x124/0x1f0
[<00000000d2b2ee40>] system_call_common+0xe8/0x214--- arch/powerpc/sysdev/xive/native.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/sysdev/xive/native.c +2 -0
@@ -18,6 +18,7 @@#include <linux/delay.h> #include <linux/cpumask.h> #include <linux/mm.h> +#include <linux/kmemleak.h> #include <asm/prom.h> #include <asm/io.h>
@@ -646,6 +647,7 @@ static bool xive_native_provision_pages(void)pr_err ("Failed to allocate provisioning page\n" );return false; } +kmemleak_ignore (p);opal_xive_donate_page (chip,__pa (p)); }return true;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 20/214 mfd: intel-lpss: Add Intel Emmitsburg PCH PCI IDs
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 3ea2e4eab64cefa06055bb0541fcdedad4b48565 ]
Intel Emmitsburg PCH has the same LPSS than Intel Ice Lake. Add the new IDs to the list of supported devices.
--- drivers/mfd/intel-lpss-pci.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mfd/intel-lpss-pci.c +3 -0
@@ -196,6 +196,9 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x1ac4), (kernel_ulong_t)&bxt_info }, { PCI_VDEVICE(INTEL, 0x1ac6), (kernel_ulong_t)&bxt_info }, { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info }, +/* EBG */ + { PCI_VDEVICE(INTEL, 0x1bad), (kernel_ulong_t)&bxt_uart_info }, + { PCI_VDEVICE(INTEL, 0x1bae), (kernel_ulong_t)&bxt_uart_info },/* GLK */ { PCI_VDEVICE(INTEL, 0x31ac), (kernel_ulong_t)&glk_i2c_info }, { PCI_VDEVICE(INTEL, 0x31ae), (kernel_ulong_t)&glk_i2c_info },
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 21/214 arm64: dts: qcom: msm8916: Pull down PDM GPIOs during sleep
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit e2ee9edc282961783d519c760bbaa20fed4dec38 ]
The original qcom kernel changed the PDM GPIOs to be pull-down during sleep at some point. Reportedly this was done because there was some "leakage at PDM outputs during sleep":
I cannot say how effective this is, but everything seems to work fine with this change so let's apply the same to mainline just to be sure.
--- arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +1 -1
@@ -521,7 +521,7 @@ pins = "gpio63", "gpio64", "gpio65", "gpio66", "gpio67", "gpio68"; drive-strength = <2>; - bias-disable; + bias-pull-down; }; }; };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 19/214 ASoC: tegra: Fix reference count leaks.
In reply to Greg Kroah-HartmanFrom: Qiushi Wu <[email protected]>
[ Upstream commit deca195383a6085be62cb453079e03e04d618d6e ]
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count if pm_runtime_put is not called in error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.
--- sound/soc/tegra/tegra30_ahub.c | 4 +++- sound/soc/tegra/tegra30_i2s.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
sound/soc/tegra/tegra30_ahub.c +3 -1
@@ -643,8 +643,10 @@ static int tegra30_ahub_resume(struct device *dev)int ret; ret =pm_runtime_get_sync (dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put (dev);return ret; + } ret =regcache_sync (ahub->regmap_ahub); ret |=regcache_sync (ahub->regmap_apbif);pm_runtime_put (dev);
sound/soc/tegra/tegra30_i2s.c +3 -1
@@ -538,8 +538,10 @@ static int tegra30_i2s_resume(struct device *dev)int ret; ret =pm_runtime_get_sync (dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put (dev);return ret; + } ret =regcache_sync (i2s->regmap);pm_runtime_put (dev);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 16/214 ALSA: hda/hdmi: Use force connectivity quirk on another HP desktop
In reply to Greg Kroah-HartmanFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit d96f27c80b65437a7b572647ecb4717ec9a50c98 ]
There's another HP desktop has buggy BIOS which flags the Port Connectivity bit as no connection.
Apply force connectivity quirk to enable DP/HDMI audio.
--- sound/pci/hda/patch_hdmi.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_hdmi.c +1 -0
@@ -1818,6 +1818,7 @@ static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t cvt_nid) }static const struct snd_pci_quirk force_connect_list[] = { +SND_PCI_QUIRK (0x103c ,0x870f ,"HP" ,1 ),SND_PCI_QUIRK (0x103c ,0x871a ,"HP" ,1 ), {} };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 15/214 ALSA: hda/realtek: Fix pin default on Intel NUC 8 Rugged
In reply to Greg Kroah-HartmanFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit e2d2fded6bdf3f7bb40718a208140dba8b4ec574 ]
The jack on Intel NUC 8 Rugged rear panel doesn't work.
The spec [1] states that the jack supports both headphone and microphone, so override a Pin Complex which has both Amp-In and Amp-Out to make the jack work.
Node 0x1b fits the requirement, and user confirmed the jack now works with new pin config.
[1] https://www.intel.com/content/dam/support/us/en/documents/mini-pcs/NUC8CCH_TechProdSpec.pdf
--- sound/pci/hda/patch_realtek.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
sound/pci/hda/patch_realtek.c +11 -0
@@ -6137,6 +6137,7 @@ enum {ALC269_FIXUP_CZC_L101 ,ALC269_FIXUP_LEMOTE_A1802 ,ALC269_FIXUP_LEMOTE_A190X , + ALC256_FIXUP_INTEL_NUC8_RUGGED, }; static const struct hda_fixup alc269_fixups[] = {
@@ -7458,6 +7459,15 @@ static const struct hda_fixup alc269_fixups[] = { }, .chain_id = ALC269_FIXUP_DMIC, }, + [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x1b ,0x01a1913c },/* use as headset mic, without its own jack detect */ + { } + }, + .chained = true, + .chain_id =ALC269_FIXUP_HEADSET_MODE + }, };static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7757,6 +7767,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x10ec ,0x118c ,"Medion EE4254 MD62100" ,ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE ),SND_PCI_QUIRK (0x1c06 ,0x2013 ,"Lemote A1802" ,ALC269_FIXUP_LEMOTE_A1802 ),SND_PCI_QUIRK (0x1c06 ,0x2015 ,"Lemote A190X" ,ALC269_FIXUP_LEMOTE_A190X ), +SND_PCI_QUIRK (0x8086 ,0x2080 ,"Intel NUC 8 Rugged" ,ALC256_FIXUP_INTEL_NUC8_RUGGED ), #if 0/* Below is a quirk table taken from the old code.
Signature · 1 line
2.25.1
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.62 release. There are 214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 03 Sep 2020 15:09:01 +0000. Anything received after that time might be too late.
Building x86_64:tools/perf ... failed
--------------
Error log:
Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
Warning: Kernel ABI header at 'tools/include/uapi/linux/sched.h' differs from latest version at 'include/uapi/linux/sched.h'
Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/unistd.h' differs from latest version at 'arch/x86/include/uapi/asm/unistd.h' Makefile.config:846: No libcap found, disables capability support, please install libcap-devel/libcap-dev Makefile.config:958: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel
PERF_VERSION = 5.4.61.gf5583dd12e6f
In file included from btf_dump.c:16:0:btf_dump.c: In function ‘btf_align_of’:tools/include/linux/kernel.h:53:17: error: comparison of distinct pointer types lacks a cast [-Werror]
(void) (&_min1 == &_min2); \
^
btf_dump.c:770:10: note: in expansion of macro ‘min’
return min(sizeof(void *), t->size);
^~~cc1: all warnings being treated as errors
make[7]: *** [/tmp/buildbot-builddir/tools/perf/staticobjs/btf_dump.o] Error 1
Bisect log below. Reverting the following two patches fixes the problem.
497ef945f327 libbpf: Fix build on ppc64le architecture 401834f55ce7 libbpf: Handle GCC built-in types for Arm NEON
Guenter
---
$ git bisect log # bad: [f5583dd12e6fc8a3c11ae732f38bce8334e150a2] Linux 5.4.62-rc1 # good: [6576d69aac94cd8409636dfa86e0df39facdf0d2] Linux 5.4.61 git bisect start 'HEAD' 'v5.4.61' # good: [6c747bd0794c982b500bda7334ef55d9dabb6cc6] nvme-fc: Fix wrong return value in __nvme_fc_init_request() git bisect good 6c747bd0794c982b500bda7334ef55d9dabb6cc6 # bad: [81b5698e6d9ecdc9569df8f4b93be70d587f5ddf] serial: samsung: Removes the IRQ not found warning git bisect bad 81b5698e6d9ecdc9569df8f4b93be70d587f5ddf # bad: [973679736caa8e1b39b68866535bdc7899a46f25] ASoC: wm8994: Avoid attempts to read unreadable registers git bisect bad 973679736caa8e1b39b68866535bdc7899a46f25 # good: [1789df2a787c589dbe83bc3ed52af2abbc739d1b] ext4: correctly restore system zone info when remount fails git bisect good 1789df2a787c589dbe83bc3ed52af2abbc739d1b # good: [ba1fb0301a60cbded377e0f312c82847415a1820] drm/amd/powerplay: correct UVD/VCE PG state on custom pptable uploading git bisect good ba1fb0301a60cbded377e0f312c82847415a1820 # bad: [1ef070d29e73a50e98a93d9a68f69cfef4247170] netfilter: avoid ipv6 -> nf_defrag_ipv6 module dependency git bisect bad 1ef070d29e73a50e98a93d9a68f69cfef4247170 # bad: [401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c] libbpf: Handle GCC built-in types for Arm NEON git bisect bad 401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c # good: [ccb6e88cd42a9cb65bde705f7f8e7c9822dcb711] drm/amd/display: Switch to immediate mode for updating infopackets git bisect good ccb6e88cd42a9cb65bde705f7f8e7c9822dcb711 # first bad commit: [401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c] libbpf: Handle GCC built-in types for Arm NEON
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.62 release. There are 214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 03 Sep 2020 15:09:01 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.62-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 24 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.62 release. There are 214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 03 Sep 2020 15:09:01 +0000. Anything received after that time might be too late.
Building x86_64:tools/perf ... failed
--------------
Error log:
Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
Warning: Kernel ABI header at 'tools/include/uapi/linux/sched.h' differs from latest version at 'include/uapi/linux/sched.h'
Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/unistd.h' differs from latest version at 'arch/x86/include/uapi/asm/unistd.h' Makefile.config:846: No libcap found, disables capability support, please install libcap-devel/libcap-dev Makefile.config:958: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel
PERF_VERSION= 5.4.61.gf5583dd12e6f
In file included from btf_dump.c:16:0:btf_dump.c: In function ‘btf_align_of’:tools/include/linux/kernel.h:53:17: error: comparison of distinct pointer types lacks a cast [-Werror]
Quoted 7 lines
(void) (&_min1 == &_min2); \ ^ btf_dump.c:770:10: note: in expansion of macro ‘min’ return min(sizeof(void *), t->size); ^~~cc1: all warnings being treated as errors
make[7]: *** [/tmp/buildbot-builddir/tools/perf/staticobjs/btf_dump.o] Error 1
This perf build break noticed and reported on mailing list [1]
Quoted 22 lines
Bisect log below. Reverting the following two patches fixes the problem.
497ef945f327libbpf: Fix build on ppc64le architecture401834f55ce7libbpf: Handle GCC built-in types for Arm NEONGuenter
---
$ git bisect log # bad: [f5583dd12e6fc8a3c11ae732f38bce8334e150a2] Linux 5.4.62-rc1 # good: [6576d69aac94cd8409636dfa86e0df39facdf0d2] Linux 5.4.61 git bisect start 'HEAD' 'v5.4.61' # good: [6c747bd0794c982b500bda7334ef55d9dabb6cc6] nvme-fc: Fix wrong return value in __nvme_fc_init_request() git bisect good 6c747bd0794c982b500bda7334ef55d9dabb6cc6 # bad: [81b5698e6d9ecdc9569df8f4b93be70d587f5ddf] serial: samsung: Removes the IRQ not found warning git bisect bad 81b5698e6d9ecdc9569df8f4b93be70d587f5ddf # bad: [973679736caa8e1b39b68866535bdc7899a46f25] ASoC: wm8994: Avoid attempts to read unreadable registers git bisect bad 973679736caa8e1b39b68866535bdc7899a46f25 # good: [1789df2a787c589dbe83bc3ed52af2abbc739d1b] ext4: correctly restore system zone info when remount fails git bisect good 1789df2a787c589dbe83bc3ed52af2abbc739d1b # good: [ba1fb0301a60cbded377e0f312c82847415a1820] drm/amd/powerplay: correct UVD/VCE PG state on custom pptable uploading
Quoted 8 lines
git bisect good ba1fb0301a60cbded377e0f312c82847415a1820 # bad: [1ef070d29e73a50e98a93d9a68f69cfef4247170] netfilter: avoid ipv6 -> nf_defrag_ipv6 module dependency git bisect bad 1ef070d29e73a50e98a93d9a68f69cfef4247170 # bad: [401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c] libbpf: Handle GCC built-in types for Arm NEON git bisect bad 401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c # good: [ccb6e88cd42a9cb65bde705f7f8e7c9822dcb711] drm/amd/display: Switch to immediate mode for updating infopackets git bisect good ccb6e88cd42a9cb65bde705f7f8e7c9822dcb711 # first bad commit: [401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c] libbpf: Handle GCC built-in types for Arm NEON
[1] https://lore.kernel.org/stable/CA+G9fYvsNkxvs7hdCB3LC9W+rP8hBa3F1fG3951S+xHfiOJwNA@mail.gmail.com/
- Naresh
Greg Kroah-Hartman
maintainerQuoted 66 lines · Naresh Kamboju
Quoted 24 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.62 release. There are 214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 03 Sep 2020 15:09:01 +0000. Anything received after that time might be too late.
Building x86_64:tools/perf ... failed
--------------
Error log:
Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
Warning: Kernel ABI header at 'tools/include/uapi/linux/sched.h' differs from latest version at 'include/uapi/linux/sched.h'
Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/unistd.h' differs from latest version at 'arch/x86/include/uapi/asm/unistd.h' Makefile.config:846: No libcap found, disables capability support, please install libcap-devel/libcap-dev Makefile.config:958: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel
PERF_VERSION= 5.4.61.gf5583dd12e6f
In file included from btf_dump.c:16:0:btf_dump.c: In function ‘btf_align_of’:tools/include/linux/kernel.h:53:17: error: comparison of distinct pointer types lacks a cast [-Werror]Quoted 7 lines
(void) (&_min1 == &_min2); \ ^ btf_dump.c:770:10: note: in expansion of macro ‘min’ return min(sizeof(void *), t->size); ^~~cc1: all warnings being treated as errors
make[7]: *** [/tmp/buildbot-builddir/tools/perf/staticobjs/btf_dump.o] Error 1This perf build break noticed and reported on mailing list [1]
Quoted 22 lines
Bisect log below. Reverting the following two patches fixes the problem.
497ef945f327libbpf: Fix build on ppc64le architecture401834f55ce7libbpf: Handle GCC built-in types for Arm NEONGuenter
---
$ git bisect log # bad: [f5583dd12e6fc8a3c11ae732f38bce8334e150a2] Linux 5.4.62-rc1 # good: [6576d69aac94cd8409636dfa86e0df39facdf0d2] Linux 5.4.61 git bisect start 'HEAD' 'v5.4.61' # good: [6c747bd0794c982b500bda7334ef55d9dabb6cc6] nvme-fc: Fix wrong return value in __nvme_fc_init_request() git bisect good 6c747bd0794c982b500bda7334ef55d9dabb6cc6 # bad: [81b5698e6d9ecdc9569df8f4b93be70d587f5ddf] serial: samsung: Removes the IRQ not found warning git bisect bad 81b5698e6d9ecdc9569df8f4b93be70d587f5ddf # bad: [973679736caa8e1b39b68866535bdc7899a46f25] ASoC: wm8994: Avoid attempts to read unreadable registers git bisect bad 973679736caa8e1b39b68866535bdc7899a46f25 # good: [1789df2a787c589dbe83bc3ed52af2abbc739d1b] ext4: correctly restore system zone info when remount fails git bisect good 1789df2a787c589dbe83bc3ed52af2abbc739d1b # good: [ba1fb0301a60cbded377e0f312c82847415a1820] drm/amd/powerplay: correct UVD/VCE PG state on custom pptable uploadingQuoted 8 lines
git bisect good ba1fb0301a60cbded377e0f312c82847415a1820 # bad: [1ef070d29e73a50e98a93d9a68f69cfef4247170] netfilter: avoid ipv6 -> nf_defrag_ipv6 module dependency git bisect bad 1ef070d29e73a50e98a93d9a68f69cfef4247170 # bad: [401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c] libbpf: Handle GCC built-in types for Arm NEON git bisect bad 401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c # good: [ccb6e88cd42a9cb65bde705f7f8e7c9822dcb711] drm/amd/display: Switch to immediate mode for updating infopackets git bisect good ccb6e88cd42a9cb65bde705f7f8e7c9822dcb711 # first bad commit: [401834f55ce7f86bf2c0f8fdd8fbf9e1baf19f1c] libbpf: Handle GCC built-in types for Arm NEON
Quoted 1 line
[1] https://lore.kernel.org/stable/CA+G9fYvsNkxvs7hdCB3LC9W+rP8hBa3F1fG3951S+xHfiOJwNA@mail.gmail.com/
Yes, sorry, I thought the follow-on patch I added would solve this issue, I guess not :(
Odd that it works in Linus's tree? I'll go drop both of these patches now...
thanks,
greg k-h