Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65039
b: refs/heads/master
c: c0e7b4a
h: refs/heads/master
i:
  65037: ebc540f
  65035: 4f6fd67
  65031: 92fc1ed
  65023: d28d8c3
v: v3
  • Loading branch information
Christoph Hellwig authored and Paul Mackerras committed Sep 19, 2007
1 parent 52edd75 commit 408bf1e
Show file tree
Hide file tree
Showing 32 changed files with 92 additions and 354 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: dbe3ed1c078c193be34326728d494c5c4bc115e2
refs/heads/master: c0e7b4aa1c09ea992808ea8c079141bc8dd0f5bc
4 changes: 2 additions & 2 deletions trunk/arch/i386/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ static unsigned long xen_read_cr2_direct(void)

static void xen_write_cr4(unsigned long cr4)
{
/* Just ignore cr4 changes; Xen doesn't allow us to do
anything anyway. */
/* never allow TSC to be disabled */
native_write_cr4(cr4 & ~X86_CR4_TSD);
}

static unsigned long xen_read_cr3(void)
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static struct spu *find_victim(struct spu_context *ctx)
list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
struct spu_context *tmp = spu->ctx;

if (tmp->prio > ctx->prio &&
if (tmp && tmp->prio > ctx->prio &&
(!victim || tmp->prio > victim->prio))
victim = spu->ctx;
}
Expand Down Expand Up @@ -611,9 +611,9 @@ static struct spu *find_victim(struct spu_context *ctx)

mutex_lock(&cbe_spu_info[node].list_mutex);
cbe_spu_info[node].nr_active--;
spu_unbind_context(spu, victim);
mutex_unlock(&cbe_spu_info[node].list_mutex);

spu_unbind_context(spu, victim);
victim->stats.invol_ctx_switch++;
spu->stats.invol_ctx_switch++;
mutex_unlock(&victim->state_mutex);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/include/kern_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extern void sigio_handler(int sig, union uml_pt_regs *regs);

extern void copy_sc(union uml_pt_regs *regs, void *from);

extern unsigned long to_irq_stack(unsigned long *mask_out);
unsigned long to_irq_stack(int sig, unsigned long *mask_out);
unsigned long from_irq_stack(int nested);

#endif
7 changes: 3 additions & 4 deletions trunk/arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,13 @@ int init_aio_irq(int irq, char *name, irq_handler_t handler)

static unsigned long pending_mask;

