Automatic merge of rsync://www.parisc-linux.org/~jejb/git/scsi-for-linus-2.6.git

This commit is contained in:
Linus Torvalds 2005-05-06 16:46:40 -07:00
commit 07342d623b
12 changed files with 48 additions and 39 deletions

View File

@ -52,7 +52,7 @@ static inline int zfcp_sg_list_copy_from_user(struct zfcp_sg_list *,
static inline int zfcp_sg_list_copy_to_user(void __user *,
struct zfcp_sg_list *, size_t);
static int zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long);
static long zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long);
#define ZFCP_CFDC_IOC_MAGIC 0xDD
#define ZFCP_CFDC_IOC \

View File

@ -61,7 +61,6 @@
#include <linux/mempool.h>
#include <linux/syscalls.h>
#include <linux/ioctl.h>
#include <linux/ioctl32.h>
/************************ DEBUG FLAGS *****************************************/

View File

@ -450,7 +450,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
}
}
return 0;
return err;
}
/**

View File

@ -2335,8 +2335,6 @@ ahc_linux_free_target(struct ahc_softc *ahc, struct ahc_linux_target *targ)
AHC_TRANS_GOAL, /*paused*/FALSE);
ahc_update_neg_request(ahc, &devinfo, tstate, tinfo, AHC_NEG_ALWAYS);
ahc->platform_data->targets[target_offset] = NULL;
if (targ->inq_data != NULL)
free(targ->inq_data, M_DEVBUF);
free(targ, M_DEVBUF);
}

View File

@ -423,10 +423,6 @@ struct ahc_linux_device {
struct ahc_linux_target *target;
};
typedef enum {
AHC_INQ_VALID = 0x02,
} ahc_linux_targ_flags;
struct ahc_linux_target {
struct ahc_linux_device *devices[AHC_NUM_LUNS];
int channel;
@ -434,8 +430,6 @@ struct ahc_linux_target {
int refcount;
struct ahc_transinfo last_tinfo;
struct ahc_softc *ahc;
ahc_linux_targ_flags flags;
struct scsi_inquiry_data *inq_data;
};
/********************* Definitions Required by the Core ***********************/

View File

@ -300,7 +300,7 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
rport->dev_loss_tmo = ha->port_down_retry_count + 5;
}
static struct fc_function_template qla2xxx_transport_functions = {
struct fc_function_template qla2xxx_transport_functions = {
.show_host_node_name = 1,
.show_host_port_name = 1,
@ -322,12 +322,6 @@ static struct fc_function_template qla2xxx_transport_functions = {
};
struct scsi_transport_template *
qla2x00_alloc_transport_tmpl(void)
{
return (fc_attach_transport(&qla2xxx_transport_functions));
}
void
qla2x00_init_host_attr(scsi_qla_host_t *ha)
{

View File

@ -24,7 +24,6 @@
#define __QLA_GBL_H
#include <linux/interrupt.h>
#include <scsi/scsi_transport.h>
extern void qla2x00_remove_one(struct pci_dev *);
extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *);
@ -248,9 +247,10 @@ extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *);
/*
* Global Function Prototypes in qla_attr.c source file.
*/
struct fc_function_template;
extern struct fc_function_template qla2xxx_transport_functions;
extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
extern struct scsi_transport_template *qla2x00_alloc_transport_tmpl(void);
extern void qla2x00_init_host_attr(scsi_qla_host_t *);
extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);

View File

@ -2350,7 +2350,8 @@ qla2x00_module_init(void)
#if DEBUG_QLA2100
strcat(qla2x00_version_str, "-debug");
#endif
qla2xxx_transport_template = qla2x00_alloc_transport_tmpl();
qla2xxx_transport_template =
fc_attach_transport(&qla2xxx_transport_functions);
if (!qla2xxx_transport_template)
return -ENODEV;

View File

@ -542,7 +542,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
* that the device is no longer present */
cmd->result = DID_NO_CONNECT << 16;
atomic_inc(&cmd->device->iorequest_cnt);
scsi_done(cmd);
__scsi_done(cmd);
/* return 0 (because the command has been processed) */
goto out;
}

View File

