Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74280
b: refs/heads/master
c: 7749c90
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Nov 27, 2007
1 parent caa9d0c commit 2250096
Show file tree
Hide file tree
Showing 23 changed files with 164 additions and 104 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: 6413f08666830afec21e41e50c28a2c5105ede69
refs/heads/master: 7749c902592f610dc448830210174ab922f54be9
14 changes: 8 additions & 6 deletions trunk/arch/alpha/kernel/pci-noop.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>

#include "proto.h"

Expand Down Expand Up @@ -172,18 +173,19 @@ dma_alloc_coherent(struct device *dev, size_t size,
EXPORT_SYMBOL(dma_alloc_coherent);

int
dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
enum dma_data_direction direction)
{
int i;
struct scatterlist *sg;

for (i = 0; i < nents; i++ ) {
for_each_sg(sgl, sg, nents, i) {
void *va;

BUG_ON(!sg[i].page);
va = page_address(sg[i].page) + sg[i].offset;
sg_dma_address(sg + i) = (dma_addr_t)virt_to_bus(va);
sg_dma_len(sg + i) = sg[i].length;
BUG_ON(!sg_page(sg));
va = sg_virt(sg);
sg_dma_address(sg) = (dma_addr_t)virt_to_bus(va);
sg_dma_len(sg) = sg->length;
}

return nents;
Expand Down
9 changes: 7 additions & 2 deletions trunk/block/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,20 +202,25 @@ static void blk_remove_tree(struct dentry *dir)
static struct dentry *blk_create_tree(const char *blk_name)
{
struct dentry *dir = NULL;
int created = 0;

mutex_lock(&blk_tree_mutex);

if (!blk_tree_root) {
blk_tree_root = debugfs_create_dir("block", NULL);
if (!blk_tree_root)
goto err;
created = 1;
}

dir = debugfs_create_dir(blk_name, blk_tree_root);
if (dir)
root_users++;
else
blk_remove_root();
else {
/* Delete root only if we created it */
if (created)
blk_remove_root();
}

err:
mutex_unlock(&blk_tree_mutex);
Expand Down
1 change: 1 addition & 0 deletions trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
disk->part = kmalloc_node(size,
GFP_KERNEL | __GFP_ZERO, node_id);
if (!disk->part) {
free_disk_stats(disk);
kfree(disk);
return NULL;
}
Expand Down
23 changes: 0 additions & 23 deletions trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4080,23 +4080,7 @@ static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page)
return queue_var_show(max_hw_sectors_kb, (page));
}

static ssize_t queue_max_segments_show(struct request_queue *q, char *page)
{
return queue_var_show(q->max_phys_segments, page);
}

static ssize_t queue_max_segments_store(struct request_queue *q,
const char *page, size_t count)
{
unsigned long segments;
ssize_t ret = queue_var_store(&segments, page, count);

spin_lock_irq(q->queue_lock);
q->max_phys_segments = segments;
spin_unlock_irq(q->queue_lock);

return ret;
}
static struct queue_sysfs_entry queue_requests_entry = {
.attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
.show = queue_requests_show,
Expand All @@ -4120,12 +4104,6 @@ static struct queue_sysfs_entry queue_max_hw_sectors_entry = {
.show = queue_max_hw_sectors_show,
};

static struct queue_sysfs_entry queue_max_segments_entry = {
.attr = {.name = "max_segments", .mode = S_IRUGO | S_IWUSR },
.show = queue_max_segments_show,
.store = queue_max_segments_store,
};

static struct queue_sysfs_entry queue_iosched_entry = {
.attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR },
.show = elv_iosched_show,
Expand All @@ -4137,7 +4115,6 @@ static struct attribute *default_attrs[] = {
&queue_ra_entry.attr,
&queue_max_hw_sectors_entry.attr,
&queue_max_sectors_entry.attr,
&queue_max_segments_entry.attr,
&queue_iosched_entry.attr,
NULL,
};
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/char/sonypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ static struct acpi_driver sonypi_acpi_driver = {
};
#endif

static int __devinit sonypi_create_input_devices(void)
static int __devinit sonypi_create_input_devices(struct platform_device *pdev)
{
struct input_dev *jog_dev;
struct input_dev *key_dev;
Expand All @@ -1177,6 +1177,7 @@ static int __devinit sonypi_create_input_devices(void)
jog_dev->name = "Sony Vaio Jogdial";
jog_dev->id.bustype = BUS_ISA;
jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
jog_dev->dev.parent = &pdev->dev;

jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
Expand All @@ -1191,6 +1192,7 @@ static int __devinit sonypi_create_input_devices(void)
key_dev->name = "Sony Vaio Keys";
key_dev->id.bustype = BUS_ISA;
key_dev->id.vendor = PCI_VENDOR_ID_SONY;
key_dev->dev.parent = &pdev->dev;

/* Initialize the Input Drivers: special keys */
key_dev->evbit[0] = BIT_MASK(EV_KEY);
Expand Down Expand Up @@ -1385,7 +1387,7 @@ static int __devinit sonypi_probe(struct platform_device *dev)

if (useinput) {

error = sonypi_create_input_devices();
error = sonypi_create_input_devices(dev);
if (error) {
printk(KERN_ERR
"sonypi: failed to create input devices\n");
Expand Down Expand Up @@ -1432,7 +1434,7 @@ static int __devexit sonypi_remove(struct platform_device *dev)
{
sonypi_disable();

synchronize_sched(); /* Allow sonypi interrupt to complete. */
synchronize_irq(sonypi_device.irq);
flush_scheduled_work();

if (useinput) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/hw/ehca/ehca_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
mqpcb->service_level = attr->ah_attr.sl;
update_mask |= EHCA_BMASK_SET(MQPCB_MASK_SERVICE_LEVEL, 1);

if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
if (ehca_calc_ipd(shca, mqpcb->prim_phys_port,
attr->ah_attr.static_rate,
&mqpcb->max_static_rate)) {
ret = -EINVAL;
Expand Down Expand Up @@ -1302,7 +1302,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
mqpcb->source_path_bits_al = attr->alt_ah_attr.src_path_bits;
mqpcb->service_level_al = attr->alt_ah_attr.sl;

if (ehca_calc_ipd(shca, my_qp->init_attr.port_num,
if (ehca_calc_ipd(shca, mqpcb->alt_phys_port,
attr->alt_ah_attr.static_rate,
&mqpcb->max_static_rate_al)) {
ret = -EINVAL;
Expand Down
19 changes: 14 additions & 5 deletions trunk/drivers/infiniband/hw/ipath/ipath_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,9 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
goto bail;
}

/*
* Return the address of the WC as the offset to mmap.
* See ipath_mmap() for details.
*/
/* Check that we can write the offset to mmap. */
if (udata && udata->outlen >= sizeof(__u64)) {
__u64 offset = (__u64) wc;
__u64 offset = 0;

ret = ib_copy_to_udata(udata, &offset, sizeof(offset));
if (ret)
Expand Down Expand Up @@ -450,6 +447,18 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
struct ipath_mmap_info *ip = cq->ip;

ipath_update_mmap_info(dev, ip, sz, wc);

/*
* Return the offset to mmap.
* See ipath_mmap() for details.
*/
if (udata && udata->outlen >= sizeof(__u64)) {
ret = ib_copy_to_udata(udata, &ip->offset,
sizeof(ip->offset));
if (ret)
goto bail;
}

spin_lock_irq(&dev->pending_lock);
if (list_empty(&ip->pending_mmaps))
list_add(&ip->pending_mmaps, &dev->pending_mmaps);
Expand Down
15 changes: 9 additions & 6 deletions trunk/drivers/infiniband/hw/ipath/ipath_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,8 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
init_attr->qp_type);
if (err) {
ret = ERR_PTR(err);
goto bail_rwq;
vfree(qp->r_rq.wq);
goto bail_qp;
}
qp->ip = NULL;
ipath_reset_qp(qp);
Expand Down Expand Up @@ -863,7 +864,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
sizeof(offset));
if (err) {
ret = ERR_PTR(err);
goto bail_rwq;
goto bail_ip;
}
} else {
u32 s = sizeof(struct ipath_rwq) +
Expand All @@ -875,7 +876,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
qp->r_rq.wq);
if (!qp->ip) {
ret = ERR_PTR(-ENOMEM);
goto bail_rwq;
goto bail_ip;
}

err = ib_copy_to_udata(udata, &(qp->ip->offset),
Expand Down Expand Up @@ -907,9 +908,11 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
goto bail;

bail_ip:
kfree(qp->ip);
bail_rwq:
vfree(qp->r_rq.wq);
if (qp->ip)
kref_put(&qp->ip->ref, ipath_release_mmap_info);
else
vfree(qp->r_rq.wq);
ipath_free_qp(&dev->qp_table, qp);
bail_qp:
kfree(qp);
bail_swq:
Expand Down
44 changes: 26 additions & 18 deletions trunk/drivers/infiniband/hw/ipath/ipath_srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int ipath_post_srq_receive(struct ib_srq *ibsrq, struct ib_recv_wr *wr,

if ((unsigned) wr->num_sge > srq->rq.max_sge) {
*bad_wr = wr;
ret = -ENOMEM;
ret = -EINVAL;
goto bail;
}

Expand Down Expand Up @@ -211,11 +211,11 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
struct ib_udata *udata)
{
struct ipath_srq *srq = to_isrq(ibsrq);
struct ipath_rwq *wq;
int ret = 0;

if (attr_mask & IB_SRQ_MAX_WR) {
struct ipath_rwq *owq;
struct ipath_rwq *wq;
struct ipath_rwqe *p;
u32 sz, size, n, head, tail;

Expand All @@ -236,27 +236,20 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
goto bail;
}

/*
* Return the address of the RWQ as the offset to mmap.
* See ipath_mmap() for details.
*/
/* Check that we can write the offset to mmap. */
if (udata && udata->inlen >= sizeof(__u64)) {
__u64 offset_addr;
__u64 offset = (__u64) wq;
__u64 offset = 0;

ret = ib_copy_from_udata(&offset_addr, udata,
sizeof(offset_addr));
if (ret) {
vfree(wq);
goto bail;
}
if (ret)
goto bail_free;
udata->outbuf = (void __user *) offset_addr;
ret = ib_copy_to_udata(udata, &offset,
sizeof(offset));
if (ret) {
vfree(wq);
goto bail;
}
if (ret)
goto bail_free;
}

spin_lock_irq(&srq->rq.lock);
Expand All @@ -277,10 +270,8 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
else
n -= tail;
if (size <= n) {
spin_unlock_irq(&srq->rq.lock);
vfree(wq);
ret = -EINVAL;
goto bail;
goto bail_unlock;
}
n = 0;
p = wq->wq;
Expand Down Expand Up @@ -314,6 +305,18 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
u32 s = sizeof(struct ipath_rwq) + size * sz;

ipath_update_mmap_info(dev, ip, s, wq);

/*
* Return the offset to mmap.
* See ipath_mmap() for details.
*/
if (udata && udata->inlen >= sizeof(__u64)) {
ret = ib_copy_to_udata(udata, &ip->offset,
sizeof(ip->offset));
if (ret)
goto bail;
}

spin_lock_irq(&dev->pending_lock);
if (list_empty(&ip->pending_mmaps))
list_add(&ip->pending_mmaps,
Expand All @@ -328,7 +331,12 @@ int ipath_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
srq->limit = attr->srq_limit;
spin_unlock_irq(&srq->rq.lock);
}
goto bail;

bail_unlock:
spin_unlock_irq(&srq->rq.lock);
bail_free:
vfree(wq);
bail:
return ret;
}
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/infiniband/hw/ipath/ipath_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,10 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
next = qp->s_head + 1;
if (next >= qp->s_size)
next = 0;
if (next == qp->s_last)
goto bail_inval;
if (next == qp->s_last) {
ret = -ENOMEM;
goto bail;
}

wqe = get_swqe_ptr(qp, qp->s_head);
wqe->wr = *wr;
Expand Down Expand Up @@ -404,7 +406,7 @@ static int ipath_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,

if ((unsigned) wr->num_sge > qp->r_rq.max_sge) {
*bad_wr = wr;
ret = -ENOMEM;
ret = -EINVAL;
goto bail;
}

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/infiniband/ulp/iser/iser_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,15 @@ static unsigned int iser_data_buf_aligned_len(struct iser_data_buf *data,
if (i + 1 < data->dma_nents) {
next_addr = ib_sg_dma_address(ibdev, sg_next(sg));
/* are i, i+1 fragments of the same page? */
if (end_addr == next_addr)
if (end_addr == next_addr) {
cnt++;
continue;
else if (!IS_4K_ALIGNED(end_addr)) {
} else if (!IS_4K_ALIGNED(end_addr)) {
ret_len = cnt + 1;
break;
}
}
cnt++;
}
if (i == data->dma_nents)
ret_len = cnt; /* loop ended */
Expand Down
Loading

0 comments on commit 2250096

Please sign in to comment.