Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 390f9985 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (22 commits)
  [SCSI] fcoe: fix fcoe in a DCB environment by adding DCB notifiers to set skb priority
  [SCSI] bnx2i: Fixed kernel panic caused by unprotected task->sc->request deref
  [SCSI] qla4xxx: check for failed conn setup
  [SCSI] qla4xxx: a small loop fix
  [SCSI] qla4xxx: fix flash/ddb support
  [SCSI] zfcp: return early from slave_destroy if slave_alloc returned early
  [SCSI] fcoe: Fix preempt count leak in fcoe_filter_frames()
  [SCSI] qla2xxx: Update version number to 8.03.07.12-k.
  [SCSI] qla2xxx: Submit all chained IOCBs for passthrough commands on request queue 0.
  [SCSI] qla2xxx: Correct fc_host port_state display.
  [SCSI] qla2xxx: Disable generating pause frames when firmware hang detected for ISP82xx.
  [SCSI] qla2xxx: Clear mailbox busy flag during premature mailbox completion for ISP82xx.
  [SCSI] qla2xxx: Encapsulate prematurely completing mailbox commands during ISP82xx firmware hang.
  [SCSI] qla2xxx: Display IPE error message for ISP82xx.
  [SCSI] qla2xxx: Return the correct value for a mailbox command if 82xx is in reset recovery.
  [SCSI] qla2xxx: Enable Minidump by default with default capture mask 0x1f.
  [SCSI] qla2xxx: Stop unconditional completion of mailbox commands issued in interrupt mode during firmware hang.
  [SCSI] qla2xxx: Revert back the request queue mapping to request queue 0.
  [SCSI] qla2xxx: Don't call alloc_fw_dump for ISP82XX.
  [SCSI] qla2xxx: Check for SCSI status on underruns.
  ...
parents e34d6b4b 6f6c2aa3
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -55,6 +55,10 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdev)
{
{
	struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
	struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);


	/* if previous slave_alloc returned early, there is nothing to do */
	if (!zfcp_sdev->port)
		return;

	zfcp_erp_lun_shutdown_wait(sdev, "scssd_1");
	zfcp_erp_lun_shutdown_wait(sdev, "scssd_1");
	put_device(&zfcp_sdev->port->dev);
	put_device(&zfcp_sdev->port->dev);
}
}
+3 −2
Original line number Original line Diff line number Diff line
@@ -1906,18 +1906,19 @@ static int bnx2i_queue_scsi_cmd_resp(struct iscsi_session *session,
	spin_lock(&session->lock);
	spin_lock(&session->lock);
	task = iscsi_itt_to_task(bnx2i_conn->cls_conn->dd_data,
	task = iscsi_itt_to_task(bnx2i_conn->cls_conn->dd_data,
				 cqe->itt & ISCSI_CMD_RESPONSE_INDEX);
				 cqe->itt & ISCSI_CMD_RESPONSE_INDEX);
	if (!task) {
	if (!task || !task->sc) {
		spin_unlock(&session->lock);
		spin_unlock(&session->lock);
		return -EINVAL;
		return -EINVAL;
	}
	}
	sc = task->sc;
	sc = task->sc;
	spin_unlock(&session->lock);


	if (!blk_rq_cpu_valid(sc->request))
	if (!blk_rq_cpu_valid(sc->request))
		cpu = smp_processor_id();
		cpu = smp_processor_id();
	else
	else
		cpu = sc->request->cpu;
		cpu = sc->request->cpu;


	spin_unlock(&session->lock);

	p = &per_cpu(bnx2i_percpu, cpu);
	p = &per_cpu(bnx2i_percpu, cpu);
	spin_lock(&p->p_work_lock);
	spin_lock(&p->p_work_lock);
	if (unlikely(!p->iothread)) {
	if (unlikely(!p->iothread)) {
+116 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,8 @@
#include <linux/sysfs.h>
#include <linux/sysfs.h>
#include <linux/ctype.h>
#include <linux/ctype.h>
#include <linux/workqueue.h>
#include <linux/workqueue.h>
#include <net/dcbnl.h>
#include <net/dcbevent.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsicam.h>
#include <scsi/scsicam.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport.h>
@@ -101,6 +103,8 @@ static int fcoe_ddp_done(struct fc_lport *, u16);
static int fcoe_ddp_target(struct fc_lport *, u16, struct scatterlist *,
static int fcoe_ddp_target(struct fc_lport *, u16, struct scatterlist *,
			   unsigned int);
			   unsigned int);
static int fcoe_cpu_callback(struct notifier_block *, unsigned long, void *);
static int fcoe_cpu_callback(struct notifier_block *, unsigned long, void *);
static int fcoe_dcb_app_notification(struct notifier_block *notifier,
				     ulong event, void *ptr);


static bool fcoe_match(struct net_device *netdev);
static bool fcoe_match(struct net_device *netdev);
static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode);
static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode);
@@ -129,6 +133,11 @@ static struct notifier_block fcoe_cpu_notifier = {
	.notifier_call = fcoe_cpu_callback,
	.notifier_call = fcoe_cpu_callback,
};
};


