Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63697
b: refs/heads/master
c: c8154c8
h: refs/heads/master
i:
  63695: eb16bcd
v: v3
  • Loading branch information
Mark Fortescue authored and David S. Miller committed Aug 5, 2007
1 parent d78ac71 commit d20321d
Show file tree
Hide file tree
Showing 50 changed files with 2,055 additions and 2,850 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bced13738405b62c8203df9c103d4ba63d747872
refs/heads/master: c8154c8a9aaf548ad91e413da8b319858e37bc52
10 changes: 3 additions & 7 deletions trunk/block/bsg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* bsg.c - block layer implementation of the sg v4 interface
* bsg.c - block layer implementation of the sg v3 interface
*
* Copyright (C) 2004 Jens Axboe <axboe@suse.de> SUSE Labs
* Copyright (C) 2004 Peter M. Jones <pjones@redhat.com>
Expand Down Expand Up @@ -421,6 +421,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
hdr->info = 0;
if (hdr->device_status || hdr->transport_status || hdr->driver_status)
hdr->info |= SG_INFO_CHECK;
hdr->din_resid = rq->data_len;
hdr->response_len = 0;

if (rq->sense_len && hdr->response) {
Expand All @@ -436,14 +437,9 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
}

if (rq->next_rq) {
hdr->dout_resid = rq->data_len;
hdr->din_resid = rq->next_rq->data_len;
blk_rq_unmap_user(bidi_bio);
blk_put_request(rq->next_rq);
} else if (rq_data_dir(rq) == READ)
hdr->din_resid = rq->data_len;
else
hdr->dout_resid = rq->data_len;
}

blk_rq_unmap_user(bio);
blk_put_request(rq);
Expand Down
14 changes: 3 additions & 11 deletions trunk/drivers/char/drm/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ static int i915_initialize(struct drm_device * dev,
* private backbuffer/depthbuffer usage.
*/
dev_priv->use_mi_batchbuffer_start = 0;
if (IS_I965G(dev)) /* 965 doesn't support older method */
dev_priv->use_mi_batchbuffer_start = 1;

/* Allow hardware batchbuffers unless told otherwise.
*/
Expand Down Expand Up @@ -519,13 +517,8 @@ static int i915_dispatch_batchbuffer(struct drm_device * dev,

if (dev_priv->use_mi_batchbuffer_start) {
BEGIN_LP_RING(2);
if (IS_I965G(dev)) {
OUT_RING(MI_BATCH_BUFFER_START | (2 << 6) | MI_BATCH_NON_SECURE_I965);
OUT_RING(batch->start);
} else {
OUT_RING(MI_BATCH_BUFFER_START | (2 << 6));
OUT_RING(batch->start | MI_BATCH_NON_SECURE);
}
OUT_RING(MI_BATCH_BUFFER_START | (2 << 6));
OUT_RING(batch->start | MI_BATCH_NON_SECURE);
ADVANCE_LP_RING();
} else {
BEGIN_LP_RING(4);
Expand Down Expand Up @@ -742,8 +735,7 @@ static int i915_setparam(DRM_IOCTL_ARGS)

switch (param.param) {
case I915_SETPARAM_USE_MI_BATCHBUFFER_START:
if (!IS_I965G(dev))
dev_priv->use_mi_batchbuffer_start = param.value;
dev_priv->use_mi_batchbuffer_start = param.value;
break;
case I915_SETPARAM_TEX_LRU_LOG_GRANULARITY:
dev_priv->tex_lru_log_granularity = param.value;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/char/drm/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
#define MI_BATCH_BUFFER_START (0x31<<23)
#define MI_BATCH_BUFFER_END (0xA<<23)
#define MI_BATCH_NON_SECURE (1)
#define MI_BATCH_NON_SECURE_I965 (1<<8)

#define MI_WAIT_FOR_EVENT ((0x3<<23))
#define MI_WAIT_FOR_PLANE_A_FLIP (1<<2)
Expand Down
17 changes: 1 addition & 16 deletions trunk/drivers/message/fusion/mptbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ module_param(mpt_channel_mapping, int, 0);
MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)");

static int mpt_debug_level;
static int mpt_set_debug_level(const char *val, struct kernel_param *kp);
module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int,
&mpt_debug_level, 0600);
module_param(mpt_debug_level, int, 0);
MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h - (default=0)");

#ifdef MFCNT
Expand Down Expand Up @@ -222,19 +220,6 @@ pci_enable_io_access(struct pci_dev *pdev)
pci_write_config_word(pdev, PCI_COMMAND, command_reg);
}

static int mpt_set_debug_level(const char *val, struct kernel_param *kp)
{
int ret = param_set_int(val, kp);
MPT_ADAPTER *ioc;

if (ret)
return ret;

list_for_each_entry(ioc, &ioc_list, list)
ioc->debug_level = mpt_debug_level;
return 0;
}

/*
* Process turbo (context) reply...
*/
Expand Down
126 changes: 0 additions & 126 deletions trunk/drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,137 +1312,11 @@ mptsas_get_bay_identifier(struct sas_rphy *rphy)
return rc;
}

