Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154324
b: refs/heads/master
c: ed4fc72
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jun 25, 2009
1 parent 9fe62c3 commit 783ae3a
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 94 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: aa715284b4d28cabde6c25c568d769a6be712bc8
refs/heads/master: ed4fc720e1912eb36ca654d03c88c48845ed39b2
1 change: 0 additions & 1 deletion trunk/arch/um/drivers/slip_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static void slip_init(struct net_device *dev, void *data)

slip_proto_init(&spri->slip);

dev->init = NULL;
dev->hard_header_len = 0;
dev->header_ops = NULL;
dev->addr_len = 0;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/um/drivers/slirp_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ void slirp_init(struct net_device *dev, void *data)

slip_proto_init(&spri->slip);

dev->init = NULL;
dev->hard_header_len = 0;
dev->header_ops = NULL;
dev->addr_len = 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/um/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
}

static inline void
dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size,
dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
enum dma_data_direction direction)
{
BUG();
}

static inline void
dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems,
dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
enum dma_data_direction direction)
{
BUG();
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ config I2C_DAVINCI

config I2C_DESIGNWARE
tristate "Synopsys DesignWare"
depends on HAVE_CLK
help
If you say yes to this option, support will be included for the
Synopsys DesignWare I2C adapter. Only master mode is supported.
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/ide/cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic

ide_pci_setup_ports(dev, d, &hw[0], &hws[0]);
hw[0].irq = 14;
hw[1].irq = 15;

return ide_host_add(d, hws, 2, NULL);
}
Expand Down
10 changes: 6 additions & 4 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,20 +876,22 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
return stat;

/*
* Sanity check the given block size
* Sanity check the given block size, in so far as making
* sure the sectors_per_frame we give to the caller won't
* end up being bogus.
*/
blocklen = be32_to_cpu(capbuf.blocklen);
blocklen = (blocklen >> SECTOR_BITS) << SECTOR_BITS;
switch (blocklen) {
case 512:
case 1024:
case 2048:
case 4096:
break;
default:
printk(KERN_ERR PFX "%s: weird block size %u\n",
printk_once(KERN_ERR PFX "%s: weird block size %u; "
"setting default block size to 2048\n",
drive->name, blocklen);
printk(KERN_ERR PFX "%s: default to 2kb block size\n",
drive->name);
blocklen = 2048;
break;
}
Expand Down
21 changes: 0 additions & 21 deletions trunk/drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,6 @@ static int ide_tune_dma(ide_drive_t *drive)
if (__ide_dma_bad_drive(drive))
return 0;

if (ide_id_dma_bug(drive))
return 0;

if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
return config_drive_for_dma(drive);

Expand Down Expand Up @@ -394,24 +391,6 @@ static int ide_dma_check(ide_drive_t *drive)
return -1;
}

int ide_id_dma_bug(ide_drive_t *drive)
{
u16 *id = drive->id;

if (id[ATA_ID_FIELD_VALID] & 4) {
if ((id[ATA_ID_UDMA_MODES] >> 8) &&
(id[ATA_ID_MWDMA_MODES] >> 8))
goto err_out;
} else if ((id[ATA_ID_MWDMA_MODES] >> 8) &&
(id[ATA_ID_SWDMA_MODES] >> 8))
goto err_out;

return 0;
err_out:
printk(KERN_ERR "%s: bad DMA info in identify block\n", drive->name);
return 1;
}

