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 git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (137 commits) [SCSI] iscsi: bidi support for iscsi_tcp [SCSI] iscsi: bidi support at the generic libiscsi level [SCSI] iscsi: extended cdb support [SCSI] zfcp: Fix error handling for blocked unit for send FCP command [SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock [SCSI] zfcp: fix 31 bit compile warnings [SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands [SCSI] bsg: remove minor in struct bsg_device [SCSI] bsg: use better helper list functions [SCSI] bsg: replace kobject_get with blk_get_queue [SCSI] bsg: takes a ref to struct device in fops->open [SCSI] qla1280: remove version check [SCSI] libsas: fix endianness bug in sas_ata [SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next) [SCSI] aacraid: Do not describe check_reset parameter with its value [SCSI] aacraid: Fix down_interruptible() to check the return value [SCSI] sun3_scsi_vme: add MODULE_LICENSE [SCSI] st: rename flush_write_buffer() [SCSI] tgt: use KMEM_CACHE macro [SCSI] initio: fix big endian problems for auto request sense ...
This commit is contained in:
@@ -2,7 +2,7 @@ This file contains brief information about the SCSI tape driver.
|
|||||||
The driver is currently maintained by Kai Mäkisara (email
|
The driver is currently maintained by Kai Mäkisara (email
|
||||||
Kai.Makisara@kolumbus.fi)
|
Kai.Makisara@kolumbus.fi)
|
||||||
|
|
||||||
Last modified: Mon Mar 7 21:14:44 2005 by kai.makisara
|
Last modified: Sun Feb 24 21:59:07 2008 by kai.makisara
|
||||||
|
|
||||||
|
|
||||||
BASICS
|
BASICS
|
||||||
@@ -133,6 +133,11 @@ the defaults set by the user. The value -1 means the default is not set. The
|
|||||||
file 'dev' contains the device numbers corresponding to this device. The links
|
file 'dev' contains the device numbers corresponding to this device. The links
|
||||||
'device' and 'driver' point to the SCSI device and driver entries.
|
'device' and 'driver' point to the SCSI device and driver entries.
|
||||||
|
|
||||||
|
Each directory also contains the entry 'options' which shows the currently
|
||||||
|
enabled driver and mode options. The value in the file is a bit mask where the
|
||||||
|
bit definitions are the same as those used with MTSETDRVBUFFER in setting the
|
||||||
|
options.
|
||||||
|
|
||||||
A link named 'tape' is made from the SCSI device directory to the class
|
A link named 'tape' is made from the SCSI device directory to the class
|
||||||
directory corresponding to the mode 0 auto-rewind device (e.g., st0).
|
directory corresponding to the mode 0 auto-rewind device (e.g., st0).
|
||||||
|
|
||||||
@@ -372,6 +377,11 @@ MTSETDRVBUFFER
|
|||||||
MT_ST_SYSV sets the SYSV semantics (mode)
|
MT_ST_SYSV sets the SYSV semantics (mode)
|
||||||
MT_ST_NOWAIT enables immediate mode (i.e., don't wait for
|
MT_ST_NOWAIT enables immediate mode (i.e., don't wait for
|
||||||
the command to finish) for some commands (e.g., rewind)
|
the command to finish) for some commands (e.g., rewind)
|
||||||
|
MT_ST_SILI enables setting the SILI bit in SCSI commands when
|
||||||
|
reading in variable block mode to enhance performance when
|
||||||
|
reading blocks shorter than the byte count; set this only
|
||||||
|
if you are sure that the drive supports SILI and the HBA
|
||||||
|
correctly returns transfer residuals
|
||||||
MT_ST_DEBUGGING debugging (global; debugging must be
|
MT_ST_DEBUGGING debugging (global; debugging must be
|
||||||
compiled into the driver)
|
compiled into the driver)
|
||||||
MT_ST_SETBOOLEANS
|
MT_ST_SETBOOLEANS
|
||||||
|
|||||||
@@ -201,22 +201,6 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode)
|
|||||||
simscsi_sg_readwrite(sc, mode, offset);
|
simscsi_sg_readwrite(sc, mode, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
|
|
||||||
{
|
|
||||||
|
|
||||||
int i;
|
|
||||||
unsigned thislen;
|
|
||||||
struct scatterlist *slp;
|
|
||||||
|
|
||||||
scsi_for_each_sg(sc, slp, scsi_sg_count(sc), i) {
|
|
||||||
if (!len)
|
|
||||||
break;
|
|
||||||
thislen = min(len, slp->length);
|
|
||||||
memcpy(sg_virt(slp), buf, thislen);
|
|
||||||
len -= thislen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
||||||
{
|
{
|
||||||
@@ -258,7 +242,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
|||||||
buf[6] = 0; /* reserved */
|
buf[6] = 0; /* reserved */
|
||||||
buf[7] = 0; /* various flags */
|
buf[7] = 0; /* various flags */
|
||||||
memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28);
|
memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28);
|
||||||
simscsi_fillresult(sc, buf, 36);
|
scsi_sg_copy_from_buffer(sc, buf, 36);
|
||||||
sc->result = GOOD;
|
sc->result = GOOD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -306,14 +290,15 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
|||||||
buf[5] = 0;
|
buf[5] = 0;
|
||||||
buf[6] = 2;
|
buf[6] = 2;
|
||||||
buf[7] = 0;
|
buf[7] = 0;
|
||||||
simscsi_fillresult(sc, buf, 8);
|
scsi_sg_copy_from_buffer(sc, buf, 8);
|
||||||
sc->result = GOOD;
|
sc->result = GOOD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_SENSE:
|
case MODE_SENSE:
|
||||||
case MODE_SENSE_10:
|
case MODE_SENSE_10:
|
||||||
/* sd.c uses this to determine whether disk does write-caching. */
|
/* sd.c uses this to determine whether disk does write-caching. */
|
||||||
simscsi_fillresult(sc, (char *)empty_zero_page, scsi_bufflen(sc));
|
scsi_sg_copy_from_buffer(sc, (char *)empty_zero_page,
|
||||||
|
PAGE_SIZE);
|
||||||
sc->result = GOOD;
|
sc->result = GOOD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+29
-23
@@ -37,7 +37,6 @@ struct bsg_device {
|
|||||||
struct list_head done_list;
|
struct list_head done_list;
|
||||||
struct hlist_node dev_list;
|
struct hlist_node dev_list;
|
||||||
atomic_t ref_count;
|
atomic_t ref_count;
|
||||||
int minor;
|
|
||||||
int queued_cmds;
|
int queued_cmds;
|
||||||
int done_cmds;
|
int done_cmds;
|
||||||
wait_queue_head_t wq_done;
|
wait_queue_head_t wq_done;
|
||||||
@@ -368,7 +367,7 @@ static struct bsg_command *bsg_next_done_cmd(struct bsg_device *bd)
|
|||||||
|
|
||||||
spin_lock_irq(&bd->lock);
|
spin_lock_irq(&bd->lock);
|
||||||
if (bd->done_cmds) {
|
if (bd->done_cmds) {
|
||||||
bc = list_entry(bd->done_list.next, struct bsg_command, list);
|
bc = list_first_entry(&bd->done_list, struct bsg_command, list);
|
||||||
list_del(&bc->list);
|
list_del(&bc->list);
|
||||||
bd->done_cmds--;
|
bd->done_cmds--;
|
||||||
}
|
}
|
||||||
@@ -468,8 +467,6 @@ static int bsg_complete_all_commands(struct bsg_device *bd)
|
|||||||
|
|
||||||
dprintk("%s: entered\n", bd->name);
|
dprintk("%s: entered\n", bd->name);
|
||||||
|
|
||||||
set_bit(BSG_F_BLOCK, &bd->flags);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wait for all commands to complete
|
* wait for all commands to complete
|
||||||
*/
|
*/
|
||||||
@@ -705,6 +702,7 @@ static struct bsg_device *bsg_alloc_device(void)
|
|||||||
static int bsg_put_device(struct bsg_device *bd)
|
static int bsg_put_device(struct bsg_device *bd)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
struct device *dev = bd->queue->bsg_dev.dev;
|
||||||
|
|
||||||
mutex_lock(&bsg_mutex);
|
mutex_lock(&bsg_mutex);
|
||||||
|
|
||||||
@@ -730,6 +728,7 @@ static int bsg_put_device(struct bsg_device *bd)
|
|||||||
kfree(bd);
|
kfree(bd);
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&bsg_mutex);
|
mutex_unlock(&bsg_mutex);
|
||||||
|
put_device(dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -738,22 +737,26 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
|
|||||||
struct file *file)
|
struct file *file)
|
||||||
{
|
{
|
||||||
struct bsg_device *bd;
|
struct bsg_device *bd;
|
||||||
|
int ret;
|
||||||
#ifdef BSG_DEBUG
|
#ifdef BSG_DEBUG
|
||||||
unsigned char buf[32];
|
unsigned char buf[32];
|
||||||
#endif
|
#endif
|
||||||
|
ret = blk_get_queue(rq);
|
||||||
|
if (ret)
|
||||||
|
return ERR_PTR(-ENXIO);
|
||||||
|
|
||||||
bd = bsg_alloc_device();
|
bd = bsg_alloc_device();
|
||||||
if (!bd)
|
if (!bd) {
|
||||||
|
blk_put_queue(rq);
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
bd->queue = rq;
|
bd->queue = rq;
|
||||||
kobject_get(&rq->kobj);
|
|
||||||
bsg_set_block(bd, file);
|
bsg_set_block(bd, file);
|
||||||
|
|
||||||
atomic_set(&bd->ref_count, 1);
|
atomic_set(&bd->ref_count, 1);
|
||||||
bd->minor = iminor(inode);
|
|
||||||
mutex_lock(&bsg_mutex);
|
mutex_lock(&bsg_mutex);
|
||||||
hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(bd->minor));
|
hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(iminor(inode)));
|
||||||
|
|
||||||
strncpy(bd->name, rq->bsg_dev.class_dev->class_id, sizeof(bd->name) - 1);
|
strncpy(bd->name, rq->bsg_dev.class_dev->class_id, sizeof(bd->name) - 1);
|
||||||
dprintk("bound to <%s>, max queue %d\n",
|
dprintk("bound to <%s>, max queue %d\n",
|
||||||
@@ -763,23 +766,21 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
|
|||||||
return bd;
|
return bd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct bsg_device *__bsg_get_device(int minor)
|
static struct bsg_device *__bsg_get_device(int minor, struct request_queue *q)
|
||||||
{
|
{
|
||||||
struct bsg_device *bd = NULL;
|
struct bsg_device *bd;
|
||||||
struct hlist_node *entry;
|
struct hlist_node *entry;
|
||||||
|
|
||||||
mutex_lock(&bsg_mutex);
|
mutex_lock(&bsg_mutex);
|
||||||
|
|
||||||
hlist_for_each(entry, bsg_dev_idx_hash(minor)) {
|
hlist_for_each_entry(bd, entry, bsg_dev_idx_hash(minor), dev_list) {
|
||||||
bd = hlist_entry(entry, struct bsg_device, dev_list);
|
if (bd->queue == q) {
|
||||||
if (bd->minor == minor) {
|
|
||||||
atomic_inc(&bd->ref_count);
|
atomic_inc(&bd->ref_count);
|
||||||
break;
|
goto found;
|
||||||
}
|
}
|
||||||
|
|
||||||
bd = NULL;
|
|
||||||
}
|
}
|
||||||
|
bd = NULL;
|
||||||
|
found:
|
||||||
mutex_unlock(&bsg_mutex);
|
mutex_unlock(&bsg_mutex);
|
||||||
return bd;
|
return bd;
|
||||||
}
|
}
|
||||||
@@ -789,21 +790,27 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file)
|
|||||||
struct bsg_device *bd;
|
struct bsg_device *bd;
|
||||||
struct bsg_class_device *bcd;
|
struct bsg_class_device *bcd;
|
||||||
|
|
||||||
bd = __bsg_get_device(iminor(inode));
|
|
||||||
if (bd)
|
|
||||||
return bd;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find the class device
|
* find the class device
|
||||||
*/
|
*/
|
||||||
mutex_lock(&bsg_mutex);
|
mutex_lock(&bsg_mutex);
|
||||||
bcd = idr_find(&bsg_minor_idr, iminor(inode));
|
bcd = idr_find(&bsg_minor_idr, iminor(inode));
|
||||||
|
if (bcd)
|
||||||
|
get_device(bcd->dev);
|
||||||
mutex_unlock(&bsg_mutex);
|
mutex_unlock(&bsg_mutex);
|
||||||
|
|
||||||
if (!bcd)
|
if (!bcd)
|
||||||
return ERR_PTR(-ENODEV);
|
return ERR_PTR(-ENODEV);
|
||||||
|
|
||||||
return bsg_add_device(inode, bcd->queue, file);
|
bd = __bsg_get_device(iminor(inode), bcd->queue);
|
||||||
|
if (bd)
|
||||||
|
return bd;
|
||||||
|
|
||||||
|
bd = bsg_add_device(inode, bcd->queue, file);
|
||||||
|
if (IS_ERR(bd))
|
||||||
|
put_device(bcd->dev);
|
||||||
|
|
||||||
|
return bd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bsg_open(struct inode *inode, struct file *file)
|
static int bsg_open(struct inode *inode, struct file *file)
|
||||||
@@ -942,7 +949,6 @@ void bsg_unregister_queue(struct request_queue *q)
|
|||||||
class_device_unregister(bcd->class_dev);
|
class_device_unregister(bcd->class_dev);
|
||||||
put_device(bcd->dev);
|
put_device(bcd->dev);
|
||||||
bcd->class_dev = NULL;
|
bcd->class_dev = NULL;
|
||||||
bcd->dev = NULL;
|
|
||||||
mutex_unlock(&bsg_mutex);
|
mutex_unlock(&bsg_mutex);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(bsg_unregister_queue);
|
EXPORT_SYMBOL_GPL(bsg_unregister_queue);
|
||||||
|
|||||||
@@ -2332,11 +2332,7 @@ void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq)
|
|||||||
{
|
{
|
||||||
cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
|
cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
|
||||||
|
|
||||||
cmd->sense_buffer[0] = 0x70; /* fixed format, current */
|
scsi_build_sense_buffer(0, cmd->sense_buffer, sk, asc, ascq);
|
||||||
cmd->sense_buffer[2] = sk;
|
|
||||||
cmd->sense_buffer[7] = 18 - 8; /* additional sense length */
|
|
||||||
cmd->sense_buffer[12] = asc;
|
|
||||||
cmd->sense_buffer[13] = ascq;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ EXPORT_SYMBOL_GPL(anon_transport_class_register);
|
|||||||
*/
|
*/
|
||||||
void anon_transport_class_unregister(struct anon_transport_class *atc)
|
void anon_transport_class_unregister(struct anon_transport_class *atc)
|
||||||
{
|
{
|
||||||
attribute_container_unregister(&atc->container);
|
if (unlikely(attribute_container_unregister(&atc->container)))
|
||||||
|
BUG();
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(anon_transport_class_unregister);
|
EXPORT_SYMBOL_GPL(anon_transport_class_unregister);
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ MODULE_VERSION(my_VERSION);
|
|||||||
/*
|
/*
|
||||||
* cmd line parameters
|
* cmd line parameters
|
||||||
*/
|
*/
|
||||||
static int mpt_msi_enable;
|
static int mpt_msi_enable = -1;
|
||||||
module_param(mpt_msi_enable, int, 0);
|
module_param(mpt_msi_enable, int, 0);
|
||||||
MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)");
|
MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)");
|
||||||
|
|
||||||
@@ -1686,6 +1686,11 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||||||
ioc->bus_type = SAS;
|
ioc->bus_type = SAS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ioc->bus_type == SAS && mpt_msi_enable == -1)
|
||||||
|
ioc->msi_enable = 1;
|
||||||
|
else
|
||||||
|
ioc->msi_enable = mpt_msi_enable;
|
||||||
|
|
||||||
if (ioc->errata_flag_1064)
|
if (ioc->errata_flag_1064)
|
||||||
pci_disable_io_access(pdev);
|
pci_disable_io_access(pdev);
|
||||||
|
|
||||||
@@ -1831,7 +1836,7 @@ mpt_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||||||
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
|
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
|
||||||
|
|
||||||
free_irq(ioc->pci_irq, ioc);
|
free_irq(ioc->pci_irq, ioc);
|
||||||
if (mpt_msi_enable)
|
if (ioc->msi_enable)
|
||||||
pci_disable_msi(ioc->pcidev);
|
pci_disable_msi(ioc->pcidev);
|
||||||
ioc->pci_irq = -1;
|
ioc->pci_irq = -1;
|
||||||
pci_save_state(pdev);
|
pci_save_state(pdev);
|
||||||
@@ -2057,15 +2062,17 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|||||||
if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) {
|
if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) {
|
||||||
ioc->pci_irq = -1;
|
ioc->pci_irq = -1;
|
||||||
if (ioc->pcidev->irq) {
|
if (ioc->pcidev->irq) {
|
||||||
if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev))
|
if (ioc->msi_enable && !pci_enable_msi(ioc->pcidev))
|
||||||
printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
|
printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
|
||||||
ioc->name);
|
ioc->name);
|
||||||
|
else
|
||||||
|
ioc->msi_enable = 0;
|
||||||
rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
|
rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
|
||||||
IRQF_SHARED, ioc->name, ioc);
|
IRQF_SHARED, ioc->name, ioc);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printk(MYIOC_s_ERR_FMT "Unable to allocate "
|
printk(MYIOC_s_ERR_FMT "Unable to allocate "
|
||||||
"interrupt %d!\n", ioc->name, ioc->pcidev->irq);
|
"interrupt %d!\n", ioc->name, ioc->pcidev->irq);
|
||||||
if (mpt_msi_enable)
|
if (ioc->msi_enable)
|
||||||
pci_disable_msi(ioc->pcidev);
|
pci_disable_msi(ioc->pcidev);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
@@ -2173,7 +2180,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|||||||
/*
|
/*
|
||||||
* Initalize link list for inactive raid volumes.
|
* Initalize link list for inactive raid volumes.
|
||||||
*/
|
*/
|
||||||
init_MUTEX(&ioc->raid_data.inactive_list_mutex);
|
mutex_init(&ioc->raid_data.inactive_list_mutex);
|
||||||
INIT_LIST_HEAD(&ioc->raid_data.inactive_list);
|
INIT_LIST_HEAD(&ioc->raid_data.inactive_list);
|
||||||
|
|
||||||
if (ioc->bus_type == SAS) {
|
if (ioc->bus_type == SAS) {
|
||||||
@@ -2261,7 +2268,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
|
|||||||
out:
|
out:
|
||||||
if ((ret != 0) && irq_allocated) {
|
if ((ret != 0) && irq_allocated) {
|
||||||
free_irq(ioc->pci_irq, ioc);
|
free_irq(ioc->pci_irq, ioc);
|
||||||
if (mpt_msi_enable)
|
if (ioc->msi_enable)
|
||||||
pci_disable_msi(ioc->pcidev);
|
pci_disable_msi(ioc->pcidev);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -2443,7 +2450,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
|
|||||||
|
|
||||||
if (ioc->pci_irq != -1) {
|
if (ioc->pci_irq != -1) {
|
||||||
free_irq(ioc->pci_irq, ioc);
|
free_irq(ioc->pci_irq, ioc);
|
||||||
if (mpt_msi_enable)
|
if (ioc->msi_enable)
|
||||||
pci_disable_msi(ioc->pcidev);
|
pci_disable_msi(ioc->pcidev);
|
||||||
ioc->pci_irq = -1;
|
ioc->pci_irq = -1;
|
||||||
}
|
}
|
||||||
@@ -5159,13 +5166,13 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc)
|
|||||||
if (list_empty(&ioc->raid_data.inactive_list))
|
if (list_empty(&ioc->raid_data.inactive_list))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
down(&ioc->raid_data.inactive_list_mutex);
|
mutex_lock(&ioc->raid_data.inactive_list_mutex);
|
||||||
list_for_each_entry_safe(component_info, pNext,
|
list_for_each_entry_safe(component_info, pNext,
|
||||||
&ioc->raid_data.inactive_list, list) {
|
&ioc->raid_data.inactive_list, list) {
|
||||||
list_del(&component_info->list);
|
list_del(&component_info->list);
|
||||||
kfree(component_info);
|
kfree(component_info);
|
||||||
}
|
}
|
||||||
up(&ioc->raid_data.inactive_list_mutex);
|
mutex_unlock(&ioc->raid_data.inactive_list_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5224,7 +5231,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
|
|||||||
if (!handle_inactive_volumes)
|
if (!handle_inactive_volumes)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
down(&ioc->raid_data.inactive_list_mutex);
|
mutex_lock(&ioc->raid_data.inactive_list_mutex);
|
||||||
for (i = 0; i < buffer->NumPhysDisks; i++) {
|
for (i = 0; i < buffer->NumPhysDisks; i++) {
|
||||||
if(mpt_raid_phys_disk_pg0(ioc,
|
if(mpt_raid_phys_disk_pg0(ioc,
|
||||||
buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0)
|
buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0)
|
||||||
@@ -5244,7 +5251,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
|
|||||||
list_add_tail(&component_info->list,
|
list_add_tail(&component_info->list,
|
||||||
&ioc->raid_data.inactive_list);
|
&ioc->raid_data.inactive_list);
|
||||||
}
|
}
|
||||||
up(&ioc->raid_data.inactive_list_mutex);
|
mutex_unlock(&ioc->raid_data.inactive_list_mutex);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (buffer)
|
if (buffer)
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
|
#include <linux/mutex.h>
|
||||||
|
|
||||||
#include "lsi/mpi_type.h"
|
#include "lsi/mpi_type.h"
|
||||||
#include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */
|
#include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */
|
||||||
@@ -531,7 +532,7 @@ struct inactive_raid_component_info {
|
|||||||
typedef struct _RaidCfgData {
|
typedef struct _RaidCfgData {
|
||||||
IOCPage2_t *pIocPg2; /* table of Raid Volumes */
|
IOCPage2_t *pIocPg2; /* table of Raid Volumes */
|
||||||
IOCPage3_t *pIocPg3; /* table of physical disks */
|
IOCPage3_t *pIocPg3; /* table of physical disks */
|
||||||
struct semaphore inactive_list_mutex;
|
struct mutex inactive_list_mutex;
|
||||||
struct list_head inactive_list; /* link list for physical
|
struct list_head inactive_list; /* link list for physical
|
||||||
disk that belong in
|
disk that belong in
|
||||||
inactive volumes */
|
inactive volumes */
|
||||||
@@ -630,6 +631,7 @@ typedef struct _MPT_ADAPTER
|
|||||||
int mtrr_reg;
|
int mtrr_reg;
|
||||||
struct pci_dev *pcidev; /* struct pci_dev pointer */
|
struct pci_dev *pcidev; /* struct pci_dev pointer */
|
||||||
int bars; /* bitmask of BAR's that must be configured */
|
int bars; /* bitmask of BAR's that must be configured */
|
||||||
|
int msi_enable;
|
||||||
u8 __iomem *memmap; /* mmap address */
|
u8 __iomem *memmap; /* mmap address */
|
||||||
struct Scsi_Host *sh; /* Scsi Host pointer */
|
struct Scsi_Host *sh; /* Scsi Host pointer */
|
||||||
SpiCfgData spi_data; /* Scsi config. data */
|
SpiCfgData spi_data; /* Scsi config. data */
|
||||||
@@ -693,7 +695,6 @@ typedef struct _MPT_ADAPTER
|
|||||||
struct mutex sas_discovery_mutex;
|
struct mutex sas_discovery_mutex;
|
||||||
u8 sas_discovery_runtime;
|
u8 sas_discovery_runtime;
|
||||||
u8 sas_discovery_ignore_events;
|
u8 sas_discovery_ignore_events;
|
||||||
u16 handle;
|
|
||||||
int sas_index; /* index refrencing */
|
int sas_index; /* index refrencing */
|
||||||
MPT_SAS_MGMT sas_mgmt;
|
MPT_SAS_MGMT sas_mgmt;
|
||||||
struct work_struct sas_persist_task;
|
struct work_struct sas_persist_task;
|
||||||
|
|||||||
@@ -230,6 +230,20 @@ static inline MPT_ADAPTER *rphy_to_ioc(struct sas_rphy *rphy)
|
|||||||
return ((MPT_SCSI_HOST *)shost->hostdata)->ioc;
|
return ((MPT_SCSI_HOST *)shost->hostdata)->ioc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct mptsas_portinfo *
|
||||||
|
mptsas_get_hba_portinfo(MPT_ADAPTER *ioc)
|
||||||
|
{
|
||||||
|
struct list_head *head = &ioc->sas_topology;
|
||||||
|
struct mptsas_portinfo *pi = NULL;
|
||||||
|
|
||||||
|
/* always the first entry on sas_topology list */
|
||||||
|
|
||||||
|
if (!list_empty(head))
|
||||||
|
pi = list_entry(head->next, struct mptsas_portinfo, list);
|
||||||
|
|
||||||
|
return pi;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mptsas_find_portinfo_by_handle
|
* mptsas_find_portinfo_by_handle
|
||||||
*
|
*
|
||||||
@@ -1290,7 +1304,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
|
|||||||
struct mptsas_portinfo *port_info;
|
struct mptsas_portinfo *port_info;
|
||||||
|
|
||||||
mutex_lock(&ioc->sas_topology_mutex);
|
mutex_lock(&ioc->sas_topology_mutex);
|
||||||
port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle);
|
port_info = mptsas_get_hba_portinfo(ioc);
|
||||||
if (port_info && port_info->phy_info)
|
if (port_info && port_info->phy_info)
|
||||||
sas_address =
|
sas_address =
|
||||||
port_info->phy_info[0].phy->identify.sas_address;
|
port_info->phy_info[0].phy->identify.sas_address;
|
||||||
@@ -2028,8 +2042,7 @@ static int mptsas_probe_one_phy(struct device *dev,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
mutex_lock(&ioc->sas_topology_mutex);
|
mutex_lock(&ioc->sas_topology_mutex);
|
||||||
port_info = mptsas_find_portinfo_by_handle(ioc,
|
port_info = mptsas_get_hba_portinfo(ioc);
|
||||||
ioc->handle);
|
|
||||||
mutex_unlock(&ioc->sas_topology_mutex);
|
mutex_unlock(&ioc->sas_topology_mutex);
|
||||||
|
|
||||||
for (i = 0; i < port_info->num_phys; i++)
|
for (i = 0; i < port_info->num_phys; i++)
|
||||||
@@ -2099,8 +2112,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
|
|||||||
|
|
||||||
mptsas_sas_io_unit_pg1(ioc);
|
mptsas_sas_io_unit_pg1(ioc);
|
||||||
mutex_lock(&ioc->sas_topology_mutex);
|
mutex_lock(&ioc->sas_topology_mutex);
|
||||||
ioc->handle = hba->phy_info[0].handle;
|
port_info = mptsas_get_hba_portinfo(ioc);
|
||||||
port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle);
|
|
||||||
if (!port_info) {
|
if (!port_info) {
|
||||||
port_info = hba;
|
port_info = hba;
|
||||||
list_add_tail(&port_info->list, &ioc->sas_topology);
|
list_add_tail(&port_info->list, &ioc->sas_topology);
|
||||||
|
|||||||
@@ -2304,14 +2304,14 @@ mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id)
|
|||||||
if (list_empty(&ioc->raid_data.inactive_list))
|
if (list_empty(&ioc->raid_data.inactive_list))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
down(&ioc->raid_data.inactive_list_mutex);
|
mutex_lock(&ioc->raid_data.inactive_list_mutex);
|
||||||
list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
|
list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
|
||||||
list) {
|
list) {
|
||||||
if ((component_info->d.PhysDiskID == id) &&
|
if ((component_info->d.PhysDiskID == id) &&
|
||||||
(component_info->d.PhysDiskBus == channel))
|
(component_info->d.PhysDiskBus == channel))
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
up(&ioc->raid_data.inactive_list_mutex);
|
mutex_unlock(&ioc->raid_data.inactive_list_mutex);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return rc;
|
return rc;
|
||||||
@@ -2341,14 +2341,14 @@ mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id)
|
|||||||
if (list_empty(&ioc->raid_data.inactive_list))
|
if (list_empty(&ioc->raid_data.inactive_list))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
down(&ioc->raid_data.inactive_list_mutex);
|
mutex_lock(&ioc->raid_data.inactive_list_mutex);
|
||||||
list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
|
list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
|
||||||
list) {
|
list) {
|
||||||
if ((component_info->d.PhysDiskID == id) &&
|
if ((component_info->d.PhysDiskID == id) &&
|
||||||
(component_info->d.PhysDiskBus == channel))
|
(component_info->d.PhysDiskBus == channel))
|
||||||
rc = component_info->d.PhysDiskNum;
|
rc = component_info->d.PhysDiskNum;
|
||||||
}
|
}
|
||||||
up(&ioc->raid_data.inactive_list_mutex);
|
mutex_unlock(&ioc->raid_data.inactive_list_mutex);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
@@ -1030,10 +1030,10 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
|
|||||||
|
|
||||||
/* initialize debug locks */
|
/* initialize debug locks */
|
||||||
|
|
||||||
spin_lock_init(&adapter->erp_dbf_lock);
|
|
||||||
spin_lock_init(&adapter->hba_dbf_lock);
|
spin_lock_init(&adapter->hba_dbf_lock);
|
||||||
spin_lock_init(&adapter->san_dbf_lock);
|
spin_lock_init(&adapter->san_dbf_lock);
|
||||||
spin_lock_init(&adapter->scsi_dbf_lock);
|
spin_lock_init(&adapter->scsi_dbf_lock);
|
||||||
|
spin_lock_init(&adapter->rec_dbf_lock);
|
||||||
|
|
||||||
retval = zfcp_adapter_debug_register(adapter);
|
retval = zfcp_adapter_debug_register(adapter);
|
||||||
if (retval)
|
if (retval)
|
||||||
@@ -1325,10 +1325,10 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter)
|
|||||||
|
|
||||||
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FC
|
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_FC
|
||||||
|
|
||||||
static void
|
static void zfcp_fsf_incoming_els_rscn(struct zfcp_fsf_req *fsf_req)
|
||||||
zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
|
|
||||||
struct fsf_status_read_buffer *status_buffer)
|
|
||||||
{
|
{
|
||||||
|
struct fsf_status_read_buffer *status_buffer = (void*)fsf_req->data;
|
||||||
|
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||||
struct fcp_rscn_head *fcp_rscn_head;
|
struct fcp_rscn_head *fcp_rscn_head;
|
||||||
struct fcp_rscn_element *fcp_rscn_element;
|
struct fcp_rscn_element *fcp_rscn_element;
|
||||||
struct zfcp_port *port;
|
struct zfcp_port *port;
|
||||||
@@ -1375,7 +1375,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
|
|||||||
ZFCP_LOG_INFO("incoming RSCN, trying to open "
|
ZFCP_LOG_INFO("incoming RSCN, trying to open "
|
||||||
"port 0x%016Lx\n", port->wwpn);
|
"port 0x%016Lx\n", port->wwpn);
|
||||||
zfcp_erp_port_reopen(port,
|
zfcp_erp_port_reopen(port,
|
||||||
ZFCP_STATUS_COMMON_ERP_FAILED);
|
ZFCP_STATUS_COMMON_ERP_FAILED,
|
||||||
|
82, fsf_req);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1406,10 +1407,10 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void zfcp_fsf_incoming_els_plogi(struct zfcp_fsf_req *fsf_req)
|
||||||
zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter,
|
|
||||||
struct fsf_status_read_buffer *status_buffer)
|
|
||||||
{
|
{
|
||||||
|
struct fsf_status_read_buffer *status_buffer = (void*)fsf_req->data;
|
||||||
|
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||||
struct fsf_plogi *els_plogi;
|
struct fsf_plogi *els_plogi;
|
||||||
struct zfcp_port *port;
|
struct zfcp_port *port;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
@@ -1428,14 +1429,14 @@ zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter,
|
|||||||
status_buffer->d_id,
|
status_buffer->d_id,
|
||||||
zfcp_get_busid_by_adapter(adapter));
|
zfcp_get_busid_by_adapter(adapter));
|
||||||
} else {
|
} else {
|
||||||
zfcp_erp_port_forced_reopen(port, 0);
|
zfcp_erp_port_forced_reopen(port, 0, 83, fsf_req);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void zfcp_fsf_incoming_els_logo(struct zfcp_fsf_req *fsf_req)
|
||||||
zfcp_fsf_incoming_els_logo(struct zfcp_adapter *adapter,
|
|
||||||
struct fsf_status_read_buffer *status_buffer)
|
|
||||||
{
|
{
|
||||||
|
struct fsf_status_read_buffer *status_buffer = (void*)fsf_req->data;
|
||||||
|
struct zfcp_adapter *adapter = fsf_req->adapter;
|
||||||
struct fcp_logo *els_logo = (struct fcp_logo *) status_buffer->payload;
|
struct fcp_logo *els_logo = (struct fcp_logo *) status_buffer->payload;
|
||||||
struct zfcp_port *port;
|
struct zfcp_port *port;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
@@ -1453,7 +1454,7 @@ zfcp_fsf_incoming_els_logo(struct zfcp_adapter *adapter,
|
|||||||
status_buffer->d_id,
|
status_buffer->d_id,
|
||||||
zfcp_get_busid_by_adapter(adapter));
|
zfcp_get_busid_by_adapter(adapter));
|
||||||
} else {
|
} else {
|
||||||
zfcp_erp_port_forced_reopen(port, 0);
|
zfcp_erp_port_forced_reopen(port, 0, 84, fsf_req);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1480,12 +1481,12 @@ zfcp_fsf_incoming_els(struct zfcp_fsf_req *fsf_req)
|
|||||||
|
|
||||||
zfcp_san_dbf_event_incoming_els(fsf_req);
|
zfcp_san_dbf_event_incoming_els(fsf_req);
|
||||||
if (els_type == LS_PLOGI)
|
if (els_type == LS_PLOGI)
|
||||||
zfcp_fsf_incoming_els_plogi(adapter, status_buffer);
|
zfcp_fsf_incoming_els_plogi(fsf_req);
|
||||||
else if (els_type == LS_LOGO)
|
else if (els_type == LS_LOGO)
|
||||||
zfcp_fsf_incoming_els_logo(adapter, status_buffer);
|
zfcp_fsf_incoming_els_logo(fsf_req);
|
||||||
else if ((els_type & 0xffff0000) == LS_RSCN)
|
else if ((els_type & 0xffff0000) == LS_RSCN)
|
||||||
/* we are only concerned with the command, not the length */
|
/* we are only concerned with the command, not the length */
|
||||||
zfcp_fsf_incoming_els_rscn(adapter, status_buffer);
|
zfcp_fsf_incoming_els_rscn(fsf_req);
|
||||||
else
|
else
|
||||||
zfcp_fsf_incoming_els_unknown(adapter, status_buffer);
|
zfcp_fsf_incoming_els_unknown(adapter, status_buffer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,9 +170,10 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device)
|
|||||||
BUG_ON(!zfcp_reqlist_isempty(adapter));
|
BUG_ON(!zfcp_reqlist_isempty(adapter));
|
||||||
adapter->req_no = 0;
|
adapter->req_no = 0;
|
||||||
|
|
||||||
zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING,
|
zfcp_erp_modify_adapter_status(adapter, 10, NULL,
|
||||||
ZFCP_SET);
|
ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET);
|
||||||
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
|
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85,
|
||||||
|
NULL);
|
||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@@ -197,7 +198,7 @@ zfcp_ccw_set_offline(struct ccw_device *ccw_device)
|
|||||||
|
|
||||||
down(&zfcp_data.config_sema);
|
down(&zfcp_data.config_sema);
|
||||||
adapter = dev_get_drvdata(&ccw_device->dev);
|
adapter = dev_get_drvdata(&ccw_device->dev);
|
||||||
zfcp_erp_adapter_shutdown(adapter, 0);
|
zfcp_erp_adapter_shutdown(adapter, 0, 86, NULL);
|
||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
zfcp_erp_thread_kill(adapter);
|
zfcp_erp_thread_kill(adapter);
|
||||||
up(&zfcp_data.config_sema);
|
up(&zfcp_data.config_sema);
|
||||||
@@ -223,24 +224,21 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
|
|||||||
case CIO_GONE:
|
case CIO_GONE:
|
||||||
ZFCP_LOG_NORMAL("adapter %s: device gone\n",
|
ZFCP_LOG_NORMAL("adapter %s: device gone\n",
|
||||||
zfcp_get_busid_by_adapter(adapter));
|
zfcp_get_busid_by_adapter(adapter));
|
||||||
debug_text_event(adapter->erp_dbf,1,"dev_gone");
|
zfcp_erp_adapter_shutdown(adapter, 0, 87, NULL);
|
||||||
zfcp_erp_adapter_shutdown(adapter, 0);
|
|
||||||
break;
|
break;
|
||||||
case CIO_NO_PATH:
|
case CIO_NO_PATH:
|
||||||
ZFCP_LOG_NORMAL("adapter %s: no path\n",
|
ZFCP_LOG_NORMAL("adapter %s: no path\n",
|
||||||
zfcp_get_busid_by_adapter(adapter));
|
zfcp_get_busid_by_adapter(adapter));
|
||||||
debug_text_event(adapter->erp_dbf,1,"no_path");
|
zfcp_erp_adapter_shutdown(adapter, 0, 88, NULL);
|
||||||
zfcp_erp_adapter_shutdown(adapter, 0);
|
|
||||||
break;
|
break;
|
||||||
case CIO_OPER:
|
case CIO_OPER:
|
||||||
ZFCP_LOG_NORMAL("adapter %s: operational again\n",
|
ZFCP_LOG_NORMAL("adapter %s: operational again\n",
|
||||||
zfcp_get_busid_by_adapter(adapter));
|
zfcp_get_busid_by_adapter(adapter));
|
||||||
debug_text_event(adapter->erp_dbf,1,"dev_oper");
|
zfcp_erp_modify_adapter_status(adapter, 11, NULL,
|
||||||
zfcp_erp_modify_adapter_status(adapter,
|
|
||||||
ZFCP_STATUS_COMMON_RUNNING,
|
ZFCP_STATUS_COMMON_RUNNING,
|
||||||
ZFCP_SET);
|
ZFCP_SET);
|
||||||
zfcp_erp_adapter_reopen(adapter,
|
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED,
|
||||||
ZFCP_STATUS_COMMON_ERP_FAILED);
|
89, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
@@ -272,7 +270,7 @@ zfcp_ccw_shutdown(struct ccw_device *cdev)
|
|||||||
|
|
||||||
down(&zfcp_data.config_sema);
|
down(&zfcp_data.config_sema);
|
||||||
adapter = dev_get_drvdata(&cdev->dev);
|
adapter = dev_get_drvdata(&cdev->dev);
|
||||||
zfcp_erp_adapter_shutdown(adapter, 0);
|
zfcp_erp_adapter_shutdown(adapter, 0, 90, NULL);
|
||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
up(&zfcp_data.config_sema);
|
up(&zfcp_data.config_sema);
|
||||||
}
|
}
|
||||||
|
|||||||
+806
-485
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,228 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the zfcp device driver for
|
||||||
|
* FCP adapters for IBM System z9 and zSeries.
|
||||||
|
*
|
||||||
|
* Copyright IBM Corp. 2008, 2008
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ZFCP_DBF_H
|
||||||
|
#define ZFCP_DBF_H
|
||||||
|
|
||||||
|
#include "zfcp_fsf.h"
|
||||||
|
|
||||||
|
#define ZFCP_DBF_TAG_SIZE 4
|
||||||
|
|
||||||
|
struct zfcp_dbf_dump {
|
||||||
|
u8 tag[ZFCP_DBF_TAG_SIZE];
|
||||||
|
u32 total_size; /* size of total dump data */
|
||||||
|
u32 offset; /* how much data has being already dumped */
|
||||||
|
u32 size; /* how much data comes with this record */
|
||||||
|
u8 data[]; /* dump data */
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_rec_dbf_record_thread {
|
||||||
|
u32 total;
|
||||||
|
u32 ready;
|
||||||
|
u32 running;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_rec_dbf_record_target {
|
||||||
|
u64 ref;
|
||||||
|
u32 status;
|
||||||
|
u32 d_id;
|
||||||
|
u64 wwpn;
|
||||||
|
u64 fcp_lun;
|
||||||
|
u32 erp_count;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_rec_dbf_record_trigger {
|
||||||
|
u8 want;
|
||||||
|
u8 need;
|
||||||
|
u32 as;
|
||||||
|
u32 ps;
|
||||||
|
u32 us;
|
||||||
|
u64 ref;
|
||||||
|
u64 action;
|
||||||
|
u64 wwpn;
|
||||||
|
u64 fcp_lun;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_rec_dbf_record_action {
|
||||||
|
u32 status;
|
||||||
|
u32 step;
|
||||||
|
u64 action;
|
||||||
|
u64 fsf_req;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_rec_dbf_record {
|
||||||
|
u8 id;
|
||||||
|
u8 id2;
|
||||||
|
union {
|
||||||
|
struct zfcp_rec_dbf_record_action action;
|
||||||
|
struct zfcp_rec_dbf_record_thread thread;
|
||||||
|
struct zfcp_rec_dbf_record_target target;
|
||||||
|
struct zfcp_rec_dbf_record_trigger trigger;
|
||||||
|
} u;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
enum {
|
||||||
|
ZFCP_REC_DBF_ID_ACTION,
|
||||||
|
ZFCP_REC_DBF_ID_THREAD,
|
||||||
|
ZFCP_REC_DBF_ID_TARGET,
|
||||||
|
ZFCP_REC_DBF_ID_TRIGGER,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct zfcp_hba_dbf_record_response {
|
||||||
|
u32 fsf_command;
|
||||||
|
u64 fsf_reqid;
|
||||||
|
u32 fsf_seqno;
|
||||||
|
u64 fsf_issued;
|
||||||
|
u32 fsf_prot_status;
|
||||||
|
u32 fsf_status;
|
||||||
|
u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE];
|
||||||
|
u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE];
|
||||||
|
u32 fsf_req_status;
|
||||||
|
u8 sbal_first;
|
||||||
|
u8 sbal_curr;
|
||||||
|
u8 sbal_last;
|
||||||
|
u8 pool;
|
||||||
|
u64 erp_action;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
u64 cmnd;
|
||||||
|
u64 serial;
|
||||||
|
} fcp;
|
||||||
|
struct {
|
||||||
|
u64 wwpn;
|
||||||
|
u32 d_id;
|
||||||
|
u32 port_handle;
|
||||||
|
} port;
|
||||||
|
struct {
|
||||||
|
u64 wwpn;
|
||||||
|
u64 fcp_lun;
|
||||||
|
u32 port_handle;
|
||||||
|
u32 lun_handle;
|
||||||
|
} unit;
|
||||||
|
struct {
|
||||||
|
u32 d_id;
|
||||||
|
u8 ls_code;
|
||||||
|
} els;
|
||||||
|
} u;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_hba_dbf_record_status {
|
||||||
|
u8 failed;
|
||||||
|
u32 status_type;
|
||||||
|
u32 status_subtype;
|
||||||
|
struct fsf_queue_designator
|
||||||
|
queue_designator;
|
||||||
|
u32 payload_size;
|
||||||
|
#define ZFCP_DBF_UNSOL_PAYLOAD 80
|
||||||
|
#define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32
|
||||||
|
#define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56
|
||||||
|
#define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32)
|
||||||
|
u8 payload[ZFCP_DBF_UNSOL_PAYLOAD];
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_hba_dbf_record_qdio {
|
||||||
|
u32 status;
|
||||||
|
u32 qdio_error;
|
||||||
|
u32 siga_error;
|
||||||
|
u8 sbal_index;
|
||||||
|
u8 sbal_count;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_hba_dbf_record {
|
||||||
|
u8 tag[ZFCP_DBF_TAG_SIZE];
|
||||||
|
u8 tag2[ZFCP_DBF_TAG_SIZE];
|
||||||
|
union {
|
||||||
|
struct zfcp_hba_dbf_record_response response;
|
||||||
|
struct zfcp_hba_dbf_record_status status;
|
||||||
|
struct zfcp_hba_dbf_record_qdio qdio;
|
||||||
|
} u;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_san_dbf_record_ct_request {
|
||||||
|
u16 cmd_req_code;
|
||||||
|
u8 revision;
|
||||||
|
u8 gs_type;
|
||||||
|
u8 gs_subtype;
|
||||||
|
u8 options;
|
||||||
|
u16 max_res_size;
|
||||||
|
u32 len;
|
||||||
|
#define ZFCP_DBF_CT_PAYLOAD 24
|
||||||
|
u8 payload[ZFCP_DBF_CT_PAYLOAD];
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_san_dbf_record_ct_response {
|
||||||
|
u16 cmd_rsp_code;
|
||||||
|
u8 revision;
|
||||||
|
u8 reason_code;
|
||||||
|
u8 expl;
|
||||||
|
u8 vendor_unique;
|
||||||
|
u32 len;
|
||||||
|
u8 payload[ZFCP_DBF_CT_PAYLOAD];
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_san_dbf_record_els {
|
||||||
|
u8 ls_code;
|
||||||
|
u32 len;
|
||||||
|
#define ZFCP_DBF_ELS_PAYLOAD 32
|
||||||
|
#define ZFCP_DBF_ELS_MAX_PAYLOAD 1024
|
||||||
|
u8 payload[ZFCP_DBF_ELS_PAYLOAD];
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_san_dbf_record {
|
||||||
|
u8 tag[ZFCP_DBF_TAG_SIZE];
|
||||||
|
u64 fsf_reqid;
|
||||||
|
u32 fsf_seqno;
|
||||||
|
u32 s_id;
|
||||||
|
u32 d_id;
|
||||||
|
union {
|
||||||
|
struct zfcp_san_dbf_record_ct_request ct_req;
|
||||||
|
struct zfcp_san_dbf_record_ct_response ct_resp;
|
||||||
|
struct zfcp_san_dbf_record_els els;
|
||||||
|
} u;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct zfcp_scsi_dbf_record {
|
||||||
|
u8 tag[ZFCP_DBF_TAG_SIZE];
|
||||||
|
u8 tag2[ZFCP_DBF_TAG_SIZE];
|
||||||
|
u32 scsi_id;
|
||||||
|
u32 scsi_lun;
|
||||||
|
u32 scsi_result;
|
||||||
|
u64 scsi_cmnd;
|
||||||
|
u64 scsi_serial;
|
||||||
|
#define ZFCP_DBF_SCSI_OPCODE 16
|
||||||
|
u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE];
|
||||||
|
u8 scsi_retries;
|
||||||
|
u8 scsi_allowed;
|
||||||
|
u64 fsf_reqid;
|
||||||
|
u32 fsf_seqno;
|
||||||
|
u64 fsf_issued;
|
||||||
|
u64 old_fsf_reqid;
|
||||||
|
u8 rsp_validity;
|
||||||
|
u8 rsp_scsi_status;
|
||||||
|
u32 rsp_resid;
|
||||||
|
u8 rsp_code;
|
||||||
|
#define ZFCP_DBF_SCSI_FCP_SNS_INFO 16
|
||||||
|
#define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256
|
||||||
|
u32 sns_info_len;
|
||||||
|
u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO];
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
#endif /* ZFCP_DBF_H */
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
#include <asm/qdio.h>
|
#include <asm/qdio.h>
|
||||||
#include <asm/debug.h>
|
#include <asm/debug.h>
|
||||||
#include <asm/ebcdic.h>
|
#include <asm/ebcdic.h>
|
||||||
|
#include "zfcp_dbf.h"
|
||||||
#include "zfcp_fsf.h"
|
#include "zfcp_fsf.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -261,167 +262,6 @@ struct fcp_logo {
|
|||||||
wwn_t nport_wwpn;
|
wwn_t nport_wwpn;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
/*
|
|
||||||
* DBF stuff
|
|
||||||
*/
|
|
||||||
#define ZFCP_DBF_TAG_SIZE 4
|
|
||||||
|
|
||||||
struct zfcp_dbf_dump {
|
|
||||||
u8 tag[ZFCP_DBF_TAG_SIZE];
|
|
||||||
u32 total_size; /* size of total dump data */
|
|
||||||
u32 offset; /* how much data has being already dumped */
|
|
||||||
u32 size; /* how much data comes with this record */
|
|
||||||
u8 data[]; /* dump data */
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
/* FIXME: to be inflated when reworking the erp dbf */
|
|
||||||
struct zfcp_erp_dbf_record {
|
|
||||||
u8 dummy[16];
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_hba_dbf_record_response {
|
|
||||||
u32 fsf_command;
|
|
||||||
u64 fsf_reqid;
|
|
||||||
u32 fsf_seqno;
|
|
||||||
u64 fsf_issued;
|
|
||||||
u32 fsf_prot_status;
|
|
||||||
u32 fsf_status;
|
|
||||||
u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE];
|
|
||||||
u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE];
|
|
||||||
u32 fsf_req_status;
|
|
||||||
u8 sbal_first;
|
|
||||||
u8 sbal_curr;
|
|
||||||
u8 sbal_last;
|
|
||||||
u8 pool;
|
|
||||||
u64 erp_action;
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
u64 scsi_cmnd;
|
|
||||||
u64 scsi_serial;
|
|
||||||
} send_fcp;
|
|
||||||
struct {
|
|
||||||
u64 wwpn;
|
|
||||||
u32 d_id;
|
|
||||||
u32 port_handle;
|
|
||||||
} port;
|
|
||||||
struct {
|
|
||||||
u64 wwpn;
|
|
||||||
u64 fcp_lun;
|
|
||||||
u32 port_handle;
|
|
||||||
u32 lun_handle;
|
|
||||||
} unit;
|
|
||||||
struct {
|
|
||||||
u32 d_id;
|
|
||||||
u8 ls_code;
|
|
||||||
} send_els;
|
|
||||||
} data;
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_hba_dbf_record_status {
|
|
||||||
u8 failed;
|
|
||||||
u32 status_type;
|
|
||||||
u32 status_subtype;
|
|
||||||
struct fsf_queue_designator
|
|
||||||
queue_designator;
|
|
||||||
u32 payload_size;
|
|
||||||
#define ZFCP_DBF_UNSOL_PAYLOAD 80
|
|
||||||
#define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32
|
|
||||||
#define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56
|
|
||||||
#define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32)
|
|
||||||
u8 payload[ZFCP_DBF_UNSOL_PAYLOAD];
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_hba_dbf_record_qdio {
|
|
||||||
u32 status;
|
|
||||||
u32 qdio_error;
|
|
||||||
u32 siga_error;
|
|
||||||
u8 sbal_index;
|
|
||||||
u8 sbal_count;
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_hba_dbf_record {
|
|
||||||
u8 tag[ZFCP_DBF_TAG_SIZE];
|
|
||||||
u8 tag2[ZFCP_DBF_TAG_SIZE];
|
|
||||||
union {
|
|
||||||
struct zfcp_hba_dbf_record_response response;
|
|
||||||
struct zfcp_hba_dbf_record_status status;
|
|
||||||
struct zfcp_hba_dbf_record_qdio qdio;
|
|
||||||
} type;
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_san_dbf_record_ct {
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
u16 cmd_req_code;
|
|
||||||
u8 revision;
|
|
||||||
u8 gs_type;
|
|
||||||
u8 gs_subtype;
|
|
||||||
u8 options;
|
|
||||||
u16 max_res_size;
|
|
||||||
} request;
|
|
||||||
struct {
|
|
||||||
u16 cmd_rsp_code;
|
|
||||||
u8 revision;
|
|
||||||
u8 reason_code;
|
|
||||||
u8 reason_code_expl;
|
|
||||||
u8 vendor_unique;
|
|
||||||
} response;
|
|
||||||
} type;
|
|
||||||
u32 payload_size;
|
|
||||||
#define ZFCP_DBF_CT_PAYLOAD 24
|
|
||||||
u8 payload[ZFCP_DBF_CT_PAYLOAD];
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_san_dbf_record_els {
|
|
||||||
u8 ls_code;
|
|
||||||
u32 payload_size;
|
|
||||||
#define ZFCP_DBF_ELS_PAYLOAD 32
|
|
||||||
#define ZFCP_DBF_ELS_MAX_PAYLOAD 1024
|
|
||||||
u8 payload[ZFCP_DBF_ELS_PAYLOAD];
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_san_dbf_record {
|
|
||||||
u8 tag[ZFCP_DBF_TAG_SIZE];
|
|
||||||
u64 fsf_reqid;
|
|
||||||
u32 fsf_seqno;
|
|
||||||
u32 s_id;
|
|
||||||
u32 d_id;
|
|
||||||
union {
|
|
||||||
struct zfcp_san_dbf_record_ct ct;
|
|
||||||
struct zfcp_san_dbf_record_els els;
|
|
||||||
} type;
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
struct zfcp_scsi_dbf_record {
|
|
||||||
u8 tag[ZFCP_DBF_TAG_SIZE];
|
|
||||||
u8 tag2[ZFCP_DBF_TAG_SIZE];
|
|
||||||
u32 scsi_id;
|
|
||||||
u32 scsi_lun;
|
|
||||||
u32 scsi_result;
|
|
||||||
u64 scsi_cmnd;
|
|
||||||
u64 scsi_serial;
|
|
||||||
#define ZFCP_DBF_SCSI_OPCODE 16
|
|
||||||
u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE];
|
|
||||||
u8 scsi_retries;
|
|
||||||
u8 scsi_allowed;
|
|
||||||
u64 fsf_reqid;
|
|
||||||
u32 fsf_seqno;
|
|
||||||
u64 fsf_issued;
|
|
||||||
union {
|
|
||||||
u64 old_fsf_reqid;
|
|
||||||
struct {
|
|
||||||
u8 rsp_validity;
|
|
||||||
u8 rsp_scsi_status;
|
|
||||||
u32 rsp_resid;
|
|
||||||
u8 rsp_code;
|
|
||||||
#define ZFCP_DBF_SCSI_FCP_SNS_INFO 16
|
|
||||||
#define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256
|
|
||||||
u32 sns_info_len;
|
|
||||||
u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO];
|
|
||||||
} fcp;
|
|
||||||
} type;
|
|
||||||
} __attribute__ ((packed));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FC-FS stuff
|
* FC-FS stuff
|
||||||
*/
|
*/
|
||||||
@@ -634,7 +474,6 @@ do { \
|
|||||||
ZFCP_STATUS_PORT_NO_SCSI_ID)
|
ZFCP_STATUS_PORT_NO_SCSI_ID)
|
||||||
|
|
||||||
/* logical unit status */
|
/* logical unit status */
|
||||||
#define ZFCP_STATUS_UNIT_NOTSUPPUNITRESET 0x00000001
|
|
||||||
#define ZFCP_STATUS_UNIT_TEMPORARY 0x00000002
|
#define ZFCP_STATUS_UNIT_TEMPORARY 0x00000002
|
||||||
#define ZFCP_STATUS_UNIT_SHARED 0x00000004
|
#define ZFCP_STATUS_UNIT_SHARED 0x00000004
|
||||||
#define ZFCP_STATUS_UNIT_READONLY 0x00000008
|
#define ZFCP_STATUS_UNIT_READONLY 0x00000008
|
||||||
@@ -917,15 +756,15 @@ struct zfcp_adapter {
|
|||||||
u32 erp_low_mem_count; /* nr of erp actions waiting
|
u32 erp_low_mem_count; /* nr of erp actions waiting
|
||||||
for memory */
|
for memory */
|
||||||
struct zfcp_port *nameserver_port; /* adapter's nameserver */
|
struct zfcp_port *nameserver_port; /* adapter's nameserver */
|
||||||
debug_info_t *erp_dbf;
|
debug_info_t *rec_dbf;
|
||||||
debug_info_t *hba_dbf;
|
debug_info_t *hba_dbf;
|
||||||
debug_info_t *san_dbf; /* debug feature areas */
|
debug_info_t *san_dbf; /* debug feature areas */
|
||||||
debug_info_t *scsi_dbf;
|
debug_info_t *scsi_dbf;
|
||||||
spinlock_t erp_dbf_lock;
|
spinlock_t rec_dbf_lock;
|
||||||
spinlock_t hba_dbf_lock;
|
spinlock_t hba_dbf_lock;
|
||||||
spinlock_t san_dbf_lock;
|
spinlock_t san_dbf_lock;
|
||||||
spinlock_t scsi_dbf_lock;
|
spinlock_t scsi_dbf_lock;
|
||||||
struct zfcp_erp_dbf_record erp_dbf_buf;
|
struct zfcp_rec_dbf_record rec_dbf_buf;
|
||||||
struct zfcp_hba_dbf_record hba_dbf_buf;
|
struct zfcp_hba_dbf_record hba_dbf_buf;
|
||||||
struct zfcp_san_dbf_record san_dbf_buf;
|
struct zfcp_san_dbf_record san_dbf_buf;
|
||||||
struct zfcp_scsi_dbf_record scsi_dbf_buf;
|
struct zfcp_scsi_dbf_record scsi_dbf_buf;
|
||||||
|
|||||||
+221
-465
File diff suppressed because it is too large
Load Diff
@@ -131,22 +131,25 @@ extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, int);
|
|||||||
extern struct fc_function_template zfcp_transport_functions;
|
extern struct fc_function_template zfcp_transport_functions;
|
||||||
|
|
||||||
/******************************** ERP ****************************************/
|
/******************************** ERP ****************************************/
|
||||||
extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u32, int);
|
extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u8, void *,
|
||||||
extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int);
|
u32, int);
|
||||||
extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int);
|
extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, u8, void *);
|
||||||
extern void zfcp_erp_adapter_failed(struct zfcp_adapter *);
|
extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, u8, void *);
|
||||||
|
extern void zfcp_erp_adapter_failed(struct zfcp_adapter *, u8, void *);
|
||||||
|
|
||||||
extern void zfcp_erp_modify_port_status(struct zfcp_port *, u32, int);
|
extern void zfcp_erp_modify_port_status(struct zfcp_port *, u8, void *, u32,
|
||||||
extern int zfcp_erp_port_reopen(struct zfcp_port *, int);
|
int);
|
||||||
extern int zfcp_erp_port_shutdown(struct zfcp_port *, int);
|
extern int zfcp_erp_port_reopen(struct zfcp_port *, int, u8, void *);
|
||||||
extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int);
|
extern int zfcp_erp_port_shutdown(struct zfcp_port *, int, u8, void *);
|
||||||
extern void zfcp_erp_port_failed(struct zfcp_port *);
|
extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int, u8, void *);
|
||||||
extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int);
|
extern void zfcp_erp_port_failed(struct zfcp_port *, u8, void *);
|
||||||
|
extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int, u8, void *);
|
||||||
|
|
||||||
extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u32, int);
|
extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u8, void *, u32,
|
||||||
extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int);
|
int);
|
||||||
extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int);
|
extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int, u8, void *);
|
||||||
extern void zfcp_erp_unit_failed(struct zfcp_unit *);
|
extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int, u8, void *);
|
||||||
|
extern void zfcp_erp_unit_failed(struct zfcp_unit *, u8, void *);
|
||||||
|
|
||||||
extern int zfcp_erp_thread_setup(struct zfcp_adapter *);
|
extern int zfcp_erp_thread_setup(struct zfcp_adapter *);
|
||||||
extern int zfcp_erp_thread_kill(struct zfcp_adapter *);
|
extern int zfcp_erp_thread_kill(struct zfcp_adapter *);
|
||||||
@@ -155,15 +158,25 @@ extern void zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long);
|
|||||||
|
|
||||||
extern int zfcp_test_link(struct zfcp_port *);
|
extern int zfcp_test_link(struct zfcp_port *);
|
||||||
|
|
||||||
extern void zfcp_erp_port_boxed(struct zfcp_port *);
|
extern void zfcp_erp_port_boxed(struct zfcp_port *, u8 id, void *ref);
|
||||||
extern void zfcp_erp_unit_boxed(struct zfcp_unit *);
|
extern void zfcp_erp_unit_boxed(struct zfcp_unit *, u8 id, void *ref);
|
||||||
extern void zfcp_erp_port_access_denied(struct zfcp_port *);
|
extern void zfcp_erp_port_access_denied(struct zfcp_port *, u8 id, void *ref);
|
||||||
extern void zfcp_erp_unit_access_denied(struct zfcp_unit *);
|
extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8 id, void *ref);
|
||||||
extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *);
|
extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, u8, void *);
|
||||||
extern void zfcp_erp_port_access_changed(struct zfcp_port *);
|
extern void zfcp_erp_port_access_changed(struct zfcp_port *, u8, void *);
|
||||||
extern void zfcp_erp_unit_access_changed(struct zfcp_unit *);
|
extern void zfcp_erp_unit_access_changed(struct zfcp_unit *, u8, void *);
|
||||||
|
|
||||||
/******************************** AUX ****************************************/
|
/******************************** AUX ****************************************/
|
||||||
|
extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter,
|
||||||
|
int lock);
|
||||||
|
extern void zfcp_rec_dbf_event_adapter(u8 id, void *ref, struct zfcp_adapter *);
|
||||||
|
extern void zfcp_rec_dbf_event_port(u8 id, void *ref, struct zfcp_port *port);
|
||||||
|
extern void zfcp_rec_dbf_event_unit(u8 id, void *ref, struct zfcp_unit *unit);
|
||||||
|
extern void zfcp_rec_dbf_event_trigger(u8 id, void *ref, u8 want, u8 need,
|
||||||
|
void *action, struct zfcp_adapter *,
|
||||||
|
struct zfcp_port *, struct zfcp_unit *);
|
||||||
|
extern void zfcp_rec_dbf_event_action(u8 id, struct zfcp_erp_action *);
|
||||||
|
|
||||||
extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *);
|
extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *);
|
||||||
extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *,
|
extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *,
|
||||||
struct fsf_status_read_buffer *);
|
struct fsf_status_read_buffer *);
|
||||||
|
|||||||
+90
-307
File diff suppressed because it is too large
Load Diff
@@ -175,8 +175,9 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter, unsigned int status,
|
|||||||
* which is set again in case we have missed by a mile.
|
* which is set again in case we have missed by a mile.
|
||||||
*/
|
*/
|
||||||
zfcp_erp_adapter_reopen(adapter,
|
zfcp_erp_adapter_reopen(adapter,
|
||||||
ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |
|
ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |
|
||||||
ZFCP_STATUS_COMMON_ERP_FAILED);
|
ZFCP_STATUS_COMMON_ERP_FAILED, 140,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@@ -239,8 +240,6 @@ static void zfcp_qdio_reqid_check(struct zfcp_adapter *adapter,
|
|||||||
struct zfcp_fsf_req *fsf_req;
|
struct zfcp_fsf_req *fsf_req;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
debug_long_event(adapter->erp_dbf, 4, req_id);
|
|
||||||
|
|
||||||
spin_lock_irqsave(&adapter->req_list_lock, flags);
|
spin_lock_irqsave(&adapter->req_list_lock, flags);
|
||||||
fsf_req = zfcp_reqlist_find(adapter, req_id);
|
fsf_req = zfcp_reqlist_find(adapter, req_id);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *,
|
|||||||
void (*done) (struct scsi_cmnd *));
|
void (*done) (struct scsi_cmnd *));
|
||||||
static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *);
|
static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *);
|
||||||
static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *);
|
static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *);
|
||||||
|
static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *);
|
||||||
static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *);
|
static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *);
|
||||||
static int zfcp_task_management_function(struct zfcp_unit *, u8,
|
static int zfcp_task_management_function(struct zfcp_unit *, u8,
|
||||||
struct scsi_cmnd *);
|
struct scsi_cmnd *);
|
||||||
@@ -51,6 +52,7 @@ struct zfcp_data zfcp_data = {
|
|||||||
.queuecommand = zfcp_scsi_queuecommand,
|
.queuecommand = zfcp_scsi_queuecommand,
|
||||||
.eh_abort_handler = zfcp_scsi_eh_abort_handler,
|
.eh_abort_handler = zfcp_scsi_eh_abort_handler,
|
||||||
.eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
|
.eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
|
||||||
|
.eh_target_reset_handler = zfcp_scsi_eh_target_reset_handler,
|
||||||
.eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler,
|
.eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler,
|
||||||
.can_queue = 4096,
|
.can_queue = 4096,
|
||||||
.this_id = -1,
|
.this_id = -1,
|
||||||
@@ -179,11 +181,10 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
|
|||||||
struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
|
struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
|
||||||
|
|
||||||
if (unit) {
|
if (unit) {
|
||||||
zfcp_erp_wait(unit->port->adapter);
|
|
||||||
atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
|
atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
|
||||||
sdpnt->hostdata = NULL;
|
sdpnt->hostdata = NULL;
|
||||||
unit->device = NULL;
|
unit->device = NULL;
|
||||||
zfcp_erp_unit_failed(unit);
|
zfcp_erp_unit_failed(unit, 12, NULL);
|
||||||
zfcp_unit_put(unit);
|
zfcp_unit_put(unit);
|
||||||
} else
|
} else
|
||||||
ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at "
|
ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at "
|
||||||
@@ -442,58 +443,32 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
|
||||||
zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
|
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata;
|
struct zfcp_unit *unit = scpnt->device->hostdata;
|
||||||
|
|
||||||
if (!unit) {
|
if (!unit) {
|
||||||
ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n");
|
WARN_ON(1);
|
||||||
retval = SUCCESS;
|
return SUCCESS;
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
ZFCP_LOG_NORMAL("resetting unit 0x%016Lx on port 0x%016Lx, adapter %s\n",
|
retval = zfcp_task_management_function(unit,
|
||||||
unit->fcp_lun, unit->port->wwpn,
|
FCP_LOGICAL_UNIT_RESET,
|
||||||
zfcp_get_busid_by_adapter(unit->port->adapter));
|
scpnt);
|
||||||
|
return retval ? FAILED : SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *scpnt)
|
||||||
* If we do not know whether the unit supports 'logical unit reset'
|
{
|
||||||
* then try 'logical unit reset' and proceed with 'target reset'
|
int retval;
|
||||||
* if 'logical unit reset' fails.
|
struct zfcp_unit *unit = scpnt->device->hostdata;
|
||||||
* If the unit is known not to support 'logical unit reset' then
|
|
||||||
* skip 'logical unit reset' and try 'target reset' immediately.
|
if (!unit) {
|
||||||
*/
|
WARN_ON(1);
|
||||||
if (!atomic_test_mask(ZFCP_STATUS_UNIT_NOTSUPPUNITRESET,
|
return SUCCESS;
|
||||||
&unit->status)) {
|
|
||||||
retval = zfcp_task_management_function(unit,
|
|
||||||
FCP_LOGICAL_UNIT_RESET,
|
|
||||||
scpnt);
|
|
||||||
if (retval) {
|
|
||||||
ZFCP_LOG_DEBUG("unit reset failed (unit=%p)\n", unit);
|
|
||||||
if (retval == -ENOTSUPP)
|
|
||||||
atomic_set_mask
|
|
||||||
(ZFCP_STATUS_UNIT_NOTSUPPUNITRESET,
|
|
||||||
&unit->status);
|
|
||||||
/* fall through and try 'target reset' next */
|
|
||||||
} else {
|
|
||||||
ZFCP_LOG_DEBUG("unit reset succeeded (unit=%p)\n",
|
|
||||||
unit);
|
|
||||||
/* avoid 'target reset' */
|
|
||||||
retval = SUCCESS;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
retval = zfcp_task_management_function(unit, FCP_TARGET_RESET, scpnt);
|
retval = zfcp_task_management_function(unit, FCP_TARGET_RESET, scpnt);
|
||||||
if (retval) {
|
return retval ? FAILED : SUCCESS;
|
||||||
ZFCP_LOG_DEBUG("target reset failed (unit=%p)\n", unit);
|
|
||||||
retval = FAILED;
|
|
||||||
} else {
|
|
||||||
ZFCP_LOG_DEBUG("target reset succeeded (unit=%p)\n", unit);
|
|
||||||
retval = SUCCESS;
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -553,7 +528,7 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
|
|||||||
unit->fcp_lun, unit->port->wwpn,
|
unit->fcp_lun, unit->port->wwpn,
|
||||||
zfcp_get_busid_by_adapter(unit->port->adapter));
|
zfcp_get_busid_by_adapter(unit->port->adapter));
|
||||||
|
|
||||||
zfcp_erp_adapter_reopen(adapter, 0);
|
zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt);
|
||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ zfcp_sysfs_port_add_store(struct device *dev, struct device_attribute *attr, con
|
|||||||
|
|
||||||
retval = 0;
|
retval = 0;
|
||||||
|
|
||||||
zfcp_erp_port_reopen(port, 0);
|
zfcp_erp_port_reopen(port, 0, 91, NULL);
|
||||||
zfcp_erp_wait(port->adapter);
|
zfcp_erp_wait(port->adapter);
|
||||||
zfcp_port_put(port);
|
zfcp_port_put(port);
|
||||||
out:
|
out:
|
||||||
@@ -147,7 +147,7 @@ zfcp_sysfs_port_remove_store(struct device *dev, struct device_attribute *attr,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
zfcp_erp_port_shutdown(port, 0);
|
zfcp_erp_port_shutdown(port, 0, 92, NULL);
|
||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
zfcp_port_put(port);
|
zfcp_port_put(port);
|
||||||
zfcp_port_dequeue(port);
|
zfcp_port_dequeue(port);
|
||||||
@@ -191,9 +191,10 @@ zfcp_sysfs_adapter_failed_store(struct device *dev, struct device_attribute *att
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING,
|
zfcp_erp_modify_adapter_status(adapter, 44, NULL,
|
||||||
ZFCP_SET);
|
ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET);
|
||||||
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
|
zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 93,
|
||||||
|
NULL);
|
||||||
zfcp_erp_wait(adapter);
|
zfcp_erp_wait(adapter);
|
||||||
out:
|
out:
|
||||||
up(&zfcp_data.config_sema);
|
up(&zfcp_data.config_sema);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user