Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2691410imj; Mon, 11 Feb 2019 07:05:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IYFX5xQ6CtgP47EYwlxi3YEQ0qQGi6MI58es5bpjqGwL2j3PN3wgDgQx1turlTOGDrKbHTb X-Received: by 2002:a65:500c:: with SMTP id f12mr25221941pgo.226.1549897535764; Mon, 11 Feb 2019 07:05:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897535; cv=none; d=google.com; s=arc-20160816; b=aQ3QPrqek4u5otSMrzWtUqLYhW1LIPa0LNzmYpyA1JGZ9ZQ5/ji6Z5bZlWqSJbo9QG +bCd2WJvclgLUgTNlIEA0+sTx/0SZQZGCsY2ITjr8oTPCz9fVqqziIiiJv94qc7oJS01 ba3QNe2exTcSl7y3P8K5sznZ1tn3aGibZdEQZQDQz24bu7GXfgQBl30gKFeM4DyUm+35 SteRlAMeMqr8btn5kUY/Mn04CpXUxIIXJaG0yQTJn+M2lSHABApEOB+sQ9gwudjryK9+ SZfeTx/RTcOu56t/7RTONT6Gn08xqfCxdTbF3pNa6wETfQdcmKl7AP62Icq3Pd/P1kyV d1AQ== 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=1MZADroLWYCs2ZXvZ8RQc5IJ0pPFQL3fGxaCABZlYlM=; b=O7LZBFAGWVMAquTyQxOn7PWsM/e7ZtwXpQGoQjScq8AEJB+0TuCt6e45OvUqZ76ZwA +e2jIgv5MPjVEPnXaq5r9F/DSwpKtkFrNNu1zfjZMfE6cgSKWqVp7moMCZlwTLQRTnKc SE/4dQOSQnS+TW8OshhP8OX344EUXw5ADbqDpA4ONTBYBr7M9XGLWNgjkG7ILs0ZWsf0 YnVHb+riRlgNAuvm4Tw0MwYprELXUGDRd8KCRlFgDy9/GIhhX3n0/9pt1ribMPkrkwAk ZnMjZqod+5+dMNt2MSbn6SryBrEvBSfYkoHnPSyRrPvZ0S03oOaC4gGcpS8pLZ1vlATY YnsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OI8gWrl3; 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 p4si10334075pls.45.2019.02.11.07.05.17; Mon, 11 Feb 2019 07:05:35 -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=OI8gWrl3; 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 S2390507AbfBKPCz (ORCPT + 99 others); Mon, 11 Feb 2019 10:02:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:51066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390457AbfBKPCt (ORCPT ); Mon, 11 Feb 2019 10:02:49 -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 2F171222AE; Mon, 11 Feb 2019 15:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897368; bh=sblv1Pqwftr6XEr5ddLhtV1bJ7zyJX4CbgkQa0b1XWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OI8gWrl356JtZl9ihfRCPkVL3oXTOT0nxH5GGZR1ARnWWNyHnzxSUQ9y3+yR/Nod0 y9STBsHwlouBB4e42iYvUmTsIinNvEPFdWwHv/lvxth9vdRFpXQnbWhWdFm7nJikui pEmPYkGqI6zXomkZ6DAAaJ8OccBc/wg87aAfaG0o= 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.14 152/205] fsl/fman: Use GFP_ATOMIC in {memac,tgec}_add_hash_mac_address() Date: Mon, 11 Feb 2019 15:19:10 +0100 Message-Id: <20190211141838.283433316@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 c0296880feba..75ce773c21a6 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -927,7 +927,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 4b0f3a50b293..e575259d20f4 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -551,7 +551,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