int ide_set_dma(ide_drive_t *drive)
{
int rc;
Expand Down
54 changes: 22 additions & 32 deletions trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,14 @@ void do_ide_request(struct request_queue *q)

if (!ide_lock_port(hwif)) {
ide_hwif_t *prev_port;

WARN_ON_ONCE(hwif->rq);
repeat:
prev_port = hwif->host->cur_port;

if (drive->dev_flags & IDE_DFLAG_BLOCKED)
rq = hwif->rq;
else
WARN_ON_ONCE(hwif->rq);

if (drive->dev_flags & IDE_DFLAG_SLEEPING &&
time_after(drive->sleep, jiffies)) {
ide_unlock_port(hwif);
Expand All @@ -506,43 +510,29 @@ void do_ide_request(struct request_queue *q)
hwif->cur_dev = drive;
drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED);

spin_unlock_irq(&hwif->lock);
spin_lock_irq(q->queue_lock);
/*
* we know that the queue isn't empty, but this can happen
* if the q->prep_rq_fn() decides to kill a request
*/
if (!rq)
if (rq == NULL) {
spin_unlock_irq(&hwif->lock);
spin_lock_irq(q->queue_lock);
/*
* we know that the queue isn't empty, but this can
* happen if ->prep_rq_fn() decides to kill a request
*/
rq = blk_fetch_request(drive->queue);
spin_unlock_irq(q->queue_lock);
spin_lock_irq(&hwif->lock);

spin_unlock_irq(q->queue_lock);
spin_lock_irq(&hwif->lock);

if (!rq) {
ide_unlock_port(hwif);
goto out;
if (rq == NULL) {
ide_unlock_port(hwif);
goto out;
}
}

/*
* Sanity: don't accept a request that isn't a PM request
* if we are currently power managed. This is very important as
* blk_stop_queue() doesn't prevent the blk_fetch_request()
* above to return us whatever is in the queue. Since we call
* ide_do_request() ourselves, we end up taking requests while
* the queue is blocked...
*
* We let requests forced at head of queue with ide-preempt
* though. I hope that doesn't happen too much, hopefully not
* unless the subdriver triggers such a thing in its own PM
* state machine.
* if we are currently power managed.
*/
if ((drive->dev_flags & IDE_DFLAG_BLOCKED) &&
blk_pm_request(rq) == 0 &&
(rq->cmd_flags & REQ_PREEMPT) == 0) {
/* there should be no pending command at this point */
ide_unlock_port(hwif);
goto plug_device;
}
BUG_ON((drive->dev_flags & IDE_DFLAG_BLOCKED) &&
blk_pm_request(rq) == 0);

hwif->rq = rq;

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ EXPORT_SYMBOL_GPL(ide_in_drive_list);
*/
static const struct drive_list_entry ivb_list[] = {
{ "QUANTUM FIREBALLlct10 05" , "A03.0900" },
{ "QUANTUM FIREBALLlct20 30" , "APL.0900" },
{ "TSSTcorp CDDVDW SH-S202J" , "SB00" },
{ "TSSTcorp CDDVDW SH-S202J" , "SB01" },
{ "TSSTcorp CDDVDW SH-S202N" , "SB00" },
Expand Down Expand Up @@ -329,9 +330,6 @@ int ide_driveid_update(ide_drive_t *drive)

kfree(id);

if ((drive->dev_flags & IDE_DFLAG_USING_DMA) && ide_id_dma_bug(drive))
ide_dma_off(drive);

return 1;
out_err:
if (rc == 2)
Expand Down
23 changes: 20 additions & 3 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,24 @@ static int ide_port_setup_devices(ide_hwif_t *hwif)
return j;
}

static void ide_host_enable_irqs(struct ide_host *host)
{
ide_hwif_t *hwif;
int i;

ide_host_for_each_port(i, hwif, host) {
if (hwif == NULL)
continue;

/* clear any pending IRQs */
hwif->tp_ops->read_status(hwif);

/* unmask IRQs */
if (hwif->io_ports.ctl_addr)
hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
}
}

/*
* This routine sets up the IRQ for an IDE interface.
*/
Expand All @@ -831,9 +849,6 @@ static int init_irq (ide_hwif_t *hwif)
if (irq_handler == NULL)
irq_handler = ide_intr;

if (io_ports->ctl_addr)
hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);

if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
goto out_up;

Expand Down Expand Up @@ -1404,6 +1419,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_port_tune_devices(hwif);
}

ide_host_enable_irqs(host);

ide_host_for_each_port(i, hwif, host) {
if (hwif == NULL)
continue;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ static void acm_waker(struct work_struct *waker)
static int acm_tty_open(struct tty_struct *tty, struct file *filp)
{
struct acm *acm;
int rv = -EINVAL;
int rv = -ENODEV;
int i;
dbg("Entering acm_tty_open.");

Expand Down Expand Up @@ -677,7 +677,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)

/* Perform the closing process and see if we need to do the hardware
shutdown */
if (tty_port_close_start(&acm->port, tty, filp) == 0)
if (!acm || tty_port_close_start(&acm->port, tty, filp) == 0)
return;
acm_port_down(acm, 0);
tty_port_close_end(&acm->port, tty);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
{
struct usb_serial_port *port = tty->driver_data;

if (!port)
return;

dbg("%s - port %d", __func__, port->number);


Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,6 @@ int ide_in_drive_list(u16 *, const struct drive_list_entry *);
#ifdef CONFIG_BLK_DEV_IDEDMA
int ide_dma_good_drive(ide_drive_t *);
int __ide_dma_bad_drive(ide_drive_t *);
int ide_id_dma_bug(ide_drive_t *);

u8 ide_find_dma_mode(ide_drive_t *, u8);

Expand Down Expand Up @@ -1402,7 +1401,6 @@ void ide_dma_lost_irq(ide_drive_t *);
ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int);

#else
static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; }
static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; }
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ extern int make_pages_present(unsigned long addr, unsigned long end);
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);

