5.3.8-stable review
Subsystems (9)
Greg Kroah-Hartman
maintainerPATCH 47/197 mips: Loongson: Fix the link time qualifier of serial_exit()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 25b69a889b638b0b7e51e2c4fe717a66bec0e566 ]
'exit' functions should be marked as __exit, not __init.
--- arch/mips/loongson64/common/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/loongson64/common/serial.c +1 -1
@@ -110,7 +110,7 @@ static int __init serial_init(void) }module_init (serial_init); -static void __init serial_exit (void ) +static void __exit serial_exit(void) {platform_device_unregister (&uart8250_device); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 1/197 drm: Free the writeback_job when it with an empty fb
In reply to Greg Kroah-HartmanFrom: Lowry Li (Arm Technology China) <[email protected]>
[ Upstream commit 8581d51055a08cc6eb061c8856062290e8582ce4 ]
Adds the check if the writeback_job with an empty fb, then it should be freed in atomic_check phase.
With this change, the driver users will not check empty fb case any more. So refined accordingly.
--- .../drm/arm/display/komeda/komeda_wb_connector.c | 3 +-- drivers/gpu/drm/arm/malidp_mw.c | 4 ++-- drivers/gpu/drm/drm_atomic.c | 13 +++++++++---- drivers/gpu/drm/rcar-du/rcar_du_writeback.c | 4 ++-- drivers/gpu/drm/vc4/vc4_txp.c | 5 ++--- 5 files changed, 16 insertions(+), 13 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +1 -2
@@ -43,9 +43,8 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder,struct komeda_data_flow_cfg dflow;int err; -if (!writeback_job || !writeback_job->fb) { +if (!writeback_job)return 0 ; - }if (!crtc_st->active) {DRM_DEBUG_ATOMIC ("Cannot write the composition result out on a inactive CRTC.\n" );
drivers/gpu/drm/arm/malidp_mw.c +2 -2
@@ -130,7 +130,7 @@ malidp_mw_encoder_atomic_check(struct drm_encoder *encoder,struct drm_framebuffer *fb;int i, n_planes; -if (!conn_state->writeback_job || !conn_state->writeback_job->fb) +if (!conn_state->writeback_job)return 0 ; fb = conn_state->writeback_job->fb;
@@ -247,7 +247,7 @@ void malidp_mw_atomic_commit(struct drm_device *drm, mw_state =to_mw_state (conn_state); -if (conn_state->writeback_job && conn_state->writeback_job->fb) { +if (conn_state->writeback_job) {struct drm_framebuffer *fb = conn_state->writeback_job->fb; DRM_DEV_DEBUG_DRIVER(drm->dev,
drivers/gpu/drm/drm_atomic.c +9 -4
@@ -430,10 +430,15 @@ static int drm_atomic_connector_check(struct drm_connector *connector,return -EINVAL ; } -if (writeback_job->out_fence && !writeback_job->fb) { -DRM_DEBUG_ATOMIC ("[CONNECTOR:%d:%s] requesting out-fence without framebuffer\n" , - connector->base.id, connector->name); -return -EINVAL ; +if (!writeback_job->fb) { +if (writeback_job->out_fence) { +DRM_DEBUG_ATOMIC ("[CONNECTOR:%d:%s] requesting out-fence without framebuffer\n" , + connector->base.id, connector->name); +return -EINVAL ; + } + +drm_writeback_cleanup_job (writeback_job); + state->writeback_job =NULL ; }return 0 ;
drivers/gpu/drm/rcar-du/rcar_du_writeback.c +2 -2
@@ -147,7 +147,7 @@ static int rcar_du_wb_enc_atomic_check(struct drm_encoder *encoder,struct drm_device *dev = encoder->dev;struct drm_framebuffer *fb; -if (!conn_state->writeback_job || !conn_state->writeback_job->fb) +if (!conn_state->writeback_job)return 0 ; fb = conn_state->writeback_job->fb;
@@ -221,7 +221,7 @@ void rcar_du_writeback_setup(struct rcar_du_crtc *rcrtc,unsigned int i; state = rcrtc->writeback.base.state; -if (!state || !state->writeback_job || !state->writeback_job->fb) +if (!state || !state->writeback_job)return ; fb = state->writeback_job->fb;
drivers/gpu/drm/vc4/vc4_txp.c +2 -3
@@ -229,7 +229,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn,int i; conn_state =drm_atomic_get_new_connector_state (state, conn); -if (!conn_state->writeback_job || !conn_state->writeback_job->fb) +if (!conn_state->writeback_job)return 0 ; crtc_state =drm_atomic_get_new_crtc_state (state, conn_state->crtc);
@@ -269,8 +269,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn,u32 ctrl;int i; -if (WARN_ON (!conn_state->writeback_job || - !conn_state->writeback_job->fb)) +if (WARN_ON (!conn_state->writeback_job))return ; mode = &conn_state->crtc->state->adjusted_mode;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 11/197 scsi: qla2xxx: Fix N2N link reset
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
[ Upstream commit 7f2a398d59d658818f3d219645164676fbbc88e8 ]
Fix stalled link recovery for N2N with FC-NVMe connection.
--- drivers/scsi/qla2xxx/qla_def.h | 3 +- drivers/scsi/qla2xxx/qla_init.c | 107 +++++++++++++++++++++++--------- drivers/scsi/qla2xxx/qla_mbx.c | 23 ++++++- drivers/scsi/qla2xxx/qla_os.c | 4 ++ 4 files changed, 103 insertions(+), 34 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +2 -1
@@ -2338,6 +2338,7 @@ typedef struct fc_port { unsigned int query:1; unsigned int id_changed:1; unsigned int scan_needed:1; + unsigned int n2n_flag:1;struct completion nvme_del_done;uint32_t nvme_prli_service_param;
@@ -2388,7 +2389,6 @@ typedef struct fc_port {uint8_t fc4_type;uint8_t fc4f_nvme;uint8_t scan_state; -uint8_t n2n_flag;unsigned long last_queue_full;unsigned long last_ramp_up;
@@ -2979,6 +2979,7 @@ enum scan_flags_t {enum fc4type_t {FS_FC4TYPE_FCP =BIT_0 ,FS_FC4TYPE_NVME =BIT_1 , +FS_FCP_IS_N2N =BIT_7 , };struct fab_scan_rp {
drivers/scsi/qla2xxx/qla_init.c +77 -30
162 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_mbx.c +20 -3
@@ -2257,7 +2257,7 @@ qla2x00_lip_reset(scsi_qla_host_t *vha)mbx_cmd_t mc;mbx_cmd_t *mcp = &mc; -ql_dbg (ql_dbg_mbx + ql_dbg_verbose, vha,0x105a , +ql_dbg (ql_dbg_disc, vha,0x105a ,"Entered %s.\n" , __func__);if (IS_CNA_CAPABLE (vha->hw)) {
@@ -3891,14 +3891,23 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,case TOPO_N2N : ha->current_topology =ISP_CFG_N ;spin_lock_irqsave (&vha->hw->tgt.sess_lock, flags); +list_for_each_entry (fcport, &vha->vp_fcports, list) { + fcport->scan_state =QLA_FCPORT_SCAN ; + fcport->n2n_flag =0 ; + } + fcport =qla2x00_find_fcport_by_wwpn (vha, rptid_entry->u.f1.port_name,1 );spin_unlock_irqrestore (&vha->hw->tgt.sess_lock, flags);if (fcport) { fcport->plogi_nack_done_deadline = jiffies +HZ ; - fcport->dm_login_expire = jiffies +3 *HZ ; + fcport->dm_login_expire = jiffies +2 *HZ ; fcport->scan_state =QLA_FCPORT_FOUND ; + fcport->n2n_flag =1 ; +if (vha->flags.nvme_enabled) + fcport->fc4f_nvme =1 ; +switch (fcport->disc_state) {case DSC_DELETED : set_bit(RELOGIN_NEEDED,
@@ -3932,7 +3941,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, rptid_entry->u.f1.port_name, rptid_entry->u.f1.node_name,NULL , - FC4_TYPE_UNKNOWN); + FS_FCP_IS_N2N); }/* if our portname is higher then initiate N2N login */
@@ -4031,6 +4040,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,list_for_each_entry (fcport, &vha->vp_fcports, list) { fcport->scan_state =QLA_FCPORT_SCAN ; + fcport->n2n_flag =0 ; } fcport = qla2x00_find_fcport_by_wwpn(vha,
@@ -4040,6 +4050,13 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->login_retry = vha->hw->login_retry_count; fcport->plogi_nack_done_deadline = jiffies +HZ ; fcport->scan_state =QLA_FCPORT_FOUND ; + fcport->n2n_flag =1 ; + fcport->d_id.b.domain = + rptid_entry->u.f2.remote_nport_id[2 ]; + fcport->d_id.b.area = + rptid_entry->u.f2.remote_nport_id[1 ]; + fcport->d_id.b.al_pa = + rptid_entry->u.f2.remote_nport_id[0 ]; } } }
drivers/scsi/qla2xxx/qla_os.c +4 -0
@@ -5050,6 +5050,10 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e)memcpy (fcport->port_name, e->u.new_sess.port_name,WWN_SIZE ); + +if (e->u.new_sess.fc4_type &FS_FCP_IS_N2N ) + fcport->n2n_flag =1 ; + }else { ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %8phC mem alloc fail.\n",
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 10/197 scsi: qla2xxx: Fix stale mem access on driver unload
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
[ Upstream commit fd5564ba54e0d8a9e3e823d311b764232e09eb5f ]
On driver unload, 'remove_one' thread was allowed to advance, while session cleanup still lag behind. This patch ensures session deletion will finish before remove_one can advance.
--- drivers/scsi/qla2xxx/qla_os.c | 1 + drivers/scsi/qla2xxx/qla_target.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +1 -0
@@ -1153,6 +1153,7 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha)qla2x00_mark_all_devices_lost (vha,0 );wait_event_timeout (vha->fcport_waitQ,test_fcport_count (vha),10 *HZ ); +flush_workqueue (vha->hw->wq); }/*
drivers/scsi/qla2xxx/qla_target.c +8 -13
@@ -954,7 +954,7 @@ void qlt_free_session_done(struct work_struct *work)struct qla_hw_data *ha = vha->hw;unsigned long flags;bool logout_started = false; -scsi_qla_host_t *base_vha; +scsi_qla_host_t *base_vha =pci_get_drvdata (ha->pdev);struct qlt_plogi_ack_t *own = sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN ];
@@ -1106,6 +1106,7 @@ void qlt_free_session_done(struct work_struct *work) }spin_unlock_irqrestore (&ha->tgt.sess_lock, flags); + sess->free_pending =0 ; ql_dbg(ql_dbg_tgt_mgt, vha, 0xf001, "Unregistration of sess %p %8phC finished fcp_cnt %d\n",
@@ -1114,17 +1115,8 @@ void qlt_free_session_done(struct work_struct *work)if (tgt && (tgt->sess_count ==0 ))wake_up_all (&tgt->waitQ); -if (vha->fcport_count ==0 ) -wake_up_all (&vha->fcport_waitQ); - - base_vha =pci_get_drvdata (ha->pdev); - - sess->free_pending =0 ; - -if (test_bit (PFLG_DRIVER_REMOVING , &base_vha->pci_flags)) -return ; - -if ((!tgt || !tgt->tgt_stop) && !LOOP_TRANSITION (vha)) { +if (!test_bit (PFLG_DRIVER_REMOVING , &base_vha->pci_flags) && + (!tgt || !tgt->tgt_stop) && !LOOP_TRANSITION (vha)) {switch (vha->host->active_mode) {case MODE_INITIATOR :case MODE_DUAL :
@@ -1137,6 +1129,9 @@ void qlt_free_session_done(struct work_struct *work)break ; } } + +if (vha->fcport_count ==0 ) +wake_up_all (&vha->fcport_waitQ); }/* ha->tgt.sess_lock supposed to be held on entry */
@@ -1166,7 +1161,7 @@ void qlt_unreg_sess(struct fc_port *sess) sess->last_login_gen = sess->login_gen;INIT_WORK (&sess->free_work, qlt_free_session_done); -schedule_work (&sess->free_work); +queue_work (sess->vha->hw->wq, &sess->free_work); }EXPORT_SYMBOL (qlt_unreg_sess);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 12/197 scsi: qla2xxx: Fix N2N link up fail
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
[ Upstream commit f3f1938bb673b1b5ad182c4608f5f8a24921eea3 ]
During link up/bounce, qla driver would do command flush as part of cleanup. In this case, the flush can intefere with FW state. This patch allows FW to be in control of link up.
--- drivers/scsi/qla2xxx/qla_mbx.c | 2 ++ drivers/scsi/qla2xxx/qla_os.c | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_mbx.c +2 -0
@@ -3905,6 +3905,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->dm_login_expire = jiffies +2 *HZ ; fcport->scan_state =QLA_FCPORT_FOUND ; fcport->n2n_flag =1 ; + fcport->keep_nport_handle =1 ;if (vha->flags.nvme_enabled) fcport->fc4f_nvme =1 ;
@@ -4050,6 +4051,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->login_retry = vha->hw->login_retry_count; fcport->plogi_nack_done_deadline = jiffies +HZ ; fcport->scan_state =QLA_FCPORT_FOUND ; + fcport->keep_nport_handle =1 ; fcport->n2n_flag =1 ; fcport->d_id.b.domain = rptid_entry->u.f2.remote_nport_id[2 ];
drivers/scsi/qla2xxx/qla_os.c +2 -4
@@ -5150,11 +5150,9 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e)if (dfcp)qlt_schedule_sess_for_deletion (tfcp); - -if (N2N_TOPO (vha->hw)) - fcport->flags &= ~FCF_FABRIC_DEVICE ; -if (N2N_TOPO (vha->hw)) { + fcport->flags &= ~FCF_FABRIC_DEVICE ; + fcport->keep_nport_handle =1 ;if (vha->flags.nvme_enabled) { fcport->fc4f_nvme =1 ; fcport->n2n_flag =1 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 13/197 ARM: dts: Fix gpio0 flags for am335x-icev2
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 4ef5d76b453908f21341e661a9b6f96862f6f589 ]
The ti,no-idle-on-init and ti,no-reset-on-init flags need to be at the interconnect target module level for the modules that have it defined. Otherwise we get the following warnings:
dts flag should be at module level for ti,no-idle-on-init dts flag should be at module level for ti,no-reset-on-init
--- arch/arm/boot/dts/am335x-icev2.dts | 2 +- arch/arm/boot/dts/am33xx-l4.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/am335x-icev2.dts +1 -1
@@ -432,7 +432,7 @@ pinctrl-0 = <&mmc0_pins_default>; }; -&gpio0 { +&gpio0_target { /* Do not idle the GPIO used for holding the VTT regulator */ ti,no-reset-on-init; ti,no-idle-on-init;
arch/arm/boot/dts/am33xx-l4.dtsi +1 -1
@@ -127,7 +127,7 @@ ranges = <0x0 0x5000 0x1000>; }; - target-module@7000 { /* 0x44e07000, ap 14 20.0 */ + gpio0_target: target-module@7000 { /* 0x44e07000, ap 14 20.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; ti,hwmods = "gpio1"; reg = <0x7000 0x4>,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 16/197 ARM: OMAP2+: Fix warnings with broken omap2_set_init_voltage()
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit cf395f7ddb9ebc6b2d28d83b53d18aa4e7c19701 ]
This code is currently unable to find the dts opp tables as ti-cpufreq needs to set them up first based on speed binning.
We stopped initializing the opp tables with platform code years ago for device tree based booting with commit 92d51856d740 ("ARM: OMAP3+: do not register non-dt OPP tables for device tree boot"), and all of mach-omap2 is now booting using device tree.
We currently get the following errors on init:
omap2_set_init_voltage: unable to find boot up OPP for vdd_mpuomap2_set_init_voltage: unable to set vdd_mpuomap2_set_init_voltage: unable to find boot up OPP for vdd_coreomap2_set_init_voltage: unable to set vdd_coreomap2_set_init_voltage: unable to find boot up OPP for vdd_ivaomap2_set_init_voltage: unable to set vdd_iva
Let's just drop the unused code. Nowadays ti-cpufreq should be used to to initialize things properly.
--- arch/arm/mach-omap2/pm.c | 100 --------------------------------------- 1 file changed, 100 deletions(-)
arch/arm/mach-omap2/pm.c +0 -100
@@ -74,83 +74,6 @@ int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)return 0 ; } -/* -* This API is to be called during init to set the various voltage -* domains to the voltage as per the opp table. Typically we boot up -* at the nominal voltage. So this function finds out the rate of -* the clock associated with the voltage domain, finds out the correct -* opp entry and sets the voltage domain to the voltage specified -* in the opp entry -*/ -static int __init omap2_set_init_voltage (char *vdd_name,char *clk_name, -const char *oh_name) -{ -struct voltagedomain *voltdm; -struct clk *clk; -struct dev_pm_opp *opp; -unsigned long freq, bootup_volt; -struct device *dev; - -if (!vdd_name || !clk_name || !oh_name) { -pr_err ("%s: invalid parameters\n" , __func__); - goto exit; - } - -if (!strncmp (oh_name,"mpu" ,3 )) -/* -* All current OMAPs share voltage rail and clock -* source, so CPU0 is used to represent the MPU-SS. -*/ - dev =get_cpu_device (0 ); -else - dev =omap_device_get_by_hwmod_name (oh_name); - -if (IS_ERR (dev)) { -pr_err ("%s: Unable to get dev pointer for hwmod %s\n" , - __func__, oh_name); - goto exit; - } - - voltdm =voltdm_lookup (vdd_name); -if (!voltdm) { -pr_err ("%s: unable to get vdd pointer for vdd_%s\n" , - __func__, vdd_name); - goto exit; - } - - clk =clk_get (NULL , clk_name); -if (IS_ERR (clk)) { -pr_err ("%s: unable to get clk %s\n" , __func__, clk_name); - goto exit; - } - - freq =clk_get_rate (clk); -clk_put (clk); - - opp =dev_pm_opp_find_freq_ceil (dev, &freq); -if (IS_ERR (opp)) { -pr_err ("%s: unable to find boot up OPP for vdd_%s\n" , - __func__, vdd_name); - goto exit; - } - - bootup_volt =dev_pm_opp_get_voltage (opp); -dev_pm_opp_put (opp); - -if (!bootup_volt) { -pr_err ("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n" , - __func__, vdd_name); - goto exit; - } - -voltdm_scale (voltdm, bootup_volt); -return 0 ; - -exit: -pr_err ("%s: unable to set vdd_%s\n" , __func__, vdd_name); -return -EINVAL ; -} -#ifdef CONFIG_SUSPEND static int omap_pm_enter (suspend_state_t suspend_state) {
@@ -208,25 +131,6 @@ void omap_common_suspend_init(void *pm_suspend) }#endif /* CONFIG_SUSPEND */ -static void __init omap3_init_voltages (void ) -{ -if (!soc_is_omap34xx ()) -return ; - -omap2_set_init_voltage ("mpu_iva" ,"dpll1_ck" ,"mpu" ); -omap2_set_init_voltage ("core" ,"l3_ick" ,"l3_main" ); -} - -static void __init omap4_init_voltages (void ) -{ -if (!soc_is_omap44xx ()) -return ; - -omap2_set_init_voltage ("mpu" ,"dpll_mpu_ck" ,"mpu" ); -omap2_set_init_voltage ("core" ,"l3_div_ck" ,"l3_main_1" ); -omap2_set_init_voltage ("iva" ,"dpll_iva_m5x2_ck" ,"iva" ); -} -int __maybe_unused omap_pm_nop_init (void ) {return 0 ;
@@ -246,10 +150,6 @@ int __init omap2_common_pm_late_init(void)omap4_twl_init ();omap_voltage_late_init (); -/* Initialize the voltages */ -omap3_init_voltages (); -omap4_init_voltages (); -/* Smartreflex device init */ omap_devinit_smartreflex ();
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 15/197 ARM: OMAP2+: Add missing LCDC midlemode for am335x
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 17529d43b21c72466e9109d602c6f5c360a1a9e8 ]
TRM "Table 13-34. SYSCONFIG Register Field Descriptions" lists both standbymode and idlemode that should be just the sidle and midle registers where midle is currently unconfigured for lcdc_sysc. As the dts data has been generated based on lcdc_sysc, we now have an empty "ti,sysc-midle" property.
And so we currently get a warning for lcdc because of a difference with dts provided configuration compared to the legacy platform data. This is because lcdc has SYSC_HAS_MIDLEMODE configured in the platform data without configuring the modes.
Let's fix the issue by adding the missing midlemode to lcdc_sysc, and configuring the "ti,sysc-midle" property based on the TRM values.
--- arch/arm/boot/dts/am33xx-l4.dtsi | 4 +++- arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-)
arch/arm/boot/dts/am33xx-l4.dtsi +3 -1
@@ -2038,7 +2038,9 @@ reg = <0xe000 0x4>, <0xe054 0x4>; reg-names = "rev", "sysc"; - ti,sysc-midle ; + ti,sysc-midle = <SYSC_IDLE_FORCE>, + <SYSC_IDLE_NO>, + <SYSC_IDLE_SMART>; ti,sysc-sidle = <SYSC_IDLE_FORCE>, <SYSC_IDLE_NO>, <SYSC_IDLE_SMART>;
arch/arm/mach-omap2/omap_hwmod_33xx_data.c +3 -2
@@ -231,8 +231,9 @@ static struct omap_hwmod am33xx_control_hwmod = {static struct omap_hwmod_class_sysconfig lcdc_sysc = { .rev_offs =0x0 , .sysc_offs =0x54 , - .sysc_flags = (SYSC_HAS_SIDLEMODE |SYSC_HAS_MIDLEMODE ), - .idlemodes = (SIDLE_FORCE |SIDLE_NO |SIDLE_SMART ), + .sysc_flags =SYSC_HAS_SIDLEMODE |SYSC_HAS_MIDLEMODE , + .idlemodes =SIDLE_FORCE |SIDLE_NO |SIDLE_SMART | +MSTANDBY_FORCE |MSTANDBY_NO |MSTANDBY_SMART , .sysc_fields = &omap_hwmod_sysc_type2, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 17/197 nvme-tcp: fix wrong stop condition in io_work
In reply to Greg Kroah-HartmanFrom: Wunderlich, Mark <[email protected]>
[ Upstream commit ddef29578a81a1d4d8f2b26a7adbfe21407ee3ea ]
Allow the do/while statement to continue if current time is not after the proposed time 'deadline'. Intent is to allow loop to proceed for a specific time period. Currently the loop, as coded, will exit after first pass.
--- drivers/nvme/host/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/tcp.c +2 -2
@@ -1039,7 +1039,7 @@ static void nvme_tcp_io_work(struct work_struct *w) {struct nvme_tcp_queue *queue = container_of(w, struct nvme_tcp_queue, io_work); -unsigned long start = jiffies +msecs_to_jiffies (1 ); +unsigned long deadline = jiffies +msecs_to_jiffies (1 ); do { bool pending = false;
@@ -1064,7 +1064,7 @@ static void nvme_tcp_io_work(struct work_struct *w)if (!pending)return ; - }while (time_after (jiffies, start));/* quota is exhausted */ + }while (!time_after (jiffies, deadline));/* quota is exhausted */ queue_work_on (queue->io_cpu, nvme_tcp_wq, &queue->io_work); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 19/197 nvme: fix an error code in nvme_init_subsystem()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit bc4f6e06a90ea016855fc67212b4d500145f0b8a ]
"ret" should be a negative error code here, but it's either success or possibly uninitialized.
--- drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +3 -2
@@ -2513,8 +2513,9 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)list_add_tail (&subsys->entry, &nvme_subsystems); } -if (sysfs_create_link (&subsys->dev.kobj, &ctrl->device->kobj, -dev_name (ctrl->device))) { + ret =sysfs_create_link (&subsys->dev.kobj, &ctrl->device->kobj, +dev_name (ctrl->device)); +if (ret) {dev_err (ctrl->device,"failed to create sysfs link from subsystem.\n" ); goto out_put_subsystem;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 18/197 nvme-pci: Save PCI state before putting drive into deepest state
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
[ Upstream commit 7cbb5c6f9aa7cfda7175d82a9cf77a92965b0c5e ]
The action of saving the PCI state will cause numerous PCI configuration space reads which depending upon the vendor implementation may cause the drive to exit the deepest NVMe state.
In these cases ASPM will typically resolve the PCIe link state and APST may resolve the NVMe power state. However it has also been observed that this register access after quiesced will cause PC10 failure on some device combinations.
To resolve this, move the PCI state saving to before SetFeatures has been called. This has been proven to resolve the issue across a 5000 sample test on previously failing disk/system combinations.
--- drivers/nvme/host/pci.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/nvme/host/pci.c +10 -7
@@ -2894,11 +2894,21 @@ static int nvme_suspend(struct device *dev)if (ret <0 ) goto unfreeze; +/* +* A saved state prevents pci pm from generically controlling the +* device's power. If we're using protocol specific settings, we don't +* want pci interfering. +*/ +pci_save_state (pdev); + ret =nvme_set_power_state (ctrl, ctrl->npss);if (ret <0 ) goto unfreeze;if (ret) { +/* discard the saved state */ +pci_load_saved_state (pdev,NULL ); +/* * Clearing npss forces a controller reset on resume. The * correct value will be resdicovered then.
@@ -2906,14 +2916,7 @@ static int nvme_suspend(struct device *dev)nvme_dev_disable (ndev, true); ctrl->npss =0 ; ret =0 ; - goto unfreeze; } -/* -* A saved state prevents pci pm from generically controlling the -* device's power. If we're using protocol specific settings, we don't -* want pci interfering. -*/ -pci_save_state (pdev); unfreeze:nvme_unfreeze (ctrl);return ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 20/197 nvme-rdma: Fix max_hw_sectors calculation
In reply to Greg Kroah-HartmanFrom: Max Gurtovoy <[email protected]>
[ Upstream commit ff13c1b87c97275b82b2af99044b4abf6861b28f ]
By default, the NVMe/RDMA driver should support max io_size of 1MiB (or upto the maximum supported size by the HCA). Currently, one will see that /sys/class/block/<bdev>/queue/max_hw_sectors_kb is 1020 instead of 1024.
A non power of 2 value can cause performance degradation due to unnecessary splitting of IO requests and unoptimized allocation units.
The number of pages per MR has been fixed here, so there is no longer any need to reduce max_sectors by 1.
--- drivers/nvme/host/rdma.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/nvme/host/rdma.c +11 -5
@@ -427,7 +427,7 @@ static void nvme_rdma_destroy_queue_ib(struct nvme_rdma_queue *queue)static int nvme_rdma_get_max_fr_pages (struct ib_device *ibdev) {return min_t (u32,NVME_RDMA_MAX_SEGMENTS , - ibdev->attrs.max_fast_reg_page_list_len); + ibdev->attrs.max_fast_reg_page_list_len -1 ); }static int nvme_rdma_create_queue_ib (struct nvme_rdma_queue *queue)
@@ -437,7 +437,7 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue)const int cq_factor = send_wr_factor +1 ;/* + RECV */ int comp_vector, idx =nvme_rdma_queue_idx (queue);enum ib_poll_context poll_ctx; -int ret; +int ret, pages_per_mr; queue->device =nvme_rdma_find_get_device (queue->cm_id);if (!queue->device) {
@@ -479,10 +479,16 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue) goto out_destroy_qp; } +/* +* Currently we don't use SG_GAPS MR's so if the first entry is +* misaligned we'll end up using two entries for a single data page, +* so one additional entry is required. +*/ + pages_per_mr =nvme_rdma_get_max_fr_pages (ibdev) +1 ; ret =ib_mr_pool_init (queue->qp, &queue->qp->rdma_mrs, queue->queue_size,IB_MR_TYPE_MEM_REG , -nvme_rdma_get_max_fr_pages (ibdev),0 ); + pages_per_mr,0 );if (ret) { dev_err(queue->ctrl->ctrl.device, "failed to initialize MR pool sized %d for QID %d\n",
@@ -824,8 +830,8 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl,if (error) goto out_stop_queue; - ctrl->ctrl.max_hw_sectors = - (ctrl->max_fr_pages -1 ) << (ilog2 (SZ_4K ) -9 ); + ctrl->ctrl.max_segments = ctrl->max_fr_pages; + ctrl->ctrl.max_hw_sectors = ctrl->max_fr_pages << (ilog2 (SZ_4K ) -9 ); error =nvme_init_identify (&ctrl->ctrl);if (error)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 21/197 Added QUIRKs for ADATA XPG SX8200 Pro 512GB
In reply to Greg Kroah-HartmanFrom: Gabriel Craciunescu <[email protected]>
[ Upstream commit f03e42c6af60f778a6d1ccfb857db9b2ec835279 ]
Booting with default_ps_max_latency_us >6000 makes the device fail. Also SUBNQN is NULL and gives a warning on each boot/resume.
$ nvme id-ctrl /dev/nvme0 | grep ^subnqn subnqn : (null)
I use this device with an Acer Nitro 5 (AN515-43-R8BF) Laptop. To be sure is not a Laptop issue only, I tested the device on my server board with the same results.
( with 2x,4x link on the board and 4x link on a PCI-E card ).
--- drivers/nvme/host/pci.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/host/pci.c +3 -0
@@ -3041,6 +3041,9 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_LIGHTNVM, }, { PCI_DEVICE(0x10ec, 0x5762), /* ADATA SX6000LNP */ .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, + { PCI_DEVICE(0x1cc1, 0x8201), /* ADATA SX8200PNP 512GB */ + .driver_data = NVME_QUIRK_NO_DEEPEST_PS | + NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 22/197 nvme: Add quirk for Kingston NVME SSD running FW E8FK11.T
In reply to Greg Kroah-HartmanFrom: Jian-Hong Pan <[email protected]>
[ Upstream commit 19ea025e1d28c629b369c3532a85b3df478cc5c6 ]
Kingston NVME SSD with firmware version E8FK11.T has no interrupt after resume with actions related to suspend to idle. This patch applied NVME_QUIRK_SIMPLE_SUSPEND quirk to fix this issue.
--- drivers/nvme/host/core.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/nvme/host/core.c +10 -0
@@ -2270,6 +2270,16 @@ static const struct nvme_core_quirk_entry core_quirks[] = { .vid = 0x14a4, .fr = "22301111", .quirks = NVME_QUIRK_SIMPLE_SUSPEND, + }, + { +/* +* This Kingston E8FK11.T firmware version has no interrupt +* after resume with actions related to suspend to idle +* https://bugzilla.kernel.org/show_bug.cgi?id=204887 +*/ + .vid = 0x2646, + .fr = "E8FK11.T", + .quirks = NVME_QUIRK_SIMPLE_SUSPEND, } };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 23/197 nvme: allow 64-bit results in passthru commands
In reply to Greg Kroah-HartmanFrom: Marta Rybczynska <[email protected]>
[ Upstream commit 65e68edce0db433aa0c2b26d7dc14fbbbeb89fbb ]
It is not possible to get 64-bit results from the passthru commands, what prevents from getting for the Capabilities (CAP) property value.
As a result, it is not possible to implement IOL's NVMe Conformance test 4.3 Case 1 for Fabrics targets [1] (page 123).
This issue has been already discussed [2], but without a solution.
This patch solves the problem by adding new ioctls with a new passthru structure, including 64-bit results. The older ioctls stay unchanged.
[1] https://www.iol.unh.edu/sites/default/files/testsuites/nvme/UNH-IOL_NVMe_Conformance_Test_Suite_v11.0.pdf
[2] http://lists.infradead.org/pipermail/linux-nvme/2018-June/018791.html
--- drivers/nvme/host/core.c | 108 +++++++++++++++++++++++++++----- include/uapi/linux/nvme_ioctl.h | 23 +++++++ 2 files changed, 115 insertions(+), 16 deletions(-)
drivers/nvme/host/core.c +92 -16
@@ -852,7 +852,7 @@ static void *nvme_add_user_metadata(struct bio *bio, void __user *ubuf,static int nvme_submit_user_cmd (struct request_queue *q,struct nvme_command *cmd,void __user *ubuffer,unsigned bufflen,void __user *meta_buffer,unsigned meta_len, -u32 meta_seed,u32 *result,unsigned timeout) +u32 meta_seed,u64 *result,unsigned timeout) {bool write =nvme_is_write (cmd);struct nvme_ns *ns = q->queuedata;
@@ -893,7 +893,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,else ret =nvme_req (req)->status;if (result) - *result =le32_to_cpu (nvme_req (req)->result.u32); + *result =le64_to_cpu (nvme_req (req)->result.u64);if (meta && !ret && !write) {if (copy_to_user (meta_buffer, meta, meta_len)) ret = -EFAULT ;
@@ -1339,6 +1339,54 @@ static int nvme_user_cmd(struct nvme_ctrl *ctrl, struct nvme_ns *ns,struct nvme_command c;unsigned timeout =0 ;u32 effects; +u64 result; +int status; + +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ; +if (copy_from_user (&cmd, ucmd,sizeof (cmd))) +return -EFAULT ; +if (cmd.flags) +return -EINVAL ; + +memset (&c,0 ,sizeof (c)); + c.common.opcode = cmd.opcode; + c.common.flags = cmd.flags; + c.common.nsid =cpu_to_le32 (cmd.nsid); + c.common.cdw2[0 ] =cpu_to_le32 (cmd.cdw2); + c.common.cdw2[1 ] =cpu_to_le32 (cmd.cdw3); + c.common.cdw10 =cpu_to_le32 (cmd.cdw10); + c.common.cdw11 =cpu_to_le32 (cmd.cdw11); + c.common.cdw12 =cpu_to_le32 (cmd.cdw12); + c.common.cdw13 =cpu_to_le32 (cmd.cdw13); + c.common.cdw14 =cpu_to_le32 (cmd.cdw14); + c.common.cdw15 =cpu_to_le32 (cmd.cdw15); + +if (cmd.timeout_ms) + timeout =msecs_to_jiffies (cmd.timeout_ms); + + effects =nvme_passthru_start (ctrl, ns, cmd.opcode); + status =nvme_submit_user_cmd (ns ? ns->queue : ctrl->admin_q, &c, + (void __user *)(uintptr_t )cmd.addr, cmd.data_len, + (void __user *)(uintptr_t )cmd.metadata, + cmd.metadata_len,0 , &result, timeout); +nvme_passthru_end (ctrl, effects); + +if (status >=0 ) { +if (put_user (result, &ucmd->result)) +return -EFAULT ; + } + +return status; +} + +static int nvme_user_cmd64 (struct nvme_ctrl *ctrl,struct nvme_ns *ns, +struct nvme_passthru_cmd64 __user *ucmd) +{ +struct nvme_passthru_cmd64 cmd; +struct nvme_command c; +unsigned timeout =0 ; +u32 effects;int status;if (!capable (CAP_SYS_ADMIN ))
@@ -1409,6 +1457,41 @@ static void nvme_put_ns_from_disk(struct nvme_ns_head *head, int idx)srcu_read_unlock (&head->srcu, idx); } +static bool is_ctrl_ioctl (unsigned int cmd) +{ +if (cmd ==NVME_IOCTL_ADMIN_CMD || cmd ==NVME_IOCTL_ADMIN64_CMD ) +return true; +if (is_sed_ioctl (cmd)) +return true; +return false; +} + +static int nvme_handle_ctrl_ioctl (struct nvme_ns *ns,unsigned int cmd, +void __user *argp, +struct nvme_ns_head *head, +int srcu_idx) +{ +struct nvme_ctrl *ctrl = ns->ctrl; +int ret; + +nvme_get_ctrl (ns->ctrl); +nvme_put_ns_from_disk (head, srcu_idx); + +switch (cmd) { +case NVME_IOCTL_ADMIN_CMD : + ret =nvme_user_cmd (ctrl,NULL , argp); +break ; +case NVME_IOCTL_ADMIN64_CMD : + ret =nvme_user_cmd64 (ctrl,NULL , argp); +break ; +default : + ret =sed_ioctl (ctrl->opal_dev, cmd, argp); +break ; + } +nvme_put_ctrl (ctrl); +return ret; +} +static int nvme_ioctl (struct block_device *bdev,fmode_t mode,unsigned int cmd,unsigned long arg) {
@@ -1426,20 +1509,8 @@ static int nvme_ioctl(struct block_device *bdev, fmode_t mode,* seperately and drop the ns SRCU reference early. This avoids a * deadlock when deleting namespaces using the passthrough interface. */ -if (cmd ==NVME_IOCTL_ADMIN_CMD ||is_sed_ioctl (cmd)) { -struct nvme_ctrl *ctrl = ns->ctrl; - -nvme_get_ctrl (ns->ctrl); -nvme_put_ns_from_disk (head, srcu_idx); - -if (cmd ==NVME_IOCTL_ADMIN_CMD ) - ret =nvme_user_cmd (ctrl,NULL , argp); -else - ret =sed_ioctl (ctrl->opal_dev, cmd, argp); - -nvme_put_ctrl (ctrl); -return ret; - } +if (is_ctrl_ioctl (cmd)) +return nvme_handle_ctrl_ioctl (ns, cmd, argp, head, srcu_idx);switch (cmd) {case NVME_IOCTL_ID :
@@ -1452,6 +1523,9 @@ static int nvme_ioctl(struct block_device *bdev, fmode_t mode,case NVME_IOCTL_SUBMIT_IO : ret =nvme_submit_io (ns, argp);break ; +case NVME_IOCTL_IO64_CMD : + ret =nvme_user_cmd64 (ns->ctrl, ns, argp); +break ;default :if (ns->ndev) ret =nvme_nvm_ioctl (ns, cmd, arg);
@@ -2826,6 +2900,8 @@ static long nvme_dev_ioctl(struct file *file, unsigned int cmd,switch (cmd) {case NVME_IOCTL_ADMIN_CMD :return nvme_user_cmd (ctrl,NULL , argp); +case NVME_IOCTL_ADMIN64_CMD : +return nvme_user_cmd64 (ctrl,NULL , argp);case NVME_IOCTL_IO_CMD :return nvme_dev_user_cmd (ctrl, argp);case NVME_IOCTL_RESET :
include/uapi/linux/nvme_ioctl.h +23 -0
@@ -45,6 +45,27 @@ struct nvme_passthru_cmd {__u32 result; }; +struct nvme_passthru_cmd64 { +__u8 opcode; +__u8 flags; +__u16 rsvd1; +__u32 nsid; +__u32 cdw2; +__u32 cdw3; +__u64 metadata; +__u64 addr; +__u32 metadata_len; +__u32 data_len; +__u32 cdw10; +__u32 cdw11; +__u32 cdw12; +__u32 cdw13; +__u32 cdw14; +__u32 cdw15; +__u32 timeout_ms; +__u64 result; +}; +#define nvme_admin_cmd nvme_passthru_cmd#define NVME_IOCTL_ID _IO('N', 0x40)
@@ -54,5 +75,7 @@ struct nvme_passthru_cmd {#define NVME_IOCTL_RESET _IO('N', 0x44)#define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)#define NVME_IOCTL_RESCAN _IO('N', 0x46) +#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64) +#define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64)#endif /* _UAPI_LINUX_NVME_IOCTL_H */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 24/197 drm/komeda: prevent memory leak in komeda_wb_connector_add
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
[ Upstream commit a0ecd6fdbf5d648123a7315c695fb6850d702835 ]
In komeda_wb_connector_add if drm_writeback_connector_init fails the allocated memory for kwb_conn should be released.
--- drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +3 -1
@@ -165,8 +165,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms, &komeda_wb_encoder_helper_funcs, formats, n_formats);komeda_put_fourcc_list (formats); -if (err) +if (err) { +kfree (kwb_conn);return err; + }drm_connector_helper_add (&wb_conn->base, &komeda_wb_conn_helper_funcs);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 25/197 nvme-rdma: fix possible use-after-free in connect timeout
In reply to Greg Kroah-HartmanFrom: Sagi Grimberg <[email protected]>
[ Upstream commit 67b483dd03c4cd9e90e4c3943132dce514ea4e88 ]
If the connect times out, we may have already destroyed the queue in the timeout handler, so test if the queue is still allocated in the connect error handler.
--- drivers/nvme/host/rdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/rdma.c +2 -1
@@ -620,7 +620,8 @@ static int nvme_rdma_start_queue(struct nvme_rdma_ctrl *ctrl, int idx)if (!ret) {set_bit (NVME_RDMA_Q_LIVE , &queue->flags); }else { -__nvme_rdma_stop_queue (queue); +if (test_bit (NVME_RDMA_Q_ALLOCATED , &queue->flags)) +__nvme_rdma_stop_queue (queue);dev_info (ctrl->ctrl.device,"failed to connect queue: %d ret=%d\n" , idx, ret); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 26/197 blk-mq: honor IO scheduler for multiqueue devices
In reply to Greg Kroah-HartmanFrom: Ming Lei <[email protected]>
[ Upstream commit a12de1d42d74ef3c80e9fb9a2da94daaef747869 ]
If a device is using multiple queues, the IO scheduler may be bypassed. This may hurt performance for some slow MQ devices, and it also breaks zoned devices which depend on mq-deadline for respecting the write order in one zone.
Don't bypass io scheduler if we have one setup.
This patch can double sequential write performance basically on MQ scsi_debug when mq-deadline is applied.
--- block/blk-mq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
block/blk-mq.c +4 -2
@@ -1998,6 +1998,8 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) }blk_add_rq_to_plug (plug, rq); + }else if (q->elevator) { +blk_mq_sched_insert_request (rq, false, true, true); }else if (plug && !blk_queue_nomerges (q)) {/* * We do limited plugging. If the bio can be merged, do that.
@@ -2021,8 +2023,8 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)blk_mq_try_issue_directly (data.hctx, same_queue_rq, &cookie); } - }else if ((q->nr_hw_queues >1 && is_sync) || (!q->elevator && - !data.hctx->dispatch_busy)) { + }else if ((q->nr_hw_queues >1 && is_sync) || + !data.hctx->dispatch_busy) {blk_mq_try_issue_directly (data.hctx, rq, &cookie); }else {blk_mq_sched_insert_request (rq, false, true, true);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 28/197 ARM: dts: am4372: Set memory bandwidth limit for DISPC
In reply to Greg Kroah-HartmanFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit f90ec6cdf674248dcad85bf9af6e064bf472b841 ]
Set memory bandwidth limit to filter out resolutions above 720p@60Hz to avoid underflow errors due to the bandwidth needs of higher resolutions.
am43xx can not provide enough bandwidth to DISPC to correctly handle 'high' resolutions.
--- arch/arm/boot/dts/am4372.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/am4372.dtsi +2 -0
@@ -337,6 +337,8 @@ ti,hwmods = "dss_dispc"; clocks = <&disp_clk>; clock-names = "fck"; + + max-memory-bandwidth = <230000000>; }; rfbi: rfbi@4832a800 {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 3/197 clk: ti: dra7: Fix mcasp8 clock bits
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit dd8882a255388ba66175098b1560d4f81c100d30 ]
There's a typo for dra7 mcasp clkctrl bit, it should be 22 like the other macasp instances, and not 24. And in dra7xx_clks[] we have the bits wrong way around.
--- drivers/clk/ti/clk-7xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/ti/clk-7xx.c +3 -3
@@ -683,7 +683,7 @@ static const struct omap_clkctrl_reg_data dra7_l4per2_clkctrl_regs[] __initconst { DRA7_L4PER2_MCASP2_CLKCTRL, dra7_mcasp2_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:0154:22" }, { DRA7_L4PER2_MCASP3_CLKCTRL, dra7_mcasp3_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:015c:22" }, { DRA7_L4PER2_MCASP5_CLKCTRL, dra7_mcasp5_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:016c:22" }, - { DRA7_L4PER2_MCASP8_CLKCTRL, dra7_mcasp8_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:0184:24" }, + { DRA7_L4PER2_MCASP8_CLKCTRL, dra7_mcasp8_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:0184:22" }, { DRA7_L4PER2_MCASP4_CLKCTRL, dra7_mcasp4_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:018c:22" }, { DRA7_L4PER2_UART7_CLKCTRL, dra7_uart7_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01c4:24" }, { DRA7_L4PER2_UART8_CLKCTRL, dra7_uart8_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01d4:24" },
@@ -828,8 +828,8 @@ static struct ti_dt_clk dra7xx_clks[] = {DT_CLK (NULL ,"mcasp6_aux_gfclk_mux" ,"l4per2-clkctrl:01f8:22" ),DT_CLK (NULL ,"mcasp7_ahclkx_mux" ,"l4per2-clkctrl:01fc:24" ),DT_CLK (NULL ,"mcasp7_aux_gfclk_mux" ,"l4per2-clkctrl:01fc:22" ), -DT_CLK (NULL ,"mcasp8_ahclkx_mux" ,"l4per2-clkctrl:0184:22" ), -DT_CLK (NULL ,"mcasp8_aux_gfclk_mux" ,"l4per2-clkctrl:0184:24" ), +DT_CLK (NULL ,"mcasp8_ahclkx_mux" ,"l4per2-clkctrl:0184:24" ), +DT_CLK (NULL ,"mcasp8_aux_gfclk_mux" ,"l4per2-clkctrl:0184:22" ),DT_CLK (NULL ,"mmc1_clk32k" ,"l3init-clkctrl:0008:8" ),DT_CLK (NULL ,"mmc1_fclk_div" ,"l3init-clkctrl:0008:25" ), DT_CLK(NULL, "mmc1_fclk_mux", "l3init-clkctrl:0008:24"),
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 29/197 net: dsa: qca8k: Use up to 7 ports for all operations
In reply to Greg Kroah-HartmanFrom: Michal Vokáč <[email protected]>
[ Upstream commit 7ae6d93c8f052b7a77ba56ed0f654e22a2876739 ]
The QCA8K family supports up to 7 ports. So use the existing QCA8K_NUM_PORTS define to allocate the switch structure and limit all operations with the switch ports.
This was not an issue until commit 0394a63acfe2 ("net: dsa: enable and disable all ports") disabled all unused ports. Since the unused ports 7-11 are outside of the correct register range on this switch some registers were rewritten with invalid content.
--- drivers/net/dsa/qca8k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/dsa/qca8k.c +2 -2
@@ -705,7 +705,7 @@ qca8k_setup(struct dsa_switch *ds) BIT(0) << QCA8K_GLOBAL_FW_CTRL1_UC_DP_S);/* Setup connection between CPU port & user ports */ -for (i =0 ; i <DSA_MAX_PORTS ; i++) { +for (i =0 ; i <QCA8K_NUM_PORTS ; i++) {/* CPU port gets connected to all user ports of the switch */ if (dsa_is_cpu_port (ds, i)) { qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(QCA8K_CPU_PORT),
@@ -1074,7 +1074,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev)if (id !=QCA8K_ID_QCA8337 )return -ENODEV ; - priv->ds =dsa_switch_alloc (&mdiodev->dev,DSA_MAX_PORTS ); + priv->ds =dsa_switch_alloc (&mdiodev->dev,QCA8K_NUM_PORTS );if (!priv->ds)return -ENOMEM ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 32/197 loop: change queue block size to match when using DIO
In reply to Greg Kroah-HartmanFrom: Martijn Coenen <[email protected]>
[ Upstream commit 85560117d00f5d528e928918b8f61cadcefff98b ]
The loop driver assumes that if the passed in fd is opened with O_DIRECT, the caller wants to use direct I/O on the loop device. However, if the underlying block device has a different block size than the loop block queue, direct I/O can't be enabled. Instead of requiring userspace to manually change the blocksize and re-enable direct I/O, just change the queue block sizes to match, as well as the io_min size.
--- drivers/block/loop.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/block/loop.c +10 -0
@@ -994,6 +994,16 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,if (!(lo_flags &LO_FLAGS_READ_ONLY ) && file->f_op->fsync)blk_queue_write_cache (lo->lo_queue, true, false); +if (io_is_direct (lo->lo_backing_file) && inode->i_sb->s_bdev) { +/* In case of direct I/O, match underlying block size */ +unsigned short bsize =bdev_logical_block_size ( + inode->i_sb->s_bdev); + +blk_queue_logical_block_size (lo->lo_queue, bsize); +blk_queue_physical_block_size (lo->lo_queue, bsize); +blk_queue_io_min (lo->lo_queue, bsize); + } +loop_update_rotational (lo);loop_update_dio (lo);set_capacity (lo->lo_disk, size);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 33/197 nl80211: fix null pointer dereference
In reply to Greg Kroah-HartmanFrom: Miaoqing Pan <[email protected]>
[ Upstream commit b501426cf86e70649c983c52f4c823b3c40d72a3 ]
If the interface is not in MESH mode, the command 'iw wlanx mpath del' will cause kernel panic.
The root cause is null pointer access in mpp_flush_by_proxy(), as the pointer 'sdata->u.mesh.mpp_paths' is NULL for non MESH interface.
Unable to handle kernel NULL pointer dereference at virtual address 00000068
[...]
PC is at _raw_spin_lock_bh+0x20/0x5c
LR is at mesh_path_del+0x1c/0x17c [mac80211]
[...]
Process iw (pid: 4537, stack limit = 0xd83e0238)
[...]
[<c021211c>] (_raw_spin_lock_bh) from [<bf8c7648>] (mesh_path_del+0x1c/0x17c [mac80211]) [<bf8c7648>] (mesh_path_del [mac80211]) from [<bf6cdb7c>] (extack_doit+0x20/0x68 [compat]) [<bf6cdb7c>] (extack_doit [compat]) from [<c05c309c>] (genl_rcv_msg+0x274/0x30c) [<c05c309c>] (genl_rcv_msg) from [<c05c25d8>] (netlink_rcv_skb+0x58/0xac) [<c05c25d8>] (netlink_rcv_skb) from [<c05c2e14>] (genl_rcv+0x20/0x34) [<c05c2e14>] (genl_rcv) from [<c05c1f90>] (netlink_unicast+0x11c/0x204) [<c05c1f90>] (netlink_unicast) from [<c05c2420>] (netlink_sendmsg+0x30c/0x370) [<c05c2420>] (netlink_sendmsg) from [<c05886d0>] (sock_sendmsg+0x70/0x84) [<c05886d0>] (sock_sendmsg) from [<c0589f4c>] (___sys_sendmsg.part.3+0x188/0x228) [<c0589f4c>] (___sys_sendmsg.part.3) from [<c058add4>] (__sys_sendmsg+0x4c/0x70) [<c058add4>] (__sys_sendmsg) from [<c0208c80>] (ret_fast_syscall+0x0/0x44)
Code: e2822c02 e2822001 e5832004 f590f000 (e1902f9f) ---[ end trace bbd717600f8f884d ]---
--- net/wireless/nl80211.c | 3 +++ 1 file changed, 3 insertions(+)
net/wireless/nl80211.c +3 -0
@@ -6184,6 +6184,9 @@ static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)if (!rdev->ops->del_mpath)return -EOPNOTSUPP ; +if (dev->ieee80211_ptr->iftype !=NL80211_IFTYPE_MESH_POINT ) +return -EOPNOTSUPP ; +return rdev_del_mpath (rdev, dev, dst); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 34/197 mac80211: fix txq null pointer dereference
In reply to Greg Kroah-HartmanFrom: Miaoqing Pan <[email protected]>
[ Upstream commit 8ed31a264065ae92058ce54aa3cc8da8d81dc6d7 ]
If the interface type is P2P_DEVICE or NAN, read the file of '/sys/kernel/debug/ieee80211/phyx/netdev:wlanx/aqm' will get a NULL pointer dereference. As for those interface type, the pointer sdata->vif.txq is NULL.
Unable to handle kernel NULL pointer dereference at virtual address 00000011 CPU: 1 PID: 30936 Comm: cat Not tainted 4.14.104 #1
task: ffffffc0337e4880 task.stack: ffffff800cd20000 PC is at ieee80211_if_fmt_aqm+0x34/0xa0 [mac80211] LR is at ieee80211_if_fmt_aqm+0x34/0xa0 [mac80211] [...]
Process cat (pid: 30936, stack limit = 0xffffff800cd20000) [...]
[<ffffff8000b7cd00>] ieee80211_if_fmt_aqm+0x34/0xa0 [mac80211] [<ffffff8000b7c414>] ieee80211_if_read+0x60/0xbc [mac80211] [<ffffff8000b7ccc4>] ieee80211_if_read_aqm+0x28/0x30 [mac80211] [<ffffff80082eff94>] full_proxy_read+0x2c/0x48 [<ffffff80081eef00>] __vfs_read+0x2c/0xd4 [<ffffff80081ef084>] vfs_read+0x8c/0x108 [<ffffff80081ef494>] SyS_read+0x40/0x7c
--- net/mac80211/debugfs_netdev.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
net/mac80211/debugfs_netdev.c +9 -2
@@ -487,9 +487,14 @@ static ssize_t ieee80211_if_fmt_aqm( const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) { struct ieee80211_local *local = sdata->local; -struct txq_info *txqi =to_txq_info (sdata->vif.txq); +struct txq_info *txqi;int len; +if (!sdata->vif.txq) +return 0 ; + + txqi =to_txq_info (sdata->vif.txq); +spin_lock_bh (&local->fq.lock);rcu_read_lock ();
@@ -658,7 +663,9 @@ static void add_common_files(struct ieee80211_sub_if_data *sdata)DEBUGFS_ADD (rc_rateidx_vht_mcs_mask_5ghz);DEBUGFS_ADD (hw_queues); -if (sdata->local->ops->wake_tx_queue) +if (sdata->local->ops->wake_tx_queue && + sdata->vif.type !=NL80211_IFTYPE_P2P_DEVICE && + sdata->vif.type !=NL80211_IFTYPE_NAN )DEBUGFS_ADD (aqm); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 35/197 netfilter: nft_connlimit: disable bh on garbage collection
In reply to Greg Kroah-HartmanFrom: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 34a4c95abd25ab41fb390b985a08a651b1fa0b0f ]
BH must be disabled when invoking nf_conncount_gc_list() to perform garbage collection, otherwise deadlock might happen.
nf_conncount_add+0x1f/0x50 [nf_conncount] nft_connlimit_eval+0x4c/0xe0 [nft_connlimit] nft_dynset_eval+0xb5/0x100 [nf_tables] nft_do_chain+0xea/0x420 [nf_tables] ? sch_direct_xmit+0x111/0x360 ? noqueue_init+0x10/0x10 ? __qdisc_run+0x84/0x510 ? tcp_packet+0x655/0x1610 [nf_conntrack] ? ip_finish_output2+0x1a7/0x430 ? tcp_error+0x130/0x150 [nf_conntrack] ? nf_conntrack_in+0x1fc/0x4c0 [nf_conntrack] nft_do_chain_ipv4+0x66/0x80 [nf_tables] nf_hook_slow+0x44/0xc0 ip_rcv+0xb5/0xd0 ? ip_rcv_finish_core.isra.19+0x360/0x360 __netif_receive_skb_one_core+0x52/0x70 netif_receive_skb_internal+0x34/0xe0 napi_gro_receive+0xba/0xe0 e1000_clean_rx_irq+0x1e9/0x420 [e1000e] e1000e_poll+0xbe/0x290 [e1000e] net_rx_action+0x149/0x3b0 __do_softirq+0xde/0x2d8 irq_exit+0xba/0xc0 do_IRQ+0x85/0xd0 common_interrupt+0xf/0xf </IRQ> RIP: 0010:nf_conncount_gc_list+0x3b/0x130 [nf_conncount]
--- net/netfilter/nft_connlimit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/netfilter/nft_connlimit.c +6 -1
@@ -218,8 +218,13 @@ static void nft_connlimit_destroy_clone(const struct nft_ctx *ctx,static bool nft_connlimit_gc (struct net *net,const struct nft_expr *expr) {struct nft_connlimit *priv =nft_expr_priv (expr); +bool ret; -return nf_conncount_gc_list (net, &priv->list); +local_bh_disable (); + ret =nf_conncount_gc_list (net, &priv->list); +local_bh_enable (); + +return ret; }static struct nft_expr_type nft_connlimit_type;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 36/197 net: mscc: ocelot: add missing of_node_put after calling of_get_child_by_name
In reply to Greg Kroah-HartmanFrom: Wen Yang <[email protected]>
[ Upstream commit d2c50b1cd94528aea8c8e9abb4cce81590f32cc4 ]
of_node_put needs to be called when the device node which is got from of_get_child_by_name finished using.
In both cases of success and failure, we need to release 'ports', so clean up the code using goto.
--- drivers/net/ethernet/mscc/ocelot_board.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ethernet/mscc/ocelot_board.c +8 -6
@@ -287,13 +287,14 @@ static int mscc_ocelot_probe(struct platform_device *pdev)continue ; phy =of_phy_find_device (phy_node); +of_node_put (phy_node);if (!phy)continue ; err =ocelot_probe_port (ocelot, port, regs, phy);if (err) {of_node_put (portnp); -return err; + goto out_put_ports; } phy_mode =of_get_phy_mode (portnp);
@@ -321,7 +322,8 @@ static int mscc_ocelot_probe(struct platform_device *pdev)"invalid phy mode for port%d, (Q)SGMII only\n" , port);of_node_put (portnp); -return -EINVAL ; + err = -EINVAL ; + goto out_put_ports; } serdes =devm_of_phy_get (ocelot->dev, portnp,NULL );
@@ -334,7 +336,8 @@ static int mscc_ocelot_probe(struct platform_device *pdev)"missing SerDes phys for port%d\n" , port); - goto err_probe_ports; +of_node_put (portnp); + goto out_put_ports; } ocelot->ports[port]->serdes = serdes;
@@ -346,9 +349,8 @@ static int mscc_ocelot_probe(struct platform_device *pdev)dev_info (&pdev->dev,"Ocelot switch probed\n" ); -return 0 ; - -err_probe_ports: +out_put_ports: +of_node_put (ports);return err; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 4/197 ARM: dts: Fix wrong clocks for dra7 mcasp
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 2d3c8ba3cffa00f76bedb713c8c2126c82d8cd13 ]
The ahclkr clkctrl clock bit 28 only exists for mcasp 1 and 2 on dra7. This causes the following warning on beagle-x15:
ti-sysc 48468000.target-module: could not add child clock ahclkr: -19
Also the mcasp clkctrl clock bits are wrong:
For mcasp1 and 2 we have four clocks at bits 28, 24, 22 and 0:
bit 28 is ahclkr
bit 24 is ahclkx
bit 22 is auxclk
bit 0 is fck
For mcasp3 to 8 we have three clocks at bits 24, 22 and 0.
bit 24 is ahclkx
bit 22 is auxclk
bit 0 is fck
We do not have currently mapped auxclk at bit 22 for the drivers, that can be added if needed.
--- arch/arm/boot/dts/dra7-l4.dtsi | 48 +++++++++++++++------------------- 1 file changed, 21 insertions(+), 27 deletions(-)
arch/arm/boot/dts/dra7-l4.dtsi +21 -27
@@ -2762,7 +2762,7 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 129 1>, <&edma_xbar 128 1>; dma-names = "tx", "rx"; - clocks = <&ipu_clkctrl DRA7_IPU_MCASP1_CLKCTRL 22>, + clocks = <&ipu_clkctrl DRA7_IPU_MCASP1_CLKCTRL 0>, <&ipu_clkctrl DRA7_IPU_MCASP1_CLKCTRL 24>, <&ipu_clkctrl DRA7_IPU_MCASP1_CLKCTRL 28>; clock-names = "fck", "ahclkx", "ahclkr";
@@ -2799,8 +2799,8 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 131 1>, <&edma_xbar 130 1>; dma-names = "tx", "rx"; - clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP2_CLKCTRL 22>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP2_CLKCTRL 24>, + clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP2_CLKCTRL 0>, + <&ipu_clkctrl DRA7_IPU_MCASP1_CLKCTRL 24>, <&l4per2_clkctrl DRA7_L4PER2_MCASP2_CLKCTRL 28>; clock-names = "fck", "ahclkx", "ahclkr"; status = "disabled";
@@ -2818,9 +2818,8 @@ <SYSC_IDLE_SMART>; /* Domains (P, C): l4per_pwrdm, l4per2_clkdm */ clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 0>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 24>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 28>; - clock-names = "fck", "ahclkx", "ahclkr"; + <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 24>; + clock-names = "fck", "ahclkx"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x68000 0x2000>,
@@ -2836,7 +2835,7 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 133 1>, <&edma_xbar 132 1>; dma-names = "tx", "rx"; - clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 22>, + clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 0>, <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 24>; clock-names = "fck", "ahclkx"; status = "disabled";
@@ -2854,9 +2853,8 @@ <SYSC_IDLE_SMART>; /* Domains (P, C): l4per_pwrdm, l4per2_clkdm */ clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP4_CLKCTRL 0>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP4_CLKCTRL 24>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP4_CLKCTRL 28>; - clock-names = "fck", "ahclkx", "ahclkr"; + <&l4per2_clkctrl DRA7_L4PER2_MCASP4_CLKCTRL 24>; + clock-names = "fck", "ahclkx"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x6c000 0x2000>,
@@ -2872,7 +2870,7 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 135 1>, <&edma_xbar 134 1>; dma-names = "tx", "rx"; - clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP4_CLKCTRL 22>, + clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP4_CLKCTRL 0>, <&l4per2_clkctrl DRA7_L4PER2_MCASP4_CLKCTRL 24>; clock-names = "fck", "ahclkx"; status = "disabled";
@@ -2890,9 +2888,8 @@ <SYSC_IDLE_SMART>; /* Domains (P, C): l4per_pwrdm, l4per2_clkdm */ clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP5_CLKCTRL 0>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP5_CLKCTRL 24>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP5_CLKCTRL 28>; - clock-names = "fck", "ahclkx", "ahclkr"; + <&l4per2_clkctrl DRA7_L4PER2_MCASP5_CLKCTRL 24>; + clock-names = "fck", "ahclkx"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x70000 0x2000>,
@@ -2908,7 +2905,7 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 137 1>, <&edma_xbar 136 1>; dma-names = "tx", "rx"; - clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP5_CLKCTRL 22>, + clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP5_CLKCTRL 0>, <&l4per2_clkctrl DRA7_L4PER2_MCASP5_CLKCTRL 24>; clock-names = "fck", "ahclkx"; status = "disabled";
@@ -2926,9 +2923,8 @@ <SYSC_IDLE_SMART>; /* Domains (P, C): l4per_pwrdm, l4per2_clkdm */ clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP6_CLKCTRL 0>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP6_CLKCTRL 24>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP6_CLKCTRL 28>; - clock-names = "fck", "ahclkx", "ahclkr"; + <&l4per2_clkctrl DRA7_L4PER2_MCASP6_CLKCTRL 24>; + clock-names = "fck", "ahclkx"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x74000 0x2000>,
@@ -2944,7 +2940,7 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 139 1>, <&edma_xbar 138 1>; dma-names = "tx", "rx"; - clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP6_CLKCTRL 22>, + clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP6_CLKCTRL 0>, <&l4per2_clkctrl DRA7_L4PER2_MCASP6_CLKCTRL 24>; clock-names = "fck", "ahclkx"; status = "disabled";
@@ -2962,9 +2958,8 @@ <SYSC_IDLE_SMART>; /* Domains (P, C): l4per_pwrdm, l4per2_clkdm */ clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP7_CLKCTRL 0>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP7_CLKCTRL 24>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP7_CLKCTRL 28>; - clock-names = "fck", "ahclkx", "ahclkr"; + <&l4per2_clkctrl DRA7_L4PER2_MCASP7_CLKCTRL 24>; + clock-names = "fck", "ahclkx"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x78000 0x2000>,
@@ -2980,7 +2975,7 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 141 1>, <&edma_xbar 140 1>; dma-names = "tx", "rx"; - clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP7_CLKCTRL 22>, + clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP7_CLKCTRL 0>, <&l4per2_clkctrl DRA7_L4PER2_MCASP7_CLKCTRL 24>; clock-names = "fck", "ahclkx"; status = "disabled";
@@ -2998,9 +2993,8 @@ <SYSC_IDLE_SMART>; /* Domains (P, C): l4per_pwrdm, l4per2_clkdm */ clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP8_CLKCTRL 0>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP8_CLKCTRL 24>, - <&l4per2_clkctrl DRA7_L4PER2_MCASP8_CLKCTRL 28>; - clock-names = "fck", "ahclkx", "ahclkr"; + <&l4per2_clkctrl DRA7_L4PER2_MCASP8_CLKCTRL 24>; + clock-names = "fck", "ahclkx"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x7c000 0x2000>,
@@ -3016,7 +3010,7 @@ interrupt-names = "tx", "rx"; dmas = <&edma_xbar 143 1>, <&edma_xbar 142 1>; dma-names = "tx", "rx"; - clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP8_CLKCTRL 22>, + clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP8_CLKCTRL 0>, <&l4per2_clkctrl DRA7_L4PER2_MCASP8_CLKCTRL 24>; clock-names = "fck", "ahclkx"; status = "disabled";
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 6/197 scsi: ufs: skip shutdown if hba is not powered
In reply to Greg Kroah-HartmanFrom: Stanley Chu <[email protected]>
[ Upstream commit f51913eef23f74c3bd07899dc7f1ed6df9e521d8 ]
In some cases, hba may go through shutdown flow without successful initialization and then make system hang.
For example, if ufshcd_change_power_mode() gets error and leads to ufshcd_hba_exit() to release resources of the host, future shutdown flow may hang the system since the host register will be accessed in unpowered state.
To solve this issue, simply add checking to skip shutdown for above kind of situation.
--- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/ufs/ufshcd.c +3 -0
@@ -8095,6 +8095,9 @@ int ufshcd_shutdown(struct ufs_hba *hba) {int ret =0 ; +if (!hba->is_powered) + goto out; +if (ufshcd_is_ufs_dev_poweroff (hba) &&ufshcd_is_link_off (hba)) goto out;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 7/197 scsi: megaraid: disable device when probe failed after enabled device
In reply to Greg Kroah-HartmanFrom: Xiang Chen <[email protected]>
[ Upstream commit 70054aa39a013fa52eff432f2223b8bd5c0048f8 ]
For pci device, need to disable device when probe failed after enabled device.
--- drivers/scsi/megaraid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/megaraid.c +2 -2
@@ -4183,11 +4183,11 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)*/ if (pdev->subsystem_vendor ==PCI_VENDOR_ID_COMPAQ && pdev->subsystem_device ==0xC000 ) -return -ENODEV ; + goto out_disable_device;/* Now check the magic signature byte */ pci_read_config_word (pdev,PCI_CONF_AMISIG , &magic);if (magic !=HBA_SIGNATURE_471 && magic !=HBA_SIGNATURE ) -return -ENODEV ; + goto out_disable_device;/* Ok it is probably a megaraid */ }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 8/197 scsi: qla2xxx: Silence fwdump template message
In reply to Greg Kroah-HartmanFrom: Himanshu Madhani <[email protected]>
[ Upstream commit 248a445adfc8c33ffd67cf1f2e336578e34f9e21 ]
Print if fwdt template is present or not, only when ql2xextended_error_logging is enabled.
--- drivers/scsi/qla2xxx/qla_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_init.c +1 -1
@@ -3268,7 +3268,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)for (j =0 ; j <2 ; j++, fwdt++) {if (!fwdt->template) { -ql_log (ql_log_warn, vha,0x00ba , +ql_dbg (ql_dbg_init, vha,0x00ba ,"-> fwdt%u no template\n" , j);continue ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 9/197 scsi: qla2xxx: Fix unbound sleep in fcport delete path.
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
[ Upstream commit c3b6a1d397420a0fdd97af2f06abfb78adc370df ]
There are instances, though rare, where a LOGO request cannot be sent out and the thread in free session done can wait indefinitely. Fix this by putting an upper bound to sleep.
--- drivers/scsi/qla2xxx/qla_target.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/qla2xxx/qla_target.c +4 -0
@@ -1021,6 +1021,7 @@ void qlt_free_session_done(struct work_struct *work)if (logout_started) {bool traced = false; +u16 cnt =0 ;while (!READ_ONCE (sess->logout_completed)) {if (!traced) {
@@ -1030,6 +1031,9 @@ void qlt_free_session_done(struct work_struct *work) traced = true; }msleep (100 ); + cnt++; +if (cnt >200 ) +break ; } ql_dbg(ql_dbg_disc, vha, 0xf087,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainercover 5.3.8-stable review
This is the start of the stable review cycle for the 5.3.8 release. There are 197 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 Tue 29 Oct 2019 08:27:02 PM UTC. 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.3.8-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.3.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.3.8-rc1
Greg KH <[email protected]>
RDMA/cxgb4: Do not dma memory off of the stack
Tejun Heo <[email protected]>
blk-rq-qos: fix first node deletion of rq_qos_del()
Chris Goldsworthy <[email protected]>
of: reserved_mem: add missing of_node_put() for proper ref-counting
Viresh Kumar <[email protected]>
opp: of: drop incorrect lockdep_assert_held()
Rafael J. Wysocki <[email protected]>
PCI: PM: Fix pci_power_up()
Juergen Gross <[email protected]>
xen/netback: fix error path of xenvif_connect_data()
Jeff Layton <[email protected]>
ceph: just skip unrecognized info in ceph_reply_info_extra
Rafael J. Wysocki <[email protected]>
cpufreq: Avoid cpufreq_suspend() deadlock on system shutdown
Christophe JAILLET <[email protected]>
memstick: jmb38x_ms: Fix an error handling path in 'jmb38x_ms_probe()'
Greg Kurz <[email protected]>
KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use
Qu Wenruo <[email protected]>
btrfs: tracepoints: Fix bad entry members of qgroup events
Qu Wenruo <[email protected]>
btrfs: tracepoints: Fix wrong parameter order for qgroup events
Filipe Manana <[email protected]>
Btrfs: check for the full sync flag while holding the inode lock during fsync
Filipe Manana <[email protected]>
Btrfs: fix qgroup double free after failure to reserve metadata for delalloc
David Sterba <[email protected]>
btrfs: don't needlessly create extent-refs kernel thread
Filipe Manana <[email protected]>
Btrfs: add missing extents release on file extent cluster relocation error
Qu Wenruo <[email protected]>
btrfs: block-group: Fix a memory leak due to missing btrfs_put_block_group()
Patrick Williams <[email protected]>
pinctrl: armada-37xx: swap polarity on LED group
Patrick Williams <[email protected]>
pinctrl: armada-37xx: fix control of pins 32 and up
Dmitry Torokhov <[email protected]>
pinctrl: cherryview: restore Strago DMI workaround for all versions
Roman Kagan <[email protected]>
x86/hyperv: Make vapic support x2apic mode
Sean Christopherson <[email protected]>
x86/apic/x2apic: Fix a NULL pointer deref when handling a dying cpu
Steve Wahl <[email protected]>
x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area
Marc Zyngier <[email protected]>
irqchip/sifive-plic: Switch to fasteoi flow
Mikulas Patocka <[email protected]>
dm cache: fix bugs when a GFP_NOWAIT allocation fails
Dan Williams <[email protected]>
fs/dax: Fix pmd vs pte conflict detection
Prateek Sood <[email protected]>
tracing: Fix race in perf_trace_buf initialization
Alexander Shishkin <[email protected]>
perf/aux: Fix AUX output stopping
Pavel Shilovsky <[email protected]>
CIFS: Fix use after free of file info structures
Chuhong Yuan <[email protected]>
cifs: Fix missed free operations
Roberto Bergantinos Corpas <[email protected]>
CIFS: avoid using MID 0xFFFF
Marc Zyngier <[email protected]>
arm64: Allow CAVIUM_TX2_ERRATUM_219 to be selected
Marc Zyngier <[email protected]>
arm64: Enable workaround for Cavium TX2 erratum 219 when running SMT
Marc Zyngier <[email protected]>
arm64: Avoid Cavium TX2 erratum 219 when switching TTBR
Marc Zyngier <[email protected]>
arm64: KVM: Trap VM ops when ARM64_WORKAROUND_CAVIUM_TX2_219_TVM is set
James Morse <[email protected]>
EDAC/ghes: Fix Use after free in ghes_edac remove path
Helge Deller <[email protected]>
parisc: Fix vmap memory leak in ioremap()/iounmap()
Thomas Gleixner <[email protected]>
lib/vdso: Make clock_getres() POSIX compliant again
Gerald Schaefer <[email protected]>
s390/kaslr: add support for R_390_GLOB_DAT relocation type
Johan Hovold <[email protected]>
s390/zcrypt: fix memleak at release
Max Filippov <[email protected]>
xtensa: fix change_bit in exclusive access option
Max Filippov <[email protected]>
xtensa: drop EXPORT_SYMBOL for outs*/ins*
Chenwandun <[email protected]>
zram: fix race between backing_dev_show and backing_dev_store
Jane Chu <[email protected]>
mm/memory-failure: poison read receives SIGKILL instead of SIGBUS if mmaped more than once
David Hildenbrand <[email protected]>
hugetlbfs: don't access uninitialized memmaps in pfn_range_valid_gigantic()
Mike Rapoport <[email protected]>
mm: memblock: do not enforce current limit for memblock_phys* family
Honglei Wang <[email protected]>
mm: memcg: get number of pages on the LRU list in memcgroup base on lru_zone_size
Vlastimil Babka <[email protected]>
mm, compaction: fix wrong pfn handling in __reset_isolation_pfn()
Roman Gushchin <[email protected]>
mm: memcg/slab: fix panic in __free_slab() caused by premature memcg pointer release
Aneesh Kumar K.V <[email protected]>
mm/memunmap: don't access uninitialized memmap in memunmap_pages()
David Hildenbrand <[email protected]>
mm/memory_hotplug: don't access uninitialized memmaps in shrink_pgdat_span()
Qian Cai <[email protected]>
mm/page_owner: don't access uninitialized memmaps when reading /proc/pagetypeinfo
Qian Cai <[email protected]>
mm/slub: fix a deadlock in show_slab_objects()
David Hildenbrand <[email protected]>
mm/memory-failure.c: don't access uninitialized memmaps in memory_failure()
Faiz Abbas <[email protected]>
mmc: sdhci-omap: Fix Tuning procedure for temperatures < -20C
Faiz Abbas <[email protected]>
mmc: cqhci: Commit descriptors before setting the doorbell
Sascha Hauer <[email protected]>
mmc: mxs: fix flags passed to dmaengine_prep_slave_sg
Jens Axboe <[email protected]>
io_uring: used cached copies of sq->dropped and cq->overflow
Pavel Begunkov <[email protected]>
io_uring: Fix race for sqes with userspace
Pavel Begunkov <[email protected]>
io_uring: Fix broken links with offloading
David Hildenbrand <[email protected]>
fs/proc/page.c: don't access uninitialized memmaps in fs/proc/page.c
David Hildenbrand <[email protected]>
drivers/base/memory.c: don't access uninitialized memmaps in soft_offline_page_store()
Philip Yang <[email protected]>
drm/amdgpu: user pages array memory leak fix
Alex Deucher <[email protected]>
drm/amdgpu/uvd7: fix allocation size in enc ring test (v2)
Alex Deucher <[email protected]>
drm/amdgpu/uvd6: fix allocation size in enc ring test (v2)
Alex Deucher <[email protected]>
drm/amdgpu/vcn: fix allocation size in enc ring test
Alex Deucher <[email protected]>
drm/amdgpu/vce: fix allocation size in enc ring test
Ville Syrjälä <[email protected]>
drm/i915: Favor last VBT child device with conflicting AUX ch/DDC pin
Chris Wilson <[email protected]>
drm/i915/userptr: Never allow userptr into the mappable GGTT
Xiaojie Yuan <[email protected]>
drm/amdgpu/sdma5: fix mask value of POLL_REGMEM packet for pipe sync
Hans de Goede <[email protected]>
drm/amdgpu: Bail earlier when amdgpu.cik_/si_support is not set to 1
Steven Price <[email protected]>
drm/panfrost: Handle resetting on timeout better
Thomas Hellstrom <[email protected]>
drm/ttm: Restore ttm prefaulting
Kai-Heng Feng <[email protected]>
drm/edid: Add 6 bpc quirk for SDC panel in Lenovo G50
Will Deacon <[email protected]>
mac80211: Reject malformed SSID elements
Will Deacon <[email protected]>
cfg80211: wext: avoid copying malformed SSIDs
Luca Coelho <[email protected]>
iwlwifi: pcie: change qu with jf devices to use qu configuration
Dan Carpenter <[email protected]>
ACPI: NFIT: Fix unlock on error in scrub_show()
John Garry <[email protected]>
ACPI: CPPC: Set pcc_data[pcc_ss_id] to NULL in acpi_cppc_processor_exit()
Junya Monden <[email protected]>
ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting
Dixit Parmar <[email protected]>
Input: st1232 - fix reporting multitouch coordinates
Evan Green <[email protected]>
Input: synaptics-rmi4 - avoid processing unknown IRQs
Marco Felsch <[email protected]>
Input: da9063 - fix capability and drop KEY_SLEEP
Kai-Heng Feng <[email protected]>
Revert "Input: elantech - enable SMBus on new (2018+) systems"
Bart Van Assche <[email protected]>
scsi: ch: Make it possible to open a ch device multiple times again
Yufen Yu <[email protected]>
scsi: core: try to get module before removing device
Damien Le Moal <[email protected]>
scsi: core: save/restore command resid for error handling
Oliver Neukum <[email protected]>
scsi: sd: Ignore a failure to sync cache due to lack of authorization
Steffen Maier <[email protected]>
scsi: zfcp: fix reaction on bit error threshold notification
Colin Ian King <[email protected]>
staging: wlan-ng: fix exit return when sme->key_idx >= NUM_WEPKEYS
Paul Burton <[email protected]>
MIPS: tlbex: Fix build_restore_pagemask KScratch restore
Jann Horn <[email protected]>
binder: Don't modify VMA bounds in ->mmap handler
Johan Hovold <[email protected]>
USB: ldusb: fix read info leaks
Johan Hovold <[email protected]>
USB: usblp: fix use-after-free on disconnect
Johan Hovold <[email protected]>
USB: ldusb: fix memleak on disconnect
Johan Hovold <[email protected]>
USB: serial: ti_usb_3410_5052: fix port-close races
Gustavo A. R. Silva <[email protected]>
usb: udc: lpc32xx: fix bad bit shift operation
Lukas Wunner <[email protected]>
ALSA: hda - Force runtime PM on Nvidia HDMI codecs
Szabolcs Szőke <[email protected]>
ALSA: usb-audio: Disable quirks for BOSS Katana amplifiers
Daniel Drake <[email protected]>
ALSA: hda/realtek - Enable headset mic on Asus MJ401TA
Kailang Yang <[email protected]>
ALSA: hda/realtek - Add support for ALC711
Johan Hovold <[email protected]>
USB: legousbtower: fix memleak on disconnect
Pavel Begunkov <[email protected]>
io_uring: Fix corrupted user_data
Jens Axboe <[email protected]>
io_uring: fix bad inflight accounting for SETUP_IOPOLL|SETUP_SQTHREAD
Eric Dumazet <[email protected]>
rxrpc: use rcu protection while reading sk->sk_user_data
Micah Morton <[email protected]>
LSM: SafeSetID: Stop releasing uninitialized ruleset
Yonglong Liu <[email protected]>
net: phy: Fix "link partner" information disappear issue
Randy Dunlap <[email protected]>
net: ethernet: broadcom: have drivers select DIMLIB as needed
YueHaibing <[email protected]>
netdevsim: Fix error handling in nsim_fib_init and nsim_fib_exit
Davide Caratti <[email protected]>
net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
Davide Caratti <[email protected]>
net: avoid errors when trying to pop MLPS header on non-MPLS packets
Marek Vasut <[email protected]>
net: phy: micrel: Update KSZ87xx PHY name
Marek Vasut <[email protected]>
net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
Dmitry Bogdanov <[email protected]>
net: aquantia: correctly handle macvlan and multicast coexistence
Dmitry Bogdanov <[email protected]>
net: aquantia: do not pass lro session with invalid tcp checksum
Igor Russkikh <[email protected]>
net: aquantia: when cleaning hw cache it should be toggled
Igor Russkikh <[email protected]>
net: aquantia: temperature retrieval fix
Xin Long <[email protected]>
sctp: change sctp_prot .no_autobind with true
Vinicius Costa Gomes <[email protected]>
sched: etf: Fix ordering of packets with same txtime
David Howells <[email protected]>
rxrpc: Fix possible NULL pointer access in ICMP handling
Biao Huang <[email protected]>
net: stmmac: disable/enable ptp_ref_clk in suspend/resume flow
Xin Long <[email protected]>
net: ipv6: fix listify ip6_rcv_finish in case of forwarding
Cédric Le Goater <[email protected]>
net/ibmvnic: Fix EOI when running in XIVE mode.
Thomas Bogendoerfer <[email protected]>
net: i82596: fix dma_alloc_attr for sni_82596
Florian Fainelli <[email protected]>
net: bcmgenet: Set phydev->dev_flags only for internal PHYs
Florian Fainelli <[email protected]>
net: bcmgenet: Fix RGMII_MODE_EN value for GENET v1/2/3
Eric Dumazet <[email protected]>
net: avoid potential infinite loop in tc_ctl_action()
Stefano Brivio <[email protected]>
ipv4: Return -ENETUNREACH if we can't create route but saddr is valid
Wei Wang <[email protected]>
ipv4: fix race condition between route lookup and invalidation
Kevin Hao <[email protected]>
nvme-pci: Set the prp2 correctly when using more than 4k page
Yi Li <[email protected]>
ocfs2: fix panic due to ocfs2_wq is null
Alex Deucher <[email protected]>
Revert "drm/radeon: Fix EEH during kexec"
Song Liu <[email protected]>
md/raid0: fix warning message for parameter default_layout
Dan Williams <[email protected]>
libata/ahci: Fix PCS quirk application
Cong Wang <[email protected]>
net_sched: fix backward compatibility for TCA_ACT_KIND
Cong Wang <[email protected]>
net_sched: fix backward compatibility for TCA_KIND
Linus Torvalds <[email protected]>
filldir[64]: remove WARN_ON_ONCE() for bad directory entries
Linus Torvalds <[email protected]>
uaccess: implement a proper unsafe_copy_to_user() and switch filldir over to it
Linus Torvalds <[email protected]>
Make filldir[64]() verify the directory entry filename is valid
Linus Torvalds <[email protected]>
elf: don't use MAP_FIXED_NOREPLACE for elf executable mappings
Linus Torvalds <[email protected]>
Convert filldir[64]() from __put_user() to unsafe_put_user()
Jacob Keller <[email protected]>
namespace: fix namespace.pl script to support relative paths
Russell King <[email protected]>
net: phy: fix write to mii-ctrl1000 register
Andrea Merello <[email protected]>
net: phy: allow for reset line to be tied to a sleepy GPIO controller
Kai-Heng Feng <[email protected]>
r8152: Set macpassthru in reset_resume callback
Qian Cai <[email protected]>
s390/mm: fix -Wunused-but-set-variable warnings
Randy Dunlap <[email protected]>
lib: textsearch: fix escapes in example code
Shuah Khan <[email protected]>
selftests: kvm: Fix libkvm build error
Thierry Reding <[email protected]>
net: stmmac: Avoid deadlock on suspend/resume
Yizhuo <[email protected]>
net: hisilicon: Fix usage of uninitialized variable in function mdio_sc_cfg_reg_write()
Christophe JAILLET <[email protected]>
mips: Loongson: Fix the link time qualifier of 'serial_exit()'
Navid Emamdoost <[email protected]>
drm/amd/display: memory leak
Navid Emamdoost <[email protected]>
drm/amdgpu: fix multiple memory leaks in acp_hw_init
Albert Ou <[email protected]>
riscv: Fix memblock reservation for device tree blob
Palmer Dabbelt <[email protected]>
RISC-V: Clear load reservations while restoring hart contexts
Oleksij Rempel <[email protected]>
net: ag71xx: fix mdio subnode support
Jose Abreu <[email protected]>
net: stmmac: Do not stop PHY if WoL is enabled
Jose Abreu <[email protected]>
net: stmmac: Correctly take timestamp for PTPv2
Jose Abreu <[email protected]>
net: stmmac: dwmac4: Always update the MAC Hash Filter
Jose Abreu <[email protected]>
net: stmmac: xgmac: Not all Unicast addresses may be available
Wen Yang <[email protected]>
net: dsa: rtl8366rb: add missing of_node_put after calling of_get_child_by_name
Wen Yang <[email protected]>
net: mscc: ocelot: add missing of_node_put after calling of_get_child_by_name
Pablo Neira Ayuso <[email protected]>
netfilter: nft_connlimit: disable bh on garbage collection
Miaoqing Pan <[email protected]>
mac80211: fix txq null pointer dereference
Miaoqing Pan <[email protected]>
nl80211: fix null pointer dereference
Martijn Coenen <[email protected]>
loop: change queue block size to match when using DIO
Ross Lagerwall <[email protected]>
xen/efi: Set nonblocking callbacks
Oleksij Rempel <[email protected]>
MIPS: dts: ar9331: fix interrupt-controller size
Michal Vokáč <[email protected]>
net: dsa: qca8k: Use up to 7 ports for all operations
Peter Ujfalusi <[email protected]>
ARM: dts: am4372: Set memory bandwidth limit for DISPC
Navid Emamdoost <[email protected]>
ieee802154: ca8210: prevent memory leak
Ming Lei <[email protected]>
blk-mq: honor IO scheduler for multiqueue devices
Sagi Grimberg <[email protected]>
nvme-rdma: fix possible use-after-free in connect timeout
Navid Emamdoost <[email protected]>
drm/komeda: prevent memory leak in komeda_wb_connector_add
Marta Rybczynska <[email protected]>
nvme: allow 64-bit results in passthru commands
Jian-Hong Pan <[email protected]>
nvme: Add quirk for Kingston NVME SSD running FW E8FK11.T
Gabriel Craciunescu <[email protected]>
Added QUIRKs for ADATA XPG SX8200 Pro 512GB
Max Gurtovoy <[email protected]>
nvme-rdma: Fix max_hw_sectors calculation
Dan Carpenter <[email protected]>
nvme: fix an error code in nvme_init_subsystem()
Mario Limonciello <[email protected]>
nvme-pci: Save PCI state before putting drive into deepest state
Wunderlich, Mark <[email protected]>
nvme-tcp: fix wrong stop condition in io_work
Tony Lindgren <[email protected]>
ARM: OMAP2+: Fix warnings with broken omap2_set_init_voltage()
Tony Lindgren <[email protected]>
ARM: OMAP2+: Add missing LCDC midlemode for am335x
Tony Lindgren <[email protected]>
ARM: OMAP2+: Fix missing reset done flag for am3 and am43
Tony Lindgren <[email protected]>
ARM: dts: Fix gpio0 flags for am335x-icev2
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix N2N link up fail
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix N2N link reset
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix stale mem access on driver unload
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix unbound sleep in fcport delete path.
Himanshu Madhani <[email protected]>
scsi: qla2xxx: Silence fwdump template message
Xiang Chen <[email protected]>
scsi: megaraid: disable device when probe failed after enabled device
Stanley Chu <[email protected]>
scsi: ufs: skip shutdown if hba is not powered
Balbir Singh <[email protected]>
nvme-pci: Fix a race in controller removal
Tony Lindgren <[email protected]>
ARM: dts: Fix wrong clocks for dra7 mcasp
Tony Lindgren <[email protected]>
clk: ti: dra7: Fix mcasp8 clock bits
Lowry Li (Arm Technology China) <[email protected]>
drm: Clear the fence pointer when writeback job signaled
Lowry Li (Arm Technology China) <[email protected]>
drm: Free the writeback_job when it with an empty fb
-------------
Diffstat:
Documentation/arm64/silicon-errata.rst | 2 + Makefile | 4 +- arch/arm/boot/dts/am335x-icev2.dts | 2 +- arch/arm/boot/dts/am33xx-l4.dtsi | 6 +- arch/arm/boot/dts/am4372.dtsi | 2 + arch/arm/boot/dts/dra7-l4.dtsi | 48 ++-- .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 3 +- arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 5 +- arch/arm/mach-omap2/pm.c | 100 -------- arch/arm/xen/efi.c | 2 + arch/arm64/Kconfig | 17 ++ arch/arm64/include/asm/cpucaps.h | 4 +- arch/arm64/kernel/cpu_errata.c | 38 +++ arch/arm64/kernel/entry.S | 2 + arch/arm64/kvm/hyp/switch.c | 69 +++++- arch/mips/boot/dts/qca/ar9331.dtsi | 2 +- arch/mips/loongson64/common/serial.c | 2 +- arch/mips/mm/tlbex.c | 23 +- arch/parisc/mm/ioremap.c | 12 +- arch/powerpc/kvm/book3s_xive.c | 24 +- arch/powerpc/kvm/book3s_xive.h | 12 + arch/powerpc/kvm/book3s_xive_native.c | 6 +- arch/riscv/include/asm/asm.h | 1 + arch/riscv/kernel/entry.S | 21 +- arch/riscv/mm/init.c | 12 +- arch/s390/boot/startup.c | 14 +- arch/s390/include/asm/hugetlb.h | 9 +- arch/s390/include/asm/pgtable.h | 3 +- arch/s390/kernel/machine_kexec_reloc.c | 1 + arch/x86/hyperv/hv_apic.c | 20 +- arch/x86/include/asm/uaccess.h | 23 ++ arch/x86/kernel/apic/x2apic_cluster.c | 3 +- arch/x86/kernel/head64.c | 22 +- arch/x86/xen/efi.c | 2 + arch/xtensa/include/asm/bitops.h | 2 +- arch/xtensa/kernel/xtensa_ksyms.c | 7 - block/blk-mq.c | 6 +- block/blk-rq-qos.h | 13 +- drivers/acpi/cppc_acpi.c | 2 +- drivers/acpi/nfit/core.c | 2 +- drivers/android/binder.c | 7 - drivers/android/binder_alloc.c | 6 +- drivers/ata/ahci.c | 4 +- drivers/base/core.c | 3 + drivers/base/memory.c | 3 + drivers/block/loop.c | 10 + drivers/block/zram/zram_drv.c | 5 +- drivers/clk/ti/clk-7xx.c | 6 +- drivers/cpufreq/cpufreq.c | 10 - drivers/edac/ghes_edac.c | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 34 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 8 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 35 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 35 --- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 20 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 35 ++- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 31 ++- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 33 ++- .../drm/amd/display/dc/dce100/dce100_resource.c | 1 + .../drm/amd/display/dc/dce110/dce110_resource.c | 1 + .../drm/amd/display/dc/dce112/dce112_resource.c | 1 + .../drm/amd/display/dc/dce120/dce120_resource.c | 1 + .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + .../gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 1 + .../drm/arm/display/komeda/komeda_wb_connector.c | 7 +- drivers/gpu/drm/arm/malidp_mw.c | 4 +- drivers/gpu/drm/drm_atomic.c | 13 +- drivers/gpu/drm/drm_edid.c | 3 + drivers/gpu/drm/drm_writeback.c | 23 +- drivers/gpu/drm/i915/display/intel_bios.c | 22 +- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 + drivers/gpu/drm/i915/gem/i915_gem_object.h | 6 + drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 3 +- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 1 + drivers/gpu/drm/i915/i915_gem.c | 3 + drivers/gpu/drm/panfrost/panfrost_job.c | 16 +- drivers/gpu/drm/radeon/radeon_drv.c | 8 - drivers/gpu/drm/rcar-du/rcar_du_writeback.c | 4 +- drivers/gpu/drm/ttm/ttm_bo_vm.c | 16 +- drivers/gpu/drm/vc4/vc4_txp.c | 5 +- drivers/infiniband/hw/cxgb4/mem.c | 28 ++- drivers/input/misc/da9063_onkey.c | 5 +- drivers/input/mouse/elantech.c | 55 +++-- drivers/input/rmi4/rmi_driver.c | 6 +- drivers/input/touchscreen/st1232.c | 6 +- drivers/irqchip/irq-sifive-plic.c | 29 +-- drivers/md/dm-cache-target.c | 28 +-- drivers/md/raid0.c | 2 +- drivers/memstick/host/jmb38x_ms.c | 2 +- drivers/mmc/host/cqhci.c | 3 +- drivers/mmc/host/mxs-mmc.c | 7 +- drivers/mmc/host/sdhci-omap.c | 2 +- drivers/net/dsa/qca8k.c | 4 +- drivers/net/dsa/rtl8366rb.c | 16 +- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 4 +- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 32 +-- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 3 +- .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 23 +- .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c | 17 +- .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h | 7 +- .../aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | 19 ++ .../aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c | 2 +- drivers/net/ethernet/atheros/ag71xx.c | 6 +- drivers/net/ethernet/broadcom/Kconfig | 4 +- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 + drivers/net/ethernet/broadcom/genet/bcmmii.c | 11 +- drivers/net/ethernet/hisilicon/hns_mdio.c | 6 +- drivers/net/ethernet/i825xx/lasi_82596.c | 4 +- drivers/net/ethernet/i825xx/lib82596.c | 4 +- drivers/net/ethernet/i825xx/sni_82596.c | 4 +- drivers/net/ethernet/ibm/ibmvnic.c | 8 +- drivers/net/ethernet/mscc/ocelot_board.c | 14 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 13 +- .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 37 ++- drivers/net/ieee802154/ca8210.c | 2 +- drivers/net/netdevsim/fib.c | 3 +- drivers/net/phy/mdio_device.c | 2 +- drivers/net/phy/micrel.c | 42 +++- drivers/net/phy/phy-c45.c | 2 + drivers/net/phy/phy.c | 8 +- drivers/net/phy/phy_device.c | 9 +- drivers/net/usb/r8152.c | 3 +- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 274 ++++++++++----------- drivers/net/xen-netback/interface.c | 1 - drivers/nvme/host/core.c | 128 ++++++++-- drivers/nvme/host/pci.c | 23 +- drivers/nvme/host/rdma.c | 19 +- drivers/nvme/host/tcp.c | 4 +- drivers/of/of_reserved_mem.c | 4 +- drivers/opp/of.c | 2 - drivers/pci/pci.c | 24 +- drivers/pinctrl/intel/pinctrl-cherryview.c | 4 - drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 26 +- drivers/s390/crypto/zcrypt_api.c | 3 +- drivers/s390/scsi/zfcp_fsf.c | 16 +- drivers/scsi/ch.c | 1 - drivers/scsi/megaraid.c | 4 +- drivers/scsi/qla2xxx/qla_def.h | 3 +- drivers/scsi/qla2xxx/qla_init.c | 109 +++++--- drivers/scsi/qla2xxx/qla_mbx.c | 25 +- drivers/scsi/qla2xxx/qla_os.c | 11 +- drivers/scsi/qla2xxx/qla_target.c | 25 +- drivers/scsi/scsi_error.c | 3 + drivers/scsi/scsi_sysfs.c | 11 +- drivers/scsi/sd.c | 3 +- drivers/scsi/ufs/ufshcd.c | 3 + drivers/staging/wlan-ng/cfg80211.c | 6 +- drivers/usb/class/usblp.c | 4 +- drivers/usb/gadget/udc/lpc32xx_udc.c | 6 +- drivers/usb/misc/ldusb.c | 23 +- drivers/usb/misc/legousbtower.c | 5 +- drivers/usb/serial/ti_usb_3410_5052.c | 10 +- fs/binfmt_elf.c | 13 +- fs/btrfs/ctree.h | 2 - fs/btrfs/delalloc-space.c | 1 - fs/btrfs/disk-io.c | 6 - fs/btrfs/extent-tree.c | 1 + fs/btrfs/file.c | 36 ++- fs/btrfs/qgroup.c | 4 +- fs/btrfs/relocation.c | 2 + fs/ceph/mds_client.c | 21 +- fs/cifs/file.c | 6 +- fs/cifs/inode.c | 4 +- fs/cifs/smb1ops.c | 3 + fs/dax.c | 5 +- fs/io_uring.c | 120 +++++---- fs/ocfs2/journal.c | 3 +- fs/ocfs2/localalloc.c | 3 +- fs/proc/page.c | 28 ++- fs/readdir.c | 128 +++++++--- include/linux/micrel_phy.h | 2 +- include/linux/mii.h | 9 + include/linux/skbuff.h | 5 +- include/linux/uaccess.h | 6 +- include/scsi/scsi_eh.h | 1 + include/trace/events/btrfs.h | 3 +- include/uapi/linux/nvme_ioctl.h | 23 ++ kernel/events/core.c | 2 +- kernel/trace/trace_event_perf.c | 4 + lib/textsearch.c | 4 +- lib/vdso/gettimeofday.c | 9 +- mm/compaction.c | 7 +- mm/hugetlb.c | 5 +- mm/memblock.c | 6 +- mm/memory-failure.c | 36 +-- mm/memory_hotplug.c | 72 ++---- mm/memremap.c | 11 +- mm/page_owner.c | 5 +- mm/slab_common.c | 9 +- mm/slub.c | 13 +- mm/vmscan.c | 9 +- net/core/skbuff.c | 21 +- net/ipv4/route.c | 11 +- net/ipv6/ip6_input.c | 4 +- net/mac80211/debugfs_netdev.c | 11 +- net/mac80211/mlme.c | 5 +- net/netfilter/nft_connlimit.c | 7 +- net/openvswitch/actions.c | 5 +- net/rxrpc/peer_event.c | 11 +- net/sched/act_api.c | 23 +- net/sched/act_mpls.c | 12 +- net/sched/cls_api.c | 36 ++- net/sched/sch_api.c | 3 +- net/sched/sch_etf.c | 2 +- net/sctp/socket.c | 4 +- net/wireless/nl80211.c | 3 + net/wireless/wext-sme.c | 8 +- scripts/namespace.pl | 13 +- security/safesetid/securityfs.c | 3 +- sound/pci/hda/patch_hdmi.c | 2 + sound/pci/hda/patch_realtek.c | 14 ++ sound/soc/sh/rcar/core.c | 1 + sound/usb/pcm.c | 3 + tools/testing/selftests/kvm/Makefile | 2 +- 218 files changed, 1919 insertions(+), 1165 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 39/197 net: stmmac: dwmac4: Always update the MAC Hash Filter
From: Jose Abreu <[email protected]>
[ Upstream commit f79bfda3756c50a86c0ee65091935c42c5bbe0cb ]
We need to always update the MAC Hash Filter so that previous entries are invalidated.
Found out while running stmmac selftests.
--- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +7 -6
@@ -407,8 +407,11 @@ static void dwmac4_set_filter(struct mac_device_info *hw,int numhashregs = (hw->multicast_filter_bins >>5 );int mcbitslog2 = hw->mcast_bits_log2;unsigned int value; +u32 mc_filter[8 ];int i; +memset (mc_filter,0 ,sizeof (mc_filter)); + value =readl (ioaddr +GMAC_PACKET_FILTER ); value &= ~GMAC_PACKET_FILTER_HMC ; value &= ~GMAC_PACKET_FILTER_HPF ;
@@ -422,16 +425,13 @@ static void dwmac4_set_filter(struct mac_device_info *hw,/* Pass all multi */ value |=GMAC_PACKET_FILTER_PM ;/* Set all the bits of the HASH tab */ -for (i =0 ; i < numhashregs; i++) -writel (0xffffffff , ioaddr +GMAC_HASH_TAB (i)); +memset (mc_filter,0xff ,sizeof (mc_filter)); }else if (!netdev_mc_empty (dev)) {struct netdev_hw_addr *ha; -u32 mc_filter[8 ];/* Hash filter for multicast */ value |=GMAC_PACKET_FILTER_HMC ; -memset (mc_filter,0 ,sizeof (mc_filter));netdev_for_each_mc_addr (ha, dev) {/* The upper n bits of the calculated CRC are used to * index the contents of the hash table. The number of
@@ -446,10 +446,11 @@ static void dwmac4_set_filter(struct mac_device_info *hw,*/ mc_filter[bit_nr >>5 ] |= (1 << (bit_nr &0x1f )); } -for (i =0 ; i < numhashregs; i++) -writel (mc_filter[i], ioaddr +GMAC_HASH_TAB (i)); } +for (i =0 ; i < numhashregs; i++) +writel (mc_filter[i], ioaddr +GMAC_HASH_TAB (i)); + value |=GMAC_PACKET_FILTER_HPF ;/* Handle multiple unicast addresses */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 51/197 lib: textsearch: fix escapes in example code
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 2105b52e30debe7f19f3218598d8ae777dcc6776 ]
This textsearch code example does not need the '\' escapes and they can be misleading to someone reading the example. Also, gcc and sparse warn that the "\%d" is an unknown escape sequence.
--- lib/textsearch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/textsearch.c +2 -2
@@ -89,9 +89,9 @@* goto errout; * } * -* pos = textsearch_find_continuous(conf, \&state, example, strlen(example)); +* pos = textsearch_find_continuous(conf, &state, example, strlen(example)); * if (pos != UINT_MAX) -* panic("Oh my god, dancing chickens at \%d\n", pos); +* panic("Oh my god, dancing chickens at %d\n", pos); * * textsearch_destroy(conf); */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 50/197 selftests: kvm: Fix libkvm build error
In reply to Greg Kroah-HartmanFrom: Shuah Khan <[email protected]>
[ Upstream commit 6e06983dde969c15eb4fdab77f0eda8b18ea28e6 ]
Fix the following build error from "make TARGETS=kvm kselftest":
libkvm.a(assert.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
This error is seen when build is done from the main Makefile using kselftest target. In this case KBUILD_CPPFLAGS and CC_OPTION_CFLAGS are defined.
When build is invoked using:
"make -C tools/testing/selftests/kvm" KBUILD_CPPFLAGS and CC_OPTION_CFLAGS aren't defined.
There is no need to pass in KBUILD_CPPFLAGS and CC_OPTION_CFLAGS for the check to determine if --no-pie is necessary, which is the case when these two aren't defined when "make -C tools/testing/selftests/kvm" runs.
Fix it by simplifying the no-pie-option logic. With this change, both build variations work.
"make TARGETS=kvm kselftest"
"make -C tools/testing/selftests/kvm"
--- tools/testing/selftests/kvm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/Makefile +1 -1
@@ -46,7 +46,7 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I.. no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \ - $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie) + $(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie) # On s390, build the testcases KVM-enabled pgste-option = $(call try-run, echo 'int main() { return 0; }' | \
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 52/197 s390/mm: fix -Wunused-but-set-variable warnings
In reply to Greg Kroah-HartmanFrom: Qian Cai <[email protected]>
[ Upstream commit 51ce02216d4ad4e8f6a58de81d6e803cf04c418e ]
Convert two functions to static inline to get ride of W=1 GCC warnings like,
mm/gup.c: In function 'gup_pte_range':mm/gup.c:1816:16: warning: variable 'ptem' set but not used [-Wunused-but-set-variable]
pte_t *ptep, *ptem;
^~~~mm/mmap.c: In function 'acct_stack_growth':mm/mmap.c:2322:16: warning: variable 'new_start' set but not used [-Wunused-but-set-variable]
unsigned long new_start;
^~~~~~~~~--- arch/s390/include/asm/hugetlb.h | 9 +++++++-- arch/s390/include/asm/pgtable.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-)
arch/s390/include/asm/hugetlb.h +7 -2
@@ -12,8 +12,6 @@#include <asm/page.h> #include <asm/pgtable.h> - -#define is_hugepage_only_range (mm, addr, len) 0#define hugetlb_free_pgd_range free_pgd_range#define hugepages_supported () (MACHINE_HAS_EDAT1)
@@ -23,6 +21,13 @@ pte_t huge_ptep_get(pte_t *ptep);pte_t huge_ptep_get_and_clear (struct mm_struct *mm,unsigned long addr,pte_t *ptep); +static inline bool is_hugepage_only_range (struct mm_struct *mm, +unsigned long addr, +unsigned long len) +{ +return false; +} +/* * If the arch doesn't supply something else, assume that hugepage * size aligned regions are ok without further preparation.
arch/s390/include/asm/pgtable.h +2 -1
@@ -1268,7 +1268,8 @@ static inline pte_t *pte_offset(pmd_t *pmd, unsigned long address)#define pte_offset_kernel (pmd, address) pte_offset(pmd, address)#define pte_offset_map (pmd, address) pte_offset_kernel(pmd, address) -#define pte_unmap (pte) do { } while (0) + +static inline void pte_unmap (pte_t *pte) { }static inline bool gup_fast_permitted (unsigned long start,unsigned long end) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 54/197 net: phy: allow for reset line to be tied to a sleepy GPIO controller
In reply to Greg Kroah-HartmanFrom: Andrea Merello <[email protected]>
[ Upstream commit ea977d19d918324ad5b66953f051a6ed07d0a3c5 ]
mdio_device_reset() makes use of the atomic-pretending API flavor for handling the PHY reset GPIO line.
I found no hint that mdio_device_reset() is called from atomic context and indeed it uses usleep_range() since long time, so I would assume that it is OK to sleep there.
This patch switch to gpiod_set_value_cansleep() in mdio_device_reset(). This is relevant if e.g. the PHY reset line is tied to a I2C GPIO controller.
This has been tested on a ZynqMP board running an upstream 4.19 kernel and then hand-ported on current kernel tree.
--- drivers/net/phy/mdio_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/mdio_device.c +1 -1
@@ -121,7 +121,7 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value)return ;if (mdiodev->reset_gpio) -gpiod_set_value (mdiodev->reset_gpio, value); +gpiod_set_value_cansleep (mdiodev->reset_gpio, value);if (mdiodev->reset_ctrl) {if (value)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 55/197 net: phy: fix write to mii-ctrl1000 register
In reply to Greg Kroah-HartmanFrom: Russell King <[email protected]>
[ Upstream commit 4cf6c57e61fee954f7b7685de31b80ec26843d27 ]
When userspace writes to the MII_ADVERTISE register, we update phylib's advertising mask and trigger a renegotiation. However, writing to the MII_CTRL1000 register, which contains the gigabit advertisement, does neither. This can lead to phylib's copy of the advertisement becoming de-synced with the values in the PHY register set, which can result in incorrect negotiation resolution.
--- drivers/net/phy/phy.c | 5 +++++ include/linux/mii.h | 9 +++++++++ 2 files changed, 14 insertions(+)
drivers/net/phy/phy.c +5 -0
@@ -457,6 +457,11 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd) val); change_autoneg = true;break ; +case MII_CTRL1000 : +mii_ctrl1000_mod_linkmode_adv_t (phydev->advertising, + val); + change_autoneg = true; +break ;default :/* do nothing */ break ;
include/linux/mii.h +9 -0
@@ -455,6 +455,15 @@ static inline void mii_lpa_mod_linkmode_lpa_t(unsigned long *lp_advertising, lp_advertising, lpa & LPA_LPACK); } +static inline void mii_ctrl1000_mod_linkmode_adv_t (unsigned long *advertising, +u32 ctrl1000) +{ +linkmode_mod_bit (ETHTOOL_LINK_MODE_1000baseT_Half_BIT, advertising, + ctrl1000 &ADVERTISE_1000HALF ); +linkmode_mod_bit (ETHTOOL_LINK_MODE_1000baseT_Full_BIT, advertising, + ctrl1000 &ADVERTISE_1000FULL ); +} +/** * linkmode_adv_to_lcl_adv_t * @advertising:pointer to linkmode advertising
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 56/197 namespace: fix namespace.pl script to support relative paths
In reply to Greg Kroah-HartmanFrom: Jacob Keller <[email protected]>
[ Upstream commit 82fdd12b95727640c9a8233c09d602e4518e71f7 ]
The namespace.pl script does not work properly if objtree is not set to an absolute path. The do_nm function is run from within the find function, which changes directories.
Because of this, appending objtree, $File::Find::dir, and $source, will return a path which is not valid from the current directory.
This used to work when objtree was set to an absolute path when using "make namespacecheck". It appears to have not worked when calling ./scripts/namespace.pl directly.
This behavior was changed in 7e1c04779efd ("kbuild: Use relative path for $(objtree)", 2014-05-14)
Rather than fixing the Makefile to set objtree to an absolute path, just fix namespace.pl to work when srctree and objtree are relative. Also fix the script to use an absolute path for these by default.
Use the File::Spec module for this purpose. It's been part of perl 5 since 5.005.
The curdir() function is used to get the current directory when the objtree and srctree aren't set in the environment.
rel2abs() is used to convert possibly relative objtree and srctree environment variables to absolute paths.
Finally, the catfile() function is used instead of string appending paths together, since this is more robust when joining paths together.
--- scripts/namespace.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
scripts/namespace.pl +7 -6
@@ -65,13 +65,14 @@ use warnings; use strict; use File::Find; +use File::Spec; my $nm = ($ENV{'NM'} || "nm") . " -p"; my $objdump = ($ENV{'OBJDUMP'} || "objdump") . " -s -j .comment"; -my $srctree = ""; -my $objtree = ""; -$srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'})); -$objtree = "$ENV{'objtree'}/" if (exists($ENV{'objtree'})); +my $srctree = File::Spec->curdir(); +my $objtree = File::Spec->curdir(); +$srctree = File::Spec->rel2abs($ENV{'srctree'}) if (exists($ENV{'srctree'})); +$objtree = File::Spec->rel2abs($ENV{'objtree'}) if (exists($ENV{'objtree'})); if ($#ARGV != -1) { print STDERR "usage: $0 takes no parameters\n";
@@ -231,9 +232,9 @@ sub do_nm } ($source = $basename) =~ s/\.o$//; if (-e "$source.c" || -e "$source.S") { - $source = "$objtree$File::Find::dir/$source"; + $source = File::Spec->catfile($objtree, $File::Find::dir, $source) } else { - $source = "$srctree$File::Find::dir/$source"; + $source = File::Spec->catfile($srctree, $File::Find::dir, $source) } if (! -e "$source.c" && ! -e "$source.S") { # No obvious source, exclude the object if it is conglomerate
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 40/197 net: stmmac: Correctly take timestamp for PTPv2
In reply to Greg Kroah-HartmanFrom: Jose Abreu <[email protected]>
[ Upstream commit 14f347334bf232074616e29e29103dd0c7c54dec ]
The case for PTPV2_EVENT requires event packets to be captured so add this setting to the list of enabled captures.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -0
@@ -626,6 +626,7 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr) config.rx_filter =HWTSTAMP_FILTER_PTP_V2_EVENT ; ptp_v2 =PTP_TCR_TSVER2ENA ; snap_type_sel =PTP_TCR_SNAPTYPSEL_1 ; + ts_event_en =PTP_TCR_TSEVNTENA ; ptp_over_ipv4_udp =PTP_TCR_TSIPV4ENA ; ptp_over_ipv6_udp =PTP_TCR_TSIPV6ENA ; ptp_over_ethernet =PTP_TCR_TSIPENA ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 59/197 Make filldir[64]() verify the directory entry filename is valid
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
[ Upstream commit 8a23eb804ca4f2be909e372cf5a9e7b30ae476cd ]
This has been discussed several times, and now filesystem people are talking about doing it individually at the filesystem layer, so head that off at the pass and just do it in getdents{64}().
This is partially based on a patch by Jann Horn, but checks for NUL bytes as well, and somewhat simplified.
There's also commentary about how it might be better if invalid names due to filesystem corruption don't cause an immediate failure, but only an error at the end of the readdir(), so that people can still see the filenames that are ok.
There's also been discussion about just how much POSIX strictly speaking requires this since it's about filesystem corruption. It's really more "protect user space from bad behavior" as pointed out by Jann. But since Eric Biederman looked up the POSIX wording, here it is for context:
"From readdir:
The readdir() function shall return a pointer to a structure representing the directory entry at the current position in the directory stream specified by the argument dirp, and position the directory stream at the next entry. It shall return a null pointer upon reaching the end of the directory stream. The structure dirent defined in the <dirent.h> header describes a directory entry.
From definitions:
3.129 Directory Entry (or Link)
An object that associates a filename with a file. Several directory entries can associate names with the same file.
...
3.169 Filename
A name consisting of 1 to {NAME_MAX} bytes used to name a file. The characters composing the name may be selected from the set of all character values excluding the slash character and the null byte. The filenames dot and dot-dot have special meaning. A filename is sometimes referred to as a 'pathname component'."
Note that I didn't bother adding the checks to any legacy interfaces that nobody uses.
Also note that if this ends up being noticeable as a performance regression, we can fix that to do a much more optimized model that checks for both NUL and '/' at the same time one word at a time.
We haven't really tended to optimize 'memchr()', and it only checks for one pattern at a time anyway, and we really _should_ check for NUL too (but see the comment about "soft errors" in the code about why it currently only checks for '/')
See the CONFIG_DCACHE_WORD_ACCESS case of hash_name() for how the name lookup code looks for pathname terminating characters in parallel.
--- fs/readdir.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
fs/readdir.c +40 -0
@@ -118,6 +118,40 @@ out: }EXPORT_SYMBOL (iterate_dir); +/* +* POSIX says that a dirent name cannot contain NULL or a '/'. +* +* It's not 100% clear what we should really do in this case. +* The filesystem is clearly corrupted, but returning a hard +* error means that you now don't see any of the other names +* either, so that isn't a perfect alternative. +* +* And if you return an error, what error do you use? Several +* filesystems seem to have decided on EUCLEAN being the error +* code for EFSCORRUPTED, and that may be the error to use. Or +* just EIO, which is perhaps more obvious to users. +* +* In order to see the other file names in the directory, the +* caller might want to make this a "soft" error: skip the +* entry, and return the error at the end instead. +* +* Note that this should likely do a "memchr(name, 0, len)" +* check too, since that would be filesystem corruption as +* well. However, that case can't actually confuse user space, +* which has to do a strlen() on the name anyway to find the +* filename length, and the above "soft error" worry means +* that it's probably better left alone until we have that +* issue clarified. +*/ +static int verify_dirent_name (const char *name,int len) +{ +if (WARN_ON_ONCE (!len)) +return -EIO ; +if (WARN_ON_ONCE (memchr (name,'/' , len))) +return -EIO ; +return 0 ; +} +/* * Traditional linux readdir() handling.. *
@@ -227,6 +261,9 @@ static int filldir(struct dir_context *ctx, const char *name, int namlen,int reclen =ALIGN (offsetof(struct linux_dirent , d_name) + namlen +2 ,sizeof (long )); + buf->error =verify_dirent_name (name, namlen); +if (unlikely (buf->error)) +return buf->error; buf->error = -EINVAL ;/* only used if we fail.. */ if (reclen > buf->count)return -EINVAL ;
@@ -316,6 +353,9 @@ static int filldir64(struct dir_context *ctx, const char *name, int namlen,int reclen =ALIGN (offsetof(struct linux_dirent64 , d_name) + namlen +1 ,sizeof (u64)); + buf->error =verify_dirent_name (name, namlen); +if (unlikely (buf->error)) +return buf->error; buf->error = -EINVAL ;/* only used if we fail.. */ if (reclen > buf->count)return -EINVAL ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 61/197 filldir[64]: remove WARN_ON_ONCE() for bad directory entries
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
[ Upstream commit b9959c7a347d6adbb558fba7e36e9fef3cba3b07 ]
This was always meant to be a temporary thing, just for testing and to see if it actually ever triggered.
The only thing that reported it was syzbot doing disk image fuzzing, and then that warning is expected. So let's just remove it before -rc4, because the extra sanity testing should probably go to -stable, but we don't want the warning to do so.
--- fs/readdir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/readdir.c +2 -2
@@ -105,9 +105,9 @@ EXPORT_SYMBOL(iterate_dir);*/ static int verify_dirent_name (const char *name,int len) { -if (WARN_ON_ONCE (!len)) +if (!len)return -EIO ; -if (WARN_ON_ONCE (memchr (name,'/' , len))) +if (memchr (name,'/' , len))return -EIO ;return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 58/197 elf: dont use MAP_FIXED_NOREPLACE for elf executable mappings
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
[ Upstream commit b212921b13bda088a004328457c5c21458262fe2 ]
In commit 4ed28639519c ("fs, elf: drop MAP_FIXED usage from elf_map") we changed elf to use MAP_FIXED_NOREPLACE instead of MAP_FIXED for the executable mappings.
Then, people reported that it broke some binaries that had overlapping segments from the same file, and commit ad55eac74f20 ("elf: enforce MAP_FIXED on overlaying elf segments") re-instated MAP_FIXED for some overlaying elf segment cases. But only some - despite the summary line of that commit, it only did it when it also does a temporary brk vma for one obvious overlapping case.
Now Russell King reports another overlapping case with old 32-bit x86 binaries, which doesn't trigger that limited case. End result: we had better just drop MAP_FIXED_NOREPLACE entirely, and go back to MAP_FIXED.
Yes, it's a sign of old binaries generated with old tool-chains, but we do pride ourselves on not breaking existing setups.
This still leaves MAP_FIXED_NOREPLACE in place for the load_elf_interp() and the old load_elf_library() use-cases, because nobody has reported breakage for those. Yet.
Note that in all the cases seen so far, the overlapping elf sections seem to be just re-mapping of the same executable with different section attributes. We could possibly introduce a new MAP_FIXED_NOFILECHANGE flag or similar, which acts like NOREPLACE, but allows just remapping the same executable file using different protection flags.
It's not clear that would make a huge difference to anything, but if people really hate that "elf remaps over previous maps" behavior, maybe at least a more limited form of remapping would alleviate some concerns.
Alternatively, we should take a look at our elf_map() logic to see if we end up not mapping things properly the first time.
In the meantime, this is the minimal "don't do that then" patch while people hopefully think about it more.
--- fs/binfmt_elf.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
fs/binfmt_elf.c +3 -10
@@ -899,7 +899,7 @@ static int load_elf_binary(struct linux_binprm *bprm)the correct location in memory. */ for (i =0 , elf_ppnt = elf_phdata; i < loc->elf_ex.e_phnum; i++, elf_ppnt++) { -int elf_prot, elf_flags, elf_fixed =MAP_FIXED_NOREPLACE ; +int elf_prot, elf_flags;unsigned long k, vaddr;unsigned long total_size =0 ;
@@ -931,13 +931,6 @@ static int load_elf_binary(struct linux_binprm *bprm)*/ } } - -/* -* Some binaries have overlapping elf segments and then -* we have to forcefully map over an existing mapping -* e.g. over this newly established brk mapping. -*/ - elf_fixed =MAP_FIXED ; } elf_prot =make_prot (elf_ppnt->p_flags);
@@ -950,7 +943,7 @@ static int load_elf_binary(struct linux_binprm *bprm)* the ET_DYN load_addr calculations, proceed normally. */ if (loc->elf_ex.e_type ==ET_EXEC || load_addr_set) { - elf_flags |= elf_fixed; + elf_flags |=MAP_FIXED ; }else if (loc->elf_ex.e_type ==ET_DYN ) {/* * This logic is run once for the first LOAD Program
@@ -986,7 +979,7 @@ static int load_elf_binary(struct linux_binprm *bprm) load_bias =ELF_ET_DYN_BASE ;if (current->flags &PF_RANDOMIZE ) load_bias +=arch_mmap_rnd (); - elf_flags |= elf_fixed; + elf_flags |=MAP_FIXED ; }else load_bias =0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 62/197 net_sched: fix backward compatibility for TCA_KIND
In reply to Greg Kroah-HartmanFrom: Cong Wang <[email protected]>
[ Upstream commit 6f96c3c6904c26cea9ca2726d5d8a9b0b8205b3c ]
Marcelo noticed a backward compatibility issue of TCA_KIND after we move from NLA_STRING to NLA_NUL_STRING, so it is probably too late to change it.
Instead, to make everyone happy, we can just insert a NUL to terminate the string with nla_strlcpy() like we do for TC actions.
--- net/sched/cls_api.c | 36 +++++++++++++++++++++++++++++++++--- net/sched/sch_api.c | 3 +-- 2 files changed, 34 insertions(+), 5 deletions(-)
net/sched/cls_api.c +33 -3
@@ -160,11 +160,22 @@ static inline u32 tcf_auto_prio(struct tcf_proto *tp)return TC_H_MAJ (first); } +static bool tcf_proto_check_kind (struct nlattr *kind,char *name) +{ +if (kind) +return nla_strlcpy (name, kind,IFNAMSIZ ) >=IFNAMSIZ ; +memset (name,0 ,IFNAMSIZ ); +return false; +} +static bool tcf_proto_is_unlocked (const char *kind) {const struct tcf_proto_ops *ops;bool ret; +if (strlen (kind) ==0 ) +return false; + ops =tcf_proto_lookup_ops (kind, false,NULL );/* On error return false to take rtnl lock. Proto lookup/create * functions will perform lookup again and properly handle errors.
@@ -1976,6 +1987,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n, {struct net *net =sock_net (skb->sk);struct nlattr *tca[TCA_MAX +1 ]; +char name[IFNAMSIZ ];struct tcmsg *t;u32 protocol;u32 prio;
@@ -2032,13 +2044,19 @@ replay:if (err)return err; +if (tcf_proto_check_kind (tca[TCA_KIND ], name)) { +NL_SET_ERR_MSG (extack,"Specified TC filter name too long" ); + err = -EINVAL ; + goto errout; + } +/* Take rtnl mutex if rtnl_held was set to true on previous iteration, * block is shared (no qdisc found), qdisc is not unlocked, classifier * type is not specified, classifier is not unlocked. */ if (rtnl_held || (q && !(q->ops->cl_ops->flags &QDISC_CLASS_OPS_DOIT_UNLOCKED )) || - !tca[TCA_KIND ] || !tcf_proto_is_unlocked (nla_data (tca[TCA_KIND ]))) { + !tcf_proto_is_unlocked (name)) { rtnl_held = true;rtnl_lock (); }
@@ -2196,6 +2214,7 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n, {struct net *net =sock_net (skb->sk);struct nlattr *tca[TCA_MAX +1 ]; +char name[IFNAMSIZ ];struct tcmsg *t;u32 protocol;u32 prio;
@@ -2235,13 +2254,18 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n,if (err)return err; +if (tcf_proto_check_kind (tca[TCA_KIND ], name)) { +NL_SET_ERR_MSG (extack,"Specified TC filter name too long" ); + err = -EINVAL ; + goto errout; + }/* Take rtnl mutex if flushing whole chain, block is shared (no qdisc * found), qdisc is not unlocked, classifier type is not specified, * classifier is not unlocked. */ if (!prio || (q && !(q->ops->cl_ops->flags &QDISC_CLASS_OPS_DOIT_UNLOCKED )) || - !tca[TCA_KIND ] || !tcf_proto_is_unlocked (nla_data (tca[TCA_KIND ]))) { + !tcf_proto_is_unlocked (name)) { rtnl_held = true;rtnl_lock (); }
@@ -2349,6 +2373,7 @@ static int tc_get_tfilter(struct sk_buff *skb, struct nlmsghdr *n, {struct net *net =sock_net (skb->sk);struct nlattr *tca[TCA_MAX +1 ]; +char name[IFNAMSIZ ];struct tcmsg *t;u32 protocol;u32 prio;
@@ -2385,12 +2410,17 @@ static int tc_get_tfilter(struct sk_buff *skb, struct nlmsghdr *n,if (err)return err; +if (tcf_proto_check_kind (tca[TCA_KIND ], name)) { +NL_SET_ERR_MSG (extack,"Specified TC filter name too long" ); + err = -EINVAL ; + goto errout; + }/* Take rtnl mutex if block is shared (no qdisc found), qdisc is not * unlocked, classifier type is not specified, classifier is not * unlocked. */ if ((q && !(q->ops->cl_ops->flags &QDISC_CLASS_OPS_DOIT_UNLOCKED )) || - !tca[TCA_KIND ] || !tcf_proto_is_unlocked (nla_data (tca[TCA_KIND ]))) { + !tcf_proto_is_unlocked (name)) { rtnl_held = true;rtnl_lock (); }
net/sched/sch_api.c +1 -2
@@ -1390,8 +1390,7 @@ check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w) }const struct nla_policy rtm_tca_policy[TCA_MAX +1 ] = { - [TCA_KIND ] = { .type =NLA_NUL_STRING , - .len =IFNAMSIZ -1 }, + [TCA_KIND ] = { .type =NLA_STRING }, [TCA_RATE ] = { .type =NLA_BINARY , .len =sizeof (struct tc_estimator ) }, [TCA_STAB ] = { .type =NLA_NESTED },
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 60/197 uaccess: implement a proper unsafe_copy_to_user() and switch filldir over to it
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
[ Upstream commit c512c69187197fe08026cb5bbe7b9709f4f89b73 ]
In commit 9f79b78ef744 ("Convert filldir[64]() from __put_user() to unsafe_put_user()") I made filldir() use unsafe_put_user(), which improves code generation on x86 enormously.
But because we didn't have a "unsafe_copy_to_user()", the dirent name copy was also done by hand with unsafe_put_user() in a loop, and it turns out that a lot of other architectures didn't like that, because unlike x86, they have various alignment issues.
Most non-x86 architectures trap and fix it up, and some (like xtensa) will just fail unaligned put_user() accesses unconditionally. Which makes that "copy using put_user() in a loop" not work for them at all.
I could make that code do explicit alignment etc, but the architectures that don't like unaligned accesses also don't really use the fancy "user_access_begin/end()" model, so they might just use the regular old __copy_to_user() interface.
So this commit takes that looping implementation, turns it into the x86 version of "unsafe_copy_to_user()", and makes other architectures implement the unsafe copy version as __copy_to_user() (the same way they do for the other unsafe_xyz() accessor functions).
Note that it only does this for the copying _to_ user space, and we still don't have a unsafe version of copy_from_user().
That's partly because we have no current users of it, but also partly because the copy_from_user() case is slightly different and cannot efficiently be implemented in terms of a unsafe_get_user() loop (because gcc can't do asm goto with outputs).
It would be trivial to do this using "rep movsb", which would work really nicely on newer x86 cores, but really badly on some older ones.
Al Viro is looking at cleaning up all our user copy routines to make this all a non-issue, but for now we have this simple-but-stupid version for x86 that works fine for the dirent name copy case because those names are short strings and we simply don't need anything fancier.
--- arch/x86/include/asm/uaccess.h | 23 ++++++++++++++++++ fs/readdir.c | 44 ++-------------------------------- include/linux/uaccess.h | 6 +++-- 3 files changed, 29 insertions(+), 44 deletions(-)
arch/x86/include/asm/uaccess.h +23 -0
@@ -734,5 +734,28 @@ do { \if (unlikely (__gu_err)) goto err_label; \ } while (0) +/* +* We want the unsafe accessors to always be inlined and use +* the error labels - thus the macro games. + */ +#define unsafe_copy_loop (dst, src, len, type, label) \ + while (len >= sizeof(type)) { \ + unsafe_put_user(*(type *)src,(type __user *)dst,label); \ + dst += sizeof(type); \ + src += sizeof(type); \ + len -= sizeof(type); \ + } + +#define unsafe_copy_to_user (_dst,_src,_len,label) \ +do { \ + char __user *__ucu_dst = (_dst); \ + const char *__ucu_src = (_src); \ + size_t __ucu_len = (_len); \ + unsafe_copy_loop(__ucu_dst, __ucu_src, __ucu_len, u64, label); \ + unsafe_copy_loop(__ucu_dst, __ucu_src, __ucu_len, u32, label); \ + unsafe_copy_loop(__ucu_dst, __ucu_src, __ucu_len, u16, label); \ + unsafe_copy_loop(__ucu_dst, __ucu_src, __ucu_len, u8, label); \ +} while (0) +#endif /* _ASM_X86_UACCESS_H */
fs/readdir.c +2 -42
55 lines not on this page · raw message
include/linux/uaccess.h +4 -2
@@ -284,8 +284,10 @@ extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);#ifndef user_access_begin#define user_access_begin (ptr,len) access_ok(ptr, len)#define user_access_end () do { } while (0) -#define unsafe_get_user (x, ptr, err) do { if (unlikely(__get_user(x, ptr))) goto err; } while (0) -#define unsafe_put_user (x, ptr, err) do { if (unlikely(__put_user(x, ptr))) goto err; } while (0) +#define unsafe_op_wrap (op, err) do { if (unlikely(op)) goto err; } while (0) +#define unsafe_get_user (x,p,e) unsafe_op_wrap(__get_user(x,p),e) +#define unsafe_put_user (x,p,e) unsafe_op_wrap(__put_user(x,p),e) +#define unsafe_copy_to_user (d,s,l,e) unsafe_op_wrap(__copy_to_user(d,s,l),e)static inline unsigned long user_access_save (void ) {return 0UL ; }static inline void user_access_restore (unsigned long flags) { }#endif
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 63/197 net_sched: fix backward compatibility for TCA_ACT_KIND
In reply to Greg Kroah-HartmanFrom: Cong Wang <[email protected]>
[ Upstream commit 4b793feccae3b06764268377a4030eb774ed924e ]
For TCA_ACT_KIND, we have to keep the backward compatibility too, and rely on nla_strlcpy() to check and terminate the string with a NUL.
Note for TC actions, nla_strcmp() is already used to compare kind strings, so we don't need to fix other places.
--- net/sched/act_api.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
net/sched/act_api.c +5 -4
@@ -832,8 +832,7 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb) }static const struct nla_policy tcf_action_policy[TCA_ACT_MAX +1 ] = { - [TCA_ACT_KIND ] = { .type =NLA_NUL_STRING , - .len =IFNAMSIZ -1 }, + [TCA_ACT_KIND ] = { .type =NLA_STRING }, [TCA_ACT_INDEX ] = { .type =NLA_U32 }, [TCA_ACT_COOKIE ] = { .type =NLA_BINARY , .len =TC_COOKIE_MAX_SIZE },
@@ -865,8 +864,10 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,NL_SET_ERR_MSG (extack,"TC action kind must be specified" ); goto err_out; } -nla_strlcpy (act_name, kind,IFNAMSIZ ); - +if (nla_strlcpy (act_name, kind,IFNAMSIZ ) >=IFNAMSIZ ) { +NL_SET_ERR_MSG (extack,"TC action name too long" ); + goto err_out; + }if (tb[TCA_ACT_COOKIE ]) { cookie =nla_memdup_cookie (tb);if (!cookie) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 64/197 libata/ahci: Fix PCS quirk application
In reply to Greg Kroah-HartmanFrom: Dan Williams <[email protected]>
[ Upstream commit 09d6ac8dc51a033ae0043c1fe40b4d02563c2496 ]
Commit c312ef176399 "libata/ahci: Drop PCS quirk for Denverton and beyond" got the polarity wrong on the check for which board-ids should have the quirk applied. The board type board_ahci_pcs7 is defined at the end of the list such that "pcs7" boards can be special cased in the future if they need the quirk. All prior Intel board ids "< board_ahci_pcs7" should proceed with applying the quirk.
--- drivers/ata/ahci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/ata/ahci.c +3 -1
@@ -1617,7 +1617,9 @@ static void ahci_intel_pcs_quirk(struct pci_dev *pdev, struct ahci_host_priv *hp*/ if (!id || id->vendor !=PCI_VENDOR_ID_INTEL )return ; -if (((enum board_ids ) id->driver_data) < board_ahci_pcs7) + +/* Skip applying the quirk on Denverton and beyond */ +if (((enum board_ids ) id->driver_data) >= board_ahci_pcs7)return ;/*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 66/197 Revert "drm/radeon: Fix EEH during kexec"
In reply to Greg Kroah-HartmanFrom: Alex Deucher <[email protected]>
[ Upstream commit 8d13c187c42e110625d60094668a8f778c092879 ]
This reverts commit 6f7fe9a93e6c09bf988c5059403f5f88e17e21e6.
This breaks some boards. Maybe just enable this on PPC for now?
--- drivers/gpu/drm/radeon/radeon_drv.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +0 -8
@@ -380,19 +380,11 @@ radeon_pci_remove(struct pci_dev *pdev)static void radeon_pci_shutdown (struct pci_dev *pdev) { -struct drm_device *ddev =pci_get_drvdata (pdev); -/* if we are running in a VM, make sure the device * torn down properly on reboot/shutdown */ if (radeon_device_is_virtual ())radeon_pci_remove (pdev); - -/* Some adapters need to be suspended before a -* shutdown occurs in order to prevent an error -* during kexec. -*/ -radeon_suspend_kms (ddev, true, true, false); }static int radeon_pmops_suspend (struct device *dev)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 41/197 net: stmmac: Do not stop PHY if WoL is enabled
In reply to Greg Kroah-HartmanFrom: Jose Abreu <[email protected]>
[ Upstream commit 3e2bf04fb0447aa4b967b8000125178f55ae7800 ]
If WoL is enabled we can't really stop the PHY, otherwise we will not receive the WoL packet. Fix this by telling phylink that only the MAC is down and only stop the PHY if WoL is not enabled.
--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +12 -6
@@ -4456,9 +4456,7 @@ int stmmac_suspend(struct device *dev)mutex_lock (&priv->lock); -rtnl_lock (); -phylink_stop (priv->phylink); -rtnl_unlock (); +phylink_mac_change (priv->phylink, false);netif_device_detach (ndev);stmmac_stop_all_queues (priv);
@@ -4473,6 +4471,10 @@ int stmmac_suspend(struct device *dev)stmmac_pmt (priv, priv->hw, priv->wolopts); priv->irq_wake =1 ; }else { +rtnl_lock (); +phylink_stop (priv->phylink); +rtnl_unlock (); +stmmac_mac_set (priv, priv->ioaddr, false);pinctrl_pm_select_sleep_state (priv->device);/* Disable clock in case of PWM is off */
@@ -4563,9 +4565,13 @@ int stmmac_resume(struct device *dev)stmmac_start_all_queues (priv); -rtnl_lock (); -phylink_start (priv->phylink); -rtnl_unlock (); +if (!device_may_wakeup (priv->device)) { +rtnl_lock (); +phylink_start (priv->phylink); +rtnl_unlock (); + } + +phylink_mac_change (priv->phylink, true);mutex_unlock (&priv->lock);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 67/197 ocfs2: fix panic due to ocfs2_wq is null
In reply to Greg Kroah-HartmanFrom: Yi Li <[email protected]>
commit b918c43021baaa3648de09e19a4a3dd555a45f40 upstream.
mount.ocfs2 failed when reading ocfs2 filesystem superblock encounters an error. ocfs2_initialize_super() returns before allocating ocfs2_wq. ocfs2_dismount_volume() triggers the following panic.
Oct 15 16:09:27 cnwarekv-205120 kernel: On-disk corruption discovered.Please run fsck.ocfs2 once the filesystem is unmounted.
Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_read_locked_inode:537 ERROR: status = -30
Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_init_global_system_inodes:458 ERROR: status = -30
Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_init_global_system_inodes:491 ERROR: status = -30
Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_initialize_super:2313 ERROR: status = -30
Oct 15 16:09:27 cnwarekv-205120 kernel: (mount.ocfs2,22804,44): ocfs2_fill_super:1033 ERROR: status = -30
------------[ cut here ]------------
Oops: 0002 [#1] SMP NOPTI
CPU: 1 PID: 11753 Comm: mount.ocfs2 Tainted: G E
4.14.148-200.ckv.x86_64 #1
Hardware name: Sugon H320-G30/35N16-US, BIOS 0SSDX017 12/21/2018
task: ffff967af0520000 task.stack: ffffa5f05484000
RIP: 0010:mutex_lock+0x19/0x20
Call Trace:
flush_workqueue+0x81/0x460
ocfs2_shutdown_local_alloc+0x47/0x440 [ocfs2]
ocfs2_dismount_volume+0x84/0x400 [ocfs2]
ocfs2_fill_super+0xa4/0x1270 [ocfs2]
? ocfs2_initialize_super.isa.211+0xf20/0xf20 [ocfs2]
mount_bdev+0x17f/0x1c0
mount_fs+0x3a/0x160--- fs/ocfs2/journal.c | 3 ++- fs/ocfs2/localalloc.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
fs/ocfs2/journal.c +2 -1
@@ -217,7 +217,8 @@ void ocfs2_recovery_exit(struct ocfs2_su/* At this point, we know that no more recovery threads can be * launched, so wait for any recovery completion work to * complete. */ -flush_workqueue (osb->ocfs2_wq); +if (osb->ocfs2_wq) +flush_workqueue (osb->ocfs2_wq);/* * Now that recovery is shut down, and the osb is about to be
fs/ocfs2/localalloc.c +2 -1
@@ -377,7 +377,8 @@ void ocfs2_shutdown_local_alloc(struct ostruct ocfs2_dinode *alloc =NULL ;cancel_delayed_work (&osb->la_enable_wq); -flush_workqueue (osb->ocfs2_wq); +if (osb->ocfs2_wq) +flush_workqueue (osb->ocfs2_wq);if (osb->local_alloc_state ==OCFS2_LA_UNUSED ) goto out;
Greg Kroah-Hartman
maintainerPATCH 68/197 nvme-pci: Set the prp2 correctly when using more than 4k page
In reply to Greg Kroah-HartmanFrom: Kevin Hao <[email protected]>
commit a4f40484e7f1dff56bb9f286cc59ffa36e0259eb upstream.
In the current code, the nvme is using a fixed 4k PRP entry size, but if the kernel use a page size which is more than 4k, we should consider the situation that the bv_offset may be larger than the dev->ctrl.page_size. Otherwise we may miss setting the prp2 and then cause the command can't be executed correctly.
--- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
@@ -769,7 +769,8 @@ static blk_status_t nvme_setup_prp_simpl struct bio_vec *bv) {struct nvme_iod *iod =blk_mq_rq_to_pdu (req); -unsigned int first_prp_len = dev->ctrl.page_size - bv->bv_offset; +unsigned int offset = bv->bv_offset & (dev->ctrl.page_size -1 ); +unsigned int first_prp_len = dev->ctrl.page_size - offset; iod->first_dma =dma_map_bvec (dev->dev, bv,rq_dma_dir (req),0 );if (dma_mapping_error (dev->dev, iod->first_dma))
Greg Kroah-Hartman
maintainerPATCH 69/197 ipv4: fix race condition between route lookup and invalidation
In reply to Greg Kroah-HartmanFrom: Wei Wang <[email protected]>
[ Upstream commit 5018c59607a511cdee743b629c76206d9c9e6d7b ]
Jesse and Ido reported the following race condition:
<CPU A, t0> - Received packet A is forwarded and cached dst entry is taken from the nexthop ('nhc->nhc_rth_input'). Calls skb_dst_set()
<t1> - Given Jesse has busy routers ("ingesting full BGP routing tables from multiple ISPs"), route is added / deleted and rt_cache_flush() is called
<CPU B, t2> - Received packet B tries to use the same cached dst entry from t0, but rt_cache_valid() is no longer true and it is replaced in rt_cache_route() by the newer one. This calls dst_dev_put() on the original dst entry which assigns the blackhole netdev to 'dst->dev'
<CPU A, t3> - dst_input(skb) is called on packet A and it is dropped due to 'dst->dev' being the blackhole netdev
There are 2 issues in the v4 routing code:
1. A per-netns counter is used to do the validation of the route. That means whenever a route is changed in the netns, users of all routes in the netns needs to redo lookup. v6 has an implementation of only updating fn_sernum for routes that are affected.
2. When rt_cache_valid() returns false, rt_cache_route() is called to throw away the current cache, and create a new one. This seems unnecessary because as long as this route does not change, the route cache does not need to be recreated.
To fully solve the above 2 issues, it probably needs quite some code changes and requires careful testing, and does not suite for net branch.
So this patch only tries to add the deleted cached rt into the uncached list, so user could still be able to use it to receive packets until it's done.
--- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/route.c +1 -1
@@ -1482,7 +1482,7 @@ static bool rt_cache_route(struct fib_nh prev =cmpxchg (p, orig, rt);if (prev == orig) {if (orig) { -dst_dev_put (&orig->dst); +rt_add_uncached_list (orig);dst_release (&orig->dst); } }else {
Greg Kroah-Hartman
maintainerPATCH 70/197 ipv4: Return -ENETUNREACH if we cant create route but saddr is valid
In reply to Greg Kroah-HartmanFrom: Stefano Brivio <[email protected]>
[ Upstream commit 595e0651d0296bad2491a4a29a7a43eae6328b02 ]
...instead of -EINVAL. An issue was found with older kernel versions while unplugging a NFS client with pending RPCs, and the wrong error code here prevented it from recovering once link is back up with a configured address.
Incidentally, this is not an issue anymore since commit 4f8943f80883 ("SUNRPC: Replace direct task wakeups from softirq context"), included in 5.2-rc7, had the effect of decoupling the forwarding of this error by using SO_ERROR in xs_wake_error(), as pointed out by Benjamin Coddington.
To the best of my knowledge, this isn't currently causing any further issue, but the error code doesn't look appropriate anyway, and we might hit this in other paths as well.
In detail, as analysed by Gonzalo Siero, once the route is deleted because the interface is down, and can't be resolved and we return -EINVAL here, this ends up, courtesy of inet_sk_rebuild_header(), as the socket error seen by tcp_write_err(), called by tcp_retransmit_timer().
In turn, tcp_write_err() indirectly calls xs_error_report(), which wakes up the RPC pending tasks with a status of -EINVAL. This is then seen by call_status() in the SUN RPC implementation, which aborts the RPC call calling rpc_exit(), instead of handling this as a potentially temporary condition, i.e. as a timeout.
Return -EINVAL only if the input parameters passed to ip_route_output_key_hash_rcu() are actually invalid (this is the case if the specified source address is multicast, limited broadcast or all zeroes), but return -ENETUNREACH in all cases where, at the given moment, the given source address doesn't allow resolving the route.
While at it, drop the initialisation of err to -ENETUNREACH, which was added to __ip_route_output_key() back then by commit 0315e3827048 ("net: Fix behaviour of unreachable, blackhole and prohibit routes"), but actually had no effect, as it was, and is, overwritten by the fib_lookup() return code assignment, and anyway ignored in all other branches, including the if (fl4->saddr) one:
I find this rather confusing, as it would look like -ENETUNREACH is the "default" error, while that statement has no effect.
Also note that after commit fc75fc8339e7 ("ipv4: dont create routes on down devices"), we would get -ENETUNREACH if the device is down, but -EINVAL if the source address is specified and we can't resolve the route, and this appears to be rather inconsistent.
--- net/ipv4/route.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/ipv4/route.c +6 -3
@@ -2470,14 +2470,17 @@ struct rtable *ip_route_output_key_hash_int orig_oif = fl4->flowi4_oif;unsigned int flags =0 ;struct rtable *rth; -int err = -ENETUNREACH ; +int err;if (fl4->saddr) { - rth =ERR_PTR (-EINVAL );if (ipv4_is_multicast (fl4->saddr) ||ipv4_is_lbcast (fl4->saddr) || -ipv4_is_zeronet (fl4->saddr)) +ipv4_is_zeronet (fl4->saddr)) { + rth =ERR_PTR (-EINVAL ); goto out; + } + + rth =ERR_PTR (-ENETUNREACH );/* I removed check for oif == dev_out->oif here. It was wrong for two reasons:
Greg Kroah-Hartman
maintainerPATCH 71/197 net: avoid potential infinite loop in tc_ctl_action()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 39f13ea2f61b439ebe0060393e9c39925c9ee28c ]
tc_ctl_action() has the ability to loop forever if tcf_action_add() returns -EAGAIN.
This special case has been done in case a module needed to be loaded, but it turns out that tcf_add_notify() could also return -EAGAIN if the socket sk_rcvbuf limit is hit.
We need to separate the two cases, and only loop for the module loading case.
While we are at it, add a limit of 10 attempts since unbounded loops are always scary.
syzbot repro was something like :
socket(PF_NETLINK, SOCK_RAW|SOCK_NONBLOCK, NETLINK_ROUTE) = 3write(3, ..., 38) = 38setsockopt(3, SOL_SOCKET, SO_RCVBUF, [0], 4) = 0sendmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{..., 388}], msg_controllen=0, msg_flags=0x10}, ...)
NMI backtrace for cpu 0
CPU: 0 PID: 1054 Comm: khungtaskd Not tainted 5.4.0-rc1+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 nmi_cpu_backtrace.cold+0x70/0xb2 lib/nmi_backtrace.c:101 nmi_trigger_cpumask_backtrace+0x23b/0x28b lib/nmi_backtrace.c:62 arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline] check_hung_uninterruptible_tasks kernel/hung_task.c:205 [inline] watchdog+0x9d0/0xef0 kernel/hung_task.c:289 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Sending NMI from CPU 0 to CPUs 1: NMI backtrace for cpu 1 CPU: 1 PID: 8859 Comm: syz-executor910 Not tainted 5.4.0-rc1+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:arch_local_save_flags arch/x86/include/asm/paravirt.h:751 [inline] RIP: 0010:lockdep_hardirqs_off+0x1df/0x2e0 kernel/locking/lockdep.c:3453 Code: 5c 08 00 00 5b 41 5c 41 5d 5d c3 48 c7 c0 58 1d f3 88 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 d3 00 00 00 <48> 83 3d 21 9e 99 07 00 0f 84 b9 00 00 00 9c 58 0f 1f 44 00 00 f6 RSP: 0018:ffff8880a6f3f1b8 EFLAGS: 00000046 RAX: 1ffffffff11e63ab RBX: ffff88808c9c6080 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff88808c9c6914 RBP: ffff8880a6f3f1d0 R08: ffff88808c9c6080 R09: fffffbfff16be5d1 R10: fffffbfff16be5d0 R11: 0000000000000003 R12: ffffffff8746591f R13: ffff88808c9c6080 R14: ffffffff8746591f R15: 0000000000000003 FS: 00000000011e4880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffff600400 CR3: 00000000a8920000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: trace_hardirqs_off+0x62/0x240 kernel/trace/trace_preemptirq.c:45 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] _raw_spin_lock_irqsave+0x6f/0xcd kernel/locking/spinlock.c:159 __wake_up_common_lock+0xc8/0x150 kernel/sched/wait.c:122 __wake_up+0xe/0x10 kernel/sched/wait.c:142 netlink_unlock_table net/netlink/af_netlink.c:466 [inline] netlink_unlock_table net/netlink/af_netlink.c:463 [inline] netlink_broadcast_filtered+0x705/0xb80 net/netlink/af_netlink.c:1514 netlink_broadcast+0x3a/0x50 net/netlink/af_netlink.c:1534 rtnetlink_send+0xdd/0x110 net/core/rtnetlink.c:714 tcf_add_notify net/sched/act_api.c:1343 [inline] tcf_action_add+0x243/0x370 net/sched/act_api.c:1362 tc_ctl_action+0x3b5/0x4bc net/sched/act_api.c:1410 rtnetlink_rcv_msg+0x463/0xb00 net/core/rtnetlink.c:5386 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5404 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x8a5/0xd60 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:657 ___sys_sendmsg+0x803/0x920 net/socket.c:2311 __sys_sendmsg+0x105/0x1d0 net/socket.c:2356 __do_sys_sendmsg net/socket.c:2365 [inline] __se_sys_sendmsg net/socket.c:2363 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2363 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x440939
--- net/sched/act_api.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
net/sched/act_api.c +8 -6
@@ -1353,11 +1353,16 @@ static int tcf_action_add(struct net *ne struct netlink_ext_ack *extack) {size_t attr_size =0 ; -int ret =0 ; +int loop, ret;struct tc_action *actions[TCA_ACT_MAX_PRIO ] = {}; - ret =tcf_action_init (net,NULL , nla,NULL ,NULL , ovr,0 , actions, - &attr_size, true, extack); +for (loop =0 ; loop <10 ; loop++) { + ret =tcf_action_init (net,NULL , nla,NULL ,NULL , ovr,0 , + actions, &attr_size, true, extack); +if (ret != -EAGAIN ) +break ; + } +if (ret <0 )return ret; ret =tcf_add_notify (net, n, actions, portid, attr_size, extack);
@@ -1407,11 +1412,8 @@ static int tc_ctl_action(struct sk_buff*/ if (n->nlmsg_flags &NLM_F_REPLACE ) ovr =1 ; -replay: ret =tcf_action_add (net, tca[TCA_ACT_TAB ], n, portid, ovr, extack); -if (ret == -EAGAIN ) - goto replay;break ;case RTM_DELACTION : ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
Greg Kroah-Hartman
maintainerPATCH 72/197 net: bcmgenet: Fix RGMII_MODE_EN value for GENET v1/2/3
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit efb86fede98cdc70b674692ff617b1162f642c49 ]
The RGMII_MODE_EN bit value was 0 for GENET versions 1 through 3, and became 6 for GENET v4 and above, account for that difference.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 + drivers/net/ethernet/broadcom/genet/bcmmii.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.h +1 -0
@@ -366,6 +366,7 @@ struct bcmgenet_mib_counters {#define EXT_PWR_DOWN_PHY_EN (1 << 20)#define EXT_RGMII_OOB_CTRL 0x0C +#define RGMII_MODE_EN_V123 (1 << 0)#define RGMII_LINK (1 << 4)#define OOB_DISABLE (1 << 5)#define RGMII_MODE_EN (1 << 6)
drivers/net/ethernet/broadcom/genet/bcmmii.c +5 -1
@@ -258,7 +258,11 @@ int bcmgenet_mii_config(struct net_devic*/ if (priv->ext_phy) { reg =bcmgenet_ext_readl (priv,EXT_RGMII_OOB_CTRL ); - reg |=RGMII_MODE_EN | id_mode_dis; + reg |= id_mode_dis; +if (GENET_IS_V1 (priv) ||GENET_IS_V2 (priv) ||GENET_IS_V3 (priv)) + reg |=RGMII_MODE_EN_V123 ; +else + reg |=RGMII_MODE_EN ;bcmgenet_ext_writel (priv, reg,EXT_RGMII_OOB_CTRL ); }
Greg Kroah-Hartman
maintainerPATCH 73/197 net: bcmgenet: Set phydev->dev_flags only for internal PHYs
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit 92696286f3bb37ba50e4bd8d1beb24afb759a799 ]
phydev->dev_flags is entirely dependent on the PHY device driver which is going to be used, setting the internal GENET PHY revision in those bits only makes sense when drivers/net/phy/bcm7xxx.c is the PHY driver being used.
--- drivers/net/ethernet/broadcom/genet/bcmmii.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmmii.c +3 -2
@@ -277,11 +277,12 @@ int bcmgenet_mii_probe(struct net_devicestruct bcmgenet_priv *priv =netdev_priv (dev);struct device_node *dn = priv->pdev->dev.of_node;struct phy_device *phydev; -u32 phy_flags; +u32 phy_flags =0 ;int ret;/* Communicate the integrated PHY revision */ - phy_flags = priv->gphy_rev; +if (priv->internal_phy) + phy_flags = priv->gphy_rev;/* Initialize link state variables that bcmgenet_mii_setup() uses */ priv->old_link =-1 ;
Greg Kroah-Hartman
maintainerPATCH 74/197 net: i82596: fix dma_alloc_attr for sni_82596
In reply to Greg Kroah-HartmanFrom: Thomas Bogendoerfer <[email protected]>
[ Upstream commit 61c1d33daf7b5146f44d4363b3322f8cda6a6c43 ]
Commit 7f683b920479 ("i825xx: switch to switch to dma_alloc_attrs") switched dma allocation over to dma_alloc_attr, but didn't convert the SNI part to request consistent DMA memory. This broke sni_82596 since driver doesn't do dma_cache_sync for performance reasons. Fix this by using different DMA_ATTRs for lasi_82596 and sni_82596.
--- drivers/net/ethernet/i825xx/lasi_82596.c | 4 +++- drivers/net/ethernet/i825xx/lib82596.c | 4 ++-- drivers/net/ethernet/i825xx/sni_82596.c | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/i825xx/lasi_82596.c +3 -1
@@ -96,6 +96,8 @@#define OPT_SWAP_PORT 0x0001/* Need to wordswp on the MPU port */ +#define LIB82596_DMA_ATTR DMA_ATTR_NON_CONSISTENT +#define DMA_WBACK (ndev, addr, len) \ do { dma_cache_sync((ndev)->dev.parent, (void *)addr, len, DMA_TO_DEVICE); } while (0)
@@ -200,7 +202,7 @@ static int __exit lan_remove_chip(structunregister_netdev (dev);dma_free_attrs (&pdev->dev,sizeof (struct i596_private ), lp->dma, - lp->dma_addr,DMA_ATTR_NON_CONSISTENT ); + lp->dma_addr,LIB82596_DMA_ATTR );free_netdev (dev);return 0 ; }
drivers/net/ethernet/i825xx/lib82596.c +2 -2
@@ -1065,7 +1065,7 @@ static int i82596_probe(struct net_devic dma =dma_alloc_attrs (dev->dev.parent,sizeof (struct i596_dma ), &lp->dma_addr,GFP_KERNEL , -DMA_ATTR_NON_CONSISTENT ); +LIB82596_DMA_ATTR );if (!dma) {printk (KERN_ERR "%s: Couldn't get shared memory\n" , __FILE__);return -ENOMEM ;
@@ -1087,7 +1087,7 @@ static int i82596_probe(struct net_devic i =register_netdev (dev);if (i) {dma_free_attrs (dev->dev.parent,sizeof (struct i596_dma ), - dma, lp->dma_addr,DMA_ATTR_NON_CONSISTENT ); + dma, lp->dma_addr,LIB82596_DMA_ATTR );return i; }
drivers/net/ethernet/i825xx/sni_82596.c +3 -1
@@ -24,6 +24,8 @@static const char sni_82596_string[] ="snirm_82596" ; +#define LIB82596_DMA_ATTR 0 +#define DMA_WBACK (priv, addr, len) do { } while (0)#define DMA_INV (priv, addr, len) do { } while (0)#define DMA_WBACK_INV (priv, addr, len) do { } while (0)
@@ -152,7 +154,7 @@ static int sni_82596_driver_remove(strucunregister_netdev (dev);dma_free_attrs (dev->dev.parent,sizeof (struct i596_private ), lp->dma, - lp->dma_addr,DMA_ATTR_NON_CONSISTENT ); + lp->dma_addr,LIB82596_DMA_ATTR );iounmap (lp->ca);iounmap (lp->mpu_port);free_netdev (dev);
Greg Kroah-Hartman
maintainerPATCH 75/197 net/ibmvnic: Fix EOI when running in XIVE mode.
In reply to Greg Kroah-HartmanFrom: "C�dric Le Goater" <[email protected]>
[ Upstream commit 11d49ce9f7946dfed4dcf5dbde865c78058b50ab ]
pSeries machines on POWER9 processors can run with the XICS (legacy) interrupt mode or with the XIVE exploitation interrupt mode. These interrupt contollers have different interfaces for interrupt management : XICS uses hcalls and XIVE loads and stores on a page. H_EOI being a XICS interface the enable_scrq_irq() routine can fail when the machine runs in XIVE mode.
Fix that by calling the EOI handler of the interrupt chip.
--- drivers/net/ethernet/ibm/ibmvnic.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +3 -5
@@ -2772,12 +2772,10 @@ static int enable_scrq_irq(struct ibmvniif (adapter->resetting && adapter->reset_reason ==VNIC_RESET_MOBILITY ) { -u64 val = (0xff000000 ) | scrq->hw_irq; +struct irq_desc *desc =irq_to_desc (scrq->irq); +struct irq_chip *chip =irq_desc_get_chip (desc); - rc =plpar_hcall_norets (H_EOI , val); -if (rc) -dev_err (dev,"H_EOI FAILED irq 0x%llx. rc=%ld\n" , - val, rc); + chip->irq_eoi (&desc->irq_data); } rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,
Greg Kroah-Hartman
maintainerPATCH 77/197 net: stmmac: disable/enable ptp_ref_clk in suspend/resume flow
In reply to Greg Kroah-HartmanFrom: Biao Huang <[email protected]>
[ Upstream commit e497c20e203680aba9ccf7bb475959595908ca7e ]
disable ptp_ref_clk in suspend flow, and enable it in resume flow.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +8 -4
@@ -4480,8 +4480,10 @@ int stmmac_suspend(struct device *dev)stmmac_mac_set (priv, priv->ioaddr, false);pinctrl_pm_select_sleep_state (priv->device);/* Disable clock in case of PWM is off */ -clk_disable (priv->plat->pclk); -clk_disable (priv->plat->stmmac_clk); +if (priv->plat->clk_ptp_ref) +clk_disable_unprepare (priv->plat->clk_ptp_ref); +clk_disable_unprepare (priv->plat->pclk); +clk_disable_unprepare (priv->plat->stmmac_clk); }mutex_unlock (&priv->lock);
@@ -4544,8 +4546,10 @@ int stmmac_resume(struct device *dev) }else {pinctrl_pm_select_default_state (priv->device);/* enable the clk previously disabled */ -clk_enable (priv->plat->stmmac_clk); -clk_enable (priv->plat->pclk); +clk_prepare_enable (priv->plat->stmmac_clk); +clk_prepare_enable (priv->plat->pclk); +if (priv->plat->clk_ptp_ref) +clk_prepare_enable (priv->plat->clk_ptp_ref);/* reset the phy so that it's ready */ if (priv->mii)stmmac_mdio_reset (priv->mii);
Greg Kroah-Hartman
maintainerPATCH 42/197 net: ag71xx: fix mdio subnode support
In reply to Greg Kroah-HartmanFrom: Oleksij Rempel <[email protected]>
[ Upstream commit 569aad4fcd82cba64eb10ede235d330a00f0aa09 ]
This patch is syncing driver with actual devicetree documentation:Documentation/devicetree/bindings/net/qca,ar71xx.txt
|Optional subnodes: |- mdio : specifies the mdio bus, used as a container for phy nodes | according to phy.txt in the same directory
The driver was working with fixed phy without any noticeable issues. This bug was uncovered by introducing dsa ar9331-switch driver.
Since no one reported this bug until now, I assume no body is using it and this patch should not brake existing system.
--- drivers/net/ethernet/atheros/ag71xx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/atheros/ag71xx.c +4 -2
@@ -526,7 +526,7 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)struct device *dev = &ag->pdev->dev;struct net_device *ndev = ag->ndev;static struct mii_bus *mii_bus; -struct device_node *np; +struct device_node *np, *mnp;int err; np = dev->of_node;
@@ -571,7 +571,9 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)msleep (200 ); } - err =of_mdiobus_register (mii_bus, np); + mnp =of_get_child_by_name (np,"mdio" ); + err =of_mdiobus_register (mii_bus, mnp); +of_node_put (mnp);if (err) goto mdio_err_put_clk;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 78/197 rxrpc: Fix possible NULL pointer access in ICMP handling
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit f0308fb0708078d6c1d8a4d533941a7a191af634 ]
If an ICMP packet comes in on the UDP socket backing an AF_RXRPC socket as the UDP socket is being shut down, rxrpc_error_report() may get called to deal with it after sk_user_data on the UDP socket has been cleared, leading to a NULL pointer access when this local endpoint record gets accessed.
Fix this by just returning immediately if sk_user_data was NULL.
The oops looks like the following:
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
...
RIP: 0010:rxrpc_error_report+0x1bd/0x6a9 ... Call Trace: ? sock_queue_err_skb+0xbd/0xde ? __udp4_lib_err+0x313/0x34d __udp4_lib_err+0x313/0x34d icmp_unreach+0x1ee/0x207 icmp_rcv+0x25b/0x28f ip_protocol_deliver_rcu+0x95/0x10e ip_local_deliver+0xe9/0x148 __netif_receive_skb_one_core+0x52/0x6e process_backlog+0xdc/0x177 net_rx_action+0xf9/0x270 __do_softirq+0x1b6/0x39a ? smpboot_register_percpu_thread+0xce/0xce run_ksoftirqd+0x1d/0x42 smpboot_thread_fn+0x19e/0x1b3 kthread+0xf1/0xf6 ? kthread_delayed_work_timer_fn+0x83/0x83 ret_from_fork+0x24/0x30
--- net/rxrpc/peer_event.c | 3 +++ 1 file changed, 3 insertions(+)
net/rxrpc/peer_event.c +3 -0
@@ -151,6 +151,9 @@ void rxrpc_error_report(struct sock *sk)struct rxrpc_peer *peer;struct sk_buff *skb; +if (unlikely (!local)) +return ; +_enter ("%p{%d}" , sk, local->debug_id);/* Clear the outstanding error value on the socket so that it doesn't
Greg Kroah-Hartman
maintainerPATCH 79/197 sched: etf: Fix ordering of packets with same txtime
In reply to Greg Kroah-HartmanFrom: Vinicius Costa Gomes <[email protected]>
[ Upstream commit 28aa7c86c2b49f659c8460a89e53b506c45979bb ]
When a application sends many packets with the same txtime, they may be transmitted out of order (different from the order in which they were enqueued).
This happens because when inserting elements into the tree, when the txtime of two packets are the same, the new packet is inserted at the left side of the tree, causing the reordering. The only effect of this change should be that packets with the same txtime will be transmitted in the order they are enqueued.
The application in question (the AVTP GStreamer plugin, still in development) is sending video traffic, in which each video frame have a single presentation time, the problem is that when packetizing, multiple packets end up with the same txtime.
The receiving side was rejecting packets because they were being received out of order.
--- net/sched/sch_etf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_etf.c +1 -1
@@ -177,7 +177,7 @@ static int etf_enqueue_timesortedlist(st parent = *p; skb =rb_to_skb (parent); -if (ktime_after (txtime, skb->tstamp)) { +if (ktime_compare (txtime, skb->tstamp) >=0 ) { p = &parent->rb_right; leftmost = false; }else {
Greg Kroah-Hartman
maintainerPATCH 80/197 sctp: change sctp_prot .no_autobind with true
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 63dfb7938b13fa2c2fbcb45f34d065769eb09414 ]
syzbot reported a memory leak:
BUG: memory leak, unreferenced object 0xffff888120b3d380 (size 64): backtrace:
[...] slab_alloc mm/slab.c:3319 [inline]
[...] kmem_cache_alloc+0x13f/0x2c0 mm/slab.c:3483
[...] sctp_bucket_create net/sctp/socket.c:8523 [inline]
[...] sctp_get_port_local+0x189/0x5a0 net/sctp/socket.c:8270
[...] sctp_do_bind+0xcc/0x200 net/sctp/socket.c:402
[...] sctp_bindx_add+0x4b/0xd0 net/sctp/socket.c:497
[...] sctp_setsockopt_bindx+0x156/0x1b0 net/sctp/socket.c:1022
[...] sctp_setsockopt net/sctp/socket.c:4641 [inline]
[...] sctp_setsockopt+0xaea/0x2dc0 net/sctp/socket.c:4611
[...] sock_common_setsockopt+0x38/0x50 net/core/sock.c:3147
[...] __sys_setsockopt+0x10f/0x220 net/socket.c:2084
[...] __do_sys_setsockopt net/socket.c:2100 [inline]It was caused by when sending msgs without binding a port, in the path:inet_sendmsg() -> inet_send_prepare() -> inet_autobind() -> .get_port/sctp_get_port(), sp->bind_hash will be set while bp->port is not. Later when binding another port by sctp_setsockopt_bindx(), a new bucket will be created as bp->port is not set.
sctp's autobind is supposed to call sctp_autobind() where it does all things including setting bp->port. Since sctp_autobind() is called in sctp_sendmsg() if the sk is not yet bound, it should have skipped the auto bind.
THis patch is to avoid calling inet_autobind() in inet_send_prepare() by changing sctp_prot .no_autobind with true, also remove the unused .get_port.
--- net/sctp/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/sctp/socket.c +2 -2
@@ -9353,7 +9353,7 @@ struct proto sctp_prot = { .backlog_rcv = sctp_backlog_rcv, .hash = sctp_hash, .unhash = sctp_unhash, - .get_port = sctp_get_port, + .no_autobind = true, .obj_size = sizeof(struct sctp_sock), .useroffset = offsetof(struct sctp_sock, subscribe), .usersize = offsetof(struct sctp_sock, initmsg) -
@@ -9395,7 +9395,7 @@ struct proto sctpv6_prot = { .backlog_rcv = sctp_backlog_rcv, .hash = sctp_hash, .unhash = sctp_unhash, - .get_port = sctp_get_port, + .no_autobind = true, .obj_size = sizeof(struct sctp6_sock), .useroffset = offsetof(struct sctp6_sock, sctp.subscribe), .usersize = offsetof(struct sctp6_sock, sctp.initmsg) -
Greg Kroah-Hartman
maintainerPATCH 81/197 net: aquantia: temperature retrieval fix
In reply to Greg Kroah-HartmanFrom: Igor Russkikh <[email protected]>
[ Upstream commit 06b0d7fe7e5ff3ba4c7e265ef41135e8bcc232bb ]
Chip temperature is a two byte word, colocated internally with cable length data. We do all readouts from HW memory by dwords, thus we should clear extra high bytes, otherwise temperature output gets weird as soon as we attach a cable to the NIC.
--- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c +1 -1
@@ -337,7 +337,7 @@ static int aq_fw2x_get_phy_temp(struct a/* Convert PHY temperature from 1/256 degree Celsius * to 1/1000 degree Celsius. */ - *temp = temp_res *1000 /256 ; + *temp = (temp_res &0xFFFF ) *1000 /256 ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 83/197 net: aquantia: do not pass lro session with invalid tcp checksum
In reply to Greg Kroah-HartmanFrom: Dmitry Bogdanov <[email protected]>
[ Upstream commit d08b9a0a3ebdf71b0aabe576c7dd48e57e80e0f0 ]
Individual descriptors on LRO TCP session should be checked for CRC errors. It was discovered that HW recalculates L4 checksums on LRO session and does not break it up on bad L4 csum.
Thus, driver should aggregate HW LRO L4 statuses from all individual buffers of LRO session and drop packet if one of the buffers has bad L4 checksum.
--- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/aq_ring.c +2 -1
@@ -313,6 +313,7 @@ int aq_ring_rx_clean(struct aq_ring_s *sbreak ; buff->is_error |= buff_->is_error; + buff->is_cso_err |= buff_->is_cso_err; }while (!buff_->is_eop);
@@ -320,7 +321,7 @@ int aq_ring_rx_clean(struct aq_ring_s *s err =0 ; goto err_exit; } -if (buff->is_error) { +if (buff->is_error || buff->is_cso_err) { buff_ = buff; do { next_ = buff_->next,
Greg Kroah-Hartman
maintainerPATCH 84/197 net: aquantia: correctly handle macvlan and multicast coexistence
In reply to Greg Kroah-HartmanFrom: Dmitry Bogdanov <[email protected]>
[ Upstream commit 9f051db566da1e8110659ab4ab188af1c2510bb4 ]
macvlan and multicast handling is now mixed up.
The explicit issue is that macvlan interface gets broken (no traffic) after clearing MULTICAST flag on the real interface.
We now do separate logic and consider both ALLMULTI and MULTICAST flags on the device.
--- drivers/net/ethernet/aquantia/atlantic/aq_main.c | 4 - drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 32 +++++++------- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 7 +-- 3 files changed, 21 insertions(+), 22 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_main.c +1 -3
@@ -194,9 +194,7 @@ static void aq_ndev_set_multicast_settin {struct aq_nic_s *aq_nic =netdev_priv (ndev); -aq_nic_set_packet_filter (aq_nic, ndev->flags); - -aq_nic_set_multicast_list (aq_nic, ndev); + (void )aq_nic_set_multicast_list (aq_nic, ndev); } static int aq_ndo_vlan_rx_add_vid(struct net_device *ndev, __be16 proto,
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +16 -16
@@ -631,9 +631,12 @@ err_exit:int aq_nic_set_multicast_list (struct aq_nic_s *self,struct net_device *ndev) { -unsigned int packet_filter = self->packet_filter; +const struct aq_hw_ops *hw_ops = self->aq_hw_ops; +struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg; +unsigned int packet_filter = ndev->flags;struct netdev_hw_addr *ha =NULL ;unsigned int i =0U ; +int err =0 ; self->mc_list.count =0 ;if (netdev_uc_count (ndev) >AQ_HW_MULTICAST_ADDRESS_MAX ) {
@@ -641,29 +644,26 @@ int aq_nic_set_multicast_list(struct aq_ }else {netdev_for_each_uc_addr (ha, ndev) {ether_addr_copy (self->mc_list.ar[i++], ha->addr); - -if (i >=AQ_HW_MULTICAST_ADDRESS_MAX ) -break ; } } -if (i +netdev_mc_count (ndev) >AQ_HW_MULTICAST_ADDRESS_MAX ) { - packet_filter |=IFF_ALLMULTI ; - }else { -netdev_for_each_mc_addr (ha, ndev) { -ether_addr_copy (self->mc_list.ar[i++], ha->addr); - -if (i >=AQ_HW_MULTICAST_ADDRESS_MAX ) -break ; + cfg->is_mc_list_enabled = !!(packet_filter &IFF_MULTICAST ); +if (cfg->is_mc_list_enabled) { +if (i +netdev_mc_count (ndev) >AQ_HW_MULTICAST_ADDRESS_MAX ) { + packet_filter |=IFF_ALLMULTI ; + }else { +netdev_for_each_mc_addr (ha, ndev) { +ether_addr_copy (self->mc_list.ar[i++], + ha->addr); + } } }if (i >0 && i <=AQ_HW_MULTICAST_ADDRESS_MAX ) { - packet_filter |=IFF_MULTICAST ; self->mc_list.count = i; - self->aq_hw_ops->hw_multicast_list_set (self->aq_hw, - self->mc_list.ar, - self->mc_list.count); + err = hw_ops->hw_multicast_list_set (self->aq_hw, + self->mc_list.ar, + self->mc_list.count); }return aq_nic_set_packet_filter (self, packet_filter); }
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +4 -3
@@ -818,14 +818,15 @@ static int hw_atl_b0_hw_packet_filter_se cfg->is_vlan_force_promisc);hw_atl_rpfl2multicast_flr_en_set (self, -IS_FILTER_ENABLED (IFF_ALLMULTI ),0 ); +IS_FILTER_ENABLED (IFF_ALLMULTI ) && +IS_FILTER_ENABLED (IFF_MULTICAST ),0 );hw_atl_rpfl2_accept_all_mc_packets_set (self, -IS_FILTER_ENABLED (IFF_ALLMULTI )); +IS_FILTER_ENABLED (IFF_ALLMULTI ) && +IS_FILTER_ENABLED (IFF_MULTICAST ));hw_atl_rpfl2broadcast_en_set (self,IS_FILTER_ENABLED (IFF_BROADCAST )); - cfg->is_mc_list_enabled =IS_FILTER_ENABLED (IFF_MULTICAST );for (i =HW_ATL_B0_MAC_MIN ; i <HW_ATL_B0_MAC_MAX ; ++i) hw_atl_rpfl2_uc_flr_en_set(self,
Greg Kroah-Hartman
maintainerPATCH 43/197 RISC-V: Clear load reservations while restoring hart contexts
In reply to Greg Kroah-HartmanFrom: Palmer Dabbelt <[email protected]>
[ Upstream commit 18856604b3e7090ce42d533995173ee70c24b1c9 ]
This is almost entirely a comment. The bug is unlikely to manifest on existing hardware because there is a timeout on load reservations, but manifests on QEMU because there is no timeout.
--- arch/riscv/include/asm/asm.h | 1 + arch/riscv/kernel/entry.S | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-)
arch/riscv/include/asm/asm.h +1 -0
@@ -22,6 +22,7 @@#define REG_L __REG_SEL(ld, lw)#define REG_S __REG_SEL(sd, sw) +#define REG_SC __REG_SEL(sc.d, sc.w)#define SZREG __REG_SEL(8, 4)#define LGREG __REG_SEL(3, 2)
arch/riscv/kernel/entry.S +20 -1
@@ -98,7 +98,26 @@ _save_context: */ .macro RESTORE_ALL REG_L a0, PT_SSTATUS(sp) - REG_L a2, PT_SEPC(sp) + /* + * The current load reservation is effectively part of the processor's + * state, in the sense that load reservations cannot be shared between + * different hart contexts. We can't actually save and restore a load + * reservation, so instead here we clear any existing reservation -- + * it's always legal for implementations to clear load reservations at + * any point (as long as the forward progress guarantee is kept, but + * we'll ignore that here). + * + * Dangling load reservations can be the result of taking a trap in the + * middle of an LR/SC sequence, but can also be the result of a taken + * forward branch around an SC -- which is how we implement CAS. As a + * result we need to clear reservations between the last CAS and the + * jump back to the new context. While it is unlikely the store + * completes, implementations are allowed to expand reservations to be + * arbitrarily large. + */ + REG_L a2, PT_SEPC(sp) + REG_SC x0, a2, PT_SEPC(sp) + csrw CSR_SSTATUS, a0 csrw CSR_SEPC, a2
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 44/197 riscv: Fix memblock reservation for device tree blob
In reply to Greg Kroah-HartmanFrom: Albert Ou <[email protected]>
[ Upstream commit 922b0375fc93fb1a20c5617e37c389c26bbccb70 ]
This fixes an error with how the FDT blob is reserved in memblock. An incorrect physical address calculation exposed the FDT header to unintended corruption, which typically manifested with of_fdt_raw_init() faulting during late boot after fdt_totalsize() returned a wrong value. Systems with smaller physical memory sizes more frequently trigger this issue, as the kernel is more likely to allocate from the DMA32 zone where bbl places the DTB after the kernel image.
Commit 671f9a3e2e24 ("RISC-V: Setup initial page tables in two stages") changed the mapping of the DTB to reside in the fixmap area. Consequently, early_init_fdt_reserve_self() cannot be used anymore in setup_bootmem() since it relies on __pa() to derive a physical address, which does not work with dtb_early_va that is no longer a valid kernel logical address.
The reserved[0x1] region shows the effect of the pointer underflow resulting from the __pa(initial_boot_params) offset subtraction:
[ 0.000000] MEMBLOCK configuration: [ 0.000000] memory size = 0x000000001fe00000 reserved size = 0x0000000000a2e514 [ 0.000000] memory.cnt = 0x1 [ 0.000000] memory[0x0] [0x0000000080200000-0x000000009fffffff], 0x000000001fe00000 bytes flags: 0x0 [ 0.000000] reserved.cnt = 0x2 [ 0.000000] reserved[0x0] [0x0000000080200000-0x0000000080c2dfeb], 0x0000000000a2dfec bytes flags: 0x0 [ 0.000000] reserved[0x1] [0xfffffff080100000-0xfffffff080100527], 0x0000000000000528 bytes flags: 0x0
With the fix applied:
[ 0.000000] MEMBLOCK configuration: [ 0.000000] memory size = 0x000000001fe00000 reserved size = 0x0000000000a2e514 [ 0.000000] memory.cnt = 0x1 [ 0.000000] memory[0x0] [0x0000000080200000-0x000000009fffffff], 0x000000001fe00000 bytes flags: 0x0 [ 0.000000] reserved.cnt = 0x2 [ 0.000000] reserved[0x0] [0x0000000080200000-0x0000000080c2dfeb], 0x0000000000a2dfec bytes flags: 0x0 [ 0.000000] reserved[0x1] [0x0000000080e00000-0x0000000080e00527], 0x0000000000000528 bytes flags: 0x0
--- arch/riscv/mm/init.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
arch/riscv/mm/init.c +11 -1
@@ -11,6 +11,7 @@#include <linux/swap.h> #include <linux/sizes.h> #include <linux/of_fdt.h> +#include <linux/libfdt.h> #include <asm/fixmap.h> #include <asm/tlbflush.h>
@@ -82,6 +83,8 @@ static void __init setup_initrd(void) }#endif /* CONFIG_BLK_DEV_INITRD */ +static phys_addr_t dtb_early_pa__initdata ; +void __init setup_bootmem (void ) {struct memblock_region *reg;
@@ -117,7 +120,12 @@ void __init setup_bootmem(void)setup_initrd ();#endif /* CONFIG_BLK_DEV_INITRD */ -early_init_fdt_reserve_self (); +/* +* Avoid using early_init_fdt_reserve_self() since __pa() does +* not work for DTB pointers that are fixmap addresses +*/ +memblock_reserve (dtb_early_pa,fdt_totalsize (dtb_early_va)); +early_init_fdt_scan_reserved_mem ();memblock_allow_resize ();memblock_dump_all ();
@@ -393,6 +401,8 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)/* Save pointer to DTB for early FDT parsing */ dtb_early_va = (void *)fix_to_virt (FIX_FDT ) + (dtb_pa & ~PAGE_MASK ); +/* Save physical address for memblock reservation */ + dtb_early_pa = dtb_pa; }static void __init setup_vm_final (void )
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 45/197 drm/amdgpu: fix multiple memory leaks in acp_hw_init
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
[ Upstream commit 57be09c6e8747bf48704136d9e3f92bfb93f5725 ]
In acp_hw_init there are some allocations that needs to be released in case of failure:
1- adev->acp.acp_genpd should be released if any allocation attemp for adev->acp.acp_cell, adev->acp.acp_res or i2s_pdata fails. 2- all of those allocations should be released if mfd_add_hotplug_devices or pm_genpd_add_device fail.
3- Release is needed in case of time out values expire.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 34 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +22 -12
@@ -189,7 +189,7 @@ static int acp_hw_init(void *handle)u32 val =0 ;u32 count =0 ;struct device *dev; -struct i2s_platform_data *i2s_pdata; +struct i2s_platform_data *i2s_pdata =NULL ;struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -231,20 +231,21 @@ static int acp_hw_init(void *handle) adev->acp.acp_cell =kcalloc (ACP_DEVS ,sizeof (struct mfd_cell ),GFP_KERNEL ); -if (adev->acp.acp_cell ==NULL ) -return -ENOMEM ; +if (adev->acp.acp_cell ==NULL ) { + r = -ENOMEM ; + goto failure; + } adev->acp.acp_res =kcalloc (5 ,sizeof (struct resource ),GFP_KERNEL );if (adev->acp.acp_res ==NULL ) { -kfree (adev->acp.acp_cell); -return -ENOMEM ; + r = -ENOMEM ; + goto failure; } i2s_pdata =kcalloc (3 ,sizeof (struct i2s_platform_data ),GFP_KERNEL );if (i2s_pdata ==NULL ) { -kfree (adev->acp.acp_res); -kfree (adev->acp.acp_cell); -return -ENOMEM ; + r = -ENOMEM ; + goto failure; }switch (adev->asic_type) {
@@ -341,14 +342,14 @@ static int acp_hw_init(void *handle) r =mfd_add_hotplug_devices (adev->acp.parent, adev->acp.acp_cell,ACP_DEVS );if (r) -return r; + goto failure;for (i =0 ; i <ACP_DEVS ; i++) { dev =get_mfd_cell_dev (adev->acp.acp_cell[i].name, i); r =pm_genpd_add_device (&adev->acp.acp_genpd->gpd, dev);if (r) {dev_err (dev,"Failed to add dev to genpd\n" ); -return r; + goto failure; } }
@@ -367,7 +368,8 @@ static int acp_hw_init(void *handle)break ;if (--count ==0 ) {dev_err (&adev->pdev->dev,"Failed to reset ACP\n" ); -return -ETIMEDOUT ; + r = -ETIMEDOUT ; + goto failure; }udelay (100 ); }
@@ -384,7 +386,8 @@ static int acp_hw_init(void *handle)break ;if (--count ==0 ) {dev_err (&adev->pdev->dev,"Failed to reset ACP\n" ); -return -ETIMEDOUT ; + r = -ETIMEDOUT ; + goto failure; }udelay (100 ); }
@@ -393,6 +396,13 @@ static int acp_hw_init(void *handle) val &= ~ACP_SOFT_RESET__SoftResetAud_MASK;cgs_write_register (adev->acp.cgs_device, mmACP_SOFT_RESET, val);return 0 ; + +failure: +kfree (i2s_pdata); +kfree (adev->acp.acp_res); +kfree (adev->acp.acp_cell); +kfree (adev->acp.acp_genpd); +return r; }/**
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 46/197 drm/amd/display: memory leak
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
[ Upstream commit 055e547478a11a6360c7ce05e2afc3e366968a12 ]
In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated clk_src needs release.
--- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 1 + 7 files changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +1 -0
@@ -668,6 +668,7 @@ struct clock_source *dce100_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +1 -0
@@ -714,6 +714,7 @@ struct clock_source *dce110_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +1 -0
@@ -687,6 +687,7 @@ struct clock_source *dce112_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +1 -0
@@ -500,6 +500,7 @@ static struct clock_source *dce120_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +1 -0
@@ -701,6 +701,7 @@ struct clock_source *dce80_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
@@ -786,6 +786,7 @@ struct clock_source *dcn10_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -0
@@ -955,6 +955,7 @@ struct clock_source *dcn20_clock_source_create(return &clk_src->base; } +kfree (clk_src);BREAK_TO_DEBUGGER ();return NULL ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 38/197 net: stmmac: xgmac: Not all Unicast addresses may be available
In reply to Greg Kroah-HartmanFrom: Jose Abreu <[email protected]>
[ Upstream commit 9a2ae7b3960eb2426a8560cbc3251e3453230d21 ]
Some setups may not have all Unicast addresses filters available. Let's check this before trying to setup filters.
--- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +1 -1
@@ -370,7 +370,7 @@ static void dwxgmac2_set_filter(struct mac_device_info *hw,dwxgmac2_set_mchash (ioaddr, mc_filter, mcbitslog2);/* Handle multiple unicast addresses */ -if (netdev_uc_count (dev) >XGMAC_ADDR_MAX ) { +if (netdev_uc_count (dev) > hw->unicast_filter_entries) { value |=XGMAC_FILTER_PR ; }else {struct netdev_hw_addr *ha;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 86/197 net: phy: micrel: Update KSZ87xx PHY name
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 1d951ba3da67bbc7a9b0e05987e09552c2060e18 ]
The KSZ8795 PHY ID is in fact used by KSZ8794/KSZ8795/KSZ8765 switches. Update the PHY ID and name to reflect that, as this family of switches is commonly refered to as KSZ87xx
--- drivers/net/phy/micrel.c | 4 ++-- include/linux/micrel_phy.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/micrel.c +2 -2
@@ -395,7 +395,7 @@ static int ksz8061_config_init(struct phstatic int ksz8795_match_phy_device (struct phy_device *phydev) { -return ksz8051_ksz8795_match_phy_device (phydev,PHY_ID_KSZ8795 ); +return ksz8051_ksz8795_match_phy_device (phydev,PHY_ID_KSZ87XX ); } static int ksz9021_load_values_from_of(struct phy_device *phydev,
@@ -1174,7 +1174,7 @@ static struct phy_driver ksphy_driver[] .suspend = genphy_suspend, .resume = genphy_resume, }, { - .name = "Micrel KSZ8795", + .name = "Micrel KSZ87XX Switch", /* PHY_BASIC_FEATURES */ .config_init = kszphy_config_init, .config_aneg = ksz8873mll_config_aneg,
include/linux/micrel_phy.h +1 -1
@@ -31,7 +31,7 @@#define PHY_ID_KSZ886X 0x00221430#define PHY_ID_KSZ8863 0x00221435 -#define PHY_ID_KSZ8795 0x00221550 +#define PHY_ID_KSZ87XX 0x00221550#define PHY_ID_KSZ9477 0x00221631
Greg Kroah-Hartman
maintainerPATCH 95/197 io_uring: Fix corrupted user_data
In reply to Greg Kroah-HartmanFrom: Pavel Begunkov <[email protected]>
commit 84d55dc5b9e57b513a702fbc358e1b5489651590 upstream.
There is a bug, where failed linked requests are returned not with specified @user_data, but with garbage from a kernel stack.
The reason is that io_fail_links() uses req->user_data, which is uninitialised when called from io_queue_sqe() on fail path.
--- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
fs/io_uring.c +2 -0
@@ -2157,6 +2157,8 @@ err:return ; } + req->user_data = s->sqe->user_data; +/* * If we already have a head request, queue this one for async * submittal once the head completes. If we don't have a head but
Greg Kroah-Hartman
maintainerPATCH 97/197 ALSA: hda/realtek - Add support for ALC711
In reply to Greg Kroah-HartmanFrom: Kailang Yang <[email protected]>
commit 83629532ce45ef9df1f297b419b9ea112045685d upstream.
Support new codec ALC711.
--- sound/pci/hda/patch_realtek.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/hda/patch_realtek.c +3 -0
@@ -393,6 +393,7 @@ static void alc_fill_eapd_coef(struct hdcase 0x10ec0700 :case 0x10ec0701 :case 0x10ec0703 : +case 0x10ec0711 :alc_update_coef_idx (codec,0x10 ,1 <<15 ,0 );break ;case 0x10ec0662 :
@@ -7965,6 +7966,7 @@ static int patch_alc269(struct hda_codeccase 0x10ec0700 :case 0x10ec0701 :case 0x10ec0703 : +case 0x10ec0711 : spec->codec_variant =ALC269_TYPE_ALC700 ; spec->gen.mixer_nid =0 ;/* ALC700 does not have any loopback mixer path */ alc_update_coef_idx (codec,0x4a ,1 <<15 ,0 );/* Combo jack auto trigger control */
@@ -9105,6 +9107,7 @@ static const struct hda_device_id snd_hdHDA_CODEC_ENTRY (0x10ec0700 ,"ALC700" , patch_alc269),HDA_CODEC_ENTRY (0x10ec0701 ,"ALC701" , patch_alc269),HDA_CODEC_ENTRY (0x10ec0703 ,"ALC703" , patch_alc269), +HDA_CODEC_ENTRY (0x10ec0711 ,"ALC711" , patch_alc269),HDA_CODEC_ENTRY (0x10ec0867 ,"ALC891" , patch_alc662),HDA_CODEC_ENTRY (0x10ec0880 ,"ALC880" , patch_alc880), HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
Greg Kroah-Hartman
maintainerPATCH 98/197 ALSA: hda/realtek - Enable headset mic on Asus MJ401TA
In reply to Greg Kroah-HartmanFrom: Daniel Drake <[email protected]>
commit 8c8967a7dc01a25f57a0757fdca10987773cd1f2 upstream.
On Asus MJ401TA (with Realtek ALC256), the headset mic is connected to pin 0x19, with default configuration value 0x411111f0 (indicating no physical connection).
Enable this by quirking the pin. Mic jack detection was also tested and found to be working.
This enables use of the headset mic on this product.
--- sound/pci/hda/patch_realtek.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
sound/pci/hda/patch_realtek.c +11 -0
@@ -5868,6 +5868,7 @@ enum {ALC225_FIXUP_WYSE_AUTO_MUTE ,ALC225_FIXUP_WYSE_DISABLE_MIC_VREF ,ALC286_FIXUP_ACER_AIO_HEADSET_MIC , +ALC256_FIXUP_ASUS_HEADSET_MIC ,ALC256_FIXUP_ASUS_MIC_NO_PRESENCE ,ALC299_FIXUP_PREDATOR_SPK , ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC,
@@ -6902,6 +6903,15 @@ static const struct hda_fixup alc269_fix .chained = true, .chain_id =ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE }, + [ALC256_FIXUP_ASUS_HEADSET_MIC] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x19 ,0x03a11020 },/* headset mic with jack detect */ + { } + }, + .chained = true, + .chain_id =ALC256_FIXUP_ASUS_HEADSET_MODE + }, [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) {
@@ -7098,6 +7108,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1043 ,0x1517 ,"Asus Zenbook UX31A" ,ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A ),SND_PCI_QUIRK (0x1043 ,0x16e3 ,"ASUS UX50" ,ALC269_FIXUP_STEREO_DMIC ),SND_PCI_QUIRK (0x1043 ,0x17d1 ,"ASUS UX431FL" ,ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC ), +SND_PCI_QUIRK (0x1043 ,0x18b1 ,"Asus MJ401TA" ,ALC256_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1043 ,0x1a13 ,"Asus G73Jw" ,ALC269_FIXUP_ASUS_G73JW ),SND_PCI_QUIRK (0x1043 ,0x1a30 ,"ASUS X705UD" ,ALC256_FIXUP_ASUS_MIC ), SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
Greg Kroah-Hartman
maintainerPATCH 99/197 ALSA: usb-audio: Disable quirks for BOSS Katana amplifiers
In reply to Greg Kroah-HartmanFrom: Szabolcs Szőke <[email protected]>
commit 7571b6a17fcc5e4f6903f065a82d0e38011346ed upstream.
BOSS Katana amplifiers cannot be used for recording or playback if quirks are applied
--- sound/usb/pcm.c | 3 +++ 1 file changed, 3 insertions(+)
sound/usb/pcm.c +3 -0
@@ -348,6 +348,9 @@ static int set_sync_ep_implicit_fb_quirk ep =0x84 ; ifnum =0 ; goto add_sync_ep_from_ifnum; +case USB_ID (0x0582 ,0x01d8 ):/* BOSS Katana */ +/* BOSS Katana amplifiers do not need quirks */ +return 0 ; } if (attr == USB_ENDPOINT_SYNC_ASYNC &&
Greg Kroah-Hartman
maintainerPATCH 100/197 ALSA: hda - Force runtime PM on Nvidia HDMI codecs
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit 94989e318b2f11e217e86bee058088064fa9a2e9 upstream.
Przemysław Kopa reports that since commit b516ea586d71 ("PCI: Enable NVIDIA HDA controllers"), the discrete GPU Nvidia GeForce GT 540M on his 2011 Samsung laptop refuses to runtime suspend, resulting in a power regression and excessive heat.
Rivera Valdez witnesses the same issue with a GeForce GT 525M (GF108M) of the same era, as does another Arch Linux user named "R0AR" with a more recent GeForce GTX 1050 Ti (GP107M).
The commit exposes the discrete GPU's HDA controller and all four codecs on the controller do not set the CLKSTOP and EPSS bits in the Supported Power States Response. They also do not set the PS-ClkStopOk bit in the Get Power State Response. hda_codec_runtime_suspend() therefore does not call snd_hdac_codec_link_down(), which prevents each codec and the PCI device from runtime suspending.
The same issue is present on some AMD discrete GPUs and we addressed it by forcing runtime PM despite the bits not being set, see commit 57cb54e53bdd ("ALSA: hda - Force to link down at runtime suspend on ATI/AMD HDMI").
Do the same for Nvidia HDMI codecs.
--- sound/pci/hda/patch_hdmi.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_hdmi.c +2 -0
@@ -3307,6 +3307,8 @@ static int patch_nvhdmi(struct hda_codec nvhdmi_chmap_cea_alloc_validate_get_type; spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; + codec->link_down_at_suspend =1 ; +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 102/197 USB: serial: ti_usb_3410_5052: fix port-close races
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 6f1d1dc8d540a9aa6e39b9cb86d3a67bbc1c8d8d upstream.
Fix races between closing a port and opening or closing another port on the same device which could lead to a failure to start or stop the shared interrupt URB. The latter could potentially cause a use-after-free or worse in the completion handler on driver unbind.
--- drivers/usb/serial/ti_usb_3410_5052.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/usb/serial/ti_usb_3410_5052.c +3 -7
@@ -776,7 +776,6 @@ static void ti_close(struct usb_serial_pstruct ti_port *tport;int port_number;int status; -int do_unlock;unsigned long flags; tdev =usb_get_serial_data (port->serial);
@@ -800,16 +799,13 @@ static void ti_close(struct usb_serial_p"%s - cannot send close port command, %d\n" , __func__, status); -/* if mutex_lock is interrupted, continue anyway */ - do_unlock = !mutex_lock_interruptible (&tdev->td_open_close_lock); +mutex_lock (&tdev->td_open_close_lock); --tport->tp_tdev->td_open_port_count; -if (tport->tp_tdev->td_open_port_count <=0 ) { +if (tport->tp_tdev->td_open_port_count ==0 ) {/* last port is closed, shut down interrupt urb */ usb_kill_urb (port->serial->port[0 ]->interrupt_in_urb); - tport->tp_tdev->td_open_port_count =0 ; } -if (do_unlock) -mutex_unlock (&tdev->td_open_close_lock); +mutex_unlock (&tdev->td_open_close_lock); }
Greg Kroah-Hartman
maintainerPATCH 101/197 usb: udc: lpc32xx: fix bad bit shift operation
In reply to Greg Kroah-HartmanFrom: Gustavo A. R. Silva <[email protected]>
commit b987b66ac3a2bc2f7b03a0ba48a07dc553100c07 upstream.
It seems that the right variable to use in this case is *i*, instead of *n*, otherwise there is an undefined behavior when right shifiting by more than 31 bits when multiplying n by 8; notice that *n* can take values equal or greater than 4 (4, 8, 16, ...).
Also, notice that under the current conditions (bl = 3), we are skiping the handling of bytes 3, 7, 31... So, fix this by updating this logic and limit *bl* up to 4 instead of up to 3.
This fix is based on function udc_stuff_fifo().
Addresses-Coverity-ID: 1454834 ("Bad bit shift operation")
--- drivers/usb/gadget/udc/lpc32xx_udc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/gadget/udc/lpc32xx_udc.c +3 -3
@@ -1180,11 +1180,11 @@ static void udc_pop_fifo(struct lpc32xx_ tmp =readl (USBD_RXDATA (udc->udp_baseaddr)); bl = bytes - n; -if (bl >3 ) - bl =3 ; +if (bl >4 ) + bl =4 ;for (i =0 ; i < bl; i++) - data[n + i] = (u8) ((tmp >> (n *8 )) &0xFF ); + data[n + i] = (u8) ((tmp >> (i *8 )) &0xFF ); }break ;
Greg Kroah-Hartman
maintainerPATCH 104/197 USB: usblp: fix use-after-free on disconnect
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 7a759197974894213621aa65f0571b51904733d6 upstream.
A recent commit addressing a runtime PM use-count regression, introduced a use-after-free by not making sure we held a reference to the struct usb_interface for the lifetime of the driver data.
--- drivers/usb/class/usblp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/class/usblp.c +3 -1
@@ -445,6 +445,7 @@ static void usblp_cleanup(struct usblp *kfree (usblp->readbuf);kfree (usblp->device_id_string);kfree (usblp->statusbuf); +usb_put_intf (usblp->intf);kfree (usblp); }
@@ -1107,7 +1108,7 @@ static int usblp_probe(struct usb_interfinit_waitqueue_head (&usblp->wwait);init_usb_anchor (&usblp->urbs); usblp->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; - usblp->intf = intf; + usblp->intf =usb_get_intf (intf);/* Malloc device ID string buffer to the largest expected length, * since we can re-query it on an ioctl and a dynamic string
@@ -1196,6 +1197,7 @@ abort:kfree (usblp->readbuf);kfree (usblp->statusbuf);kfree (usblp->device_id_string); +usb_put_intf (usblp->intf);kfree (usblp); abort_ret:return retval;
Greg Kroah-Hartman
maintainerPATCH 103/197 USB: ldusb: fix memleak on disconnect
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit b14a39048c1156cfee76228bf449852da2f14df8 upstream.
If disconnect() races with release() after a process has been interrupted, release() could end up returning early and the driver would fail to free its driver data.
--- drivers/usb/misc/ldusb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/misc/ldusb.c +1 -4
@@ -380,10 +380,7 @@ static int ld_usb_release(struct inode * goto exit; } -if (mutex_lock_interruptible (&dev->mutex)) { - retval = -ERESTARTSYS ; - goto exit; - } +mutex_lock (&dev->mutex);if (dev->open_count !=1 ) { retval = -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 105/197 USB: ldusb: fix read info leaks
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 7a6f22d7479b7a0b68eadd308a997dd64dda7dae upstream.
Fix broken read implementation, which could be used to trigger slab info leaks.
The driver failed to check if the custom ring buffer was still empty when waking up after having waited for more data. This would happen on every interrupt-in completion, even if no data had been added to the ring buffer (e.g. on disconnect events).
Due to missing sanity checks and uninitialised (kmalloced) ring-buffer entries, this meant that huge slab info leaks could easily be triggered.
Note that the empty-buffer check after wakeup is enough to fix the info leak on disconnect, but let's clear the buffer on allocation and add a sanity check to read() to prevent further leaks.
--- drivers/usb/misc/ldusb.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/usb/misc/ldusb.c +11 -7
@@ -464,7 +464,7 @@ static ssize_t ld_usb_read(struct file */* wait for data */ spin_lock_irq (&dev->rbsl); -if (dev->ring_head == dev->ring_tail) { +while (dev->ring_head == dev->ring_tail) { dev->interrupt_in_done =0 ;spin_unlock_irq (&dev->rbsl);if (file->f_flags &O_NONBLOCK ) {
@@ -474,12 +474,17 @@ static ssize_t ld_usb_read(struct file * retval =wait_event_interruptible (dev->read_wait, dev->interrupt_in_done);if (retval <0 ) goto unlock_exit; - }else { -spin_unlock_irq (&dev->rbsl); + +spin_lock_irq (&dev->rbsl); } +spin_unlock_irq (&dev->rbsl);/* actual_buffer contains actual_length + interrupt_in_buffer */ actual_buffer = (size_t *)(dev->ring_buffer + dev->ring_tail * (sizeof (size_t )+dev->interrupt_in_endpoint_size)); +if (*actual_buffer > dev->interrupt_in_endpoint_size) { + retval = -EIO ; + goto unlock_exit; + } bytes_to_read =min (count, *actual_buffer);if (bytes_to_read < *actual_buffer) dev_warn(&dev->intf->dev, "Read buffer overflow, %zd bytes dropped\n",
@@ -690,10 +695,9 @@ static int ld_usb_probe(struct usb_interdev_warn (&intf->dev,"Interrupt out endpoint not found (using control endpoint instead)\n" ); dev->interrupt_in_endpoint_size =usb_endpoint_maxp (dev->interrupt_in_endpoint); - dev->ring_buffer = -kmalloc_array (ring_buffer_size, -sizeof (size_t ) + dev->interrupt_in_endpoint_size, -GFP_KERNEL ); + dev->ring_buffer =kcalloc (ring_buffer_size, +sizeof (size_t ) + dev->interrupt_in_endpoint_size, +GFP_KERNEL );if (!dev->ring_buffer) goto error; dev->interrupt_in_buffer =kmalloc (dev->interrupt_in_endpoint_size,GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 107/197 MIPS: tlbex: Fix build_restore_pagemask KScratch restore
In reply to Greg Kroah-HartmanFrom: Paul Burton <[email protected]>
commit b42aa3fd5957e4daf4b69129e5ce752a2a53e7d6 upstream.
build_restore_pagemask() will restore the value of register $1/$at when its restore_scratch argument is non-zero, and aims to do so by filling a branch delay slot. Commit 0b24cae4d535 ("MIPS: Add missing EHB in mtc0 -> mfc0 sequence.") added an EHB instruction (Execution Hazard Barrier) prior to restoring $1 from a KScratch register, in order to resolve a hazard that can result in stale values of the KScratch register being observed. In particular, P-class CPUs from MIPS with out of order execution pipelines such as the P5600 & P6600 are affected.
Unfortunately this EHB instruction was inserted in the branch delay slot causing the MFC0 instruction which performs the restoration to no longer execute along with the branch. The result is that the $1 register isn't actually restored, ie. the TLB refill exception handler clobbers it - which is exactly the problem the EHB is meant to avoid for the P-class CPUs.
Similarly build_get_pgd_vmalloc() will restore the value of $1/$at when its mode argument equals refill_scratch, and suffers from the same problem.
Fix this by in both cases moving the EHB earlier in the emitted code. There's no reason it needs to immediately precede the MFC0 - it simply needs to be between the MTC0 & MFC0.
This bug only affects Cavium Octeon systems which use build_fast_tlb_refill_handler().
--- arch/mips/mm/tlbex.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
arch/mips/mm/tlbex.c +15 -8
@@ -655,6 +655,13 @@ static void build_restore_pagemask(u32 * int restore_scratch) {if (restore_scratch) { +/* +* Ensure the MFC0 below observes the value written to the +* KScratch register by the prior MTC0. +*/ +if (scratch_reg >=0 ) +uasm_i_ehb (p); +/* Reset default page size */ if (PM_DEFAULT_MASK >>16 ) {uasm_i_lui (p, tmp,PM_DEFAULT_MASK >>16 );
@@ -669,12 +676,10 @@ static void build_restore_pagemask(u32 *uasm_i_mtc0 (p,0 ,C0_PAGEMASK );uasm_il_b (p, r, lid); } -if (scratch_reg >=0 ) { -uasm_i_ehb (p); +if (scratch_reg >=0 )UASM_i_MFC0 (p,1 ,c0_kscratch (), scratch_reg); - }else { +else UASM_i_LW (p,1 ,scratchpad_offset (0 ),0 ); - } }else {/* Reset default page size */ if (PM_DEFAULT_MASK >>16 ) {
@@ -923,6 +928,10 @@ build_get_pgd_vmalloc64(u32 **p, struct }if (mode != not_refill && check_for_high_segbits) {uasm_l_large_segbits_fault (l, *p); + +if (mode == refill_scratch && scratch_reg >=0 ) +uasm_i_ehb (p); +/* * We get here if we are an xsseg address, or if we are * an xuseg address above (PGDIR_SHIFT+PGDIR_BITS) boundary.
@@ -941,12 +950,10 @@ build_get_pgd_vmalloc64(u32 **p, structuasm_i_jr (p, ptr);if (mode == refill_scratch) { -if (scratch_reg >=0 ) { -uasm_i_ehb (p); +if (scratch_reg >=0 )UASM_i_MFC0 (p,1 ,c0_kscratch (), scratch_reg); - }else { +else UASM_i_LW (p,1 ,scratchpad_offset (0 ),0 ); - } }else {uasm_i_nop (p); }
Greg Kroah-Hartman
maintainerPATCH 108/197 staging: wlan-ng: fix exit return when sme->key_idx >= NUM_WEPKEYS
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
commit 153c5d8191c26165dbbd2646448ca7207f7796d0 upstream.
Currently the exit return path when sme->key_idx >= NUM_WEPKEYS is via label 'exit' and this checks if result is non-zero, however result has not been initialized and contains garbage. Fix this by replacing the goto with a return with the error code.
Addresses-Coverity: ("Uninitialized scalar variable")
--- drivers/staging/wlan-ng/cfg80211.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/wlan-ng/cfg80211.c +2 -4
@@ -469,10 +469,8 @@ static int prism2_connect(struct wiphy */* Set the encryption - we only support wep */ if (is_wep) {if (sme->key) { -if (sme->key_idx >=NUM_WEPKEYS ) { - err = -EINVAL ; - goto exit; - } +if (sme->key_idx >=NUM_WEPKEYS ) +return -EINVAL ; result = prism2_domibset_uint32(wlandev, DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
Greg Kroah-Hartman
maintainerPATCH 109/197 scsi: zfcp: fix reaction on bit error threshold notification
In reply to Greg Kroah-HartmanFrom: Steffen Maier <[email protected]>
commit 2190168aaea42c31bff7b9a967e7b045f07df095 upstream.
On excessive bit errors for the FCP channel ingress fibre path, the channel notifies us. Previously, we only emitted a kernel message and a trace record. Since performance can become suboptimal with I/O timeouts due to bit errors, we now stop using an FCP device by default on channel notification so multipath on top can timely failover to other paths. A new module parameter zfcp.ber_stop can be used to get zfcp old behavior.
User explanation of new kernel message:
* Description:
* The FCP channel reported that its bit error threshold has been exceeded.
* These errors might result from a problem with the physical components
* of the local fibre link into the FCP channel.
* The problem might be damage or malfunction of the cable or
* cable connection between the FCP channel and
* the adjacent fabric switch port or the point-to-point peer.
* Find details about the errors in the HBA trace for the FCP device.
* The zfcp device driver closed down the FCP device
* to limit the performance impact from possible I/O command timeouts.
* User action:
* Check for problems on the local fibre link, ensure that fibre optics are
* clean and functional, and all cables are properly plugged.
* After the repair action, you can manually recover the FCP device by
* writing "0" into its "failed" sysfs attribute.
* If recovery through sysfs is not possible, set the CHPID of the device
* offline and back online on the service element.
--- drivers/s390/scsi/zfcp_fsf.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/s390/scsi/zfcp_fsf.c +13 -3
@@ -27,6 +27,11 @@struct kmem_cache *zfcp_fsf_qtcb_cache; +static bool ber_stop = true; +module_param (ber_stop, bool,0600 ); +MODULE_PARM_DESC (ber_stop, +"Shuts down FCP devices for FCP channels that report a bit-error count in excess of its threshold (default on)" ); +static void zfcp_fsf_request_timeout_handler (struct timer_list *t) {struct zfcp_fsf_req *fsf_req =from_timer (fsf_req, t, timer);
@@ -236,10 +241,15 @@ static void zfcp_fsf_status_read_handlercase FSF_STATUS_READ_SENSE_DATA_AVAIL :break ;case FSF_STATUS_READ_BIT_ERROR_THRESHOLD : -dev_warn (&adapter->ccw_device->dev, -"The error threshold for checksum statistics " -"has been exceeded\n" );zfcp_dbf_hba_bit_err ("fssrh_3" , req); +if (ber_stop) { +dev_warn (&adapter->ccw_device->dev, +"All paths over this FCP device are disused because of excessive bit errors\n" ); +zfcp_erp_adapter_shutdown (adapter,0 ,"fssrh_b" ); + }else { +dev_warn (&adapter->ccw_device->dev, +"The error threshold for checksum statistics has been exceeded\n" ); + }break ;case FSF_STATUS_READ_LINK_DOWN :zfcp_fsf_status_read_link_down (req);
Greg Kroah-Hartman
maintainerPATCH 110/197 scsi: sd: Ignore a failure to sync cache due to lack of authorization
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit 21e3d6c81179bbdfa279efc8de456c34b814cfd2 upstream.
I've got a report about a UAS drive enclosure reporting back Sense: Logical unit access not authorized if the drive it holds is password protected. While the drive is obviously unusable in that state as a mass storage device, it still exists as a sd device and when the system is asked to perform a suspend of the drive, it will be sent a SYNCHRONIZE CACHE. If that fails due to password protection, the error must be ignored.
--- drivers/scsi/sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/sd.c +2 -1
@@ -1655,7 +1655,8 @@ static int sd_sync_cache(struct scsi_dis/* we need to evaluate the error return */ if (scsi_sense_valid (sshdr) && (sshdr->asc ==0x3a ||/* medium not present */ - sshdr->asc ==0x20 ))/* invalid command */ + sshdr->asc ==0x20 ||/* invalid command */ + (sshdr->asc ==0x74 && sshdr->ascq ==0x71 )))/* drive is password locked */ /* this is no error here */ return 0 ;
Greg Kroah-Hartman
maintainerPATCH 111/197 scsi: core: save/restore command resid for error handling
In reply to Greg Kroah-HartmanFrom: Damien Le Moal <[email protected]>
commit 8f8fed0cdbbd6cdbf28d9ebe662f45765d2f7d39 upstream.
When a non-passthrough command is terminated with CHECK CONDITION, request sense is executed by hijacking the command descriptor. Since scsi_eh_prep_cmnd() and scsi_eh_restore_cmnd() do not save/restore the original command resid, the value returned on failure of the original command is lost and replaced with the value set by the execution of the request sense command. This value may in many instances be unaligned to the device sector size, causing sd_done() to print a warning message about the incorrect unaligned resid before the command is retried.
Fix this problem by saving the original command residual in struct scsi_eh_save using scsi_eh_prep_cmnd() and restoring it in scsi_eh_restore_cmnd(). In addition, to make sure that the request sense command is executed with a correctly initialized command structure, also reset the residual to 0 in scsi_eh_prep_cmnd() after saving the original command value in struct scsi_eh_save.
--- drivers/scsi/scsi_error.c | 3 +++ include/scsi/scsi_eh.h | 1 + 2 files changed, 4 insertions(+)
drivers/scsi/scsi_error.c +3 -0
@@ -967,6 +967,7 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd ses->data_direction = scmd->sc_data_direction; ses->sdb = scmd->sdb; ses->result = scmd->result; + ses->resid_len = scmd->req.resid_len; ses->underflow = scmd->underflow; ses->prot_op = scmd->prot_op; ses->eh_eflags = scmd->eh_eflags;
@@ -977,6 +978,7 @@ void scsi_eh_prep_cmnd(struct scsi_cmndmemset (scmd->cmnd,0 ,BLK_MAX_CDB );memset (&scmd->sdb,0 ,sizeof (scmd->sdb)); scmd->result =0 ; + scmd->req.resid_len =0 ;if (sense_bytes) { scmd->sdb.length = min_t(unsigned, SCSI_SENSE_BUFFERSIZE,
@@ -1029,6 +1031,7 @@ void scsi_eh_restore_cmnd(struct scsi_cm scmd->sc_data_direction = ses->data_direction; scmd->sdb = ses->sdb; scmd->result = ses->result; + scmd->req.resid_len = ses->resid_len; scmd->underflow = ses->underflow; scmd->prot_op = ses->prot_op; scmd->eh_eflags = ses->eh_eflags;
include/scsi/scsi_eh.h +1 -0
@@ -32,6 +32,7 @@ extern int scsi_ioctl_reset(struct scsi_struct scsi_eh_save {/* saved state */ int result; +unsigned int resid_len;int eh_eflags;enum dma_data_direction data_direction;unsigned underflow;
Greg Kroah-Hartman
maintainerPATCH 112/197 scsi: core: try to get module before removing device
In reply to Greg Kroah-HartmanFrom: Yufen Yu <[email protected]>
commit 77c301287ebae86cc71d03eb3806f271cb14da79 upstream.
We have a test case like block/001 in blktests, which will create a scsi device by loading scsi_debug module and then try to delete the device by sysfs interface. At the same time, it may remove the scsi_debug module.
And getting a invalid paging request BUG_ON as following:
[ 34.625854] BUG: unable to handle page fault for address: ffffffffa0016bb8 [ 34.629189] Oops: 0000 [#1] SMP PTI [ 34.629618] CPU: 1 PID: 450 Comm: bash Tainted: G W 5.4.0-rc3+ #473 [ 34.632524] RIP: 0010:scsi_proc_hostdir_rm+0x5/0xa0 [ 34.643555] CR2: ffffffffa0016bb8 CR3: 000000012cd88000 CR4: 00000000000006e0 [ 34.644545] Call Trace: [ 34.644907] scsi_host_dev_release+0x6b/0x1f0 [ 34.645511] device_release+0x74/0x110 [ 34.646046] kobject_put+0x116/0x390 [ 34.646559] put_device+0x17/0x30 [ 34.647041] scsi_target_dev_release+0x2b/0x40 [ 34.647652] device_release+0x74/0x110 [ 34.648186] kobject_put+0x116/0x390 [ 34.648691] put_device+0x17/0x30 [ 34.649157] scsi_device_dev_release_usercontext+0x2e8/0x360 [ 34.649953] execute_in_process_context+0x29/0x80 [ 34.650603] scsi_device_dev_release+0x20/0x30 [ 34.651221] device_release+0x74/0x110 [ 34.651732] kobject_put+0x116/0x390 [ 34.652230] sysfs_unbreak_active_protection+0x3f/0x50 [ 34.652935] sdev_store_delete.cold.4+0x71/0x8f [ 34.653579] dev_attr_store+0x1b/0x40 [ 34.654103] sysfs_kf_write+0x3d/0x60 [ 34.654603] kernfs_fop_write+0x174/0x250 [ 34.655165] __vfs_write+0x1f/0x60 [ 34.655639] vfs_write+0xc7/0x280 [ 34.656117] ksys_write+0x6d/0x140 [ 34.656591] __x64_sys_write+0x1e/0x30 [ 34.657114] do_syscall_64+0xb1/0x400 [ 34.657627] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 34.658335] RIP: 0033:0x7f156f337130
During deleting scsi target, the scsi_debug module have been removed. Then, sdebug_driver_template belonged to the module cannot be accessd, resulting in scsi_proc_hostdir_rm() BUG_ON.
To fix the bug, we add scsi_device_get() in sdev_store_delete() to try to increase refcount of module, avoiding the module been removed.
--- drivers/scsi/scsi_sysfs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/scsi/scsi_sysfs.c +10 -1
@@ -730,6 +730,14 @@ sdev_store_delete(struct device *dev, st const char *buf, size_t count) {struct kernfs_node *kn; +struct scsi_device *sdev =to_scsi_device (dev); + +/* +* We need to try to get module, avoiding the module been removed +* during delete. +*/ +if (scsi_device_get (sdev)) +return -ENODEV ; kn =sysfs_break_active_protection (&dev->kobj, &attr->attr);WARN_ON_ONCE (!kn);
@@ -744,9 +752,10 @@ sdev_store_delete(struct device *dev, st* state into SDEV_DEL. */ device_remove_file (dev, attr); -scsi_remove_device (to_scsi_device (dev)); +scsi_remove_device (sdev);if (kn)sysfs_unbreak_active_protection (kn); +scsi_device_put (sdev);return count; }; static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);
Greg Kroah-Hartman
maintainerPATCH 113/197 scsi: ch: Make it possible to open a ch device multiple times again
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
commit 6a0990eaa768dfb7064f06777743acc6d392084b upstream.
Clearing ch->device in ch_release() is wrong because that pointer must remain valid until ch_remove() is called. This patch fixes the following crash the second time a ch device is opened:
BUG: kernel NULL pointer dereference, address: 0000000000000790 RIP: 0010:scsi_device_get+0x5/0x60 Call Trace: ch_open+0x4c/0xa0 [ch] chrdev_open+0xa2/0x1c0 do_dentry_open+0x13a/0x380 path_openat+0x591/0x1470 do_filp_open+0x91/0x100 do_sys_open+0x184/0x220 do_syscall_64+0x5f/0x1a0 entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- drivers/scsi/ch.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/ch.c +0 -1
@@ -579,7 +579,6 @@ ch_release(struct inode *inode, struct fscsi_changer *ch = file->private_data;scsi_device_put (ch->device); - ch->device =NULL ; file->private_data =NULL ;kref_put (&ch->ref, ch_destroy);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 114/197 Revert "Input: elantech - enable SMBus on new (2018+) systems"
In reply to Greg Kroah-HartmanFrom: Kai-Heng Feng <[email protected]>
commit c324345ce89c3cc50226372960619c7ee940f616 upstream.
This reverts commit 883a2a80f79ca5c0c105605fafabd1f3df99b34c.
Apparently use dmi_get_bios_year() as manufacturing date isn't accurate and this breaks older laptops with new BIOS update.
So let's revert this patch.
There are still new HP laptops still need to use SMBus to support all features, but it'll be enabled via a whitelist.
--- drivers/input/mouse/elantech.c | 55 +++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 26 deletions(-)
drivers/input/mouse/elantech.c +29 -26
@@ -1827,31 +1827,6 @@ static int elantech_create_smbus(struct leave_breadcrumbs); } -static bool elantech_use_host_notify (struct psmouse *psmouse, -struct elantech_device_info *info) -{ -if (ETP_NEW_IC_SMBUS_HOST_NOTIFY (info->fw_version)) -return true; - -switch (info->bus) { -case ETP_BUS_PS2_ONLY : -/* expected case */ -break ; -case ETP_BUS_SMB_HST_NTFY_ONLY : -case ETP_BUS_PS2_SMB_HST_NTFY : -/* SMbus implementation is stable since 2018 */ -if (dmi_get_bios_year () >=2018 ) -return true; -/* fall through */ -default : -psmouse_dbg (psmouse, -"Ignoring SMBus bus provider %d\n" , info->bus); -break ; - } - -return false; -} -/** * elantech_setup_smbus - called once the PS/2 devices are enumerated * and decides to instantiate a SMBus InterTouch device.
@@ -1871,7 +1846,7 @@ static int elantech_setup_smbus(struct p* i2c_blacklist_pnp_ids. * Old ICs are up to the user to decide. */ -if (!elantech_use_host_notify (psmouse, info) || +if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY (info->fw_version) ||psmouse_matches_pnp_id (psmouse, i2c_blacklist_pnp_ids))return -ENXIO ; }
@@ -1891,6 +1866,34 @@ static int elantech_setup_smbus(struct preturn 0 ; } +static bool elantech_use_host_notify (struct psmouse *psmouse, +struct elantech_device_info *info) +{ +if (ETP_NEW_IC_SMBUS_HOST_NOTIFY (info->fw_version)) +return true; + +switch (info->bus) { +case ETP_BUS_PS2_ONLY : +/* expected case */ +break ; +case ETP_BUS_SMB_ALERT_ONLY : +/* fall-through */ +case ETP_BUS_PS2_SMB_ALERT : +psmouse_dbg (psmouse,"Ignoring SMBus provider through alert protocol.\n" ); +break ; +case ETP_BUS_SMB_HST_NTFY_ONLY : +/* fall-through */ +case ETP_BUS_PS2_SMB_HST_NTFY : +return true; +default : +psmouse_dbg (psmouse, +"Ignoring SMBus bus provider %d.\n" , + info->bus); + } + +return false; +} +int elantech_init_smbus (struct psmouse *psmouse) {struct elantech_device_info info;
Greg Kroah-Hartman
maintainerPATCH 88/197 net/sched: fix corrupted L2 header with MPLS push and pop actions
In reply to Greg Kroah-HartmanFrom: Davide Caratti <[email protected]>
[ Upstream commit fa4e0f8855fcba600e0be2575ee29c69166f74bd ]
the following script:
# tc qdisc add dev eth0 clsact # tc filter add dev eth0 egress protocol ip matchall \
Quoted 1 line
action mpls push protocol
mpls_uclabel0x355aabos 1
causes corruption of all IP packets transmitted by eth0. On TC egress, we can't rely on the value of skb->mac_len, because it's 0 and a MPLS 'push' operation will result in an overwrite of the first 4 octets in the packet L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same error pattern is present also in the MPLS 'pop' operation. Fix this error in act_mpls data plane, computing 'mac_len' as the difference between the network header and the mac header (when not at TC ingress), and use it in MPLS 'push'/'pop' core functions.
v2: unbreak 'make htmldocs' because of missing documentation of 'mac_len'
in skb_mpls_pop(), reported by kbuild test robot
--- include/linux/skbuff.h | 5 +++-- net/core/skbuff.c | 19 +++++++++++-------- net/openvswitch/actions.c | 5 +++-- net/sched/act_mpls.c | 12 ++++++++---- 4 files changed, 25 insertions(+), 16 deletions(-)
include/linux/skbuff.h +3 -2
@@ -3465,8 +3465,9 @@ int skb_ensure_writable(struct sk_buff *int __skb_vlan_pop (struct sk_buff *skb,u16 *vlan_tci);int skb_vlan_pop (struct sk_buff *skb);int skb_vlan_push (struct sk_buff *skb,__be16 vlan_proto,u16 vlan_tci); -int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto); -int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto); +int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto, +int mac_len); +int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len);int skb_mpls_update_lse (struct sk_buff *skb,__be32 mpls_lse);int skb_mpls_dec_ttl (struct sk_buff *skb); struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy,
net/core/skbuff.c +11 -8
@@ -5465,12 +5465,14 @@ static void skb_mod_eth_type(struct sk_b* @skb: buffer * @mpls_lse: MPLS label stack entry to push * @mpls_proto: ethertype of the new MPLS header (expects 0x8847 or 0x8848) +* @mac_len: length of the MAC header * * Expects skb->data at mac header. * * Returns 0 on success, -errno otherwise. */ -int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto) +int skb_mpls_push (struct sk_buff *skb,__be32 mpls_lse,__be16 mpls_proto, +int mac_len) {struct mpls_shim_hdr *lse;int err;
@@ -5487,15 +5489,15 @@ int skb_mpls_push(struct sk_buff *skb, _return err;if (!skb->inner_protocol) { -skb_set_inner_network_header (skb, skb->mac_len); +skb_set_inner_network_header (skb, mac_len);skb_set_inner_protocol (skb, skb->protocol); }skb_push (skb,MPLS_HLEN );memmove (skb_mac_header (skb) -MPLS_HLEN ,skb_mac_header (skb), - skb->mac_len); + mac_len);skb_reset_mac_header (skb); -skb_set_network_header (skb, skb->mac_len); +skb_set_network_header (skb, mac_len); lse =mpls_hdr (skb); lse->label_stack_entry = mpls_lse;
@@ -5514,29 +5516,30 @@ EXPORT_SYMBOL_GPL(skb_mpls_push);* * @skb: buffer * @next_proto: ethertype of header after popped MPLS header +* @mac_len: length of the MAC header * * Expects skb->data at mac header. * * Returns 0 on success, -errno otherwise. */ -int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto) +int skb_mpls_pop (struct sk_buff *skb,__be16 next_proto,int mac_len) {int err;if (unlikely (!eth_p_mpls (skb->protocol)))return 0 ; - err =skb_ensure_writable (skb, skb->mac_len +MPLS_HLEN ); + err =skb_ensure_writable (skb, mac_len +MPLS_HLEN );if (unlikely (err))return err;skb_postpull_rcsum (skb,mpls_hdr (skb),MPLS_HLEN );memmove (skb_mac_header (skb) +MPLS_HLEN ,skb_mac_header (skb), - skb->mac_len); + mac_len);__skb_pull (skb,MPLS_HLEN );skb_reset_mac_header (skb); -skb_set_network_header (skb, skb->mac_len); +skb_set_network_header (skb, mac_len);if (skb->dev && skb->dev->type ==ARPHRD_ETHER ) {struct ethhdr *hdr;
net/openvswitch/actions.c +3 -2
@@ -165,7 +165,8 @@ static int push_mpls(struct sk_buff *skb {int err; - err =skb_mpls_push (skb, mpls->mpls_lse, mpls->mpls_ethertype); + err =skb_mpls_push (skb, mpls->mpls_lse, mpls->mpls_ethertype, + skb->mac_len);if (err)return err;
@@ -178,7 +179,7 @@ static int pop_mpls(struct sk_buff *skb, {int err; - err =skb_mpls_pop (skb, ethertype); + err =skb_mpls_pop (skb, ethertype, skb->mac_len);if (err)return err;
net/sched/act_mpls.c +8 -4
@@ -55,7 +55,7 @@ static int tcf_mpls_act(struct sk_buff *struct tcf_mpls *m =to_mpls (a);struct tcf_mpls_params *p;__be32 new_lse; -int ret; +int ret, mac_len;tcf_lastuse_update (&m->tcf_tm);bstats_cpu_update (this_cpu_ptr (m->common.cpu_bstats), skb);
@@ -63,8 +63,12 @@ static int tcf_mpls_act(struct sk_buff */* Ensure 'data' points at mac_header prior calling mpls manipulating * functions. */ -if (skb_at_tc_ingress (skb)) +if (skb_at_tc_ingress (skb)) {skb_push_rcsum (skb, skb->mac_len); + mac_len = skb->mac_len; + }else { + mac_len =skb_network_header (skb) -skb_mac_header (skb); + } ret =READ_ONCE (m->tcf_action);
@@ -72,12 +76,12 @@ static int tcf_mpls_act(struct sk_buff *switch (p->tcfm_action) {case TCA_MPLS_ACT_POP : -if (skb_mpls_pop (skb, p->tcfm_proto)) +if (skb_mpls_pop (skb, p->tcfm_proto, mac_len)) goto drop;break ;case TCA_MPLS_ACT_PUSH : new_lse =tcf_mpls_get_lse (NULL , p, !eth_p_mpls (skb->protocol)); -if (skb_mpls_push (skb, new_lse, p->tcfm_proto)) +if (skb_mpls_push (skb, new_lse, p->tcfm_proto, mac_len)) goto drop;break ;case TCA_MPLS_ACT_MODIFY :
Greg Kroah-Hartman
maintainerPATCH 115/197 Input: da9063 - fix capability and drop KEY_SLEEP
In reply to Greg Kroah-HartmanFrom: Marco Felsch <[email protected]>
commit afce285b859cea91c182015fc9858ea58c26cd0e upstream.
Since commit f889beaaab1c ("Input: da9063 - report KEY_POWER instead of KEY_SLEEP during power key-press") KEY_SLEEP isn't supported anymore. This caused input device to not generate any events if "dlg,disable-key-power" is set.
Fix this by unconditionally setting KEY_POWER capability, and not declaring KEY_SLEEP.
--- drivers/input/misc/da9063_onkey.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/input/misc/da9063_onkey.c +1 -4
@@ -232,10 +232,7 @@ static int da9063_onkey_probe(struct pla onkey->input->phys = onkey->phys; onkey->input->dev.parent = &pdev->dev; -if (onkey->key_power) -input_set_capability (onkey->input,EV_KEY ,KEY_POWER ); - -input_set_capability (onkey->input,EV_KEY ,KEY_SLEEP ); +input_set_capability (onkey->input,EV_KEY ,KEY_POWER );INIT_DELAYED_WORK (&onkey->work, da9063_poll_on);
Greg Kroah-Hartman
maintainerPATCH 118/197 ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting
In reply to Greg Kroah-HartmanFrom: Junya Monden <[email protected]>
commit 22e58665a01006d05f0239621f7d41cacca96cc4 upstream.
Unlike other format-related DAI parameters, rdai->bit_clk_inv flag is not properly re-initialized when setting format for new stream processing. The inversion, if requested, is then applied not to default, but to a previous value, which leads to SCKP bit in SSICR register being set incorrectly.
Fix this by re-setting the flag to its initial value, determined by format.
--- sound/soc/sh/rcar/core.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/sh/rcar/core.c +1 -0
@@ -761,6 +761,7 @@ static int rsnd_soc_dai_set_fmt(struct s }/* set format */ + rdai->bit_clk_inv =0 ;switch (fmt &SND_SOC_DAIFMT_FORMAT_MASK ) {case SND_SOC_DAIFMT_I2S : rdai->sys_delay =0 ;
Greg Kroah-Hartman
maintainerPATCH 117/197 Input: st1232 - fix reporting multitouch coordinates
In reply to Greg Kroah-HartmanFrom: Dixit Parmar <[email protected]>
commit b1a402e75a5f5127ff1ffff0615249f98df8b7b3 upstream.
For Sitronix st1633 multi-touch controller driver the coordinates reported for multiple fingers were wrong, as it was always taking LSB of coordinates from the first contact data.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204561
--- drivers/input/touchscreen/st1232.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/input/touchscreen/st1232.c +4 -2
@@ -81,8 +81,10 @@ static int st1232_ts_read_data(struct stfor (i =0 , y =0 ; i < ts->chip_info->max_fingers; i++, y +=3 ) { finger[i].is_valid = buf[i + y] >>7 ;if (finger[i].is_valid) { - finger[i].x = ((buf[i + y] &0x0070 ) <<4 ) | buf[i +1 ]; - finger[i].y = ((buf[i + y] &0x0007 ) <<8 ) | buf[i +2 ]; + finger[i].x = ((buf[i + y] &0x0070 ) <<4 ) | + buf[i + y +1 ]; + finger[i].y = ((buf[i + y] &0x0007 ) <<8 ) | + buf[i + y +2 ];/* st1232 includes a z-axis / touch strength */ if (ts->chip_info->have_z)
Greg Kroah-Hartman
maintainerPATCH 120/197 ACPI: NFIT: Fix unlock on error in scrub_show()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit edffc70f505abdab885f4b4212438b4298dec78f upstream.
We change the locking in this function and forgot to update this error path so we are accidentally still holding the "dev->lockdep_mutex".
--- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/core.c +1 -1
@@ -1322,7 +1322,7 @@ static ssize_t scrub_show(struct devicenfit_device_lock (dev); nd_desc =dev_get_drvdata (dev);if (!nd_desc) { -device_unlock (dev); +nfit_device_unlock (dev);return rc; } acpi_desc =to_acpi_desc (nd_desc);
Greg Kroah-Hartman
maintainerPATCH 119/197 ACPI: CPPC: Set pcc_data[pcc_ss_id] to NULL in acpi_cppc_processor_exit()
In reply to Greg Kroah-HartmanFrom: John Garry <[email protected]>
commit 56a0b978d42f58c7e3ba715cf65af487d427524d upstream.
When enabling KASAN and DEBUG_TEST_DRIVER_REMOVE, I find this KASAN warning:
[ 20.872057] BUG: KASAN: use-after-free in pcc_data_alloc+0x40/0xb8 [ 20.878226] Read of size 4 at addr ffff00236cdeb684 by task swapper/0/1 [ 20.884826] [ 20.886309] CPU: 19 PID: 1 Comm: swapper/0 Not tainted 5.4.0-rc1-00009-ge7f7df3db5bf-dirty #289 [ 20.894994] Hardware name: Huawei D06 /D06, BIOS Hisilicon D06 UEFI RC0 - V1.16.01 03/15/2019 [ 20.903505] Call trace: [ 20.905942] dump_backtrace+0x0/0x200 [ 20.909593] show_stack+0x14/0x20 [ 20.912899] dump_stack+0xd4/0x130 [ 20.916291] print_address_description.isra.9+0x6c/0x3b8 [ 20.921592] __kasan_report+0x12c/0x23c [ 20.925417] kasan_report+0xc/0x18 [ 20.928808] __asan_load4+0x94/0xb8 [ 20.932286] pcc_data_alloc+0x40/0xb8 [ 20.935938] acpi_cppc_processor_probe+0x4e8/0xb08 [ 20.940717] __acpi_processor_start+0x48/0xb0 [ 20.945062] acpi_processor_start+0x40/0x60 [ 20.949235] really_probe+0x118/0x548 [ 20.952887] driver_probe_device+0x7c/0x148 [ 20.957059] device_driver_attach+0x94/0xa0 [ 20.961231] __driver_attach+0xa4/0x110 [ 20.965055] bus_for_each_dev+0xe8/0x158 [ 20.968966] driver_attach+0x30/0x40 [ 20.972531] bus_add_driver+0x234/0x2f0 [ 20.976356] driver_register+0xbc/0x1d0 [ 20.980182] acpi_processor_driver_init+0x40/0xe4 [ 20.984875] do_one_initcall+0xb4/0x254 [ 20.988700] kernel_init_freeable+0x24c/0x2f8 [ 20.993047] kernel_init+0x10/0x118 [ 20.996524] ret_from_fork+0x10/0x18 [ 21.000087] [ 21.001567] Allocated by task 1: [ 21.004785] save_stack+0x28/0xc8 [ 21.008089] __kasan_kmalloc.isra.9+0xbc/0xd8 [ 21.012435] kasan_kmalloc+0xc/0x18 [ 21.015913] pcc_data_alloc+0x94/0xb8 [ 21.019564] acpi_cppc_processor_probe+0x4e8/0xb08 [ 21.024343] __acpi_processor_start+0x48/0xb0 [ 21.028689] acpi_processor_start+0x40/0x60 [ 21.032860] really_probe+0x118/0x548 [ 21.036512] driver_probe_device+0x7c/0x148 [ 21.040684] device_driver_attach+0x94/0xa0 [ 21.044855] __driver_attach+0xa4/0x110 [ 21.048680] bus_for_each_dev+0xe8/0x158 [ 21.052591] driver_attach+0x30/0x40 [ 21.056155] bus_add_driver+0x234/0x2f0 [ 21.059980] driver_register+0xbc/0x1d0 [ 21.063805] acpi_processor_driver_init+0x40/0xe4 [ 21.068497] do_one_initcall+0xb4/0x254 [ 21.072322] kernel_init_freeable+0x24c/0x2f8 [ 21.076667] kernel_init+0x10/0x118 [ 21.080144] ret_from_fork+0x10/0x18 [ 21.083707] [ 21.085186] Freed by task 1: [ 21.088056] save_stack+0x28/0xc8 [ 21.091360] __kasan_slab_free+0x118/0x180 [ 21.095445] kasan_slab_free+0x10/0x18 [ 21.099183] kfree+0x80/0x268 [ 21.102139] acpi_cppc_processor_exit+0x1a8/0x1b8 [ 21.106832] acpi_processor_stop+0x70/0x80 [ 21.110917] really_probe+0x174/0x548 [ 21.114568] driver_probe_device+0x7c/0x148 [ 21.118740] device_driver_attach+0x94/0xa0 [ 21.122912] __driver_attach+0xa4/0x110 [ 21.126736] bus_for_each_dev+0xe8/0x158 [ 21.130648] driver_attach+0x30/0x40 [ 21.134212] bus_add_driver+0x234/0x2f0 [ 21.0x10/0x18 [ 21.161764] [ 21.163244] The buggy address belongs to the object at ffff00236cdeb600 [ 21.163244] which belongs to the cache kmalloc-256 of size 256 [ 21.175750] The buggy address is located 132 bytes inside of [ 21.175750] 256-byte region [ffff00236cdeb600, ffff00236cdeb700) [ 21.187473] The buggy address belongs to the page: [ 21.192254] page:fffffe008d937a00 refcount:1 mapcount:0 mapping:ffff002370c0fa00 index:0x0 compound_mapcount: 0 [ 21.202331] flags: 0x1ffff00000010200(slab|head) [ 21.206940] raw: 1ffff00000010200 dead000000000100 dead000000000122 ffff002370c0fa00 [ 21.214671] raw: 0000000000000000 00000000802a002a 00000001ffffffff 0000000000000000 [ 21.222400] page dumped because: kasan: bad access detected [ 21.227959] [ 21.229438] Memory state around the buggy address: [ 21.234218] ffff00236cdeb580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.241427] ffff00236cdeb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.248637] >ffff00236cdeb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.255845] ^ [ 21.259062] ffff00236cdeb700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.266272] ffff00236cdeb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 21.273480] ==================================================================
It seems that global pcc_data[pcc_ss_id] can be freed in acpi_cppc_processor_exit(), but we may later reference this value, so NULLify it when freed.
Also remove the useless setting of data "pcc_channel_acquired", which we're about to free.
--- drivers/acpi/cppc_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +1 -1
@@ -905,8 +905,8 @@ void acpi_cppc_processor_exit(struct acp pcc_data[pcc_ss_id]->refcount--;if (!pcc_data[pcc_ss_id]->refcount) {pcc_mbox_free_channel (pcc_data[pcc_ss_id]->pcc_channel); - pcc_data[pcc_ss_id]->pcc_channel_acquired =0 ;kfree (pcc_data[pcc_ss_id]); + pcc_data[pcc_ss_id] =NULL ; } } }
Greg Kroah-Hartman
maintainerPATCH 121/197 iwlwifi: pcie: change qu with jf devices to use qu configuration
In reply to Greg Kroah-HartmanFrom: Luca Coelho <[email protected]>
commit aa0cc7dde17bb6b8cc533bbcfe3f53d70e0dd269 upstream.
There were a bunch of devices with qu and jf that were loading the configuration with pu and jf, which is wrong. Fix them all accordingly. Additionally, remove 0x1010 and 0x1210 subsytem IDs from the list, since they are obviously wrong, and 0x0044 and 0x0244, which were duplicate.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 274 +++++++++++++------------- 1 file changed, 137 insertions(+), 137 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +137 -137
@@ -513,31 +513,33 @@ static const struct pci_device_id iwl_hw {IWL_PCI_DEVICE(0x24FD, 0x9074, iwl8265_2ac_cfg)},/* 9000 Series */ - {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, - {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)}, + {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)}, {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)}, {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
@@ -643,34 +645,34 @@ static const struct pci_device_id iwl_hw {IWL_PCI_DEVICE(0x2720, 0x40A4, iwl9462_2ac_cfg_soc)}, {IWL_PCI_DEVICE(0x2720, 0x4234, iwl9560_2ac_cfg_soc)}, {IWL_PCI_DEVICE(0x2720, 0x42A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0034, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9460_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0064, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x00A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x00A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0230, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0238, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x023C, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0260, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x1010, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x30DC, 0x1030, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x1210, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x30DC, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x1552, iwl9560_killer_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x40A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x4234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x30DC, 0x42A4, iwl9462_2ac_cfg_soc)}, + + {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x30DC, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_160_cfg_shared_clk)}, {IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_shared_clk)}, {IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_160_cfg_shared_clk)},
@@ -726,62 +728,60 @@ static const struct pci_device_id iwl_hw {IWL_PCI_DEVICE(0x34F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, {IWL_PCI_DEVICE(0x34F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0034, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0060, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0064, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x00A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x00A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0230, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0238, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x023C, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0260, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x0264, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x02A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x02A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x1010, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x3DF0, 0x1030, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x1210, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x3DF0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x4234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x3DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x00A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0230, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x02A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x1010, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x43F0, 0x1030, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x1210, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x43F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x40A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x4234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0x43F0, 0x42A4, iwl9462_2ac_cfg_soc)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x3DF0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + + {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x43F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0x9DF0, 0x0000, iwl9460_2ac_cfg_soc)}, {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9460_2ac_cfg_soc)}, {IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_160_cfg_soc)},
@@ -821,34 +821,34 @@ static const struct pci_device_id iwl_hw {IWL_PCI_DEVICE(0x9DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, {IWL_PCI_DEVICE(0x9DF0, 0x4234, iwl9560_2ac_cfg_soc)}, {IWL_PCI_DEVICE(0x9DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x00A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0230, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x02A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x1010, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0xA0F0, 0x1030, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x1210, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0xA0F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x40A4, iwl9462_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x4234, iwl9560_2ac_cfg_soc)}, - {IWL_PCI_DEVICE(0xA0F0, 0x42A4, iwl9462_2ac_cfg_soc)}, + + {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x00A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0230, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x1030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA0F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, + {IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_160_cfg_soc)}, {IWL_PCI_DEVICE(0xA370, 0x0034, iwl9560_2ac_cfg_soc)}, {IWL_PCI_DEVICE(0xA370, 0x0038, iwl9560_2ac_160_cfg_soc)},
Greg Kroah-Hartman
maintainerPATCH 123/197 mac80211: Reject malformed SSID elements
In reply to Greg Kroah-HartmanFrom: Will Deacon <[email protected]>
commit 4152561f5da3fca92af7179dd538ea89e248f9d0 upstream.
Although this shouldn't occur in practice, it's a good idea to bounds check the length field of the SSID element prior to using it for things like allocations or memcpy operations.
--- net/mac80211/mlme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +3 -2
@@ -2629,7 +2629,8 @@ struct sk_buff *ieee80211_ap_probereq_gercu_read_lock (); ssid =ieee80211_bss_get_ie (cbss,WLAN_EID_SSID ); -if (WARN_ON_ONCE (ssid ==NULL )) +if (WARN_ONCE (!ssid || ssid[1 ] >IEEE80211_MAX_SSID_LEN , +"invalid SSID element (len=%d)" , ssid ? ssid[1 ] :-1 )) ssid_len =0 ;else ssid_len = ssid[1 ];
@@ -5227,7 +5228,7 @@ int ieee80211_mgd_assoc(struct ieee80211rcu_read_lock (); ssidie =ieee80211_bss_get_ie (req->bss,WLAN_EID_SSID ); -if (!ssidie) { +if (!ssidie || ssidie[1 ] >sizeof (assoc_data->ssid)) {rcu_read_unlock ();kfree (assoc_data);return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 124/197 drm/edid: Add 6 bpc quirk for SDC panel in Lenovo G50
In reply to Greg Kroah-HartmanFrom: Kai-Heng Feng <[email protected]>
commit 11bcf5f78905b90baae8fb01e16650664ed0cb00 upstream.
Another panel that needs 6BPC quirk.
--- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_edid.c +3 -0
@@ -159,6 +159,9 @@ static const struct edid_quirk {/* Medion MD 30217 PG */ { "MED", 0x7b8, EDID_QUIRK_PREFER_LARGE_75 }, +/* Lenovo G50 */ + { "SDC", 18514, EDID_QUIRK_FORCE_6BPC }, +/* Panel in Samsung NP700G7A-S01PL notebook reports 6bpc */ { "SEC", 0xd033, EDID_QUIRK_FORCE_8BPC },
Greg Kroah-Hartman
maintainerPATCH 89/197 netdevsim: Fix error handling in nsim_fib_init and nsim_fib_exit
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit 33902b4a4227877896dd9368ac10f4ca0d100de5 ]
In nsim_fib_init(), if register_fib_notifier failed, nsim_fib_net_ops should be unregistered before return.
In nsim_fib_exit(), unregister_fib_notifier should be called before nsim_fib_net_ops be unregistered, otherwise may cause use-after-free:
BUG: KASAN: use-after-free in nsim_fib_event_nb+0x342/0x570 [netdevsim] Read of size 8 at addr ffff8881daaf4388 by task kworker/0:3/3499 CPU: 0 PID: 3499 Comm: kworker/0:3 Not tainted 5.3.0-rc7+ #30 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 Workqueue: ipv6_addrconf addrconf_dad_work [ipv6] Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xa9/0x10e lib/dump_stack.c:113 print_address_description+0x65/0x380 mm/kasan/report.c:351 __kasan_report+0x149/0x18d mm/kasan/report.c:482 kasan_report+0xe/0x20 mm/kasan/common.c:618 nsim_fib_event_nb+0x342/0x570 [netdevsim] notifier_call_chain+0x52/0xf0 kernel/notifier.c:95 __atomic_notifier_call_chain+0x78/0x140 kernel/notifier.c:185 call_fib_notifiers+0x30/0x60 net/core/fib_notifier.c:30 call_fib6_entry_notifiers+0xc1/0x100 [ipv6] fib6_add+0x92e/0x1b10 [ipv6] __ip6_ins_rt+0x40/0x60 [ipv6] ip6_ins_rt+0x84/0xb0 [ipv6] __ipv6_ifa_notify+0x4b6/0x550 [ipv6] ipv6_ifa_notify+0xa5/0x180 [ipv6] addrconf_dad_completed+0xca/0x640 [ipv6] addrconf_dad_work+0x296/0x960 [ipv6] process_one_work+0x5c0/0xc00 kernel/workqueue.c:2269 worker_thread+0x5c/0x670 kernel/workqueue.c:2415 kthread+0x1d7/0x200 kernel/kthread.c:255 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 3388: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.3+0xa0/0xd0 mm/kasan/common.c:493 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:748 [inline] ops_init+0xa9/0x220 net/core/net_namespace.c:127 __register_pernet_operations net/core/net_namespace.c:1135 [inline] register_pernet_operations+0x1d4/0x420 net/core/net_namespace.c:1212 register_pernet_subsys+0x24/0x40 net/core/net_namespace.c:1253 nsim_fib_init+0x12/0x70 [netdevsim] veth_get_link_ksettings+0x2b/0x50 [veth] do_one_initcall+0xd4/0x454 init/main.c:939 do_init_module+0xe0/0x330 kernel/module.c:3490 load_module+0x3c2f/0x4620 kernel/module.c:3841 __do_sys_finit_module+0x163/0x190 kernel/module.c:3931 do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 3534: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x130/0x180 mm/kasan/common.c:455 slab_free_hook mm/slub.c:1423 [inline] slab_free_freelist_hook mm/slub.c:1474 [inline] slab_free mm/slub.c:3016 [inline] kfree+0xe9/0x2d0 mm/slub.c:3957 ops_free net/core/net_namespace.c:151 [inline] ops_free_list.part.7+0x156/0x220 net/core/net_namespace.c:184 ops_free_list net/core/net_namespace.c:182 [inline] __unregister_pernet_operations net/core/net_namespace.c:1165 [inline] unregister_pernet_operations+0x221/0x2a0 net/core/net_namespace.c:1224 unregister_pernet_subsys+0x1d/0x30 net/core/net_namespace.c:1271 nsim_fib_exit+0x11/0x20 [netdevsim] nsim_module_exit+0x16/0x21 [netdevsim] __do_sys_delete_module kernel/module.c:1015 [inline] __se_sys_delete_module kernel/module.c:958 [inline] __x64_sys_delete_module+0x244/0x330 kernel/module.c:958 do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe
--- drivers/net/netdevsim/fib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/netdevsim/fib.c +2 -1
@@ -241,8 +241,8 @@ static struct pernet_operations nsim_fibvoid nsim_fib_exit (void ) { -unregister_pernet_subsys (&nsim_fib_net_ops);unregister_fib_notifier (&nsim_fib_nb); +unregister_pernet_subsys (&nsim_fib_net_ops); }int nsim_fib_init (void )
@@ -258,6 +258,7 @@ int nsim_fib_init(void) err =register_fib_notifier (&nsim_fib_nb, nsim_fib_dump_inconsistent);if (err <0 ) {pr_err ("Failed to register fib notifier\n" ); +unregister_pernet_subsys (&nsim_fib_net_ops); goto err_out; }
Greg Kroah-Hartman
maintainerPATCH 125/197 drm/ttm: Restore ttm prefaulting
In reply to Greg Kroah-HartmanFrom: Thomas Hellstrom <[email protected]>
commit 941f2f72dbbe0cf8c2d6e0b180a8021a0ec477fa upstream.
Commit 4daa4fba3a38 ("gpu: drm: ttm: Adding new return type vm_fault_t") broke TTM prefaulting. Since vmf_insert_mixed() typically always returns VM_FAULT_NOPAGE, prefaulting stops after the second PTE.
Restore (almost) the original behaviour. Unfortunately we can no longer with the new vm_fault_t return type determine whether a prefaulting PTE insertion hit an already populated PTE, and terminate the insertion loop. Instead we continue with the pre-determined number of prefaults.
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +7 -9
@@ -278,15 +278,13 @@ static vm_fault_t ttm_bo_vm_fault(structelse ret =vmf_insert_pfn (&cvma, address, pfn); -/* -* Somebody beat us to this PTE or prefaulting to -* an already populated PTE, or prefaulting error. -*/ - -if (unlikely ((ret ==VM_FAULT_NOPAGE && i >0 ))) -break ; -else if (unlikely (ret &VM_FAULT_ERROR )) - goto out_io_unlock; +/* Never error on prefaulted PTEs */ +if (unlikely ((ret &VM_FAULT_ERROR ))) { +if (i ==0 ) + goto out_io_unlock; +else +break ; + } address +=PAGE_SIZE ;if (unlikely (++page_offset >= page_last))
Greg Kroah-Hartman
maintainerPATCH 126/197 drm/panfrost: Handle resetting on timeout better
In reply to Greg Kroah-HartmanFrom: Steven Price <[email protected]>
commit 5b3ec8134f5f9fa1ed0a538441a495521078bbee upstream.
Panfrost uses multiple schedulers (one for each slot, so 2 in reality), and on a timeout has to stop all the schedulers to safely perform a reset. However more than one scheduler can trigger a timeout at the same time. This race condition results in jobs being freed while they are still in use.
When stopping other slots use cancel_delayed_work_sync() to ensure that any timeout started for that slot has completed. Also use mutex_trylock() to obtain reset_lock. This means that only one thread attempts the reset, the other threads will simply complete without doing anything (the first thread will wait for this in the call to cancel_delayed_work_sync()).
While we're here and since the function is already dependent on sched_job not being NULL, let's remove the unnecessary checks.
--- drivers/gpu/drm/panfrost/panfrost_job.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/panfrost/panfrost_job.c +11 -5
@@ -384,13 +384,19 @@ static void panfrost_job_timedout(structjob_read (pfdev,JS_TAIL_LO (js)), sched_job); -mutex_lock (&pfdev->reset_lock); +if (!mutex_trylock (&pfdev->reset_lock)) +return ; -for (i =0 ; i <NUM_JOB_SLOTS ; i++) -drm_sched_stop (&pfdev->js->queue[i].sched, sched_job); +for (i =0 ; i <NUM_JOB_SLOTS ; i++) { +struct drm_gpu_scheduler *sched = &pfdev->js->queue[i].sched; -if (sched_job) -drm_sched_increase_karma (sched_job); +drm_sched_stop (sched, sched_job); +if (js != i) +/* Ensure any timeouts on other slots have finished */ +cancel_delayed_work_sync (&sched->work_tdr); + } + +drm_sched_increase_karma (sched_job);/* panfrost_core_dump(pfdev); */
Greg Kroah-Hartman
maintainerPATCH 127/197 drm/amdgpu: Bail earlier when amdgpu.cik_/si_support is not set to 1
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 984d7a929ad68b7be9990fc9c5cfa5d5c9fc7942 upstream.
Bail from the pci_driver probe function instead of from the drm_driver load function.
This avoid /dev/dri/card0 temporarily getting registered and then unregistered again, sending unwanted add / remove udev events to userspace.
Specifically this avoids triggering the (userspace) bug fixed by this plymouth merge-request:
https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/59
Note that despite that being a userspace bug, not sending unnecessary udev events is a good idea in general.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 35 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 35 -------------------------------- 2 files changed, 35 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +35 -0
@@ -1030,6 +1030,41 @@ static int amdgpu_pci_probe(struct pci_dreturn -ENODEV ; } +#ifdef CONFIG_DRM_AMDGPU_SI +if (!amdgpu_si_support) { +switch (flags &AMD_ASIC_MASK ) { +case CHIP_TAHITI : +case CHIP_PITCAIRN : +case CHIP_VERDE : +case CHIP_OLAND : +case CHIP_HAINAN : +dev_info (&pdev->dev, +"SI support provided by radeon.\n" ); +dev_info (&pdev->dev, +"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n" + ); +return -ENODEV ; + } + } +#endif +#ifdef CONFIG_DRM_AMDGPU_CIK +if (!amdgpu_cik_support) { +switch (flags &AMD_ASIC_MASK ) { +case CHIP_KAVERI : +case CHIP_BONAIRE : +case CHIP_HAWAII : +case CHIP_KABINI : +case CHIP_MULLINS : +dev_info (&pdev->dev, +"CIK support provided by radeon.\n" ); +dev_info (&pdev->dev, +"Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n" + ); +return -ENODEV ; + } + } +#endif +/* Get rid of things like offb */ ret =drm_fb_helper_remove_conflicting_pci_framebuffers (pdev,0 ,"amdgpudrmfb" );if (ret)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -35
@@ -144,41 +144,6 @@ int amdgpu_driver_load_kms(struct drm_destruct amdgpu_device *adev;int r, acpi_status; -#ifdef CONFIG_DRM_AMDGPU_SI -if (!amdgpu_si_support) { -switch (flags &AMD_ASIC_MASK ) { -case CHIP_TAHITI : -case CHIP_PITCAIRN : -case CHIP_VERDE : -case CHIP_OLAND : -case CHIP_HAINAN : -dev_info (dev->dev, -"SI support provided by radeon.\n" ); -dev_info (dev->dev, -"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n" - ); -return -ENODEV ; - } - } -#endif -#ifdef CONFIG_DRM_AMDGPU_CIK -if (!amdgpu_cik_support) { -switch (flags &AMD_ASIC_MASK ) { -case CHIP_KAVERI : -case CHIP_BONAIRE : -case CHIP_HAWAII : -case CHIP_KABINI : -case CHIP_MULLINS : -dev_info (dev->dev, -"CIK support provided by radeon.\n" ); -dev_info (dev->dev, -"Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n" - ); -return -ENODEV ; - } - } -#endif - adev =kzalloc (sizeof (struct amdgpu_device ),GFP_KERNEL );if (adev ==NULL ) {return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 128/197 drm/amdgpu/sdma5: fix mask value of POLL_REGMEM packet for pipe sync
In reply to Greg Kroah-HartmanFrom: Xiaojie Yuan <[email protected]>
commit d12c50857c6edc1d18aa7a60c5a4d6d943137bc0 upstream.
sdma will hang once sequence number to be polled reaches 0x1000_0000
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1 -1
@@ -1086,7 +1086,7 @@ static void sdma_v5_0_ring_emit_pipelineamdgpu_ring_write (ring, addr &0xfffffffc );amdgpu_ring_write (ring,upper_32_bits (addr) &0xffffffff );amdgpu_ring_write (ring, seq);/* reference */ -amdgpu_ring_write (ring,0xfffffff );/* mask */ +amdgpu_ring_write (ring,0xffffffff );/* mask */ amdgpu_ring_write (ring,SDMA_PKT_POLL_REGMEM_DW5_RETRY_COUNT (0xfff ) |SDMA_PKT_POLL_REGMEM_DW5_INTERVAL (4 ));/* retry count, poll interval */ }
Greg Kroah-Hartman
maintainerPATCH 129/197 drm/i915/userptr: Never allow userptr into the mappable GGTT
In reply to Greg Kroah-HartmanFrom: Chris Wilson <[email protected]>
commit 4f2a572eda67aecb1e7e4fc26cc985fb8158f6e8 upstream.
Daniel Vetter uncovered a nasty cycle in using the mmu-notifiers to invalidate userptr objects which also happen to be pulled into GGTT mmaps. That is when we unbind the userptr object (on mmu invalidation), we revoke all CPU mmaps, which may then recurse into mmu invalidation.
We looked for ways of breaking the cycle, but the revocation on invalidation is required and cannot be avoided. The only solution we could see was to not allow such GGTT bindings of userptr objects in the first place. In practice, no one really wants to use a GGTT mmapping of a CPU pointer...
Just before Daniel's explosive lockdep patches land in v5.4-rc1, we got a genuine blip from CI:
<4>[ 246.793958] ======================================================
<4>[ 246.793972] WARNING: possible circular locking dependency detected
<4>[ 246.793989] 5.3.0-gbd6c56f50d15-drmtip_372+ #1 Tainted: G U
<4>[ 246.794003] ------------------------------------------------------
<4>[ 246.794017] kswapd0/145 is trying to acquire lock:
<4>[ 246.794030] 000000003f565be6 (&dev->struct_mutex/1){+.+.}, at: userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
<4>[ 246.794250]
but task is already holding lock:
<4>[ 246.794263] 000000001799cef9 (&anon_vma->rwsem){++++}, at: page_lock_anon_vma_read+0xe6/0x2a0
<4>[ 246.794291]
which lock already depends on the new lock.<4>[ 246.794307]
the existing dependency chain (in reverse order) is:
<4>[ 246.794322]
-> #3 (&anon_vma->rwsem){++++}:
<4>[ 246.794344] down_write+0x33/0x70
<4>[ 246.794357] __vma_adjust+0x3d9/0x7b0
<4>[ 246.794370] __split_vma+0x16a/0x180
<4>[ 246.794385] mprotect_fixup+0x2a5/0x320
<4>[ 246.794399] do_mprotect_pkey+0x208/0x2e0
<4>[ 246.794413] __x64_sys_mprotect+0x16/0x20
<4>[ 246.794429] do_syscall_64+0x55/0x1c0
<4>[ 246.794443] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4>[ 246.794456]
-> #2 (&mapping->i_mmap_rwsem){++++}:
<4>[ 246.794478] down_write+0x33/0x70
<4>[ 246.794493] unmap_mapping_pages+0x48/0x130
<4>[ 246.794519] i915_vma_revoke_mmap+0x81/0x1b0 [i915]
<4>[ 246.794519] i915_vma_unbind+0x11d/0x4a0 [i915]
<4>[ 246.794519] i915_vma_destroy+0x31/0x300 [i915]
<4>[ 246.794519] __i915_gem_free_objects+0xb8/0x4b0 [i915]
<4>[ 246.794519] drm_file_free.part.0+0x1e6/0x290
<4>[ 246.794519] drm_release+0xa6/0xe0
<4>[ 246.794519] __fput+0xc2/0x250
<4>[ 246.794519] task_work_run+0x82/0xb0
<4>[ 246.794519] do_exit+0x35b/0xdb0
<4>[ 246.794519] do_group_exit+0x34/0xb0
<4>[ 246.794519] __x64_sys_exit_group+0xf/0x10
<4>[ 246.794519] do_syscall_64+0x55/0x1c0
<4>[ 246.794519] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4>[ 246.794519]
-> #1 (&vm->mutex){+.+.}:
<4>[ 246.794519] i915_gem_shrinker_taints_mutex+0x6d/0xe0 [i915]
<4>[ 246.794519] i915_address_space_init+0x9f/0x160 [i915]
<4>[ 246.794519] i915_ggtt_init_hw+0x55/0x170 [i915]
<4>[ 246.794519] i915_driver_probe+0xc9f/0x1620 [i915]
<4>[ 246.794519] i915_pci_probe+0x43/0x1b0 [i915]
<4>[ 246.794519] pci_device_probe+0x9e/0x120
<4>[ 246.794519] really_probe+0xea/0x3d0
<4>[ 246.794519] driver_probe_device+0x10b/0x120
<4>[ 246.794519] device_driver_attach+0x4a/0x50
<4>[ 246.794519] __driver_attach+0x97/0x130
<4>[ 246.794519] bus_for_each_dev+0x74/0xc0
<4>[ 246.794519] bus_add_driver+0x13f/0x210
<4>[ 246.794519] driver_register+0x56/0xe0
<4>[ 246.794519] do_one_initcall+0x58/0x300
<4>[ 246.794519] do_init_module+0x56/0x1f6
<4>[ 246.794519] load_module+0x25bd/0x2a40
<4>[ 246.794519] __se_sys_finit_module+0xd3/0xf0
<4>[ 246.794519] do_syscall_64+0x55/0x1c0
<4>[ 246.794519] entry_SYSCALL_64_after_hwframe+0x49/0xbe
<4>[ 246.794519]
-> #0 (&dev->struct_mutex/1){+.+.}:
<4>[ 246.794519] __lock_acquire+0x15d8/0x1e90
<4>[ 246.794519] lock_acquire+0xa6/0x1c0
<4>[ 246.794519] __mutex_lock+0x9d/0x9b0
<4>[ 246.794519] userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
<4>[ 246.794519] __mmu_notifier_invalidate_range_start+0x85/0x110
<4>[ 246.794519] try_to_unmap_one+0x76b/0x860
<4>[ 246.794519] rmap_walk_anon+0x104/0x280
<4>[ 246.794519] try_to_unmap+0xc0/0xf0
<4>[ 246.794519] shrink_page_list+0x561/0xc10
<4>[ 246.794519] shrink_inactive_list+0x220/0x440
<4>[ 246.794519] shrink_node_memcg+0x36e/0x740
<4>[ 246.794519] shrink_node+0xcb/0x490
<4>[ 246.794519] balance_pgdat+0x241/0x580
<4>[ 246.794519] kswapd+0x16c/0x530
<4>[ 246.794519] kthread+0x119/0x130
<4>[ 246.794519] ret_from_fork+0x24/0x50
<4>[ 246.794519]
other info that might help us debug this:<4>[ 246.794519] Chain exists of:
&dev->struct_mutex/1 --> &mapping->i_mmap_rwsem --> &anon_vma->rwsem<4>[ 246.794519] Possible unsafe locking scenario:
<4>[ 246.794519] CPU0 CPU1
<4>[ 246.794519] ---- ----
<4>[ 246.794519] lock(&anon_vma->rwsem);
<4>[ 246.794519] lock(&mapping->i_mmap_rwsem);
<4>[ 246.794519] lock(&anon_vma->rwsem);
<4>[ 246.794519] lock(&dev->struct_mutex/1);
<4>[ 246.794519]
*** DEADLOCK ***v2: Say no to mmap_ioctl
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111744
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111870
--- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 +++++++ drivers/gpu/drm/i915/gem/i915_gem_object.h | 6 ++++++ drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 3 ++- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 1 + drivers/gpu/drm/i915/i915_gem.c | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gem/i915_gem_mman.c +7 -0
@@ -365,6 +365,7 @@ err:return VM_FAULT_OOM ;case -ENOSPC :case -EFAULT : +case -ENODEV :/* bad object, how did you get here! */ return VM_FAULT_SIGBUS ;default :WARN_ONCE (ret,"unhandled error in %s: %i\n" , __func__, ret);
@@ -475,10 +476,16 @@ i915_gem_mmap_gtt(struct drm_file *file,if (!obj)return -ENOENT ; +if (i915_gem_object_never_bind_ggtt (obj)) { + ret = -ENODEV ; + goto out; + } + ret =create_mmap_offset (obj);if (ret ==0 ) *offset =drm_vma_node_offset_addr (&obj->base.vma_node); +out:i915_gem_object_put (obj);return ret; }
drivers/gpu/drm/i915/gem/i915_gem_object.h +6 -0
@@ -153,6 +153,12 @@ i915_gem_object_is_proxy(const struct dr }static inline bool +i915_gem_object_never_bind_ggtt (const struct drm_i915_gem_object *obj) +{ +return obj->ops->flags &I915_GEM_OBJECT_NO_GGTT ; +} + +static inline bool i915_gem_object_needs_async_cancel (const struct drm_i915_gem_object *obj) {return obj->ops->flags &I915_GEM_OBJECT_ASYNC_CANCEL ;
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +2 -1
@@ -31,7 +31,8 @@ struct drm_i915_gem_object_ops {#define I915_GEM_OBJECT_HAS_STRUCT_PAGE BIT(0)#define I915_GEM_OBJECT_IS_SHRINKABLE BIT(1)#define I915_GEM_OBJECT_IS_PROXY BIT(2) -#define I915_GEM_OBJECT_ASYNC_CANCEL BIT(3) +#define I915_GEM_OBJECT_NO_GGTT BIT(3) +#define I915_GEM_OBJECT_ASYNC_CANCEL BIT(4)/* Interface between the GEM object and its backing storage. * get_pages() is called once prior to the use of the associated set
drivers/gpu/drm/i915/gem/i915_gem_userptr.c +1 -0
@@ -694,6 +694,7 @@ i915_gem_userptr_dmabuf_export(struct drstatic const struct drm_i915_gem_object_ops i915_gem_userptr_ops = { .flags =I915_GEM_OBJECT_HAS_STRUCT_PAGE |I915_GEM_OBJECT_IS_SHRINKABLE | +I915_GEM_OBJECT_NO_GGTT |I915_GEM_OBJECT_ASYNC_CANCEL , .get_pages = i915_gem_userptr_get_pages, .put_pages = i915_gem_userptr_put_pages,
drivers/gpu/drm/i915/i915_gem.c +3 -0
@@ -1030,6 +1030,9 @@ i915_gem_object_ggtt_pin(struct drm_i915lockdep_assert_held (&obj->base.dev->struct_mutex); +if (i915_gem_object_never_bind_ggtt (obj)) +return ERR_PTR (-ENODEV ); +if (flags &PIN_MAPPABLE && (!view || view->type ==I915_GGTT_VIEW_NORMAL )) {/* If the required space is larger than the available
Greg Kroah-Hartman
maintainerPATCH 131/197 drm/amdgpu/vce: fix allocation size in enc ring test
In reply to Greg Kroah-HartmanFrom: Alex Deucher <[email protected]>
commit ee027828c40faa92a7ef4c2b0641bbb3f4be95d3 upstream.
We need to allocate a large enough buffer for the feedback buffer, otherwise the IB test can overwrite other memory.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 20 +++++++++++++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h | 1 + 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +15 -5
@@ -429,13 +429,14 @@ void amdgpu_vce_free_handles(struct amdg* Open up a stream for HW test */ int amdgpu_vce_get_create_msg (struct amdgpu_ring *ring,uint32_t handle, +struct amdgpu_bo *bo,struct dma_fence **fence) {const unsigned ib_size_dw =1024 ;struct amdgpu_job *job;struct amdgpu_ib *ib;struct dma_fence *f =NULL ; -uint64_t dummy; +uint64_t addr;int i, r; r =amdgpu_job_alloc_with_ib (ring->adev, ib_size_dw *4 , &job);
@@ -444,7 +445,7 @@ int amdgpu_vce_get_create_msg(struct amd ib = &job->ibs[0 ]; - dummy = ib->gpu_addr +1024 ; + addr =amdgpu_bo_gpu_offset (bo);/* stitch together an VCE create msg */ ib->length_dw =0 ;
@@ -476,8 +477,8 @@ int amdgpu_vce_get_create_msg(struct amd ib->ptr[ib->length_dw++] =0x00000014 ;/* len */ ib->ptr[ib->length_dw++] =0x05000005 ;/* feedback buffer */ - ib->ptr[ib->length_dw++] =upper_32_bits (dummy); - ib->ptr[ib->length_dw++] = dummy; + ib->ptr[ib->length_dw++] =upper_32_bits (addr); + ib->ptr[ib->length_dw++] = addr; ib->ptr[ib->length_dw++] =0x00000001 ;for (i = ib->length_dw; i < ib_size_dw; ++i)
@@ -1110,13 +1111,20 @@ int amdgpu_vce_ring_test_ring(struct amdint amdgpu_vce_ring_test_ib (struct amdgpu_ring *ring,long timeout) {struct dma_fence *fence =NULL ; +struct amdgpu_bo *bo =NULL ;long r;/* skip vce ring1/2 ib test for now, since it's not reliable */ if (ring != &ring->adev->vce.ring[0 ])return 0 ; - r =amdgpu_vce_get_create_msg (ring,1 ,NULL ); + r =amdgpu_bo_create_reserved (ring->adev,512 ,PAGE_SIZE , +AMDGPU_GEM_DOMAIN_VRAM , + &bo,NULL ,NULL ); +if (r) +return r; + + r =amdgpu_vce_get_create_msg (ring,1 , bo,NULL );if (r) goto error;
@@ -1132,5 +1140,7 @@ int amdgpu_vce_ring_test_ib(struct amdgp error:dma_fence_put (fence); +amdgpu_bo_unreserve (bo); +amdgpu_bo_unref (&bo);return r; }
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h +1 -0
@@ -59,6 +59,7 @@ int amdgpu_vce_entity_init(struct amdgpuint amdgpu_vce_suspend (struct amdgpu_device *adev);int amdgpu_vce_resume (struct amdgpu_device *adev);int amdgpu_vce_get_create_msg (struct amdgpu_ring *ring,uint32_t handle, +struct amdgpu_bo *bo,struct dma_fence **fence);int amdgpu_vce_get_destroy_msg (struct amdgpu_ring *ring,uint32_t handle,bool direct,struct dma_fence **fence);
Greg Kroah-Hartman
maintainerPATCH 90/197 net: ethernet: broadcom: have drivers select DIMLIB as needed
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit ddc790e92b3afa4e366ffb41818cfcd19015031e ]
NET_VENDOR_BROADCOM is intended to control a kconfig menu only. It should not have anything to do with code generation. As such, it should not select DIMLIB for all drivers under NET_VENDOR_BROADCOM. Instead each driver that needs DIMLIB should select it (being the symbols SYSTEMPORT, BNXT, and BCMGENET).
--- drivers/net/ethernet/broadcom/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/Kconfig +3 -1
@@ -8,7 +8,6 @@ config NET_VENDOR_BROADCOM default y depends on (SSB_POSSIBLE && HAS_DMA) || PCI || BCM63XX || \ SIBYTE_SB1xxx_SOC - select DIMLIB ---help--- If you have a network (Ethernet) chipset belonging to this class, say Y.
@@ -69,6 +68,7 @@ config BCMGENET select FIXED_PHY select BCM7XXX_PHY select MDIO_BCM_UNIMAC + select DIMLIB help This driver supports the built-in Ethernet MACs found in the Broadcom BCM7xxx Set Top Box family chipset.
@@ -188,6 +188,7 @@ config SYSTEMPORT select MII select PHYLIB select FIXED_PHY + select DIMLIB help This driver supports the built-in Ethernet MACs found in the Broadcom BCM7xxx Set Top Box family chipset using an internal
@@ -200,6 +201,7 @@ config BNXT select LIBCRC32C select NET_DEVLINK select PAGE_POOL + select DIMLIB ---help--- This driver supports Broadcom NetXtreme-C/E 10/25/40/50 gigabit Ethernet cards. To compile this driver as a module, choose M here:
Greg Kroah-Hartman
maintainerPATCH 91/197 net: phy: Fix "link partner" information disappear issue
In reply to Greg Kroah-HartmanFrom: Yonglong Liu <[email protected]>
[ Upstream commit 3de5ae54712c75cf3c517a288e0a704784ec6cf5 ]
Some drivers just call phy_ethtool_ksettings_set() to set the links, for those phy drivers that use genphy_read_status(), if autoneg is on, and the link is up, than execute "ethtool -s ethx autoneg on" will cause "link partner" information disappear.
The call trace is phy_ethtool_ksettings_set()->phy_start_aneg() ->linkmode_zero(phydev->lp_advertising)->genphy_read_status(), the link didn't change, so genphy_read_status() just return, and phydev->lp_advertising is zero now.
This patch moves the clear operation of lp_advertising from phy_start_aneg() to genphy_read_lpa()/genphy_c45_read_lpa(), and if autoneg on and autoneg not complete, just clear what the generic functions care about.
--- drivers/net/phy/phy-c45.c | 2 ++ drivers/net/phy/phy.c | 3 --- drivers/net/phy/phy_device.c | 9 ++++++++- 3 files changed, 10 insertions(+), 4 deletions(-)
drivers/net/phy/phy-c45.c +2 -0
@@ -323,6 +323,8 @@ int genphy_c45_read_pma(struct phy_devic {int val; +linkmode_zero (phydev->lp_advertising); + val =phy_read_mmd (phydev,MDIO_MMD_PMAPMD ,MDIO_CTRL1 );if (val <0 )return val;
drivers/net/phy/phy.c +0 -3
@@ -566,9 +566,6 @@ int phy_start_aneg(struct phy_device *phif (AUTONEG_DISABLE == phydev->autoneg)phy_sanitize_settings (phydev); -/* Invalidate LP advertising flags */ -linkmode_zero (phydev->lp_advertising); - err =phy_config_aneg (phydev);if (err <0 ) goto out_unlock;
drivers/net/phy/phy_device.c +8 -1
@@ -1823,7 +1823,14 @@ int genphy_read_status(struct phy_devicelinkmode_zero (phydev->lp_advertising); -if (phydev->autoneg ==AUTONEG_ENABLE && phydev->autoneg_complete) { +if (phydev->autoneg ==AUTONEG_ENABLE ) { +if (!phydev->autoneg_complete) { +mii_stat1000_mod_linkmode_lpa_t (phydev->lp_advertising, +0 ); +mii_lpa_mod_linkmode_lpa_t (phydev->lp_advertising,0 ); +return 0 ; + } +if (phydev->is_gigabit_capable) { lpagb =phy_read (phydev,MII_STAT1000 );if (lpagb <0 )
Greg Kroah-Hartman
maintainerPATCH 92/197 LSM: SafeSetID: Stop releasing uninitialized ruleset
In reply to Greg Kroah-HartmanFrom: Micah Morton <[email protected]>
[ Upstream commit 21ab8580b383f27b7f59b84ac1699cb26d6c3d69 ]
The first time a rule set is configured for SafeSetID, we shouldn't be trying to release the previously configured ruleset, since there isn't one. Currently, the pointer that would point to a previously configured ruleset is uninitialized on first rule set configuration, leading to a crash when we try to call release_ruleset with that pointer.
--- security/safesetid/securityfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
security/safesetid/securityfs.c +2 -1
@@ -187,7 +187,8 @@ static ssize_t handle_policy_update(struct file *file, out_free_buf:kfree (buf); out_free_pol: -release_ruleset (pol); +if (pol) +release_ruleset (pol);return err; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 94/197 io_uring: fix bad inflight accounting for SETUP_IOPOLL|SETUP_SQTHREAD
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit 2b2ed9750fc9d040b9f6d076afcef6f00b6f1f7c upstream.
We currently assume that submissions from the sqthread are successful, and if IO polling is enabled, we use that value for knowing how many completions to look for. But if we overflowed the CQ ring or some requests simply got errored and already completed, they won't be available for polling.
For the case of IO polling and SQTHREAD usage, look at the pending poll list. If it ever hits empty then we know that we don't have anymore pollable requests inflight. For that case, simply reset the inflight count to zero.
--- fs/io_uring.c | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-)
fs/io_uring.c +32 -12
@@ -816,19 +816,11 @@ static void io_iopoll_reap_events(structmutex_unlock (&ctx->uring_lock); } -static int io_iopoll_check (struct io_ring_ctx *ctx,unsigned *nr_events, -long min) +static int __io_iopoll_check (struct io_ring_ctx *ctx,unsigned *nr_events, +long min) { -int iters, ret =0 ; +int iters =0 , ret =0 ; -/* -* We disallow the app entering submit/complete with polling, but we -* still need to lock the ring to prevent racing with polled issue -* that got punted to a workqueue. -*/ -mutex_lock (&ctx->uring_lock); - - iters =0 ; do { int tmin = 0;
@@ -864,6 +856,21 @@ static int io_iopoll_check(struct io_rin ret =0 ; }while (min && !*nr_events && !need_resched ()); +return ret; +} + +static int io_iopoll_check (struct io_ring_ctx *ctx,unsigned *nr_events, +long min) +{ +int ret; + +/* +* We disallow the app entering submit/complete with polling, but we +* still need to lock the ring to prevent racing with polled issue +* that got punted to a workqueue. +*/ +mutex_lock (&ctx->uring_lock); + ret =__io_iopoll_check (ctx, nr_events, min);mutex_unlock (&ctx->uring_lock);return ret; }
@@ -2327,7 +2334,20 @@ static int io_sq_thread(void *data)unsigned nr_events =0 ;if (ctx->flags &IORING_SETUP_IOPOLL ) { -io_iopoll_check (ctx, &nr_events,0 ); +/* +* inflight is the count of the maximum possible +* entries we submitted, but it can be smaller +* if we dropped some of them. If we don't have +* poll entries available, then we know that we +* have nothing left to poll for. Reset the +* inflight count to zero in that case. +*/ +mutex_lock (&ctx->uring_lock); +if (!list_empty (&ctx->poll_list)) +__io_iopoll_check (ctx, &nr_events,0 ); +else + inflight =0 ; +mutex_unlock (&ctx->uring_lock); }else {/* * Normal IO, just pretend everything completed.
Greg Kroah-Hartman
maintainerPATCH 133/197 drm/amdgpu/uvd6: fix allocation size in enc ring test (v2)
In reply to Greg Kroah-HartmanFrom: Alex Deucher <[email protected]>
commit ce584a8e2885c7b59dfacba42db39761243cacb2 upstream.
We need to allocate a large enough buffer for the session info, otherwise the IB test can overwrite other memory.
v2: - session info is 128K according to mesa
- use the same session info for create and destroy
--- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +21 -10
@@ -206,13 +206,14 @@ static int uvd_v6_0_enc_ring_test_ring(s* Open up a stream for HW test */ static int uvd_v6_0_enc_get_create_msg (struct amdgpu_ring *ring,uint32_t handle, +struct amdgpu_bo *bo,struct dma_fence **fence) {const unsigned ib_size_dw =16 ;struct amdgpu_job *job;struct amdgpu_ib *ib;struct dma_fence *f =NULL ; -uint64_t dummy; +uint64_t addr;int i, r; r =amdgpu_job_alloc_with_ib (ring->adev, ib_size_dw *4 , &job);
@@ -220,15 +221,15 @@ static int uvd_v6_0_enc_get_create_msg(sreturn r; ib = &job->ibs[0 ]; - dummy = ib->gpu_addr +1024 ; + addr =amdgpu_bo_gpu_offset (bo); ib->length_dw =0 ; ib->ptr[ib->length_dw++] =0x00000018 ; ib->ptr[ib->length_dw++] =0x00000001 ;/* session info */ ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =0x00010000 ; - ib->ptr[ib->length_dw++] =upper_32_bits (dummy); - ib->ptr[ib->length_dw++] = dummy; + ib->ptr[ib->length_dw++] =upper_32_bits (addr); + ib->ptr[ib->length_dw++] = addr; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;/* task info */
@@ -268,13 +269,14 @@ err:*/ static int uvd_v6_0_enc_get_destroy_msg (struct amdgpu_ring *ring,uint32_t handle, +struct amdgpu_bo *bo,struct dma_fence **fence) {const unsigned ib_size_dw =16 ;struct amdgpu_job *job;struct amdgpu_ib *ib;struct dma_fence *f =NULL ; -uint64_t dummy; +uint64_t addr;int i, r; r =amdgpu_job_alloc_with_ib (ring->adev, ib_size_dw *4 , &job);
@@ -282,15 +284,15 @@ static int uvd_v6_0_enc_get_destroy_msg(return r; ib = &job->ibs[0 ]; - dummy = ib->gpu_addr +1024 ; + addr =amdgpu_bo_gpu_offset (bo); ib->length_dw =0 ; ib->ptr[ib->length_dw++] =0x00000018 ; ib->ptr[ib->length_dw++] =0x00000001 ;/* session info */ ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =0x00010000 ; - ib->ptr[ib->length_dw++] =upper_32_bits (dummy); - ib->ptr[ib->length_dw++] = dummy; + ib->ptr[ib->length_dw++] =upper_32_bits (addr); + ib->ptr[ib->length_dw++] = addr; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;/* task info */
@@ -327,13 +329,20 @@ err:static int uvd_v6_0_enc_ring_test_ib (struct amdgpu_ring *ring,long timeout) {struct dma_fence *fence =NULL ; +struct amdgpu_bo *bo =NULL ;long r; - r =uvd_v6_0_enc_get_create_msg (ring,1 ,NULL ); + r =amdgpu_bo_create_reserved (ring->adev,128 *1024 ,PAGE_SIZE , +AMDGPU_GEM_DOMAIN_VRAM , + &bo,NULL ,NULL ); +if (r) +return r; + + r =uvd_v6_0_enc_get_create_msg (ring,1 , bo,NULL );if (r) goto error; - r =uvd_v6_0_enc_get_destroy_msg (ring,1 , &fence); + r =uvd_v6_0_enc_get_destroy_msg (ring,1 , bo, &fence);if (r) goto error;
@@ -345,6 +354,8 @@ static int uvd_v6_0_enc_ring_test_ib(str error:dma_fence_put (fence); +amdgpu_bo_unreserve (bo); +amdgpu_bo_unref (&bo);return r; }
Greg Kroah-Hartman
maintainerPATCH 143/197 mmc: sdhci-omap: Fix Tuning procedure for temperatures < -20C
In reply to Greg Kroah-HartmanFrom: Faiz Abbas <[email protected]>
commit feb40824d78eac5e48f56498dca941754dff33d7 upstream.
According to the App note[1] detailing the tuning algorithm, for temperatures < -20C, the initial tuning value should be min(largest value in LPW - 24, ceil(13/16 ratio of LPW)). The largest value in LPW is (max_window + 4 * (max_len - 1)) and not (max_window + 4 * max_len) itself. Fix this implementation.
[1] http://www.ti.com/lit/an/spraca9b/spraca9b.pdf
--- drivers/mmc/host/sdhci-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-omap.c +1 -1
@@ -372,7 +372,7 @@ static int sdhci_omap_execute_tuning(str* on temperature */ if (temperature <-20000 ) - phase_delay =min (max_window +4 * max_len -24 , + phase_delay =min (max_window +4 * (max_len -1 ) -24 , max_window +DIV_ROUND_UP (13 * max_len,16 ) *4 );else if (temperature <20000 )
Greg Kroah-Hartman
maintainerPATCH 142/197 mmc: cqhci: Commit descriptors before setting the doorbell
In reply to Greg Kroah-HartmanFrom: Faiz Abbas <[email protected]>
commit c07d0073b9ec80a139d07ebf78e9c30d2a28279e upstream.
Add a write memory barrier to make sure that descriptors are actually written to memory, before ringing the doorbell.
--- drivers/mmc/host/cqhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/cqhci.c +2 -1
@@ -611,7 +611,8 @@ static int cqhci_request(struct mmc_host cq_host->slot[tag].flags =0 ; cq_host->qcnt +=1 ; - +/* Make sure descriptors are ready before ringing the doorbell */ +wmb ();cqhci_writel (cq_host,1 << tag,CQHCI_TDBR );if (!(cqhci_readl (cq_host,CQHCI_TDBR ) & (1 << tag))) pr_debug("%s: cqhci: doorbell not set for tag %d\n",
Greg Kroah-Hartman
maintainerPATCH 144/197 mm/memory-failure.c: dont access uninitialized memmaps in memory_failure()
In reply to Greg Kroah-HartmanFrom: David Hildenbrand <[email protected]>
commit 96c804a6ae8c59a9092b3d5dd581198472063184 upstream.
We should check for pfn_to_online_page() to not access uninitialized memmaps. Reshuffle the code so we don't have to duplicate the error message.
--- mm/memory-failure.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
mm/memory-failure.c +8 -6
@@ -1253,17 +1253,19 @@ int memory_failure(unsigned long pfn, inif (!sysctl_memory_failure_recovery)panic ("Memory failure on page %lx" , pfn); -if (!pfn_valid (pfn)) { + p =pfn_to_online_page (pfn); +if (!p) { +if (pfn_valid (pfn)) { + pgmap =get_dev_pagemap (pfn,NULL ); +if (pgmap) +return memory_failure_dev_pagemap (pfn, flags, + pgmap); + }pr_err ("Memory failure: %#lx: memory outside kernel control\n" , pfn);return -ENXIO ; } - pgmap =get_dev_pagemap (pfn,NULL ); -if (pgmap) -return memory_failure_dev_pagemap (pfn, flags, pgmap); - - p =pfn_to_page (pfn);if (PageHuge (p))return memory_failure_hugetlb (pfn, flags);if (TestSetPageHWPoison (p)) {
Greg Kroah-Hartman
maintainerPATCH 146/197 mm/page_owner: dont access uninitialized memmaps when reading /proc/pagetypeinfo
In reply to Greg Kroah-HartmanFrom: Qian Cai <[email protected]>
commit a26ee565b6cd8dc2bf15ff6aa70bbb28f928b773 upstream.
Uninitialized memmaps contain garbage and in the worst case trigger kernel BUGs, especially with CONFIG_PAGE_POISONING. They should not get touched.
For example, when not onlining a memory block that is spanned by a zone and reading /proc/pagetypeinfo with CONFIG_DEBUG_VM_PGFLAGS and CONFIG_PAGE_POISONING, we can trigger a kernel BUG:
:/# echo 1 > /sys/devices/system/memory/memory40/online :/# echo 1 > /sys/devices/system/memory/memory42/online :/# cat /proc/pagetypeinfo > test.file page:fffff2c585200000 is uninitialized and poisoned raw: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff raw: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p)) There is not page extension available. ------------[ cut here ]------------ kernel BUG at include/linux/mm.h:1107! invalid opcode: 0000 [#1] SMP NOPTI
Please note that this change does not affect ZONE_DEVICE, because pagetypeinfo_showmixedcount_print() is called from mm/vmstat.c:pagetypeinfo_showmixedcount() only for populated zones, and ZONE_DEVICE is never populated (zone->present_pages always 0).
--- mm/page_owner.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
mm/page_owner.c +3 -2
@@ -258,7 +258,8 @@ void pagetypeinfo_showmixedcount_print(s* not matter as the mixed block count will still be correct */ for (; pfn < end_pfn; ) { -if (!pfn_valid (pfn)) { + page =pfn_to_online_page (pfn); +if (!page) { pfn =ALIGN (pfn +1 ,MAX_ORDER_NR_PAGES );continue ; }
@@ -266,13 +267,13 @@ void pagetypeinfo_showmixedcount_print(s block_end_pfn =ALIGN (pfn +1 , pageblock_nr_pages); block_end_pfn =min (block_end_pfn, end_pfn); - page =pfn_to_page (pfn); pageblock_mt =get_pageblock_migratetype (page);for (; pfn < block_end_pfn; pfn++) {if (!pfn_valid_within (pfn))continue ; +/* The pageblock is online, no need to recheck. */ page =pfn_to_page (pfn);if (page_zone (page) != zone)
Greg Kroah-Hartman
maintainerPATCH 145/197 mm/slub: fix a deadlock in show_slab_objects()
In reply to Greg Kroah-HartmanFrom: Qian Cai <[email protected]>
commit e4f8e513c3d353c134ad4eef9fd0bba12406c7c8 upstream.
A long time ago we fixed a similar deadlock in show_slab_objects() [1]. However, it is apparently due to the commits like 01fb58bcba63 ("slab:
remove synchronous synchronize_sched() from memcg cache deactivation path") and 03afc0e25f7f ("slab: get_online_mems for kmem_cache_{create,destroy,shrink}"), this kind of deadlock is back by just reading files in /sys/kernel/slab which will generate a lockdep splat below.
Since the "mem_hotplug_lock" here is only to obtain a stable online node mask while racing with NUMA node hotplug, in the worst case, the results may me miscalculated while doing NUMA node hotplug, but they shall be corrected by later reads of the same files.
WARNING: possible circular locking dependency detected
------------------------------------------------------
cat/5224 is trying to acquire lock:
ffff900012ac3120 (mem_hotplug_lock.rw_sem){++++}, at:
show_slab_objects+0x94/0x3a8
but task is already holding lock:
b8ff009693eee398 (kn->count#45){++++}, at: kernfs_seq_start+0x44/0xf0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (kn->count#45){++++}:
lock_acquire+0x31c/0x360
__kernfs_remove+0x290/0x490
kernfs_remove+0x30/0x44
sysfs_remove_dir+0x70/0x88
kobject_del+0x50/0xb0
sysfs_slab_unlink+0x2c/0x38
shutdown_cache+0xa0/0xf0
kmemcg_cache_shutdown_fn+0x1c/0x34
kmemcg_workfn+0x44/0x64
process_one_work+0x4f4/0x950
worker_thread+0x390/0x4bc
kthread+0x1cc/0x1e8
ret_from_fork+0x10/0x18-> #1 (slab_mutex){+.+.}:
lock_acquire+0x31c/0x360
__mutex_lock_common+0x16c/0xf78
mutex_lock_nested+0x40/0x50
memcg_create_kmem_cache+0x38/0x16c
memcg_kmem_cache_create_func+0x3c/0x70
process_one_work+0x4f4/0x950
worker_thread+0x390/0x4bc
kthread+0x1cc/0x1e8
ret_from_fork+0x10/0x18-> #0 (mem_hotplug_lock.rw_sem){++++}:
validate_chain+0xd10/0x2bcc
__lock_acquire+0x7f4/0xb8c
lock_acquire+0x31c/0x360
get_online_mems+0x54/0x150
show_slab_objects+0x94/0x3a8
total_objects_show+0x28/0x34
slab_attr_show+0x38/0x54
sysfs_kf_seq_show+0x198/0x2d4
kernfs_seq_show+0xa4/0xcc
seq_read+0x30c/0x8a8
kernfs_fop_read+0xa8/0x314
__vfs_read+0x88/0x20c
vfs_read+0xd8/0x10c
ksys_read+0xb0/0x120
__arm64_sys_read+0x54/0x88
el0_svc_handler+0x170/0x240
el0_svc+0x8/0xcother info that might help us debug this:
Chain exists of:
mem_hotplug_lock.rw_sem --> slab_mutex --> kn->count#45
Possible unsafe locking scenario: CPU0 CPU1
---- ----
lock(kn->count#45);
lock(slab_mutex);
lock(kn->count#45);
lock(mem_hotplug_lock.rw_sem);*** DEADLOCK ***
3 locks held by cat/5224:
#0: 9eff00095b14b2a0 (&p->lock){+.+.}, at: seq_read+0x4c/0x8a8 #1: 0eff008997041480 (&of->mutex){+.+.}, at: kernfs_seq_start+0x34/0xf0 #2: b8ff009693eee398 (kn->count#45){++++}, at:
kernfs_seq_start+0x44/0xf0 stack backtrace: Call trace: dump_backtrace+0x0/0x248 show_stack+0x20/0x2c dump_stack+0xd0/0x140 print_circular_bug+0x368/0x380 check_noncircular+0x248/0x250 validate_chain+0xd10/0x2bcc __lock_acquire+0x7f4/0xb8c lock_acquire+0x31c/0x360 get_online_mems+0x54/0x150 show_slab_objects+0x94/0x3a8 total_objects_show+0x28/0x34 slab_attr_show+0x38/0x54 sysfs_kf_seq_show+0x198/0x2d4 kernfs_seq_show+0xa4/0xcc seq_read+0x30c/0x8a8 kernfs_fop_read+0xa8/0x314 __vfs_read+0x88/0x20c vfs_read+0xd8/0x10c ksys_read+0xb0/0x120 __arm64_sys_read+0x54/0x88 el0_svc_handler+0x170/0x240 el0_svc+0x8/0xc
I think it is important to mention that this doesn't expose the show_slab_objects to use-after-free. There is only a single path that might really race here and that is the slab hotplug notifier callback __kmem_cache_shrink (via slab_mem_going_offline_callback) but that path doesn't really destroy kmem_cache_node data structures.
[1] http://lkml.iu.edu/hypermail/linux/kernel/1101.0/02850.html
--- mm/slub.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
mm/slub.c +11 -2
@@ -4836,7 +4836,17 @@ static ssize_t show_slab_objects(struct } } -get_online_mems (); +/* +* It is impossible to take "mem_hotplug_lock" here with "kernfs_mutex" +* already held which will conflict with an existing lock order: +* +* mem_hotplug_lock->slab_mutex->kernfs_mutex +* +* We don't really need mem_hotplug_lock (to hold off +* slab_mem_going_offline_callback) here because slab's memory hot +* unplug code doesn't destroy the kmem_cache->node[] data. +*/ +#ifdef CONFIG_SLUB_DEBUG if (flags &SO_ALL ) {struct kmem_cache_node *n;
@@ -4877,7 +4887,6 @@ static ssize_t show_slab_objects(struct x +=sprintf (buf + x," N%d=%lu" , node, nodes[node]);#endif -put_online_mems ();kfree (nodes);return x +sprintf (buf + x,"\n" ); }
Greg Kroah-Hartman
maintainerPATCH 149/197 mm: memcg/slab: fix panic in __free_slab() caused by premature memcg pointer release
In reply to Greg Kroah-HartmanFrom: Roman Gushchin <[email protected]>
commit b749ecfaf6c53ce79d6ab66afd2fc34189a073b1 upstream.
Karsten reported the following panic in __free_slab() happening on a s390x machine:
Unable to handle kernel pointer dereference in virtual kernel address space
Failing address: 0000000000000000 TEID: 0000000000000483
Fault in home space mode while using kernel ASCE.
AS:00000000017d4007 R3:000000007fbd0007 S:000000007fbff000 P:000000000000003d
Oops: 0004 ilc:3 Ý#1¨ PREEMPT SMP
Modules linked in: tcp_diag inet_diag xt_tcpudp ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ip6table_nat ip6table_mangle ip6table_raw ip6table_security iptable_at nf_nat
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.3.0-05872-g6133e3e4bada-dirty #14
Hardware name: IBM 2964 NC9 702 (z/VM 6.4.0)
Krnl PSW : 0704d00180000000 00000000003cadb6 (__free_slab+0x686/0x6b0)
R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3
Krnl GPRS: 00000000f3a32928 0000000000000000 000000007fbf5d00 000000000117c4b8
0000000000000000 000000009e3291c1 0000000000000000 0000000000000000
0000000000000003 0000000000000008 000000002b478b00 000003d080a97600
0000000000000003 0000000000000008 000000002b478b00 000003d080a97600
000000000117ba00 000003e000057db0 00000000003cabcc 000003e000057c78
Krnl Code: 00000000003cada6: e310a1400004 lg %r1,320(%r10)
00000000003cadac: c0e50046c286 brasl %r14,ca32b8
#00000000003cadb2: a7f4fe36 brc 15,3caa1e
>00000000003cadb6: e32060800024 stg %r2,128(%r6)
00000000003cadbc: a7f4fd9e brc 15,3ca8f8
00000000003cadc0: c0e50046790c brasl %r14,c99fd8
00000000003cadc6: a7f4fe2c brc 15,3caa
00000000003cadc6: a7f4fe2c brc 15,3caa1e
00000000003cadca: ecb1ffff00d9 aghik %r11,%r1,-1
Call Trace:
(<00000000003cabcc> __free_slab+0x49c/0x6b0)
<00000000001f5886> rcu_core+0x5a6/0x7e0
<0000000000ca2dea> __do_softirq+0xf2/0x5c0
<0000000000152644> irq_exit+0x104/0x130
<000000000010d222> do_IRQ+0x9a/0xf0
<0000000000ca2344> ext_int_handler+0x130/0x134
<0000000000103648> enabled_wait+0x58/0x128
(<0000000000103634> enabled_wait+0x44/0x128)
<0000000000103b00> arch_cpu_idle+0x40/0x58
<0000000000ca0544> default_idle_call+0x3c/0x68
<000000000018eaa4> do_idle+0xec/0x1c0
<000000000018ee0e> cpu_startup_entry+0x36/0x40
<000000000122df34> arch_call_rest_init+0x5c/0x88
<0000000000000000> 0x0
INFO: lockdep is turned off.
Last Breaking-Event-Address:
<00000000003ca8f4> __free_slab+0x1c4/0x6b0
Kernel panic - not syncing: Fatal exception in interruptThe kernel panics on an attempt to dereference the NULL memcg pointer. When shutdown_cache() is called from the kmem_cache_destroy() context, a memcg kmem_cache might have empty slab pages in a partial list, which are still charged to the memory cgroup.
These pages are released by free_partial() at the beginning of shutdown_cache(): either directly or by scheduling a RCU-delayed work (if the kmem_cache has the SLAB_TYPESAFE_BY_RCU flag). The latter case is when the reported panic can happen: memcg_unlink_cache() is called immediately after shrinking partial lists, without waiting for scheduled RCU works. It sets the kmem_cache->memcg_params.memcg pointer to NULL, and the following attempt to dereference it by __free_slab() from the RCU work context causes the panic.
To fix the issue, let's postpone the release of the memcg pointer to destroy_memcg_params(). It's called from a separate work context by slab_caches_to_rcu_destroy_workfn(), which contains a full RCU barrier. This guarantees that all scheduled page release RCU works will complete before the memcg pointer will be zeroed.
Big thanks for Karsten for the perfect report containing all necessary information, his help with the analysis of the problem and testing of the fix.
--- mm/slab_common.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
mm/slab_common.c +5 -4
@@ -178,10 +178,13 @@ static int init_memcg_params(struct kmemstatic void destroy_memcg_params (struct kmem_cache *s) { -if (is_root_cache (s)) +if (is_root_cache (s)) {kvfree (rcu_access_pointer (s->memcg_params.memcg_caches)); -else + }else { +mem_cgroup_put (s->memcg_params.memcg); +WRITE_ONCE (s->memcg_params.memcg,NULL );percpu_ref_exit (&s->memcg_params.refcnt); + } }static void free_memcg_params (struct rcu_head *rcu)
@@ -253,8 +256,6 @@ static void memcg_unlink_cache(struct km } else {list_del (&s->memcg_params.children_node);list_del (&s->memcg_params.kmem_caches_node); -mem_cgroup_put (s->memcg_params.memcg); -WRITE_ONCE (s->memcg_params.memcg,NULL ); } }#else
Greg Kroah-Hartman
maintainerPATCH 150/197 mm, compaction: fix wrong pfn handling in __reset_isolation_pfn()
In reply to Greg Kroah-HartmanFrom: Vlastimil Babka <[email protected]>
commit a2e9a5afce080226edbf1882d63d99bf32070e9e upstream.
Florian and Dave reported [1] a NULL pointer dereference in __reset_isolation_pfn(). While the exact cause is unclear, staring at the code revealed two bugs, which might be related.
One bug is that if zone starts in the middle of pageblock, block_page might correspond to different pfn than block_pfn, and then the pfn_valid_within() checks will check different pfn's than those accessed via struct page. This might result in acessing an unitialized page in CONFIG_HOLES_IN_ZONE configs.
The other bug is that end_page refers to the first page of next pageblock and not last page of current pageblock. The online and valid check is then wrong and with sections, the while (page < end_page) loop might wander off actual struct page arrays.
[1] https://lore.kernel.org/linux-xfs/[email protected]/
--- mm/compaction.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
mm/compaction.c +4 -3
@@ -270,14 +270,15 @@ __reset_isolation_pfn(struct zone *zone,/* Ensure the start of the pageblock or zone is online and valid */ block_pfn =pageblock_start_pfn (pfn); - block_page =pfn_to_online_page (max (block_pfn, zone->zone_start_pfn)); + block_pfn =max (block_pfn, zone->zone_start_pfn); + block_page =pfn_to_online_page (block_pfn);if (block_page) { page = block_page; pfn = block_pfn; }/* Ensure the end of the pageblock or zone is online and valid */ - block_pfn += pageblock_nr_pages; + block_pfn =pageblock_end_pfn (pfn) -1 ; block_pfn =min (block_pfn,zone_end_pfn (zone) -1 ); end_page =pfn_to_online_page (block_pfn);if (!end_page)
@@ -303,7 +304,7 @@ __reset_isolation_pfn(struct zone *zone, page += (1 <<PAGE_ALLOC_COSTLY_ORDER ); pfn += (1 <<PAGE_ALLOC_COSTLY_ORDER ); - }while (page < end_page); + }while (page <= end_page);return false; }
Greg Kroah-Hartman
maintainerPATCH 151/197 mm: memcg: get number of pages on the LRU list in memcgroup base on lru_zone_size
In reply to Greg Kroah-HartmanFrom: Honglei Wang <[email protected]>
commit b11edebbc967ebf5c55b8f9e1d5bb6d68ec3a7fd upstream.
Commit 1a61ab8038e72 ("mm: memcontrol: replace zone summing with lruvec_page_state()") has made lruvec_page_state to use per-cpu counters instead of calculating it directly from lru_zone_size with an idea that this would be more effective.
Tim has reported that this is not really the case for their database benchmark which is showing an opposite results where lruvec_page_state is taking up a huge chunk of CPU cycles (about 25% of the system time which is roughly 7% of total cpu cycles) on 5.3 kernels. The workload is running on a larger machine (96cpus), it has many cgroups (500) and it is heavily direct reclaim bound.
Tim Chen said:
: The problem can also be reproduced by running simple multi-threaded : pmbench benchmark with a fast Optane SSD swap (see profile below). :
:
: 6.15% 3.08% pmbench [kernel.vmlinux] [k] lruvec_lru_size
: | : |--3.07%--lruvec_lru_size : | | : | |--2.11%--cpumask_next : | | | : | | --1.66%--find_next_bit : | | : | --0.57%--call_function_interrupt : | | : | --0.55%--smp_call_function_interrupt : | : |--1.59%--0x441f0fc3d009 : | _ops_rdtsc_init_base_freq : | access_histogram : | page_fault : | __do_page_fault : | handle_mm_fault : | __handle_mm_fault : | | : | --1.54%--do_swap_page : | swapin_readahead : | swap_cluster_readahead : | | : | --1.53%--read_swap_cache_async : | __read_swap_cache_async : | alloc_pages_vma : | __alloc_pages_nodemask : | __alloc_pages_slowpath : | try_to_free_pages : | do_try_to_free_pages : | shrink_node : | shrink_node_memcg : | | : | |--0.77%--lruvec_lru_size : | | : | --0.76%--inactive_list_is_low : | | : | --0.76%--lruvec_lru_size : | : --1.50%--measure_read : page_fault : __do_page_fault : handle_mm_fault : __handle_mm_fault : do_swap_page : swapin_readahead : swap_cluster_readahead : | : --1.48%--read_swap_cache_async : __read_swap_cache_async : alloc_pages_vma : __alloc_pages_nodemask : __alloc_pages_slowpath : try_to_free_pages : do_try_to_free_pages : shrink_node : shrink_node_memcg : | : |--0.75%--inactive_list_is_low : | | : | --0.75%--lruvec_lru_size : |
: --0.73%--lruvec_lru_size
The likely culprit is the cache traffic the lruvec_page_state_local generates. Dave Hansen says:
: I was thinking purely of the cache footprint. If it's reading : pn->lruvec_stat_local->count[idx] is three separate cachelines, so 192 : bytes of cache *96 CPUs = 18k of data, mostly read-only. 1 cgroup would : be 18k of data for the whole system and the caching would be pretty : efficient and all 18k would probably survive a tight page fault loop in : the L1. 500 cgroups would be ~90k of data per CPU thread which doesn't : fit in the L1 and probably wouldn't survive a tight page fault loop if : both logical threads were banging on different cgroups.
:
: It's just a theory, but it's why I noted the number of cgroups when I : initially saw this show up in profiles
Fix the regression by partially reverting the said commit and calculate the lru size explicitly.
--- mm/vmscan.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
mm/vmscan.c +5 -4
@@ -354,12 +354,13 @@ unsigned long zone_reclaimable_pages(str*/ unsigned long lruvec_lru_size (struct lruvec *lruvec,enum lru_list lru,int zone_idx) { -unsigned long lru_size; +unsigned long lru_size =0 ;int zid; -if (!mem_cgroup_disabled ()) - lru_size =lruvec_page_state_local (lruvec,NR_LRU_BASE + lru); -else +if (!mem_cgroup_disabled ()) { +for (zid =0 ; zid <MAX_NR_ZONES ; zid++) + lru_size +=mem_cgroup_get_zone_lru_size (lruvec, lru, zid); + }else lru_size =node_page_state (lruvec_pgdat (lruvec),NR_LRU_BASE + lru);for (zid = zone_idx +1 ; zid <MAX_NR_ZONES ; zid++) {
Greg Kroah-Hartman
maintainerPATCH 134/197 drm/amdgpu/uvd7: fix allocation size in enc ring test (v2)
In reply to Greg Kroah-HartmanFrom: Alex Deucher <[email protected]>
commit 5d230bc91f6c15e5d281f2851502918d98b9e770 upstream.
We need to allocate a large enough buffer for the session info, otherwise the IB test can overwrite other memory.
v2: - session info is 128K according to mesa
- use the same session info for create and destroy
--- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +22 -11
@@ -214,13 +214,14 @@ static int uvd_v7_0_enc_ring_test_ring(s* Open up a stream for HW test */ static int uvd_v7_0_enc_get_create_msg (struct amdgpu_ring *ring,uint32_t handle, +struct amdgpu_bo *bo,struct dma_fence **fence) {const unsigned ib_size_dw =16 ;struct amdgpu_job *job;struct amdgpu_ib *ib;struct dma_fence *f =NULL ; -uint64_t dummy; +uint64_t addr;int i, r; r =amdgpu_job_alloc_with_ib (ring->adev, ib_size_dw *4 , &job);
@@ -228,15 +229,15 @@ static int uvd_v7_0_enc_get_create_msg(sreturn r; ib = &job->ibs[0 ]; - dummy = ib->gpu_addr +1024 ; + addr =amdgpu_bo_gpu_offset (bo); ib->length_dw =0 ; ib->ptr[ib->length_dw++] =0x00000018 ; ib->ptr[ib->length_dw++] =0x00000001 ;/* session info */ ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =0x00000000 ; - ib->ptr[ib->length_dw++] =upper_32_bits (dummy); - ib->ptr[ib->length_dw++] = dummy; + ib->ptr[ib->length_dw++] =upper_32_bits (addr); + ib->ptr[ib->length_dw++] = addr; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;/* task info */
@@ -275,13 +276,14 @@ err:* Close up a stream for HW test or if userspace failed to do so */ static int uvd_v7_0_enc_get_destroy_msg (struct amdgpu_ring *ring,uint32_t handle, -struct dma_fence **fence) +struct amdgpu_bo *bo, +struct dma_fence **fence) {const unsigned ib_size_dw =16 ;struct amdgpu_job *job;struct amdgpu_ib *ib;struct dma_fence *f =NULL ; -uint64_t dummy; +uint64_t addr;int i, r; r =amdgpu_job_alloc_with_ib (ring->adev, ib_size_dw *4 , &job);
@@ -289,15 +291,15 @@ static int uvd_v7_0_enc_get_destroy_msg(return r; ib = &job->ibs[0 ]; - dummy = ib->gpu_addr +1024 ; + addr =amdgpu_bo_gpu_offset (bo); ib->length_dw =0 ; ib->ptr[ib->length_dw++] =0x00000018 ; ib->ptr[ib->length_dw++] =0x00000001 ; ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =0x00000000 ; - ib->ptr[ib->length_dw++] =upper_32_bits (dummy); - ib->ptr[ib->length_dw++] = dummy; + ib->ptr[ib->length_dw++] =upper_32_bits (addr); + ib->ptr[ib->length_dw++] = addr; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;
@@ -334,13 +336,20 @@ err:static int uvd_v7_0_enc_ring_test_ib (struct amdgpu_ring *ring,long timeout) {struct dma_fence *fence =NULL ; +struct amdgpu_bo *bo =NULL ;long r; - r =uvd_v7_0_enc_get_create_msg (ring,1 ,NULL ); + r =amdgpu_bo_create_reserved (ring->adev,128 *1024 ,PAGE_SIZE , +AMDGPU_GEM_DOMAIN_VRAM , + &bo,NULL ,NULL ); +if (r) +return r; + + r =uvd_v7_0_enc_get_create_msg (ring,1 , bo,NULL );if (r) goto error; - r =uvd_v7_0_enc_get_destroy_msg (ring,1 , &fence); + r =uvd_v7_0_enc_get_destroy_msg (ring,1 , bo, &fence);if (r) goto error;
@@ -352,6 +361,8 @@ static int uvd_v7_0_enc_ring_test_ib(str error:dma_fence_put (fence); +amdgpu_bo_unreserve (bo); +amdgpu_bo_unref (&bo);return r; }
Greg Kroah-Hartman
maintainerPATCH 152/197 mm: memblock: do not enforce current limit for memblock_phys* family
In reply to Greg Kroah-HartmanFrom: Mike Rapoport <[email protected]>
commit f3057ad767542be7bbac44e548cb44017178a163 upstream.
Until commit 92d12f9544b7 ("memblock: refactor internal allocation functions") the maximal address for memblock allocations was forced to memblock.current_limit only for the allocation functions returning virtual address. The changes introduced by that commit moved the limit enforcement into the allocation core and as a result the allocation functions returning physical address also started to limit allocations to memblock.current_limit.
This caused breakage of etnaviv GPU driver:
etnaviv etnaviv: bound 130000.gpu (ops gpu_ops)
etnaviv etnaviv: bound 134000.gpu (ops gpu_ops)
etnaviv etnaviv: bound 2204000.gpu (ops gpu_ops) etnaviv-gpu 130000.gpu: model: GC2000, revision: 5108 etnaviv-gpu 130000.gpu: command buffer outside valid memory window etnaviv-gpu 134000.gpu: model: GC320, revision: 5007 etnaviv-gpu 134000.gpu: command buffer outside valid memory window etnaviv-gpu 2204000.gpu: model: GC355, revision: 1215 etnaviv-gpu 2204000.gpu: Ignoring GPU with VG and FE2.0
Restore the behaviour of memblock_phys* family so that these functions will not enforce memblock.current_limit.
--- mm/memblock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
mm/memblock.c +3 -3
@@ -1356,9 +1356,6 @@ static phys_addr_t __init memblock_alloc align =SMP_CACHE_BYTES ; } -if (end > memblock.current_limit) - end = memblock.current_limit; - again: found =memblock_find_in_range_node (size, align, start, end, nid, flags);
@@ -1469,6 +1466,9 @@ static void * __init memblock_alloc_inteif (WARN_ON_ONCE (slab_is_available ()))return kzalloc_node (size,GFP_NOWAIT , nid); +if (max_addr > memblock.current_limit) + max_addr = memblock.current_limit; + alloc =memblock_alloc_range_nid (size, align, min_addr, max_addr, nid);/* retry allocation without lower limit */
Greg Kroah-Hartman
maintainerPATCH 153/197 hugetlbfs: dont access uninitialized memmaps in pfn_range_valid_gigantic()
In reply to Greg Kroah-HartmanFrom: David Hildenbrand <[email protected]>
commit f231fe4235e22e18d847e05cbe705deaca56580a upstream.
Uninitialized memmaps contain garbage and in the worst case trigger kernel BUGs, especially with CONFIG_PAGE_POISONING. They should not get touched.
Let's make sure that we only consider online memory (managed by the buddy) that has initialized memmaps. ZONE_DEVICE is not applicable.
page_zone() will call page_to_nid(), which will trigger VM_BUG_ON_PGFLAGS(PagePoisoned(page), page) with CONFIG_PAGE_POISONING and CONFIG_DEBUG_VM_PGFLAGS when called on uninitialized memmaps. This can be the case when an offline memory block (e.g., never onlined) is spanned by a zone.
Note: As explained by Michal in [1], alloc_contig_range() will verify the range. So it boils down to the wrong access in this function.
[1] http://lkml.kernel.org/r/[email protected]
--- mm/hugetlb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
mm/hugetlb.c +2 -3
@@ -1084,11 +1084,10 @@ static bool pfn_range_valid_gigantic(strstruct page *page;for (i = start_pfn; i < end_pfn; i++) { -if (!pfn_valid (i)) + page =pfn_to_online_page (i); +if (!page)return false; - page =pfn_to_page (i); -if (page_zone (page) != z)return false;
Greg Kroah-Hartman
maintainerPATCH 154/197 mm/memory-failure: poison read receives SIGKILL instead of SIGBUS if mmaped more than once
In reply to Greg Kroah-HartmanFrom: Jane Chu <[email protected]>
commit 3d7fed4ad8ccb691d217efbb0f934e6a4df5ef91 upstream.
Mmap /dev/dax more than once, then read the poison location using address from one of the mappings. The other mappings due to not having the page mapped in will cause SIGKILLs delivered to the process. SIGKILL succeeds over SIGBUS, so user process loses the opportunity to handle the UE.
Although one may add MAP_POPULATE to mmap(2) to work around the issue, MAP_POPULATE makes mapping 128GB of pmem several magnitudes slower, so isn't always an option.
Details -
ndctl inject-error --block=10 --count=1 namespace6.0
./read_poison -x dax6.0 -o 5120 -m 2
mmaped address 0x7f5bb6600000
mmaped address 0x7f3cf3600000
doing local read at address 0x7f3cf3601400
Killed
Console messages in instrumented kernel -
mce: Uncorrected hardware memory error in user-access at edbe201400
Memory failure: tk->addr = 7f5bb6601000
Memory failure: address edbe201: call dev_pagemap_mapping_shift
dev_pagemap_mapping_shift: page edbe201: no PUD
Memory failure: tk->size_shift == 0
Memory failure: Unable to find user space address edbe201 in read_poison
Memory failure: tk->addr = 7f3cf3601000
Memory failure: address edbe201: call dev_pagemap_mapping_shift
Memory failure: tk->size_shift = 21
Memory failure: 0xedbe201: forcibly killing read_poison:22434 because of failure to unmap corrupted page
=> to deliver SIGKILL
Memory failure: 0xedbe201: Killing read_poison:22434 due to hardware memory corruption
=> to deliver SIGBUS
--- mm/memory-failure.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
mm/memory-failure.c +13 -9
@@ -199,7 +199,6 @@ struct to_kill {struct task_struct *tsk;unsigned long addr;short size_shift; -char addr_valid; };/*
@@ -324,22 +323,27 @@ static void add_to_kill(struct task_stru } } tk->addr =page_address_in_vma (p, vma); - tk->addr_valid =1 ;if (is_zone_device_page (p)) tk->size_shift =dev_pagemap_mapping_shift (p, vma);else tk->size_shift =compound_order (compound_head (p)) +PAGE_SHIFT ;/* -* In theory we don't have to kill when the page was -* munmaped. But it could be also a mremap. Since that's -* likely very rare kill anyways just out of paranoia, but use -* a SIGKILL because the error is not contained anymore. +* Send SIGKILL if "tk->addr == -EFAULT". Also, as +* "tk->size_shift" is always non-zero for !is_zone_device_page(), +* so "tk->size_shift == 0" effectively checks no mapping on +* ZONE_DEVICE. Indeed, when a devdax page is mmapped N times +* to a process' address space, it's possible not all N VMAs +* contain mappings for the page, but at least one VMA does. +* Only deliver SIGBUS with payload derived from the VMA that +* has a mapping for the page. */ -if (tk->addr == -EFAULT || tk->size_shift ==0 ) { +if (tk->addr == -EFAULT ) {pr_info ("Memory failure: Unable to find user space address %lx in %s\n" ,page_to_pfn (p), tsk->comm); - tk->addr_valid =0 ; + }else if (tk->size_shift ==0 ) { +kfree (tk); +return ; }get_task_struct (tsk); tk->tsk = tsk;
@@ -366,7 +370,7 @@ static void kill_procs(struct list_head* make sure the process doesn't catch the * signal and then access the memory. Just kill it. */ -if (fail || tk->addr_valid ==0 ) { +if (fail || tk->addr == -EFAULT ) {pr_err ("Memory failure: %#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n" , pfn, tk->tsk->comm, tk->tsk->pid); do_send_sig_info(SIGKILL, SEND_SIG_PRIV,
Greg Kroah-Hartman
maintainerPATCH 155/197 zram: fix race between backing_dev_show and backing_dev_store
In reply to Greg Kroah-HartmanFrom: Chenwandun <[email protected]>
commit f7daefe4231e57381d92c2e2ad905a899c28e402 upstream.
CPU0: CPU1:backing_dev_show backing_dev_store
...... ......
file = zram->backing_dev;
down_read(&zram->init_lock); down_read(&zram->init_init_lock)
file_path(file, ...); zram->backing_dev = backing_dev;
up_read(&zram->init_lock); up_read(&zram->init_lock);gets the value of zram->backing_dev too early in backing_dev_show, which resultin the value being NULL at the beginning, and not NULL later.
backtrace:
d_path+0xcc/0x174 file_path+0x10/0x18 backing_dev_show+0x40/0xb4 dev_attr_show+0x20/0x54 sysfs_kf_seq_show+0x9c/0x10c kernfs_seq_show+0x28/0x30 seq_read+0x184/0x488 kernfs_fop_read+0x5c/0x1a4 __vfs_read+0x44/0x128 vfs_read+0xa0/0x138 SyS_read+0x54/0xb4
--- drivers/block/zram/zram_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/block/zram/zram_drv.c +3 -2
@@ -413,13 +413,14 @@ static void reset_bdev(struct zram *zramstatic ssize_t backing_dev_show (struct device *dev,struct device_attribute *attr,char *buf) { +struct file *file;struct zram *zram =dev_to_zram (dev); -struct file *file = zram->backing_dev;char *p;ssize_t ret;down_read (&zram->init_lock); -if (!zram->backing_dev) { + file = zram->backing_dev; +if (!file) {memcpy (buf,"none\n" ,5 );up_read (&zram->init_lock);return 5 ;
Greg Kroah-Hartman
maintainerPATCH 157/197 xtensa: fix change_bit in exclusive access option
In reply to Greg Kroah-HartmanFrom: Max Filippov <[email protected]>
commit 775fd6bfefc66a8c33e91dd9687ed530643b954d upstream.
change_bit implementation for XCHAL_HAVE_EXCLUSIVE case changes all bits except the one required due to copy-paste error from clear_bit.
--- arch/xtensa/include/asm/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/xtensa/include/asm/bitops.h +1 -1
@@ -148,7 +148,7 @@ static inline void change_bit(unsigned i" getex %0\n" " beqz %0, 1b\n" : "=&a" (tmp) - : "a" (~mask), "a" (p) + : "a" (mask), "a" (p) : "memory"); }
Greg Kroah-Hartman
maintainerPATCH 158/197 s390/zcrypt: fix memleak at release
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 388bb19be8eab4674a660e0c97eaf60775362bc7 upstream.
If a process is interrupted while accessing the crypto device and the global ap_perms_mutex is contented, release() could return early and fail to free related resources.
--- drivers/s390/crypto/zcrypt_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/crypto/zcrypt_api.c +1 -2
@@ -539,8 +539,7 @@ static int zcrypt_release(struct inode *if (filp->f_inode->i_cdev == &zcrypt_cdev) {struct zcdn_device *zcdndev; -if (mutex_lock_interruptible (&ap_perms_mutex)) -return -ERESTARTSYS ; +mutex_lock (&ap_perms_mutex); zcdndev =find_zcdndev_by_devt (filp->f_inode->i_rdev);mutex_unlock (&ap_perms_mutex);if (zcdndev) {
Greg Kroah-Hartman
maintainerPATCH 156/197 xtensa: drop EXPORT_SYMBOL for outs*/ins*
In reply to Greg Kroah-HartmanFrom: Max Filippov <[email protected]>
commit 8b39da985194aac2998dd9e3a22d00b596cebf1e upstream.
Custom outs*/ins* implementations are long gone from the xtensa port, remove matching EXPORT_SYMBOLs.
This fixes the following build warnings issued by modpost since commit 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions"):
WARNING: "insb" [vmlinux] is a static EXPORT_SYMBOL
WARNING: "insw" [vmlinux] is a static EXPORT_SYMBOL
WARNING: "insl" [vmlinux] is a static EXPORT_SYMBOL
WARNING: "outsb" [vmlinux] is a static EXPORT_SYMBOL
WARNING: "outsw" [vmlinux] is a static EXPORT_SYMBOL
WARNING: "outsl" [vmlinux] is a static EXPORT_SYMBOL
--- arch/xtensa/kernel/xtensa_ksyms.c | 7 ------- 1 file changed, 7 deletions(-)
arch/xtensa/kernel/xtensa_ksyms.c +0 -7
@@ -119,13 +119,6 @@ EXPORT_SYMBOL(__invalidate_icache_range)// FIXME EXPORT_SYMBOL(screen_info); #endif -EXPORT_SYMBOL (outsb); -EXPORT_SYMBOL (outsw); -EXPORT_SYMBOL (outsl); -EXPORT_SYMBOL (insb); -EXPORT_SYMBOL (insw); -EXPORT_SYMBOL (insl); -extern long common_exception_return;EXPORT_SYMBOL (common_exception_return);
Greg Kroah-Hartman
maintainerPATCH 160/197 lib/vdso: Make clock_getres() POSIX compliant again
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
commit 1638b8f096ca165965189b9626564c933c79fe63 upstream.
A recent commit removed the NULL pointer check from the clock_getres() implementation causing a test case to fault.
POSIX requires an explicit NULL pointer check for clock_getres() aside of the validity check of the clock_id argument for obscure reasons.
Add it back for both 32bit and 64bit.
Note, this is only a partial revert of the offending commit which does not bring back the broken fallback invocation in the the 32bit compat implementations of clock_getres() and clock_gettime().
--- lib/vdso/gettimeofday.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
lib/vdso/gettimeofday.c +5 -4
@@ -214,9 +214,10 @@ int __cvdso_clock_getres_common(clockid_return -1 ; } - res->tv_sec =0 ; - res->tv_nsec = ns; - +if (likely (res)) { + res->tv_sec =0 ; + res->tv_nsec = ns; + }return 0 ; }
@@ -245,7 +246,7 @@ __cvdso_clock_getres_time32(clockid_t cl ret =clock_getres_fallback (clock, &ts);#endif -if (likely (!ret)) { +if (likely (!ret && res)) { res->tv_sec = ts.tv_sec; res->tv_nsec = ts.tv_nsec; }
Greg Kroah-Hartman
maintainerPATCH 161/197 parisc: Fix vmap memory leak in ioremap()/iounmap()
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit 513f7f747e1cba81f28a436911fba0b485878ebd upstream.
Sven noticed that calling ioremap() and iounmap() multiple times leads to a vmap memory leak:
vmap allocation for size 4198400 failed:
use vmalloc=<size> to increase size
It seems we missed calling vunmap() in iounmap().
--- arch/parisc/mm/ioremap.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
arch/parisc/mm/ioremap.c +7 -5
@@ -3,7 +3,7 @@* arch/parisc/mm/ioremap.c * * (C) Copyright 1995 1996 Linus Torvalds -* (C) Copyright 2001-2006 Helge Deller <[email protected]> +* (C) Copyright 2001-2019 Helge Deller <[email protected]> * (C) Copyright 2005 Kyle McMartin <[email protected]> */
@@ -84,7 +84,7 @@ void __iomem * __ioremap(unsigned long p addr = (void __iomem *) area->addr;if (ioremap_page_range ((unsigned long )addr, (unsigned long )addr + size, phys_addr, pgprot)) { -vfree (addr); +vunmap (addr);return NULL ; }
@@ -92,9 +92,11 @@ void __iomem * __ioremap(unsigned long p }EXPORT_SYMBOL (__ioremap); -void iounmap (const volatile void __iomem *addr) +void iounmap (const volatile void __iomem *io_addr) { -if (addr > high_memory) -return vfree ((void *) (PAGE_MASK & (unsigned long __force ) addr)); +unsigned long addr = (unsigned long )io_addr &PAGE_MASK ; + +if (is_vmalloc_addr ((void *)addr)) +vunmap ((void *)addr); }EXPORT_SYMBOL (iounmap);
Greg Kroah-Hartman
maintainerPATCH 135/197 drm/amdgpu: user pages array memory leak fix
In reply to Greg Kroah-HartmanFrom: Philip Yang <[email protected]>
commit 209620b422945ee03cebb03f726e706d537b692d upstream.
user_pages array should always be freed after validation regardless if user pages are changed after bo is created because with HMM change parse bo always allocate user pages array to get user pages for userptr bo.
v2: remove unused local variable and amend commit
v3: add back get user pages in gem_userptr_ioctl, to detect application bug where an userptr VMA is not ananymous memory and reject it.
Bugzilla: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1844962
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -6
@@ -536,7 +536,6 @@ static int amdgpu_cs_list_validate(struclist_for_each_entry (lobj, validated, tv.head) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (lobj->tv.bo); -bool binding_userptr = false;struct mm_struct *usermm; usermm =amdgpu_ttm_tt_get_usermm (bo->tbo.ttm);
@@ -553,7 +552,6 @@ static int amdgpu_cs_list_validate(strucamdgpu_ttm_tt_set_user_pages (bo->tbo.ttm, lobj->user_pages); - binding_userptr = true; }if (p->evictable == lobj)
@@ -563,10 +561,8 @@ static int amdgpu_cs_list_validate(strucif (r)return r; -if (binding_userptr) { -kvfree (lobj->user_pages); - lobj->user_pages =NULL ; - } +kvfree (lobj->user_pages); + lobj->user_pages =NULL ; }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 162/197 EDAC/ghes: Fix Use after free in ghes_edac remove path
In reply to Greg Kroah-HartmanFrom: James Morse <[email protected]>
commit 1e72e673b9d102ff2e8333e74b3308d012ddf75b upstream.
ghes_edac models a single logical memory controller, and uses a global ghes_init variable to ensure only the first ghes_edac_register() will do anything.
ghes_edac is registered the first time a GHES entry in the HEST is probed. There may be multiple entries, so subsequent attempts to register ghes_edac are silently ignored as the work has already been done.
When a GHES entry is unregistered, it calls ghes_edac_unregister(), which free()s the memory behind the global variables in ghes_edac.
But there may be multiple GHES entries, the next call to ghes_edac_unregister() will dereference the free()d memory, and attempt to free it a second time.
This may also be triggered on a platform with one GHES entry, if the driver is unbound/re-bound and unbound. The re-bind step will do nothing because of ghes_init, the second unbind will then do the same work as the first.
Doing the unregister work on the first call is unsafe, as another CPU may be processing a notification in ghes_edac_report_mem_error(), using the memory we are about to free.
ghes_init is already half of the reference counting. We only need to do the register work for the first call, and the unregister work for the last. Add the unregister check.
This means we no longer free ghes_edac's memory while there are GHES entries that may receive a notification.
This was detected by KASAN and DEBUG_TEST_DRIVER_REMOVE.
[ bp: merge into a single patch. ]
--- drivers/edac/ghes_edac.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/edac/ghes_edac.c +4 -0
@@ -553,7 +553,11 @@ void ghes_edac_unregister(struct ghes *gif (!ghes_pvt)return ; +if (atomic_dec_return (&ghes_init)) +return ; + mci = ghes_pvt->mci; + ghes_pvt =NULL ;edac_mc_del_mc (mci->pdev);edac_mc_free (mci); }
Greg Kroah-Hartman
maintainerPATCH 163/197 arm64: KVM: Trap VM ops when ARM64_WORKAROUND_CAVIUM_TX2_219_TVM is set
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit d3ec3a08fa700c8b46abb137dce4e2514a6f9668 upstream.
In order to workaround the TX2-219 erratum, it is necessary to trap TTBRx_EL1 accesses to EL2. This is done by setting HCR_EL2.TVM on guest entry, which has the side effect of trapping all the other VM-related sysregs as well.
To minimize the overhead, a fast path is used so that we don't have to go all the way back to the main sysreg handling code, unless the rest of the hypervisor expects to see these accesses.
--- arch/arm64/include/asm/cpucaps.h | 3 + arch/arm64/kvm/hyp/switch.c | 69 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 3 deletions(-)
arch/arm64/include/asm/cpucaps.h +2 -1
@@ -52,7 +52,8 @@#define ARM64_HAS_IRQ_PRIO_MASKING 42#define ARM64_HAS_DCPODP 43#define ARM64_WORKAROUND_1463225 44 +#define ARM64_WORKAROUND_CAVIUM_TX2_219_TVM 45 -#define ARM64_NCAPS 45 +#define ARM64_NCAPS 46#endif /* __ASM_CPUCAPS_H */
arch/arm64/kvm/hyp/switch.c +67 -2
93 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 164/197 arm64: Avoid Cavium TX2 erratum 219 when switching TTBR
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit 9405447ef79bc93101373e130f72e9e6cbf17dbb upstream.
As a PRFM instruction racing against a TTBR update can have undesirable effects on TX2, NOP-out such PRFM on cores that are affected by the TX2-219 erratum.
--- arch/arm64/include/asm/cpucaps.h | 3 ++- arch/arm64/kernel/cpu_errata.c | 5 +++++ arch/arm64/kernel/entry.S | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-)
arch/arm64/include/asm/cpucaps.h +2 -1
@@ -53,7 +53,8 @@#define ARM64_HAS_DCPODP 43#define ARM64_WORKAROUND_1463225 44#define ARM64_WORKAROUND_CAVIUM_TX2_219_TVM 45 +#define ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM 46 -#define ARM64_NCAPS 46 +#define ARM64_NCAPS 47#endif /* __ASM_CPUCAPS_H */
arch/arm64/kernel/cpu_errata.c +5 -0
@@ -851,6 +851,11 @@ const struct arm64_cpu_capabilities arm6 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, .matches = has_cortex_a76_erratum_1463225, }, + { + .desc = "Cavium ThunderX2 erratum 219 (PRFM removal)", + .capability = ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM, + ERRATA_MIDR_RANGE_LIST(tx2_family_cpus), + },#endif { }
arch/arm64/kernel/entry.S +2 -0
@@ -1070,7 +1070,9 @@ alternative_insn isb, nop, ARM64_WORKARO #else ldr x30, =vectors #endif +alternative_if_not ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM prfm plil1strm, [x30, #(1b - tramp_vectors)] +alternative_else_nop_endif msr vbar_el1, x30 add x30, x30, #(1b - tramp_vectors) isb
Greg Kroah-Hartman
maintainerPATCH 166/197 arm64: Allow CAVIUM_TX2_ERRATUM_219 to be selected
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit 603afdc9438ac546181e843f807253d75d3dbc45 upstream.
Allow the user to select the workaround for TX2-219, and update the silicon-errata.rst file to reflect this.
--- Documentation/arm64/silicon-errata.rst | 2 ++ arch/arm64/Kconfig | 17 +++++++++++++++++ 2 files changed, 19 insertions(+)
Documentation/arm64/silicon-errata.rst +2 -0
@@ -107,6 +107,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | Cavium | ThunderX2 SMMUv3| #126 | N/A | +----------------+-----------------+-----------------+-----------------------------+ +| Cavium | ThunderX2 Core | #219 | CAVIUM_TX2_ERRATUM_219 | ++----------------+-----------------+-----------------+-----------------------------+ +----------------+-----------------+-----------------+-----------------------------+ | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 | +----------------+-----------------+-----------------+-----------------------------+
arch/arm64/Kconfig +17 -0
@@ -601,6 +601,23 @@ config CAVIUM_ERRATUM_30115 If unsure, say Y. +config CAVIUM_TX2_ERRATUM_219 + bool "Cavium ThunderX2 erratum 219: PRFM between TTBR change and ISB fails" + default y + help + On Cavium ThunderX2, a load, store or prefetch instruction between a + TTBR update and the corresponding context synchronizing operation can + cause a spurious Data Abort to be delivered to any hardware thread in + the CPU core. + + Work around the issue by avoiding the problematic code sequence and + trapping KVM guest TTBRx_EL1 writes to EL2 when SMT is enabled. The + trap handler performs the corresponding register access, skips the + instruction and ensures context synchronization by virtue of the + exception return. + + If unsure, say Y. + config QCOM_FALKOR_ERRATUM_1003 bool "Falkor E1003: Incorrect translation due to ASID change" default y
Greg Kroah-Hartman
maintainerPATCH 167/197 CIFS: avoid using MID 0xFFFF
In reply to Greg Kroah-HartmanFrom: Roberto Bergantinos Corpas <[email protected]>
commit 03d9a9fe3f3aec508e485dd3dcfa1e99933b4bdb upstream.
According to MS-CIFS specification MID 0xFFFF should not be used by the CIFS client, but we actually do. Besides, this has proven to cause races leading to oops between SendReceive2/cifs_demultiplex_thread. On SMB1, MID is a 2 byte value easy to reach in CurrentMid which may conflict with an oplock break notification request coming from server
--- fs/cifs/smb1ops.c | 3 +++ 1 file changed, 3 insertions(+)
fs/cifs/smb1ops.c +3 -0
@@ -171,6 +171,9 @@ cifs_get_next_mid(struct TCP_Server_Info/* we do not want to loop forever */ last_mid = cur_mid; cur_mid++; +/* avoid 0xFFFF MID */ +if (cur_mid ==0xffff ) + cur_mid++;/* * This nested loop looks more expensive than it is.
Greg Kroah-Hartman
maintainerPATCH 168/197 cifs: Fix missed free operations
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
commit 783bf7b8b641167fb6f3f4f787f60ae62bad41b3 upstream.
cifs_setattr_nounix has two paths which miss free operations for xid and fullpath.
Use goto cifs_setattr_exit like other paths to fix them.
--- fs/cifs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/inode.c +2 -2
@@ -2465,9 +2465,9 @@ cifs_setattr_nounix(struct dentry *diren rc = tcon->ses->server->ops->flush (xid, tcon, &wfile->fid);cifsFileInfo_put (wfile);if (rc) -return rc; + goto cifs_setattr_exit; }else if (rc != -EBADF ) -return rc; + goto cifs_setattr_exit;else rc =0 ; }
Greg Kroah-Hartman
maintainerPATCH 169/197 CIFS: Fix use after free of file info structures
In reply to Greg Kroah-HartmanFrom: Pavel Shilovsky <[email protected]>
commit 1a67c415965752879e2e9fad407bc44fc7f25f23 upstream.
Currently the code assumes that if a file info entry belongs to lists of open file handles of an inode and a tcon then it has non-zero reference. The recent changes broke that assumption when putting the last reference of the file info. There may be a situation when a file is being deleted but nothing prevents another thread to reference it again and start using it. This happens because we do not hold the inode list lock while checking the number of references of the file info structure. Fix this by doing the proper locking when doing the check.
--- fs/cifs/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/cifs/file.c +3 -3
@@ -405,10 +405,11 @@ void _cifsFileInfo_put(struct cifsFileInbool oplock_break_cancelled;spin_lock (&tcon->open_file_lock); - +spin_lock (&cifsi->open_file_lock);spin_lock (&cifs_file->file_info_lock);if (--cifs_file->count >0 ) {spin_unlock (&cifs_file->file_info_lock); +spin_unlock (&cifsi->open_file_lock);spin_unlock (&tcon->open_file_lock);return ; }
@@ -421,9 +422,7 @@ void _cifsFileInfo_put(struct cifsFileIncifs_add_pending_open_locked (&fid, cifs_file->tlink, &open);/* remove it from the lists */ -spin_lock (&cifsi->open_file_lock);list_del (&cifs_file->flist); -spin_unlock (&cifsi->open_file_lock);list_del (&cifs_file->tlist);atomic_dec (&tcon->num_local_opens);
@@ -440,6 +439,7 @@ void _cifsFileInfo_put(struct cifsFileIncifs_set_oplock_level (cifsi,0 ); } +spin_unlock (&cifsi->open_file_lock);spin_unlock (&tcon->open_file_lock); oplock_break_cancelled = wait_oplock_handler ?
Greg Kroah-Hartman
maintainerPATCH 170/197 perf/aux: Fix AUX output stopping
In reply to Greg Kroah-HartmanFrom: Alexander Shishkin <[email protected]>
commit f3a519e4add93b7b31a6616f0b09635ff2e6a159 upstream.
Commit:
8a58ddae2379 ("perf/core: Fix exclusive events' grouping")
allows CAP_EXCLUSIVE events to be grouped with other events. Since all of those also happen to be AUX events (which is not the case the other way around, because arch/s390), this changes the rules for stopping the
output: the AUX event may not be on its PMU's context any more, if it's grouped with a HW event, in which case it will be on that HW event's context instead. If that's the case, munmap() of the AUX buffer can't find and stop the AUX event, potentially leaving the last reference with the atomic context, which will then end up freeing the AUX buffer. This will then trip warnings:
Fix this by using the context's PMU context when looking for events to stop, instead of the event's PMU context.
--- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
@@ -6839,7 +6839,7 @@ static void __perf_event_output_stop(strstatic int __perf_pmu_output_stop (void *info) {struct perf_event *event = info; -struct pmu *pmu = event->pmu; +struct pmu *pmu = event->ctx->pmu;struct perf_cpu_context *cpuctx =this_cpu_ptr (pmu->pmu_cpu_context);struct remote_output ro = { .rb = event->rb,
Greg Kroah-Hartman
maintainerPATCH 171/197 tracing: Fix race in perf_trace_buf initialization
In reply to Greg Kroah-HartmanFrom: Prateek Sood <[email protected]>
commit 6b1340cc00edeadd52ebd8a45171f38c8de2a387 upstream.
A race condition exists while initialiazing perf_trace_buf from perf_trace_init() and perf_kprobe_init().
CPU0 CPU1perf_trace_init()
mutex_lock(&event_mutex)
perf_trace_event_init()
perf_trace_event_reg()
total_ref_count == 0
buf = alloc_percpu()
perf_trace_buf[i] = buf
tp_event->class->reg() //fails perf_kprobe_init()
goto fail perf_trace_event_init()
perf_trace_event_reg()
fail:
total_ref_count == 0
total_ref_count == 0 buf = alloc_percpu() perf_trace_buf[i] = buf tp_event->class->reg() total_ref_count++
free_percpu(perf_trace_buf[i])
perf_trace_buf[i] = NULL
Any subsequent call to perf_trace_event_reg() will observe total_ref_count > 0, causing the perf_trace_buf to be always NULL. This can result in perf_trace_buf getting accessed from perf_trace_buf_alloc() without being initialized. Acquiring event_mutex in perf_kprobe_init() before calling perf_trace_event_init() should fix this race.
The race caused the following bug:
Unable to handle kernel paging request at virtual address 0000003106f2003c Mem abort info: ESR = 0x96000045 Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000045 CM = 0, WnR = 1 user pgtable: 4k pages, 39-bit VAs, pgdp = ffffffc034b9b000 [0000003106f2003c] pgd=0000000000000000, pud=0000000000000000 Internal error: Oops: 96000045 [#1] PREEMPT SMP Process syz-executor (pid: 18393, stack limit = 0xffffffc093190000) pstate: 80400005 (Nzcv daif +PAN -UAO) pc : __memset+0x20/0x1ac lr : memset+0x3c/0x50 sp : ffffffc09319fc50 __memset+0x20/0x1ac perf_trace_buf_alloc+0x140/0x1a0 perf_trace_sys_enter+0x158/0x310 syscall_trace_enter+0x348/0x7c0 el0_svc_common+0x11c/0x368 el0_svc_handler+0x12c/0x198 el0_svc+0x8/0xc
Ramdumps showed the following:
total_ref_count = 3
perf_trace_buf = (
0x0 -> NULL,
0x0 -> NULL,
0x0 -> NULL,
0x0 -> NULL)--- kernel/trace/trace_event_perf.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/trace/trace_event_perf.c +4 -0
@@ -272,9 +272,11 @@ int perf_kprobe_init(struct perf_event * goto out; } +mutex_lock (&event_mutex); ret =perf_trace_event_init (tp_event, p_event);if (ret)destroy_local_trace_kprobe (tp_event); +mutex_unlock (&event_mutex); out:kfree (func);return ret;
@@ -282,8 +284,10 @@ out:void perf_kprobe_destroy (struct perf_event *p_event) { +mutex_lock (&event_mutex);perf_trace_event_close (p_event);perf_trace_event_unreg (p_event); +mutex_unlock (&event_mutex);destroy_local_trace_kprobe (p_event->tp_event); }
Greg Kroah-Hartman
maintainerPATCH 172/197 fs/dax: Fix pmd vs pte conflict detection
In reply to Greg Kroah-HartmanFrom: Dan Williams <[email protected]>
commit 6370740e5f8ef12de7f9a9bf48a0393d202cd827 upstream.
Users reported a v5.3 performance regression and inability to establish huge page mappings. A revised version of the ndctl "dax.sh" huge page unit test identifies commit 23c84eb78375 "dax: Fix missed wakeup with PMD faults" as the source.
Update get_unlocked_entry() to check for NULL entries before checking the entry order, otherwise NULL is misinterpreted as a present pte conflict. The 'order' check needs to happen before the locked check as an unlocked entry at the wrong order must fallback to lookup the correct order.
--- fs/dax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/dax.c +3 -2
@@ -220,10 +220,11 @@ static void *get_unlocked_entry(struct xfor (;;) { entry =xas_find_conflict (xas); +if (!entry ||WARN_ON_ONCE (!xa_is_value (entry))) +return entry;if (dax_entry_order (entry) < order)return XA_RETRY_ENTRY ; -if (!entry ||WARN_ON_ONCE (!xa_is_value (entry)) || - !dax_is_locked (entry)) +if (!dax_is_locked (entry))return entry; wq =dax_entry_waitqueue (xas, entry, &ewait.key);
Greg Kroah-Hartman
maintainerPATCH 173/197 dm cache: fix bugs when a GFP_NOWAIT allocation fails
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
commit 13bd677a472d534bf100bab2713efc3f9e3f5978 upstream.
GFP_NOWAIT allocation can fail anytime - it doesn't wait for memory being available and it fails if the mempool is exhausted and there is not enough memory.
If we go down this path:
map_bio -> mg_start -> alloc_migration -> mempool_alloc(GFP_NOWAIT)
we can see that map_bio() doesn't check the return value of mg_start(), and the bio is leaked.
If we go down this path:
map_bio -> mg_start -> mg_lock_writes -> alloc_prison_cell -> dm_bio_prison_alloc_cell_v2 -> mempool_alloc(GFP_NOWAIT) -> mg_lock_writes -> mg_complete
the bio is ended with an error - it is unacceptable because it could cause filesystem corruption if the machine ran out of memory temporarily.
Change GFP_NOWAIT to GFP_NOIO, so that the mempool code will properly wait until memory becomes available. mempool_alloc with GFP_NOIO can't fail, so remove the code paths that deal with allocation failure.
--- drivers/md/dm-cache-target.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-)
drivers/md/dm-cache-target.c +2 -26
@@ -542,7 +542,7 @@ static void wake_migration_worker(structstatic struct dm_bio_prison_cell_v2 *alloc_prison_cell (struct cache *cache) { -return dm_bio_prison_alloc_cell_v2 (cache->prison,GFP_NOWAIT ); +return dm_bio_prison_alloc_cell_v2 (cache->prison,GFP_NOIO ); }static void free_prison_cell (struct cache *cache,struct dm_bio_prison_cell_v2 *cell)
@@ -554,9 +554,7 @@ static struct dm_cache_migration *alloc_ {struct dm_cache_migration *mg; - mg =mempool_alloc (&cache->migration_pool,GFP_NOWAIT ); -if (!mg) -return NULL ; + mg =mempool_alloc (&cache->migration_pool,GFP_NOIO );memset (mg,0 ,sizeof (*mg));
@@ -664,10 +662,6 @@ static bool bio_detain_shared(struct cacstruct dm_bio_prison_cell_v2 *cell_prealloc, *cell; cell_prealloc =alloc_prison_cell (cache);/* FIXME: allow wait if calling from worker */ -if (!cell_prealloc) { -defer_bio (cache, bio); -return false; - }build_key (oblock, end, &key); r =dm_cell_get_v2 (cache->prison, &key,lock_level (bio), bio, cell_prealloc, &cell);
@@ -1493,11 +1487,6 @@ static int mg_lock_writes(struct dm_cachstruct dm_bio_prison_cell_v2 *prealloc; prealloc =alloc_prison_cell (cache); -if (!prealloc) { -DMERR_LIMIT ("%s: alloc_prison_cell failed" ,cache_device_name (cache)); -mg_complete (mg, false); -return -ENOMEM ; - }/* * Prevent writes to the block, but allow reads to continue.
@@ -1535,11 +1524,6 @@ static int mg_start(struct cache *cache, } mg =alloc_migration (cache); -if (!mg) { -policy_complete_background_work (cache->policy, op, false); -background_work_end (cache); -return -ENOMEM ; - } mg->op = op; mg->overwrite_bio = bio;
@@ -1628,10 +1612,6 @@ static int invalidate_lock(struct dm_cacstruct dm_bio_prison_cell_v2 *prealloc; prealloc =alloc_prison_cell (cache); -if (!prealloc) { -invalidate_complete (mg, false); -return -ENOMEM ; - }build_key (mg->invalidate_oblock,oblock_succ (mg->invalidate_oblock), &key); r = dm_cell_lock_v2(cache->prison, &key,
@@ -1669,10 +1649,6 @@ static int invalidate_start(struct cachereturn -EPERM ; mg =alloc_migration (cache); -if (!mg) { -background_work_end (cache); -return -ENOMEM ; - } mg->overwrite_bio = bio; mg->invalidate_cblock = cblock;
Greg Kroah-Hartman
maintainerPATCH 174/197 irqchip/sifive-plic: Switch to fasteoi flow
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit bb0fed1c60cccbe4063b455a7228818395dac86e upstream.
The SiFive PLIC interrupt controller seems to have all the HW features to support the fasteoi flow, but the driver seems to be stuck in a distant past. Bring it into the 21st century.
--- drivers/irqchip/irq-sifive-plic.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
drivers/irqchip/irq-sifive-plic.c +15 -14
@@ -97,7 +97,7 @@ static inline void plic_irq_toggle(const } } -static void plic_irq_enable (struct irq_data *d) +static void plic_irq_unmask (struct irq_data *d) {unsigned int cpu =cpumask_any_and (irq_data_get_affinity_mask (d), cpu_online_mask);
@@ -106,7 +106,7 @@ static void plic_irq_enable(struct irq_dplic_irq_toggle (cpumask_of (cpu), d->hwirq,1 ); } -static void plic_irq_disable (struct irq_data *d) +static void plic_irq_mask (struct irq_data *d) {plic_irq_toggle (cpu_possible_mask, d->hwirq,0 ); }
@@ -125,10 +125,8 @@ static int plic_set_affinity(struct irq_if (cpu >= nr_cpu_ids)return -EINVAL ; -if (!irqd_irq_disabled (d)) { -plic_irq_toggle (cpu_possible_mask, d->hwirq,0 ); -plic_irq_toggle (cpumask_of (cpu), d->hwirq,1 ); - } +plic_irq_toggle (cpu_possible_mask, d->hwirq,0 ); +plic_irq_toggle (cpumask_of (cpu), d->hwirq,1 );irq_data_update_effective_affinity (d,cpumask_of (cpu));
@@ -136,14 +134,18 @@ static int plic_set_affinity(struct irq_ }#endif +static void plic_irq_eoi (struct irq_data *d) +{ +struct plic_handler *handler =this_cpu_ptr (&plic_handlers); + +writel (d->hwirq, handler->hart_base +CONTEXT_CLAIM ); +} +static struct irq_chip plic_chip = { .name ="SiFive PLIC" , -/* -* There is no need to mask/unmask PLIC interrupts. They are "masked" -* by reading claim and "unmasked" when writing it back. -*/ - .irq_enable = plic_irq_enable, - .irq_disable = plic_irq_disable, + .irq_mask = plic_irq_mask, + .irq_unmask = plic_irq_unmask, + .irq_eoi = plic_irq_eoi, #ifdef CONFIG_SMP .irq_set_affinity = plic_set_affinity, #endif
@@ -152,7 +154,7 @@ static struct irq_chip plic_chip = {static int plic_irqdomain_map (struct irq_domain *d,unsigned int irq,irq_hw_number_t hwirq) { -irq_set_chip_and_handler (irq, &plic_chip, handle_simple_irq); +irq_set_chip_and_handler (irq, &plic_chip, handle_fasteoi_irq);irq_set_chip_data (irq,NULL );irq_set_noprobe (irq);return 0 ;
@@ -188,7 +190,6 @@ static void plic_handle_irq(struct pt_re hwirq); elsegeneric_handle_irq (irq ); -writel (hwirq, claim); }csr_set (sie,SIE_SEIE ); }
Greg Kroah-Hartman
maintainerPATCH 175/197 x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area
In reply to Greg Kroah-HartmanFrom: Steve Wahl <[email protected]>
commit 2aa85f246c181b1fa89f27e8e20c5636426be624 upstream.
Our hardware (UV aka Superdome Flex) has address ranges marked reserved by the BIOS. Access to these ranges is caught as an error, causing the BIOS to halt the system.
Initial page tables mapped a large range of physical addresses that were not checked against the list of BIOS reserved addresses, and sometimes included reserved addresses in part of the mapped range. Including the reserved range in the map allowed processor speculative accesses to the reserved range, triggering a BIOS halt.
Used early in booting, the page table level2_kernel_pgt addresses 1 GiB divided into 2 MiB pages, and it was set up to linearly map a full
1 GiB of physical addresses that included the physical address range
of the kernel image, as chosen by KASLR. But this also included a large range of unused addresses on either side of the kernel image. And unlike the kernel image's physical address range, this extra mapped space was not checked against the BIOS tables of usable RAM addresses. So there were times when the addresses chosen by KASLR would result in processor accessible mappings of BIOS reserved physical addresses.
The kernel code did not directly access any of this extra mapped space, but having it mapped allowed the processor to issue speculative accesses into reserved memory, causing system halts.
This was encountered somewhat rarely on a normal system boot, and much more often when starting the crash kernel if "crashkernel=512M,high" was specified on the command line (this heavily restricts the physical address of the crash kernel, in our case usually within 1 GiB of reserved space).
The solution is to invalidate the pages of this table outside the kernel image's space before the page table is activated. It fixes this problem on our hardware.
[ bp: Touchups. ]
--- arch/x86/kernel/head64.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
arch/x86/kernel/head64.c +20 -2
@@ -222,13 +222,31 @@ unsigned long __head __startup_64(unsign* we might write invalid pmds, when the kernel is relocated * cleanup_highmap() fixes this up along with the mappings * beyond _end. +* +* Only the region occupied by the kernel image has so far +* been checked against the table of usable memory regions +* provided by the firmware, so invalidate pages outside that +* region. A page table entry that maps to a reserved area of +* memory would allow processor speculation into that area, +* and on some hardware (particularly the UV platform) even +* speculative access to some reserved areas is caught as an +* error, causing the BIOS to halt the system. */ pmd =fixup_pointer (level2_kernel_pgt, physaddr); -for (i =0 ; i <PTRS_PER_PMD ; i++) { + +/* invalidate pages before the kernel image */ +for (i =0 ; i <pmd_index ((unsigned long )_text); i++) + pmd[i] &= ~_PAGE_PRESENT; + +/* fixup pages that are part of the kernel image */ +for (; i <=pmd_index ((unsigned long )_end); i++)if (pmd[i] & _PAGE_PRESENT) pmd[i] += load_delta; - } + +/* invalidate pages after the kernel image */ +for (; i <PTRS_PER_PMD ; i++) + pmd[i] &= ~_PAGE_PRESENT;/* * Fixup phys_base - remove the memory encryption mask to obtain
Greg Kroah-Hartman
maintainerPATCH 176/197 x86/apic/x2apic: Fix a NULL pointer deref when handling a dying cpu
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
commit 7a22e03b0c02988e91003c505b34d752a51de344 upstream.
Check that the per-cpu cluster mask pointer has been set prior to clearing a dying cpu's bit. The per-cpu pointer is not set until the target cpu reaches smp_callin() during CPUHP_BRINGUP_CPU, whereas the teardown function, x2apic_dead_cpu(), is associated with the earlier CPUHP_X2APIC_PREPARE. If an error occurs before the cpu is awakened, e.g. if do_boot_cpu() itself fails, x2apic_dead_cpu() will dereference the NULL pointer and cause a panic.
smpboot: do_boot_cpu failed(-22) to wakeup CPU#1
BUG: kernel NULL pointer dereference, address: 0000000000000008 RIP: 0010:x2apic_dead_cpu+0x1a/0x30 Call Trace: cpuhp_invoke_callback+0x9a/0x580 _cpu_up+0x10d/0x140 do_cpu_up+0x69/0xb0 smp_init+0x63/0xa9 kernel_init_freeable+0xd7/0x229 ? rest_init+0xa0/0xa0 kernel_init+0xa/0x100 ret_from_fork+0x35/0x40
--- arch/x86/kernel/apic/x2apic_cluster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/apic/x2apic_cluster.c +2 -1
@@ -158,7 +158,8 @@ static int x2apic_dead_cpu(unsigned int {struct cluster_mask *cmsk =per_cpu (cluster_masks, dead_cpu); -cpumask_clear_cpu (dead_cpu, &cmsk->mask); +if (cmsk) +cpumask_clear_cpu (dead_cpu, &cmsk->mask);free_cpumask_var (per_cpu (ipi_mask, dead_cpu));return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 177/197 x86/hyperv: Make vapic support x2apic mode
In reply to Greg Kroah-HartmanFrom: Roman Kagan <[email protected]>
commit e211288b72f15259da86eed6eca680758dbe9e74 upstream.
Now that there's Hyper-V IOMMU driver, Linux can switch to x2apic mode when supported by the vcpus.
However, the apic access functions for Hyper-V enlightened apic assume xapic mode only.
As a result, Linux fails to bring up secondary cpus when run as a guest in QEMU/KVM with both hv_apic and x2apic enabled.
According to Michael Kelley, when in x2apic mode, the Hyper-V synthetic apic MSRs behave exactly the same as the corresponding architectural x2apic MSRs, so there's no need to override the apic accessors. The only exception is hv_apic_eoi_write, which benefits from lazy EOI when available; however, its implementation works for both xapic and x2apic modes.
--- arch/x86/hyperv/hv_apic.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
arch/x86/hyperv/hv_apic.c +15 -5
@@ -260,11 +260,21 @@ void __init hv_apic_init(void) }if (ms_hyperv.hints &HV_X64_APIC_ACCESS_RECOMMENDED ) { -pr_info ("Hyper-V: Using MSR based APIC access\n" ); +pr_info ("Hyper-V: Using enlightened APIC (%s mode)" , +x2apic_enabled () ?"x2apic" :"xapic" ); +/* +* With x2apic, architectural x2apic MSRs are equivalent to the +* respective synthetic MSRs, so there's no need to override +* the apic accessors. The only exception is +* hv_apic_eoi_write, because it benefits from lazy EOI when +* available, but it works for both xapic and x2apic modes. +*/ apic_set_eoi_write (hv_apic_eoi_write); - apic->read = hv_apic_read; - apic->write = hv_apic_write; - apic->icr_write = hv_apic_icr_write; - apic->icr_read = hv_apic_icr_read; +if (!x2apic_enabled ()) { + apic->read = hv_apic_read; + apic->write = hv_apic_write; + apic->icr_write = hv_apic_icr_write; + apic->icr_read = hv_apic_icr_read; + } } }
Greg Kroah-Hartman
maintainerPATCH 178/197 pinctrl: cherryview: restore Strago DMI workaround for all versions
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
commit 260996c30f4f3a732f45045e3e0efe27017615e4 upstream.
This is essentially a revert of:
e3f72b749da2 pinctrl: cherryview: fix Strago DMI workaround 86c5dd6860a6 pinctrl: cherryview: limit Strago DMI workarounds to version 1.0
because even with 1.1 versions of BIOS there are some pins that are configured as interrupts but not claimed by any driver, and they sometimes fire up and result in interrupt storms that cause touchpad stop functioning and other issues.
Given that we are unlikely to qualify another firmware version for a while it is better to keep the workaround active on all Strago boards.
--- drivers/pinctrl/intel/pinctrl-cherryview.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/pinctrl/intel/pinctrl-cherryview.c +0 -4
@@ -1513,7 +1513,6 @@ static const struct dmi_system_id chv_no .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"GOOGLE" ), DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"), - DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"), }, }, {
@@ -1521,7 +1520,6 @@ static const struct dmi_system_id chv_no .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"HP" ), DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"), - DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"), }, }, {
@@ -1529,7 +1527,6 @@ static const struct dmi_system_id chv_no .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"GOOGLE" ), DMI_MATCH(DMI_PRODUCT_NAME, "Cyan"), - DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"), }, }, {
@@ -1537,7 +1534,6 @@ static const struct dmi_system_id chv_no .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"GOOGLE" ), DMI_MATCH(DMI_PRODUCT_NAME, "Celes"), - DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"), }, }, {}
Greg Kroah-Hartman
maintainerPATCH 140/197 io_uring: used cached copies of sq->dropped and cq->overflow
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
[ Upstream commit 498ccd9eda49117c34e0041563d0da6ac40e52b8 ]
We currently use the ring values directly, but that can lead to issues if the application is malicious and changes these values on our behalf. Created in-kernel cached versions of them, and just overwrite the user side when we update them. This is similar to how we treat the sq/cq ring tail/head updates.
--- fs/io_uring.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
fs/io_uring.c +8 -5
@@ -221,6 +221,7 @@ struct io_ring_ctx {unsigned sq_entries;unsigned sq_mask;unsigned sq_thread_idle; +unsigned cached_sq_dropped;struct io_uring_sqe *sq_sqes;struct list_head defer_list;
@@ -237,6 +238,7 @@ struct io_ring_ctx {/* CQ ring */ struct io_cq_ring *cq_ring;unsigned cached_cq_tail; +atomic_t cached_cq_overflow;unsigned cq_entries;unsigned cq_mask;struct wait_queue_head cq_wait;
@@ -431,7 +433,8 @@ static inline bool io_sequence_defer(struct io_ring_ctx *ctx,if ((req->flags & (REQ_F_IO_DRAIN |REQ_F_IO_DRAINED )) !=REQ_F_IO_DRAIN )return false; -return req->sequence != ctx->cached_cq_tail + ctx->sq_ring->dropped; +return req->sequence != ctx->cached_cq_tail + ctx->sq_ring->dropped + +atomic_read (&ctx->cached_cq_overflow); }static struct io_kiocb *io_get_deferred_req (struct io_ring_ctx *ctx)
@@ -511,9 +514,8 @@ static void io_cqring_fill_event(struct io_ring_ctx *ctx, u64 ki_user_data,WRITE_ONCE (cqe->res, res);WRITE_ONCE (cqe->flags,0 ); }else { -unsigned overflow =READ_ONCE (ctx->cq_ring->overflow); - -WRITE_ONCE (ctx->cq_ring->overflow, overflow +1 ); +WRITE_ONCE (ctx->cq_ring->overflow, +atomic_inc_return (&ctx->cached_cq_overflow)); } }
@@ -2272,7 +2274,8 @@ static bool io_get_sqring(struct io_ring_ctx *ctx, struct sqe_submit *s)/* drop invalid entries */ ctx->cached_sq_head++; - ring->dropped++; + ctx->cached_sq_dropped++; +WRITE_ONCE (ring->dropped, ctx->cached_sq_dropped);return false; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 141/197 mmc: mxs: fix flags passed to dmaengine_prep_slave_sg
In reply to Greg Kroah-HartmanFrom: Sascha Hauer <[email protected]>
commit 2bb9f7566ba7ab3c2154964461e37b52cdc6b91b upstream.
Since ceeeb99cd821 we no longer abuse the DMA_CTRL_ACK flag for custom driver use and introduced the MXS_DMA_CTRL_WAIT4END instead. We have not changed all users to this flag though. This patch fixes it for the mxs-mmc driver.
--- drivers/mmc/host/mxs-mmc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/host/mxs-mmc.c +4 -3
@@ -17,6 +17,7 @@#include <linux/interrupt.h> #include <linux/dma-mapping.h> #include <linux/dmaengine.h> +#include <linux/dma/mxs-dma.h> #include <linux/highmem.h> #include <linux/clk.h> #include <linux/err.h>
@@ -266,7 +267,7 @@ static void mxs_mmc_bc(struct mxs_mmc_ho ssp->ssp_pio_words[2 ] = cmd1; ssp->dma_dir =DMA_NONE ; ssp->slave_dirn =DMA_TRANS_NONE ; - desc =mxs_mmc_prep_dma (host,DMA_CTRL_ACK ); + desc =mxs_mmc_prep_dma (host,MXS_DMA_CTRL_WAIT4END );if (!desc) goto out;
@@ -311,7 +312,7 @@ static void mxs_mmc_ac(struct mxs_mmc_ho ssp->ssp_pio_words[2 ] = cmd1; ssp->dma_dir =DMA_NONE ; ssp->slave_dirn =DMA_TRANS_NONE ; - desc =mxs_mmc_prep_dma (host,DMA_CTRL_ACK ); + desc =mxs_mmc_prep_dma (host,MXS_DMA_CTRL_WAIT4END );if (!desc) goto out;
@@ -441,7 +442,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_ host->data = data; ssp->dma_dir = dma_data_dir; ssp->slave_dirn = slave_dirn; - desc =mxs_mmc_prep_dma (host,DMA_PREP_INTERRUPT |DMA_CTRL_ACK ); + desc =mxs_mmc_prep_dma (host,DMA_PREP_INTERRUPT |MXS_DMA_CTRL_WAIT4END );if (!desc) goto out;
Greg Kroah-Hartman
maintainerPATCH 132/197 drm/amdgpu/vcn: fix allocation size in enc ring test
In reply to Greg Kroah-HartmanFrom: Alex Deucher <[email protected]>
commit c81fffc2c9450750dd7a54a36a788a860ab0425d upstream.
We need to allocate a large enough buffer for the session info, otherwise the IB test can overwrite other memory.
- Session info is 128K according to mesa
- Use the same session info for create and destroy
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +23 -12
@@ -517,13 +517,14 @@ int amdgpu_vcn_enc_ring_test_ring(struct }static int amdgpu_vcn_enc_get_create_msg (struct amdgpu_ring *ring,uint32_t handle, -struct dma_fence **fence) +struct amdgpu_bo *bo, +struct dma_fence **fence) {const unsigned ib_size_dw =16 ;struct amdgpu_job *job;struct amdgpu_ib *ib;struct dma_fence *f =NULL ; -uint64_t dummy; +uint64_t addr;int i, r; r =amdgpu_job_alloc_with_ib (ring->adev, ib_size_dw *4 , &job);
@@ -531,14 +532,14 @@ static int amdgpu_vcn_enc_get_create_msgreturn r; ib = &job->ibs[0 ]; - dummy = ib->gpu_addr +1024 ; + addr =amdgpu_bo_gpu_offset (bo); ib->length_dw =0 ; ib->ptr[ib->length_dw++] =0x00000018 ; ib->ptr[ib->length_dw++] =0x00000001 ;/* session info */ ib->ptr[ib->length_dw++] = handle; - ib->ptr[ib->length_dw++] =upper_32_bits (dummy); - ib->ptr[ib->length_dw++] = dummy; + ib->ptr[ib->length_dw++] =upper_32_bits (addr); + ib->ptr[ib->length_dw++] = addr; ib->ptr[ib->length_dw++] =0x0000000b ; ib->ptr[ib->length_dw++] =0x00000014 ;
@@ -569,13 +570,14 @@ err: }static int amdgpu_vcn_enc_get_destroy_msg (struct amdgpu_ring *ring,uint32_t handle, -struct dma_fence **fence) +struct amdgpu_bo *bo, +struct dma_fence **fence) {const unsigned ib_size_dw =16 ;struct amdgpu_job *job;struct amdgpu_ib *ib;struct dma_fence *f =NULL ; -uint64_t dummy; +uint64_t addr;int i, r; r =amdgpu_job_alloc_with_ib (ring->adev, ib_size_dw *4 , &job);
@@ -583,14 +585,14 @@ static int amdgpu_vcn_enc_get_destroy_msreturn r; ib = &job->ibs[0 ]; - dummy = ib->gpu_addr +1024 ; + addr =amdgpu_bo_gpu_offset (bo); ib->length_dw =0 ; ib->ptr[ib->length_dw++] =0x00000018 ; ib->ptr[ib->length_dw++] =0x00000001 ; ib->ptr[ib->length_dw++] = handle; - ib->ptr[ib->length_dw++] =upper_32_bits (dummy); - ib->ptr[ib->length_dw++] = dummy; + ib->ptr[ib->length_dw++] =upper_32_bits (addr); + ib->ptr[ib->length_dw++] = addr; ib->ptr[ib->length_dw++] =0x0000000b ; ib->ptr[ib->length_dw++] =0x00000014 ;
@@ -623,13 +625,20 @@ err:int amdgpu_vcn_enc_ring_test_ib (struct amdgpu_ring *ring,long timeout) {struct dma_fence *fence =NULL ; +struct amdgpu_bo *bo =NULL ;long r; - r =amdgpu_vcn_enc_get_create_msg (ring,1 ,NULL ); + r =amdgpu_bo_create_reserved (ring->adev,128 *1024 ,PAGE_SIZE , +AMDGPU_GEM_DOMAIN_VRAM , + &bo,NULL ,NULL ); +if (r) +return r; + + r =amdgpu_vcn_enc_get_create_msg (ring,1 , bo,NULL );if (r) goto error; - r =amdgpu_vcn_enc_get_destroy_msg (ring,1 , &fence); + r =amdgpu_vcn_enc_get_destroy_msg (ring,1 , bo, &fence);if (r) goto error;
@@ -641,6 +650,8 @@ int amdgpu_vcn_enc_ring_test_ib(struct a error:dma_fence_put (fence); +amdgpu_bo_unreserve (bo); +amdgpu_bo_unref (&bo);return r; }
Greg Kroah-Hartman
maintainerPATCH 180/197 pinctrl: armada-37xx: swap polarity on LED group
In reply to Greg Kroah-HartmanFrom: Patrick Williams <[email protected]>
commit b835d6953009dc350d61402a854b5a7178d8c615 upstream.
The configuration registers for the LED group have inverted polarity, which puts the GPIO into open-drain state when used in GPIO mode. Switch to '0' for GPIO and '1' for LED modes.
--- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +4 -4
@@ -183,10 +183,10 @@ static struct armada_37xx_pin_group armaPIN_GRP_EXTRA ("uart2" ,9 ,2 ,BIT (1 ) |BIT (13 ) |BIT (14 ) |BIT (19 ),BIT (1 ) |BIT (13 ) |BIT (14 ),BIT (1 ) |BIT (19 ),18 ,2 ,"gpio" ,"uart" ), -PIN_GRP_GPIO ("led0_od" ,11 ,1 ,BIT (20 ),"led" ), -PIN_GRP_GPIO ("led1_od" ,12 ,1 ,BIT (21 ),"led" ), -PIN_GRP_GPIO ("led2_od" ,13 ,1 ,BIT (22 ),"led" ), - PIN_GRP_GPIO("led3_od", 14, 1, BIT(23), "led"), +PIN_GRP_GPIO_2 ("led0_od" ,11 ,1 ,BIT (20 ),BIT (20 ),0 ,"led" ), +PIN_GRP_GPIO_2 ("led1_od" ,12 ,1 ,BIT (21 ),BIT (21 ),0 ,"led" ), +PIN_GRP_GPIO_2 ("led2_od" ,13 ,1 ,BIT (22 ),BIT (22 ),0 ,"led" ), + PIN_GRP_GPIO_2("led3_od", 14, 1, BIT(23), BIT(23), 0, "led"), };
Greg Kroah-Hartman
maintainerPATCH 189/197 memstick: jmb38x_ms: Fix an error handling path in jmb38x_ms_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit 28c9fac09ab0147158db0baeec630407a5e9b892 upstream.
If 'jmb38x_ms_count_slots()' returns 0, we must undo the previous 'pci_request_regions()' call.
Goto 'err_out_int' to fix it.
--- drivers/memstick/host/jmb38x_ms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memstick/host/jmb38x_ms.c +1 -1
@@ -941,7 +941,7 @@ static int jmb38x_ms_probe(struct pci_deif (!cnt) { rc = -ENODEV ; pci_dev_busy =1 ; - goto err_out; + goto err_out_int; } jm = kzalloc(sizeof(struct jmb38x_ms)
Greg Kroah-Hartman
maintainerPATCH 192/197 xen/netback: fix error path of xenvif_connect_data()
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
commit 3d5c1a037d37392a6859afbde49be5ba6a70a6b3 upstream.
xenvif_connect_data() calls module_put() in case of error. This is wrong as there is no related module_get().
Remove the superfluous module_put().
--- drivers/net/xen-netback/interface.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/xen-netback/interface.c +0 -1
@@ -719,7 +719,6 @@ err_unmap:xenvif_unmap_frontend_data_rings (queue);netif_napi_del (&queue->napi); err: -module_put (THIS_MODULE );return err; }