Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
torvalds committed Apr 18, 2008
2 parents eddeb0e + 94795b6 commit 2cca775
Show file tree
Hide file tree
Showing 133 changed files with 4,953 additions and 4,469 deletions.
12 changes: 11 additions & 1 deletion Documentation/scsi/st.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This file contains brief information about the SCSI tape driver.
The driver is currently maintained by Kai Mäkisara (email
[email protected])

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
Expand Down Expand Up @@ -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
'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
directory corresponding to the mode 0 auto-rewind device (e.g., st0).

Expand Down Expand Up @@ -372,6 +377,11 @@ MTSETDRVBUFFER
MT_ST_SYSV sets the SYSV semantics (mode)
MT_ST_NOWAIT enables immediate mode (i.e., don't wait for
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
compiled into the driver)
MT_ST_SETBOOLEANS
Expand Down
23 changes: 4 additions & 19 deletions arch/ia64/hp/sim/simscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,22 +201,6 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode)
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
simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
{
Expand Down Expand Up @@ -258,7 +242,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
buf[6] = 0; /* reserved */
buf[7] = 0; /* various flags */
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;
break;

Expand Down Expand Up @@ -306,14 +290,15 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
buf[5] = 0;
buf[6] = 2;
buf[7] = 0;
simscsi_fillresult(sc, buf, 8);
scsi_sg_copy_from_buffer(sc, buf, 8);
sc->result = GOOD;
break;

case MODE_SENSE:
case MODE_SENSE_10:
/* 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;
break;

Expand Down
52 changes: 29 additions & 23 deletions block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ struct bsg_device {
struct list_head done_list;
struct hlist_node dev_list;
atomic_t ref_count;
int minor;
int queued_cmds;
int done_cmds;
wait_queue_head_t wq_done;
Expand Down Expand Up @@ -368,7 +367,7 @@ static struct bsg_command *bsg_next_done_cmd(struct bsg_device *bd)

spin_lock_irq(&bd->lock);
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);
bd->done_cmds--;
}
Expand Down Expand Up @@ -468,8 +467,6 @@ static int bsg_complete_all_commands(struct bsg_device *bd)

dprintk("%s: entered\n", bd->name);

set_bit(BSG_F_BLOCK, &bd->flags);

/*
* wait for all commands to complete
*/
Expand Down Expand Up @@ -705,6 +702,7 @@ static struct bsg_device *bsg_alloc_device(void)
static int bsg_put_device(struct bsg_device *bd)
{
int ret = 0;
struct device *dev = bd->queue->bsg_dev.dev;

mutex_lock(&bsg_mutex);

Expand All @@ -730,6 +728,7 @@ static int bsg_put_device(struct bsg_device *bd)
kfree(bd);
out:
mutex_unlock(&bsg_mutex);
put_device(dev);
return ret;
}

Expand All @@ -738,22 +737,26 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
struct file *file)
{
struct bsg_device *bd;
int ret;
#ifdef BSG_DEBUG
unsigned char buf[32];
#endif
ret = blk_get_queue(rq);
if (ret)
return ERR_PTR(-ENXIO);

bd = bsg_alloc_device();
if (!bd)
if (!bd) {
blk_put_queue(rq);
return ERR_PTR(-ENOMEM);
}

bd->queue = rq;
kobject_get(&rq->kobj);
bsg_set_block(bd, file);

atomic_set(&bd->ref_count, 1);
bd->minor = iminor(inode);
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);
dprintk("bound to <%s>, max queue %d\n",
Expand All @@ -763,23 +766,21 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
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;

mutex_lock(&bsg_mutex);

hlist_for_each(entry, bsg_dev_idx_hash(minor)) {
bd = hlist_entry(entry, struct bsg_device, dev_list);
if (bd->minor == minor) {
hlist_for_each_entry(bd, entry, bsg_dev_idx_hash(minor), dev_list) {
if (bd->queue == q) {
atomic_inc(&bd->ref_count);
break;
goto found;
}

bd = NULL;
}

bd = NULL;
found:
mutex_unlock(&bsg_mutex);
return bd;
}
Expand All @@ -789,21 +790,27 @@ static struct bsg_device *bsg_get_device(struct inode *inode, struct file *file)
struct bsg_device *bd;
struct bsg_class_device *bcd;

bd = __bsg_get_device(iminor(inode));
if (bd)
return bd;

/*
* find the class device
*/
mutex_lock(&bsg_mutex);
bcd = idr_find(&bsg_minor_idr, iminor(inode));
if (bcd)
get_device(bcd->dev);
mutex_unlock(&bsg_mutex);

if (!bcd)
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)
Expand Down Expand Up @@ -942,7 +949,6 @@ void bsg_unregister_queue(struct request_queue *q)
class_device_unregister(bcd->class_dev);
put_device(bcd->dev);
bcd->class_dev = NULL;
bcd->dev = NULL;
mutex_unlock(&bsg_mutex);
}
EXPORT_SYMBOL_GPL(bsg_unregister_queue);
Expand Down
6 changes: 1 addition & 5 deletions drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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->sense_buffer[0] = 0x70; /* fixed format, current */
cmd->sense_buffer[2] = sk;
cmd->sense_buffer[7] = 18 - 8; /* additional sense length */
cmd->sense_buffer[12] = asc;
cmd->sense_buffer[13] = ascq;
scsi_build_sense_buffer(0, cmd->sense_buffer, sk, asc, ascq);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion drivers/base/transport_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ EXPORT_SYMBOL_GPL(anon_transport_class_register);
*/
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);