int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, int len, int write, int force,
unsigned long start, int nr_pages, int write, int force,
struct page **pages, struct vm_area_struct **vmas);
int get_user_pages_fast(unsigned long start, int nr_pages, int write,
struct page **pages);
Expand Down
26 changes: 12 additions & 14 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,8 @@ static inline int use_zero_page(struct vm_area_struct *vma)


int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, int len, int flags,
struct page **pages, struct vm_area_struct **vmas)
unsigned long start, int nr_pages, int flags,
struct page **pages, struct vm_area_struct **vmas)
{
int i;
unsigned int vm_flags = 0;
Expand All @@ -1217,7 +1217,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
int ignore = !!(flags & GUP_FLAGS_IGNORE_VMA_PERMISSIONS);
int ignore_sigkill = !!(flags & GUP_FLAGS_IGNORE_SIGKILL);

if (len <= 0)
if (nr_pages <= 0)
return 0;
/*
* Require read or write permissions.
Expand Down Expand Up @@ -1269,7 +1269,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
vmas[i] = gate_vma;
i++;
start += PAGE_SIZE;
len--;
nr_pages--;
continue;
}

Expand All @@ -1280,7 +1280,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,

if (is_vm_hugetlb_page(vma)) {
i = follow_hugetlb_page(mm, vma, pages, vmas,
&start, &len, i, write);
&start, &nr_pages, i, write);
continue;
}

Expand Down Expand Up @@ -1357,9 +1357,9 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
vmas[i] = vma;
i++;
start += PAGE_SIZE;
len--;
} while (len && start < vma->vm_end);
} while (len);
nr_pages--;
} while (nr_pages && start < vma->vm_end);
} while (nr_pages);
return i;
}

Expand All @@ -1368,7 +1368,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
* @tsk: task_struct of target task
* @mm: mm_struct of target mm
* @start: starting user address
* @len: number of pages from start to pin
* @nr_pages: number of pages from start to pin
* @write: whether pages will be written to by the caller
* @force: whether to force write access even if user mapping is
* readonly. This will result in the page being COWed even
Expand All @@ -1380,7 +1380,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
* Or NULL if the caller does not require them.
*
* Returns number of pages pinned. This may be fewer than the number
* requested. If len is 0 or negative, returns 0. If no pages
* requested. If nr_pages is 0 or negative, returns 0. If no pages
* were pinned, returns -errno. Each page returned must be released
* with a put_page() call when it is finished with. vmas will only
* remain valid while mmap_sem is held.
Expand Down Expand Up @@ -1414,7 +1414,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
* See also get_user_pages_fast, for performance critical applications.
*/
int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, int len, int write, int force,
unsigned long start, int nr_pages, int write, int force,
struct page **pages, struct vm_area_struct **vmas)
{
int flags = 0;
Expand All @@ -1424,9 +1424,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
if (force)
flags |= GUP_FLAGS_FORCE;

return __get_user_pages(tsk, mm,
start, len, flags,
pages, vmas);
return __get_user_pages(tsk, mm, start, nr_pages, flags, pages, vmas);
}

EXPORT_SYMBOL(get_user_pages);
Expand Down
Loading

0 comments on commit 783ae3a

Please sign in to comment.