提交 0603006b 编写于 作者: L Linus Torvalds

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

Pull SCSI fixes from James Bottomley:
 "This is seven basic fixes (plus one MAINTAINER update) which came in
  close to the merge window"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  ipr: Fix error return code in ipr_probe_ioa()
  fcoe: add missing destroy_workqueue() on error in fcoe_init()
  lpfc: Fix possible NULL pointer dereference
  fcoe: Use default VLAN for FIP VLAN discovery
  ipr: Wait to do async scan until scsi host is initialized
  MAINTAINERS: Update cxlflash maintainers
  cxlflash: Verify problem state area is mapped before notifying shutdown
  lpfc: fix oops in lpfc_sli4_scmd_to_wqidx_distr() from lpfc_send_taskmgmt()
...@@ -3494,6 +3494,7 @@ F: Documentation/ABI/testing/sysfs-class-cxl ...@@ -3494,6 +3494,7 @@ F: Documentation/ABI/testing/sysfs-class-cxl
CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER
M: Manoj N. Kumar <manoj@linux.vnet.ibm.com> M: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
M: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> M: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
M: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
L: linux-scsi@vger.kernel.org L: linux-scsi@vger.kernel.org
S: Supported S: Supported
F: drivers/scsi/cxlflash/ F: drivers/scsi/cxlflash/
......
...@@ -778,7 +778,7 @@ static void notify_shutdown(struct cxlflash_cfg *cfg, bool wait) ...@@ -778,7 +778,7 @@ static void notify_shutdown(struct cxlflash_cfg *cfg, bool wait)
{ {
struct afu *afu = cfg->afu; struct afu *afu = cfg->afu;
struct device *dev = &cfg->dev->dev; struct device *dev = &cfg->dev->dev;
struct sisl_global_map __iomem *global = &afu->afu_map->global; struct sisl_global_map __iomem *global;
struct dev_dependent_vals *ddv; struct dev_dependent_vals *ddv;
u64 reg, status; u64 reg, status;
int i, retry_cnt = 0; int i, retry_cnt = 0;
...@@ -787,6 +787,14 @@ static void notify_shutdown(struct cxlflash_cfg *cfg, bool wait) ...@@ -787,6 +787,14 @@ static void notify_shutdown(struct cxlflash_cfg *cfg, bool wait)
if (!(ddv->flags & CXLFLASH_NOTIFY_SHUTDOWN)) if (!(ddv->flags & CXLFLASH_NOTIFY_SHUTDOWN))
return; return;
if (!afu || !afu->afu_map) {
dev_dbg(dev, "%s: The problem state area is not mapped\n",
__func__);
return;
}
global = &afu->afu_map->global;
/* Notify AFU */ /* Notify AFU */
for (i = 0; i < NUM_FC_PORTS; i++) { for (i = 0; i < NUM_FC_PORTS; i++) {
reg = readq_be(&global->fc_regs[i][FC_CONFIG2 / 8]); reg = readq_be(&global->fc_regs[i][FC_CONFIG2 / 8]);
......
...@@ -92,6 +92,8 @@ static struct fcoe_interface ...@@ -92,6 +92,8 @@ static struct fcoe_interface
static int fcoe_fip_recv(struct sk_buff *, struct net_device *, static int fcoe_fip_recv(struct sk_buff *, struct net_device *,
struct packet_type *, struct net_device *); struct packet_type *, struct net_device *);
static int fcoe_fip_vlan_recv(struct sk_buff *, struct net_device *,
struct packet_type *, struct net_device *);
static void fcoe_fip_send(struct fcoe_ctlr *, struct sk_buff *); static void fcoe_fip_send(struct fcoe_ctlr *, struct sk_buff *);
static void fcoe_update_src_mac(struct fc_lport *, u8 *); static void fcoe_update_src_mac(struct fc_lport *, u8 *);
...@@ -363,6 +365,12 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe, ...@@ -363,6 +365,12 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
fcoe->fip_packet_type.dev = netdev; fcoe->fip_packet_type.dev = netdev;
dev_add_pack(&fcoe->fip_packet_type); dev_add_pack(&fcoe->fip_packet_type);
if (netdev != real_dev) {
fcoe->fip_vlan_packet_type.func = fcoe_fip_vlan_recv;
fcoe->fip_vlan_packet_type.type = htons(ETH_P_FIP);
fcoe->fip_vlan_packet_type.dev = real_dev;
dev_add_pack(&fcoe->fip_vlan_packet_type);
}
return 0; return 0;
} }
...@@ -450,6 +458,8 @@ static void fcoe_interface_remove(struct fcoe_interface *fcoe) ...@@ -450,6 +458,8 @@ static void fcoe_interface_remove(struct fcoe_interface *fcoe)
*/ */
__dev_remove_pack(&fcoe->fcoe_packet_type); __dev_remove_pack(&fcoe->fcoe_packet_type);
__dev_remove_pack(&fcoe->fip_packet_type); __dev_remove_pack(&fcoe->fip_packet_type);
if (netdev != fcoe->realdev)
__dev_remove_pack(&fcoe->fip_vlan_packet_type);
synchronize_net(); synchronize_net();
/* Delete secondary MAC addresses */ /* Delete secondary MAC addresses */
...@@ -519,6 +529,29 @@ static int fcoe_fip_recv(struct sk_buff *skb, struct net_device *netdev, ...@@ -519,6 +529,29 @@ static int fcoe_fip_recv(struct sk_buff *skb, struct net_device *netdev,
return 0; return 0;
} }
/**
* fcoe_fip_vlan_recv() - Handler for received FIP VLAN discovery frames
* @skb: The receive skb
* @netdev: The associated net device
* @ptype: The packet_type structure which was used to register this handler
* @orig_dev: The original net_device the the skb was received on.
* (in case dev is a bond)
*
* Returns: 0 for success
*/
static int fcoe_fip_vlan_recv(struct sk_buff *skb, struct net_device *netdev,
struct packet_type *ptype,
struct net_device *orig_dev)
{
struct fcoe_interface *fcoe;
struct fcoe_ctlr *ctlr;
fcoe = container_of(ptype, struct fcoe_interface, fip_vlan_packet_type);
ctlr = fcoe_to_ctlr(fcoe);
fcoe_ctlr_recv(ctlr, skb);
return 0;
}
/** /**
* fcoe_port_send() - Send an Ethernet-encapsulated FIP/FCoE frame * fcoe_port_send() - Send an Ethernet-encapsulated FIP/FCoE frame
* @port: The FCoE port * @port: The FCoE port
...@@ -539,7 +572,21 @@ static void fcoe_port_send(struct fcoe_port *port, struct sk_buff *skb) ...@@ -539,7 +572,21 @@ static void fcoe_port_send(struct fcoe_port *port, struct sk_buff *skb)
*/ */
static void fcoe_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) static void fcoe_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb)
{ {
skb->dev = fcoe_from_ctlr(fip)->netdev; struct fcoe_interface *fcoe = fcoe_from_ctlr(fip);
struct fip_frame {
struct ethhdr eth;
struct fip_header fip;
} __packed *frame;
/*
* Use default VLAN for FIP VLAN discovery protocol
*/
frame = (struct fip_frame *)skb->data;
if (frame->fip.fip_op == ntohs(FIP_OP_VLAN) &&
fcoe->realdev != fcoe->netdev)
skb->dev = fcoe->realdev;
else
skb->dev = fcoe->netdev;
fcoe_port_send(lport_priv(fip->lp), skb); fcoe_port_send(lport_priv(fip->lp), skb);
} }
...@@ -2448,7 +2495,7 @@ static int __init fcoe_init(void) ...@@ -2448,7 +2495,7 @@ static int __init fcoe_init(void)
if (rc) { if (rc) {
printk(KERN_ERR "failed to register an fcoe transport, check " printk(KERN_ERR "failed to register an fcoe transport, check "
"if libfcoe is loaded\n"); "if libfcoe is loaded\n");
return rc; goto out_destroy;
} }
mutex_lock(&fcoe_config_mutex); mutex_lock(&fcoe_config_mutex);
...@@ -2471,6 +2518,7 @@ static int __init fcoe_init(void) ...@@ -2471,6 +2518,7 @@ static int __init fcoe_init(void)
out_free: out_free:
mutex_unlock(&fcoe_config_mutex); mutex_unlock(&fcoe_config_mutex);
out_destroy:
destroy_workqueue(fcoe_wq); destroy_workqueue(fcoe_wq);
return rc; return rc;
} }
......
...@@ -80,6 +80,7 @@ struct fcoe_interface { ...@@ -80,6 +80,7 @@ struct fcoe_interface {
struct net_device *realdev; struct net_device *realdev;
struct packet_type fcoe_packet_type; struct packet_type fcoe_packet_type;
struct packet_type fip_packet_type; struct packet_type fip_packet_type;
struct packet_type fip_vlan_packet_type;
struct fc_exch_mgr *oem; struct fc_exch_mgr *oem;
u8 removed; u8 removed;
u8 priority; u8 priority;
......
...@@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct work_struct *work) ...@@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct work_struct *work)
return; return;
} }
if (!ioa_cfg->scan_enabled) {
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
return;
}
restart: restart:
do { do {
did_work = 0; did_work = 0;
...@@ -10214,6 +10219,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev, ...@@ -10214,6 +10219,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
if (!ioa_cfg->reset_work_q) { if (!ioa_cfg->reset_work_q) {
dev_err(&pdev->dev, "Couldn't register reset workqueue\n"); dev_err(&pdev->dev, "Couldn't register reset workqueue\n");
rc = -ENOMEM;
goto out_free_irq; goto out_free_irq;
} }
} else } else
...@@ -10362,6 +10368,7 @@ static void ipr_remove(struct pci_dev *pdev) ...@@ -10362,6 +10368,7 @@ static void ipr_remove(struct pci_dev *pdev)
static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
{ {
struct ipr_ioa_cfg *ioa_cfg; struct ipr_ioa_cfg *ioa_cfg;
unsigned long flags;
int rc, i; int rc, i;
rc = ipr_probe_ioa(pdev, dev_id); rc = ipr_probe_ioa(pdev, dev_id);
...@@ -10414,7 +10421,10 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) ...@@ -10414,7 +10421,10 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
} }
} }
spin_lock_irqsave(ioa_cfg->host->host_lock, flags);
ioa_cfg->scan_enabled = 1;
schedule_work(&ioa_cfg->work_q); schedule_work(&ioa_cfg->work_q);
spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags);
return 0; return 0;
} }
......
...@@ -1478,6 +1478,7 @@ struct ipr_ioa_cfg { ...@@ -1478,6 +1478,7 @@ struct ipr_ioa_cfg {
u8 in_ioa_bringdown:1; u8 in_ioa_bringdown:1;
u8 ioa_unit_checked:1; u8 ioa_unit_checked:1;
u8 dump_taken:1; u8 dump_taken:1;
u8 scan_enabled:1;
u8 scan_done:1; u8 scan_done:1;
u8 needs_hard_reset:1; u8 needs_hard_reset:1;
u8 dual_raid:1; u8 dual_raid:1;
......
...@@ -3877,7 +3877,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba, ...@@ -3877,7 +3877,7 @@ int lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba,
uint32_t tag; uint32_t tag;
uint16_t hwq; uint16_t hwq;
if (shost_use_blk_mq(cmnd->device->host)) { if (cmnd && shost_use_blk_mq(cmnd->device->host)) {
tag = blk_mq_unique_tag(cmnd->request); tag = blk_mq_unique_tag(cmnd->request);
hwq = blk_mq_unique_tag_to_hwq(tag); hwq = blk_mq_unique_tag_to_hwq(tag);
......
...@@ -1323,21 +1323,18 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -1323,21 +1323,18 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
{ {
lockdep_assert_held(&phba->hbalock); lockdep_assert_held(&phba->hbalock);
BUG_ON(!piocb || !piocb->vport);
list_add_tail(&piocb->list, &pring->txcmplq); list_add_tail(&piocb->list, &pring->txcmplq);
piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ; piocb->iocb_flag |= LPFC_IO_ON_TXCMPLQ;
if ((unlikely(pring->ringno == LPFC_ELS_RING)) && if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
(piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) && (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
(piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) && (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
(!(piocb->vport->load_flag & FC_UNLOADING))) { (!(piocb->vport->load_flag & FC_UNLOADING)))
if (!piocb->vport) mod_timer(&piocb->vport->els_tmofunc,
BUG(); jiffies +
else msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
mod_timer(&piocb->vport->els_tmofunc,
jiffies +
msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册