All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [mkp-scsi:for-next 67/132] drivers/scsi/elx/libefc/efc_els.c:73 efc_els_io_alloc_size() warn: sleeping in atomic context
Date: Sat, 08 Jan 2022 23:50:23 +0800	[thread overview]
Message-ID: <202201082354.iAG3UuiL-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 6405 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Christoph Hellwig <hch@lst.de>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: James Smart <jsmart2021@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head:   315d049ad1951cef02d9337a2469cac51cca6932
commit: efac162a4e4dc4cebcc658e02676821ca834b56c [67/132] scsi: efct: Don't pass GFP_DMA to dma_alloc_coherent()
:::::: branch date: 25 hours ago
:::::: commit date: 3 weeks ago
config: x86_64-randconfig-m031-20220107 (https://download.01.org/0day-ci/archive/20220108/202201082354.iAG3UuiL-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/scsi/elx/libefc/efc_els.c:73 efc_els_io_alloc_size() warn: sleeping in atomic context

vim +73 drivers/scsi/elx/libefc/efc_els.c

8f406ef728597d James Smart       2021-06-01   39  
8f406ef728597d James Smart       2021-06-01   40  struct efc_els_io_req *
8f406ef728597d James Smart       2021-06-01   41  efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)
8f406ef728597d James Smart       2021-06-01   42  {
8f406ef728597d James Smart       2021-06-01   43  	struct efc *efc;
8f406ef728597d James Smart       2021-06-01   44  	struct efc_els_io_req *els;
8f406ef728597d James Smart       2021-06-01   45  	unsigned long flags = 0;
8f406ef728597d James Smart       2021-06-01   46  
8f406ef728597d James Smart       2021-06-01   47  	efc = node->efc;
8f406ef728597d James Smart       2021-06-01   48  
8f406ef728597d James Smart       2021-06-01   49  	spin_lock_irqsave(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   50  
8f406ef728597d James Smart       2021-06-01   51  	if (!node->els_io_enabled) {
8f406ef728597d James Smart       2021-06-01   52  		efc_log_err(efc, "els io alloc disabled\n");
8f406ef728597d James Smart       2021-06-01   53  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   54  		return NULL;
8f406ef728597d James Smart       2021-06-01   55  	}
8f406ef728597d James Smart       2021-06-01   56  
8f406ef728597d James Smart       2021-06-01   57  	els = mempool_alloc(efc->els_io_pool, GFP_ATOMIC);
8f406ef728597d James Smart       2021-06-01   58  	if (!els) {
8f406ef728597d James Smart       2021-06-01   59  		atomic_add_return(1, &efc->els_io_alloc_failed_count);
8f406ef728597d James Smart       2021-06-01   60  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   61  		return NULL;
8f406ef728597d James Smart       2021-06-01   62  	}
8f406ef728597d James Smart       2021-06-01   63  
8f406ef728597d James Smart       2021-06-01   64  	/* initialize refcount */
8f406ef728597d James Smart       2021-06-01   65  	kref_init(&els->ref);
8f406ef728597d James Smart       2021-06-01   66  	els->release = _efc_els_io_free;
8f406ef728597d James Smart       2021-06-01   67  
8f406ef728597d James Smart       2021-06-01   68  	/* populate generic io fields */
8f406ef728597d James Smart       2021-06-01   69  	els->node = node;
8f406ef728597d James Smart       2021-06-01   70  
8f406ef728597d James Smart       2021-06-01   71  	/* now allocate DMA for request and response */
8f406ef728597d James Smart       2021-06-01   72  	els->io.req.size = reqlen;
8f406ef728597d James Smart       2021-06-01  @73  	els->io.req.virt = dma_alloc_coherent(&efc->pci->dev, els->io.req.size,
efac162a4e4dc4 Christoph Hellwig 2021-12-14   74  					      &els->io.req.phys, GFP_KERNEL);
8f406ef728597d James Smart       2021-06-01   75  	if (!els->io.req.virt) {
8f406ef728597d James Smart       2021-06-01   76  		mempool_free(els, efc->els_io_pool);
8f406ef728597d James Smart       2021-06-01   77  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   78  		return NULL;
8f406ef728597d James Smart       2021-06-01   79  	}
8f406ef728597d James Smart       2021-06-01   80  
8f406ef728597d James Smart       2021-06-01   81  	els->io.rsp.size = rsplen;
8f406ef728597d James Smart       2021-06-01   82  	els->io.rsp.virt = dma_alloc_coherent(&efc->pci->dev, els->io.rsp.size,
efac162a4e4dc4 Christoph Hellwig 2021-12-14   83  					      &els->io.rsp.phys, GFP_KERNEL);
8f406ef728597d James Smart       2021-06-01   84  	if (!els->io.rsp.virt) {
8f406ef728597d James Smart       2021-06-01   85  		dma_free_coherent(&efc->pci->dev, els->io.req.size,
8f406ef728597d James Smart       2021-06-01   86  				  els->io.req.virt, els->io.req.phys);
8f406ef728597d James Smart       2021-06-01   87  		mempool_free(els, efc->els_io_pool);
8f406ef728597d James Smart       2021-06-01   88  		els = NULL;
8f406ef728597d James Smart       2021-06-01   89  	}
8f406ef728597d James Smart       2021-06-01   90  
8f406ef728597d James Smart       2021-06-01   91  	if (els) {
8f406ef728597d James Smart       2021-06-01   92  		/* initialize fields */
8f406ef728597d James Smart       2021-06-01   93  		els->els_retries_remaining = EFC_FC_ELS_DEFAULT_RETRIES;
8f406ef728597d James Smart       2021-06-01   94  
8f406ef728597d James Smart       2021-06-01   95  		/* add els structure to ELS IO list */
8f406ef728597d James Smart       2021-06-01   96  		INIT_LIST_HEAD(&els->list_entry);
8f406ef728597d James Smart       2021-06-01   97  		list_add_tail(&els->list_entry, &node->els_ios_list);
8f406ef728597d James Smart       2021-06-01   98  	}
8f406ef728597d James Smart       2021-06-01   99  
8f406ef728597d James Smart       2021-06-01  100  	spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01  101  	return els;
8f406ef728597d James Smart       2021-06-01  102  }
8f406ef728597d James Smart       2021-06-01  103  

:::::: The code at line 73 was first introduced by commit
:::::: 8f406ef728597da39c935ab9c12f4940139775f9 scsi: elx: libefc: Extended link Service I/O handling

:::::: TO: James Smart <jsmart2021@gmail.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [mkp-scsi:for-next 67/132] drivers/scsi/elx/libefc/efc_els.c:73 efc_els_io_alloc_size() warn: sleeping in atomic context
Date: Mon, 10 Jan 2022 10:01:57 +0300	[thread overview]
Message-ID: <202201082354.iAG3UuiL-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 6123 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head:   315d049ad1951cef02d9337a2469cac51cca6932
commit: efac162a4e4dc4cebcc658e02676821ca834b56c [67/132] scsi: efct: Don't pass GFP_DMA to dma_alloc_coherent()
config: x86_64-randconfig-m031-20220107 (https://download.01.org/0day-ci/archive/20220108/202201082354.iAG3UuiL-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/scsi/elx/libefc/efc_els.c:73 efc_els_io_alloc_size() warn: sleeping in atomic context

vim +73 drivers/scsi/elx/libefc/efc_els.c

8f406ef728597d James Smart       2021-06-01   40  struct efc_els_io_req *
8f406ef728597d James Smart       2021-06-01   41  efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)
8f406ef728597d James Smart       2021-06-01   42  {
8f406ef728597d James Smart       2021-06-01   43  	struct efc *efc;
8f406ef728597d James Smart       2021-06-01   44  	struct efc_els_io_req *els;
8f406ef728597d James Smart       2021-06-01   45  	unsigned long flags = 0;
8f406ef728597d James Smart       2021-06-01   46  
8f406ef728597d James Smart       2021-06-01   47  	efc = node->efc;
8f406ef728597d James Smart       2021-06-01   48  
8f406ef728597d James Smart       2021-06-01   49  	spin_lock_irqsave(&node->els_ios_lock, flags);
                                                        ^^^^^^^^^^^^^^^^^

8f406ef728597d James Smart       2021-06-01   50  
8f406ef728597d James Smart       2021-06-01   51  	if (!node->els_io_enabled) {
8f406ef728597d James Smart       2021-06-01   52  		efc_log_err(efc, "els io alloc disabled\n");
8f406ef728597d James Smart       2021-06-01   53  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   54  		return NULL;
8f406ef728597d James Smart       2021-06-01   55  	}
8f406ef728597d James Smart       2021-06-01   56  
8f406ef728597d James Smart       2021-06-01   57  	els = mempool_alloc(efc->els_io_pool, GFP_ATOMIC);
8f406ef728597d James Smart       2021-06-01   58  	if (!els) {
8f406ef728597d James Smart       2021-06-01   59  		atomic_add_return(1, &efc->els_io_alloc_failed_count);
8f406ef728597d James Smart       2021-06-01   60  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   61  		return NULL;
8f406ef728597d James Smart       2021-06-01   62  	}
8f406ef728597d James Smart       2021-06-01   63  
8f406ef728597d James Smart       2021-06-01   64  	/* initialize refcount */
8f406ef728597d James Smart       2021-06-01   65  	kref_init(&els->ref);
8f406ef728597d James Smart       2021-06-01   66  	els->release = _efc_els_io_free;
8f406ef728597d James Smart       2021-06-01   67  
8f406ef728597d James Smart       2021-06-01   68  	/* populate generic io fields */
8f406ef728597d James Smart       2021-06-01   69  	els->node = node;
8f406ef728597d James Smart       2021-06-01   70  
8f406ef728597d James Smart       2021-06-01   71  	/* now allocate DMA for request and response */
8f406ef728597d James Smart       2021-06-01   72  	els->io.req.size = reqlen;
8f406ef728597d James Smart       2021-06-01  @73  	els->io.req.virt = dma_alloc_coherent(&efc->pci->dev, els->io.req.size,
efac162a4e4dc4 Christoph Hellwig 2021-12-14   74  					      &els->io.req.phys, GFP_KERNEL);
                                                                                                                 ^^^^^^^^^^
Sleeping in spin lock

8f406ef728597d James Smart       2021-06-01   75  	if (!els->io.req.virt) {
8f406ef728597d James Smart       2021-06-01   76  		mempool_free(els, efc->els_io_pool);
8f406ef728597d James Smart       2021-06-01   77  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   78  		return NULL;
8f406ef728597d James Smart       2021-06-01   79  	}
8f406ef728597d James Smart       2021-06-01   80  
8f406ef728597d James Smart       2021-06-01   81  	els->io.rsp.size = rsplen;
8f406ef728597d James Smart       2021-06-01   82  	els->io.rsp.virt = dma_alloc_coherent(&efc->pci->dev, els->io.rsp.size,
efac162a4e4dc4 Christoph Hellwig 2021-12-14   83  					      &els->io.rsp.phys, GFP_KERNEL);
                                                                                                                 ^^^^^^^^^^
Same

8f406ef728597d James Smart       2021-06-01   84  	if (!els->io.rsp.virt) {
8f406ef728597d James Smart       2021-06-01   85  		dma_free_coherent(&efc->pci->dev, els->io.req.size,
8f406ef728597d James Smart       2021-06-01   86  				  els->io.req.virt, els->io.req.phys);
8f406ef728597d James Smart       2021-06-01   87  		mempool_free(els, efc->els_io_pool);
8f406ef728597d James Smart       2021-06-01   88  		els = NULL;
8f406ef728597d James Smart       2021-06-01   89  	}
8f406ef728597d James Smart       2021-06-01   90  
8f406ef728597d James Smart       2021-06-01   91  	if (els) {
8f406ef728597d James Smart       2021-06-01   92  		/* initialize fields */
8f406ef728597d James Smart       2021-06-01   93  		els->els_retries_remaining = EFC_FC_ELS_DEFAULT_RETRIES;
8f406ef728597d James Smart       2021-06-01   94  
8f406ef728597d James Smart       2021-06-01   95  		/* add els structure to ELS IO list */
8f406ef728597d James Smart       2021-06-01   96  		INIT_LIST_HEAD(&els->list_entry);
8f406ef728597d James Smart       2021-06-01   97  		list_add_tail(&els->list_entry, &node->els_ios_list);
8f406ef728597d James Smart       2021-06-01   98  	}
8f406ef728597d James Smart       2021-06-01   99  
8f406ef728597d James Smart       2021-06-01  100  	spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01  101  	return els;
8f406ef728597d James Smart       2021-06-01  102  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Christoph Hellwig <hch@lst.de>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	James Smart <jsmart2021@gmail.com>
Subject: [mkp-scsi:for-next 67/132] drivers/scsi/elx/libefc/efc_els.c:73 efc_els_io_alloc_size() warn: sleeping in atomic context
Date: Mon, 10 Jan 2022 10:01:57 +0300	[thread overview]
Message-ID: <202201082354.iAG3UuiL-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head:   315d049ad1951cef02d9337a2469cac51cca6932
commit: efac162a4e4dc4cebcc658e02676821ca834b56c [67/132] scsi: efct: Don't pass GFP_DMA to dma_alloc_coherent()
config: x86_64-randconfig-m031-20220107 (https://download.01.org/0day-ci/archive/20220108/202201082354.iAG3UuiL-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/scsi/elx/libefc/efc_els.c:73 efc_els_io_alloc_size() warn: sleeping in atomic context

vim +73 drivers/scsi/elx/libefc/efc_els.c

8f406ef728597d James Smart       2021-06-01   40  struct efc_els_io_req *
8f406ef728597d James Smart       2021-06-01   41  efc_els_io_alloc_size(struct efc_node *node, u32 reqlen, u32 rsplen)
8f406ef728597d James Smart       2021-06-01   42  {
8f406ef728597d James Smart       2021-06-01   43  	struct efc *efc;
8f406ef728597d James Smart       2021-06-01   44  	struct efc_els_io_req *els;
8f406ef728597d James Smart       2021-06-01   45  	unsigned long flags = 0;
8f406ef728597d James Smart       2021-06-01   46  
8f406ef728597d James Smart       2021-06-01   47  	efc = node->efc;
8f406ef728597d James Smart       2021-06-01   48  
8f406ef728597d James Smart       2021-06-01   49  	spin_lock_irqsave(&node->els_ios_lock, flags);
                                                        ^^^^^^^^^^^^^^^^^

8f406ef728597d James Smart       2021-06-01   50  
8f406ef728597d James Smart       2021-06-01   51  	if (!node->els_io_enabled) {
8f406ef728597d James Smart       2021-06-01   52  		efc_log_err(efc, "els io alloc disabled\n");
8f406ef728597d James Smart       2021-06-01   53  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   54  		return NULL;
8f406ef728597d James Smart       2021-06-01   55  	}
8f406ef728597d James Smart       2021-06-01   56  
8f406ef728597d James Smart       2021-06-01   57  	els = mempool_alloc(efc->els_io_pool, GFP_ATOMIC);
8f406ef728597d James Smart       2021-06-01   58  	if (!els) {
8f406ef728597d James Smart       2021-06-01   59  		atomic_add_return(1, &efc->els_io_alloc_failed_count);
8f406ef728597d James Smart       2021-06-01   60  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   61  		return NULL;
8f406ef728597d James Smart       2021-06-01   62  	}
8f406ef728597d James Smart       2021-06-01   63  
8f406ef728597d James Smart       2021-06-01   64  	/* initialize refcount */
8f406ef728597d James Smart       2021-06-01   65  	kref_init(&els->ref);
8f406ef728597d James Smart       2021-06-01   66  	els->release = _efc_els_io_free;
8f406ef728597d James Smart       2021-06-01   67  
8f406ef728597d James Smart       2021-06-01   68  	/* populate generic io fields */
8f406ef728597d James Smart       2021-06-01   69  	els->node = node;
8f406ef728597d James Smart       2021-06-01   70  
8f406ef728597d James Smart       2021-06-01   71  	/* now allocate DMA for request and response */
8f406ef728597d James Smart       2021-06-01   72  	els->io.req.size = reqlen;
8f406ef728597d James Smart       2021-06-01  @73  	els->io.req.virt = dma_alloc_coherent(&efc->pci->dev, els->io.req.size,
efac162a4e4dc4 Christoph Hellwig 2021-12-14   74  					      &els->io.req.phys, GFP_KERNEL);
                                                                                                                 ^^^^^^^^^^
Sleeping in spin lock

8f406ef728597d James Smart       2021-06-01   75  	if (!els->io.req.virt) {
8f406ef728597d James Smart       2021-06-01   76  		mempool_free(els, efc->els_io_pool);
8f406ef728597d James Smart       2021-06-01   77  		spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01   78  		return NULL;
8f406ef728597d James Smart       2021-06-01   79  	}
8f406ef728597d James Smart       2021-06-01   80  
8f406ef728597d James Smart       2021-06-01   81  	els->io.rsp.size = rsplen;
8f406ef728597d James Smart       2021-06-01   82  	els->io.rsp.virt = dma_alloc_coherent(&efc->pci->dev, els->io.rsp.size,
efac162a4e4dc4 Christoph Hellwig 2021-12-14   83  					      &els->io.rsp.phys, GFP_KERNEL);
                                                                                                                 ^^^^^^^^^^
Same

8f406ef728597d James Smart       2021-06-01   84  	if (!els->io.rsp.virt) {
8f406ef728597d James Smart       2021-06-01   85  		dma_free_coherent(&efc->pci->dev, els->io.req.size,
8f406ef728597d James Smart       2021-06-01   86  				  els->io.req.virt, els->io.req.phys);
8f406ef728597d James Smart       2021-06-01   87  		mempool_free(els, efc->els_io_pool);
8f406ef728597d James Smart       2021-06-01   88  		els = NULL;
8f406ef728597d James Smart       2021-06-01   89  	}
8f406ef728597d James Smart       2021-06-01   90  
8f406ef728597d James Smart       2021-06-01   91  	if (els) {
8f406ef728597d James Smart       2021-06-01   92  		/* initialize fields */
8f406ef728597d James Smart       2021-06-01   93  		els->els_retries_remaining = EFC_FC_ELS_DEFAULT_RETRIES;
8f406ef728597d James Smart       2021-06-01   94  
8f406ef728597d James Smart       2021-06-01   95  		/* add els structure to ELS IO list */
8f406ef728597d James Smart       2021-06-01   96  		INIT_LIST_HEAD(&els->list_entry);
8f406ef728597d James Smart       2021-06-01   97  		list_add_tail(&els->list_entry, &node->els_ios_list);
8f406ef728597d James Smart       2021-06-01   98  	}
8f406ef728597d James Smart       2021-06-01   99  
8f406ef728597d James Smart       2021-06-01  100  	spin_unlock_irqrestore(&node->els_ios_lock, flags);
8f406ef728597d James Smart       2021-06-01  101  	return els;
8f406ef728597d James Smart       2021-06-01  102  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


             reply	other threads:[~2022-01-08 15:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08 15:50 kernel test robot [this message]
2022-01-10  7:01 ` [mkp-scsi:for-next 67/132] drivers/scsi/elx/libefc/efc_els.c:73 efc_els_io_alloc_size() warn: sleeping in atomic context Dan Carpenter
2022-01-10  7:01 ` Dan Carpenter
2022-01-10  7:11 ` Christoph Hellwig
2022-01-10  7:11   ` Christoph Hellwig
2022-01-10 16:39   ` James Smart
2022-01-10 16:39     ` James Smart

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=202201082354.iAG3UuiL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.