From patchwork Fri Dec 20 20:26:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3391701 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB157C0D4A for ; Fri, 20 Dec 2013 20:27:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E205820709 for ; Fri, 20 Dec 2013 20:27:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0F4F20703 for ; Fri, 20 Dec 2013 20:27:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753569Ab3LTU1Q (ORCPT ); Fri, 20 Dec 2013 15:27:16 -0500 Received: from mtv-iport-3.cisco.com ([173.36.130.14]:12672 "EHLO mtv-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797Ab3LTU1M (ORCPT ); Fri, 20 Dec 2013 15:27:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3402; q=dns/txt; s=iport; t=1387571232; x=1388780832; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Xi/SR0Nzs8nJAixGDRD5lbKkdcZiVMKqgDqzV2b8Vws=; b=IOROPMoPE6daL0TX7aRMK4fSDDFGGOVQLuBO24Z0ElVfjMJfts7nkOIR zuZVAjtRW0KznxeOLu7ANoRFl4ajzuTbJEVQVqIMvDzr//7HMcmjx9GJe LK1N6UO7TKnGN8f2FccIXtJxAQeBnFfVmrJmXInqMyIvN2AMK0mJ2Li0x k=; X-IronPort-AV: E=Sophos;i="4.95,523,1384300800"; d="scan'208";a="98539121" Received: from mtv-core-1.cisco.com ([171.68.58.6]) by mtv-iport-3.cisco.com with ESMTP; 20 Dec 2013 20:27:10 +0000 Received: from sjc-savbu-bld03.cisco.com (sjc-savbu-bld03.cisco.com [171.71.188.58]) by mtv-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id rBKKRAUj028524; Fri, 20 Dec 2013 20:27:10 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id F21F53F80C; Fri, 20 Dec 2013 12:27:09 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH for-next 12/15] IB/usnic: Change GFP_KERNEL TO GFP_ATOMIC if spinlock is held Date: Fri, 20 Dec 2013 12:26:43 -0800 Message-Id: <1387571206-8043-13-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 In-Reply-To: <1387571206-8043-1-git-send-email-umalhi@cisco.com> References: <1387571206-8043-1-git-send-email-umalhi@cisco.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-15.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP usNIC code at few places, calls kzalloc with GFP_KERNEL flag while holding a spinlock. Change GPF_KERNEL to GFP_ATOMIC at such places. Signed-off-by: Upinder Malhi --- drivers/infiniband/hw/usnic/usnic_fwd.c | 2 +- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 4 ++-- drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c | 2 +- drivers/infiniband/hw/usnic/usnic_vnic.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/usnic/usnic_fwd.c b/drivers/infiniband/hw/usnic/usnic_fwd.c index b5719fc..8e42216 100644 --- a/drivers/infiniband/hw/usnic/usnic_fwd.c +++ b/drivers/infiniband/hw/usnic/usnic_fwd.c @@ -98,7 +98,7 @@ int usnic_fwd_add_usnic_filter(struct usnic_fwd_dev *ufdev, int vnic_idx, return -ENOMEM; } - usnic_filter_hndl = kzalloc(sizeof(*usnic_filter_hndl), GFP_KERNEL); + usnic_filter_hndl = kzalloc(sizeof(*usnic_filter_hndl), GFP_ATOMIC); if (!usnic_filter_hndl) { usnic_err("Failed to allocate memory for hndl\n"); pci_free_consistent(pdev, tlv_size, tlv, tlv_pa); diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index 0daf7e9..ca5fa6a 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c @@ -346,7 +346,7 @@ alloc_res_chunk_list(struct usnic_vnic *vnic, } res_chunk_list = kzalloc(sizeof(*res_chunk_list)*(res_lst_sz+1), - GFP_KERNEL); + GFP_ATOMIC); if (!res_chunk_list) return ERR_PTR(-ENOMEM); @@ -464,7 +464,7 @@ usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, return ERR_PTR(-EINVAL); } - qp_grp = kzalloc(sizeof(*qp_grp), GFP_KERNEL); + qp_grp = kzalloc(sizeof(*qp_grp), GFP_ATOMIC); if (!qp_grp) { usnic_err("Unable to alloc qp_grp - Out of memory\n"); return NULL; diff --git a/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c b/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c index b6e3a6b..7e1dafc 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c +++ b/drivers/infiniband/hw/usnic/usnic_uiom_interval_tree.c @@ -39,7 +39,7 @@ usnic_uiom_interval_node_alloc(long int start, long int last, int ref_cnt, int flags) { struct usnic_uiom_interval_node *interval = kzalloc(sizeof(*interval), - GFP_KERNEL); + GFP_ATOMIC); if (!interval) return NULL; diff --git a/drivers/infiniband/hw/usnic/usnic_vnic.c b/drivers/infiniband/hw/usnic/usnic_vnic.c index 74e4e5b..656b88c 100644 --- a/drivers/infiniband/hw/usnic/usnic_vnic.c +++ b/drivers/infiniband/hw/usnic/usnic_vnic.c @@ -225,14 +225,14 @@ usnic_vnic_get_resources(struct usnic_vnic *vnic, enum usnic_vnic_res_type type, if (usnic_vnic_res_free_cnt(vnic, type) < cnt || cnt < 1 || !owner) return ERR_PTR(-EINVAL); - ret = kzalloc(sizeof(*ret), GFP_KERNEL); + ret = kzalloc(sizeof(*ret), GFP_ATOMIC); if (!ret) { usnic_err("Failed to allocate chunk for %s - Out of memory\n", usnic_vnic_pci_name(vnic)); return ERR_PTR(-ENOMEM); } - ret->res = kzalloc(sizeof(*(ret->res))*cnt, GFP_KERNEL); + ret->res = kzalloc(sizeof(*(ret->res))*cnt, GFP_ATOMIC); if (!ret->res) { usnic_err("Failed to allocate resources for %s. Out of memory\n", usnic_vnic_pci_name(vnic));