From patchwork Thu Jan 9 22:47:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3463491 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 BF667C02DC for ; Thu, 9 Jan 2014 22:48:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D085820122 for ; Thu, 9 Jan 2014 22:48:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C177C2012E for ; Thu, 9 Jan 2014 22:48:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756165AbaAIWsM (ORCPT ); Thu, 9 Jan 2014 17:48:12 -0500 Received: from mtv-iport-3.cisco.com ([173.36.130.14]:1966 "EHLO mtv-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756201AbaAIWr7 (ORCPT ); Thu, 9 Jan 2014 17:47:59 -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=1389307679; x=1390517279; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=cu1hGwIOxkTtR1f4QsOlmRP2VYNdrKFtuhp4a/mYeqE=; b=MtuJi3OzSWOTNfzlXQbSdFgiUxx/MQGsu4HTsy38rC4RysISZA+0OiVN ZxwPfhF1rkJIB1vtHuKXPp9uwrMTfkwibGfYlPJEB5jcCF0Lol+x262fB 7qqIOSqnCMCYXTBCN6H8AwndQSMXDSsCZFd4jbutoqibvMJu23jzTMvvi s=; X-IronPort-AV: E=Sophos;i="4.95,634,1384300800"; d="scan'208";a="99936705" Received: from mtv-core-1.cisco.com ([171.68.58.6]) by mtv-iport-3.cisco.com with ESMTP; 09 Jan 2014 22:47:57 +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 s09MlvYB030673; Thu, 9 Jan 2014 22:47:57 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id 440F53F58E; Thu, 9 Jan 2014 14:47:57 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH v1 for-next 12/15] IB/usnic: Change GFP_KERNEL TO GFP_ATOMIC if spinlock is held Date: Thu, 9 Jan 2014 14:47:40 -0800 Message-Id: <1389307663-11296-13-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 In-Reply-To: <1389307663-11296-1-git-send-email-umalhi@cisco.com> References: <1389307663-11296-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=-14.5 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 06c21be..5a873f5 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));