unsigned long to_irq_stack(unsigned long *mask_out)
unsigned long to_irq_stack(int sig, unsigned long *mask_out)
{
struct thread_info *ti;
unsigned long mask, old;
int nested;

mask = xchg(&pending_mask, *mask_out);
mask = xchg(&pending_mask, 1 << sig);
if(mask != 0){
/* If any interrupts come in at this point, we want to
* make sure that their bits aren't lost by our
Expand All @@ -534,7 +534,7 @@ unsigned long to_irq_stack(unsigned long *mask_out)
* and pending_mask contains a bit for each interrupt
* that came in.
*/
old = *mask_out;
old = 1 << sig;
do {
old |= mask;
mask = xchg(&pending_mask, old);
Expand All @@ -550,7 +550,6 @@ unsigned long to_irq_stack(unsigned long *mask_out)

task = cpu_tasks[ti->cpu].task;
tti = task_thread_info(task);

*ti = *tti;
ti->real_thread = tti;
task->stack = ti;
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/um/os-Linux/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ int os_file_size(char *file, unsigned long long *size_out)
}

if(S_ISBLK(buf.ust_mode)){
int fd;
long blocks;
int fd, blocks;

fd = os_open_file(file, of_read(OPENFLAGS()), 0);
if(fd < 0){
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/um/os-Linux/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void (*handlers[_NSIG])(int sig, struct sigcontext *sc);

void handle_signal(int sig, struct sigcontext *sc)
{
unsigned long pending = 1UL << sig;
unsigned long pending = 0;

do {
int nested, bail;
Expand All @@ -134,7 +134,7 @@ void handle_signal(int sig, struct sigcontext *sc)
* have to return, and the upper handler will deal
* with this interrupt.
*/
bail = to_irq_stack(&pending);
bail = to_irq_stack(sig, &pending);
if(bail)
return;

Expand Down
7 changes: 0 additions & 7 deletions trunk/arch/x86_64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
if (unlikely(in_atomic() || !mm))
goto bad_area_nosemaphore;

/*
* User-mode registers count as a user access even for any
* potential system fault or CPU buglet.
*/
if (user_mode_vm(regs))
error_code |= PF_USER;

again:
/* When running in the kernel we expect faults to occur only to
* addresses in user space. All other faults represent errors in the
Expand Down
29 changes: 6 additions & 23 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,38 +679,21 @@ static int device_add_class_symlinks(struct device *dev)
goto out_subsys;
}
if (dev->parent) {
error = sysfs_create_link(&dev->kobj, &dev->parent->kobj,
"device");
if (error)
goto out_busid;
#ifdef CONFIG_SYSFS_DEPRECATED
{
struct device *parent = dev->parent;
char *class_name;

/*
* In old sysfs stacked class devices had 'device'
* link pointing to real device instead of parent
*/
while (parent->class && !parent->bus && parent->parent)
parent = parent->parent;

error = sysfs_create_link(&dev->kobj,
&parent->kobj,
"device");
if (error)
goto out_busid;

class_name = make_class_name(dev->class->name,
&dev->kobj);
char * class_name = make_class_name(dev->class->name,
&dev->kobj);
if (class_name)
error = sysfs_create_link(&dev->parent->kobj,
&dev->kobj, class_name);
kfree(class_name);
if (error)
goto out_device;
}
#else
error = sysfs_create_link(&dev->kobj, &dev->parent->kobj,
"device");
if (error)
goto out_busid;
#endif
}
return 0;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/block/DAC960.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/genhd.h>
#include <linux/hdreg.h>
#include <linux/blkpg.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/mm.h>
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/char/agp/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ struct agp_bridge_data {
#define I830_GMCH_MEM_MASK 0x1
#define I830_GMCH_MEM_64M 0x1
#define I830_GMCH_MEM_128M 0
#define I830_GMCH_GMS_MASK 0x70
#define I830_GMCH_GMS_MASK 0xF0
#define I830_GMCH_GMS_DISABLED 0x00
#define I830_GMCH_GMS_LOCAL 0x10
#define I830_GMCH_GMS_STOLEN_512 0x20
Expand All @@ -190,7 +190,6 @@ struct agp_bridge_data {
#define INTEL_I830_ERRSTS 0x92

/* Intel 855GM/852GM registers */
#define I855_GMCH_GMS_MASK 0xF0
#define I855_GMCH_GMS_STOLEN_0M 0x0
#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4)
#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/agp/intel-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ static void intel_i830_init_gtt_entries(void)
*/
if (IS_G33)
size = 0;
switch (gmch_ctrl & I855_GMCH_GMS_MASK) {
switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
case I855_GMCH_GMS_STOLEN_1M:
gtt_entries = MB(1) - KB(size);
break;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2215,8 +2215,7 @@ static int ipmi_pci_resume(struct pci_dev *pdev)

static struct pci_device_id ipmi_pci_devices[] = {
{ PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) },
{ PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) },
{ 0, }
{ PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }
};
MODULE_DEVICE_TABLE(pci, ipmi_pci_devices);

Expand Down
69 changes: 21 additions & 48 deletions trunk/drivers/char/mspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
/*
* Page types allocated by the device.
*/
enum mspec_page_type {
enum {
MSPEC_FETCHOP = 1,
MSPEC_CACHED,
MSPEC_UNCACHED
Expand All @@ -83,25 +83,15 @@ static int is_sn2;
* One of these structures is allocated when an mspec region is mmaped. The
* structure is pointed to by the vma->vm_private_data field in the vma struct.
* This structure is used to record the addresses of the mspec pages.
* This structure is shared by all vma's that are split off from the
* original vma when split_vma()'s are done.
*
* The refcnt is incremented atomically because mm->mmap_sem does not
* protect in fork case where multiple tasks share the vma_data.
*/
struct vma_data {
atomic_t refcnt; /* Number of vmas sharing the data. */
spinlock_t lock; /* Serialize access to this structure. */
spinlock_t lock; /* Serialize access to the vma. */
int count; /* Number of pages allocated. */
enum mspec_page_type type; /* Type of pages allocated. */
int flags; /* See VMD_xxx below. */
unsigned long vm_start; /* Original (unsplit) base. */
unsigned long vm_end; /* Original (unsplit) end. */
int type; /* Type of pages allocated. */
unsigned long maddr[0]; /* Array of MSPEC addresses. */
};

#define VMD_VMALLOCED 0x1 /* vmalloc'd rather than kmalloc'd */

/* used on shub2 to clear FOP cache in the HUB */
static unsigned long scratch_page[MAX_NUMNODES];
#define SH2_AMO_CACHE_ENTRIES 4
Expand Down Expand Up @@ -139,8 +129,8 @@ mspec_zero_block(unsigned long addr, int len)
* mspec_open
*
* Called when a device mapping is created by a means other than mmap
* (via fork, munmap, etc.). Increments the reference count on the
* underlying mspec data so it is not freed prematurely.
* (via fork, etc.). Increments the reference count on the underlying
* mspec data so it is not freed prematurely.
*/
static void
mspec_open(struct vm_area_struct *vma)
Expand All @@ -161,44 +151,34 @@ static void
mspec_close(struct vm_area_struct *vma)
{
struct vma_data *vdata;
int index, last_index, result;
unsigned long my_page;
int i, pages, result, vdata_size;

vdata = vma->vm_private_data;
if (!atomic_dec_and_test(&vdata->refcnt))
return;

BUG_ON(vma->vm_start < vdata->vm_start || vma->vm_end > vdata->vm_end);

spin_lock(&vdata->lock);
index = (vma->vm_start - vdata->vm_start) >> PAGE_SHIFT;
last_index = (vma->vm_end - vdata->vm_start) >> PAGE_SHIFT;
for (; index < last_index; index++) {
if (vdata->maddr[index] == 0)
pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
vdata_size = sizeof(struct vma_data) + pages * sizeof(long);
for (i = 0; i < pages; i++) {
if (vdata->maddr[i] == 0)
continue;
/*
* Clear the page before sticking it back
* into the pool.
*/
my_page = vdata->maddr[index];
vdata->maddr[index] = 0;
spin_unlock(&vdata->lock);
result = mspec_zero_block(my_page, PAGE_SIZE);
result = mspec_zero_block(vdata->maddr[i], PAGE_SIZE);
if (!result)
uncached_free_page(my_page);
uncached_free_page(vdata->maddr[i]);
else
printk(KERN_WARNING "mspec_close(): "
"failed to zero page %i\n",
result);
spin_lock(&vdata->lock);
}
spin_unlock(&vdata->lock);

if (!atomic_dec_and_test(&vdata->refcnt))
return;

if (vdata->flags & VMD_VMALLOCED)
vfree(vdata);
else
if (vdata_size <= PAGE_SIZE)
kfree(vdata);
else
vfree(vdata);
}


Expand All @@ -215,8 +195,7 @@ mspec_nopfn(struct vm_area_struct *vma, unsigned long address)
int index;
struct vma_data *vdata = vma->vm_private_data;

BUG_ON(address < vdata->vm_start || address >= vdata->vm_end);
index = (address - vdata->vm_start) >> PAGE_SHIFT;
index = (address - vma->vm_start) >> PAGE_SHIFT;
maddr = (volatile unsigned long) vdata->maddr[index];
if (maddr == 0) {
maddr = uncached_alloc_page(numa_node_id());
Expand Down Expand Up @@ -258,11 +237,10 @@ static struct vm_operations_struct mspec_vm_ops = {
* underlying pages.
*/
static int
mspec_mmap(struct file *file, struct vm_area_struct *vma,
enum mspec_page_type type)
mspec_mmap(struct file *file, struct vm_area_struct *vma, int type)
{
struct vma_data *vdata;
int pages, vdata_size, flags = 0;
int pages, vdata_size;

if (vma->vm_pgoff != 0)
return -EINVAL;
Expand All @@ -277,17 +255,12 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma,
vdata_size = sizeof(struct vma_data) + pages * sizeof(long);
if (vdata_size <= PAGE_SIZE)
vdata = kmalloc(vdata_size, GFP_KERNEL);
else {
else
vdata = vmalloc(vdata_size);
flags = VMD_VMALLOCED;
}
if (!vdata)
return -ENOMEM;
memset(vdata, 0, vdata_size);

vdata->vm_start = vma->vm_start;
vdata->vm_end = vma->vm_end;
vdata->flags = flags;
vdata->type = type;
spin_lock_init(&vdata->lock);
vdata->refcnt = ATOMIC_INIT(1);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/media/video/usbvision/usbvision-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,6 @@ struct usb_device_id usbvision_table [] = {
{ USB_DEVICE(0x2304, 0x0301), .driver_info=PINNA_LINX_VD_IN_CAB_PAL },
{ USB_DEVICE(0x2304, 0x0419), .driver_info=PINNA_PCTV_BUNGEE_PAL_FM },
{ USB_DEVICE(0x2400, 0x4200), .driver_info=HPG_WINTV },
{ }, /* terminate list */
};

MODULE_DEVICE_TABLE (usb, usbvision_table);
3 changes: 1 addition & 2 deletions trunk/drivers/mtd/nand/cafe_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,7 @@ static void __devexit cafe_nand_remove(struct pci_dev *pdev)
}

static struct pci_device_id cafe_nand_tbl[] = {
{ 0x11ab, 0x4100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MEMORY_FLASH << 8, 0xFFFF0 },
{ 0, }
{ 0x11ab, 0x4100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MEMORY_FLASH << 8, 0xFFFF0 }
};

MODULE_DEVICE_TABLE(pci, cafe_nand_tbl);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/rtc/rtc-ds1553.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
struct rtc_plat_data {
struct rtc_device *rtc;
void __iomem *ioaddr;
resource_size_t baseaddr;
unsigned long baseaddr;
unsigned long last_jiffies;
int irq;
unsigned int irqen;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/rtc/rtc-ds1742.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct rtc_plat_data {
void __iomem *ioaddr_rtc;
size_t size_nvram;
size_t size;
resource_size_t baseaddr;
unsigned long baseaddr;
unsigned long last_jiffies;
};

Expand Down
Loading

0 comments on commit 408bf1e

Please sign in to comment.