@ -22,6 +22,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/workqueue.h>
#include <linux/blkdev.h>
#include <asm/semaphore.h>
#include <scsi/scsi.h>
#include "scsi_priv.h"
@ -41,6 +42,11 @@
#define SPI_MAX_ECHO_BUFFER_SIZE 4096
#define DV_LOOPS 3
#define DV_TIMEOUT (10*HZ)
#define DV_RETRIES 3 /* should only need at most
* two cc/ua clears */
/* Private data accessors (keep these out of the header file) */
#define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending)
#define spi_dv_sem(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_sem)
@ -100,6 +106,29 @@ static int sprint_frac(char *dest, int value, int denom)
return result;
}
/* Modification of scsi_wait_req that will clear UNIT ATTENTION conditions
* resulting from (likely) bus and device resets */
static void spi_wait_req(struct scsi_request *sreq, const void *cmd,
void *buffer, unsigned bufflen)
{
int i;
for(i = 0; i < DV_RETRIES; i++) {
sreq->sr_request->flags |= REQ_FAILFAST;
scsi_wait_req(sreq, cmd, buffer, bufflen,
DV_TIMEOUT, /* retries */ 1);
if (sreq->sr_result & DRIVER_SENSE) {
struct scsi_sense_hdr sshdr;
if (scsi_request_normalize_sense(sreq, &sshdr)
&& sshdr.sense_key == UNIT_ATTENTION)
continue;
}
break;
}
}
static struct {
enum spi_signal_type value;
char *name;
@ -378,11 +407,6 @@ static CLASS_DEVICE_ATTR(signalling, S_IRUGO | S_IWUSR,
if(i->f->set_##x) \
i->f->set_##x(sdev->sdev_target, y)
#define DV_LOOPS 3
#define DV_TIMEOUT (10*HZ)
#define DV_RETRIES 3 /* should only need at most
* two cc/ua clears */
enum spi_compare_returns {
SPI_COMPARE_SUCCESS,
SPI_COMPARE_FAILURE,
@ -446,8 +470,7 @@ spi_dv_device_echo_buffer(struct scsi_request *sreq, u8 *buffer,
for (r = 0; r < retries; r++) {
sreq->sr_cmd_len = 0; /* wait_req to fill in */
sreq->sr_data_direction = DMA_TO_DEVICE;
scsi_wait_req(sreq, spi_write_buffer, buffer, len,
DV_TIMEOUT, DV_RETRIES);
spi_wait_req(sreq, spi_write_buffer, buffer, len);
if(sreq->sr_result || !scsi_device_online(sdev)) {
struct scsi_sense_hdr sshdr;
@ -471,8 +494,7 @@ spi_dv_device_echo_buffer(struct scsi_request *sreq, u8 *buffer,
memset(ptr, 0, len);
sreq->sr_cmd_len = 0; /* wait_req to fill in */
sreq->sr_data_direction = DMA_FROM_DEVICE;
scsi_wait_req(sreq, spi_read_buffer, ptr, len,
DV_TIMEOUT, DV_RETRIES);
spi_wait_req(sreq, spi_read_buffer, ptr, len);
scsi_device_set_state(sdev, SDEV_QUIESCE);
if (memcmp(buffer, ptr, len) != 0)
@ -500,8 +522,7 @@ spi_dv_device_compare_inquiry(struct scsi_request *sreq, u8 *buffer,
memset(ptr, 0, len);
scsi_wait_req(sreq, spi_inquiry, ptr, len,
DV_TIMEOUT, DV_RETRIES);
spi_wait_req(sreq, spi_inquiry, ptr, len);
if(sreq->sr_result || !scsi_device_online(sdev)) {
scsi_device_set_state(sdev, SDEV_QUIESCE);
@ -593,8 +614,7 @@ spi_dv_device_get_echo_buffer(struct scsi_request *sreq, u8 *buffer)
* (reservation conflict, device not ready, etc) just
* skip the write tests */
for (l = 0; ; l++) {
scsi_wait_req(sreq, spi_test_unit_ready, NULL, 0,
DV_TIMEOUT, DV_RETRIES);
spi_wait_req(sreq, spi_test_unit_ready, NULL, 0);
if(sreq->sr_result) {
if(l >= 3)
@ -608,8 +628,7 @@ spi_dv_device_get_echo_buffer(struct scsi_request *sreq, u8 *buffer)
sreq->sr_cmd_len = 0;
sreq->sr_data_direction = DMA_FROM_DEVICE;
scsi_wait_req(sreq, spi_read_buffer_descriptor, buffer, 4,
DV_TIMEOUT, DV_RETRIES);
spi_wait_req(sreq, spi_read_buffer_descriptor, buffer, 4);
if (sreq->sr_result)
/* Device has no echo buffer */

View File

@ -281,6 +281,9 @@ int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn)
char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
int result;
if (!buffer)
return -ENOMEM;
memset(&cgc, 0, sizeof(struct packet_command));
cgc.cmd[0] = GPCMD_READ_SUBCHANNEL;
cgc.cmd[2] = 0x40; /* I do want the subchannel info */

View File

@ -2038,8 +2038,9 @@ static void sym2_set_period(struct scsi_target *starget, int period)
struct sym_hcb *np = sym_get_hcb(shost);
struct sym_tcb *tp = &np->target[starget->id];
/* have to have DT for these transfers */
if (period <= np->minsync)
/* have to have DT for these transfers, but DT will also
* set width, so check that this is allowed */
if (period <= np->minsync && spi_width(starget))
tp->tgoal.dt = 1;
tp->tgoal.period = period;