static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
struct request *req)
{
MPT_ADAPTER *ioc = ((MPT_SCSI_HOST *) shost->hostdata)->ioc;
MPT_FRAME_HDR *mf;
SmpPassthroughRequest_t *smpreq;
struct request *rsp = req->next_rq;
int ret;
int flagsLength;
unsigned long timeleft;
char *psge;
dma_addr_t dma_addr_in = 0;
dma_addr_t dma_addr_out = 0;
u64 sas_address = 0;

if (!rsp) {
printk(KERN_ERR "%s: the smp response space is missing\n",
__FUNCTION__);
return -EINVAL;
}

/* do we need to support multiple segments? */
if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) {
printk(KERN_ERR "%s: multiple segments req %u %u, rsp %u %u\n",
__FUNCTION__, req->bio->bi_vcnt, req->data_len,
rsp->bio->bi_vcnt, rsp->data_len);
return -EINVAL;
}

ret = mutex_lock_interruptible(&ioc->sas_mgmt.mutex);
if (ret)
goto out;

mf = mpt_get_msg_frame(mptsasMgmtCtx, ioc);
if (!mf) {
ret = -ENOMEM;
goto out_unlock;
}

smpreq = (SmpPassthroughRequest_t *)mf;
memset(smpreq, 0, sizeof(*smpreq));

smpreq->RequestDataLength = cpu_to_le16(req->data_len - 4);
smpreq->Function = MPI_FUNCTION_SMP_PASSTHROUGH;

if (rphy)
sas_address = rphy->identify.sas_address;
else {
struct mptsas_portinfo *port_info;

mutex_lock(&ioc->sas_topology_mutex);
port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle);
if (port_info && port_info->phy_info)
sas_address =
port_info->phy_info[0].phy->identify.sas_address;
mutex_unlock(&ioc->sas_topology_mutex);
}

*((u64 *)&smpreq->SASAddress) = cpu_to_le64(sas_address);

psge = (char *)
(((int *) mf) + (offsetof(SmpPassthroughRequest_t, SGL) / 4));

/* request */
flagsLength = (MPI_SGE_FLAGS_SIMPLE_ELEMENT |
MPI_SGE_FLAGS_END_OF_BUFFER |
MPI_SGE_FLAGS_DIRECTION |
mpt_addr_size()) << MPI_SGE_FLAGS_SHIFT;
flagsLength |= (req->data_len - 4);

dma_addr_out = pci_map_single(ioc->pcidev, bio_data(req->bio),
req->data_len, PCI_DMA_BIDIRECTIONAL);
if (!dma_addr_out)
goto put_mf;
mpt_add_sge(psge, flagsLength, dma_addr_out);
psge += (sizeof(u32) + sizeof(dma_addr_t));

/* response */
flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ;
flagsLength |= rsp->data_len + 4;
dma_addr_in = pci_map_single(ioc->pcidev, bio_data(rsp->bio),
rsp->data_len, PCI_DMA_BIDIRECTIONAL);
if (!dma_addr_in)
goto unmap;
mpt_add_sge(psge, flagsLength, dma_addr_in);

mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf);

timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ);
if (!timeleft) {
printk(KERN_ERR "%s: smp timeout!\n", __FUNCTION__);
/* On timeout reset the board */
mpt_HardResetHandler(ioc, CAN_SLEEP);
ret = -ETIMEDOUT;
goto unmap;
}
mf = NULL;

