Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2751010imj; Mon, 11 Feb 2019 07:57:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IaRszmjgRjPLyhPcxWoKnzC8yA0CRdrVC1jte8ncOvCuxHTuPf8TJCFx0LgW7y3XIHFFxyv X-Received: by 2002:a17:902:b182:: with SMTP id s2mr38442072plr.89.1549900673676; Mon, 11 Feb 2019 07:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900673; cv=none; d=google.com; s=arc-20160816; b=ENo+vHIPXHY/c2Qi82K5H+nNLajYHJ+QQVVsje/hdcuVWKpJyqlynII9ZajQFym34k FndxCVEi7TSU2ECtO/D0omxqrX2bTFyKH2NkIP0RPR4lKIMzpMMaig0ci1o57cDgwVit wAh8UxanBFu+ARXJb0cAgF1GFFuy12vouo5YDIoDN5bmwyfdHqju6JvyjuBUiREMEp2D j9/rGQRnTpg3j/+H51FTf4aC9y6H4yvgLCvM0Q9U6NPy+7vMGJ4UsZuyQZ9aDpIZNZns b5p25+j8eOUpK3L2R2kxEHcLFVFO3JKGsfYPUpBBiq01AcP9pWqkp+XDHhHeBc3iKoOT OQMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lc9LdCx0TxYj0WpTZ6T9qh2DvppS9Uv40fqT7HeA+2g=; b=xPpRVmh/p3BKO/VDVg8gFnHRK88Aj7z6vozZRtFt+EZG3zmYV/8cfVcrefrrzZ9YyB e6XUmYMTsFSBZKUMyFLrBxpvsjkV76KY4A/apgUsv8xSX/oXCPY5AKEIU+BkKN0VTfNT 76xSFo9ZBXTifDikzwPzrttuqmnw17JfeRLv0fP2ZUA67Z1JmMDXjAUXYlbsdhVaLj/m EazPgTC7RhcCw2WYhp+93AvQSGKSvQPliGdwA9VMbYbYMw+rAhM8lf9kxcCFv9fHIe9O k9EpTtiVo8aOWyCzHemJubl0xvZbE8OmxeuneQ9XiH/jKZQjYYnxZMwOtUJWgQIQC/ly LJzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xmeQ8LMY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20si3112006pgh.147.2019.02.11.07.57.38; Mon, 11 Feb 2019 07:57:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xmeQ8LMY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730385AbfBKOeG (ORCPT + 99 others); Mon, 11 Feb 2019 09:34:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:42102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730776AbfBKOeC (ORCPT ); Mon, 11 Feb 2019 09:34:02 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE9612081B; Mon, 11 Feb 2019 14:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895641; bh=ixE9ydbJCZ47ITLh8zBTr6SS0Ca71EO3yKbn3onaQbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xmeQ8LMYEYeuKMm6eQUP50JvO5A29u8x4pYL7EJJ2NI6JMW99G8DvWzEgqMaRWy5H uVHZPqg9H0bSkvsMtsTsJZOKqNJ2YCDLX+iYnPWMngEo836CdzC1rzZlAFuELQmJQb s5Kx3z4wFvALXP2jTjx8UK4hF0WHmkRXUVImepGs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Scott Wood , "David S. Miller" , Sasha Levin Subject: [PATCH 4.20 272/352] fsl/fman: Use GFP_ATOMIC in {memac,tgec}_add_hash_mac_address() Date: Mon, 11 Feb 2019 15:18:19 +0100 Message-Id: <20190211141904.306013049@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 0d9c9a238faf925823bde866182c663b6d734f2e ] These functions are called from atomic context: [ 9.150239] BUG: sleeping function called from invalid context at /home/scott/git/linux/mm/slab.h:421 [ 9.158159] in_atomic(): 1, irqs_disabled(): 0, pid: 4432, name: ip [ 9.163128] CPU: 8 PID: 4432 Comm: ip Not tainted 4.20.0-rc2-00169-g63d86876f324 #29 [ 9.163130] Call Trace: [ 9.170701] [c0000002e899a980] [c0000000009c1068] .dump_stack+0xa8/0xec (unreliable) [ 9.177140] [c0000002e899aa10] [c00000000007a7b4] .___might_sleep+0x138/0x164 [ 9.184440] [c0000002e899aa80] [c0000000001d5bac] .kmem_cache_alloc_trace+0x238/0x30c [ 9.191216] [c0000002e899ab40] [c00000000065ea1c] .memac_add_hash_mac_address+0x104/0x198 [ 9.199464] [c0000002e899abd0] [c00000000065a788] .set_multi+0x1c8/0x218 [ 9.206242] [c0000002e899ac80] [c0000000006615ec] .dpaa_set_rx_mode+0xdc/0x17c [ 9.213544] [c0000002e899ad00] [c00000000083d2b0] .__dev_set_rx_mode+0x80/0xd4 [ 9.219535] [c0000002e899ad90] [c00000000083d334] .dev_set_rx_mode+0x30/0x54 [ 9.225271] [c0000002e899ae10] [c00000000083d4a0] .__dev_open+0x148/0x1c8 [ 9.230751] [c0000002e899aeb0] [c00000000083d934] .__dev_change_flags+0x19c/0x1e0 [ 9.230755] [c0000002e899af60] [c00000000083d9a4] .dev_change_flags+0x2c/0x80 [ 9.242752] [c0000002e899aff0] [c0000000008554ec] .do_setlink+0x350/0xf08 [ 9.248228] [c0000002e899b170] [c000000000857ad0] .rtnl_newlink+0x588/0x7e0 [ 9.253965] [c0000002e899b740] [c000000000852424] .rtnetlink_rcv_msg+0x3e0/0x498 [ 9.261440] [c0000002e899b820] [c000000000884790] .netlink_rcv_skb+0x134/0x14c [ 9.267607] [c0000002e899b8e0] [c000000000851840] .rtnetlink_rcv+0x18/0x2c [ 9.274558] [c0000002e899b950] [c000000000883c8c] .netlink_unicast+0x214/0x318 [ 9.281163] [c0000002e899ba00] [c000000000884220] .netlink_sendmsg+0x348/0x444 [ 9.287076] [c0000002e899bae0] [c00000000080d13c] .sock_sendmsg+0x2c/0x54 [ 9.287080] [c0000002e899bb50] [c0000000008106c0] .___sys_sendmsg+0x2d0/0x2d8 [ 9.298375] [c0000002e899bd30] [c000000000811a80] .__sys_sendmsg+0x5c/0xb0 [ 9.303939] [c0000002e899be20] [c0000000000006b0] system_call+0x60/0x6c Signed-off-by: Scott Wood Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/fman/fman_memac.c | 2 +- drivers/net/ethernet/freescale/fman/fman_tgec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index bc6eb30aa20f..41c6fa200e74 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -928,7 +928,7 @@ int memac_add_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr) hash = get_mac_addr_hash_code(addr) & HASH_CTRL_ADDR_MASK; /* Create element to be added to the driver hash table */ - hash_entry = kmalloc(sizeof(*hash_entry), GFP_KERNEL); + hash_entry = kmalloc(sizeof(*hash_entry), GFP_ATOMIC); if (!hash_entry) return -ENOMEM; hash_entry->addr = addr; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 40705938eecc..f75b9c11b2d2 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -553,7 +553,7 @@ int tgec_add_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr) hash = (crc >> TGEC_HASH_MCAST_SHIFT) & TGEC_HASH_ADR_MSK; /* Create element to be added to the driver hash table */ - hash_entry = kmalloc(sizeof(*hash_entry), GFP_KERNEL); + hash_entry = kmalloc(sizeof(*hash_entry), GFP_ATOMIC); if (!hash_entry) return -ENOMEM; hash_entry->addr = addr; -- 2.19.1