/* notification function for DCB events */
static struct notifier_block dcb_notifier = {
	.notifier_call = fcoe_dcb_app_notification,
};

static struct scsi_transport_template *fcoe_nport_scsi_transport;
static struct scsi_transport_template *fcoe_nport_scsi_transport;
static struct scsi_transport_template *fcoe_vport_scsi_transport;
static struct scsi_transport_template *fcoe_vport_scsi_transport;


@@ -1522,6 +1531,8 @@ int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)
	skb_reset_network_header(skb);
	skb_reset_network_header(skb);
	skb->mac_len = elen;
	skb->mac_len = elen;
	skb->protocol = htons(ETH_P_FCOE);
	skb->protocol = htons(ETH_P_FCOE);
	skb->priority = port->priority;

	if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN &&
	if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN &&
	    fcoe->realdev->features & NETIF_F_HW_VLAN_TX) {
	    fcoe->realdev->features & NETIF_F_HW_VLAN_TX) {
		skb->vlan_tci = VLAN_TAG_PRESENT |
		skb->vlan_tci = VLAN_TAG_PRESENT |
@@ -1624,6 +1635,7 @@ static inline int fcoe_filter_frames(struct fc_lport *lport,
	stats->InvalidCRCCount++;
	stats->InvalidCRCCount++;
	if (stats->InvalidCRCCount < 5)
	if (stats->InvalidCRCCount < 5)
		printk(KERN_WARNING "fcoe: dropping frame with CRC error\n");
		printk(KERN_WARNING "fcoe: dropping frame with CRC error\n");
	put_cpu();
	return -EINVAL;
	return -EINVAL;
}
}


@@ -1746,6 +1758,7 @@ int fcoe_percpu_receive_thread(void *arg)
 */
 */
static void fcoe_dev_setup(void)
static void fcoe_dev_setup(void)
{
{
	register_dcbevent_notifier(&dcb_notifier);
	register_netdevice_notifier(&fcoe_notifier);
	register_netdevice_notifier(&fcoe_notifier);
}
}


@@ -1754,9 +1767,69 @@ static void fcoe_dev_setup(void)
 */
 */
static void fcoe_dev_cleanup(void)
static void fcoe_dev_cleanup(void)
{
{
	unregister_dcbevent_notifier(&dcb_notifier);
	unregister_netdevice_notifier(&fcoe_notifier);
	unregister_netdevice_notifier(&fcoe_notifier);
}
}


static struct fcoe_interface *
fcoe_hostlist_lookup_realdev_port(struct net_device *netdev)
{
	struct fcoe_interface *fcoe;
	struct net_device *real_dev;

	list_for_each_entry(fcoe, &fcoe_hostlist, list) {
		if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN)
			real_dev = vlan_dev_real_dev(fcoe->netdev);
		else
			real_dev = fcoe->netdev;

		if (netdev == real_dev)
			return fcoe;
	}
	return NULL;
}

static int fcoe_dcb_app_notification(struct notifier_block *notifier,
				     ulong event, void *ptr)
{
	struct dcb_app_type *entry = ptr;
	struct fcoe_interface *fcoe;
	struct net_device *netdev;
	struct fcoe_port *port;
	int prio;

	if (entry->app.selector != DCB_APP_IDTYPE_ETHTYPE)
		return NOTIFY_OK;

	netdev = dev_get_by_index(&init_net, entry->ifindex);
	if (!netdev)
		return NOTIFY_OK;

	fcoe = fcoe_hostlist_lookup_realdev_port(netdev);
	dev_put(netdev);
	if (!fcoe)
		return NOTIFY_OK;

	if (entry->dcbx & DCB_CAP_DCBX_VER_CEE)
		prio = ffs(entry->app.priority) - 1;
	else
		prio = entry->app.priority;

	if (prio < 0)
		return NOTIFY_OK;

	if (entry->app.protocol == ETH_P_FIP ||
	    entry->app.protocol == ETH_P_FCOE)
		fcoe->ctlr.priority = prio;

	if (entry->app.protocol == ETH_P_FCOE) {
		port = lport_priv(fcoe->ctlr.lp);
		port->priority = prio;
	}

	return NOTIFY_OK;
}

/**
/**
 * fcoe_device_notification() - Handler for net device events
 * fcoe_device_notification() - Handler for net device events
 * @notifier: The context of the notification
 * @notifier: The context of the notification
@@ -1964,6 +2037,46 @@ static bool fcoe_match(struct net_device *netdev)
	return true;
	return true;
}
}


/**
 * fcoe_dcb_create() - Initialize DCB attributes and hooks
 * @netdev: The net_device object of the L2 link that should be queried
 * @port: The fcoe_port to bind FCoE APP priority with
 * @
 */