if (ioc->sas_mgmt.status & MPT_IOCTL_STATUS_RF_VALID) {
SmpPassthroughReply_t *smprep;

smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply;
memcpy(req->sense, smprep, sizeof(*smprep));
req->sense_len = sizeof(*smprep);
} else {
printk(KERN_ERR "%s: smp passthru reply failed to be returned\n",
__FUNCTION__);
ret = -ENXIO;
}
unmap:
if (dma_addr_out)
pci_unmap_single(ioc->pcidev, dma_addr_out, req->data_len,
PCI_DMA_BIDIRECTIONAL);
if (dma_addr_in)
pci_unmap_single(ioc->pcidev, dma_addr_in, rsp->data_len,
PCI_DMA_BIDIRECTIONAL);
put_mf:
if (mf)
mpt_free_msg_frame(ioc, mf);
out_unlock:
mutex_unlock(&ioc->sas_mgmt.mutex);
out:
return ret;
}

static struct sas_function_template mptsas_transport_functions = {
.get_linkerrors = mptsas_get_linkerrors,
.get_enclosure_identifier = mptsas_get_enclosure_identifier,
.get_bay_identifier = mptsas_get_bay_identifier,
.phy_reset = mptsas_phy_reset,
.smp_handler = mptsas_smp_handler,
};

static struct scsi_transport_template *mptsas_transport_template;
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/s390/scsi/zfcp_fsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4154,9 +4154,8 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
fcp_rsp_iu->fcp_resid,
(int) zfcp_get_fcp_dl(fcp_cmnd_iu));

scsi_set_resid(scpnt, fcp_rsp_iu->fcp_resid);
if (scsi_bufflen(scpnt) - scsi_get_resid(scpnt) <
scpnt->underflow)
scpnt->resid = fcp_rsp_iu->fcp_resid;
if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow)
set_host_byte(&scpnt->result, DID_ERROR);
}

Expand Down
41 changes: 35 additions & 6 deletions trunk/drivers/s390/scsi/zfcp_qdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ static void zfcp_qdio_sbale_fill
(struct zfcp_fsf_req *, unsigned long, void *, int);
static int zfcp_qdio_sbals_from_segment
(struct zfcp_fsf_req *, unsigned long, void *, unsigned long);
static int zfcp_qdio_sbals_from_buffer
(struct zfcp_fsf_req *, unsigned long, void *, unsigned long, int);

static qdio_handler_t zfcp_qdio_request_handler;
static qdio_handler_t zfcp_qdio_response_handler;
Expand Down Expand Up @@ -629,6 +631,28 @@ zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
}


/**
* zfcp_qdio_sbals_from_buffer - fill SBALs from buffer
* @fsf_req: request to be processed
* @sbtype: SBALE flags
* @buffer: data buffer
* @length: length of buffer
* @max_sbals: upper bound for number of SBALs to be used
*/
static int
zfcp_qdio_sbals_from_buffer(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
void *buffer, unsigned long length, int max_sbals)
{
struct scatterlist sg_segment;

zfcp_address_to_sg(buffer, &sg_segment);
sg_segment.length = length;

return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, &sg_segment, 1,
max_sbals);
}


/**
* zfcp_qdio_sbals_from_scsicmnd - fill SBALs from scsi command
* @fsf_req: request to be processed
Expand All @@ -640,13 +664,18 @@ int
zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req,
unsigned long sbtype, struct scsi_cmnd *scsi_cmnd)
{
if (scsi_sg_count(scsi_cmnd))
if (scsi_cmnd->use_sg) {
return zfcp_qdio_sbals_from_sg(fsf_req, sbtype,
scsi_sglist(scsi_cmnd),
scsi_sg_count(scsi_cmnd),
ZFCP_MAX_SBALS_PER_REQ);
else
return 0;
(struct scatterlist *)
scsi_cmnd->request_buffer,
scsi_cmnd->use_sg,
ZFCP_MAX_SBALS_PER_REQ);
} else {
return zfcp_qdio_sbals_from_buffer(fsf_req, sbtype,
scsi_cmnd->request_buffer,
scsi_cmnd->request_bufflen,
ZFCP_MAX_SBALS_PER_REQ);
}
}

/**
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,9 +1110,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
__aac_shutdown(aac);
out_unmap:
aac_fib_map_free(aac);
if (aac->comm_addr)
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
aac->comm_phys);
pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
kfree(aac->queues);
aac_adapter_ioremap(aac, 0);
kfree(aac->fibs);
Expand Down
Loading

0 comments on commit d20321d

Please sign in to comment.