From patchwork Fri Jan 15 12:27:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E442C4332E for ; Fri, 15 Jan 2021 13:01:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51BB62256F for ; Fri, 15 Jan 2021 13:01:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388434AbhAONBR (ORCPT ); Fri, 15 Jan 2021 08:01:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:39982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732055AbhAOMdF (ORCPT ); Fri, 15 Jan 2021 07:33:05 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0D1C235F9; Fri, 15 Jan 2021 12:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713945; bh=LcsDfsXtnt6BALebnMNStaCQLdQeJlU3QXNbuKfSNKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxCJb2ahaQzw+ZBWcKkmhhu3U127kwpkmpl69Xu0wokT9K74sJoojI4WSnO1WC8Od TD5iVWept/KVWgaZuu4ujqziUp/yXIsYWr8SQx9zKJwSEP+r/5Y9EYBKhReI1hhRKy j6NJ3hYIzYXYxnRl/AFSNZ/jF8QIyn+tVHLcYLRw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yufeng Mo , Huazhong Tan , "David S. Miller" Subject: [PATCH 4.19 02/43] net: hns3: fix the number of queues actually used by ARQ Date: Fri, 15 Jan 2021 13:27:32 +0100 Message-Id: <20210115121957.165879490@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yufeng Mo [ Upstream commit 65e61e3c2a619c4d4b873885b2d5394025ed117b ] HCLGE_MBX_MAX_ARQ_MSG_NUM is used to apply memory for the number of queues used by ARQ(Asynchronous Receive Queue), so the head and tail pointers should also use this macro. Fixes: 07a0556a3a73 ("net: hns3: Changes to support ARQ(Asynchronous Receive Queue)") Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h +++ b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h @@ -102,7 +102,7 @@ struct hclgevf_mbx_arq_ring { #define hclge_mbx_ring_ptr_move_crq(crq) \ (crq->next_to_use = (crq->next_to_use + 1) % crq->desc_num) #define hclge_mbx_tail_ptr_move_arq(arq) \ - (arq.tail = (arq.tail + 1) % HCLGE_MBX_MAX_ARQ_MSG_SIZE) + (arq.tail = (arq.tail + 1) % HCLGE_MBX_MAX_ARQ_MSG_NUM) #define hclge_mbx_head_ptr_move_arq(arq) \ - (arq.head = (arq.head + 1) % HCLGE_MBX_MAX_ARQ_MSG_SIZE) + (arq.head = (arq.head + 1) % HCLGE_MBX_MAX_ARQ_MSG_NUM) #endif From patchwork Fri Jan 15 12:27:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D9BEC4332D for ; Fri, 15 Jan 2021 13:02:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0FAC221FA for ; Fri, 15 Jan 2021 13:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733185AbhAONBz (ORCPT ); Fri, 15 Jan 2021 08:01:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:39354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731599AbhAOMc4 (ORCPT ); Fri, 15 Jan 2021 07:32:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EC3F12333E; Fri, 15 Jan 2021 12:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713960; bh=7ZpCsSK2RVJ+ZQfyxTBYcdk3EMLC1D20DrcLXb0mkK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I32R426q0z8+sCMO9doLFkR9HTo6yV6Ijw1IFiVNunkLX1qjcQXQi4s4/VjNC2DbZ c+b701JH/xxdwys+JmQcrjz+AcFMQF4EzH7/yDsKjViBQc4ecbH1O449AzDudHn6HW 7Zk65gtLhYDUVdfSi6Dyr9b49ksGlDLfDj2RVUAk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Samuel Holland , "David S. Miller" Subject: [PATCH 4.19 04/43] net: stmmac: dwmac-sun8i: Balance internal PHY power Date: Fri, 15 Jan 2021 13:27:34 +0100 Message-Id: <20210115121957.263251610@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Samuel Holland [ Upstream commit b8239638853e3e37b287e4bd4d57b41f14c78550 ] sun8i_dwmac_exit calls sun8i_dwmac_unpower_internal_phy, but sun8i_dwmac_init did not call sun8i_dwmac_power_internal_phy. This caused PHY power to remain off after a suspend/resume cycle. Fix this by recording if PHY power should be restored, and if so, restoring it. Fixes: 634db83b8265 ("net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs") Signed-off-by: Samuel Holland Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -73,6 +73,7 @@ struct emac_variant { * @variant: reference to the current board variant * @regmap: regmap for using the syscon * @internal_phy_powered: Does the internal PHY is enabled + * @use_internal_phy: Is the internal PHY selected for use * @mux_handle: Internal pointer used by mdio-mux lib */ struct sunxi_priv_data { @@ -83,6 +84,7 @@ struct sunxi_priv_data { const struct emac_variant *variant; struct regmap_field *regmap_field; bool internal_phy_powered; + bool use_internal_phy; void *mux_handle; }; @@ -518,8 +520,11 @@ static const struct stmmac_dma_ops sun8i .dma_interrupt = sun8i_dwmac_dma_interrupt, }; +static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv); + static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) { + struct net_device *ndev = platform_get_drvdata(pdev); struct sunxi_priv_data *gmac = priv; int ret; @@ -533,13 +538,25 @@ static int sun8i_dwmac_init(struct platf ret = clk_prepare_enable(gmac->tx_clk); if (ret) { - if (gmac->regulator) - regulator_disable(gmac->regulator); dev_err(&pdev->dev, "Could not enable AHB clock\n"); - return ret; + goto err_disable_regulator; + } + + if (gmac->use_internal_phy) { + ret = sun8i_dwmac_power_internal_phy(netdev_priv(ndev)); + if (ret) + goto err_disable_clk; } return 0; + +err_disable_clk: + clk_disable_unprepare(gmac->tx_clk); +err_disable_regulator: + if (gmac->regulator) + regulator_disable(gmac->regulator); + + return ret; } static void sun8i_dwmac_core_init(struct mac_device_info *hw, @@ -809,7 +826,6 @@ static int mdio_mux_syscon_switch_fn(int struct sunxi_priv_data *gmac = priv->plat->bsp_priv; u32 reg, val; int ret = 0; - bool need_power_ephy = false; if (current_child ^ desired_child) { regmap_field_read(gmac->regmap_field, ®); @@ -817,13 +833,12 @@ static int mdio_mux_syscon_switch_fn(int case DWMAC_SUN8I_MDIO_MUX_INTERNAL_ID: dev_info(priv->device, "Switch mux to internal PHY"); val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SELECT; - - need_power_ephy = true; + gmac->use_internal_phy = true; break; case DWMAC_SUN8I_MDIO_MUX_EXTERNAL_ID: dev_info(priv->device, "Switch mux to external PHY"); val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SHUTDOWN; - need_power_ephy = false; + gmac->use_internal_phy = false; break; default: dev_err(priv->device, "Invalid child ID %x\n", @@ -831,7 +846,7 @@ static int mdio_mux_syscon_switch_fn(int return -EINVAL; } regmap_field_write(gmac->regmap_field, val); - if (need_power_ephy) { + if (gmac->use_internal_phy) { ret = sun8i_dwmac_power_internal_phy(priv); if (ret) return ret; From patchwork Fri Jan 15 12:27:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F7F1C43381 for ; Fri, 15 Jan 2021 13:02:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C1532256F for ; Fri, 15 Jan 2021 13:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731582AbhAONBz (ORCPT ); Fri, 15 Jan 2021 08:01:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:39426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733041AbhAOMc6 (ORCPT ); Fri, 15 Jan 2021 07:32:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2433A23884; Fri, 15 Jan 2021 12:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713962; bh=/6OtgpkAcLwhpPaznxOQq4fJsVnYKg8lwYWNpIgt+b4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rSkwo2gtCY4iH4supeAAhzEoD56ph6f/6VCHphc92c74GEmJOFqNf8Wg4BH7l2DwB zB2+t/QVEHGIh1SEGNHef6JIhn2U4SHJKluWKTkAGM52ggboeyvEW96+OYrAiV8KTO TwbsXwfwVIiayMnHqu9LSNr3Wq4Z/C5s4GJg1S+4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Kicinski , "David S. Miller" Subject: [PATCH 4.19 05/43] net: vlan: avoid leaks on register_vlan_dev() failures Date: Fri, 15 Jan 2021 13:27:35 +0100 Message-Id: <20210115121957.312655457@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jakub Kicinski [ Upstream commit 55b7ab1178cbf41f979ff83236d3321ad35ed2ad ] VLAN checks for NETREG_UNINITIALIZED to distinguish between registration failure and unregistration in progress. Since commit cb626bf566eb ("net-sysfs: Fix reference count leak") registration failure may, however, result in NETREG_UNREGISTERED as well as NETREG_UNINITIALIZED. This fix is similer to cebb69754f37 ("rtnetlink: Fix memory(net_device) leak when ->newlink fails") Fixes: cb626bf566eb ("net-sysfs: Fix reference count leak") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/8021q/vlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -277,7 +277,8 @@ static int register_vlan_device(struct n return 0; out_free_newdev: - if (new_dev->reg_state == NETREG_UNINITIALIZED) + if (new_dev->reg_state == NETREG_UNINITIALIZED || + new_dev->reg_state == NETREG_UNREGISTERED) free_netdev(new_dev); return err; } From patchwork Fri Jan 15 12:27:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88FA6C433E0 for ; Fri, 15 Jan 2021 13:00:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60AD3221FA for ; Fri, 15 Jan 2021 13:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733157AbhAOMd2 (ORCPT ); Fri, 15 Jan 2021 07:33:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:40396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733154AbhAOMd1 (ORCPT ); Fri, 15 Jan 2021 07:33:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 872B02336F; Fri, 15 Jan 2021 12:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713967; bh=pfMeXNysOzQTPDmCEc+5nOvWKPsqEUx9T2x+yAP5mpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UG7HMaQidlSj7Ev5B0BvImnEtlDZliA6QMg8tMO0icaOn7C2KL/O+tiLVOEeRy59d 7iamO6psMzwBLxoG4YwBiCsR66geEw7IYl5Rn1/pahP2UVau/ZbDeFAIXudzR1aoY2 cwznf6Cd64m6K0BEwNXhRuy41JS3VRL5XAf0fQpg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Perle , Florian Westphal , Pablo Neira Ayuso , Jakub Kicinski Subject: [PATCH 4.19 07/43] net: ip: always refragment ip defragmented packets Date: Fri, 15 Jan 2021 13:27:37 +0100 Message-Id: <20210115121957.409613220@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Westphal [ Upstream commit bb4cc1a18856a73f0ff5137df0c2a31f4c50f6cf ] Conntrack reassembly records the largest fragment size seen in IPCB. However, when this gets forwarded/transmitted, fragmentation will only be forced if one of the fragmented packets had the DF bit set. In that case, a flag in IPCB will force fragmentation even if the MTU is large enough. This should work fine, but this breaks with ip tunnels. Consider client that sends a UDP datagram of size X to another host. The client fragments the datagram, so two packets, of size y and z, are sent. DF bit is not set on any of these packets. Middlebox netfilter reassembles those packets back to single size-X packet, before routing decision. packet-size-vs-mtu checks in ip_forward are irrelevant, because DF bit isn't set. At output time, ip refragmentation is skipped as well because x is still smaller than the mtu of the output device. If ttransmit device is an ip tunnel, the packet size increases to x+overhead. Also, tunnel might be configured to force DF bit on outer header. In this case, packet will be dropped (exceeds MTU) and an ICMP error is generated back to sender. But sender already respects the announced MTU, all the packets that it sent did fit the announced mtu. Force refragmentation as per original sizes unconditionally so ip tunnel will encapsulate the fragments instead. The only other solution I see is to place ip refragmentation in the ip_tunnel code to handle this case. Fixes: d6b915e29f4ad ("ip_fragment: don't forward defragmented DF packet") Reported-by: Christian Perle Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -312,7 +312,7 @@ static int ip_finish_output(struct net * if (skb_is_gso(skb)) return ip_finish_output_gso(net, sk, skb, mtu); - if (skb->len > mtu || (IPCB(skb)->flags & IPSKB_FRAG_PMTU)) + if (skb->len > mtu || IPCB(skb)->frag_max_size) return ip_fragment(net, sk, skb, mtu, ip_finish_output2); return ip_finish_output2(net, sk, skb); From patchwork Fri Jan 15 12:27:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3435EC433E9 for ; Fri, 15 Jan 2021 13:01:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 107282256F for ; Fri, 15 Jan 2021 13:01:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733061AbhAOMdH (ORCPT ); Fri, 15 Jan 2021 07:33:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:39632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731147AbhAOMdH (ORCPT ); Fri, 15 Jan 2021 07:33:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E5B3823370; Fri, 15 Jan 2021 12:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713971; bh=NjIcjsNUDRZit9ds32hhnoD0fdbR8WXH7Dg2O1I7FH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ze/g+niQX20lQ6j8Cx3Cv791XPrCT2Og3T2nJsxZjEZkfSMpSyI4FThY8bOx+5578 sXoMFZb1h7zHM8Lv3rYYWjJnTaebL1NeEHX0fjatItVAtvbDQJp8VUl9OtwBENdjly /QejUfzeTH0v9izKuNOnZbRmqOlxzx6+iPpkt6ms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Tranchetti , David Ahern , Jakub Kicinski Subject: [PATCH 4.19 09/43] net: ipv6: fib: flush exceptions when purging route Date: Fri, 15 Jan 2021 13:27:39 +0100 Message-Id: <20210115121957.491877723@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sean Tranchetti [ Upstream commit d8f5c29653c3f6995e8979be5623d263e92f6b86 ] Route removal is handled by two code paths. The main removal path is via fib6_del_route() which will handle purging any PMTU exceptions from the cache, removing all per-cpu copies of the DST entry used by the route, and releasing the fib6_info struct. The second removal location is during fib6_add_rt2node() during a route replacement operation. This path also calls fib6_purge_rt() to handle cleaning up the per-cpu copies of the DST entries and releasing the fib6_info associated with the older route, but it does not flush any PMTU exceptions that the older route had. Since the older route is removed from the tree during the replacement, we lose any way of accessing it again. As these lingering DSTs and the fib6_info struct are holding references to the underlying netdevice struct as well, unregistering that device from the kernel can never complete. Fixes: 2b760fcf5cfb3 ("ipv6: hook up exception table to store dst cache") Signed-off-by: Sean Tranchetti Reviewed-by: David Ahern Link: https://lore.kernel.org/r/1609892546-11389-1-git-send-email-stranche@quicinc.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_fib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -906,6 +906,8 @@ static void fib6_purge_rt(struct fib6_in { struct fib6_table *table = rt->fib6_table; + /* Flush all cached dst in exception table */ + rt6_flush_exceptions(rt); if (rt->rt6i_pcpu) fib6_drop_pcpu_from(rt, table); @@ -1756,9 +1758,6 @@ static void fib6_del_route(struct fib6_t net->ipv6.rt6_stats->fib_rt_entries--; net->ipv6.rt6_stats->fib_discarded_routes++; - /* Flush all cached dst in exception table */ - rt6_flush_exceptions(rt); - /* Reset round-robin state, if necessary */ if (rcu_access_pointer(fn->rr_ptr) == rt) fn->rr_ptr = NULL; From patchwork Fri Jan 15 12:27:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF1F1C433E6 for ; Fri, 15 Jan 2021 13:02:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E070221FA for ; Fri, 15 Jan 2021 13:02:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733257AbhAONCO (ORCPT ); Fri, 15 Jan 2021 08:02:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:39632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731651AbhAOMcu (ORCPT ); Fri, 15 Jan 2021 07:32:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 243672339D; Fri, 15 Jan 2021 12:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713929; bh=vzDbLjDdpWdvu5S8k1Zf/+vqpKmaM+lttFnZlmXVDB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbYWS8fAvKQq4vpTHnQ3LHAPp5g7ox1Hl2AR/1hwPK1X2R6tiuiJfxSvMA+Dp9SG0 SX5ewrnRqgTp36meLS9VoyIdkqU2cA/AfZ9yzg1CTchzyu2+tJYX7rEe1zYZTCQ6k4 ep2N2we/5xFZ+Sn7kUiZ3ZbWBNrDvKsfx/lUn1Z0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinay Kumar Yadav , Ayush Sawal , Jakub Kicinski Subject: [PATCH 4.19 13/43] chtls: Replace skb_dequeue with skb_peek Date: Fri, 15 Jan 2021 13:27:43 +0100 Message-Id: <20210115121957.686731061@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ayush Sawal [ Upstream commit a84b2c0d5fa23da6d6c8c0d5f5c93184a2744d3e ] The skb is unlinked twice, one in __skb_dequeue in function chtls_reset_synq() and another in cleanup_syn_rcv_conn(). So in this patch using skb_peek() instead of __skb_dequeue(), so that unlink will be handled only in cleanup_syn_rcv_conn(). Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition") Signed-off-by: Vinay Kumar Yadav Signed-off-by: Ayush Sawal Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/chelsio/chtls/chtls_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/chelsio/chtls/chtls_cm.c +++ b/drivers/crypto/chelsio/chtls/chtls_cm.c @@ -581,7 +581,7 @@ static void chtls_reset_synq(struct list while (!skb_queue_empty(&listen_ctx->synq)) { struct chtls_sock *csk = - container_of((struct synq *)__skb_dequeue + container_of((struct synq *)skb_peek (&listen_ctx->synq), struct chtls_sock, synq); struct sock *child = csk->sk; From patchwork Fri Jan 15 12:27:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B066C433E9 for ; Fri, 15 Jan 2021 13:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C0F122473 for ; Fri, 15 Jan 2021 13:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731469AbhAOMdA (ORCPT ); Fri, 15 Jan 2021 07:33:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:39910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732069AbhAOMc7 (ORCPT ); Fri, 15 Jan 2021 07:32:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 09E2E23359; Fri, 15 Jan 2021 12:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713938; bh=hRcoCfh9d6SyECfi+A1ndn0fRkrdz9XEX+CwrdN/SjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=otr9f7FohN20bYuicTIX21Q4cNDxW9Xn84LxubPZKKO9O8ptcu0AoQ5irbVeh5QWC NgXbEhltDeg9GcCmOzmJFPQXLmm/rOPTUIS8X3Z+mdCZzLvH72n9qiXEDtTZJrpOmQ a5tZGfMicxOEJsyuipmbJICSG/i06E2iAawmio14= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shakeel Butt , Fenghua Yu , Reinette Chatre , Borislav Petkov , Tony Luck Subject: [PATCH 4.19 17/43] x86/resctrl: Dont move a task to the same resource group Date: Fri, 15 Jan 2021 13:27:47 +0100 Message-Id: <20210115121957.882938474@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Fenghua Yu commit a0195f314a25582b38993bf30db11c300f4f4611 upstream Shakeel Butt reported in [1] that a user can request a task to be moved to a resource group even if the task is already in the group. It just wastes time to do the move operation which could be costly to send IPI to a different CPU. Add a sanity check to ensure that the move operation only happens when the task is not already in the resource group. [1] https://lore.kernel.org/lkml/CALvZod7E9zzHwenzf7objzGKsdBmVwTgEJ0nPgs0LUFU3SN5Pw@mail.gmail.com/ Backporting notes: Since upstream commit fa7d949337cc ("x86/resctrl: Rename and move rdt files to a separate directory"), the file arch/x86/kernel/cpu/intel_rdt_rdtgroup.c has been renamed and moved to arch/x86/kernel/cpu/resctrl/rdtgroup.c. Apply the change against file arch/x86/kernel/cpu/intel_rdt_rdtgroup.c for older stable trees. Fixes: e02737d5b826 ("x86/intel_rdt: Add tasks files") Reported-by: Shakeel Butt Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/962ede65d8e95be793cb61102cca37f7bb018e66.1608243147.git.reinette.chatre@intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -554,6 +554,13 @@ static void update_task_closid_rmid(stru static int __rdtgroup_move_task(struct task_struct *tsk, struct rdtgroup *rdtgrp) { + /* If the task is already in rdtgrp, no need to move the task. */ + if ((rdtgrp->type == RDTCTRL_GROUP && tsk->closid == rdtgrp->closid && + tsk->rmid == rdtgrp->mon.rmid) || + (rdtgrp->type == RDTMON_GROUP && tsk->rmid == rdtgrp->mon.rmid && + tsk->closid == rdtgrp->mon.parent->closid)) + return 0; + /* * Set the task's closid/rmid before the PQR_ASSOC MSR can be * updated by them. From patchwork Fri Jan 15 12:27:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363608 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp272138jap; Fri, 15 Jan 2021 05:03:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJy09t5uPkN9awWvhrtbLXsvqIMaE9vnf7zgTMqlqSqKPO33GVhrWtLAyzj0S4fLn42ZgzRq X-Received: by 2002:a17:906:2f07:: with SMTP id v7mr8638593eji.343.1610715790322; Fri, 15 Jan 2021 05:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715790; cv=none; d=google.com; s=arc-20160816; b=Y3als3gp1thrHWXl12damzpwQ67cJbWK6nMb/WERUAH5aDZtZUBi6I49YPYVWcBjLN aJ4zduwk68FTerCOMDX+kGqn51ygJp0todv+N0AovWmmHSrxAhPdzvUZ7d35GxvKZ26G cDb96d8e7Zo90hMpVmE8tjZOrsX1xciTCrEqcGoKvvvXF7p7sqk7DbxzPRvSbvfSaej7 EfiN9mpLpfBzMEUFxMCtr3Iid+bnDI2YvNVsq6KNPQTfxGSu1VjVo7OB8fKqZp/DnHYk l7v2H4yPgZJGFeLF6fexED+/lr1vold2VuWsr0u4n7Uz2kcnpQEY8YaWGfX5Rm4EdXqU d0og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7o/38xibW8FviyQb/A//oal3s511fnNS1K09j5wEyTQ=; b=UQ2rB4K/mlUbVsQzANqsKRpVIcDk+YLMNfFoDwSgDqy7BuDVvcCqBUCjgYG49pF6Gc g1fldyXXrVGKUc0Yj5OnxtYPy3h1FItDiuJ3oZJ/blZhUThms6NVp69Jlo/r1zxEI0Pq SWjo2EAw1jWXtNUTSc/1UqYhRqHwwLHv7A+OT9jR8nxWJZ+T0b3M+bQi+U8ik6a6Sm4M ORBeVfJknaGo07O6NexwsVAqDIOCWNQMYRnu4i3LtvGDVYcz2DTw4ItykrYgZfohoW5V xTZBxmBM0yUn2jdd/sxIczoCkiQQtDgkR974Tu4H2wNYN+943MGjQPQjOabmo8SdnJtG PSLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AJn5235a; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si4390850edn.0.2021.01.15.05.03.10; Fri, 15 Jan 2021 05:03:10 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AJn5235a; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729698AbhAONBl (ORCPT + 13 others); Fri, 15 Jan 2021 08:01:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:39938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733048AbhAOMdB (ORCPT ); Fri, 15 Jan 2021 07:33:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1AF2223339; Fri, 15 Jan 2021 12:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713940; bh=QtR4PMTdr2JCl48RQw0sZcI1aCVVKNiEoPwrrCM6zmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AJn5235aQGLN5bSD/OhXFQkGxGwzH2WFrHnwX6w3/KyUUjyOWBWl+rdChs072y9Cd FQkySEf87WtCoF7oaW0NZysEesxWEwtIDxvSHSqPGDWdqFX8h208nkvsKzTHXwYMpF f1DYlCwKYzCjvgbvvjJVNnCXxRoJ3RdqiMb4C2BI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Cai , =?utf-8?b?RsSBbmctcnXDrCBTw7JuZw==?= , Nick Desaulniers , Kees Cook , Ingo Molnar , Luis Lozano , Manoj Gupta , linux-arch@vger.kernel.org, Nathan Chancellor Subject: [PATCH 4.19 18/43] vmlinux.lds.h: Add PGO and AutoFDO input sections Date: Fri, 15 Jan 2021 13:27:48 +0100 Message-Id: <20210115121957.934394200@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nick Desaulniers commit eff8728fe69880d3f7983bec3fb6cea4c306261f upstream. Basically, consider .text.{hot|unlikely|unknown}.* part of .text, too. When compiling with profiling information (collected via PGO instrumentations or AutoFDO sampling), Clang will separate code into .text.hot, .text.unlikely, or .text.unknown sections based on profiling information. After D79600 (clang-11), these sections will have a trailing `.` suffix, ie. .text.hot., .text.unlikely., .text.unknown.. When using -ffunction-sections together with profiling infomation, either explicitly (FGKASLR) or implicitly (LTO), code may be placed in sections following the convention: .text.hot., .text.unlikely., .text.unknown. where , , and are functions. (This produces one section per function; we generally try to merge these all back via linker script so that we don't have 50k sections). For the above cases, we need to teach our linker scripts that such sections might exist and that we'd explicitly like them grouped together, otherwise we can wind up with code outside of the _stext/_etext boundaries that might not be mapped properly for some architectures, resulting in boot failures. If the linker script is not told about possible input sections, then where the section is placed as output is a heuristic-laiden mess that's non-portable between linkers (ie. BFD and LLD), and has resulted in many hard to debug bugs. Kees Cook is working on cleaning this up by adding --orphan-handling=warn linker flag used in ARCH=powerpc to additional architectures. In the case of linker scripts, borrowing from the Zen of Python: explicit is better than implicit. Also, ld.bfd's internal linker script considers .text.hot AND .text.hot.* to be part of .text, as well as .text.unlikely and .text.unlikely.*. I didn't see support for .text.unknown.*, and didn't see Clang producing such code in our kernel builds, but I see code in LLVM that can produce such section names if profiling information is missing. That may point to a larger issue with generating or collecting profiles, but I would much rather be safe and explicit than have to debug yet another issue related to orphan section placement. Reported-by: Jian Cai Suggested-by: Fāng-ruì Sòng Signed-off-by: Nick Desaulniers Signed-off-by: Kees Cook Signed-off-by: Ingo Molnar Tested-by: Luis Lozano Tested-by: Manoj Gupta Acked-by: Kees Cook Cc: linux-arch@vger.kernel.org Cc: stable@vger.kernel.org Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=add44f8d5c5c05e08b11e033127a744d61c26aee Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1de778ed23ce7492c523d5850c6c6dbb34152655 Link: https://reviews.llvm.org/D79600 Link: https://bugs.chromium.org/p/chromium/issues/detail?id=1084760 Link: https://lore.kernel.org/r/20200821194310.3089815-7-keescook@chromium.org Debugged-by: Luis Lozano [nc: Resolve small conflict due to lack of NOINSTR_TEXT] Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- include/asm-generic/vmlinux.lds.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -492,7 +492,10 @@ */ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ - *(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \ + *(.text.hot .text.hot.*) \ + *(TEXT_MAIN .text.fixup) \ + *(.text.unlikely .text.unlikely.*) \ + *(.text.unknown .text.unknown.*) \ *(.text..refcount) \ *(.ref.text) \ MEM_KEEP(init.text*) \ From patchwork Fri Jan 15 12:27:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD1E5C433DB for ; Fri, 15 Jan 2021 13:02:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 861B822473 for ; Fri, 15 Jan 2021 13:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731567AbhAOMcs (ORCPT ); Fri, 15 Jan 2021 07:32:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:38812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733010AbhAOMco (ORCPT ); Fri, 15 Jan 2021 07:32:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 055432336F; Fri, 15 Jan 2021 12:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713949; bh=6gvE6nzPjcWnoQZJOaFtUVrfogYLaWHJndWXDwnj+P8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FUaRu6XbqvOUDTQhyd1bBPWFz+U80gQ+y8AbNd7R/PDSyg1UWglVjrxi9AEa5HiJ5 4ipvwK0J/6v9ceQIiO0IjnjzYXNQJeRPo6zLTXeniYKmeMpK7ZUIG4DLDnfZtezFX9 7I0x5JN/Fj+FgxXvn0+fgNLU1Tw6OnCjad2QJaPQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Nyekjaer , Jonathan Cameron , Sudip Mukherjee Subject: [PATCH 4.19 21/43] iio: imu: st_lsm6dsx: flip irq return logic Date: Fri, 15 Jan 2021 13:27:51 +0100 Message-Id: <20210115121958.071514885@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sean Nyekjaer commit ec76d918f23034f9f662539ca9c64e2ae3ba9fba upstream No need for using reverse logic in the irq return, fix this by flip things around. Signed-off-by: Sean Nyekjaer Signed-off-by: Jonathan Cameron Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c @@ -481,7 +481,7 @@ static irqreturn_t st_lsm6dsx_handler_th count = st_lsm6dsx_read_fifo(hw); mutex_unlock(&hw->fifo_lock); - return !count ? IRQ_NONE : IRQ_HANDLED; + return count ? IRQ_HANDLED : IRQ_NONE; } static int st_lsm6dsx_buffer_preenable(struct iio_dev *iio_dev) From patchwork Fri Jan 15 12:27:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 418CCC43381 for ; Fri, 15 Jan 2021 12:57:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A60A23136 for ; Fri, 15 Jan 2021 12:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733108AbhAOM50 (ORCPT ); Fri, 15 Jan 2021 07:57:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:41144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387456AbhAOMeP (ORCPT ); Fri, 15 Jan 2021 07:34:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0C992336F; Fri, 15 Jan 2021 12:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714015; bh=YCuT/meOWi39fL2ZvWvY68jiEeri71aX+oqCkmAL4ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mP1C+16JZ2/3LTtcQci6mG2CpAAFudOQtiSB0rcbnFcbQLjojzuPfNnRgaas1sXy1 YvhjTVg0L9Icu2RdtHtzPsP9YW55udvi23Z6+KjCiR4KH+R0omM8Kz9RASgyfteWI6 sR5F58uiHdDsrdFFHOAChF3FaY4yk47VQaAslAbk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linhua Xu , Chunyan Zhang , Wolfram Sang Subject: [PATCH 4.19 25/43] i2c: sprd: use a specific timeout to avoid system hang up issue Date: Fri, 15 Jan 2021 13:27:55 +0100 Message-Id: <20210115121958.272354531@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chunyan Zhang commit 0b884fe71f9ee6a5df35e677154256ea2099ebb8 upstream. If the i2c device SCL bus being pulled up due to some exception before message transfer done, the system cannot receive the completing interrupt signal any more, it would not exit waiting loop until MAX_SCHEDULE_TIMEOUT jiffies eclipse, that would make the system seemed hang up. To avoid that happen, this patch adds a specific timeout for message transfer. Fixes: 8b9ec0719834 ("i2c: Add Spreadtrum I2C controller driver") Signed-off-by: Linhua Xu Signed-off-by: Chunyan Zhang [wsa: changed errno to ETIMEDOUT] Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-sprd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/i2c/busses/i2c-sprd.c +++ b/drivers/i2c/busses/i2c-sprd.c @@ -71,6 +71,8 @@ /* timeout (ms) for pm runtime autosuspend */ #define SPRD_I2C_PM_TIMEOUT 1000 +/* timeout (ms) for transfer message */ +#define I2C_XFER_TIMEOUT 1000 /* SPRD i2c data structure */ struct sprd_i2c { @@ -244,6 +246,7 @@ static int sprd_i2c_handle_msg(struct i2 struct i2c_msg *msg, bool is_last_msg) { struct sprd_i2c *i2c_dev = i2c_adap->algo_data; + unsigned long time_left; i2c_dev->msg = msg; i2c_dev->buf = msg->buf; @@ -273,7 +276,10 @@ static int sprd_i2c_handle_msg(struct i2 sprd_i2c_opt_start(i2c_dev); - wait_for_completion(&i2c_dev->complete); + time_left = wait_for_completion_timeout(&i2c_dev->complete, + msecs_to_jiffies(I2C_XFER_TIMEOUT)); + if (!time_left) + return -ETIMEDOUT; return i2c_dev->err; } From patchwork Fri Jan 15 12:27:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BC7FC433E6 for ; Fri, 15 Jan 2021 12:33:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2E5023370 for ; Fri, 15 Jan 2021 12:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733078AbhAOMdM (ORCPT ); Fri, 15 Jan 2021 07:33:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:39676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733075AbhAOMdL (ORCPT ); Fri, 15 Jan 2021 07:33:11 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 50AA723356; Fri, 15 Jan 2021 12:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713975; bh=RrzrU55MdqYkXPCVEyn7aQX+cGvKgK9aqbEhIt56lJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iT9MP+gemSoUXc25+PJJGm6LSmGspBvaKK6oDMBNiTFRE9wYehPNlNy7uYj+gzfTZ jfhF6nEOT1jW8CjMFLyLfuRmQiQu2EgJMe5twhQT//OBrRD9y2bli6dTacU7NulV8t z7OsAaAWzeEFIBXSQLjrZY+weAHX3LHTGLc1soLw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Viresh Kumar , Colin Ian King , "Rafael J. Wysocki" Subject: [PATCH 4.19 26/43] cpufreq: powernow-k8: pass policy rather than use cpufreq_cpu_get() Date: Fri, 15 Jan 2021 13:27:56 +0100 Message-Id: <20210115121958.311172846@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Colin Ian King commit 943bdd0cecad06da8392a33093230e30e501eccc upstream. Currently there is an unlikely case where cpufreq_cpu_get() returns a NULL policy and this will cause a NULL pointer dereference later on. Fix this by passing the policy to transition_frequency_fidvid() from the caller and hence eliminating the need for the cpufreq_cpu_get() and cpufreq_cpu_put(). Thanks to Viresh Kumar for suggesting the fix. Addresses-Coverity: ("Dereference null return") Fixes: b43a7ffbf33b ("cpufreq: Notify all policy->cpus in cpufreq_notify_transition()") Suggested-by: Viresh Kumar Signed-off-by: Colin Ian King Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/powernow-k8.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -881,9 +881,9 @@ static int get_transition_latency(struct /* Take a frequency, and issue the fid/vid transition command */ static int transition_frequency_fidvid(struct powernow_k8_data *data, - unsigned int index) + unsigned int index, + struct cpufreq_policy *policy) { - struct cpufreq_policy *policy; u32 fid = 0; u32 vid = 0; int res; @@ -915,9 +915,6 @@ static int transition_frequency_fidvid(s freqs.old = find_khz_freq_from_fid(data->currfid); freqs.new = find_khz_freq_from_fid(fid); - policy = cpufreq_cpu_get(smp_processor_id()); - cpufreq_cpu_put(policy); - cpufreq_freq_transition_begin(policy, &freqs); res = transition_fid_vid(data, fid, vid); cpufreq_freq_transition_end(policy, &freqs, res); @@ -972,7 +969,7 @@ static long powernowk8_target_fn(void *a powernow_k8_acpi_pst_values(data, newstate); - ret = transition_frequency_fidvid(data, newstate); + ret = transition_frequency_fidvid(data, newstate, pol); if (ret) { pr_err("transition frequency failed\n"); From patchwork Fri Jan 15 12:27:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364562 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3499C4332B for ; Fri, 15 Jan 2021 12:59:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 985E32256F for ; Fri, 15 Jan 2021 12:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733193AbhAOMdi (ORCPT ); Fri, 15 Jan 2021 07:33:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:39960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733154AbhAOMdh (ORCPT ); Fri, 15 Jan 2021 07:33:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 962DC235F8; Fri, 15 Jan 2021 12:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714002; bh=TDDpXuBgLVCiAQrY2XBfhsvvI8CTbty4gxeGpYh89g8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BSOeeDcJkX+BFZb3fmsDKNlFzJiq9T/8CTPqwU1SiIEUaogL3b/Hjq6nWAEin2U+C CGGh22iNFBMGMYHjZ1eYcpk33d2G5Bqv6T2Um9y6uccdCA4ZxUvDJCDenia6yGV8+s 0d9b5gUms6FFJIkuGkfC807lv0htZvZPEyDlu+ns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shravya Kumbham , Radhey Shyam Pandey , Vinod Koul Subject: [PATCH 4.19 29/43] dmaengine: xilinx_dma: check dma_async_device_register return value Date: Fri, 15 Jan 2021 13:27:59 +0100 Message-Id: <20210115121958.458407619@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Shravya Kumbham commit 99974aedbd73523969afb09f33c6e3047cd0ddae upstream. dma_async_device_register() can return non-zero error code. Add condition to check the return value of dma_async_device_register function and handle the error path. Addresses-Coverity: Event check_return. Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/xilinx/xilinx_dma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2713,7 +2713,11 @@ static int xilinx_dma_probe(struct platf } /* Register the DMA engine with the core */ - dma_async_device_register(&xdev->common); + err = dma_async_device_register(&xdev->common); + if (err) { + dev_err(xdev->dev, "failed to register the dma device\n"); + goto error; + } err = of_dma_controller_register(node, of_dma_xilinx_xlate, xdev); From patchwork Fri Jan 15 12:28:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C7CAC433E9 for ; Fri, 15 Jan 2021 12:33:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E6D4238A0 for ; Fri, 15 Jan 2021 12:33:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733154AbhAOMdl (ORCPT ); Fri, 15 Jan 2021 07:33:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:39612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733218AbhAOMdj (ORCPT ); Fri, 15 Jan 2021 07:33:39 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C349223339; Fri, 15 Jan 2021 12:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714004; bh=MfLHoS0vnrYuPWiEEYF5pa32RrfYysgWSlR23/eQX0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ldBVeE+/0sC6dDfVI6nKJvCx2TRhsh9czebO0mLiNc/tn13ypwDJZMDkl08Ab46S2 zUHZUmXbK8kok8CP4xTCZVRYq5M3HapUi8cKXqCLaZDICcVAkFHw2cEEq6JZfJ7hQe Izs88PJDOJsrIpuF6WMmniNZkIzZsub537uM8zDE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shravya Kumbham , Radhey Shyam Pandey , Vinod Koul Subject: [PATCH 4.19 30/43] dmaengine: xilinx_dma: fix incompatible param warning in _child_probe() Date: Fri, 15 Jan 2021 13:28:00 +0100 Message-Id: <20210115121958.506620898@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Shravya Kumbham commit faeb0731be0a31e2246b21a85fa7dabbd750101d upstream. In xilinx_dma_child_probe function, the nr_channels variable is passed to of_property_read_u32() which expects an u32 return value pointer. Modify the nr_channels variable type from int to u32 to fix the incompatible parameter coverity warning. Addresses-Coverity: Event incompatible_param. Fixes: 1a9e7a03c761 ("dmaengine: vdma: Add support for mulit-channel dma mode") Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1608722462-29519-3-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/xilinx/xilinx_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2529,7 +2529,8 @@ static int xilinx_dma_chan_probe(struct static int xilinx_dma_child_probe(struct xilinx_dma_device *xdev, struct device_node *node) { - int ret, i, nr_channels = 1; + int ret, i; + u32 nr_channels = 1; ret = of_property_read_u32(node, "dma-channels", &nr_channels); if ((ret < 0) && xdev->mcdma) From patchwork Fri Jan 15 12:28:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363606 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp269237jap; Fri, 15 Jan 2021 05:00:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx53Ti1yVXCP2EQL3NtfiXUvwDgdaS/aahZeXCHUjaIG4Ugt/VYCHA8Ie9rSmgYGVcsO+pC X-Received: by 2002:a50:9f4d:: with SMTP id b71mr5735675edf.310.1610715601266; Fri, 15 Jan 2021 05:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715601; cv=none; d=google.com; s=arc-20160816; b=QbF3hIoB4OBlbEC4MbwcoC4mey+t25HyVjADNXcOQTxLeS9ICi9w0ASmTbU1S6H+d5 kKyk2PB9Blkw6vUGaItFXU2haWMmPr7YGi5ZJ6dRgeOB6P4zSCSghl6mjsVtxlyC5y1Z NL/i5aB1fmKXtg5Ypamqup/9zdKOS/m4OHbNN8hwkenAX4PaS8jVlgTD0eoEz1PJpUfF H0bjjWpF/eOtXeFEfqKGX2s5ddiQ3FbuD+WWgjIbbKLjbPQNax0Ktl5N/I4IDmAgTMTF B3N6nosyBg+ncs4LpnZ+3F1vxfSzeJ5RigerUS20HPpBuCKq5T3fd3gfYLGVSH6LA3t2 LAXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K+aLa4Lwtw23nHeiF3ghOlPKPHvOdg5oqR0v3xRwTUA=; b=ZKbmtjHKklxUSmi9pRusKJrI94SlzFSEJKhmN5cZMxkN1AB+P20R2Z0f8ViYYRH/8K T8DjawsyjPnWwpZU3trkfQpmFZg+qcB9OAQUllRItyM47LUtEaYVS76nFP4fYYcs647P Qmh2VweH38q+SIoiUUJ3T2TLNem34VjyqMfwjRT5o4tQKf2F3K8PbngpMTVYj6geWcqd WI4PrwGdo6bNUjvSsWP6BUjPwoKl4jtG3iFKqL/kMvqdf1v7vAb7AI9cicLoiU4Unqsc 7MjRgVDWkuEFFIy6mqxKmbFu+1DsJknWrVZUkbSkyPVjTdRqeKfrBpcx5sfW9EghGipk 3+Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P1a5CvKA; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si968432ejb.358.2021.01.15.05.00.00; Fri, 15 Jan 2021 05:00:01 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P1a5CvKA; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733238AbhAOMdp (ORCPT + 13 others); Fri, 15 Jan 2021 07:33:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:40396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733235AbhAOMdo (ORCPT ); Fri, 15 Jan 2021 07:33:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E8A623356; Fri, 15 Jan 2021 12:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714008; bh=s5rdMnDuSkDqSsdKS3Kfx41GvoHWbEtG2/DA60iC/qQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P1a5CvKAfD0i9VDK7F9WDKhrow8PmqVgdQWId6pjqyEQJ+Kv1iLjtV5AmXr6++DL8 7+RrKX4VUOU2tyO0wB4qTIu99PTKLEwMm4tZtR+/jSkhRwvlMY4DHokbkFUSjDzGbr 5cbB3JtR96TnSPxUinQZig64sHr6WcJA3IbBgWks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , "David S. Miller" Subject: [PATCH 4.19 32/43] wil6210: select CONFIG_CRC32 Date: Fri, 15 Jan 2021 13:28:02 +0100 Message-Id: <20210115121958.603484102@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit e186620d7bf11b274b985b839c38266d7918cc05 upstream. Without crc32, the driver fails to link: arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o: in function `wil_fw_verify': fw.c:(.text+0x74c): undefined reference to `crc32_le' arm-linux-gnueabi-ld: drivers/net/wireless/ath/wil6210/fw.o:fw.c:(.text+0x758): more undefined references to `crc32_le' follow Fixes: 151a9706503f ("wil6210: firmware download") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/wil6210/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/wireless/ath/wil6210/Kconfig +++ b/drivers/net/wireless/ath/wil6210/Kconfig @@ -1,6 +1,7 @@ config WIL6210 tristate "Wilocity 60g WiFi card wil6210 support" select WANT_DEV_COREDUMP + select CRC32 depends on CFG80211 depends on PCI default n From patchwork Fri Jan 15 12:28:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363605 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp268223jap; Fri, 15 Jan 2021 04:58:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqYsTFDgIqlWfCYjFdy4gw8KiV2cjY7rd01eZcRufCxDQcueFeEHl39+h2rkLoCNenQVuv X-Received: by 2002:a17:906:b252:: with SMTP id ce18mr8744037ejb.5.1610715489589; Fri, 15 Jan 2021 04:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715489; cv=none; d=google.com; s=arc-20160816; b=JHbXnQh0clSKmNSxh2r8yGoAurLbQs74bwy3qtrGPjCBTN9O+Ih5i/d577B0HWzcZC R8i6dqa+CpGUVVvy8JwuFpLF5a2AVpLFqPpkSpIblHf4FeJp2Clgap2lP9e+dbY191lH TDkLitdFA8THDVwrbWb7sL1pioEHlQUl0S4XPMXiagbGLFda7nk2l8eJmzwB5uImfLTV EmDxrgZUJjf4I3uCZnre5Ygvxs8GgYpOVJ/6x/ldqu8khnnxRv6ZgGLerzgBv2OiLUCf dc6tCx0c0Gbb3imoq9QLophYzcPNxDXvGqAVm53leQAlGLt5CCOhk27Vw5+Yrt7LG1Ow 93Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cQVYncGYWs2kZqm0Q7N/Qrq2KR7x6gPkqxFOEfbRFKY=; b=gzH1hTP+TrlcuovqG8stI+dI2DZh1tIPogRbfrSHvmfauzK9uF3yE/MB7/lRzhMlq4 bmBbMZcl7Z6j9PfHeGZ67RilB4nOXYw92FfkqF0A3+XIeijcZcrPQcBaZAhmUz/MZHSJ k6FN0WFk5sbBOc/hLsfebwRczbDzRg+7cFHxIG1jnpDzypTn1vOilWX5piIHXIAJ79+T iCsgCD5oQUxAYvqrDiFvcMBJPufIVJbJZJYNmTAzD1nY0jKF7GeCxKE8x1tO7UP+SwBg bUm0rPMiLikGYwt4VtlO3ge4Qx8K8+BSLUHYE0XRPYX0BQvdtPmqdEYi/6Rh9lM+VNA5 Qo6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wFnR+htB; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si3901231edr.464.2021.01.15.04.58.09; Fri, 15 Jan 2021 04:58:09 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wFnR+htB; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733296AbhAOM5m (ORCPT + 13 others); Fri, 15 Jan 2021 07:57:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:41098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387439AbhAOMeL (ORCPT ); Fri, 15 Jan 2021 07:34:11 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 605B12333E; Fri, 15 Jan 2021 12:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714010; bh=dED4n+b+mFEUmzm6mF7pfPFTq2xs9X+jXLI1xsa+kYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wFnR+htBwVh9A0sC7U6S1WfD3dViGgvsD1HbayVsLl1BEnBYfwncradGG4Emd3/m5 x6rg3e+VQAq6bseRVRzxeZAYxKYxhrp9r0IZZPBkr4wXl0/VzMRSF7D//cfHnHAhVK vjtZQb8tcOnLsP1cp6jVv8D5ShRVaLB9Jq8Rhdps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jens Axboe Subject: [PATCH 4.19 33/43] block: rsxx: select CONFIG_CRC32 Date: Fri, 15 Jan 2021 13:28:03 +0100 Message-Id: <20210115121958.651636922@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 36a106a4c1c100d55ba3d32a21ef748cfcd4fa99 upstream. Without crc32, the driver fails to link: arm-linux-gnueabi-ld: drivers/block/rsxx/config.o: in function `rsxx_load_config': config.c:(.text+0x124): undefined reference to `crc32_le' Fixes: 8722ff8cdbfa ("block: IBM RamSan 70/80 device driver") Signed-off-by: Arnd Bergmann Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -474,6 +474,7 @@ config BLK_DEV_RBD config BLK_DEV_RSXX tristate "IBM Flash Adapter 900GB Full Height PCIe Device Driver" depends on PCI + select CRC32 help Device driver for IBM's high speed PCIe SSD storage device: Flash Adapter 900GB Full Height. From patchwork Fri Jan 15 12:28:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363604 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp268202jap; Fri, 15 Jan 2021 04:58:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSCd3XUYn6GzmU9csK7Bxz84XQlPwKFFARZctC1FXIpvN3TtBqldfzmws8DIMl1SP+Tf5g X-Received: by 2002:a17:907:20bb:: with SMTP id pw27mr8435469ejb.102.1610715488249; Fri, 15 Jan 2021 04:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715488; cv=none; d=google.com; s=arc-20160816; b=Ei+sdBy4/PTW6bazY4QjosvCwd+Nq390vChhaaQOmSw28Dzthpy1dDSl4Z+wXh8Gxi kOV3GfxvPZaVp2FQ+X6oG2T/lWGI51O+rpTcO0jmae0PVz8GTdHB5CwGS8GOdz75Kzm2 emhmqfNQs0R/57mV9yC7cOfNjoAOU/OsZt+lV3XWelT+A1wme5BovNyVWZznGsM4n/k3 SrRoPox5Z+lHGHZAc6CcdSmCLPsbUSJZ/KSvDRDN7WYA6YoNqtFylJm7fAoS/VW2tyH7 OK8Yf7EQMknaYgiSari5myx+OyjgGK/LcInyeFMT9IzWa/aR0EyfFecLsZt3ZlWvCskt HAtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gIMgE5oDWasEkw1tdKp3AWuJsVtxjgQB5mfrhN4XnaI=; b=Rqfvb7cic4bw/usgZy5WungzX+bBG2h5/kbmyBiIxCXxfvGq/yLs4kTNzQtWuCCitP LO6x0JTJNBOkmoFMBfSUdZeIzFDSMjrbWHOdXdkYuKYNDaDQjpNdOHqQlFxrFn1R4dzk urxvCYbavwcZT52PMAutoedwkYQ2Vlp8MGtMyDd7AAQlUc3wSEQWsA9wp9C8yGMsjHAl XB5tlJYWTm4iVHs0OsuKXSedf3IOZwfN5m3Kz1SUY7lxxl1a4jAOjGQABIQaaAE/FgcP G4d8kmsSaVdiLGuIFKn3OcZAOQOC0ABsNcLlYQ6pM0GR6tCQsGU+s4HcPFOSyDVmPmk7 zDHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1QkeMuwb; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si3901231edr.464.2021.01.15.04.58.08; Fri, 15 Jan 2021 04:58:08 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1QkeMuwb; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387451AbhAOMeO (ORCPT + 13 others); Fri, 15 Jan 2021 07:34:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:41120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387448AbhAOMeN (ORCPT ); Fri, 15 Jan 2021 07:34:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91E8D22473; Fri, 15 Jan 2021 12:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714013; bh=w/CCngwlvQXfR6R9z2V8zA7OSINpshvyHzofDEeKu5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1QkeMuwb1QBMSkbknvItZSzDoCza6XJDf6Djf7K91VOinvL8pj0s83zysTm6Lhbu9 33ePCAWfkOmTRzRWbQ5+I1cWnDsmzSHVdIq1AdekFWjs0NXDukZ6WP3/a718isy57R dNTgSXzgsQ/zoeXHQ3K3KmI4ilWEUtNpmTlzOkRs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jens Axboe Subject: [PATCH 4.19 34/43] lightnvm: select CONFIG_CRC32 Date: Fri, 15 Jan 2021 13:28:04 +0100 Message-Id: <20210115121958.694439807@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 19cd3403cb0d522dd5e10188eef85817de29e26e upstream. Without CRC32 support, this fails to link: arm-linux-gnueabi-ld: drivers/lightnvm/pblk-init.o: in function `pblk_init': pblk-init.c:(.text+0x2654): undefined reference to `crc32_le' arm-linux-gnueabi-ld: drivers/lightnvm/pblk-init.o: in function `pblk_exit': pblk-init.c:(.text+0x2a7c): undefined reference to `crc32_le' Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") Signed-off-by: Arnd Bergmann Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/lightnvm/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/lightnvm/Kconfig +++ b/drivers/lightnvm/Kconfig @@ -19,6 +19,7 @@ if NVM config NVM_PBLK tristate "Physical Block Device Open-Channel SSD target" + select CRC32 help Allows an open-channel SSD to be exposed as a block device to the host. The target assumes the device exposes raw flash and must be From patchwork Fri Jan 15 12:28:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 571A7C433E6 for ; Fri, 15 Jan 2021 13:01:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D67022473 for ; Fri, 15 Jan 2021 13:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733089AbhAOMdN (ORCPT ); Fri, 15 Jan 2021 07:33:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:39354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733084AbhAOMdN (ORCPT ); Fri, 15 Jan 2021 07:33:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 805DE224F9; Fri, 15 Jan 2021 12:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713978; bh=3W/2kl5pRoifQ/6sKqJmSbA/UXuAGiXQNBe4dTELBq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MVYwmoFZNjLc/OvNYgBJ+zVE7Si78hvTsAmLr70AEgmUyH2XogqDlNO4yPBE5jdwE 4lAG5WFSiPW9QRCBNvI52V2iIQN3efKDoLGB6795FpZZyPf2BPCksSePUi17OOt/vk l4EkYrcE6n5n3bvhyUrB3YiS2jpRoiv3nita1DeQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Lu Baolu , Will Deacon Subject: [PATCH 4.19 35/43] iommu/intel: Fix memleak in intel_irq_remapping_alloc Date: Fri, 15 Jan 2021 13:28:05 +0100 Message-Id: <20210115121958.743938233@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu commit ff2b46d7cff80d27d82f7f3252711f4ca1666129 upstream. When irq_domain_get_irq_data() or irqd_cfg() fails at i == 0, data allocated by kzalloc() has not been freed before returning, which leads to memleak. Fixes: b106ee63abcc ("irq_remapping/vt-d: Enhance Intel IR driver to support hierarchical irqdomains") Signed-off-by: Dinghao Liu Acked-by: Lu Baolu Link: https://lore.kernel.org/r/20210105051837.32118-1-dinghao.liu@zju.edu.cn Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/intel_irq_remapping.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c @@ -1373,6 +1373,8 @@ static int intel_irq_remapping_alloc(str irq_data = irq_domain_get_irq_data(domain, virq + i); irq_cfg = irqd_cfg(irq_data); if (!irq_data || !irq_cfg) { + if (!i) + kfree(data); ret = -EINVAL; goto out_free_data; } From patchwork Fri Jan 15 12:28:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76200C433DB for ; Fri, 15 Jan 2021 13:00:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C9D7221FA for ; Fri, 15 Jan 2021 13:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733107AbhAONA1 (ORCPT ); Fri, 15 Jan 2021 08:00:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:39938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733106AbhAOMdR (ORCPT ); Fri, 15 Jan 2021 07:33:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2D56238E3; Fri, 15 Jan 2021 12:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713982; bh=PJzgqFqKZVgFLlgeDp7lTZbFkIcGuHXKZypxC+ix11k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GVKN2VkSayjor7AKv3ESVoT/mLbJL4nk6mEsmh+/Lp+myPz8BKyxr23nCjT819ZcD rAhWmKpvHecDRQ5aZWWGHJ13tdfAsgCFtZQ8G1VCakszYFIvzU+hrWYEOHe6S9hWVT RldEZtYun4aV8v3DlLzh+dKmuVaImGI7edpic1to= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Leon Romanovsky , Saeed Mahameed Subject: [PATCH 4.19 37/43] net/mlx5e: Fix two double free cases Date: Fri, 15 Jan 2021 13:28:07 +0100 Message-Id: <20210115121958.840039375@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu commit 7a6eb072a9548492ead086f3e820e9aac71c7138 upstream. mlx5e_create_ttc_table_groups() frees ft->g on failure of kvzalloc(), but such failure will be caught by its caller in mlx5e_create_ttc_table() and ft->g will be freed again in mlx5e_destroy_flow_table(). The same issue also occurs in mlx5e_create_ttc_table_groups(). Set ft->g to NULL after kfree() to avoid double free. Fixes: 7b3722fa9ef6 ("net/mlx5e: Support RSS for GRE tunneled packets") Fixes: 33cfaaa8f36f ("net/mlx5e: Split the main flow steering table") Signed-off-by: Dinghao Liu Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c @@ -893,6 +893,7 @@ static int mlx5e_create_ttc_table_groups in = kvzalloc(inlen, GFP_KERNEL); if (!in) { kfree(ft->g); + ft->g = NULL; return -ENOMEM; } @@ -1033,6 +1034,7 @@ static int mlx5e_create_inner_ttc_table_ in = kvzalloc(inlen, GFP_KERNEL); if (!in) { kfree(ft->g); + ft->g = NULL; return -ENOMEM; } From patchwork Fri Jan 15 12:28:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 364560 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3631EC433E0 for ; Fri, 15 Jan 2021 13:00:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 060B8221FA for ; Fri, 15 Jan 2021 13:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732602AbhAONAM (ORCPT ); Fri, 15 Jan 2021 08:00:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:39960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733119AbhAOMdU (ORCPT ); Fri, 15 Jan 2021 07:33:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 211C723136; Fri, 15 Jan 2021 12:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713984; bh=kXkmpOb9cuil0mUV6rMG9o25V7UONvMlHxshH1L7tiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mThs41ZsNBnil0YaXgBIZ+HxBdkQEd5UdAqdN2JM/p/cDxriXC9OPvtzzfB+UBGXR OAoyl62RQPLdnYe7NcRzQef19EXa7x1y5uLskFWpRJJ31FyINJNE+0fjUUFnP0L/KM 0Ju2OwnZM5OH3d1vW45IMeHzJlF8wphcKj75rZUM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaolei Wang , Mark Brown Subject: [PATCH 4.19 38/43] regmap: debugfs: Fix a memory leak when calling regmap_attach_dev Date: Fri, 15 Jan 2021 13:28:08 +0100 Message-Id: <20210115121958.889683670@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xiaolei Wang commit cffa4b2122f5f3e53cf3d529bbc74651f95856d5 upstream. After initializing the regmap through syscon_regmap_lookup_by_compatible, then regmap_attach_dev to the device, because the debugfs_name has been allocated, there is no need to redistribute it again unreferenced object 0xd8399b80 (size 64): comm "swapper/0", pid 1, jiffies 4294937641 (age 278.590s) hex dump (first 32 bytes): 64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72 dummy-iomuxc-gpr 40 32 30 65 34 30 30 30 00 7f 52 5b d8 7e 42 69 @20e4000..R[.~Bi backtrace: [] kasprintf+0x2c/0x54 [<6ad3bbc2>] regmap_debugfs_init+0xdc/0x2fc [] __regmap_init+0xc38/0xd88 [<1f7e0609>] of_syscon_register+0x168/0x294 [<735e8766>] device_node_get_regmap+0x6c/0x98 [] imx6ul_init_machine+0x20/0x88 [<0456565b>] customize_machine+0x1c/0x30 [] do_one_initcall+0x80/0x3ac [<7e584867>] kernel_init_freeable+0x170/0x1f0 [<80074741>] kernel_init+0x8/0x120 [<285d6f28>] ret_from_fork+0x14/0x20 [<00000000>] 0x0 Fixes: 9b947a13e7f6 ("regmap: use debugfs even when no device") Signed-off-by: Xiaolei Wang Link: https://lore.kernel.org/r/20201229105046.41984-1-xiaolei.wang@windriver.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/base/regmap/regmap-debugfs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -579,18 +579,25 @@ void regmap_debugfs_init(struct regmap * devname = dev_name(map->dev); if (name) { - map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", + if (!map->debugfs_name) { + map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", devname, name); + if (!map->debugfs_name) + return; + } name = map->debugfs_name; } else { name = devname; } if (!strcmp(name, "dummy")) { - kfree(map->debugfs_name); + if (!map->debugfs_name) + kfree(map->debugfs_name); map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d", dummy_index); + if (!map->debugfs_name) + return; name = map->debugfs_name; dummy_index++; } From patchwork Fri Jan 15 12:28:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 363607 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp270669jap; Fri, 15 Jan 2021 05:01:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZbl7DaxV3sq4NKni1Gggc9Y0mVdQifSxFYwyIvKXjQlRbF1GewTUTJ/HozW5T/bcZTTVn X-Received: by 2002:a17:907:7289:: with SMTP id dt9mr5707123ejc.446.1610715692030; Fri, 15 Jan 2021 05:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715692; cv=none; d=google.com; s=arc-20160816; b=cDmNmcyW6ai4KET/DuxTH+AwrEVuCdTwrWYODMqog+A3NhX2AVkSJp6fKxgwsVloPU f30q0Xw8cUhYSJuS92O9LaxdZkdh7IdtfXJkhER5vMc6dQ8pssTWSzAfXD4RYxovJ9wR ds96MO3QZ5RnzL+N7BEcAtSmO1crJvVEPTGKLoo9kWWIqzQ63uQDg5NlMBkBqS9Z4TDN LIC/+4Gp3rKkLl7ikShbYfU3kMybDpprcPaU0EwFkBGDsvLB6WV6a07TREJXXgj22QXo 6+/PdQLorcTwUA7e9t73aHGDSFPtNY9pf3HtNB2MifJOvm+xRb7oxkWQDMrMocTFA73A rYIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8V19FoB/3kYTuImn7NMSRUArBF62snp98xo3FAUqQYE=; b=qtnukP0vMChIrYdldvc/aY49bkcjyxoDE/2ESmybyAp9xJ/nJ7Zu8ToIDYbDNNiv8O G0s2iGXWtjqx3jw795ff1PePCm1E8efwqjM6Ml2ryQKJKEcgKWbdkRl0vOm2haGpZRH3 RcWKCjXlTcdiFLuhfM6tfc8VsUYCTKXBF/maT88y1/UtCCO6PVESasNzXnRKquVw3n7b 6B84NhVAnkavfHBpLLtRtzKTxHi0MGz6PxtuHKjTqVZWkFt5MefLNcvzvSkuUr4OgcYU gwe6SYmxk46HOh3u+VRQ3vE2gCijpDpZb5jZtsRAc6Rdsjb+G81RvuA7nso9LUP4v7QO Kf5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ytqw9lem; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h10si3617200ejj.473.2021.01.15.05.01.31; Fri, 15 Jan 2021 05:01:32 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ytqw9lem; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733118AbhAOMdX (ORCPT + 13 others); Fri, 15 Jan 2021 07:33:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:39612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733127AbhAOMdW (ORCPT ); Fri, 15 Jan 2021 07:33:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 56C9E23339; Fri, 15 Jan 2021 12:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713986; bh=fA0KTB++A7mRqnSitYulWdbeN4Ebxk5der3k//c7uXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ytqw9lemy4Os0n7ED+8ySJSAahUZFVcLcCksPyi0fYbRdPJg0Cqb5/7B3ulXQ6fpg hT7v/6ODqEJgS3mnkNfj4QGwiD6iFGesGGIklGjm9ies/SMG2oWeVNqItdRU9i+P5K ArslJ0p+IsB9F85iDRWJZnDjRNgzA36L8bsVWpCg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , "David S. Miller" Subject: [PATCH 4.19 39/43] wan: ds26522: select CONFIG_BITREVERSE Date: Fri, 15 Jan 2021 13:28:09 +0100 Message-Id: <20210115121958.937486533@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121957.037407908@linuxfoundation.org> References: <20210115121957.037407908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 69931e11288520c250152180ecf9b6ac5e6e40ed upstream. Without this, the driver runs into a link failure arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_ds26522_probe': slic_ds26522.c:(.text+0x100c): undefined reference to `byte_rev_table' arm-linux-gnueabi-ld: slic_ds26522.c:(.text+0x1cdc): undefined reference to `byte_rev_table' arm-linux-gnueabi-ld: drivers/net/wan/slic_ds26522.o: in function `slic_write': slic_ds26522.c:(.text+0x1e4c): undefined reference to `byte_rev_table' Fixes: c37d4a0085c5 ("Maxim/driver: Add driver for maxim ds26522") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/wan/Kconfig +++ b/drivers/net/wan/Kconfig @@ -295,6 +295,7 @@ config SLIC_DS26522 tristate "Slic Maxim ds26522 card support" depends on SPI depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE || COMPILE_TEST + select BITREVERSE help This module initializes and configures the slic maxim card in T1 or E1 mode.