From patchwork Wed Jun 14 19:34:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niranjana Vishwanathapura X-Patchwork-Id: 9787319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 67E19602D9 for ; Wed, 14 Jun 2017 19:35:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58E1A28294 for ; Wed, 14 Jun 2017 19:35:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D5AA283A6; Wed, 14 Jun 2017 19:35:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C978B20410 for ; Wed, 14 Jun 2017 19:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752321AbdFNTfs (ORCPT ); Wed, 14 Jun 2017 15:35:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:47690 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbdFNTfp (ORCPT ); Wed, 14 Jun 2017 15:35:45 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2017 12:35:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,341,1493708400"; d="scan'208";a="113254290" Received: from knc-06.sc.intel.com ([172.25.55.131]) by orsmga005.jf.intel.com with ESMTP; 14 Jun 2017 12:35:44 -0700 From: "Vishwanathapura, Niranjana" To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, Niranjana Vishwanathapura Subject: [PATCH 1/2] IB/opa_vnic: Use GFP_ATOMIC while sending trap Date: Wed, 14 Jun 2017 12:34:41 -0700 Message-Id: <1497468882-19161-2-git-send-email-niranjana.vishwanathapura@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1497468882-19161-1-git-send-email-niranjana.vishwanathapura@intel.com> References: <1497468882-19161-1-git-send-email-niranjana.vishwanathapura@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pass GFP_ATOMIC flag to ib_create_send_mad() while sending trap as it can be triggered from the atomic context. Fix the following trace with debug kernel. BUG: sleeping function called from invalid context at mm/slab.h:432 in_atomic(): 1, irqs_disabled(): 0, pid: 1771, name: NetworkManager Call Trace: dump_stack+0x63/0x90 ___might_sleep+0xda/0x130 __might_sleep+0x4a/0x90 __kmalloc+0x19e/0x220 ? ib_create_send_mad+0xea/0x390 [ib_core] ib_create_send_mad+0xea/0x390 [ib_core] opa_vnic_vema_send_trap+0x17b/0x460 [opa_vnic] opa_vnic_vema_report_event+0x57/0x80 [opa_vnic] opa_vnic_mac_send_event+0xaa/0xf0 [opa_vnic] opa_vnic_set_rx_mode+0x17/0x30 [opa_vnic] __dev_set_rx_mode+0x52/0x90 dev_set_rx_mode+0x26/0x40 __dev_open+0xe8/0x140 Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Niranjana Vishwanathapura --- drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c index 875694f..cf768dd 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c @@ -794,7 +794,7 @@ void opa_vnic_vema_send_trap(struct opa_vnic_adapter *adapter, send_buf = ib_create_send_mad(port->mad_agent, 1, pkey_idx, 0, IB_MGMT_VENDOR_HDR, IB_MGMT_MAD_DATA, - GFP_KERNEL, OPA_MGMT_BASE_VERSION); + GFP_ATOMIC, OPA_MGMT_BASE_VERSION); if (IS_ERR(send_buf)) { c_err("%s:Couldn't allocate send buf\n", __func__); goto err_sndbuf;