2020-09-03 15:31:42

by Alex Dewar

[permalink] [raw]
Subject: [PATCH RFC 2/3] scsi: mpt: Replace a few uses of GFP_ATOMIC with GFP_KERNEL

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 <[email protected]>
---
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