You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This is mostly updates to the usual drivers: ufs, qedf, mpt3sas, lpfc, xfcp, hisi_sas, cxlflash, qla2xxx. In the absence of Nic, we're also taking target updates which are mostly minor except for the tcmu refactor. The only real core change to worry about is the removal of high page bouncing (in sas, storvsc and iscsi). This has been well tested and no problems have shown up so far" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (268 commits) scsi: lpfc: update driver version to 12.0.0.4 scsi: lpfc: Fix port initialization failure. scsi: lpfc: Fix 16gb hbas failing cq create. scsi: lpfc: Fix crash in blk_mq layer when executing modprobe -r lpfc scsi: lpfc: correct oversubscription of nvme io requests for an adapter scsi: lpfc: Fix MDS diagnostics failure (Rx < Tx) scsi: hisi_sas: Mark PHY as in reset for nexus reset scsi: hisi_sas: Fix return value when get_free_slot() failed scsi: hisi_sas: Terminate STP reject quickly for v2 hw scsi: hisi_sas: Add v2 hw force PHY function for internal ATA command scsi: hisi_sas: Include TMF elements in struct hisi_sas_slot scsi: hisi_sas: Try wait commands before before controller reset scsi: hisi_sas: Init disks after controller reset scsi: hisi_sas: Create a scsi_host_template per HW module scsi: hisi_sas: Reset disks when discovered scsi: hisi_sas: Add LED feature for v3 hw scsi: hisi_sas: Change common allocation mode of device id scsi: hisi_sas: change slot index allocation mode scsi: hisi_sas: Introduce hisi_sas_phy_set_linkrate() scsi: hisi_sas: fix a typo in hisi_sas_task_prep() ...
This commit is contained in:
@@ -36,6 +36,7 @@ available subsections can be seen below.
|
|||||||
edac
|
edac
|
||||||
scsi
|
scsi
|
||||||
libata
|
libata
|
||||||
|
target
|
||||||
mtdnand
|
mtdnand
|
||||||
miscellaneous
|
miscellaneous
|
||||||
w1
|
w1
|
||||||
|
|||||||
@@ -334,5 +334,5 @@ todo
|
|||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
|
Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
|
||||||
FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
|
FireWire, ATAPI devices, Infiniband, I2O, Parallel ports,
|
||||||
netlink...
|
netlink...
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
=================================
|
||||||
|
target and iSCSI Interfaces Guide
|
||||||
|
=================================
|
||||||
|
|
||||||
|
Introduction and Overview
|
||||||
|
=========================
|
||||||
|
|
||||||
|
TBD
|
||||||
|
|
||||||
|
Target core device interfaces
|
||||||
|
=============================
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/target/target_core_device.c
|
||||||
|
:export:
|
||||||
|
|
||||||
|
Target core transport interfaces
|
||||||
|
================================
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/target/target_core_transport.c
|
||||||
|
:export:
|
||||||
|
|
||||||
|
Target-supported userspace I/O
|
||||||
|
==============================
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/target/target_core_user.c
|
||||||
|
:doc: Userspace I/O
|
||||||
|
|
||||||
|
.. kernel-doc:: include/uapi/linux/target_core_user.h
|
||||||
|
:doc: Ring Design
|
||||||
|
|
||||||
|
iSCSI helper functions
|
||||||
|
======================
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/scsi/libiscsi.c
|
||||||
|
:export:
|
||||||
|
|
||||||
|
|
||||||
|
iSCSI boot information
|
||||||
|
======================
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/scsi/iscsi_boot_sysfs.c
|
||||||
|
:export:
|
||||||
|
|
||||||
|
|
||||||
|
iSCSI transport class
|
||||||
|
=====================
|
||||||
|
|
||||||
|
The file drivers/scsi/scsi_transport_iscsi.c defines transport
|
||||||
|
attributes for the iSCSI class, which sends SCSI packets over TCP/IP
|
||||||
|
connections.
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/scsi/scsi_transport_iscsi.c
|
||||||
|
:export:
|
||||||
|
|
||||||
|
|
||||||
|
iSCSI TCP interfaces
|
||||||
|
====================
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/scsi/iscsi_tcp.c
|
||||||
|
:internal:
|
||||||
|
|
||||||
|
.. kernel-doc:: drivers/scsi/libiscsi_tcp.c
|
||||||
|
:export:
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ Code Seq#(hex) Include File Comments
|
|||||||
'J' 00-1F drivers/scsi/gdth_ioctl.h
|
'J' 00-1F drivers/scsi/gdth_ioctl.h
|
||||||
'K' all linux/kd.h
|
'K' all linux/kd.h
|
||||||
'L' 00-1F linux/loop.h conflict!
|
'L' 00-1F linux/loop.h conflict!
|
||||||
'L' 10-1F drivers/scsi/mpt2sas/mpt2sas_ctl.h conflict!
|
'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
|
||||||
'L' 20-2F linux/lightnvm.h
|
'L' 20-2F linux/lightnvm.h
|
||||||
'L' E0-FF linux/ppdd.h encrypted disk device driver
|
'L' E0-FF linux/ppdd.h encrypted disk device driver
|
||||||
<http://linux01.gwdg.de/~alatham/ppdd.html>
|
<http://linux01.gwdg.de/~alatham/ppdd.html>
|
||||||
|
|||||||
@@ -8446,7 +8446,6 @@ L: linux-scsi@vger.kernel.org
|
|||||||
W: http://www.avagotech.com/support/
|
W: http://www.avagotech.com/support/
|
||||||
S: Supported
|
S: Supported
|
||||||
F: drivers/message/fusion/
|
F: drivers/message/fusion/
|
||||||
F: drivers/scsi/mpt2sas/
|
|
||||||
F: drivers/scsi/mpt3sas/
|
F: drivers/scsi/mpt3sas/
|
||||||
|
|
||||||
LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
|
LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
|
||||||
|
|||||||
@@ -5054,6 +5054,18 @@ int ata_sas_port_init(struct ata_port *ap)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(ata_sas_port_init);
|
EXPORT_SYMBOL_GPL(ata_sas_port_init);
|
||||||
|
|
||||||
|
int ata_sas_tport_add(struct device *parent, struct ata_port *ap)
|
||||||
|
{
|
||||||
|
return ata_tport_add(parent, ap);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(ata_sas_tport_add);
|
||||||
|
|
||||||
|
void ata_sas_tport_delete(struct ata_port *ap)
|
||||||
|
{
|
||||||
|
ata_tport_delete(ap);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(ata_sas_tport_delete);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ata_sas_port_destroy - Destroy a SATA port allocated by ata_sas_port_alloc
|
* ata_sas_port_destroy - Destroy a SATA port allocated by ata_sas_port_alloc
|
||||||
* @ap: SATA port to destroy
|
* @ap: SATA port to destroy
|
||||||
|
|||||||
@@ -227,6 +227,8 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
|
|||||||
ring_info->ring_buffer->feature_bits.value = 1;
|
ring_info->ring_buffer->feature_bits.value = 1;
|
||||||
|
|
||||||
ring_info->ring_size = page_cnt << PAGE_SHIFT;
|
ring_info->ring_size = page_cnt << PAGE_SHIFT;
|
||||||
|
ring_info->ring_size_div10_reciprocal =
|
||||||
|
reciprocal_value(ring_info->ring_size / 10);
|
||||||
ring_info->ring_datasize = ring_info->ring_size -
|
ring_info->ring_datasize = ring_info->ring_size -
|
||||||
sizeof(struct hv_ring_buffer);
|
sizeof(struct hv_ring_buffer);
|
||||||
|
|
||||||
|
|||||||
@@ -1802,13 +1802,13 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
|
|||||||
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_2 (0x00000002)
|
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_2 (0x00000002)
|
||||||
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_3 (0x00000004)
|
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_3 (0x00000004)
|
||||||
|
|
||||||
#define MPI_FCPORTPAGE0_SUPPORT_SPEED_UKNOWN (0x00000000) /* (SNIA)HBA_PORTSPEED_UNKNOWN 0 Unknown - transceiver incapable of reporting */
|
#define MPI_FCPORTPAGE0_SUPPORT_SPEED_UNKNOWN (0x00000000) /* (SNIA)HBA_PORTSPEED_UNKNOWN 0 Unknown - transceiver incapable of reporting */
|
||||||
#define MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED (0x00000001) /* (SNIA)HBA_PORTSPEED_1GBIT 1 1 GBit/sec */
|
#define MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED (0x00000001) /* (SNIA)HBA_PORTSPEED_1GBIT 1 1 GBit/sec */
|
||||||
#define MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED (0x00000002) /* (SNIA)HBA_PORTSPEED_2GBIT 2 2 GBit/sec */
|
#define MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED (0x00000002) /* (SNIA)HBA_PORTSPEED_2GBIT 2 2 GBit/sec */
|
||||||
#define MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED (0x00000004) /* (SNIA)HBA_PORTSPEED_10GBIT 4 10 GBit/sec */
|
#define MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED (0x00000004) /* (SNIA)HBA_PORTSPEED_10GBIT 4 10 GBit/sec */
|
||||||
#define MPI_FCPORTPAGE0_SUPPORT_4GBIT_SPEED (0x00000008) /* (SNIA)HBA_PORTSPEED_4GBIT 8 4 GBit/sec */
|
#define MPI_FCPORTPAGE0_SUPPORT_4GBIT_SPEED (0x00000008) /* (SNIA)HBA_PORTSPEED_4GBIT 8 4 GBit/sec */
|
||||||
|
|
||||||
#define MPI_FCPORTPAGE0_CURRENT_SPEED_UKNOWN MPI_FCPORTPAGE0_SUPPORT_SPEED_UKNOWN
|
#define MPI_FCPORTPAGE0_CURRENT_SPEED_UNKNOWN MPI_FCPORTPAGE0_SUPPORT_SPEED_UNKNOWN
|
||||||
#define MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED
|
#define MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED
|
||||||
#define MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED
|
#define MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED
|
||||||
#define MPI_FCPORTPAGE0_CURRENT_SPEED_10GBIT MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED
|
#define MPI_FCPORTPAGE0_CURRENT_SPEED_10GBIT MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED
|
||||||
|
|||||||
@@ -7600,7 +7600,7 @@ mpt_display_event_info(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply)
|
|||||||
|
|
||||||
snprintf(evStr, EVENT_DESCR_STR_SZ,
|
snprintf(evStr, EVENT_DESCR_STR_SZ,
|
||||||
"SAS Initiator Device Table Overflow: max initiators=%02d "
|
"SAS Initiator Device Table Overflow: max initiators=%02d "
|
||||||
"current initators=%02d",
|
"current initiators=%02d",
|
||||||
max_init, current_init);
|
max_init, current_init);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -693,7 +693,7 @@ mptfc_display_port_link_speed(MPT_ADAPTER *ioc, int portnum, FCPortPage0_t *pp0d
|
|||||||
state = pp0dest->PortState;
|
state = pp0dest->PortState;
|
||||||
|
|
||||||
if (state != MPI_FCPORTPAGE0_PORTSTATE_OFFLINE &&
|
if (state != MPI_FCPORTPAGE0_PORTSTATE_OFFLINE &&
|
||||||
new_speed != MPI_FCPORTPAGE0_CURRENT_SPEED_UKNOWN) {
|
new_speed != MPI_FCPORTPAGE0_CURRENT_SPEED_UNKNOWN) {
|
||||||
|
|
||||||
old = old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT ? "1 Gbps" :
|
old = old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT ? "1 Gbps" :
|
||||||
old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT ? "2 Gbps" :
|
old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT ? "2 Gbps" :
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
||||||
static int
|
static netdev_tx_t
|
||||||
mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct mpt_lan_priv *priv = netdev_priv(dev);
|
struct mpt_lan_priv *priv = netdev_priv(dev);
|
||||||
|
|||||||
@@ -4320,7 +4320,7 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
|
|||||||
if (ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID ==
|
if (ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID ==
|
||||||
hot_plug_info->id) {
|
hot_plug_info->id) {
|
||||||
printk(MYIOC_s_WARN_FMT "firmware bug: unable "
|
printk(MYIOC_s_WARN_FMT "firmware bug: unable "
|
||||||
"to add hidden disk - target_id matchs "
|
"to add hidden disk - target_id matches "
|
||||||
"volume_id\n", ioc->name);
|
"volume_id\n", ioc->name);
|
||||||
mptsas_free_fw_event(ioc, fw_event);
|
mptsas_free_fw_event(ioc, fw_event);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -189,7 +189,6 @@ struct netvsc_device;
|
|||||||
struct net_device_context;
|
struct net_device_context;
|
||||||
|
|
||||||
extern u32 netvsc_ring_bytes;
|
extern u32 netvsc_ring_bytes;
|
||||||
extern struct reciprocal_value netvsc_ring_reciprocal;
|
|
||||||
|
|
||||||
struct netvsc_device *netvsc_device_add(struct hv_device *device,
|
struct netvsc_device *netvsc_device_add(struct hv_device *device,
|
||||||
const struct netvsc_device_info *info);
|
const struct netvsc_device_info *info);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
#include <linux/prefetch.h>
|
#include <linux/prefetch.h>
|
||||||
#include <linux/reciprocal_div.h>
|
|
||||||
|
|
||||||
#include <asm/sync_bitops.h>
|
#include <asm/sync_bitops.h>
|
||||||
|
|
||||||
@@ -635,17 +634,6 @@ void netvsc_device_remove(struct hv_device *device)
|
|||||||
#define RING_AVAIL_PERCENT_HIWATER 20
|
#define RING_AVAIL_PERCENT_HIWATER 20
|
||||||
#define RING_AVAIL_PERCENT_LOWATER 10
|
#define RING_AVAIL_PERCENT_LOWATER 10
|
||||||
|
|
||||||
/*
|
|
||||||
* Get the percentage of available bytes to write in the ring.
|
|
||||||
* The return value is in range from 0 to 100.
|
|
||||||
*/
|
|
||||||
static u32 hv_ringbuf_avail_percent(const struct hv_ring_buffer_info *ring_info)
|
|
||||||
{
|
|
||||||
u32 avail_write = hv_get_bytes_to_write(ring_info);
|
|
||||||
|
|
||||||
return reciprocal_divide(avail_write * 100, netvsc_ring_reciprocal);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
|
static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
|
||||||
u32 index)
|
u32 index)
|
||||||
{
|
{
|
||||||
@@ -694,8 +682,8 @@ static void netvsc_send_tx_complete(struct net_device *ndev,
|
|||||||
struct netdev_queue *txq = netdev_get_tx_queue(ndev, q_idx);
|
struct netdev_queue *txq = netdev_get_tx_queue(ndev, q_idx);
|
||||||
|
|
||||||
if (netif_tx_queue_stopped(txq) &&
|
if (netif_tx_queue_stopped(txq) &&
|
||||||
(hv_ringbuf_avail_percent(&channel->outbound) > RING_AVAIL_PERCENT_HIWATER ||
|
(hv_get_avail_to_write_percent(&channel->outbound) >
|
||||||
queue_sends < 1)) {
|
RING_AVAIL_PERCENT_HIWATER || queue_sends < 1)) {
|
||||||
netif_tx_wake_queue(txq);
|
netif_tx_wake_queue(txq);
|
||||||
ndev_ctx->eth_stats.wake_queue++;
|
ndev_ctx->eth_stats.wake_queue++;
|
||||||
}
|
}
|
||||||
@@ -802,7 +790,7 @@ static inline int netvsc_send_pkt(
|
|||||||
struct netdev_queue *txq = netdev_get_tx_queue(ndev, packet->q_idx);
|
struct netdev_queue *txq = netdev_get_tx_queue(ndev, packet->q_idx);
|
||||||
u64 req_id;
|
u64 req_id;
|
||||||
int ret;
|
int ret;
|
||||||
u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound);
|
u32 ring_avail = hv_get_avail_to_write_percent(&out_channel->outbound);
|
||||||
|
|
||||||
nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
|
nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
|
||||||
if (skb)
|
if (skb)
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
#include <linux/netpoll.h>
|
#include <linux/netpoll.h>
|
||||||
#include <linux/reciprocal_div.h>
|
|
||||||
|
|
||||||
#include <net/arp.h>
|
#include <net/arp.h>
|
||||||
#include <net/route.h>
|
#include <net/route.h>
|
||||||
@@ -59,7 +58,6 @@ static unsigned int ring_size __ro_after_init = 128;
|
|||||||
module_param(ring_size, uint, 0444);
|
module_param(ring_size, uint, 0444);
|
||||||
MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
|
MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
|
||||||
unsigned int netvsc_ring_bytes __ro_after_init;
|
unsigned int netvsc_ring_bytes __ro_after_init;
|
||||||
struct reciprocal_value netvsc_ring_reciprocal __ro_after_init;
|
|
||||||
|
|
||||||
static const u32 default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
|
static const u32 default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
|
||||||
NETIF_MSG_LINK | NETIF_MSG_IFUP |
|
NETIF_MSG_LINK | NETIF_MSG_IFUP |
|
||||||
@@ -2130,7 +2128,6 @@ static int __init netvsc_drv_init(void)
|
|||||||
ring_size);
|
ring_size);
|
||||||
}
|
}
|
||||||
netvsc_ring_bytes = ring_size * PAGE_SIZE;
|
netvsc_ring_bytes = ring_size * PAGE_SIZE;
|
||||||
netvsc_ring_reciprocal = reciprocal_value(netvsc_ring_bytes);
|
|
||||||
|
|
||||||
ret = vmbus_driver_register(&netvsc_drv);
|
ret = vmbus_driver_register(&netvsc_drv);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|||||||
@@ -285,6 +285,8 @@ void zfcp_dbf_rec_trig(char *tag, struct zfcp_adapter *adapter,
|
|||||||
struct list_head *entry;
|
struct list_head *entry;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
lockdep_assert_held(&adapter->erp_lock);
|
||||||
|
|
||||||
if (unlikely(!debug_level_enabled(dbf->rec, level)))
|
if (unlikely(!debug_level_enabled(dbf->rec, level)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -599,16 +601,18 @@ void zfcp_dbf_san_in_els(char *tag, struct zfcp_fsf_req *fsf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* zfcp_dbf_scsi - trace event for scsi commands
|
* zfcp_dbf_scsi_common() - Common trace event helper for scsi.
|
||||||
* @tag: identifier for event
|
* @tag: Identifier for event.
|
||||||
* @sc: pointer to struct scsi_cmnd
|
* @level: trace level of event.
|
||||||
* @fsf: pointer to struct zfcp_fsf_req
|
* @sdev: Pointer to SCSI device as context for this event.
|
||||||
|
* @sc: Pointer to SCSI command, or NULL with task management function (TMF).
|
||||||
|
* @fsf: Pointer to FSF request, or NULL.
|
||||||
*/
|
*/
|
||||||
void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
|
void zfcp_dbf_scsi_common(char *tag, int level, struct scsi_device *sdev,
|
||||||
struct zfcp_fsf_req *fsf)
|
struct scsi_cmnd *sc, struct zfcp_fsf_req *fsf)
|
||||||
{
|
{
|
||||||
struct zfcp_adapter *adapter =
|
struct zfcp_adapter *adapter =
|
||||||
(struct zfcp_adapter *) sc->device->host->hostdata[0];
|
(struct zfcp_adapter *) sdev->host->hostdata[0];
|
||||||
struct zfcp_dbf *dbf = adapter->dbf;
|
struct zfcp_dbf *dbf = adapter->dbf;
|
||||||
struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
|
struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
|
||||||
struct fcp_resp_with_ext *fcp_rsp;
|
struct fcp_resp_with_ext *fcp_rsp;
|
||||||
@@ -620,6 +624,7 @@ void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
|
|||||||
|
|
||||||
memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
|
memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
|
||||||
rec->id = ZFCP_DBF_SCSI_CMND;
|
rec->id = ZFCP_DBF_SCSI_CMND;
|
||||||
|
if (sc) {
|
||||||
rec->scsi_result = sc->result;
|
rec->scsi_result = sc->result;
|
||||||
rec->scsi_retries = sc->retries;
|
rec->scsi_retries = sc->retries;
|
||||||
rec->scsi_allowed = sc->allowed;
|
rec->scsi_allowed = sc->allowed;
|
||||||
@@ -629,7 +634,18 @@ void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
|
|||||||
rec->host_scribble = (unsigned long)sc->host_scribble;
|
rec->host_scribble = (unsigned long)sc->host_scribble;
|
||||||
|
|
||||||
memcpy(rec->scsi_opcode, sc->cmnd,
|
memcpy(rec->scsi_opcode, sc->cmnd,
|
||||||
min((int)sc->cmd_len, ZFCP_DBF_SCSI_OPCODE));
|
min_t(int, sc->cmd_len, ZFCP_DBF_SCSI_OPCODE));
|
||||||
|
} else {
|
||||||
|
rec->scsi_result = ~0;
|
||||||
|
rec->scsi_retries = ~0;
|
||||||
|
rec->scsi_allowed = ~0;
|
||||||
|
rec->scsi_id = sdev->id;
|
||||||
|
rec->scsi_lun = (u32)sdev->lun;
|
||||||
|
rec->scsi_lun_64_hi = (u32)(sdev->lun >> 32);
|
||||||
|
rec->host_scribble = ~0;
|
||||||
|
|
||||||
|
memset(rec->scsi_opcode, 0xff, ZFCP_DBF_SCSI_OPCODE);
|
||||||
|
}
|
||||||
|
|
||||||
if (fsf) {
|
if (fsf) {
|
||||||
rec->fsf_req_id = fsf->req_id;
|
rec->fsf_req_id = fsf->req_id;
|
||||||
@@ -664,6 +680,46 @@ void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
|
|||||||
spin_unlock_irqrestore(&dbf->scsi_lock, flags);
|
spin_unlock_irqrestore(&dbf->scsi_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zfcp_dbf_scsi_eh() - Trace event for special cases of scsi_eh callbacks.
|
||||||
|
* @tag: Identifier for event.
|
||||||
|
* @adapter: Pointer to zfcp adapter as context for this event.
|
||||||
|
* @scsi_id: SCSI ID/target to indicate scope of task management function (TMF).
|
||||||
|
* @ret: Return value of calling function.
|
||||||
|
*
|
||||||
|
* This SCSI trace variant does not depend on any of:
|
||||||
|
* scsi_cmnd, zfcp_fsf_req, scsi_device.
|
||||||
|
*/
|
||||||
|
void zfcp_dbf_scsi_eh(char *tag, struct zfcp_adapter *adapter,
|
||||||
|
unsigned int scsi_id, int ret)
|
||||||
|
{
|
||||||
|
struct zfcp_dbf *dbf = adapter->dbf;
|
||||||
|
struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
|
||||||
|
unsigned long flags;
|
||||||
|
static int const level = 1;
|
||||||
|
|
||||||
|
if (unlikely(!debug_level_enabled(adapter->dbf->scsi, level)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dbf->scsi_lock, flags);
|
||||||
|
memset(rec, 0, sizeof(*rec));
|
||||||
|
|
||||||
|
memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
|
||||||
|
rec->id = ZFCP_DBF_SCSI_CMND;
|
||||||
|
rec->scsi_result = ret; /* re-use field, int is 4 bytes and fits */
|
||||||
|
rec->scsi_retries = ~0;
|
||||||
|
rec->scsi_allowed = ~0;
|
||||||
|
rec->fcp_rsp_info = ~0;
|
||||||
|
rec->scsi_id = scsi_id;
|
||||||
|
rec->scsi_lun = (u32)ZFCP_DBF_INVALID_LUN;
|
||||||
|
rec->scsi_lun_64_hi = (u32)(ZFCP_DBF_INVALID_LUN >> 32);
|
||||||
|
rec->host_scribble = ~0;
|
||||||
|
memset(rec->scsi_opcode, 0xff, ZFCP_DBF_SCSI_OPCODE);
|
||||||
|
|
||||||
|
debug_event(dbf->scsi, level, rec, sizeof(*rec));
|
||||||
|
spin_unlock_irqrestore(&dbf->scsi_lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
static debug_info_t *zfcp_dbf_reg(const char *name, int size, int rec_size)
|
static debug_info_t *zfcp_dbf_reg(const char *name, int size, int rec_size)
|
||||||
{
|
{
|
||||||
struct debug_info *d;
|
struct debug_info *d;
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ void _zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *scmd,
|
|||||||
scmd->device->host->hostdata[0];
|
scmd->device->host->hostdata[0];
|
||||||
|
|
||||||
if (debug_level_enabled(adapter->dbf->scsi, level))
|
if (debug_level_enabled(adapter->dbf->scsi, level))
|
||||||
zfcp_dbf_scsi(tag, level, scmd, req);
|
zfcp_dbf_scsi_common(tag, level, scmd->device, scmd, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -402,16 +402,23 @@ void zfcp_dbf_scsi_abort(char *tag, struct scsi_cmnd *scmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* zfcp_dbf_scsi_devreset - trace event for Logical Unit or Target Reset
|
* zfcp_dbf_scsi_devreset() - Trace event for Logical Unit or Target Reset.
|
||||||
* @tag: tag indicating success or failure of reset operation
|
* @tag: Tag indicating success or failure of reset operation.
|
||||||
* @scmnd: SCSI command which caused this error recovery
|
* @sdev: Pointer to SCSI device as context for this event.
|
||||||
* @flag: indicates type of reset (Target Reset, Logical Unit Reset)
|
* @flag: Indicates type of reset (Target Reset, Logical Unit Reset).
|
||||||
|
* @fsf_req: Pointer to FSF request representing the TMF, or NULL.
|
||||||
*/
|
*/
|
||||||
static inline
|
static inline
|
||||||
void zfcp_dbf_scsi_devreset(char *tag, struct scsi_cmnd *scmnd, u8 flag,
|
void zfcp_dbf_scsi_devreset(char *tag, struct scsi_device *sdev, u8 flag,
|
||||||
struct zfcp_fsf_req *fsf_req)
|
struct zfcp_fsf_req *fsf_req)
|
||||||
{
|
{
|
||||||
|
struct zfcp_adapter *adapter = (struct zfcp_adapter *)
|
||||||
|
sdev->host->hostdata[0];
|
||||||
char tmp_tag[ZFCP_DBF_TAG_LEN];
|
char tmp_tag[ZFCP_DBF_TAG_LEN];
|
||||||
|
static int const level = 1;
|
||||||
|
|
||||||
|
if (unlikely(!debug_level_enabled(adapter->dbf->scsi, level)))
|
||||||
|
return;
|
||||||
|
|
||||||
if (flag == FCP_TMF_TGT_RESET)
|
if (flag == FCP_TMF_TGT_RESET)
|
||||||
memcpy(tmp_tag, "tr_", 3);
|
memcpy(tmp_tag, "tr_", 3);
|
||||||
@@ -419,7 +426,7 @@ void zfcp_dbf_scsi_devreset(char *tag, struct scsi_cmnd *scmnd, u8 flag,
|
|||||||
memcpy(tmp_tag, "lr_", 3);
|
memcpy(tmp_tag, "lr_", 3);
|
||||||
|
|
||||||
memcpy(&tmp_tag[3], tag, 4);
|
memcpy(&tmp_tag[3], tag, 4);
|
||||||
_zfcp_dbf_scsi(tmp_tag, 1, scmnd, fsf_req);
|
zfcp_dbf_scsi_common(tmp_tag, level, sdev, NULL, fsf_req);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+124
-56
@@ -19,7 +19,6 @@
|
|||||||
enum zfcp_erp_act_flags {
|
enum zfcp_erp_act_flags {
|
||||||
ZFCP_STATUS_ERP_TIMEDOUT = 0x10000000,
|
ZFCP_STATUS_ERP_TIMEDOUT = 0x10000000,
|
||||||
ZFCP_STATUS_ERP_CLOSE_ONLY = 0x01000000,
|
ZFCP_STATUS_ERP_CLOSE_ONLY = 0x01000000,
|
||||||
ZFCP_STATUS_ERP_DISMISSING = 0x00100000,
|
|
||||||
ZFCP_STATUS_ERP_DISMISSED = 0x00200000,
|
ZFCP_STATUS_ERP_DISMISSED = 0x00200000,
|
||||||
ZFCP_STATUS_ERP_LOWMEM = 0x00400000,
|
ZFCP_STATUS_ERP_LOWMEM = 0x00400000,
|
||||||
ZFCP_STATUS_ERP_NO_REF = 0x00800000,
|
ZFCP_STATUS_ERP_NO_REF = 0x00800000,
|
||||||
@@ -27,7 +26,6 @@ enum zfcp_erp_act_flags {
|
|||||||
|
|
||||||
enum zfcp_erp_steps {
|
enum zfcp_erp_steps {
|
||||||
ZFCP_ERP_STEP_UNINITIALIZED = 0x0000,
|
ZFCP_ERP_STEP_UNINITIALIZED = 0x0000,
|
||||||
ZFCP_ERP_STEP_FSF_XCONFIG = 0x0001,
|
|
||||||
ZFCP_ERP_STEP_PHYS_PORT_CLOSING = 0x0010,
|
ZFCP_ERP_STEP_PHYS_PORT_CLOSING = 0x0010,
|
||||||
ZFCP_ERP_STEP_PORT_CLOSING = 0x0100,
|
ZFCP_ERP_STEP_PORT_CLOSING = 0x0100,
|
||||||
ZFCP_ERP_STEP_PORT_OPENING = 0x0800,
|
ZFCP_ERP_STEP_PORT_OPENING = 0x0800,
|
||||||
@@ -35,16 +33,28 @@ enum zfcp_erp_steps {
|
|||||||
ZFCP_ERP_STEP_LUN_OPENING = 0x2000,
|
ZFCP_ERP_STEP_LUN_OPENING = 0x2000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum zfcp_erp_act_type - Type of ERP action object.
|
||||||
|
* @ZFCP_ERP_ACTION_REOPEN_LUN: LUN recovery.
|
||||||
|
* @ZFCP_ERP_ACTION_REOPEN_PORT: Port recovery.
|
||||||
|
* @ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: Forced port recovery.
|
||||||
|
* @ZFCP_ERP_ACTION_REOPEN_ADAPTER: Adapter recovery.
|
||||||
|
* @ZFCP_ERP_ACTION_NONE: Eyecatcher pseudo flag to bitwise or-combine with
|
||||||
|
* either of the first four enum values.
|
||||||
|
* Used to indicate that an ERP action could not be
|
||||||
|
* set up despite a detected need for some recovery.
|
||||||
|
* @ZFCP_ERP_ACTION_FAILED: Eyecatcher pseudo flag to bitwise or-combine with
|
||||||
|
* either of the first four enum values.
|
||||||
|
* Used to indicate that ERP not needed because
|
||||||
|
* the object has ZFCP_STATUS_COMMON_ERP_FAILED.
|
||||||
|
*/
|
||||||
enum zfcp_erp_act_type {
|
enum zfcp_erp_act_type {
|
||||||
ZFCP_ERP_ACTION_REOPEN_LUN = 1,
|
ZFCP_ERP_ACTION_REOPEN_LUN = 1,
|
||||||
ZFCP_ERP_ACTION_REOPEN_PORT = 2,
|
ZFCP_ERP_ACTION_REOPEN_PORT = 2,
|
||||||
ZFCP_ERP_ACTION_REOPEN_PORT_FORCED = 3,
|
ZFCP_ERP_ACTION_REOPEN_PORT_FORCED = 3,
|
||||||
ZFCP_ERP_ACTION_REOPEN_ADAPTER = 4,
|
ZFCP_ERP_ACTION_REOPEN_ADAPTER = 4,
|
||||||
};
|
ZFCP_ERP_ACTION_NONE = 0xc0,
|
||||||
|
ZFCP_ERP_ACTION_FAILED = 0xe0,
|
||||||
enum zfcp_erp_act_state {
|
|
||||||
ZFCP_ERP_ACTION_RUNNING = 1,
|
|
||||||
ZFCP_ERP_ACTION_READY = 2,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum zfcp_erp_act_result {
|
enum zfcp_erp_act_result {
|
||||||
@@ -62,14 +72,14 @@ static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask)
|
|||||||
ZFCP_STATUS_COMMON_UNBLOCKED | mask);
|
ZFCP_STATUS_COMMON_UNBLOCKED | mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zfcp_erp_action_exists(struct zfcp_erp_action *act)
|
static bool zfcp_erp_action_is_running(struct zfcp_erp_action *act)
|
||||||
{
|
{
|
||||||
struct zfcp_erp_action *curr_act;
|
struct zfcp_erp_action *curr_act;
|
||||||
|
|
||||||
list_for_each_entry(curr_act, &act->adapter->erp_running_head, list)
|
list_for_each_entry(curr_act, &act->adapter->erp_running_head, list)
|
||||||
if (act == curr_act)
|
if (act == curr_act)
|
||||||
return ZFCP_ERP_ACTION_RUNNING;
|
return true;
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zfcp_erp_action_ready(struct zfcp_erp_action *act)
|
static void zfcp_erp_action_ready(struct zfcp_erp_action *act)
|
||||||
@@ -85,7 +95,7 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act)
|
|||||||
static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act)
|
static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act)
|
||||||
{
|
{
|
||||||
act->status |= ZFCP_STATUS_ERP_DISMISSED;
|
act->status |= ZFCP_STATUS_ERP_DISMISSED;
|
||||||
if (zfcp_erp_action_exists(act) == ZFCP_ERP_ACTION_RUNNING)
|
if (zfcp_erp_action_is_running(act))
|
||||||
zfcp_erp_action_ready(act);
|
zfcp_erp_action_ready(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +136,49 @@ static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int zfcp_erp_handle_failed(int want, struct zfcp_adapter *adapter,
|
||||||
|
struct zfcp_port *port,
|
||||||
|
struct scsi_device *sdev)
|
||||||
|
{
|
||||||
|
int need = want;
|
||||||
|
struct zfcp_scsi_dev *zsdev;
|
||||||
|
|
||||||
|
switch (want) {
|
||||||
|
case ZFCP_ERP_ACTION_REOPEN_LUN:
|
||||||
|
zsdev = sdev_to_zfcp(sdev);
|
||||||
|
if (atomic_read(&zsdev->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
|
||||||
|
need = 0;
|
||||||
|
break;
|
||||||
|
case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
|
||||||
|
if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
|
||||||
|
need = 0;
|
||||||
|
break;
|
||||||
|
case ZFCP_ERP_ACTION_REOPEN_PORT:
|
||||||
|
if (atomic_read(&port->status) &
|
||||||
|
ZFCP_STATUS_COMMON_ERP_FAILED) {
|
||||||
|
need = 0;
|
||||||
|
/* ensure propagation of failed status to new devices */
|
||||||
|
zfcp_erp_set_port_status(
|
||||||
|
port, ZFCP_STATUS_COMMON_ERP_FAILED);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
|
||||||
|
if (atomic_read(&adapter->status) &
|
||||||
|
ZFCP_STATUS_COMMON_ERP_FAILED) {
|
||||||
|
need = 0;
|
||||||
|
/* ensure propagation of failed status to new devices */
|
||||||
|
zfcp_erp_set_adapter_status(
|
||||||
|
adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
need = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return need;
|
||||||
|
}
|
||||||
|
|
||||||
static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter,
|
static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter,
|
||||||
struct zfcp_port *port,
|
struct zfcp_port *port,
|
||||||
struct scsi_device *sdev)
|
struct scsi_device *sdev)
|
||||||
@@ -241,47 +294,69 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
|
|||||||
return erp_action;
|
return erp_action;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter,
|
static void zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter,
|
||||||
struct zfcp_port *port,
|
struct zfcp_port *port,
|
||||||
struct scsi_device *sdev,
|
struct scsi_device *sdev,
|
||||||
char *id, u32 act_status)
|
char *id, u32 act_status)
|
||||||
{
|
{
|
||||||
int retval = 1, need;
|
int need;
|
||||||
struct zfcp_erp_action *act;
|
struct zfcp_erp_action *act;
|
||||||
|
|
||||||
if (!adapter->erp_thread)
|
need = zfcp_erp_handle_failed(want, adapter, port, sdev);
|
||||||
return -EIO;
|
if (!need) {
|
||||||
|
need = ZFCP_ERP_ACTION_FAILED; /* marker for trace */
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!adapter->erp_thread) {
|
||||||
|
need = ZFCP_ERP_ACTION_NONE; /* marker for trace */
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
need = zfcp_erp_required_act(want, adapter, port, sdev);
|
need = zfcp_erp_required_act(want, adapter, port, sdev);
|
||||||
if (!need)
|
if (!need)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
act = zfcp_erp_setup_act(need, act_status, adapter, port, sdev);
|
act = zfcp_erp_setup_act(need, act_status, adapter, port, sdev);
|
||||||
if (!act)
|
if (!act) {
|
||||||
|
need |= ZFCP_ERP_ACTION_NONE; /* marker for trace */
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
atomic_or(ZFCP_STATUS_ADAPTER_ERP_PENDING, &adapter->status);
|
atomic_or(ZFCP_STATUS_ADAPTER_ERP_PENDING, &adapter->status);
|
||||||
++adapter->erp_total_count;
|
++adapter->erp_total_count;
|
||||||
list_add_tail(&act->list, &adapter->erp_ready_head);
|
list_add_tail(&act->list, &adapter->erp_ready_head);
|
||||||
wake_up(&adapter->erp_ready_wq);
|
wake_up(&adapter->erp_ready_wq);
|
||||||
retval = 0;
|
|
||||||
out:
|
out:
|
||||||
zfcp_dbf_rec_trig(id, adapter, port, sdev, want, need);
|
zfcp_dbf_rec_trig(id, adapter, port, sdev, want, need);
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter,
|
void zfcp_erp_port_forced_no_port_dbf(char *id, struct zfcp_adapter *adapter,
|
||||||
|
u64 port_name, u32 port_id)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
static /* don't waste stack */ struct zfcp_port tmpport;
|
||||||
|
|
||||||
|
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||||
|
/* Stand-in zfcp port with fields just good enough for
|
||||||
|
* zfcp_dbf_rec_trig() and zfcp_dbf_set_common().
|
||||||
|
* Under lock because tmpport is static.
|
||||||
|
*/
|
||||||
|
atomic_set(&tmpport.status, -1); /* unknown */
|
||||||
|
tmpport.wwpn = port_name;
|
||||||
|
tmpport.d_id = port_id;
|
||||||
|
zfcp_dbf_rec_trig(id, adapter, &tmpport, NULL,
|
||||||
|
ZFCP_ERP_ACTION_REOPEN_PORT_FORCED,
|
||||||
|
ZFCP_ERP_ACTION_NONE);
|
||||||
|
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter,
|
||||||
int clear_mask, char *id)
|
int clear_mask, char *id)
|
||||||
{
|
{
|
||||||
zfcp_erp_adapter_block(adapter, clear_mask);
|
zfcp_erp_adapter_block(adapter, clear_mask);
|
||||||
zfcp_scsi_schedule_rports_block(adapter);
|
zfcp_scsi_schedule_rports_block(adapter);
|
||||||
|
|
||||||
/* ensure propagation of failed status to new devices */
|
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER,
|
||||||
if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
|
|
||||||
zfcp_erp_set_adapter_status(adapter,
|
|
||||||
ZFCP_STATUS_COMMON_ERP_FAILED);
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER,
|
|
||||||
adapter, NULL, NULL, id, 0);
|
adapter, NULL, NULL, id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,10 +374,6 @@ void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, char *id)
|
|||||||
zfcp_scsi_schedule_rports_block(adapter);
|
zfcp_scsi_schedule_rports_block(adapter);
|
||||||
|
|
||||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||||
if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
|
|
||||||
zfcp_erp_set_adapter_status(adapter,
|
|
||||||
ZFCP_STATUS_COMMON_ERP_FAILED);
|
|
||||||
else
|
|
||||||
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, adapter,
|
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, adapter,
|
||||||
NULL, NULL, id, 0);
|
NULL, NULL, id, 0);
|
||||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||||
@@ -345,9 +416,6 @@ static void _zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear,
|
|||||||
zfcp_erp_port_block(port, clear);
|
zfcp_erp_port_block(port, clear);
|
||||||
zfcp_scsi_schedule_rport_block(port);
|
zfcp_scsi_schedule_rport_block(port);
|
||||||
|
|
||||||
if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
|
|
||||||
return;
|
|
||||||
|
|
||||||
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT_FORCED,
|
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT_FORCED,
|
||||||
port->adapter, port, NULL, id, 0);
|
port->adapter, port, NULL, id, 0);
|
||||||
}
|
}
|
||||||
@@ -368,18 +436,12 @@ void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, char *id)
|
|||||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id)
|
static void _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id)
|
||||||
{
|
{
|
||||||
zfcp_erp_port_block(port, clear);
|
zfcp_erp_port_block(port, clear);
|
||||||
zfcp_scsi_schedule_rport_block(port);
|
zfcp_scsi_schedule_rport_block(port);
|
||||||
|
|
||||||
if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
|
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT,
|
||||||
/* ensure propagation of failed status to new devices */
|
|
||||||
zfcp_erp_set_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED);
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT,
|
|
||||||
port->adapter, port, NULL, id, 0);
|
port->adapter, port, NULL, id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,20 +450,15 @@ static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id)
|
|||||||
* @port: port to recover
|
* @port: port to recover
|
||||||
* @clear_mask: flags in port status to be cleared
|
* @clear_mask: flags in port status to be cleared
|
||||||
* @id: Id for debug trace event.
|
* @id: Id for debug trace event.
|
||||||
*
|
|
||||||
* Returns 0 if recovery has been triggered, < 0 if not.
|
|
||||||
*/
|
*/
|
||||||
int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id)
|
void zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id)
|
||||||
{
|
{
|
||||||
int retval;
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct zfcp_adapter *adapter = port->adapter;
|
struct zfcp_adapter *adapter = port->adapter;
|
||||||
|
|
||||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||||
retval = _zfcp_erp_port_reopen(port, clear, id);
|
_zfcp_erp_port_reopen(port, clear, id);
|
||||||
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
write_unlock_irqrestore(&adapter->erp_lock, flags);
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zfcp_erp_lun_block(struct scsi_device *sdev, int clear_mask)
|
static void zfcp_erp_lun_block(struct scsi_device *sdev, int clear_mask)
|
||||||
@@ -418,9 +475,6 @@ static void _zfcp_erp_lun_reopen(struct scsi_device *sdev, int clear, char *id,
|
|||||||
|
|
||||||
zfcp_erp_lun_block(sdev, clear);
|
zfcp_erp_lun_block(sdev, clear);
|
||||||
|
|
||||||
if (atomic_read(&zfcp_sdev->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
|
|
||||||
return;
|
|
||||||
|
|
||||||
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_LUN, adapter,
|
zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_LUN, adapter,
|
||||||
zfcp_sdev->port, sdev, id, act_status);
|
zfcp_sdev->port, sdev, id, act_status);
|
||||||
}
|
}
|
||||||
@@ -482,21 +536,23 @@ void zfcp_erp_lun_shutdown_wait(struct scsi_device *sdev, char *id)
|
|||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int status_change_set(unsigned long mask, atomic_t *status)
|
static int zfcp_erp_status_change_set(unsigned long mask, atomic_t *status)
|
||||||
{
|
{
|
||||||
return (atomic_read(status) ^ mask) & mask;
|
return (atomic_read(status) ^ mask) & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter)
|
static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter)
|
||||||
{
|
{
|
||||||
if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status))
|
if (zfcp_erp_status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED,
|
||||||
|
&adapter->status))
|
||||||
zfcp_dbf_rec_run("eraubl1", &adapter->erp_action);
|
zfcp_dbf_rec_run("eraubl1", &adapter->erp_action);
|
||||||
atomic_or(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status);
|
atomic_or(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zfcp_erp_port_unblock(struct zfcp_port *port)
|
static void zfcp_erp_port_unblock(struct zfcp_port *port)
|
||||||
{
|
{
|
||||||
if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status))
|
if (zfcp_erp_status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED,
|
||||||
|
&port->status))
|
||||||
zfcp_dbf_rec_run("erpubl1", &port->erp_action);
|
zfcp_dbf_rec_run("erpubl1", &port->erp_action);
|
||||||
atomic_or(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status);
|
atomic_or(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status);
|
||||||
}
|
}
|
||||||
@@ -505,7 +561,8 @@ static void zfcp_erp_lun_unblock(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 (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &zfcp_sdev->status))
|
if (zfcp_erp_status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED,
|
||||||
|
&zfcp_sdev->status))
|
||||||
zfcp_dbf_rec_run("erlubl1", &sdev_to_zfcp(sdev)->erp_action);
|
zfcp_dbf_rec_run("erlubl1", &sdev_to_zfcp(sdev)->erp_action);
|
||||||
atomic_or(ZFCP_STATUS_COMMON_UNBLOCKED, &zfcp_sdev->status);
|
atomic_or(ZFCP_STATUS_COMMON_UNBLOCKED, &zfcp_sdev->status);
|
||||||
}
|
}
|
||||||
@@ -553,7 +610,7 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
write_lock_irqsave(&adapter->erp_lock, flags);
|
write_lock_irqsave(&adapter->erp_lock, flags);
|
||||||
if (zfcp_erp_action_exists(erp_action) == ZFCP_ERP_ACTION_RUNNING) {
|
if (zfcp_erp_action_is_running(erp_action)) {
|
||||||
erp_action->status |= set_mask;
|
erp_action->status |= set_mask;
|
||||||
zfcp_erp_action_ready(erp_action);
|
zfcp_erp_action_ready(erp_action);
|
||||||
}
|
}
|
||||||
@@ -1634,3 +1691,14 @@ void zfcp_erp_clear_lun_status(struct scsi_device *sdev, u32 mask)
|
|||||||
atomic_set(&zfcp_sdev->erp_counter, 0);
|
atomic_set(&zfcp_sdev->erp_counter, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zfcp_erp_adapter_reset_sync() - Really reopen adapter and wait.
|
||||||
|
* @adapter: Pointer to zfcp_adapter to reopen.
|
||||||
|
* @id: Trace tag string of length %ZFCP_DBF_TAG_LEN.
|
||||||
|
*/
|
||||||
|
void zfcp_erp_adapter_reset_sync(struct zfcp_adapter *adapter, char *id)
|
||||||
|
{
|
||||||
|
zfcp_erp_set_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING);
|
||||||
|
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, id);
|
||||||
|
zfcp_erp_wait(adapter);
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,17 +50,23 @@ extern void zfcp_dbf_hba_basic(char *, struct zfcp_adapter *);
|
|||||||
extern void zfcp_dbf_san_req(char *, struct zfcp_fsf_req *, u32);
|
extern void zfcp_dbf_san_req(char *, struct zfcp_fsf_req *, u32);
|
||||||
extern void zfcp_dbf_san_res(char *, struct zfcp_fsf_req *);
|
extern void zfcp_dbf_san_res(char *, struct zfcp_fsf_req *);
|
||||||
extern void zfcp_dbf_san_in_els(char *, struct zfcp_fsf_req *);
|
extern void zfcp_dbf_san_in_els(char *, struct zfcp_fsf_req *);
|
||||||
extern void zfcp_dbf_scsi(char *, int, struct scsi_cmnd *,
|
extern void zfcp_dbf_scsi_common(char *tag, int level, struct scsi_device *sdev,
|
||||||
struct zfcp_fsf_req *);
|
struct scsi_cmnd *sc,
|
||||||
|
struct zfcp_fsf_req *fsf);
|
||||||
|
extern void zfcp_dbf_scsi_eh(char *tag, struct zfcp_adapter *adapter,
|
||||||
|
unsigned int scsi_id, int ret);
|
||||||
|
|
||||||
/* zfcp_erp.c */
|
/* zfcp_erp.c */
|
||||||
extern void zfcp_erp_set_adapter_status(struct zfcp_adapter *, u32);
|
extern void zfcp_erp_set_adapter_status(struct zfcp_adapter *, u32);
|
||||||
extern void zfcp_erp_clear_adapter_status(struct zfcp_adapter *, u32);
|
extern void zfcp_erp_clear_adapter_status(struct zfcp_adapter *, u32);
|
||||||
|
extern void zfcp_erp_port_forced_no_port_dbf(char *id,
|
||||||
|
struct zfcp_adapter *adapter,
|
||||||
|
u64 port_name, u32 port_id);
|
||||||
extern void zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, char *);
|
extern void zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, char *);
|
||||||
extern void zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, char *);
|
extern void zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, char *);
|
||||||
extern void zfcp_erp_set_port_status(struct zfcp_port *, u32);
|
extern void zfcp_erp_set_port_status(struct zfcp_port *, u32);
|
||||||
extern void zfcp_erp_clear_port_status(struct zfcp_port *, u32);
|
extern void zfcp_erp_clear_port_status(struct zfcp_port *, u32);
|
||||||
extern int zfcp_erp_port_reopen(struct zfcp_port *, int, char *);
|
extern void zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id);
|
||||||
extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, char *);
|
extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, char *);
|
||||||
extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, char *);
|
extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, char *);
|
||||||
extern void zfcp_erp_set_lun_status(struct scsi_device *, u32);
|
extern void zfcp_erp_set_lun_status(struct scsi_device *, u32);
|
||||||
@@ -73,6 +79,7 @@ extern void zfcp_erp_thread_kill(struct zfcp_adapter *);
|
|||||||
extern void zfcp_erp_wait(struct zfcp_adapter *);
|
extern void zfcp_erp_wait(struct zfcp_adapter *);
|
||||||
extern void zfcp_erp_notify(struct zfcp_erp_action *, unsigned long);
|
extern void zfcp_erp_notify(struct zfcp_erp_action *, unsigned long);
|
||||||
extern void zfcp_erp_timeout_handler(struct timer_list *t);
|
extern void zfcp_erp_timeout_handler(struct timer_list *t);
|
||||||
|
extern void zfcp_erp_adapter_reset_sync(struct zfcp_adapter *adapter, char *id);
|
||||||
|
|
||||||
/* zfcp_fc.c */
|
/* zfcp_fc.c */
|
||||||
extern struct kmem_cache *zfcp_fc_req_cache;
|
extern struct kmem_cache *zfcp_fc_req_cache;
|
||||||
@@ -120,7 +127,8 @@ extern int zfcp_fsf_send_els(struct zfcp_adapter *, u32,
|
|||||||
struct zfcp_fsf_ct_els *, unsigned int);
|
struct zfcp_fsf_ct_els *, unsigned int);
|
||||||
extern int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *);
|
extern int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *);
|
||||||
extern void zfcp_fsf_req_free(struct zfcp_fsf_req *);
|
extern void zfcp_fsf_req_free(struct zfcp_fsf_req *);
|
||||||
extern struct zfcp_fsf_req *zfcp_fsf_fcp_task_mgmt(struct scsi_cmnd *, u8);
|
extern struct zfcp_fsf_req *zfcp_fsf_fcp_task_mgmt(struct scsi_device *sdev,
|
||||||
|
u8 tm_flags);
|
||||||
extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_cmnd(struct scsi_cmnd *);
|
extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_cmnd(struct scsi_cmnd *);
|
||||||
extern void zfcp_fsf_reqid_check(struct zfcp_qdio *, int);
|
extern void zfcp_fsf_reqid_check(struct zfcp_qdio *, int);
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ void zfcp_fc_post_event(struct work_struct *work)
|
|||||||
list_del(&event->list);
|
list_del(&event->list);
|
||||||
kfree(event);
|
kfree(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -425,6 +424,7 @@ void zfcp_fc_port_did_lookup(struct work_struct *work)
|
|||||||
struct zfcp_port *port = container_of(work, struct zfcp_port,
|
struct zfcp_port *port = container_of(work, struct zfcp_port,
|
||||||
gid_pn_work);
|
gid_pn_work);
|
||||||
|
|
||||||
|
set_worker_desc("zgidpn%16llx", port->wwpn); /* < WORKER_DESC_LEN=24 */
|
||||||
ret = zfcp_fc_ns_gid_pn(port);
|
ret = zfcp_fc_ns_gid_pn(port);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* could not issue gid_pn for some reason */
|
/* could not issue gid_pn for some reason */
|
||||||
@@ -559,6 +559,7 @@ void zfcp_fc_link_test_work(struct work_struct *work)
|
|||||||
container_of(work, struct zfcp_port, test_link_work);
|
container_of(work, struct zfcp_port, test_link_work);
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
|
set_worker_desc("zadisc%16llx", port->wwpn); /* < WORKER_DESC_LEN=24 */
|
||||||
get_device(&port->dev);
|
get_device(&port->dev);
|
||||||
port->rport_task = RPORT_DEL;
|
port->rport_task = RPORT_DEL;
|
||||||
zfcp_scsi_rport_work(&port->rport_work);
|
zfcp_scsi_rport_work(&port->rport_work);
|
||||||
@@ -596,7 +597,7 @@ void zfcp_fc_test_link(struct zfcp_port *port)
|
|||||||
put_device(&port->dev);
|
put_device(&port->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct zfcp_fc_req *zfcp_alloc_sg_env(int buf_num)
|
static struct zfcp_fc_req *zfcp_fc_alloc_sg_env(int buf_num)
|
||||||
{
|
{
|
||||||
struct zfcp_fc_req *fc_req;
|
struct zfcp_fc_req *fc_req;
|
||||||
|
|
||||||
@@ -748,7 +749,7 @@ void zfcp_fc_scan_ports(struct work_struct *work)
|
|||||||
if (zfcp_fc_wka_port_get(&adapter->gs->ds))
|
if (zfcp_fc_wka_port_get(&adapter->gs->ds))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fc_req = zfcp_alloc_sg_env(buf_num);
|
fc_req = zfcp_fc_alloc_sg_env(buf_num);
|
||||||
if (!fc_req)
|
if (!fc_req)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user