Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed May 6, 2005
2 parents d4a1a73 + e4862fe commit 07342d6
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 39 deletions.
2 changes: 1 addition & 1 deletion drivers/s390/scsi/zfcp_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion drivers/s390/scsi/zfcp_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#include <linux/mempool.h>
#include <linux/syscalls.h>
#include <linux/ioctl.h>
#include <linux/ioctl32.h>

/************************ DEBUG FLAGS *****************************************/

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
}
}

return 0;
return err;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/aic7xxx/aic7xxx_osm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 0 additions & 6 deletions drivers/scsi/aic7xxx/aic7xxx_osm.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,19 +423,13 @@ 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;
int 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 ***********************/
Expand Down
8 changes: 1 addition & 7 deletions drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/qla2xxx/qla_gbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down Expand Up @@ -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 *);
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
49 changes: 34 additions & 15 deletions drivers/scsi/scsi_transport_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand All @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand All @@ -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 */
Expand Down
3 changes: 3 additions & 0 deletions drivers/scsi/sr_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
5 changes: 3 additions & 2 deletions drivers/scsi/sym53c8xx_2/sym_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 07342d6

Please sign in to comment.