linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Dewar <alex.dewar90@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Alex Dewar <alex.dewar90@gmail.com>,
	Sathya Prakash <sathya.prakash@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	Suganath Prabu Subramani  <suganath-prabu.subramani@broadcom.com>,
	MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH RFC 2/3] scsi: mpt: Replace a few uses of GFP_ATOMIC with GFP_KERNEL
Date: Thu,  3 Sep 2020 16:28:31 +0100	[thread overview]
Message-ID: <20200903152832.484908-3-alex.dewar90@gmail.com> (raw)
In-Reply-To: <20200903152832.484908-1-alex.dewar90@gmail.com>

None of the relevant functions are called from an atomic context, so
allocate memory with GFP_KERNEL to give a better chance of allocating
memory.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
---
 drivers/message/fusion/mptbase.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index b7136257b455..85fd9c3721ec 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -4254,14 +4254,14 @@ initChainBuffers(MPT_ADAPTER *ioc)
 	 */
 	if (ioc->ReqToChain == NULL) {
 		sz = ioc->req_depth * sizeof(int);
-		mem = kmalloc(sz, GFP_ATOMIC);
+		mem = kmalloc(sz, GFP_KERNEL);
 		if (mem == NULL)
 			return -1;
 
 		ioc->ReqToChain = (int *) mem;
 		dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ReqToChain alloc  @ %p, sz=%d bytes\n",
 			 	ioc->name, mem, sz));
-		mem = kmalloc(sz, GFP_ATOMIC);
+		mem = kmalloc(sz, GFP_KERNEL);
 		if (mem == NULL)
 			return -1;
 
@@ -4328,7 +4328,7 @@ initChainBuffers(MPT_ADAPTER *ioc)
 
 	sz = num_chain * sizeof(int);
 	if (ioc->ChainToChain == NULL) {
-		mem = kmalloc(sz, GFP_ATOMIC);
+		mem = kmalloc(sz, GFP_KERNEL);
 		if (mem == NULL)
 			return -1;
 
@@ -5283,7 +5283,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
 		int	 sz;
 		u8	*mem;
 		sz = MPT_MAX_SCSI_DEVICES * sizeof(int);
-		mem = kmalloc(sz, GFP_ATOMIC);
+		mem = kmalloc(sz, GFP_KERNEL);
 		if (mem == NULL)
 			return -EFAULT;
 
-- 
2.28.0


  parent reply	other threads:[~2020-09-03 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 15:28 [PATCH RFC 0/3] scsi: mpt: Refactor and port to dma_* interface Alex Dewar
2020-09-03 15:28 ` [PATCH RFC 1/3] scsi: mpt: Remove unnecessary sleepFlag argument from functions Alex Dewar
2020-09-03 15:28 ` Alex Dewar [this message]
2020-09-03 15:28 ` [PATCH RFC 3/3] scsi: mpt: Port from pci_* to dma_* interface Alex Dewar
2020-09-16  2:12 ` [PATCH RFC 0/3] scsi: mpt: Refactor and port " Martin K. Petersen
2020-09-16 16:44   ` Alex Dewar
2020-09-18  3:26     ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200903152832.484908-3-alex.dewar90@gmail.com \
    --to=alex.dewar90@gmail.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).