Expand Down
29 changes: 18 additions & 11 deletions drivers/message/fusion/mptbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ MODULE_VERSION(my_VERSION);
/*
* cmd line parameters
*/
static int mpt_msi_enable;
static int mpt_msi_enable = -1;
module_param(mpt_msi_enable, int, 0);
MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)");

Expand Down Expand Up @@ -1686,6 +1686,11 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
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)
pci_disable_io_access(pdev);

Expand Down Expand Up @@ -1831,7 +1836,7 @@ mpt_suspend(struct pci_dev *pdev, pm_message_t state)
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);

free_irq(ioc->pci_irq, ioc);
if (mpt_msi_enable)
if (ioc->msi_enable)
pci_disable_msi(ioc->pcidev);
ioc->pci_irq = -1;
pci_save_state(pdev);
Expand Down Expand Up @@ -2057,15 +2062,17 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) {
ioc->pci_irq = -1;
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",
ioc->name);
else
ioc->msi_enable = 0;
rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
IRQF_SHARED, ioc->name, ioc);
if (rc < 0) {
printk(MYIOC_s_ERR_FMT "Unable to allocate "
"interrupt %d!\n", ioc->name, ioc->pcidev->irq);
if (mpt_msi_enable)
if (ioc->msi_enable)
pci_disable_msi(ioc->pcidev);
return -EBUSY;
}
Expand Down Expand Up @@ -2173,7 +2180,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
/*
* 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);

if (ioc->bus_type == SAS) {
Expand Down Expand Up @@ -2261,7 +2268,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
out:
if ((ret != 0) && irq_allocated) {
free_irq(ioc->pci_irq, ioc);
if (mpt_msi_enable)
if (ioc->msi_enable)
pci_disable_msi(ioc->pcidev);
}
return ret;
Expand Down Expand Up @@ -2443,7 +2450,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)

if (ioc->pci_irq != -1) {
free_irq(ioc->pci_irq, ioc);
if (mpt_msi_enable)
if (ioc->msi_enable)
pci_disable_msi(ioc->pcidev);
ioc->pci_irq = -1;
}
Expand Down Expand Up @@ -5159,13 +5166,13 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc)
if (list_empty(&ioc->raid_data.inactive_list))
return;

down(&ioc->raid_data.inactive_list_mutex);
mutex_lock(&ioc->raid_data.inactive_list_mutex);
list_for_each_entry_safe(component_info, pNext,
&ioc->raid_data.inactive_list, list) {
list_del(&component_info->list);
kfree(component_info);
}
up(&ioc->raid_data.inactive_list_mutex);
mutex_unlock(&ioc->raid_data.inactive_list_mutex);
}

/**
Expand Down Expand Up @@ -5224,7 +5231,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
if (!handle_inactive_volumes)
goto out;

down(&ioc->raid_data.inactive_list_mutex);
mutex_lock(&ioc->raid_data.inactive_list_mutex);
for (i = 0; i < buffer->NumPhysDisks; i++) {
if(mpt_raid_phys_disk_pg0(ioc,
buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0)
Expand All @@ -5244,7 +5251,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
list_add_tail(&component_info->list,
&ioc->raid_data.inactive_list);
}
up(&ioc->raid_data.inactive_list_mutex);
mutex_unlock(&ioc->raid_data.inactive_list_mutex);

out:
if (buffer)
Expand Down
5 changes: 3 additions & 2 deletions drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/mutex.h>

#include "lsi/mpi_type.h"
#include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */
Expand Down Expand Up @@ -531,7 +532,7 @@ struct inactive_raid_component_info {
typedef struct _RaidCfgData {
IOCPage2_t *pIocPg2; /* table of Raid Volumes */
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
disk that belong in
inactive volumes */
Expand Down Expand Up @@ -630,6 +631,7 @@ typedef struct _MPT_ADAPTER
int mtrr_reg;
struct pci_dev *pcidev; /* struct pci_dev pointer */
int bars; /* bitmask of BAR's that must be configured */
int msi_enable;
u8 __iomem *memmap; /* mmap address */
struct Scsi_Host *sh; /* Scsi Host pointer */
SpiCfgData spi_data; /* Scsi config. data */
Expand Down Expand Up @@ -693,7 +695,6 @@ typedef struct _MPT_ADAPTER
struct mutex sas_discovery_mutex;
u8 sas_discovery_runtime;
u8 sas_discovery_ignore_events;
u16 handle;
int sas_index; /* index refrencing */
MPT_SAS_MGMT sas_mgmt;
struct work_struct sas_persist_task;
Expand Down
Loading

0 comments on commit 2cca775

Please sign in to comment.