static void fcoe_dcb_create(struct fcoe_interface *fcoe)
{
#ifdef CONFIG_DCB
	int dcbx;
	u8 fup, up;
	struct net_device *netdev = fcoe->realdev;
	struct fcoe_port *port = lport_priv(fcoe->ctlr.lp);
	struct dcb_app app = {
				.priority = 0,
				.protocol = ETH_P_FCOE
			     };

	/* setup DCB priority attributes. */
	if (netdev && netdev->dcbnl_ops && netdev->dcbnl_ops->getdcbx) {
		dcbx = netdev->dcbnl_ops->getdcbx(netdev);

		if (dcbx & DCB_CAP_DCBX_VER_IEEE) {
			app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE;
			up = dcb_ieee_getapp_mask(netdev, &app);
			app.protocol = ETH_P_FIP;
			fup = dcb_ieee_getapp_mask(netdev, &app);
		} else {
			app.selector = DCB_APP_IDTYPE_ETHTYPE;
			up = dcb_getapp(netdev, &app);
			app.protocol = ETH_P_FIP;
			fup = dcb_getapp(netdev, &app);
		}

		port->priority = ffs(up) ? ffs(up) - 1 : 0;
		fcoe->ctlr.priority = ffs(fup) ? ffs(fup) - 1 : port->priority;
	}
#endif
}

/**
/**
 * fcoe_create() - Create a fcoe interface
 * fcoe_create() - Create a fcoe interface
 * @netdev  : The net_device object the Ethernet interface to create on
 * @netdev  : The net_device object the Ethernet interface to create on
@@ -2007,6 +2120,9 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
	/* Make this the "master" N_Port */
	/* Make this the "master" N_Port */
	fcoe->ctlr.lp = lport;
	fcoe->ctlr.lp = lport;


	/* setup DCB priority attributes. */
	fcoe_dcb_create(fcoe);

	/* add to lports list */
	/* add to lports list */
	fcoe_hostlist_add(lport);
	fcoe_hostlist_add(lport);


+4 −0
Original line number Original line Diff line number Diff line
@@ -320,6 +320,7 @@ static void fcoe_ctlr_solicit(struct fcoe_ctlr *fip, struct fcoe_fcf *fcf)


	skb_put(skb, sizeof(*sol));
	skb_put(skb, sizeof(*sol));
	skb->protocol = htons(ETH_P_FIP);
	skb->protocol = htons(ETH_P_FIP);
	skb->priority = fip->priority;
	skb_reset_mac_header(skb);
	skb_reset_mac_header(skb);
	skb_reset_network_header(skb);
	skb_reset_network_header(skb);
	fip->send(fip, skb);
	fip->send(fip, skb);
@@ -474,6 +475,7 @@ static void fcoe_ctlr_send_keep_alive(struct fcoe_ctlr *fip,
	}
	}
	skb_put(skb, len);
	skb_put(skb, len);
	skb->protocol = htons(ETH_P_FIP);
	skb->protocol = htons(ETH_P_FIP);
	skb->priority = fip->priority;
	skb_reset_mac_header(skb);
	skb_reset_mac_header(skb);
	skb_reset_network_header(skb);
	skb_reset_network_header(skb);
	fip->send(fip, skb);
	fip->send(fip, skb);
@@ -566,6 +568,7 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip, struct fc_lport *lport,
	cap->fip.fip_dl_len = htons(dlen / FIP_BPW);
	cap->fip.fip_dl_len = htons(dlen / FIP_BPW);


	skb->protocol = htons(ETH_P_FIP);
	skb->protocol = htons(ETH_P_FIP);
	skb->priority = fip->priority;
	skb_reset_mac_header(skb);
	skb_reset_mac_header(skb);
	skb_reset_network_header(skb);
	skb_reset_network_header(skb);
	return 0;
	return 0;
@@ -1911,6 +1914,7 @@ static void fcoe_ctlr_vn_send(struct fcoe_ctlr *fip,


	skb_put(skb, len);
	skb_put(skb, len);
	skb->protocol = htons(ETH_P_FIP);
	skb->protocol = htons(ETH_P_FIP);
	skb->priority = fip->priority;
	skb_reset_mac_header(skb);
	skb_reset_mac_header(skb);
	skb_reset_network_header(skb);
	skb_reset_network_header(skb);


+1 −1
Original line number Original line Diff line number Diff line
@@ -4335,7 +4335,7 @@ _scsih_smart_predicted_fault(struct MPT2SAS_ADAPTER *ioc, u16 handle)
	/* insert into event log */
	/* insert into event log */
	sz = offsetof(Mpi2EventNotificationReply_t, EventData) +
	sz = offsetof(Mpi2EventNotificationReply_t, EventData) +
	     sizeof(Mpi2EventDataSasDeviceStatusChange_t);
	     sizeof(Mpi2EventDataSasDeviceStatusChange_t);
	event_reply = kzalloc(sz, GFP_KERNEL);
	event_reply = kzalloc(sz, GFP_ATOMIC);
	if (!event_reply) {
	if (!event_reply) {
		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
		printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
		    ioc->name, __FILE__, __LINE__, __func__);
		    ioc->name, __FILE__, __LINE__, __func__);
Loading