4.18.12-stable review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 171/228 bus: ti-sysc: Fix module register ioremap for larger offsets
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit 0ef8e3bb974af56346b34393e643d491d9141c66 ]
We can have the interconnect target module control registers pretty much anywhere within the module range. The current code attempts an incomplete optimization of the ioremap size but does it wrong and it only works for registers at the beginning of the module.
Let's just use the largest control register to calculate the ioremap size. The ioremapped range is for most part cached anyways so there is no need for size optimization. Let's also update the comments accordingly.
target driver")
--- drivers/bus/ti-sysc.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-)
drivers/bus/ti-sysc.c +13 -16
@@ -490,32 +490,29 @@ static int sysc_check_registers(struct s/** * syc_ioremap - ioremap register space for the interconnect target module -* @ddata: deviec driver data +* @ddata: device driver data * * Note that the interconnect target module registers can be anywhere -* within the first child device address space. For example, SGX has -* them at offset 0x1fc00 in the 32MB module address space. We just -* what we need around the interconnect target module registers. +* within the interconnect target module range. For example, SGX has +* them at offset 0x1fc00 in the 32MB module address space. And cpsw +* has them at offset 0x1200 in the CPSW_WR child. Usually the +* the interconnect target module registers are at the beginning of +* the module range though. */ static int sysc_ioremap (struct sysc *ddata) { -u32 size =0 ; +int size; -if (ddata->offsets[SYSC_SYSSTATUS ] >=0 ) - size = ddata->offsets[SYSC_SYSSTATUS ]; -else if (ddata->offsets[SYSC_SYSCONFIG ] >=0 ) - size = ddata->offsets[SYSC_SYSCONFIG ]; -else if (ddata->offsets[SYSC_REVISION ] >=0 ) - size = ddata->offsets[SYSC_REVISION ]; -else -return -EINVAL ; + size =max3 (ddata->offsets[SYSC_REVISION ], + ddata->offsets[SYSC_SYSCONFIG ], + ddata->offsets[SYSC_SYSSTATUS ]); - size &=0xfff00 ; - size +=SZ_256 ; +if (size <0 || (size +sizeof (u32)) > ddata->module_size) +return -EINVAL ; ddata->module_va =devm_ioremap (ddata->dev, ddata->module_pa, - size); + size +sizeof (u32));if (!ddata->module_va)return -EIO ;
Greg Kroah-Hartman
maintainerPATCH 172/228 qed: Wait for ready indication before rereading the shmem
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomer Tayar <[email protected]>
[ Upstream commit f00d25f3154b676fcea4502a25b94bd7f142ca74 ]
The MFW might be reset and re-update its shared memory.
Upon the detection of such a reset the driver rereads this memory, but it has to wait till the data is valid.
This patch adds the missing wait for a data ready indication.
--- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 50 ++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 9 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_mcp.c +41 -9
@@ -183,18 +183,57 @@ int qed_mcp_free(struct qed_hwfn *p_hwfnreturn 0 ; } +/* Maximum of 1 sec to wait for the SHMEM ready indication */ +#define QED_MCP_SHMEM_RDY_MAX_RETRIES 20 +#define QED_MCP_SHMEM_RDY_ITER_MS 50 +static int qed_load_mcp_offsets (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt) {struct qed_mcp_info *p_info = p_hwfn->mcp_info; +u8 cnt =QED_MCP_SHMEM_RDY_MAX_RETRIES ; +u8 msec =QED_MCP_SHMEM_RDY_ITER_MS ;u32 drv_mb_offsize, mfw_mb_offsize;u32 mcp_pf_id =MCP_PF_ID (p_hwfn); p_info->public_base =qed_rd (p_hwfn, p_ptt,MISC_REG_SHARED_MEM_ADDR ); -if (!p_info->public_base) -return 0 ; +if (!p_info->public_base) { +DP_NOTICE (p_hwfn, +"The address of the MCP scratch-pad is not configured\n" ); +return -EINVAL ; + } p_info->public_base |=GRCBASE_MCP ; +/* Get the MFW MB address and number of supported messages */ + mfw_mb_offsize =qed_rd (p_hwfn, p_ptt, +SECTION_OFFSIZE_ADDR (p_info->public_base, +PUBLIC_MFW_MB )); + p_info->mfw_mb_addr =SECTION_ADDR (mfw_mb_offsize, mcp_pf_id); + p_info->mfw_mb_length = (u16 )qed_rd (p_hwfn, p_ptt, + p_info->mfw_mb_addr + + offsetof(struct public_mfw_mb , + sup_msgs)); + +/* The driver can notify that there was an MCP reset, and might read the +* SHMEM values before the MFW has completed initializing them. +* To avoid this, the "sup_msgs" field in the MFW mailbox is used as a +* data ready indication. +*/ +while (!p_info->mfw_mb_length && --cnt) { +msleep (msec); + p_info->mfw_mb_length = + (u16 )qed_rd (p_hwfn, p_ptt, + p_info->mfw_mb_addr + + offsetof(struct public_mfw_mb , sup_msgs)); + } + +if (!cnt) { +DP_NOTICE (p_hwfn, +"Failed to get the SHMEM ready notification after %d msec\n" , +QED_MCP_SHMEM_RDY_MAX_RETRIES * msec); +return -EBUSY ; + } +/* Calculate the driver and MFW mailbox address */ drv_mb_offsize = qed_rd(p_hwfn, p_ptt, SECTION_OFFSIZE_ADDR(p_info->public_base,
@@ -204,13 +243,6 @@ static int qed_load_mcp_offsets(struct q"drv_mb_offsiz = 0x%x, drv_mb_addr = 0x%x mcp_pf_id = 0x%x\n" , drv_mb_offsize, p_info->drv_mb_addr, mcp_pf_id); -/* Set the MFW MB address */ - mfw_mb_offsize =qed_rd (p_hwfn, p_ptt, -SECTION_OFFSIZE_ADDR (p_info->public_base, -PUBLIC_MFW_MB )); - p_info->mfw_mb_addr =SECTION_ADDR (mfw_mb_offsize, mcp_pf_id); - p_info->mfw_mb_length = (u16 )qed_rd (p_hwfn, p_ptt, p_info->mfw_mb_addr); -/* Get the current driver mailbox sequence before sending * the first command */
Greg Kroah-Hartman
maintainerPATCH 173/228 qed: Wait for MCP halt and resume commands to take place
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomer Tayar <[email protected]>
[ Upstream commit 76271809f49056f079e202bf6513d17b0d6dd34d ]
Successive iterations of halting and resuming the management chip (MCP) might fail, since currently the driver doesn't wait for these operations to actually take place.
This patch prevents the driver from moving forward before the operations are reflected in the state register.
--- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 46 ++++++++++++++++++++----- drivers/net/ethernet/qlogic/qed/qed_reg_addr.h | 1 2 files changed, 39 insertions(+), 8 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_mcp.c +38 -8
@@ -2107,31 +2107,61 @@ qed_mcp_send_drv_version(struct qed_hwfnreturn rc; } +/* A maximal 100 msec waiting time for the MCP to halt */ +#define QED_MCP_HALT_SLEEP_MS 10 +#define QED_MCP_HALT_MAX_RETRIES 10 +int qed_mcp_halt (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt) { -u32 resp =0 , param =0 ; +u32 resp =0 , param =0 , cpu_state, cnt =0 ;int rc; rc =qed_mcp_cmd (p_hwfn, p_ptt,DRV_MSG_CODE_MCP_HALT ,0 , &resp, ¶m); -if (rc) +if (rc) {DP_ERR (p_hwfn,"MCP response failure, aborting\n" ); +return rc; + } -return rc; +do { +msleep (QED_MCP_HALT_SLEEP_MS ); + cpu_state =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_STATE ); +if (cpu_state &MCP_REG_CPU_STATE_SOFT_HALTED ) +break ; + }while (++cnt <QED_MCP_HALT_MAX_RETRIES ); + +if (cnt ==QED_MCP_HALT_MAX_RETRIES ) { +DP_NOTICE (p_hwfn, +"Failed to halt the MCP [CPU_MODE = 0x%08x, CPU_STATE = 0x%08x]\n" , +qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_MODE ), cpu_state); +return -EBUSY ; + } + +return 0 ; } +#define QED_MCP_RESUME_SLEEP_MS 10 +int qed_mcp_resume (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt) { -u32 value, cpu_mode; +u32 cpu_mode, cpu_state;qed_wr (p_hwfn, p_ptt,MCP_REG_CPU_STATE ,0xffffffff ); - value =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_MODE ); - value &= ~MCP_REG_CPU_MODE_SOFT_HALT ; -qed_wr (p_hwfn, p_ptt,MCP_REG_CPU_MODE , value); cpu_mode =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_MODE ); + cpu_mode &= ~MCP_REG_CPU_MODE_SOFT_HALT ; +qed_wr (p_hwfn, p_ptt,MCP_REG_CPU_MODE , cpu_mode); +msleep (QED_MCP_RESUME_SLEEP_MS ); + cpu_state =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_STATE ); + +if (cpu_state &MCP_REG_CPU_STATE_SOFT_HALTED ) { +DP_NOTICE (p_hwfn, +"Failed to resume the MCP [CPU_MODE = 0x%08x, CPU_STATE = 0x%08x]\n" , + cpu_mode, cpu_state); +return -EBUSY ; + } -return (cpu_mode &MCP_REG_CPU_MODE_SOFT_HALT ) ? -EAGAIN :0 ; +return 0 ; } int qed_mcp_ov_update_current_config(struct qed_hwfn *p_hwfn,
drivers/net/ethernet/qlogic/qed/qed_reg_addr.h +1 -0
@@ -562,6 +562,7 @@ 0#define MCP_REG_CPU_STATE \ 0xe05004UL +#define MCP_REG_CPU_STATE_SOFT_HALTED (0x1UL << 10)#define MCP_REG_CPU_EVENT_MASK \ 0xe05008UL#define PGLUE_B_REG_PF_BAR0_SIZE \
Greg Kroah-Hartman
maintainerPATCH 174/228 qed: Prevent a possible deadlock during driver load and unload
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomer Tayar <[email protected]>
[ Upstream commit eaa50fc59e5841910987e90b0438b2643041f508 ]
The MFW manages an internal lock to prevent concurrent hardware (de)initialization of different PFs.
This, together with the busy-waiting for the MFW's responses for commands, might lead to a deadlock during concurrent load or unload of PFs. This patch adds the option to sleep within the busy-waiting, and uses it for the (un)load requests (which are not sent from an interrupt context) to prevent the possible deadlock.
--- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 43 +++++++++++++++++++++--------- drivers/net/ethernet/qlogic/qed/qed_mcp.h | 21 +++++++++----- 2 files changed, 44 insertions(+), 20 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_mcp.c +31 -12
@@ -48,7 +48,7 @@#include "qed_reg_addr.h" #include "qed_sriov.h" -#define CHIP_MCP_RESP_ITER_US 10 +#define QED_MCP_RESP_ITER_US 10#define QED_DRV_MB_MAX_RETRIES (500 * 1000)/* Account for 5 sec */ #define QED_MCP_RESET_RETRIES (50 * 1000)/* Account for 500 msec */
@@ -317,7 +317,7 @@ static void qed_mcp_reread_offsets(strucint qed_mcp_reset (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt) { -u32 org_mcp_reset_seq, seq, delay =CHIP_MCP_RESP_ITER_US , cnt =0 ; +u32 org_mcp_reset_seq, seq, delay =QED_MCP_RESP_ITER_US , cnt =0 ;int rc =0 ;/* Ensure that only a single thread is accessing the mailbox */
@@ -449,10 +449,10 @@ static int _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, struct qed_mcp_mb_params *p_mb_params, - u32 max_retries, u32 delay) + u32 max_retries, u32 usecs) { + u32 cnt = 0, msecs = DIV_ROUND_UP(usecs, 1000);struct qed_mcp_cmd_elem *p_cmd_elem; -u32 cnt =0 ;u16 seq_num;int rc =0 ;
@@ -475,7 +475,11 @@ _qed_mcp_cmd_and_union(struct qed_hwfn * goto err;spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock); -udelay (delay); + +if (QED_MB_FLAGS_IS_SET (p_mb_params,CAN_SLEEP )) +msleep (msecs); +else +udelay (usecs); }while (++cnt < max_retries);if (cnt >= max_retries) {
@@ -504,7 +508,11 @@ _qed_mcp_cmd_and_union(struct qed_hwfn ** The spinlock stays locked until the list element is removed. */ -udelay (delay); +if (QED_MB_FLAGS_IS_SET (p_mb_params,CAN_SLEEP )) +msleep (msecs); +else +udelay (usecs); +spin_lock_bh (&p_hwfn->mcp_info->cmd_lock);if (p_cmd_elem->b_is_completed)
@@ -539,7 +547,7 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *"MFW mailbox: response 0x%08x param 0x%08x [after %d.%03d ms]\n" , p_mb_params->mcp_resp, p_mb_params->mcp_param, - (cnt * delay) / 1000, (cnt * delay) % 1000); + (cnt * usecs) / 1000, (cnt * usecs) % 1000);/* Clear the sequence number from the MFW response */ p_mb_params->mcp_resp &=FW_MSG_CODE_MASK ;
@@ -557,7 +565,7 @@ static int qed_mcp_cmd_and_union(struct {size_t union_data_size =sizeof (union drv_union_data );u32 max_retries =QED_DRV_MB_MAX_RETRIES ; -u32 delay =CHIP_MCP_RESP_ITER_US ; +u32 usecs =QED_MCP_RESP_ITER_US ;/* MCP not initialized */ if (!qed_mcp_is_init (p_hwfn)) {
@@ -574,8 +582,13 @@ static int qed_mcp_cmd_and_union(structreturn -EINVAL ; } +if (QED_MB_FLAGS_IS_SET (p_mb_params,CAN_SLEEP )) { + max_retries =DIV_ROUND_UP (max_retries,1000 ); + usecs *=1000 ; + } +return _qed_mcp_cmd_and_union (p_hwfn, p_ptt, p_mb_params, max_retries, - delay); + usecs); } int qed_mcp_cmd(struct qed_hwfn *p_hwfn,
@@ -792,6 +805,7 @@ __qed_mcp_load_req(struct qed_hwfn *p_hw mb_params.data_src_size =sizeof (load_req); mb_params.p_data_dst = &load_rsp; mb_params.data_dst_size =sizeof (load_rsp); + mb_params.flags =QED_MB_FLAG_CAN_SLEEP ; DP_VERBOSE(p_hwfn, QED_MSG_SP, "Load Request: param 0x%08x [init_hw %d, drv_type %d, hsi_ver %d, pda 0x%04x]\n",
@@ -1013,7 +1027,8 @@ int qed_mcp_load_req(struct qed_hwfn *p_int qed_mcp_unload_req (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt) { -u32 wol_param, mcp_resp, mcp_param; +struct qed_mcp_mb_params mb_params; +u32 wol_param;switch (p_hwfn->cdev->wol_config) {case QED_OV_WOL_DISABLED :
@@ -1031,8 +1046,12 @@ int qed_mcp_unload_req(struct qed_hwfn * wol_param =DRV_MB_PARAM_UNLOAD_WOL_MCP ; } -return qed_mcp_cmd (p_hwfn, p_ptt,DRV_MSG_CODE_UNLOAD_REQ , wol_param, - &mcp_resp, &mcp_param); +memset (&mb_params,0 ,sizeof (mb_params)); + mb_params.cmd =DRV_MSG_CODE_UNLOAD_REQ ; + mb_params.param = wol_param; + mb_params.flags =QED_MB_FLAG_CAN_SLEEP ; + +return qed_mcp_cmd_and_union (p_hwfn, p_ptt, &mb_params); }int qed_mcp_unload_done (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt)
drivers/net/ethernet/qlogic/qed/qed_mcp.h +13 -8
@@ -660,14 +660,19 @@ struct qed_mcp_info { };struct qed_mcp_mb_params { -u32 cmd; -u32 param; -void *p_data_src; -u8 data_src_size; -void *p_data_dst; -u8 data_dst_size; -u32 mcp_resp; -u32 mcp_param; +u32 cmd; +u32 param; +void *p_data_src; +void *p_data_dst; +u8 data_src_size; +u8 data_dst_size; +u32 mcp_resp; +u32 mcp_param; +u32 flags; +#define QED_MB_FLAG_CAN_SLEEP (0x1 << 0) +#define QED_MB_FLAGS_IS_SET (params, flag) \ + ({ typeof(params) __params = (params); \ + (__params && (__params->flags & QED_MB_FLAG_ ## flag)); }) };struct qed_drv_tlv_hdr {
Greg Kroah-Hartman
maintainerPATCH 175/228 qed: Avoid sending mailbox commands when MFW is not responsive
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomer Tayar <[email protected]>
[ Upstream commit b310974e041913231b6e3d5d475d4df55c312301 ]
Keep sending mailbox commands to the MFW when it is not responsive ends up with a redundant amount of timeout expiries.
This patch prints the MCP status on the first command which is not responded, and blocks the following commands.
Since the (un)load request commands might be not responded due to other PFs, the patch also adds the option to skip the blocking upon a failure.
--- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 52 ++++++++++++++++++++++++- drivers/net/ethernet/qlogic/qed/qed_mcp.h | 6 ++ drivers/net/ethernet/qlogic/qed/qed_reg_addr.h | 1 3 files changed, 56 insertions(+), 3 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_mcp.c +50 -2
@@ -320,6 +320,12 @@ int qed_mcp_reset(struct qed_hwfn *p_hwfu32 org_mcp_reset_seq, seq, delay =QED_MCP_RESP_ITER_US , cnt =0 ;int rc =0 ; +if (p_hwfn->mcp_info->b_block_cmd) { +DP_NOTICE (p_hwfn, +"The MFW is not responsive. Avoid sending MCP_RESET mailbox command.\n" ); +return -EBUSY ; + } +/* Ensure that only a single thread is accessing the mailbox */ spin_lock_bh (&p_hwfn->mcp_info->cmd_lock);
@@ -445,6 +451,33 @@ static void __qed_mcp_cmd_and_union(stru (p_mb_params->cmd | seq_num), p_mb_params->param); } +static void qed_mcp_cmd_set_blocking (struct qed_hwfn *p_hwfn,bool block_cmd) +{ + p_hwfn->mcp_info->b_block_cmd = block_cmd; + +DP_INFO (p_hwfn,"%s sending of mailbox commands to the MFW\n" , + block_cmd ?"Block" :"Unblock" ); +} + +static void qed_mcp_print_cpu_info (struct qed_hwfn *p_hwfn, +struct qed_ptt *p_ptt) +{ +u32 cpu_mode, cpu_state, cpu_pc_0, cpu_pc_1, cpu_pc_2; +u32 delay =QED_MCP_RESP_ITER_US ; + + cpu_mode =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_MODE ); + cpu_state =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_STATE ); + cpu_pc_0 =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_PROGRAM_COUNTER ); +udelay (delay); + cpu_pc_1 =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_PROGRAM_COUNTER ); +udelay (delay); + cpu_pc_2 =qed_rd (p_hwfn, p_ptt,MCP_REG_CPU_PROGRAM_COUNTER ); + +DP_NOTICE (p_hwfn, +"MCP CPU info: mode 0x%08x, state 0x%08x, pc {0x%08x, 0x%08x, 0x%08x}\n" , + cpu_mode, cpu_state, cpu_pc_0, cpu_pc_1, cpu_pc_2); +} + static int _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
@@ -531,11 +564,15 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *DP_NOTICE (p_hwfn,"The MFW failed to respond to command 0x%08x [param 0x%08x].\n" , p_mb_params->cmd, p_mb_params->param); +qed_mcp_print_cpu_info (p_hwfn, p_ptt);spin_lock_bh (&p_hwfn->mcp_info->cmd_lock);qed_mcp_cmd_del_elem (p_hwfn, p_cmd_elem);spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock); +if (!QED_MB_FLAGS_IS_SET (p_mb_params,AVOID_BLOCK )) +qed_mcp_cmd_set_blocking (p_hwfn, true); +return -EAGAIN ; }
@@ -573,6 +610,13 @@ static int qed_mcp_cmd_and_union(structreturn -EBUSY ; } +if (p_hwfn->mcp_info->b_block_cmd) { +DP_NOTICE (p_hwfn, +"The MFW is not responsive. Avoid sending mailbox command 0x%08x [param 0x%08x].\n" , + p_mb_params->cmd, p_mb_params->param); +return -EBUSY ; + } +if (p_mb_params->data_src_size > union_data_size || p_mb_params->data_dst_size > union_data_size) { DP_ERR(p_hwfn,
@@ -805,7 +849,7 @@ __qed_mcp_load_req(struct qed_hwfn *p_hw mb_params.data_src_size =sizeof (load_req); mb_params.p_data_dst = &load_rsp; mb_params.data_dst_size =sizeof (load_rsp); - mb_params.flags =QED_MB_FLAG_CAN_SLEEP ; + mb_params.flags =QED_MB_FLAG_CAN_SLEEP |QED_MB_FLAG_AVOID_BLOCK ; DP_VERBOSE(p_hwfn, QED_MSG_SP, "Load Request: param 0x%08x [init_hw %d, drv_type %d, hsi_ver %d, pda 0x%04x]\n",
@@ -1049,7 +1093,7 @@ int qed_mcp_unload_req(struct qed_hwfn *memset (&mb_params,0 ,sizeof (mb_params)); mb_params.cmd =DRV_MSG_CODE_UNLOAD_REQ ; mb_params.param = wol_param; - mb_params.flags =QED_MB_FLAG_CAN_SLEEP ; + mb_params.flags =QED_MB_FLAG_CAN_SLEEP |QED_MB_FLAG_AVOID_BLOCK ;return qed_mcp_cmd_and_union (p_hwfn, p_ptt, &mb_params); }
@@ -2156,6 +2200,8 @@ int qed_mcp_halt(struct qed_hwfn *p_hwfnreturn -EBUSY ; } +qed_mcp_cmd_set_blocking (p_hwfn, true); +return 0 ; }
@@ -2180,6 +2226,8 @@ int qed_mcp_resume(struct qed_hwfn *p_hwreturn -EBUSY ; } +qed_mcp_cmd_set_blocking (p_hwfn, false); +return 0 ; }
drivers/net/ethernet/qlogic/qed/qed_mcp.h +5 -1
@@ -635,11 +635,14 @@ struct qed_mcp_info {*/ spinlock_t cmd_lock; +/* Flag to indicate whether sending a MFW mailbox command is blocked */ +bool b_block_cmd; +/* Spinlock used for syncing SW link-changes and link-changes * originating from attention context. */ spinlock_t link_lock; -bool block_mb_sending; +u32 public_base;u32 drv_mb_addr;u32 mfw_mb_addr;
@@ -670,6 +673,7 @@ struct qed_mcp_mb_params {u32 mcp_param;u32 flags;#define QED_MB_FLAG_CAN_SLEEP (0x1 << 0) +#define QED_MB_FLAG_AVOID_BLOCK (0x1 << 1)#define QED_MB_FLAGS_IS_SET (params, flag) \ ({ typeof(params) __params = (params); \ (__params && (__params->flags & QED_MB_FLAG_ ## flag)); })
drivers/net/ethernet/qlogic/qed/qed_reg_addr.h +1 -0
@@ -565,6 +565,7 @@#define MCP_REG_CPU_STATE_SOFT_HALTED (0x1UL << 10)#define MCP_REG_CPU_EVENT_MASK \ 0xe05008UL +#define MCP_REG_CPU_PROGRAM_COUNTER 0xe0501cUL#define PGLUE_B_REG_PF_BAR0_SIZE \ 0x2aae60UL#define PGLUE_B_REG_PF_BAR1_SIZE \
Greg Kroah-Hartman
maintainerPATCH 176/228 thermal: of-thermal: disable passive polling when thermal zone is disabled
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anson Huang <[email protected]>
[ Upstream commit 152395fd03d4ce1e535a75cdbf58105e50587611 ]
When thermal zone is in passive mode, disabling its mode from sysfs is NOT taking effect at all, it is still polling the temperature of the disabled thermal zone and handling all thermal trips, it makes user confused. The disabling operation should disable the thermal zone behavior completely, for both active and passive mode, this patch clears the passive_delay when thermal zone is disabled and restores it when it is enabled.
--- drivers/thermal/of-thermal.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/thermal/of-thermal.c +5 -2
@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct thmutex_lock (&tz->lock); -if (mode ==THERMAL_DEVICE_ENABLED ) +if (mode ==THERMAL_DEVICE_ENABLED ) { tz->polling_delay = data->polling_delay; -else + tz->passive_delay = data->passive_delay; + }else { tz->polling_delay =0 ; + tz->passive_delay =0 ; + }mutex_unlock (&tz->lock);
Greg Kroah-Hartman
maintainerPATCH 177/228 isofs: reject hardware sector size > 2048 bytes
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <[email protected]>
[ Upstream commit 09a4e0be5826aa66c4ce9954841f110ffe63ef4f ]
The largest block size supported by isofs is ISOFS_BLOCK_SIZE (2048), but isofs_fill_super calls sb_min_blocksize and sets the blocksize to the device's logical block size if it's larger than what we ended up with after option parsing.
If for some reason we try to mount a hard 4k device as an isofs filesystem, we'll set opt.blocksize to 4096, and when we try to read the superblock we found via:
block = iso_blknum << (ISOFS_BLOCK_BITS - s->s_blocksize_bits)
with s_blocksize_bits greater than ISOFS_BLOCK_BITS, we'll have a negative shift and the bread will fail somewhat cryptically:
isofs_fill_super: bread failed, dev=sda, iso_blknum=17, block=-2147483648
It seems best to just catch and clearly reject mounts of such a device.
--- fs/isofs/inode.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/isofs/inode.c +7 -0
@@ -24,6 +24,7 @@#include <linux/mpage.h> #include <linux/user_namespace.h> #include <linux/seq_file.h> +#include <linux/blkdev.h> #include "isofs.h" #include "zisofs.h"
@@ -653,6 +654,12 @@ static int isofs_fill_super(struct super/* * What if bugger tells us to go beyond page size? */ +if (bdev_logical_block_size (s->s_bdev) >2048 ) { +printk (KERN_WARNING +"ISOFS: unsupported/invalid hardware sector size %d\n" , +bdev_logical_block_size (s->s_bdev)); + goto out_freesbi; + } opt.blocksize =sb_min_blocksize (s, opt.blocksize); sbi->s_high_sierra =0 ;/* default is iso9660 */
Greg Kroah-Hartman
maintainerPATCH 178/228 mmc: atmel-mci: fix bad logic of sg_copy_{from,to}_buffer conversion
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ludovic Desroches <[email protected]>
[ Upstream commit 19f5e9e015675fcdbf2c20e804b2e84e80201454 ]
The conversion to sg_copy_{from,to}_buffer has been done in the wrong way. sg_copy_to_buffer is a copy from an SG list to a linear buffer so it can't replace memcpy(buf + offset, &value, remaining) where buf is the virtual address of the SG. Same for sg_copy_to_buffer but in the opposite way.
--- drivers/mmc/host/atmel-mci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/mmc/host/atmel-mci.c +6 -6
@@ -1976,7 +1976,7 @@ static void atmci_read_data_pio(struct a do { value = atmci_readl(host, ATMCI_RDR); if (likely(offset + 4 <= sg->length)) { - sg_pcopy_to_buffer(sg, 1, &value, sizeof(u32), offset); + sg_pcopy_from_buffer(sg, 1, &value, sizeof(u32), offset); offset += 4; nbytes += 4;
@@ -1993,7 +1993,7 @@ static void atmci_read_data_pio(struct a }else {unsigned int remaining = sg->length - offset; -sg_pcopy_to_buffer (sg,1 , &value, remaining, offset); +sg_pcopy_from_buffer (sg,1 , &value, remaining, offset); nbytes += remaining;flush_dcache_page (sg_page (sg));
@@ -2003,7 +2003,7 @@ static void atmci_read_data_pio(struct a goto done; offset =4 - remaining; -sg_pcopy_to_buffer (sg,1 , (u8 *)&value + remaining, +sg_pcopy_from_buffer (sg,1 , (u8 *)&value + remaining, offset,0 ); nbytes += offset; }
@@ -2042,7 +2042,7 @@ static void atmci_write_data_pio(struct do { if (likely(offset + 4 <= sg->length)) { - sg_pcopy_from_buffer(sg, 1, &value, sizeof(u32), offset); + sg_pcopy_to_buffer(sg, 1, &value, sizeof(u32), offset); atmci_writel(host, ATMCI_TDR, value); offset += 4;
@@ -2059,7 +2059,7 @@ static void atmci_write_data_pio(structunsigned int remaining = sg->length - offset; value =0 ; -sg_pcopy_from_buffer (sg,1 , &value, remaining, offset); +sg_pcopy_to_buffer (sg,1 , &value, remaining, offset); nbytes += remaining; host->sg = sg =sg_next (sg);
@@ -2070,7 +2070,7 @@ static void atmci_write_data_pio(struct } offset =4 - remaining; -sg_pcopy_from_buffer (sg,1 , (u8 *)&value + remaining, +sg_pcopy_to_buffer (sg,1 , (u8 *)&value + remaining, offset,0 );atmci_writel (host,ATMCI_TDR , value); nbytes += offset;
Greg Kroah-Hartman
maintainerPATCH 179/228 mmc: android-goldfish: fix bad logic of sg_copy_{from,to}_buffer conversion
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ludovic Desroches <[email protected]>
[ Upstream commit 17e96d8516e31c3cb52cb8e2ee79d1d2e6948c11 ]
The conversion to sg_copy_{from,to}_buffer has been done in the wrong way. sg_copy_to_buffer is a copy from an SG list to a linear buffer so it can't replace memcpy(dest, host->virt_base, data->sg->length) where dest is the virtual address of the SG. Same for sg_copy_from_buffer but in the opposite way.
--- drivers/mmc/host/android-goldfish.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/android-goldfish.c +2 -2
@@ -217,7 +217,7 @@ static void goldfish_mmc_xfer_done(struc* We don't really have DMA, so we need * to copy from our platform driver buffer */ -sg_copy_to_buffer (data->sg,1 , host->virt_base, +sg_copy_from_buffer (data->sg,1 , host->virt_base, data->sg->length); } host->data->bytes_xfered += data->sg->length;
@@ -393,7 +393,7 @@ static void goldfish_mmc_prepare_data(st* We don't really have DMA, so we need to copy to our * platform driver buffer */ -sg_copy_from_buffer (data->sg,1 , host->virt_base, +sg_copy_to_buffer (data->sg,1 , host->virt_base, data->sg->length); } }
Greg Kroah-Hartman
maintainerPATCH 180/228 bus: ti-sysc: Fix no_console_suspend handling
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit 4f3530f4a41d49c41015020cd9a5ed5c95b5d2db ]
If no_console_suspend is set, we should keep console enabled during suspend. Lets fix this by only producing a warning if we can't idle hardware during suspend.
--- drivers/bus/ti-sysc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/bus/ti-sysc.c +3 -3
@@ -1175,10 +1175,10 @@ static int sysc_child_suspend_noirq(struif (!pm_runtime_status_suspended (dev)) { error =pm_generic_runtime_suspend (dev);if (error) { -dev_err (dev,"%s error at %i: %i\n" , - __func__, __LINE__, error); +dev_warn (dev,"%s busy at %i: %i\n" , + __func__, __LINE__, error); -return error; +return 0 ; } error =sysc_runtime_suspend (ddata->dev);
Greg Kroah-Hartman
maintainerPATCH 181/228 ARM: dts: omap4-droid4: fix vibrations on Droid 4
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Machek <[email protected]>
[ Upstream commit f4efa74c09a7eddcc12cd13208f78743763f6e7a ]
Vibration GPIOs don't have anything to do with wakeup. Move it to normal section; this fixes vibrations on Droid 4.
--- arch/arm/boot/dts/omap4-droid4-xt894.dts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap4-droid4-xt894.dts +9 -9
@@ -618,15 +618,6 @@ OMAP4_IOPAD(0x10c, PIN_INPUT | MUX_MODE1) /* abe_mcbsp3_fsx */ >; }; -}; - -&omap4_pmx_wkup { - usb_gpio_mux_sel2: pinmux_usb_gpio_mux_sel2_pins { - /* gpio_wk0 */ - pinctrl-single,pins = < - OMAP4_IOPAD(0x040, PIN_OUTPUT_PULLDOWN | MUX_MODE3) - >; - }; vibrator_direction_pin: pinmux_vibrator_direction_pin { pinctrl-single,pins = <
@@ -640,6 +631,15 @@ >; }; }; + +&omap4_pmx_wkup { + usb_gpio_mux_sel2: pinmux_usb_gpio_mux_sel2_pins { + /* gpio_wk0 */ + pinctrl-single,pins = < + OMAP4_IOPAD(0x040, PIN_OUTPUT_PULLDOWN | MUX_MODE3) + >; + }; +}; /* * As uart1 is wired to mdm6600 with rts and cts, we can use the cts pin for
Greg Kroah-Hartman
maintainerPATCH 182/228 bpf, sockmap: fix sock_hash_alloc and reject zero-sized keys
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit b845c898b2f1ea458d5453f0fa1da6e2dfce3bb4 ]
Currently, it is possible to create a sock hash map with key size of 0 and have the kernel return a fd back to user space. This is invalid for hash maps (and kernel also hasn't been tested for zero key size support in general at this point). Thus, reject such configuration.
--- kernel/bpf/sockmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/bpf/sockmap.c +3 -1
@@ -2143,7 +2143,9 @@ static struct bpf_map *sock_hash_alloc(ureturn ERR_PTR (-EPERM );/* check sanity of attributes */ -if (attr->max_entries ==0 || attr->value_size !=4 || +if (attr->max_entries ==0 || + attr->key_size ==0 || + attr->value_size !=4 || attr->map_flags & ~SOCK_CREATE_FLAG_MASK )return ERR_PTR (-EINVAL );
Greg Kroah-Hartman
maintainerPATCH 183/228 bpf, sockmap: fix sock hash count in alloc_sock_hash_elem
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit eb29429d81e31b191f3b2bd19cf820279cec6463 ]
When we try to allocate a new sock hash entry and the allocation fails, then sock hash map fails to reduce the map element counter, meaning we keep accounting this element although it was never used. Fix it by dropping the element counter on error.
--- kernel/bpf/sockmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/bpf/sockmap.c +3 -1
@@ -2272,8 +2272,10 @@ static struct htab_elem *alloc_sock_hash } l_new =kmalloc_node (htab->elem_size,GFP_ATOMIC | __GFP_NOWARN, htab->map.numa_node); -if (!l_new) +if (!l_new) { +atomic_dec (&htab->count);return ERR_PTR (-ENOMEM ); + }memcpy (l_new->key, key, key_size); l_new->sk = sk;
Greg Kroah-Hartman
maintainerPATCH 184/228 tls: possible hang when do_tcp_sendpages hits sndbuf is full case
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Fastabend <[email protected]>
[ Upstream commit 67db7cd249e71f64346f481b629724376d063e08 ]
Currently, the lower protocols sk_write_space handler is not called if TLS is sending a scatterlist via tls_push_sg. However, normally tls_push_sg calls do_tcp_sendpage, which may be under memory pressure, that in turn may trigger a wait via sk_wait_event. Typically, this happens when the in-flight bytes exceed the sdnbuf size. In the normal case when enough ACKs are received sk_write_space() will be called and the sk_wait_event will be woken up allowing it to send more data and/or return to the user.
But, in the TLS case because the sk_write_space() handler does not wake up the events the above send will wait until the sndtimeo is exceeded. By default this is MAX_SCHEDULE_TIMEOUT so it look like a hang to the user (especially this impatient user). To fix this pass the sk_write_space event to the lower layers sk_write_space event which in the TCP case will wake any pending events.
I observed the above while integrating sockmap and ktls. It initially appeared as test_sockmap (modified to use ktls) occasionally hanging. To reliably reproduce this reduce the sndbuf size and stress the tls layer by sending many 1B sends. This results in every byte needing a header and each byte individually being sent to the crypto layer.
--- net/tls/tls_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
net/tls/tls_main.c +7 -2
@@ -222,9 +222,14 @@ static void tls_write_space(struct sock {struct tls_context *ctx =tls_get_ctx (sk); -/* We are already sending pages, ignore notification */ -if (ctx->in_tcp_sendpages) +/* If in_tcp_sendpages call lower protocol write space handler +* to ensure we wake up any waiting operations there. For example +* if do_tcp_sendpages where to call sk_wait_event. +*/ +if (ctx->in_tcp_sendpages) { + ctx->sk_write_space (sk);return ; + }if (!sk->sk_write_pending &&tls_is_pending_closed_record (ctx)) {gfp_t sk_allocation = sk->sk_allocation;
Greg Kroah-Hartman
maintainerPATCH 185/228 bpf: sockmap: write_space events need to be passed to TCP handler
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Fastabend <[email protected]>
[ Upstream commit 9b2e0388bec8ec5427403e23faff3b58dd1c3200 ]
When sockmap code is using the stream parser it also handles the write space events in order to handle the case where (a) verdict redirects skb to another socket and (b) the sockmap then sends the skb but due to memory constraints (or other EAGAIN errors) needs to do a retry.
But the initial code missed a third case where the skb_send_sock_locked() triggers an sk_wait_event(). A typically case would be when sndbuf size is exceeded. If this happens because we do not pass the write_space event to the lower layers we never wake up the event and it will wait for sndtimeo. Which as noted in ktls fix may be rather large and look like a hang to the user.
To reproduce the best test is to reduce the sndbuf size and send 1B data chunks to stress the memory handling. To fix this pass the event from the upper layer to the lower layer.
--- kernel/bpf/sockmap.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/bpf/sockmap.c +3 -0
@@ -1430,12 +1430,15 @@ out:static void smap_write_space (struct sock *sk) {struct smap_psock *psock; +void (*write_space)(struct sock *sk);rcu_read_lock (); psock =smap_psock_sk (sk);if (likely (psock &&test_bit (SMAP_TX_RUNNING , &psock->state)))schedule_work (&psock->tx_work); + write_space = psock->save_write_space;rcu_read_unlock (); +write_space (sk); }static void smap_stop_sock (struct smap_psock *psock,struct sock *sk)
Greg Kroah-Hartman
maintainerPATCH 186/228 drm/amdgpu: fix VM clearing for the root PD
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian König <[email protected]>
[ Upstream commit 8604ffcbf04f8f4f3f55a9e46e5ff948b2ed4290 ]
We need to figure out the address after validating the BO, not before.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -303,7 +303,6 @@ static int amdgpu_vm_clear_bo(struct amduint64_t addr;int r; - addr =amdgpu_bo_gpu_offset (bo); entries =amdgpu_bo_size (bo) /8 ;if (pte_support_ats) {
@@ -335,6 +334,7 @@ static int amdgpu_vm_clear_bo(struct amdif (r) goto error; + addr =amdgpu_bo_gpu_offset (bo);if (ats_entries) {uint64_t ats_value;
Greg Kroah-Hartman
maintainerPATCH 187/228 drm/amdgpu: fix preamble handling
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian König <[email protected]>
[ Upstream commit d98ff24e8e9be3329eea7c84d5e244d0c1cd0ab3 ]
At this point the command submission can still be interrupted.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +9 -7
@@ -975,13 +975,9 @@ static int amdgpu_cs_ib_fill(struct amdgif (r)return r; -if (chunk_ib->flags &AMDGPU_IB_FLAG_PREAMBLE ) { - parser->job->preamble_status |=AMDGPU_PREAMBLE_IB_PRESENT ; -if (!parser->ctx->preamble_presented) { - parser->job->preamble_status |=AMDGPU_PREAMBLE_IB_PRESENT_FIRST ; - parser->ctx->preamble_presented = true; - } - } +if (chunk_ib->flags &AMDGPU_IB_FLAG_PREAMBLE ) + parser->job->preamble_status |= +AMDGPU_PREAMBLE_IB_PRESENT ;if (parser->job->ring && parser->job->ring != ring)return -EINVAL ;
@@ -1206,6 +1202,12 @@ static int amdgpu_cs_submit(struct amdgpamdgpu_cs_post_dependencies (p); +if ((job->preamble_status &AMDGPU_PREAMBLE_IB_PRESENT ) && + !p->ctx->preamble_presented) { + job->preamble_status |=AMDGPU_PREAMBLE_IB_PRESENT_FIRST ; + p->ctx->preamble_presented = true; + } + cs->out.handle = seq; job->uf_sequence = seq;
Greg Kroah-Hartman
maintainerPATCH 188/228 amdgpu: fix multi-process hang issue
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emily Deng <[email protected]>
[ Upstream commit 2f40c6eac74a2a60921cdec9e9a8a57e88e31434 ]
SWDEV-146499: hang during multi vulkan process testing
cause:
the second frame's PREAMBLE_IB have clear-state and LOAD actions, those actions ruin the pipeline that is still doing process in the previous frame's work-load IB.
fix:
need insert pipeline sync if have context switch for SRIOV (because only SRIOV will report PREEMPTION flag to UMD)
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -1
@@ -164,8 +164,10 @@ int amdgpu_ib_schedule(struct amdgpu_rinreturn r; } + need_ctx_switch = ring->current_ctx != fence_ctx;if (ring->funcs->emit_pipeline_sync && job && ((tmp =amdgpu_sync_get_fence (&job->sched_sync,NULL )) || + (amdgpu_sriov_vf (adev) && need_ctx_switch) ||amdgpu_vm_need_pipeline_sync (ring, job))) { need_pipe_sync = true;dma_fence_put (tmp);
@@ -196,7 +198,6 @@ int amdgpu_ib_schedule(struct amdgpu_rin } skip_preamble = ring->current_ctx == fence_ctx; - need_ctx_switch = ring->current_ctx != fence_ctx;if (job && ring->funcs->emit_cntxcntl) {if (need_ctx_switch) status |=AMDGPU_HAVE_CTX_SWITCH ;
Greg Kroah-Hartman
maintainerPATCH 189/228 net/ncsi: Fixup .dumpit message flags and ID check in Netlink handler
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Mendoza-Jonas <[email protected]>
[ Upstream commit 3d0371b313b84ba7c16ebf2526a7a34f1c57b19e ]
The ncsi_pkg_info_all_nl() .dumpit handler is missing the NLM_F_MULTI flag, causing additional package information after the first to be lost. Also fixup a sanity check in ncsi_write_package_info() to reject out of range package IDs.
--- net/ncsi/ncsi-netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ncsi/ncsi-netlink.c +2 -2
@@ -100,7 +100,7 @@ static int ncsi_write_package_info(strucbool found;int rc; -if (id > ndp->package_num) { +if (id > ndp->package_num -1 ) {netdev_info (ndp->ndev.dev,"NCSI: No package with id %u\n" , id);return -ENODEV ; }
@@ -240,7 +240,7 @@ static int ncsi_pkg_info_all_nl(struct sreturn 0 ;/* done */ hdr =genlmsg_put (skb,NETLINK_CB (cb->skb).portid, cb->nlh->nlmsg_seq, - &ncsi_genl_family,0 ,NCSI_CMD_PKG_INFO ); + &ncsi_genl_family,NLM_F_MULTI ,NCSI_CMD_PKG_INFO );if (!hdr) { rc = -EMSGSIZE ; goto err;
Greg Kroah-Hartman
maintainerPATCH 190/228 tcp_bbr: add bbr_check_probe_rtt_done() helper
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Yang <[email protected]>
[ Upstream commit fb99886224294b2291d267da41395022fa4200e2 ]
This patch add a helper function bbr_check_probe_rtt_done() to
1. check the condition to see if bbr should exit probe_rtt mode;
2. process the logic of exiting probe_rtt mode.
--- net/ipv4/tcp_bbr.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-)
net/ipv4/tcp_bbr.c +18 -16
@@ -95,11 +95,10 @@ struct bbr { u32 mode:3, /* current bbr_mode in state machine */ prev_ca_state:3, /* CA state on previous ACK */ packet_conservation:1, /* use packet conservation? */ - restore_cwnd:1, /* decided to revert cwnd to old value */ round_start:1, /* start of packet-timed tx->ack round? */ idle_restart:1, /* restarting after idle? */ probe_rtt_round_done:1, /* a BBR_PROBE_RTT round at 4 pkts? */ - unused:12, + unused:13, lt_is_sampling:1, /* taking long-term ("LT") samples now? */ lt_rtt_cnt:7, /* round trips in long-term interval */ lt_use_bw:1; /* use lt_bw as our bw estimate? */
@@ -392,17 +391,11 @@ static bool bbr_set_cwnd_to_recover_or_r cwnd =tcp_packets_in_flight (tp) + acked; }else if (prev_state >= TCP_CA_Recovery && state < TCP_CA_Recovery) {/* Exiting loss recovery; restore cwnd saved before recovery. */ - bbr->restore_cwnd =1 ; + cwnd =max (cwnd, bbr->prior_cwnd); bbr->packet_conservation =0 ; } bbr->prev_ca_state = state; -if (bbr->restore_cwnd) { -/* Restore cwnd after exiting loss recovery or PROBE_RTT. */ - cwnd =max (cwnd, bbr->prior_cwnd); - bbr->restore_cwnd =0 ; - } -if (bbr->packet_conservation) { *new_cwnd =max (cwnd,tcp_packets_in_flight (tp) + acked);return true;/* yes, using packet conservation */
@@ -744,6 +737,20 @@ static void bbr_check_drain(struct sockbbr_reset_probe_bw_mode (sk);/* we estimate queue is drained */ } +static void bbr_check_probe_rtt_done (struct sock *sk) +{ +struct tcp_sock *tp =tcp_sk (sk); +struct bbr *bbr =inet_csk_ca (sk); + +if (!(bbr->probe_rtt_done_stamp && +after (tcp_jiffies32, bbr->probe_rtt_done_stamp))) +return ; + + bbr->min_rtt_stamp = tcp_jiffies32;/* wait a while until PROBE_RTT */ + tp->snd_cwnd =max (tp->snd_cwnd, bbr->prior_cwnd); +bbr_reset_mode (sk); +} +/* The goal of PROBE_RTT mode is to have BBR flows cooperatively and * periodically drain the bottleneck queue, to converge to measure the true * min_rtt (unloaded propagation delay). This allows the flows to keep queues
@@ -802,12 +809,8 @@ static void bbr_update_min_rtt(struct so }else if (bbr->probe_rtt_done_stamp) {if (bbr->round_start) bbr->probe_rtt_round_done =1 ; -if (bbr->probe_rtt_round_done && -after (tcp_jiffies32, bbr->probe_rtt_done_stamp)) { - bbr->min_rtt_stamp = tcp_jiffies32; - bbr->restore_cwnd =1 ;/* snap to prior_cwnd */ -bbr_reset_mode (sk); - } +if (bbr->probe_rtt_round_done) +bbr_check_probe_rtt_done (sk); } }/* Restart after idle ends only once we process a new S/ACK for data */
@@ -858,7 +861,6 @@ static void bbr_init(struct sock *sk) bbr->has_seen_rtt =0 ;bbr_init_pacing_rate_from_rtt (sk); - bbr->restore_cwnd =0 ; bbr->round_start =0 ; bbr->idle_restart =0 ; bbr->full_bw_reached =0 ;
Greg Kroah-Hartman
maintainerPATCH 191/228 tcp_bbr: in restart from idle, see if we should exit PROBE_RTT
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Yang <[email protected]>
[ Upstream commit 5490b32dce6932ea7ee8e3b2f76db2957c92af6e ]
This patch fix the case where BBR does not exit PROBE_RTT mode when it restarts from idle. When BBR restarts from idle and if BBR is in PROBE_RTT mode, BBR should check if it's time to exit PROBE_RTT. If yes, then BBR should exit PROBE_RTT mode and restore the cwnd to its full value.
--- net/ipv4/tcp_bbr.c | 4 ++++ 1 file changed, 4 insertions(+)
net/ipv4/tcp_bbr.c +4 -0
@@ -174,6 +174,8 @@ static const u32 bbr_lt_bw_diff = 4000 //* If we estimate we're policed, use lt_bw for this many round trips: */ static const u32 bbr_lt_bw_max_rtts =48 ; +static void bbr_check_probe_rtt_done (struct sock *sk); +/* Do we estimate that STARTUP filled the pipe? */ static bool bbr_full_bw_reached (const struct sock *sk) {
@@ -304,6 +306,8 @@ static void bbr_cwnd_event(struct sock **/ if (bbr->mode ==BBR_PROBE_BW )bbr_set_pacing_rate (sk,bbr_bw (sk),BBR_UNIT ); +else if (bbr->mode ==BBR_PROBE_RTT ) +bbr_check_probe_rtt_done (sk); } }
Greg Kroah-Hartman
maintainerPATCH 192/228 net: hns: fix length and page_offset overflow when CONFIG_ARM64_64K_PAGES
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huazhong Tan <[email protected]>
[ Upstream commit 3ed614dce3ca9912d22be215ff0f11104b69fe62 ]
When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE is 65536(64K). But the type of length and page_offset are u16, they will overflow. So change them to u32.
--- drivers/net/ethernet/hisilicon/hns/hnae.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/hisilicon/hns/hnae.h +3 -3
@@ -220,10 +220,10 @@ struct hnae_desc_cb {/* priv data for the desc, e.g. skb when use with ip stack*/ void *priv; -u16 page_offset; -u16 reuse_flag; +u32 page_offset; +u32 length;/* length of the buffer */ -u16 length;/* length of the buffer */ +u16 reuse_flag;/* desc type, used by the ring user to mark the type of the priv data */ u16 type;
Greg Kroah-Hartman
maintainerPATCH 193/228 net: hns: fix skb->truesize underestimation
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huazhong Tan <[email protected]>
[ Upstream commit b1ccd4c0ab6ef499f47dd84ed4920502a7147bba ]
skb->truesize is not meant to be tracking amount of used bytes in a skb, but amount of reserved/consumed bytes in memory.
For instance, if we use a single byte in last page fragment, we have to account the full size of the fragment.
So skb_add_rx_frag needs to calculate the length of the entire buffer into turesize.
--- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns/hns_enet.c +1 -1
@@ -530,7 +530,7 @@ static void hns_nic_reuse_page(struct sk }skb_add_rx_frag (skb, i, desc_cb->priv, desc_cb->page_offset + pull_len, - size - pull_len, truesize - pull_len); + size - pull_len, truesize);/* avoid re-using remote pages,flag default unreuse */ if (unlikely (page_to_nid (desc_cb->priv) !=numa_node_id ()))
Greg Kroah-Hartman
maintainerPATCH 194/228 net: hns3: fix page_offset overflow when CONFIG_ARM64_64K_PAGES
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huazhong Tan <[email protected]>
[ Upstream commit 27a5959308559fa6afcaa4e6cd81d25bcb2dda7c ]
When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE is 65536(64K). But the type of page_offset is u16, it will overflow. So change it to u32, when "CONFIG_ARM64_64K_PAGES" enabled.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +3 -3
@@ -290,11 +290,11 @@ struct hns3_desc_cb {/* priv data for the desc, e.g. skb when use with ip stack*/ void *priv; -u16 page_offset; -u16 reuse_flag; - +u32 page_offset;u32 length;/* length of the buffer */ +u16 reuse_flag; +/* desc type, used by the ring user to mark the type of the priv data */ u16 type; };
Greg Kroah-Hartman
maintainerPATCH 195/228 ice: Fix multiple static analyser warnings
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anirudh Venkataramanan <[email protected]>
[ Upstream commit 4381147df9098706caa5cf9fda37e53b2fe4871f ]
This patch fixes the following smatch errors:
1) Fix "odd binop '0x0 & 0xc'" when performing the bitwise-and with a constant value of zero (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG). Remove a similar bitwise-and with 0 in ice_add_marker_act() and use the right mask ICE_LG_ACT_GENERIC_OFFSET_M in the expression.
2) Fix a similar issue "odd binop '0x0 & 0x1800' in ice_req_irq_msix_misc.
3) Fix "odd binop '0x380000 & 0x7fff8'" in ice_add_marker_act(). Also, use a new define ICE_LG_ACT_GENERIC_OFF_RX_DESC_PROF_IDX instead of magic number '7'.
4) Fix warn: odd binop '0x0 & 0x18' in ice_set_dflt_vsi_ctx() by removing unnecessary logic to explicitly unset bits 3 and 4 in port_vlan_bits. These bits are unset already by the memset on ctxt->info.
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 1 drivers/net/ethernet/intel/ice/ice_common.c | 25 +++++++++++++----------- drivers/net/ethernet/intel/ice/ice_main.c | 19 +++++++----------- drivers/net/ethernet/intel/ice/ice_switch.c | 4 +-- 4 files changed, 25 insertions(+), 24 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +1 -0
@@ -594,6 +594,7 @@ struct ice_sw_rule_lg_act {#define ICE_LG_ACT_GENERIC_OFFSET_M (0x7 << ICE_LG_ACT_GENERIC_OFFSET_S)#define ICE_LG_ACT_GENERIC_PRIORITY_S 22#define ICE_LG_ACT_GENERIC_PRIORITY_M (0x7 << ICE_LG_ACT_GENERIC_PRIORITY_S) +#define ICE_LG_ACT_GENERIC_OFF_RX_DESC_PROF_IDX 7/* Action = 7 - Set Stat count */ #define ICE_LG_ACT_STAT_COUNT 0x7
drivers/net/ethernet/intel/ice/ice_common.c +14 -11
@@ -1619,20 +1619,23 @@ __ice_aq_get_set_rss_lut(struct ice_hw * }/* LUT size is only valid for Global and PF table types */ -if (lut_size ==ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128 ) { - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG << -ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S ) & -ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M ; - }else if (lut_size ==ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512 ) { +switch (lut_size) { +case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128 : +break ; +case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512 : flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG <<ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S ) &ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M ; - }else if ((lut_size ==ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K ) && - (lut_type ==ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF )) { - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG << -ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S ) & -ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M ; - }else { +break ; +case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K : +if (lut_type ==ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF ) { + flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG << +ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S ) & +ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M ; +break ; + } +/* fall-through */ +default : status =ICE_ERR_PARAM ; goto ice_aq_get_set_rss_lut_exit; }
drivers/net/ethernet/intel/ice/ice_main.c +8 -11
@@ -1352,14 +1352,13 @@ static void ice_set_dflt_vsi_ctx(struct ctxt->info.sw_flags =ICE_AQ_VSI_SW_FLAG_SRC_PRUNE ;/* Traffic from VSI can be sent to LAN */ ctxt->info.sw_flags2 =ICE_AQ_VSI_SW_FLAG_LAN_ENA ; -/* Allow all packets untagged/tagged */ +/* By default bits 3 and 4 in port_vlan_flags are 0's which results in +* legacy behavior (show VLAN, DEI, and UP) in descriptor. Also, allow +* all packets untagged/tagged. +*/ ctxt->info.port_vlan_flags = ((ICE_AQ_VSI_PVLAN_MODE_ALL &ICE_AQ_VSI_PVLAN_MODE_M ) >>ICE_AQ_VSI_PVLAN_MODE_S ); -/* Show VLAN/UP from packets in Rx descriptors */ - ctxt->info.port_vlan_flags |= ((ICE_AQ_VSI_PVLAN_EMOD_STR_BOTH & -ICE_AQ_VSI_PVLAN_EMOD_M ) >> -ICE_AQ_VSI_PVLAN_EMOD_S );/* Have 1:1 UP mapping for both ingress/egress tables */ table |=ICE_UP_TABLE_TRANSLATE (0 ,0 ); table |=ICE_UP_TABLE_TRANSLATE (1 ,1 );
@@ -2058,15 +2057,13 @@ static int ice_req_irq_msix_misc(struct skip_req_irq:ice_ena_misc_vector (pf); - val = (pf->oicr_idx &PFINT_OICR_CTL_MSIX_INDX_M ) | - (ICE_RX_ITR &PFINT_OICR_CTL_ITR_INDX_M ) | -PFINT_OICR_CTL_CAUSE_ENA_M ; + val = ((pf->oicr_idx &PFINT_OICR_CTL_MSIX_INDX_M ) | +PFINT_OICR_CTL_CAUSE_ENA_M );wr32 (hw,PFINT_OICR_CTL , val);/* This enables Admin queue Interrupt causes */ - val = (pf->oicr_idx &PFINT_FW_CTL_MSIX_INDX_M ) | - (ICE_RX_ITR &PFINT_FW_CTL_ITR_INDX_M ) | -PFINT_FW_CTL_CAUSE_ENA_M ; + val = ((pf->oicr_idx &PFINT_FW_CTL_MSIX_INDX_M ) | +PFINT_FW_CTL_CAUSE_ENA_M );wr32 (hw,PFINT_FW_CTL , val); itr_gran = hw->itr_gran_200;
drivers/net/ethernet/intel/ice/ice_switch.c +2 -2
@@ -645,14 +645,14 @@ ice_add_marker_act(struct ice_hw *hw, st act |= (1 <<ICE_LG_ACT_GENERIC_VALUE_S ) &ICE_LG_ACT_GENERIC_VALUE_M ; lg_act->pdata.lg_act.act[1 ] =cpu_to_le32 (act); - act = (7 <<ICE_LG_ACT_GENERIC_OFFSET_S ) &ICE_LG_ACT_GENERIC_VALUE_M ; + act = (ICE_LG_ACT_GENERIC_OFF_RX_DESC_PROF_IDX << +ICE_LG_ACT_GENERIC_OFFSET_S ) &ICE_LG_ACT_GENERIC_OFFSET_M ;/* Third action Marker value */ act |=ICE_LG_ACT_GENERIC ; act |= (sw_marker <<ICE_LG_ACT_GENERIC_VALUE_S ) &ICE_LG_ACT_GENERIC_VALUE_M ; - act |= (0 <<ICE_LG_ACT_GENERIC_OFFSET_S ) &ICE_LG_ACT_GENERIC_VALUE_M ; lg_act->pdata.lg_act.act[2 ] =cpu_to_le32 (act);/* call the fill switch rule to fill the lookup tx rx structure */
Greg Kroah-Hartman
maintainerPATCH 196/228 ice: Report stats for allocated queues via ethtool stats
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
[ Upstream commit f8ba7db850350319348b6d3c276f8ba19bc098ef ]
It is not safe to have the string table for statistics change order or size over the lifetime of a given netdevice. This is because of the nature of the 3-step process for obtaining stats. First, user space performs a request for the size of the strings table. Second it performs a separate request for the strings themselves, after allocating space for the table. Third, it requests the stats themselves, also allocating space for the table.
If the size decreased, there is potential to see garbage data or stats values. In the worst case, we could potentially see stats values become mis-aligned with their strings, so that it looks like a statistic is being reported differently than it actually is.
Even worse, if the size increased, there is potential that the strings table or stats table was not allocated large enough and the stats code could access and write to memory it should not, potentially resulting in undefined behavior and system crashes.
It isn't even safe if the size always changes under the RTNL lock. This is because the calls take place over multiple user space commands, so it is not possible to hold the RTNL lock for the entire duration of obtaining strings and stats. Further, not all consumers of the ethtool API are the user space ethtool program, and it is possible that one assumes the strings will not change (valid under the current contract), and thus only requests the stats values when requesting stats in a loop.
Finally, it's not possible in the general case to detect when the size changes, because it is quite possible that one value which could impact the stat size increased, while another decreased. This would result in the same total number of stats, but reordering them so that stats no longer line up with the strings they belong to. Since only size changes aren't enough, we would need some sort of hash or token to determine when the strings no longer match. This would require extending the ethtool stats commands, but there is no more space in the relevant structures.
The real solution to resolve this would be to add a completely new API for stats, probably over netlink.
In the ice driver, the only thing impacting the stats that is not constant is the number of queues. Instead of reporting stats for each used queue, report stats for each allocated queue. We do not change the number of queues allocated for a given netdevice, as we pass this into the alloc_etherdev_mq() function to set the num_tx_queues and num_rx_queues.
This resolves the potential bugs at the slight cost of displaying many queue statistics which will not be activated.
--- drivers/net/ethernet/intel/ice/ice.h | 7 +++ drivers/net/ethernet/intel/ice/ice_ethtool.c | 52 ++++++++++++++++++++------- 2 files changed, 46 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +7 -0
@@ -89,6 +89,13 @@ extern const char ice_drv_ver[];#define ice_for_each_rxq (vsi, i) \ for ((i) = 0; (i) < (vsi)->num_rxq; (i)++) +/* Macros for each allocated tx/rx ring whether used or not in a VSI */ +#define ice_for_each_alloc_txq (vsi, i) \ + for ((i) = 0; (i) < (vsi)->alloc_txq; (i)++) + +#define ice_for_each_alloc_rxq (vsi, i) \ + for ((i) = 0; (i) < (vsi)->alloc_rxq; (i)++) +struct ice_tc_info {u16 qoffset;u16 qcount;
drivers/net/ethernet/intel/ice/ice_ethtool.c +39 -13
98 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 197/228 ice: Clean control queues only when they are initialized
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Preethi Banala <[email protected]>
[ Upstream commit b29bc220e2c7bd494a4605defcd93b18d5a8cf86 ]
Clean control queues only when they are initialized. One of the ways to validate if the basic initialization is done is by checking value of cq->sq.head and cq->rq.head variables that specify the register address. This patch adds a check to avoid NULL pointer dereference crash when tried to shutdown uninitialized control queue.
--- drivers/net/ethernet/intel/ice/ice_controlq.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/ice/ice_controlq.c +16 -8
@@ -597,10 +597,14 @@ static enum ice_status ice_init_check_adreturn 0 ; init_ctrlq_free_rq: -ice_shutdown_rq (hw, cq); -ice_shutdown_sq (hw, cq); -mutex_destroy (&cq->sq_lock); -mutex_destroy (&cq->rq_lock); +if (cq->rq.head) { +ice_shutdown_rq (hw, cq); +mutex_destroy (&cq->rq_lock); + } +if (cq->sq.head) { +ice_shutdown_sq (hw, cq); +mutex_destroy (&cq->sq_lock); + }return status; }
@@ -706,10 +710,14 @@ static void ice_shutdown_ctrlq(struct icreturn ; } -ice_shutdown_sq (hw, cq); -ice_shutdown_rq (hw, cq); -mutex_destroy (&cq->sq_lock); -mutex_destroy (&cq->rq_lock); +if (cq->sq.head) { +ice_shutdown_sq (hw, cq); +mutex_destroy (&cq->sq_lock); + } +if (cq->rq.head) { +ice_shutdown_rq (hw, cq); +mutex_destroy (&cq->rq_lock); + } }/**
Greg Kroah-Hartman
maintainerPATCH 198/228 ice: Fix bugs in control queue processing
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anirudh Venkataramanan <[email protected]>
[ Upstream commit 3d6b640efcc1b07709b42dd2e9609401c6f88633 ]
This patch is a consolidation of multiple bug fixes for control queue processing.
1) In ice_clean_adminq_subtask() remove unnecessary reads/writes to registers. The bits PFINT_FW_CTL, PFINT_MBX_CTL and PFINT_SB_CTL are not set when an interrupt arrives, which means that clearing them again can be omitted.
2) Get an accurate value in "pending" by re-reading the control queue head register from the hardware.
3) Fix a corner case involving lost control queue messages by checking for new control messages (using ice_ctrlq_pending) before exiting the cleanup routine.
--- drivers/net/ethernet/intel/ice/ice_controlq.c | 5 ++++- drivers/net/ethernet/intel/ice/ice_main.c | 26 ++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_controlq.c +4 -1
@@ -1065,8 +1065,11 @@ ice_clean_rq_elem(struct ice_hw *hw, str clean_rq_elem_out:/* Set pending if needed, unlock and return */ -if (pending) +if (pending) { +/* re-read HW head to calculate actual pending messages */ + ntu = (u16)(rd32 (hw, cq->rq.head) & cq->rq.head_mask); *pending = (u16)((ntc > ntu ? cq->rq.count :0 ) + (ntu - ntc)); + } clean_rq_elem_err:mutex_unlock (&cq->rq_lock);
drivers/net/ethernet/intel/ice/ice_main.c +22 -4
@@ -917,13 +917,27 @@ static int __ice_clean_ctrlq(struct ice_ }/** +* ice_ctrlq_pending - check if there is a difference between ntc and ntu +* @hw: pointer to hardware info +* @cq: control queue information +* +* returns true if there are pending messages in a queue, false if there aren't +*/ +static bool ice_ctrlq_pending (struct ice_hw *hw,struct ice_ctl_q_info *cq) +{ +u16 ntu; + + ntu = (u16)(rd32 (hw, cq->rq.head) & cq->rq.head_mask); +return cq->rq.next_to_clean != ntu; +} + +/** * ice_clean_adminq_subtask - clean the AdminQ rings * @pf: board private structure */ static void ice_clean_adminq_subtask (struct ice_pf *pf) {struct ice_hw *hw = &pf->hw; -u32 val;if (!test_bit (__ICE_ADMINQ_EVENT_PENDING, pf->state))return ;
@@ -933,9 +947,13 @@ static void ice_clean_adminq_subtask(strclear_bit (__ICE_ADMINQ_EVENT_PENDING, pf->state); -/* re-enable Admin queue interrupt causes */ - val =rd32 (hw,PFINT_FW_CTL ); -wr32 (hw,PFINT_FW_CTL , (val |PFINT_FW_CTL_CAUSE_ENA_M )); +/* There might be a situation where new messages arrive to a control +* queue between processing the last message and clearing the +* EVENT_PENDING bit. So before exiting, check queue head again (using +* ice_ctrlq_pending) and process new messages if any. +*/ +if (ice_ctrlq_pending (hw, &hw->adminq)) +__ice_clean_ctrlq (pf,ICE_CTL_Q_ADMIN );ice_flush (hw); }
Greg Kroah-Hartman
maintainerPATCH 199/228 ice: Use order_base_2 to calculate higher power of 2
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
[ Upstream commit 1eb43fc754485d772b1165118a8fb80c385f0492 ]
Currently, we use a combination of ilog2 and is_power_of_2() to calculate the next power of 2 for the qcount. This appears to be causing a warning on some combinations of GCC and the Linux kernel:
MODPOST 1 modules
WARNING: "____ilog2_NaN" [ice.ko] undefined!
This appears to because because GCC realizes that qcount could be zero in some circumstances and thus attempts to link against the intentionally undefined ___ilog2_NaN function.
The order_base_2 function is intentionally defined to return 0 when passed 0 as an argument, and thus will be safe to use here.
This not only fixes the warning but makes the resulting code slightly cleaner, and is really what we should have used originally.
Also update the comment to make it more clear that we are rounding up, not just incrementing the ilog2 of qcount unconditionally.
--- drivers/net/ethernet/intel/ice/ice_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +2 -5
@@ -1313,11 +1313,8 @@ static void ice_vsi_setup_q_map(struct i qcount = numq_tc; } -/* find higher power-of-2 of qcount */ - pow =ilog2 (qcount); - -if (!is_power_of_2 (qcount)) - pow++; +/* find the (rounded up) power-of-2 of qcount */ + pow =order_base_2 (qcount);for (i =0 ; i <ICE_MAX_TRAFFIC_CLASS ; i++) {if (!(vsi->tc_cfg.ena_tc &BIT (i))) {
Greg Kroah-Hartman
maintainerPATCH 200/228 ice: Set VLAN flags correctly
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brett Creeley <[email protected]>
[ Upstream commit 5d8778d803e21f235e9bc727b5bd619f02abb88b ]
In the struct ice_aqc_vsi_props the field port_vlan_flags is an overloaded term because it is used for both port VLANs (PVLANs) and regular VLANs. This is an issue and is very confusing especially when dealing with VFs because normal VLANs and port VLANs are not the same. To fix this the field was renamed to vlan_flags and all of the #define's labeled *_PVLAN_* were renamed to *_VLAN_* if they are not specific to port VLANs.
Also in ice_vsi_manage_vlan_stripping, set the ICE_AQ_VSI_VLAN_MODE_ALL bit to allow the driver to add a VLAN tag to all packets it sends.
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 24 +++++++++--------- drivers/net/ethernet/intel/ice/ice_main.c | 31 +++++++++++++----------- 2 files changed, 30 insertions(+), 25 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +12 -12
@@ -329,19 +329,19 @@ struct ice_aqc_vsi_props {/* VLAN section */ __le16 pvid;/* VLANS include priority bits */ u8 pvlan_reserved[2 ]; -u8 port_vlan_flags; -#define ICE_AQ_VSI_PVLAN_MODE_S 0 -#define ICE_AQ_VSI_PVLAN_MODE_M (0x3 << ICE_AQ_VSI_PVLAN_MODE_S) -#define ICE_AQ_VSI_PVLAN_MODE_UNTAGGED 0x1 -#define ICE_AQ_VSI_PVLAN_MODE_TAGGED 0x2 -#define ICE_AQ_VSI_PVLAN_MODE_ALL 0x3 +u8 vlan_flags; +#define ICE_AQ_VSI_VLAN_MODE_S 0 +#define ICE_AQ_VSI_VLAN_MODE_M (0x3 << ICE_AQ_VSI_VLAN_MODE_S) +#define ICE_AQ_VSI_VLAN_MODE_UNTAGGED 0x1 +#define ICE_AQ_VSI_VLAN_MODE_TAGGED 0x2 +#define ICE_AQ_VSI_VLAN_MODE_ALL 0x3#define ICE_AQ_VSI_PVLAN_INSERT_PVID BIT(2) -#define ICE_AQ_VSI_PVLAN_EMOD_S 3 -#define ICE_AQ_VSI_PVLAN_EMOD_M (0x3 << ICE_AQ_VSI_PVLAN_EMOD_S) -#define ICE_AQ_VSI_PVLAN_EMOD_STR_BOTH (0x0 << ICE_AQ_VSI_PVLAN_EMOD_S) -#define ICE_AQ_VSI_PVLAN_EMOD_STR_UP (0x1 << ICE_AQ_VSI_PVLAN_EMOD_S) -#define ICE_AQ_VSI_PVLAN_EMOD_STR (0x2 << ICE_AQ_VSI_PVLAN_EMOD_S) -#define ICE_AQ_VSI_PVLAN_EMOD_NOTHING (0x3 << ICE_AQ_VSI_PVLAN_EMOD_S) +#define ICE_AQ_VSI_VLAN_EMOD_S 3 +#define ICE_AQ_VSI_VLAN_EMOD_M (0x3 << ICE_AQ_VSI_VLAN_EMOD_S) +#define ICE_AQ_VSI_VLAN_EMOD_STR_BOTH (0x0 << ICE_AQ_VSI_VLAN_EMOD_S) +#define ICE_AQ_VSI_VLAN_EMOD_STR_UP (0x1 << ICE_AQ_VSI_VLAN_EMOD_S) +#define ICE_AQ_VSI_VLAN_EMOD_STR (0x2 << ICE_AQ_VSI_VLAN_EMOD_S) +#define ICE_AQ_VSI_VLAN_EMOD_NOTHING (0x3 << ICE_AQ_VSI_VLAN_EMOD_S)u8 pvlan_reserved2[3 ];/* ingress egress up sections */ __le32 ingress_table;/* bitmap, 3 bits per up */
drivers/net/ethernet/intel/ice/ice_main.c +18 -13
@@ -1367,13 +1367,15 @@ static void ice_set_dflt_vsi_ctx(struct ctxt->info.sw_flags =ICE_AQ_VSI_SW_FLAG_SRC_PRUNE ;/* Traffic from VSI can be sent to LAN */ ctxt->info.sw_flags2 =ICE_AQ_VSI_SW_FLAG_LAN_ENA ; -/* By default bits 3 and 4 in port_vlan_flags are 0's which results in -* legacy behavior (show VLAN, DEI, and UP) in descriptor. Also, allow -* all packets untagged/tagged. + +/* By default bits 3 and 4 in vlan_flags are 0's which results in legacy +* behavior (show VLAN, DEI, and UP) in descriptor. Also, allow all +* packets untagged/tagged. */ - ctxt->info.port_vlan_flags = ((ICE_AQ_VSI_PVLAN_MODE_ALL & -ICE_AQ_VSI_PVLAN_MODE_M ) >> -ICE_AQ_VSI_PVLAN_MODE_S ); + ctxt->info.vlan_flags = ((ICE_AQ_VSI_VLAN_MODE_ALL & +ICE_AQ_VSI_VLAN_MODE_M ) >> +ICE_AQ_VSI_VLAN_MODE_S ); +/* Have 1:1 UP mapping for both ingress/egress tables */ table |=ICE_UP_TABLE_TRANSLATE (0 ,0 ); table |=ICE_UP_TABLE_TRANSLATE (1 ,1 );
@@ -3732,10 +3734,10 @@ static int ice_vsi_manage_vlan_insertionenum ice_status status;/* Here we are configuring the VSI to let the driver add VLAN tags by -* setting port_vlan_flags to ICE_AQ_VSI_PVLAN_MODE_ALL. The actual VLAN -* tag insertion happens in the Tx hot path, in ice_tx_map. +* setting vlan_flags to ICE_AQ_VSI_VLAN_MODE_ALL. The actual VLAN tag +* insertion happens in the Tx hot path, in ice_tx_map. */ - ctxt.info.port_vlan_flags =ICE_AQ_VSI_PVLAN_MODE_ALL ; + ctxt.info.vlan_flags =ICE_AQ_VSI_VLAN_MODE_ALL ; ctxt.info.valid_sections =cpu_to_le16 (ICE_AQ_VSI_PROP_VLAN_VALID ); ctxt.vsi_num = vsi->vsi_num;
@@ -3747,7 +3749,7 @@ static int ice_vsi_manage_vlan_insertionreturn -EIO ; } - vsi->info.port_vlan_flags = ctxt.info.port_vlan_flags; + vsi->info.vlan_flags = ctxt.info.vlan_flags;return 0 ; }
@@ -3769,12 +3771,15 @@ static int ice_vsi_manage_vlan_stripping*/ if (ena) {/* Strip VLAN tag from Rx packet and put it in the desc */ - ctxt.info.port_vlan_flags =ICE_AQ_VSI_PVLAN_EMOD_STR_BOTH ; + ctxt.info.vlan_flags =ICE_AQ_VSI_VLAN_EMOD_STR_BOTH ; }else {/* Disable stripping. Leave tag in packet */ - ctxt.info.port_vlan_flags =ICE_AQ_VSI_PVLAN_EMOD_NOTHING ; + ctxt.info.vlan_flags =ICE_AQ_VSI_VLAN_EMOD_NOTHING ; } +/* Allow all packets untagged/tagged */ + ctxt.info.vlan_flags |=ICE_AQ_VSI_VLAN_MODE_ALL ; + ctxt.info.valid_sections =cpu_to_le16 (ICE_AQ_VSI_PROP_VLAN_VALID ); ctxt.vsi_num = vsi->vsi_num;
@@ -3785,7 +3790,7 @@ static int ice_vsi_manage_vlan_strippingreturn -EIO ; } - vsi->info.port_vlan_flags = ctxt.info.port_vlan_flags; + vsi->info.vlan_flags = ctxt.info.vlan_flags;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 201/228 tools: bpftool: return from do_event_pipe() on bad arguments
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Monnet <[email protected]>
[ Upstream commit 785e76d7a2051a9e28b9134d5388a45b16f5eb72 ]
When command line parsing fails in the while loop in do_event_pipe() because the number of arguments is incorrect or because the keyword is unknown, an error message is displayed, but bpftool remains stuck in the loop. Make sure we exit the loop upon failure.
--- tools/bpf/bpftool/map_perf_ring.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/bpf/bpftool/map_perf_ring.c +4 -1
@@ -194,8 +194,10 @@ int do_event_pipe(int argc, char **argv) }while (argc) { -if (argc <2 ) +if (argc <2 ) {BAD_ARG (); + goto err_close_map; + }if (is_prefix (*argv,"cpu" )) {char *endptr;
@@ -221,6 +223,7 @@ int do_event_pipe(int argc, char **argv)NEXT_ARG (); }else {BAD_ARG (); + goto err_close_map; } do_all = false;
Greg Kroah-Hartman
maintainerPATCH 202/228 ice: Fix a few null pointer dereference issues
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anirudh Venkataramanan <[email protected]>
[ Upstream commit c7f2c42b80ed6009f44e355aefc1e40db9485a9d ]
1) When ice_ena_msix_range() fails to reserve vectors, a devm_kfree() warning was seen in the error flow path. So check pf->irq_tracker before use in ice_clear_interrupt_scheme().
2) In ice_vsi_cfg(), check vsi->netdev before use.
3) In ice_get_link_status, check link_up before use.
--- drivers/net/ethernet/intel/ice/ice_common.c | 2 +- drivers/net/ethernet/intel/ice/ice_main.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/ice/ice_common.c +1 -1
@@ -1483,7 +1483,7 @@ enum ice_status ice_get_link_status(strustruct ice_phy_info *phy_info;enum ice_status status =0 ; -if (!pi) +if (!pi || !link_up)return ICE_ERR_PARAM ; phy_info = &pi->phy;
drivers/net/ethernet/intel/ice/ice_main.c +10 -7
@@ -3260,8 +3260,10 @@ static void ice_clear_interrupt_scheme(sif (test_bit (ICE_FLAG_MSIX_ENA , pf->flags))ice_dis_msix (pf); -devm_kfree (&pf->pdev->dev, pf->irq_tracker); - pf->irq_tracker =NULL ; +if (pf->irq_tracker) { +devm_kfree (&pf->pdev->dev, pf->irq_tracker); + pf->irq_tracker =NULL ; + } }/**
@@ -4115,11 +4117,12 @@ static int ice_vsi_cfg(struct ice_vsi *v {int err; -ice_set_rx_mode (vsi->netdev); - - err =ice_restore_vlan (vsi); -if (err) -return err; +if (vsi->netdev) { +ice_set_rx_mode (vsi->netdev); + err =ice_restore_vlan (vsi); +if (err) +return err; + } err =ice_vsi_cfg_txqs (vsi);if (!err)
Greg Kroah-Hartman
maintainerPATCH 203/228 ice: Fix potential return of uninitialized value
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Brandeburg <[email protected]>
[ Upstream commit dab0588fb616c1774bbf108eab1749dda4ac6942 ]
In ice_vsi_setup_[tx|rx]_rings, err is uninitialized which can result in a garbage value return to the caller. Fix that.
--- drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +2 -2
@@ -4888,7 +4888,7 @@ int ice_down(struct ice_vsi *vsi)*/ static int ice_vsi_setup_tx_rings (struct ice_vsi *vsi) { -int i, err; +int i, err =0 ;if (!vsi->num_txq) { dev_err(&vsi->back->pdev->dev, "VSI %d has 0 Tx queues\n",
@@ -4913,7 +4913,7 @@ static int ice_vsi_setup_tx_rings(struct*/ static int ice_vsi_setup_rx_rings (struct ice_vsi *vsi) { -int i, err; +int i, err =0 ;if (!vsi->num_rxq) { dev_err(&vsi->back->pdev->dev, "VSI %d has 0 Rx queues\n",
Greg Kroah-Hartman
maintainerPATCH 204/228 e1000: check on netif_running() before calling e1000_up()
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bo Chen <[email protected]>
[ Upstream commit cf1acec008f8d7761aa3fd7c4bca7e17b2d2512d ]
When the device is not up, the call to 'e1000_up()' from the error handling path of 'e1000_set_ringparam()' causes a kernel oops with a null-pointer dereference. The null-pointer dereference is triggered in function 'e1000_alloc_rx_buffers()' at line 'buffer_info = &rx_ring->buffer_info[i]'.
This bug was reported by COD, a tool for testing kernel module binaries I am building. This bug was also detected by KFI from Dr. Kai Cong.
This patch fixes the bug by checking on 'netif_running()' before calling 'e1000_up()' in 'e1000_set_ringparam()'.
--- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_ethtool.c +2 -1
@@ -644,7 +644,8 @@ err_setup_rx: err_alloc_rx:kfree (txdr); err_alloc_tx: -e1000_up (adapter); +if (netif_running (adapter->netdev)) +e1000_up (adapter); err_setup:clear_bit (__E1000_RESETTING, &adapter->flags);return err;
Greg Kroah-Hartman
maintainerPATCH 205/228 e1000: ensure to free old tx/rx rings in set_ringparam()
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bo Chen <[email protected]>
[ Upstream commit ee400a3f1bfe7004a3e14b81c38ccc5583c26295 ]
In 'e1000_set_ringparam()', the tx_ring and rx_ring are updated with new value and the old tx/rx rings are freed only when the device is up. There are resource leaks on old tx/rx rings when the device is not up. This bug is reported by COD, a tool for testing kernel module binaries I am building.
This patch fixes the bug by always calling 'kfree()' on old tx/rx rings in 'e1000_set_ringparam()'.
--- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_ethtool.c +2 -2
@@ -624,14 +624,14 @@ static int e1000_set_ringparam(struct ne adapter->tx_ring = tx_old;e1000_free_all_rx_resources (adapter);e1000_free_all_tx_resources (adapter); -kfree (tx_old); -kfree (rx_old); adapter->rx_ring = rxdr; adapter->tx_ring = txdr; err =e1000_up (adapter);if (err) goto err_setup; } +kfree (tx_old); +kfree (rx_old);clear_bit (__E1000_RESETTING, &adapter->flags);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 206/228 ixgbe: fix driver behaviour after issuing VFLR
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Basierski <[email protected]>
[ Upstream commit 939b701ad63314f5aa90dcd3d866f73954945209 ]
Since VFLR doesn't clear VFMBMEM (VF Mailbox Memory) and is not re-enabling queues correctly we should fix this behavior.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 26 +++++++++++++++++++++++++ drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 1 2 files changed, 27 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +26 -0
@@ -688,8 +688,13 @@ static int ixgbe_set_vf_macvlan(struct istatic inline void ixgbe_vf_reset_event (struct ixgbe_adapter *adapter,u32 vf) {struct ixgbe_hw *hw = &adapter->hw; +struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ ];struct vf_data_storage *vfinfo = &adapter->vfinfo[vf]; +u32 q_per_pool =__ALIGN_MASK (1 , ~vmdq->mask);u8 num_tcs = adapter->hw_tcs; +u32 reg_val; +u32 queue; +u32 word;/* remove VLAN filters beloning to this VF */ ixgbe_clear_vf_vlans (adapter, vf);
@@ -726,6 +731,27 @@ static inline void ixgbe_vf_reset_event(/* reset VF api back to unknown */ adapter->vfinfo[vf].vf_api = ixgbe_mbox_api_10; + +/* Restart each queue for given VF */ +for (queue =0 ; queue < q_per_pool; queue++) { +unsigned int reg_idx = (vf * q_per_pool) + queue; + + reg_val =IXGBE_READ_REG (hw,IXGBE_PVFTXDCTL (reg_idx)); + +/* Re-enabling only configured queues */ +if (reg_val) { + reg_val |=IXGBE_TXDCTL_ENABLE ; +IXGBE_WRITE_REG (hw,IXGBE_PVFTXDCTL (reg_idx), reg_val); + reg_val &= ~IXGBE_TXDCTL_ENABLE ; +IXGBE_WRITE_REG (hw,IXGBE_PVFTXDCTL (reg_idx), reg_val); + } + } + +/* Clear VF's mailbox memory */ +for (word =0 ; word <IXGBE_VFMAILBOX_SIZE ; word++) +IXGBE_WRITE_REG_ARRAY (hw,IXGBE_PFMBMEM (vf), word,0 ); + +IXGBE_WRITE_FLUSH (hw); } static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter,
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +1 -0
@@ -2518,6 +2518,7 @@ enum {/* Translated register #defines */ #define IXGBE_PVFTDH (P ) (0x06010 + (0x40 * (P)))#define IXGBE_PVFTDT (P ) (0x06018 + (0x40 * (P))) +#define IXGBE_PVFTXDCTL (P ) (0x06028 + (0x40 * (P)))#define IXGBE_PVFTDWBAL (P ) (0x06038 + (0x40 * (P)))#define IXGBE_PVFTDWBAH (P ) (0x0603C + (0x40 * (P)))
Greg Kroah-Hartman
maintainerPATCH 207/228 i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martyna Szapar <[email protected]>
[ Upstream commit fa38e30ac73fbb01d7e5d0fd1b12d412fa3ac3ee ]
If interface is connected to switch port configured for DCB there are TX timeouts when bringing up interface. Problem started appearing after adding in i40e driver code mqprio hardware offload mode. In function i40e_vsi_configure_bw_alloc was added resetting BW rate which should be executing when mqprio qdisc is removed but was also when there was no mqprio qdisc added and DCB was enabled. In this patch was added additional check for DCB flag so now when DCB is enabled the correct DCB configs from before mqprio patch are restored.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +8 -7
@@ -5121,15 +5121,17 @@ static int i40e_vsi_configure_bw_alloc(s u8 *bw_share) {struct i40e_aqc_configure_vsi_tc_bw_data bw_data; +struct i40e_pf *pf = vsi->back;i40e_status ret;int i; -if (vsi->back->flags &I40E_FLAG_TC_MQPRIO ) +/* There is no need to reset BW when mqprio mode is on. */ +if (pf->flags &I40E_FLAG_TC_MQPRIO )return 0 ; -if (!vsi->mqprio_qopt.qopt.hw) { +if (!vsi->mqprio_qopt.qopt.hw && !(pf->flags &I40E_FLAG_DCB_ENABLED )) { ret =i40e_set_bw_limit (vsi, vsi->seid,0 );if (ret) -dev_info (&vsi->back->pdev->dev, +dev_info (&pf->pdev->dev,"Failed to reset tx rate for vsi->seid %u\n" , vsi->seid);return ret;
@@ -5138,12 +5140,11 @@ static int i40e_vsi_configure_bw_alloc(sfor (i =0 ; i <I40E_MAX_TRAFFIC_CLASS ; i++) bw_data.tc_bw_credits[i] = bw_share[i]; - ret =i40e_aq_config_vsi_tc_bw (&vsi->back->hw, vsi->seid, &bw_data, -NULL ); + ret =i40e_aq_config_vsi_tc_bw (&pf->hw, vsi->seid, &bw_data,NULL );if (ret) { -dev_info (&vsi->back->pdev->dev, +dev_info (&pf->pdev->dev,"AQ command Config VSI BW allocation per TC failed = %d\n" , - vsi->back->hw.aq.asq_last_status); + pf->hw.aq.asq_last_status);return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 208/228 i40e: fix condition of WARN_ONCE for stat strings
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
[ Upstream commit 07f3701387dcab3a4fb0166098fb2754a1b927e1 ]
Commit 9b10df596bd4 ("i40e: use WARN_ONCE to replace the commented BUG_ON size check") introduced a warning check to make sure that the size of the stat strings was always the expected value. This code accidentally inverted the check of the data pointer. Fix this so that we accurately count the size of the stats we copied in.
This fixes an erroneous WARN kernel splat that occurs when requesting ethtool statistics.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -1903,7 +1903,7 @@ static void i40e_get_stat_strings(struct data +=ETH_GSTRING_LEN ; } -WARN_ONCE (p - data !=i40e_get_stats_count (netdev) *ETH_GSTRING_LEN , +WARN_ONCE (data - p !=i40e_get_stats_count (netdev) *ETH_GSTRING_LEN ,"stat strings count mismatch!" ); }
Greg Kroah-Hartman
maintainerPATCH 209/228 crypto: chtls - fix null dereference chtls_free_uld()
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ganesh Goudar <[email protected]>
[ Upstream commit 65b2c12dcdb883fc015c0ec65d6c2f857e0456ac ]
call chtls_free_uld() only for the initialized cdev, this fixes NULL dereference in chtls_free_uld()
--- drivers/crypto/chelsio/chtls/chtls.h | 5 +++++ drivers/crypto/chelsio/chtls/chtls_main.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/crypto/chelsio/chtls/chtls.h +5 -0
@@ -96,6 +96,10 @@ enum csk_flags { CSK_CONN_INLINE, /* Connection on HW */ }; +enum chtls_cdev_state { +CHTLS_CDEV_STATE_UP =1 +}; +struct listen_ctx {struct sock *lsk;struct chtls_dev *cdev;
@@ -146,6 +150,7 @@ struct chtls_dev {unsigned int send_page_order;int max_host_sndbuf;struct key_map kmap; +unsigned int cdev_state; };struct chtls_hws {
drivers/crypto/chelsio/chtls/chtls_main.c +5 -2
@@ -160,6 +160,7 @@ static void chtls_register_dev(struct ch tlsdev->hash = chtls_create_hash; tlsdev->unhash = chtls_destroy_hash;tls_register_device (&cdev->tlsdev); + cdev->cdev_state =CHTLS_CDEV_STATE_UP ; }static void chtls_unregister_dev (struct chtls_dev *cdev)
@@ -281,8 +282,10 @@ static void chtls_free_all_uld(void)struct chtls_dev *cdev, *tmp;mutex_lock (&cdev_mutex); -list_for_each_entry_safe (cdev, tmp, &cdev_list, list) -chtls_free_uld (cdev); +list_for_each_entry_safe (cdev, tmp, &cdev_list, list) { +if (cdev->cdev_state ==CHTLS_CDEV_STATE_UP ) +chtls_free_uld (cdev); + }mutex_unlock (&cdev_mutex); }
Greg Kroah-Hartman
maintainerPATCH 210/228 crypto: cavium/nitrox - fix for command corruption in queue full case with backlog submissions.
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srikanth Jampala <[email protected]>
[ Upstream commit 3d7c82060d1fe65bde4023aac41a0b1bd7718e07 ]
Earlier used to post the current command without checking queue full
after backlog submissions. So, post the current command only after confirming the space in queue after backlog submissions.
Maintain host write index instead of reading device registers to get the next free slot to post the command.
Return -ENOSPC in queue full case.
--- drivers/crypto/cavium/nitrox/nitrox_dev.h | 3 - drivers/crypto/cavium/nitrox/nitrox_lib.c | 1 drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 57 +++++++++++++++------------ 3 files changed, 35 insertions(+), 26 deletions(-)
drivers/crypto/cavium/nitrox/nitrox_dev.h +2 -1
@@ -35,6 +35,7 @@ struct nitrox_cmdq {/* requests in backlog queues */ atomic_t backlog_count; +int write_idx;/* command size 32B/64B */ u8 instr_size;u8 qno;
@@ -87,7 +88,7 @@ struct nitrox_bh {struct bh_data *slc; }; -/* NITROX-5 driver state */ +/* NITROX-V driver state */ #define NITROX_UCODE_LOADED 0#define NITROX_READY 1
drivers/crypto/cavium/nitrox/nitrox_lib.c +1 -0
@@ -36,6 +36,7 @@ static int cmdq_common_init(struct nitro cmdq->head =PTR_ALIGN (cmdq->head_unaligned,PKT_IN_ALIGN ); cmdq->dma =PTR_ALIGN (cmdq->dma_unaligned,PKT_IN_ALIGN ); cmdq->qsize = (qsize +PKT_IN_ALIGN ); + cmdq->write_idx =0 ;spin_lock_init (&cmdq->response_lock);spin_lock_init (&cmdq->cmdq_lock);
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c +32 -25
115 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 211/228 hwmon: (ina2xx) fix sysfs shunt resistor read access
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lothar Felten <[email protected]>
[ Upstream commit 3ad867001c91657c46dcf6656d52eb6080286fd5 ]
fix the sysfs shunt resistor read access: return the shunt resistor value, not the calibration register contents.
update email address
--- Documentation/hwmon/ina2xx | 2 +- drivers/hwmon/ina2xx.c | 13 +++++++++++-- include/linux/platform_data/ina2xx.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-)
Documentation/hwmon/ina2xx +1 -1
@@ -32,7 +32,7 @@ Supported chips: Datasheet: Publicly available at the Texas Instruments website http://www.ti.com/ -Author: Lothar Felten <[email protected]> +Author: Lothar Felten <[email protected]> Description -----------
drivers/hwmon/ina2xx.c +11 -2
@@ -17,7 +17,7 @@* Bi-directional Current/Power Monitor with I2C Interface * Datasheet: http://www.ti.com/product/ina230 * -* Copyright (C) 2012 Lothar Felten <[email protected]> +* Copyright (C) 2012 Lothar Felten <[email protected]> * Thanks to Jan Volkering * * This program is free software; you can redistribute it and/or modify
@@ -329,6 +329,15 @@ static int ina2xx_set_shunt(struct ina2xreturn 0 ; } +static ssize_t ina2xx_show_shunt (struct device *dev, +struct device_attribute *da, +char *buf) +{ +struct ina2xx_data *data =dev_get_drvdata (dev); + +return snprintf (buf,PAGE_SIZE ,"%li\n" , data->rshunt); +} +static ssize_t ina2xx_store_shunt (struct device *dev,struct device_attribute *da,const char *buf,size_t count)
@@ -403,7 +412,7 @@ static SENSOR_DEVICE_ATTR(power1_input,/* shunt resistance */ static SENSOR_DEVICE_ATTR(shunt_resistor, S_IRUGO | S_IWUSR, - ina2xx_show_value, ina2xx_store_shunt, + ina2xx_show_shunt, ina2xx_store_shunt, INA2XX_CALIBRATION);/* update interval (ina226 only) */
include/linux/platform_data/ina2xx.h +1 -1
@@ -1,7 +1,7 @@/* * Driver for Texas Instruments INA219, INA226 power monitor chips * -* Copyright (C) 2012 Lothar Felten <[email protected]> +* Copyright (C) 2012 Lothar Felten <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
Greg Kroah-Hartman
maintainerPATCH 212/228 hwmon: (adt7475) Make adt7475_read_word() return errors
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit f196dec6d50abb2e65fb54a0621b2f1b4d922995 ]
The adt7475_read_word() function was meant to return negative error codes on failure.
--- drivers/hwmon/adt7475.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/hwmon/adt7475.c +9 -5
@@ -303,14 +303,18 @@ static inline u16 volt2reg(int channel,return clamp_val (reg,0 ,1023 ) & (0xff <<2 ); } -static u16 adt7475_read_word (struct i2c_client *client,int reg) +static int adt7475_read_word (struct i2c_client *client,int reg) { -u16 val; +int val1, val2; - val =i2c_smbus_read_byte_data (client, reg); - val |= (i2c_smbus_read_byte_data (client, reg +1 ) <<8 ); + val1 =i2c_smbus_read_byte_data (client, reg); +if (val1 <0 ) +return val1; + val2 =i2c_smbus_read_byte_data (client, reg +1 ); +if (val2 <0 ) +return val2; -return val; +return val1 | (val2 <<8 ); }static void adt7475_write_word (struct i2c_client *client,int reg,u16 val)
Greg Kroah-Hartman
maintainerPATCH 213/228 Revert "ARM: dts: imx7d: Invert legacy PCI irq mapping"
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leonard Crestez <[email protected]>
[ Upstream commit 538d6e9d597584e80514698e24321645debde78f ]
This reverts commit 1c86c9dd82f859b474474a7fee0d5195da2c9c1d.
That commit followed the reference manual but unfortunately the imx7d manual is incorrect.
Tested with ath9k pcie card and confirmed internally.
--- arch/arm/boot/dts/imx7d.dtsi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx7d.dtsi +8 -4
@@ -125,10 +125,14 @@ interrupt-names = "msi"; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 2 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 3 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 4 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>; + /* + * Reference manual lists pci irqs incorrectly + * Real hardware ordering is same as imx6: D+MSI, C, B, A + */ + interrupt-map = <0 0 0 1 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 2 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 3 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 4 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX7D_PCIE_CTRL_ROOT_CLK>, <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>, <&clks IMX7D_PCIE_PHY_ROOT_CLK>;
Greg Kroah-Hartman
maintainerPATCH 214/228 drm/amdgpu: Enable/disable gfx PG feature in rlc safe mode
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rex Zhu <[email protected]>
[ Upstream commit 8ef23364b654d44244400d79988e677e504b21ba ]
This is required by gfx hw and can fix the rlc hang when do s3 stree test on Cz/St.
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +10 -1
@@ -5614,6 +5614,11 @@ static int gfx_v8_0_set_powergating_statif (amdgpu_sriov_vf (adev))return 0 ; +if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_SMG | +AMD_PG_SUPPORT_RLC_SMU_HS | +AMD_PG_SUPPORT_CP | +AMD_PG_SUPPORT_GFX_DMG )) + adev->gfx.rlc.funcs->enter_safe_mode (adev);switch (adev->asic_type) {case CHIP_CARRIZO :case CHIP_STONEY :
@@ -5663,7 +5668,11 @@ static int gfx_v8_0_set_powergating_statdefault :break ; } - +if (adev->pg_flags & (AMD_PG_SUPPORT_GFX_SMG | +AMD_PG_SUPPORT_RLC_SMU_HS | +AMD_PG_SUPPORT_CP | +AMD_PG_SUPPORT_GFX_DMG )) + adev->gfx.rlc.funcs->exit_safe_mode (adev);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 215/228 drm/amdgpu: Update power state at the end of smu hw_init.
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rex Zhu <[email protected]>
[ Upstream commit 2ab4d0e74256fc49b7b270f63c1d1e47c2455abc ]
For SI/Kv, the power state is managed by function amdgpu_pm_compute_clocks.
when dpm enabled, we should call amdgpu_pm_compute_clocks to update current power state instand of set boot state.
this change can fix the oops when kfd driver was enabled on Kv.
--- drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 4 +--- drivers/gpu/drm/amd/amdgpu/si_dpm.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/kv_dpm.c +1 -3
@@ -1354,8 +1354,6 @@ static int kv_dpm_enable(struct amdgpu_dreturn ret; } -kv_update_current_ps (adev, adev->pm.dpm.boot_ps); -if (adev->irq.installed &&amdgpu_is_internal_thermal_sensor (adev->pm.int_thermal_type)) { ret =kv_set_thermal_temperature_range (adev,KV_TEMP_RANGE_MIN ,KV_TEMP_RANGE_MAX );
@@ -3061,7 +3059,7 @@ static int kv_dpm_hw_init(void *handle)else adev->pm.dpm_enabled = true;mutex_unlock (&adev->pm.mutex); - +amdgpu_pm_compute_clocks (adev);return ret; }
drivers/gpu/drm/amd/amdgpu/si_dpm.c +1 -2
@@ -6887,7 +6887,6 @@ static int si_dpm_enable(struct amdgpu_dsi_enable_auto_throttle_source (adev,AMDGPU_DPM_AUTO_THROTTLE_SRC_THERMAL , true);si_thermal_start_thermal_controller (adev); -ni_update_current_ps (adev, boot_ps);return 0 ; }
@@ -7764,7 +7763,7 @@ static int si_dpm_hw_init(void *handle)else adev->pm.dpm_enabled = true;mutex_unlock (&adev->pm.mutex); - +amdgpu_pm_compute_clocks (adev);return ret; }
Greg Kroah-Hartman
maintainerPATCH 216/228 ata: ftide010: Add a quirk for SQ201
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 46cb52ad414ac829680d0bb8cc7090ac2b577ca7 ]
The DMA is broken on this specific device for some unknown reason (probably badly designed or plain broken interface electronics) and will only work with PIO. Other users of the same hardware does not have this problem.
Add a specific quirk so that this Gemini device gets DMA turned off. Also fix up some code around passing the port information around in probe while we're at it.
--- drivers/ata/pata_ftide010.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
drivers/ata/pata_ftide010.c +17 -10
@@ -256,14 +256,12 @@ static struct ata_port_operations pata_f .qc_issue = ftide010_qc_issue, }; -static struct ata_port_info ftide010_port_info[] = { - { - .flags =ATA_FLAG_SLAVE_POSS , - .mwdma_mask =ATA_MWDMA2 , - .udma_mask =ATA_UDMA6 , - .pio_mask =ATA_PIO4 , - .port_ops = &pata_ftide010_port_ops, - }, +static struct ata_port_info ftide010_port_info = { + .flags =ATA_FLAG_SLAVE_POSS , + .mwdma_mask =ATA_MWDMA2 , + .udma_mask =ATA_UDMA6 , + .pio_mask =ATA_PIO4 , + .port_ops = &pata_ftide010_port_ops, };#if IS_ENABLED (CONFIG_SATA_GEMINI )
@@ -349,6 +347,7 @@ static int pata_ftide010_gemini_cable_de }static int pata_ftide010_gemini_init (struct ftide010 *ftide, +struct ata_port_info *pi,bool is_ata1) {struct device *dev = ftide->dev;
@@ -373,7 +372,13 @@ static int pata_ftide010_gemini_init(str/* Flag port as SATA-capable */ if (gemini_sata_bridge_enabled (sg, is_ata1)) - ftide010_port_info[0 ].flags |=ATA_FLAG_SATA ; + pi->flags |=ATA_FLAG_SATA ; + +/* This device has broken DMA, only PIO works */ +if (of_machine_is_compatible ("itian,sq201" )) { + pi->mwdma_mask =0 ; + pi->udma_mask =0 ; + }/* * We assume that a simple 40-wire cable is used in the PATA mode.
@@ -435,6 +440,7 @@ static int pata_ftide010_gemini_init(str }#else static int pata_ftide010_gemini_init (struct ftide010 *ftide, +struct ata_port_info *pi,bool is_ata1) {return -ENOTSUPP ;
@@ -446,7 +452,7 @@ static int pata_ftide010_probe(struct pl {struct device *dev = &pdev->dev;struct device_node *np = dev->of_node; -const struct ata_port_info pi = ftide010_port_info[0 ]; +struct ata_port_info pi = ftide010_port_info;const struct ata_port_info *ppi[] = { &pi,NULL };struct ftide010 *ftide;struct resource *res;
@@ -490,6 +496,7 @@ static int pata_ftide010_probe(struct pl* are ATA0. This will also set up the cable types. */ ret =pata_ftide010_gemini_init (ftide, + &pi, (res->start ==0x63400000 ));if (ret) goto err_dis_clk;
Greg Kroah-Hartman
maintainerPATCH 217/228 nvme-fcloop: Fix dropped LSs to removed target port
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Smart <[email protected]>
[ Upstream commit afd299ca996929f4f98ac20da0044c0cdc124879 ]
When a targetport is removed from the config, fcloop will avoid calling the LS done() routine thinking the targetport is gone. This leaves the initiator reset/reconnect hanging as it waits for a status on the Create_Association LS for the reconnect.
Change the filter in the LS callback path. If tport null (set when failed validation before "sending to remote port"), be sure to call done. This was the main bug. But, continue the logic that only calls done if tport was set but there is no remoteport (e.g. case where remoteport has been removed, thus host doesn't expect a completion).
--- drivers/nvme/target/fcloop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/target/fcloop.c +2 -1
@@ -311,7 +311,7 @@ fcloop_tgt_lsrqst_done_work(struct work_struct fcloop_tport *tport = tls_req->tport;struct nvmefc_ls_req *lsreq = tls_req->lsreq; -if (tport->remoteport) +if (!tport || tport->remoteport) lsreq->done (lsreq, tls_req->status); }
@@ -329,6 +329,7 @@ fcloop_ls_req(struct nvme_fc_local_portif (!rport->targetport) { tls_req->status = -ECONNREFUSED ; + tls_req->tport =NULL ;schedule_work (&tls_req->work);return ret; }
Greg Kroah-Hartman
maintainerPATCH 218/228 ARM: dts: omap4-droid4: Fix emmc errors seen on some devices
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit 2d59bb602314a4b2593fde267734266b5e872dd0 ]
Otherwise we can get the following errors occasionally on some devices:
mmc1: tried to HW reset card, got error -110
mmcblk1: error -110 requesting status
mmcblk1: recovery failed!print_req_error: I/O error, dev mmcblk1, sector 14329
...
I have one device that hits this error almost on every boot, and another one that hits it only rarely with the other ones I've used behave without problems. I'm not sure if the issue is related to a particular eMMC card model, but in case it is, both of the machines with issues have:
# cat /sys/class/mmc_host/mmc1/mmc1:0001/manfid \ /sys/class/mmc_host/mmc1/mmc1:0001/oemid \ /sys/class/mmc_host/mmc1/mmc1:0001/name 0x000045 0x0100 SEM16G
and the working ones have:
0x0000110x0100
016G92
Note that "ti,non-removable" is different as omap_hsmmc_reg_get() does not call omap_hsmmc_disable_boot_regulators() if no_regulator_off_init is set. And currently we set no_regulator_off_init only for "ti,non-removable" and not for "non-removable". It seems that we should have "non-removable" with some other mmc generic property behave in the same way instead of having to use a non-generic property. But let's fix the issue first.
xt894")
--- arch/arm/boot/dts/omap4-droid4-xt894.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/omap4-droid4-xt894.dts +1 -1
@@ -351,7 +351,7 @@ &mmc2 { vmmc-supply = <&vsdio>; bus-width = <8>; - non-removable; + ti,non-removable; }; &mmc3 {
Greg Kroah-Hartman
maintainerPATCH 219/228 drm/amdgpu: Need to set moved to true when evict bo
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emily Deng <[email protected]>
[ Upstream commit 6ddd9769db4fc11a98bd7e58be1764e47fdb8384 ]
Fix the VMC page fault when the running sequence is as below:
1.amdgpu_gem_create_ioctl 2.ttm_bo_swapout->amdgpu_vm_bo_invalidate, as not called amdgpu_vm_bo_base_init, so won't called list_add_tail(&base->bo_list, &bo->va). Even the bo was evicted, it won't set the bo_base->moved. 3.drm_gem_open_ioctl->amdgpu_vm_bo_base_init, here only called list_move_tail(&base->vm_status, &vm->evicted), but not set the bo_base->moved. 4.amdgpu_vm_bo_map->amdgpu_vm_bo_insert_map, as the bo_base->moved is not set true, the function amdgpu_vm_bo_insert_map will call list_move(&bo_va->base.vm_status, &vm->moved) 5.amdgpu_cs_ioctl won't validate the swapout bo, as it is only in the moved list, not in the evict list. So VMC page fault occurs.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -0
@@ -123,6 +123,7 @@ static void amdgpu_vm_bo_base_init(struc* is validated on next vm use to avoid fault. * */ list_move_tail (&base->vm_status, &vm->evicted); + base->moved = true; }/**
Greg Kroah-Hartman
maintainerPATCH 220/228 arm/arm64: smccc-1.1: Make return values unsigned long
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
[ Upstream commit 1d8f574708a3fb6f18c85486d0c5217df893c0cf ]
An unfortunate consequence of having a strong typing for the input values to the SMC call is that it also affects the type of the return values, limiting r0 to 32 bits and r{1,2,3} to whatever was passed as an input.
Let's turn everything into "unsigned long", which satisfies the requirements of both architectures, and allows for the full range of return values.
--- include/linux/arm-smccc.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
include/linux/arm-smccc.h +10 -10
@@ -199,31 +199,31 @@ asmlinkage void __arm_smccc_hvc(unsigned#define __declare_arg_0 (a0, res) \ struct arm_smccc_res *___res = res; \ - register u32 r0 asm("r0") = a0; \ + register unsigned long r0 asm("r0") = (u32)a0; \ register unsigned long r1 asm("r1"); \ register unsigned long r2 asm("r2"); \ register unsigned long r3 asm("r3")#define __declare_arg_1 (a0, a1, res) \ struct arm_smccc_res *___res = res; \ - register u32 r0 asm("r0") = a0; \ - register typeof(a1) r1 asm("r1") = a1; \ + register unsigned long r0 asm("r0") = (u32)a0; \ + register unsigned long r1 asm("r1") = a1; \ register unsigned long r2 asm("r2"); \ register unsigned long r3 asm("r3")#define __declare_arg_2 (a0, a1, a2, res) \ struct arm_smccc_res *___res = res; \ - register u32 r0 asm("r0") = a0; \ - register typeof(a1) r1 asm("r1") = a1; \ - register typeof(a2) r2 asm("r2") = a2; \ + register unsigned long r0 asm("r0") = (u32)a0; \ + register unsigned long r1 asm("r1") = a1; \ + register unsigned long r2 asm("r2") = a2; \ register unsigned long r3 asm("r3")#define __declare_arg_3 (a0, a1, a2, a3, res) \ struct arm_smccc_res *___res = res; \ - register u32 r0 asm("r0") = a0; \ - register typeof(a1) r1 asm("r1") = a1; \ - register typeof(a2) r2 asm("r2") = a2; \ - register typeof(a3) r3 asm("r3") = a3 + register unsigned long r0 asm("r0") = (u32)a0; \ + register unsigned long r1 asm("r1") = a1; \ + register unsigned long r2 asm("r2") = a2; \ + register unsigned long r3 asm("r3") = a3#define __declare_arg_4 (a0, a1, a2, a3, a4, res) \ __declare_arg_3(a0, a1, a2, a3, res); \
Greg Kroah-Hartman
maintainerPATCH 221/228 arm/arm64: smccc-1.1: Handle function result as parameters
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
[ Upstream commit 755a8bf5579d22eb5636685c516d8dede799e27b ]
If someone has the silly idea to write something along those lines:
extern u64 foo(void);
void bar(struct arm_smccc_res *res)
{
arm_smccc_1_1_smc(0xbad, foo(), res);
}they are in for a surprise, as this gets compiled as:
0000000000000588 <bar>: 588: a9be7bfd stp x29, x30, [sp, #-32]! 58c: 910003fd mov x29, sp 590: f9000bf3 str x19, [sp, #16] 594: aa0003f3 mov x19, x0 598: aa1e03e0 mov x0, x30 59c: 94000000 bl 0 <_mcount> 5a0: 94000000 bl 0 <foo> 5a4: aa0003e1 mov x1, x0 5a8: d4000003 smc #0x0 5ac: b4000073 cbz x19, 5b8 <bar+0x30> 5b0: a9000660 stp x0, x1, [x19] 5b4: a9010e62 stp x2, x3, [x19, #16] 5b8: f9400bf3 ldr x19, [sp, #16] 5bc: a8c27bfd ldp x29, x30, [sp], #32 5c0: d65f03c0 ret 5c4: d503201f nop
The call to foo "overwrites" the x0 register for the return value, and we end up calling the wrong secure service.
A solution is to evaluate all the parameters before assigning anything to specific registers, leading to the expected result:
0000000000000588 <bar>: 588: a9be7bfd stp x29, x30, [sp, #-32]! 58c: 910003fd mov x29, sp 590: f9000bf3 str x19, [sp, #16] 594: aa0003f3 mov x19, x0 598: aa1e03e0 mov x0, x30 59c: 94000000 bl 0 <_mcount> 5a0: 94000000 bl 0 <foo> 5a4: aa0003e1 mov x1, x0 5a8: d28175a0 mov x0, #0xbad 5ac: d4000003 smc #0x0 5b0: b4000073 cbz x19, 5bc <bar+0x34> 5b4: a9000660 stp x0, x1, [x19] 5b8: a9010e62 stp x2, x3, [x19, #16] 5bc: f9400bf3 ldr x19, [sp, #16] 5c0: a8c27bfd ldp x29, x30, [sp], #32 5c4: d65f03c0 ret
--- include/linux/arm-smccc.h | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
include/linux/arm-smccc.h +20 -10
@@ -205,41 +205,51 @@ asmlinkage void __arm_smccc_hvc(unsigned register unsigned long r3 asm("r3")#define __declare_arg_1 (a0, a1, res) \ + typeof(a1) __a1 = a1; \ struct arm_smccc_res *___res = res; \ register unsigned long r0 asm("r0") = (u32)a0; \ - register unsigned long r1 asm("r1") = a1; \ + register unsigned long r1 asm("r1") = __a1; \ register unsigned long r2 asm("r2"); \ register unsigned long r3 asm("r3")#define __declare_arg_2 (a0, a1, a2, res) \ + typeof(a1) __a1 = a1; \ + typeof(a2) __a2 = a2; \ struct arm_smccc_res *___res = res; \ register unsigned long r0 asm("r0") = (u32)a0; \ - register unsigned long r1 asm("r1") = a1; \ - register unsigned long r2 asm("r2") = a2; \ + register unsigned long r1 asm("r1") = __a1; \ + register unsigned long r2 asm("r2") = __a2; \ register unsigned long r3 asm("r3")#define __declare_arg_3 (a0, a1, a2, a3, res) \ + typeof(a1) __a1 = a1; \ + typeof(a2) __a2 = a2; \ + typeof(a3) __a3 = a3; \ struct arm_smccc_res *___res = res; \ register unsigned long r0 asm("r0") = (u32)a0; \ - register unsigned long r1 asm("r1") = a1; \ - register unsigned long r2 asm("r2") = a2; \ - register unsigned long r3 asm("r3") = a3 + register unsigned long r1 asm("r1") = __a1; \ + register unsigned long r2 asm("r2") = __a2; \ + register unsigned long r3 asm("r3") = __a3#define __declare_arg_4 (a0, a1, a2, a3, a4, res) \ + typeof(a4) __a4 = a4; \ __declare_arg_3(a0, a1, a2, a3, res); \ - register typeof(a4) r4 asm("r4") = a4 + register unsigned long r4 asm("r4") = __a4#define __declare_arg_5 (a0, a1, a2, a3, a4, a5, res) \ + typeof(a5) __a5 = a5; \ __declare_arg_4(a0, a1, a2, a3, a4, res); \ - register typeof(a5) r5 asm("r5") = a5 + register unsigned long r5 asm("r5") = __a5#define __declare_arg_6 (a0, a1, a2, a3, a4, a5, a6, res) \ + typeof(a6) __a6 = a6; \ __declare_arg_5(a0, a1, a2, a3, a4, a5, res); \ - register typeof(a6) r6 asm("r6") = a6 + register unsigned long r6 asm("r6") = __a6#define __declare_arg_7 (a0, a1, a2, a3, a4, a5, a6, a7, res) \ + typeof(a7) __a7 = a7; \ __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res); \ - register typeof(a7) r7 asm("r7") = a7 + register unsigned long r7 asm("r7") = __a7#define ___declare_args (count, ...) __declare_arg_ ## count(__VA_ARGS__)#define __declare_args (count, ...) ___declare_args(count, __VA_ARGS__)
Greg Kroah-Hartman
maintainerPATCH 222/228 i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
[ Upstream commit 7fd6d98b89f382d414e1db528e29a67bbd749457 ]
Commit 7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR") made it possible for AML code to access SMBus I/O ports by installing custom SystemIO OpRegion handler and blocking i80i driver access upon first AML read/write to this OpRegion.
However, while ThinkPad T560 does have SystemIO OpRegion declared under the SMBus device, it does not access any of the SMBus registers:
Device (SMBU)
{
...
OperationRegion (SMBP, PCI_Config, 0x50, 0x04)
Field (SMBP, DWordAcc, NoLock, Preserve)
{
, 5,
TCOB, 11,
Offset (0x04)
}
Name (TCBV, 0x00)
Method (TCBS, 0, NotSerialized)
{
If ((TCBV == 0x00))
{
TCBV = (\_SB.PCI0.SMBU.TCOB << 0x05)
}
Return (TCBV) /* \_SB_.PCI0.SMBU.TCBV */
}
OperationRegion (TCBA, SystemIO, TCBS (), 0x10)
Field (TCBA, ByteAcc, NoLock, Preserve)
{
Offset (0x04),
, 9,
CPSC, 1
}
}Problem with the current approach is that it blocks all I/O port access and because this system has touchpad connected to the SMBus controller after first AML access (happens during suspend/resume cycle) the touchpad fails to work anymore.
Fix this so that we allow ACPI AML I/O port access if it does not touch the region reserved for the SMBus.
--- drivers/i2c/busses/i2c-i801.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-i801.c +8 -1
@@ -1417,6 +1417,13 @@ static void i801_add_tco(struct i801_pri }#ifdef CONFIG_ACPI +static bool i801_acpi_is_smbus_ioport (const struct i801_priv *priv, +acpi_physical_address address) +{ +return address >= priv->smba && + address <=pci_resource_end (priv->pci_dev,SMBBAR ); +} +static acpi_status i801_acpi_io_handler (u32 function,acpi_physical_address address,u32 bits,u64 *value,void *handler_context,void *region_context)
@@ -1432,7 +1439,7 @@ i801_acpi_io_handler(u32 function, acpi_*/ mutex_lock (&priv->acpi_lock); -if (!priv->acpi_reserved) { +if (!priv->acpi_reserved &&i801_acpi_is_smbus_ioport (priv, address)) { priv->acpi_reserved = true;dev_warn (&pdev->dev,"BIOS is accessing SMBus registers\n" );
Greg Kroah-Hartman
maintainerPATCH 223/228 clk: x86: Set default parent to 48Mhz
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akshu Agrawal <[email protected]>
[ Upstream commit bded6c03e398dc6e862dc8301fb9a60175740653 ]
System clk provided in ST soc can be set to:
48Mhz, non-spread
25Mhz, spread
To get accurate rate, we need it to set it at non-spread option which is 48Mhz.
--- drivers/clk/x86/clk-st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/x86/clk-st.c +1 -1
@@ -46,7 +46,7 @@ static int st_clk_probe(struct platform_ clk_oscout1_parents,ARRAY_SIZE (clk_oscout1_parents), 0, st_data->base + CLKDRVSTR2, OSCOUT1CLK25MHZ, 3, 0, NULL); -clk_set_parent (hws[ST_CLK_MUX ]->clk, hws[ST_CLK_25M ]->clk); +clk_set_parent (hws[ST_CLK_MUX ]->clk, hws[ST_CLK_48M ]->clk); hws[ST_CLK_GATE] = clk_hw_register_gate(NULL, "oscout1", "oscout1_mux", 0, st_data->base + MISCCLKCNTL1, OSCCLKENB,
Greg Kroah-Hartman
maintainerPATCH 224/228 x86/pti: Fix section mismatch warning/error
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
[ Upstream commit ff924c5a1ec7548825cc2d07980b03be4224ffac ]
Fix the section mismatch warning in arch/x86/mm/pti.c:
WARNING: vmlinux.o(.text+0x6972a): Section mismatch in reference from the function pti_clone_pgtable() to the function .init.text:pti_user_pagetable_walk_pte() The function pti_clone_pgtable() references
the function __init pti_user_pagetable_walk_pte().
This is often because pti_clone_pgtable lacks a __init
annotation or the annotation of pti_user_pagetable_walk_pte is wrong.
FATAL: modpost: Section mismatches detected.
--- arch/x86/mm/pti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/pti.c +1 -1
@@ -239,7 +239,7 @@ static pmd_t *pti_user_pagetable_walk_pm* * Returns a pointer to a PTE on success, or NULL on failure. */ -static __init pte_t *pti_user_pagetable_walk_pte (unsigned long address) +static pte_t *pti_user_pagetable_walk_pte (unsigned long address) {gfp_t gfp = (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO);pmd_t *pmd;
Greg Kroah-Hartman
maintainerPATCH 225/228 KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <[email protected]>
commit f14040bca89258b8a1c71e2112e430462172ce93 upstream.
When we come into the softpatch handler (0x1500), we use r11 to store the HSRR0 for later use by the denorm handler.
We also use the softpatch handler for the TM workarounds for POWER9. Unfortunately, in kvmppc_interrupt_hv we later store r11 out to the vcpu assuming it's still what we got from userspace.
This causes r11 to be corrupted in the VCPU and hence when we restore the guest, we get a corrupted r11. We've seen this when running TM tests inside guests on P9.
This fixes the problem by only touching r11 in the denorm case.
--- arch/powerpc/kernel/exceptions-64s.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/exceptions-64s.S +2 -2
@@ -1321,9 +1321,7 @@ EXC_REAL_BEGIN(denorm_exception_hv, 0x15 #ifdef CONFIG_PPC_DENORMALISATION mfspr r10,SPRN_HSRR1 - mfspr r11,SPRN_HSRR0 /* save HSRR0 */ andis. r10,r10,(HSRR1_DENORM)@h /* denorm? */ - addi r11,r11,-4 /* HSRR0 is next instruction */ bne+ denorm_assist #endif
@@ -1389,6 +1387,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) */ XVCPSGNDP32(32) denorm_done: + mfspr r11,SPRN_HSRR0 + subi r11,r11,4 mtspr SPRN_HSRR0,r11 mtcrf 0x80,r9 ld r9,PACA_EXGEN+EX_R9(r13)
Greg Kroah-Hartman
maintainerPATCH 226/228 powerpc: fix csum_ipv6_magic() on little endian platforms
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe Leroy <[email protected]>
commit 85682a7e3b9c664995ad477520f917039afdc330 upstream.
On little endian platforms, csum_ipv6_magic() keeps len and proto in CPU byte order. This generates a bad results leading to ICMPv6 packets from other hosts being dropped by powerpc64le platforms.
In order to fix this, len and proto should be converted to network byte order ie bigendian byte order. However checksumming 0x12345678 and 0x56341278 provide the exact same result so it is enough to rotate the sum of len and proto by 1 byte.
PPC32 only support bigendian so the fix is needed for PPC64 only
--- arch/powerpc/lib/checksum_64.S | 3 +++ 1 file changed, 3 insertions(+)
arch/powerpc/lib/checksum_64.S +3 -0
@@ -443,6 +443,9 @@ _GLOBAL(csum_ipv6_magic) addc r0, r8, r9 ld r10, 0(r4) ld r11, 8(r4) +#ifdef CONFIG_CPU_LITTLE_ENDIAN + rotldi r5, r5, 8 +#endif adde r0, r0, r10 add r5, r5, r7 adde r0, r0, r11
Greg Kroah-Hartman
maintainerPATCH 227/228 powerpc/pkeys: Fix reading of ibm, processor-storage-keys property
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thiago Jung Bauermann <[email protected]>
commit c716a25b9b70084e1144f77423f5aedd772ea478 upstream.
scan_pkey_feature() uses of_property_read_u32_array() to read the ibm,processor-storage-keys property and calls be32_to_cpu() on the value it gets. The problem is that of_property_read_u32_array() already returns the value converted to the CPU byte order.
The value of pkeys_total ends up more or less sane because there's a min() call in pkey_initialize() which reduces pkeys_total to 32. So in practice the kernel ignores the fact that the hypervisor reserved one key for itself (the device tree advertises 31 keys in my test VM).
This is wrong, but the effect in practice is that when a process tries to allocate the 32nd key, it gets an -EINVAL error instead of -ENOSPC which would indicate that there aren't any keys available
--- arch/powerpc/mm/pkeys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/pkeys.c +1 -1
@@ -44,7 +44,7 @@ static void scan_pkey_feature(void)* Since any pkey can be used for data or execute, we will just treat * all keys as equal and track them as one entity. */ - pkeys_total =be32_to_cpu (vals[0 ]); + pkeys_total = vals[0 ]; pkeys_devtree_defined = true; }
Greg Kroah-Hartman
maintainerPATCH 228/228 powerpc/pseries: Fix unitialized timer reset on migration
In reply to Greg Kroah-Hartman4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Bringmann <[email protected]>
commit 8604895a34d92f5e186ceb931b0d1b384030ea3d upstream.
After migration of a powerpc LPAR, the kernel executes code to update the system state to reflect new platform characteristics.
Such changes include modifications to device tree properties provided to the system by PHYP. Property notifications received by the post_mobility_fixup() code are passed along to the kernel in general through a call to of_update_property() which in turn passes such events back to all modules through entries like the '.notifier_call' function within the NUMA module.
When the NUMA module updates its state, it resets its event timer. If this occurs after a previous call to stop_topology_update() or on a system without VPHN enabled, the code runs into an unitialized timer structure and crashes. This patch adds a safety check along this path toward the problem code.
An example crash log is as follows.
ibmvscsi 30000081: Re-enabling adapter!
------------[ cut here ]------------
kernel BUG at kernel/time/timer.c:958!
Oops: Exception in kernel mode, sig: 5 [#1]
LE SMP NR_CPUS=2048 NUMA pSeries
Modules linked in: nfsv3 nfs_acl nfs tcp_diag udp_diag inet_diag lockd unix_diag af_packet_diag netlink_diag grace fscache sunrpc xts vmx_crypto pseries_rng sg binfmt_misc ip_tables xfs libcrc32c sd_mod ibmvscsi ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod
CPU: 11 PID: 3067 Comm: drmgr Not tainted 4.17.0+ #179
...
NIP mod_timer+0x4c/0x400
LR reset_topology_timer+0x40/0x60
Call Trace:
0xc0000003f9407830 (unreliable)
reset_topology_timer+0x40/0x60
dt_update_callback+0x100/0x120
notifier_call_chain+0x90/0x100
__blocking_notifier_call_chain+0x60/0x90
of_property_notify+0x90/0xd0
of_update_property+0x104/0x150
update_dt_property+0xdc/0x1f0
pseries_devicetree_update+0x2d0/0x510
post_mobility_fixup+0x7c/0xf0
migration_store+0xa4/0xc0
kobj_attr_store+0x30/0x60
sysfs_kf_write+0x64/0xa0
kernfs_fop_write+0x16c/0x240
__vfs_write+0x40/0x200
vfs_write+0xc8/0x240
ksys_write+0x5c/0x100
system_call+0x58/0x6c--- arch/powerpc/mm/numa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/mm/numa.c +2 -1
@@ -1452,7 +1452,8 @@ static struct timer_list topology_timer;static void reset_topology_timer (void ) { -mod_timer (&topology_timer, jiffies + topology_timer_secs *HZ ); +if (vphn_enabled) +mod_timer (&topology_timer, jiffies + topology_timer_secs *HZ ); }#ifdef CONFIG_SMP
Quoted 1 line · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release.
Applied over .11 and now running on three different machines. No observed regressions in dmesg or behaviour.
cheers!
Holger
Greg Kroah-Hartman
maintainerQuoted 5 lines · Holger Hoffstätte
Quoted 1 line · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release.
Applied over .11 and now running on three different machines. No observed regressions in dmesg or behaviour.
Wonderful, thanks for testing and letting me know.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.18.12-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Greg Kroah-Hartman
maintainerQuoted 15 lines · Shuah Khan
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. 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/v4.x/stable-review/patch-4.18.12-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.18.y
and the diffstat can be found below.
Quoted 6 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
Thanks for testing all of these and letting me know.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1
Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfs
Details are available at https://kerneltests.org/builders/.
Guenter
Greg Kroah-Hartman
maintainerQuoted 12 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfs
What is the status of that powerpc failure fix? What's the odds it can get into mainline soon?
Thanks for testing all of these,
greg k-h
Quoted 20 lines · Greg Kroah-Hartman
Quoted 12 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfs
Quoted 3 lines
What is the status of that powerpc failure fix? What's the odds it can get into mainline soon?
The fix has been -next for about a week.
da08d8cb8cfc of: unittest: Disable interrupt node tests for old world MAC systems
You'll have to ask Rob (copied) if he plans to send a pull request before the next commit window opens.
Guenter
Quoted 26 lines · Guenter Roeck
Quoted 20 lines · Greg Kroah-Hartman
Quoted 12 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfsQuoted 3 lines
What is the status of that powerpc failure fix? What's the odds it can get into mainline soon?
Quoted 6 lines
The fix has been -next for about a week.
da08d8cb8cfcof: unittest: Disable interrupt node tests for old world MAC systemsYou'll have to ask Rob (copied) if he plans to send a pull request before the next commit window opens.
I wasn't planning to as it's just for the unittest and has been that way for how long? Why's the unittest enabled for a defconfig anyways?
There was another g3beige fix (e54192b48da7 of: fix phandle cache creation for DTs with no phandles) which is tagged for stable. Not sure if qemu would hit the issue though.
Rob
Quoted 29 lines · Rob Herring
Quoted 28 lines · Guenter Roeck
Quoted 20 lines · Greg Kroah-Hartman
Quoted 12 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfsQuoted 3 lines
What is the status of that powerpc failure fix? What's the odds it can get into mainline soon?
The fix has been -next for about a week.
Quoted 8 lines
Quoted 4 lines
da08d8cb8cfcof: unittest: Disable interrupt node tests for old world MAC systemsYou'll have to ask Rob (copied) if he plans to send a pull request before the next commit window opens.
I wasn't planning to as it's just for the unittest and has been that way for how long? Why's the unittest enabled for a defconfig anyways?
I enabled it to improve test coverage for stable releases. This is how I found the problem in the first place. Are you suggesting that I should not run DT unit tests for stable release candidates ?
Quoted 4 lines
There was another g3beige fix (
e54192b48da7of: fix phandle cache creation for DTs with no phandles) which is tagged for stable. Not sure if qemu would hit the issue though.
Depends if there is a test that can be enabled which hits the problem.
Thanks,
Guenter
Quoted 35 lines · Guenter Roeck
Quoted 34 lines · Rob Herring
Quoted 32 lines · Guenter Roeck
Quoted 20 lines · Greg Kroah-Hartman
Quoted 12 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfsQuoted 3 lines
What is the status of that powerpc failure fix? What's the odds it can get into mainline soon?
The fix has been -next for about a week.
da08d8cb8cfcof: unittest: Disable interrupt node tests for old world MAC systemsYou'll have to ask Rob (copied) if he plans to send a pull request before the next commit window opens.
Quoted 8 lines
Quoted 3 lines
I wasn't planning to as it's just for the unittest and has been that way for how long? Why's the unittest enabled for a defconfig anyways?
I enabled it to improve test coverage for stable releases. This is how I found the problem in the first place. Are you suggesting that I should not run DT unit tests for stable release candidates ?
I have now disabled CONFIG_OF_UNITTEST in my tests.
Guenter
Quoted 41 lines · Guenter Roeck
Quoted 39 lines · Guenter Roeck
Quoted 37 lines · Rob Herring
Quoted 26 lines · Guenter Roeck
Quoted 20 lines · Greg Kroah-Hartman
Quoted 12 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfsQuoted 3 lines
What is the status of that powerpc failure fix? What's the odds it can get into mainline soon?
Quoted 6 lines
The fix has been -next for about a week.
da08d8cb8cfcof: unittest: Disable interrupt node tests for old world MAC systemsYou'll have to ask Rob (copied) if he plans to send a pull request before the next commit window opens.
I wasn't planning to as it's just for the unittest and has been that way for how long? Why's the unittest enabled for a defconfig anyways?
Quoted 5 lines
Quoted 4 lines
I enabled it to improve test coverage for stable releases. This is how I found the problem in the first place. Are you suggesting that I should not run DT unit tests for stable release candidates ?
I have now disabled
CONFIG_OF_UNITTESTin my tests.
Well no, that wasn't what I was suggesting. I'll send it to Greg this week.
Are there details on how you run qemu?
Rob
Quoted 2 lines
Guenter
Quoted 46 lines · Rob Herring
Quoted 45 lines · Guenter Roeck
Quoted 43 lines · Guenter Roeck
Quoted 29 lines · Rob Herring
Quoted 28 lines · Guenter Roeck
Quoted 20 lines · Greg Kroah-Hartman
Quoted 12 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 321 pass: 320 fail: 1Failed tests:
powerpc:g3beige:ppc_book3s_defconfig:nosmp:ide:rootfsQuoted 3 lines
What is the status of that powerpc failure fix? What's the odds it can get into mainline soon?
The fix has been -next for about a week.
Quoted 8 lines
Quoted 4 lines
da08d8cb8cfcof: unittest: Disable interrupt node tests for old world MAC systemsYou'll have to ask Rob (copied) if he plans to send a pull request before the next commit window opens.
I wasn't planning to as it's just for the unittest and has been that way for how long? Why's the unittest enabled for a defconfig anyways?
I enabled it to improve test coverage for stable releases. This is how I found the problem in the first place. Are you suggesting that I should not run DT unit tests for stable release candidates ?
Quoted 6 lines
Quoted 1 line
I have now disabled
CONFIG_OF_UNITTESTin my tests.Well no, that wasn't what I was suggesting. I'll send it to Greg this week.
Are there details on how you run qemu?
Official ? No.
However, everything is published at https://github.com/groeck/linux-build-test/.
Guenter
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 4.18.12-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.18.y
git commit: e894b754af73d0948e34f61e6070f2d9407a4f98
git describe: v4.18.11-230-ge894b754af73
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.18-oe/build/v4.18.11-230-ge894b754af73
No regressions (compared to build v4.18.11)
------------------------------------------------------------------------
Ran 20361 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- i386
- juno-r2 - arm64
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15 - arm
- x86_64
Test Suites
-----------
* boot
* kselftest
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-containers-tests
* ltp-cve-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-timers-tests
* ltp-math-tests
* ltp-open-posix-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 11 lines · Dan Rue
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.18.12 release. There are 228 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Oct 4 13:24:08 UTC 2018. Anything received after that time might be too late.
Results from Linaro’s test farm.
No regressions on arm64, arm,x86_64, and i386.
Thanks for testing all of these and letting me know.
greg k-h