Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp725385ybm; Wed, 22 May 2019 10:26:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzptP+YeSWCYbq42xJOXL+AYxu6/V+0n0uWuWBrhpFI23W8BXehqZ5sv1b4TRmqZc/t2h5v X-Received: by 2002:a62:38cc:: with SMTP id f195mr96688497pfa.15.1558545999881; Wed, 22 May 2019 10:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558545999; cv=none; d=google.com; s=arc-20160816; b=ICmvZ/Vec/uo9EISuPB8Z4AOrKSCysKnKio06afftVpNMcRKLW6tUaS/wPsBmHtNLB B884kcGRfWEbWFnmVmIfSDp7LPh3BQnkNbMU96r8T/V3psfoK70S1yvNKgv0/gEEwVF+ 9L+eHLqDYIfvj6O5io5skbUCWyVM6A1HtA//dfTzmg4be5XtxEu5ZZm7tyLDo3zxbKi+ y3PnvblgtEwttPWn+k9PO/Mnr/c8yF/tUhvfk/uMXIyk0OfNeHKguevmlNqyTY3Z4TH4 ZBE9eQvc8PvE5kExtUznWIJtMqyN9Eq1ho4s9iSe8Kv1UfukCfBP7jd8yRdARF7Jed02 +TcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=dry8Vhqj9YW/Gsi060WCLElWagqgpLJMYP0BE8xe+RE=; b=0WWjBmbGrxqnmw9u7Qi0++DXpVr550vjn9S1VfQ2m6oCSMriqyMy9CaKZM69Fx8OQ5 Yx5x9X8YqYSBHue8kitwrE7DgNjyqNz10VDmj5HBl2bVJhVDtwjYwcYZhUEmN413kVz+ m6B1X6XHto9yL/ojaAb9yseYJvJ0cpbJdmx3hv74ZLa8r2y/l+6oGysZywEyzArFF3l6 4UkXWHfatrWR0PN80g6ssixMkfx72iUANyVh3SNnAshcjQ4sUeQWZbVGuNrGFMXUDTk2 gqWykVWGXaH6a5lT09HVyFrNu03e+Ygon32G9ZX+lJEmxBFYkzX7TQ2DevbgoUSG3Omm uhOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cbUkLYqR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si26800494pgh.162.2019.05.22.10.26.22; Wed, 22 May 2019 10:26:39 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=cbUkLYqR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730304AbfEVRFi (ORCPT + 99 others); Wed, 22 May 2019 13:05:38 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36881 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729269AbfEVRFh (ORCPT ); Wed, 22 May 2019 13:05:37 -0400 Received: by mail-pg1-f196.google.com with SMTP id n27so1633869pgm.4 for ; Wed, 22 May 2019 10:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=dry8Vhqj9YW/Gsi060WCLElWagqgpLJMYP0BE8xe+RE=; b=cbUkLYqRtFLwJAXvt6BO6XW43SoQqFSp77EVgjawQUtNQsy5MbLveeKO2HAhi0GiL2 7Q8bUj1XxmQXIMav3U78Eg8gtZTnG+LXKGDujl3fTnElMxysw7fvX28x85h/xm8h/fOg e7qzOy92Arx26cdWMl+T8CFoyrSqOaV37+hkfKsP5KvZ2QqJwF7FF62P5uSFTzsSVPwl sSkLsz2LWxk+UYGJLoFo++g9kZNjIHawIKJcX20Rlk1PrQqyqT0LbYlpl+9SpqwCdVFW aerFbheaU54RXBPjhVqBIKjQb3bl8xDgTSj12nSDIIrfsLRIt9jMSquyXtf/uHYuTLPX O//A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=dry8Vhqj9YW/Gsi060WCLElWagqgpLJMYP0BE8xe+RE=; b=ZBQFkFIMC/ACQ9L7ohuUuZMF5VCtICho8LM2xq5VB/+jL0iFh/xFst7XBxrVN5zdqa zFYu0BO21FvZ4T1cL+aRRtV1Sf7ftBRh/5mgclC1QpfMh2u3W9YN63YbmmmB1wlDuvui 5s0vgZuvY7TTCj3CRNtKLvmSGAu/tktGnqZ3QIeH+qmSDfgn1y6FGpMXvp7zDLYG8P7T BwRXUBbswZr1/H4s3MeKwKiUfTTjFeXlNHz69CKejpujX8DqIvpTvE/ckQpbywJ2Xnms lGhOvMOlNEkVK/oDIWxRFkLJUmoiUXqlrDSdK3b2jdMKNDaOpHo2dH9Gbhb/X+MPHZa8 pvWw== X-Gm-Message-State: APjAAAVwbHQ/VKjIg/lLJzQzanN5cVSom8pFVXdQ1e3kLWTEbC1+L0BU qZM+m/MZRk2Akjm23PEJXO8= X-Received: by 2002:a62:7a8e:: with SMTP id v136mr237711pfc.208.1558544737054; Wed, 22 May 2019 10:05:37 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.73]) by smtp.gmail.com with ESMTPSA id s2sm28417529pfe.105.2019.05.22.10.05.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 10:05:35 -0700 (PDT) Date: Wed, 22 May 2019 22:35:30 +0530 From: Hariprasad Kelam To: David Kershner , Greg Kroah-Hartman , Petr Machata , David Ahern , "David S. Miller" , Jann Horn , Hariprasad Kelam , sparmaintainer@unisys.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: unisys: visornic: Replace GFP_ATOMIC with GFP_KERNEL Message-ID: <20190522170530.GA4331@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As per below information GFP_KERNEL FLAG This is a normal allocation and might block. This is the flag to use in process context code when it is safe to sleep. GFP_ATOMIC FLAG The allocation is high-priority and does not sleep. This is the flag to use in interrupt handlers, bottom halves and other situations where you cannot sleep And we can take advantage of GFP_KERNEL , as when system is in low memory chances of getting success is high compared to GFP_ATOMIC. As visornic_probe is in process context we can use GPF_KERNEL. Signed-off-by: Hariprasad Kelam --- drivers/staging/unisys/visornic/visornic_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 1c1a470..9d4f1da 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -1861,12 +1861,12 @@ static int visornic_probe(struct visor_device *dev) skb_queue_head_init(&devdata->xmitbufhead); /* create a cmdrsp we can use to post and unpost rcv buffers */ - devdata->cmdrsp_rcv = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC); + devdata->cmdrsp_rcv = kmalloc(SIZEOF_CMDRSP, GFP_KERNEL); if (!devdata->cmdrsp_rcv) { err = -ENOMEM; goto cleanup_rcvbuf; } - devdata->xmit_cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC); + devdata->xmit_cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_KERNEL); if (!devdata->xmit_cmdrsp) { err = -ENOMEM; goto cleanup_cmdrsp_rcv; -- 2.7.4