Commit 19a61a75 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Four small fixes in three drivers.

  The mptfusion one has actually caused user visible issues in certain
  kernel configurations"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: mptfusion: Don't use GFP_ATOMIC for larger DMA allocations
  scsi: libfc: Skip additional kref updating work event
  scsi: libfc: Handling of extra kref
  scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
parents 29206c63 311950f8
...@@ -1324,13 +1324,13 @@ mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init) ...@@ -1324,13 +1324,13 @@ mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init)
return 0; /* fw doesn't need any host buffers */ return 0; /* fw doesn't need any host buffers */
/* spin till we get enough memory */ /* spin till we get enough memory */
while(host_page_buffer_sz > 0) { while (host_page_buffer_sz > 0) {
ioc->HostPageBuffer =
if((ioc->HostPageBuffer = pci_alloc_consistent( dma_alloc_coherent(&ioc->pcidev->dev,
ioc->pcidev, host_page_buffer_sz,
host_page_buffer_sz, &ioc->HostPageBuffer_dma,
&ioc->HostPageBuffer_dma)) != NULL) { GFP_KERNEL);
if (ioc->HostPageBuffer) {
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT
"host_page_buffer @ %p, dma @ %x, sz=%d bytes\n", "host_page_buffer @ %p, dma @ %x, sz=%d bytes\n",
ioc->name, ioc->HostPageBuffer, ioc->name, ioc->HostPageBuffer,
...@@ -2741,8 +2741,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) ...@@ -2741,8 +2741,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
sz = ioc->alloc_sz; sz = ioc->alloc_sz;
dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "free @ %p, sz=%d bytes\n", dexitprintk(ioc, printk(MYIOC_s_INFO_FMT "free @ %p, sz=%d bytes\n",
ioc->name, ioc->alloc, ioc->alloc_sz)); ioc->name, ioc->alloc, ioc->alloc_sz));
pci_free_consistent(ioc->pcidev, sz, dma_free_coherent(&ioc->pcidev->dev, sz, ioc->alloc,
ioc->alloc, ioc->alloc_dma); ioc->alloc_dma);
ioc->reply_frames = NULL; ioc->reply_frames = NULL;
ioc->req_frames = NULL; ioc->req_frames = NULL;
ioc->alloc = NULL; ioc->alloc = NULL;
...@@ -2751,8 +2751,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) ...@@ -2751,8 +2751,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
if (ioc->sense_buf_pool != NULL) { if (ioc->sense_buf_pool != NULL) {
sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC); sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC);
pci_free_consistent(ioc->pcidev, sz, dma_free_coherent(&ioc->pcidev->dev, sz, ioc->sense_buf_pool,
ioc->sense_buf_pool, ioc->sense_buf_pool_dma); ioc->sense_buf_pool_dma);
ioc->sense_buf_pool = NULL; ioc->sense_buf_pool = NULL;
ioc->alloc_total -= sz; ioc->alloc_total -= sz;
} }
...@@ -2802,7 +2802,7 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) ...@@ -2802,7 +2802,7 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
"HostPageBuffer free @ %p, sz=%d bytes\n", "HostPageBuffer free @ %p, sz=%d bytes\n",
ioc->name, ioc->HostPageBuffer, ioc->name, ioc->HostPageBuffer,
ioc->HostPageBuffer_sz)); ioc->HostPageBuffer_sz));
pci_free_consistent(ioc->pcidev, ioc->HostPageBuffer_sz, dma_free_coherent(&ioc->pcidev->dev, ioc->HostPageBuffer_sz,
ioc->HostPageBuffer, ioc->HostPageBuffer_dma); ioc->HostPageBuffer, ioc->HostPageBuffer_dma);
ioc->HostPageBuffer = NULL; ioc->HostPageBuffer = NULL;
ioc->HostPageBuffer_sz = 0; ioc->HostPageBuffer_sz = 0;
...@@ -4497,7 +4497,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc) ...@@ -4497,7 +4497,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
ioc->name, sz, sz, num_chain)); ioc->name, sz, sz, num_chain));
total_size += sz; total_size += sz;
mem = pci_alloc_consistent(ioc->pcidev, total_size, &alloc_dma); mem = dma_alloc_coherent(&ioc->pcidev->dev, total_size,
&alloc_dma, GFP_KERNEL);
if (mem == NULL) { if (mem == NULL) {
printk(MYIOC_s_ERR_FMT "Unable to allocate Reply, Request, Chain Buffers!\n", printk(MYIOC_s_ERR_FMT "Unable to allocate Reply, Request, Chain Buffers!\n",
ioc->name); ioc->name);
...@@ -4574,8 +4575,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc) ...@@ -4574,8 +4575,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
spin_unlock_irqrestore(&ioc->FreeQlock, flags); spin_unlock_irqrestore(&ioc->FreeQlock, flags);
sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC); sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC);
ioc->sense_buf_pool = ioc->sense_buf_pool = dma_alloc_coherent(&ioc->pcidev->dev, sz,
pci_alloc_consistent(ioc->pcidev, sz, &ioc->sense_buf_pool_dma); &ioc->sense_buf_pool_dma, GFP_KERNEL);
if (ioc->sense_buf_pool == NULL) { if (ioc->sense_buf_pool == NULL) {
printk(MYIOC_s_ERR_FMT "Unable to allocate Sense Buffers!\n", printk(MYIOC_s_ERR_FMT "Unable to allocate Sense Buffers!\n",
ioc->name); ioc->name);
...@@ -4613,18 +4614,16 @@ PrimeIocFifos(MPT_ADAPTER *ioc) ...@@ -4613,18 +4614,16 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
if (ioc->alloc != NULL) { if (ioc->alloc != NULL) {
sz = ioc->alloc_sz; sz = ioc->alloc_sz;
pci_free_consistent(ioc->pcidev, dma_free_coherent(&ioc->pcidev->dev, sz, ioc->alloc,
sz, ioc->alloc_dma);
ioc->alloc, ioc->alloc_dma);
ioc->reply_frames = NULL; ioc->reply_frames = NULL;
ioc->req_frames = NULL; ioc->req_frames = NULL;
ioc->alloc_total -= sz; ioc->alloc_total -= sz;
} }
if (ioc->sense_buf_pool != NULL) { if (ioc->sense_buf_pool != NULL) {
sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC); sz = (ioc->req_depth * MPT_SENSE_BUFFER_ALLOC);
pci_free_consistent(ioc->pcidev, dma_free_coherent(&ioc->pcidev->dev, sz, ioc->sense_buf_pool,
sz, ioc->sense_buf_pool_dma);
ioc->sense_buf_pool, ioc->sense_buf_pool_dma);
ioc->sense_buf_pool = NULL; ioc->sense_buf_pool = NULL;
} }
......
...@@ -133,8 +133,10 @@ struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id) ...@@ -133,8 +133,10 @@ struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id)
lockdep_assert_held(&lport->disc.disc_mutex); lockdep_assert_held(&lport->disc.disc_mutex);
rdata = fc_rport_lookup(lport, port_id); rdata = fc_rport_lookup(lport, port_id);
if (rdata) if (rdata) {
kref_put(&rdata->kref, fc_rport_destroy);
return rdata; return rdata;
}
if (lport->rport_priv_size > 0) if (lport->rport_priv_size > 0)
rport_priv_size = lport->rport_priv_size; rport_priv_size = lport->rport_priv_size;
...@@ -481,10 +483,11 @@ static void fc_rport_enter_delete(struct fc_rport_priv *rdata, ...@@ -481,10 +483,11 @@ static void fc_rport_enter_delete(struct fc_rport_priv *rdata,
fc_rport_state_enter(rdata, RPORT_ST_DELETE); fc_rport_state_enter(rdata, RPORT_ST_DELETE);
kref_get(&rdata->kref); if (rdata->event == RPORT_EV_NONE) {
if (rdata->event == RPORT_EV_NONE && kref_get(&rdata->kref);
!queue_work(rport_event_queue, &rdata->event_work)) if (!queue_work(rport_event_queue, &rdata->event_work))
kref_put(&rdata->kref, fc_rport_destroy); kref_put(&rdata->kref, fc_rport_destroy);
}
rdata->event = event; rdata->event = event;
} }
......
...@@ -5944,7 +5944,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) ...@@ -5944,7 +5944,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
break; break;
} }
if (NVME_TARGET(vha->hw, fcport)) { if (found && NVME_TARGET(vha->hw, fcport)) {
if (fcport->disc_state == DSC_DELETE_PEND) { if (fcport->disc_state == DSC_DELETE_PEND) {
qla2x00_set_fcport_disc_state(fcport, DSC_GNL); qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
vha->fcport_count--; vha->fcport_count--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment