Commit d7f1917a authored by Richard Russon's avatar Richard Russon

Merge flatcap.org:/home/flatcap/backup/bk/ntfs-2.6

into flatcap.org:/home/flatcap/backup/bk/ntfs-2.6-devel
parents bad71405 8ff96da6
......@@ -91,7 +91,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
* braindamage (it can't really handle filesystems where the directory
* offset differences aren't the same as "d_reclen").
*/
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
#define NAME_OFFSET offsetof (struct osf_dirent, d_name)
#define ROUND_UP(x) (((x)+3) & ~3)
struct osf_dirent {
......@@ -114,7 +114,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
{
struct osf_dirent __user *dirent;
struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1);
buf->error = -EINVAL; /* only used if we fail */
if (reclen > buf->count)
......@@ -989,7 +989,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
fd_set_bits fds;
char *bits;
size_t size;
unsigned long timeout;
long timeout;
int ret;
timeout = MAX_SCHEDULE_TIMEOUT;
......
......@@ -91,15 +91,15 @@ static int regoff[] = {
PT_REG( pc)
};
static long zero;
static unsigned long zero;
/*
* Get address of register REGNO in task TASK.
*/
static long *
static unsigned long *
get_reg_addr(struct task_struct * task, unsigned long regno)
{
long *addr;
unsigned long *addr;
if (regno == 30) {
addr = &task->thread_info->pcb.usp;
......@@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
zero = 0;
addr = &zero;
} else {
addr = (long *)((long)task->thread_info + regoff[regno]);
addr = (void *)task->thread_info + regoff[regno];
}
return addr;
}
......@@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
/*
* Get contents of register REGNO in task TASK.
*/
static long
static unsigned long
get_reg(struct task_struct * task, unsigned long regno)
{
/* Special hack for fpcr -- combine hardware and software bits. */
......@@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno)
* Write contents of register REGNO in task TASK.
*/
static int
put_reg(struct task_struct *task, unsigned long regno, long data)
put_reg(struct task_struct *task, unsigned long regno, unsigned long data)
{
if (regno == 63) {
task->thread_info->ieee_state
......@@ -168,11 +168,11 @@ int
ptrace_set_bpt(struct task_struct * child)
{
int displ, i, res, reg_b, nsaved = 0;
u32 insn, op_code;
unsigned int insn, op_code;
unsigned long pc;
pc = get_reg(child, REG_PC);
res = read_int(child, pc, &insn);
res = read_int(child, pc, (int *) &insn);
if (res < 0)
return res;
......@@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child)
/* install breakpoints: */
for (i = 0; i < nsaved; ++i) {
res = read_int(child, child->thread_info->bpt_addr[i], &insn);
res = read_int(child, child->thread_info->bpt_addr[i],
(int *) &insn);
if (res < 0)
return res;
child->thread_info->bpt_insn[i] = insn;
......
......@@ -228,6 +228,12 @@ struct rt_sigframe
unsigned int retcode[3];
};
/* If this changes, userland unwinders that Know Things about our signal
frame will break. Do not undertake lightly. It also implies an ABI
change wrt the size of siginfo_t, which may cause some pain. */
extern char compile_time_assert
[offsetof(struct rt_sigframe, uc.uc_mcontext) == 176 ? 1 : -1];
#define INSN_MOV_R30_R16 0x47fe0410
#define INSN_LDI_R0 0x201f0000
#define INSN_CALLSYS 0x00000083
......
......@@ -91,15 +91,15 @@ srmcons_receive_chars(unsigned long data)
/* called with callback_lock held */
static int
srmcons_do_write(struct tty_struct *tty, const unsigned char *buf, int count)
srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
{
unsigned char *str_cr = "\r";
static char str_cr[1] = "\r";
long c, remaining = count;
srmcons_result result;
unsigned char *cur;
char *cur;
int need_cr;
for (cur = (unsigned char *)buf; remaining > 0; ) {
for (cur = (char *)buf; remaining > 0; ) {
need_cr = 0;
/*
* Break it up into reasonable size chunks to allow a chance
......@@ -138,7 +138,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
unsigned long flags;
if (from_user) {
unsigned char tmp[512];
char tmp[512];
int ret = 0;
size_t c;
......@@ -167,7 +167,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
}
spin_lock_irqsave(&srmcons_callback_lock, flags);
srmcons_do_write(tty, buf, count);
srmcons_do_write(tty, (const char *) buf, count);
spin_unlock_irqrestore(&srmcons_callback_lock, flags);
return count;
......
......@@ -176,7 +176,6 @@ CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_FWMARK=y
CONFIG_IP_ROUTE_NAT=y
# CONFIG_IP_ROUTE_MULTIPATH is not set
# CONFIG_IP_ROUTE_TOS is not set
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set
......
......@@ -308,7 +308,6 @@ CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_FWMARK=y
CONFIG_IP_ROUTE_NAT=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_TOS=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
......
......@@ -202,7 +202,7 @@ static void apm_suspend(void)
}
up_read(&user_list_lock);
wake_up_interruptible(&apm_suspend_waitqueue);
wake_up(&apm_suspend_waitqueue);
}
static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
......@@ -306,6 +306,14 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
flags = current->flags;
current->flags |= PF_NOFREEZE;
/*
* Note: do not allow a thread which is acking the suspend
* to escape until the resume is complete.
*/
if (as->suspend_state == SUSPEND_ACKED)
wait_event(apm_suspend_waitqueue,
as->suspend_state == SUSPEND_DONE);
else
wait_event_interruptible(apm_suspend_waitqueue,
as->suspend_state == SUSPEND_DONE);
......
......@@ -32,6 +32,7 @@
#include <asm/arch/udc.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/mmc.h>
#include "generic.h"
......@@ -128,6 +129,12 @@ static struct platform_device pxamci_device = {
.resource = pxamci_resources,
};
void __init pxa_set_mci_info(struct pxamci_platform_data *info)
{
pxamci_device.dev.platform_data = info;
}
EXPORT_SYMBOL(pxa_set_mci_info);
static struct pxa2xx_udc_mach_info pxa_udc_info;
......
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.9-rc1
# Fri Aug 27 22:00:00 2004
# Linux kernel version: 2.6.9-rc2
# Fri Sep 17 13:58:32 2004
#
#
......@@ -13,6 +13,7 @@ CONFIG_CLEAN_COMPILE=y
#
# General setup
#
CONFIG_LOCALVERSION=""
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
......@@ -33,6 +34,8 @@ CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SHMEM=y
# CONFIG_TINY_SHMEM is not set
#
# Loadable module support
......@@ -54,6 +57,7 @@ CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_TIME_INTERPOLATION=y
CONFIG_EFI=y
CONFIG_GENERIC_IOMAP=y
# CONFIG_IA64_GENERIC is not set
# CONFIG_IA64_DIG is not set
# CONFIG_IA64_HP_ZX1 is not set
......@@ -210,7 +214,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
......@@ -277,7 +280,8 @@ CONFIG_SCSI_FC_ATTRS=y
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
CONFIG_SCSI_SATA=y
# CONFIG_SCSI_SATA_SVW is not set
# CONFIG_SCSI_ATA_PIIX is not set
......@@ -334,8 +338,7 @@ CONFIG_DM_ZERO=m
# Fusion MPT device support
#
CONFIG_FUSION=y
CONFIG_FUSION_MAX_SGE=40
CONFIG_FUSION_ISENSE=m
CONFIG_FUSION_MAX_SGE=128
CONFIG_FUSION_CTL=m
#
......@@ -550,7 +553,6 @@ CONFIG_SERIAL_SGI_L1_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_QIC02_TAPE is not set
#
# IPMI
......@@ -575,6 +577,7 @@ CONFIG_EFI_RTC=y
CONFIG_RAW_DRIVER=m
# CONFIG_HPET is not set
CONFIG_MAX_RAW_DEVS=256
CONFIG_MMTIMER=y
#
# I2C support
......
......@@ -48,6 +48,7 @@ static void elf32_set_personality (void);
extern struct page *ia32_shared_page[];
extern unsigned long *ia32_gdt;
extern struct page *ia32_gate_page;
struct page *
ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int *type)
......@@ -59,10 +60,25 @@ ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int
return pg;
}
struct page *
ia32_install_gate_page (struct vm_area_struct *vma, unsigned long address, int *type)
{
struct page *pg = ia32_gate_page;
get_page(pg);
if (type)
*type = VM_FAULT_MINOR;
return pg;
}
static struct vm_operations_struct ia32_shared_page_vm_ops = {
.nopage = ia32_install_shared_page
};
static struct vm_operations_struct ia32_gate_page_vm_ops = {
.nopage = ia32_install_gate_page
};
void
ia64_elf32_init (struct pt_regs *regs)
{
......@@ -89,6 +105,29 @@ ia64_elf32_init (struct pt_regs *regs)
up_write(&current->mm->mmap_sem);
}
/*
* When user stack is not executable, push sigreturn code to stack makes
* segmentation fault raised when returning to kernel. So now sigreturn
* code is locked in specific gate page, which is pointed by pretcode
* when setup_frame_ia32
*/
vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
if (vma) {
memset(vma, 0, sizeof(*vma));
vma->vm_mm = current->mm;
vma->vm_start = IA32_GATE_OFFSET;
vma->vm_end = vma->vm_start + PAGE_SIZE;
vma->vm_page_prot = PAGE_COPY_EXEC;
vma->vm_flags = VM_READ | VM_MAYREAD | VM_EXEC
| VM_MAYEXEC | VM_RESERVED;
vma->vm_ops = &ia32_gate_page_vm_ops;
down_write(&current->mm->mmap_sem);
{
insert_vm_struct(current->mm, vma);
}
up_write(&current->mm->mmap_sem);
}
/*
* Install LDT as anonymous memory. This gives us all-zero segment descriptors
* until a task modifies them via modify_ldt().
......
......@@ -311,7 +311,7 @@ ia32_syscall_table:
data8 sys_ni_syscall /* old profil syscall holder */
data8 compat_sys_statfs
data8 compat_sys_fstatfs /* 100 */
data8 sys32_ioperm
data8 sys_ni_syscall /* ioperm */
data8 compat_sys_socketcall
data8 sys_syslog
data8 compat_sys_setitimer
......@@ -320,7 +320,7 @@ ia32_syscall_table:
data8 compat_sys_newlstat
data8 compat_sys_newfstat
data8 sys_ni_syscall
data8 sys32_iopl /* 110 */
data8 sys_ni_syscall /* iopl */ /* 110 */
data8 sys_vhangup
data8 sys_ni_syscall /* used to be sys_idle */
data8 sys_ni_syscall
......
......@@ -853,13 +853,18 @@ setup_frame_ia32 (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs
unsigned int restorer = IA32_SA_RESTORER(ka);
err |= __put_user(restorer, &frame->pretcode);
} else {
err |= __put_user((long)frame->retcode, &frame->pretcode);
/* This is popl %eax ; movl $,%eax ; int $0x80 */
/* Pointing to restorer in ia32 gate page */
err |= __put_user(IA32_GATE_OFFSET, &frame->pretcode);
}
/* This is popl %eax ; movl $,%eax ; int $0x80
* and there for historical reasons only.
* See arch/i386/kernel/signal.c
*/
err |= __put_user(0xb858, (short *)(frame->retcode+0));
err |= __put_user(__IA32_NR_sigreturn & 0xffff, (short *)(frame->retcode+2));
err |= __put_user(__IA32_NR_sigreturn >> 16, (short *)(frame->retcode+4));
err |= __put_user(__IA32_NR_sigreturn, (int *)(frame->retcode+2));
err |= __put_user(0x80cd, (short *)(frame->retcode+6));
}
if (err)
goto give_sigsegv;
......@@ -922,12 +927,18 @@ setup_rt_frame_ia32 (int sig, struct k_sigaction *ka, siginfo_t *info,
unsigned int restorer = IA32_SA_RESTORER(ka);
err |= __put_user(restorer, &frame->pretcode);
} else {
err |= __put_user((long)frame->retcode, &frame->pretcode);
/* This is movl $,%eax ; int $0x80 */
/* Pointing to rt_restorer in ia32 gate page */
err |= __put_user(IA32_GATE_OFFSET + 8, &frame->pretcode);
}
/* This is movl $,%eax ; int $0x80
* and there for historical reasons only.
* See arch/i386/kernel/signal.c
*/
err |= __put_user(0xb8, (char *)(frame->retcode+0));
err |= __put_user(__IA32_NR_rt_sigreturn, (int *)(frame->retcode+1));
err |= __put_user(0x80cd, (short *)(frame->retcode+5));
}
if (err)
goto give_sigsegv;
......
......@@ -33,6 +33,7 @@ struct exec_domain ia32_exec_domain;
struct page *ia32_shared_page[NR_CPUS];
unsigned long *ia32_boot_gdt;
unsigned long *cpu_gdt_table[NR_CPUS];
struct page *ia32_gate_page;
static unsigned long
load_desc (u16 selector)
......@@ -158,7 +159,7 @@ ia32_gdt_init (void)
/*
* Setup IA32 GDT and TSS
*/
void
static void
ia32_boot_gdt_init (void)
{
unsigned long ldt_size;
......@@ -172,12 +173,12 @@ ia32_boot_gdt_init (void)
/* CS descriptor in IA-32 (scrambled) format */
ia32_boot_gdt[__USER_CS >> 3]
= IA32_SEG_DESCRIPTOR(0, (IA32_PAGE_OFFSET-1) >> IA32_PAGE_SHIFT,
= IA32_SEG_DESCRIPTOR(0, (IA32_GATE_END-1) >> IA32_PAGE_SHIFT,
0xb, 1, 3, 1, 1, 1, 1);
/* DS descriptor in IA-32 (scrambled) format */
ia32_boot_gdt[__USER_DS >> 3]
= IA32_SEG_DESCRIPTOR(0, (IA32_PAGE_OFFSET-1) >> IA32_PAGE_SHIFT,
= IA32_SEG_DESCRIPTOR(0, (IA32_GATE_END-1) >> IA32_PAGE_SHIFT,
0x3, 1, 3, 1, 1, 1, 1);
ldt_size = PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE);
......@@ -187,6 +188,27 @@ ia32_boot_gdt_init (void)
0x2, 0, 3, 1, 1, 1, 0);
}
static void
ia32_gate_page_init(void)
{
unsigned long *sr;
ia32_gate_page = alloc_page(GFP_KERNEL);
sr = page_address(ia32_gate_page);
/* This is popl %eax ; movl $,%eax ; int $0x80 */
*sr++ = 0xb858 | (__IA32_NR_sigreturn << 16) | (0x80cdUL << 48);
/* This is movl $,%eax ; int $0x80 */
*sr = 0xb8 | (__IA32_NR_rt_sigreturn << 8) | (0x80cdUL << 40);
}
void
ia32_mem_init(void)
{
ia32_boot_gdt_init();
ia32_gate_page_init();
}
/*
* Handle bad IA32 interrupt via syscall
*/
......
......@@ -168,6 +168,9 @@ struct ia32_user_fxsr_struct {
#define IA32_SA_HANDLER(ka) ((unsigned long) (ka)->sa.sa_handler & 0xffffffff)
#define IA32_SA_RESTORER(ka) ((unsigned long) (ka)->sa.sa_handler >> 32)
#define __IA32_NR_sigreturn 119
#define __IA32_NR_rt_sigreturn 173
struct sigaction32 {
unsigned int sa_handler; /* Really a pointer, but need to deal with 32 bits */
unsigned int sa_flags;
......@@ -324,14 +327,16 @@ struct old_linux32_dirent {
#define IA32_PAGE_OFFSET 0xc0000000
#define IA32_STACK_TOP IA32_PAGE_OFFSET
#define IA32_GATE_OFFSET IA32_PAGE_OFFSET
#define IA32_GATE_END IA32_PAGE_OFFSET + PAGE_SIZE
/*
* The system segments (GDT, TSS, LDT) have to be mapped below 4GB so the IA-32 engine can
* access them.
*/
#define IA32_GDT_OFFSET (IA32_PAGE_OFFSET)
#define IA32_TSS_OFFSET (IA32_PAGE_OFFSET + PAGE_SIZE)
#define IA32_LDT_OFFSET (IA32_PAGE_OFFSET + 2*PAGE_SIZE)
#define IA32_GDT_OFFSET (IA32_PAGE_OFFSET + PAGE_SIZE)
#define IA32_TSS_OFFSET (IA32_PAGE_OFFSET + 2*PAGE_SIZE)
#define IA32_LDT_OFFSET (IA32_PAGE_OFFSET + 3*PAGE_SIZE)
#define ELF_EXEC_PAGESIZE IA32_PAGE_SIZE
......
......@@ -1913,73 +1913,6 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data,
return ret;
}
/*
* The IA64 maps 4 I/O ports for each 4K page
*/
#define IOLEN ((65536 / 4) * 4096)
asmlinkage long
sys32_iopl (int level)
{
extern unsigned long ia64_iobase;
int fd;
struct file * file;
unsigned int old;
unsigned long addr;
mm_segment_t old_fs = get_fs ();
if (level != 3)
return(-EINVAL);
/* Trying to gain more privileges? */
old = ia64_getreg(_IA64_REG_AR_EFLAG);
if ((unsigned int) level > ((old >> 12) & 3)) {
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
}
set_fs(KERNEL_DS);
fd = sys_open("/dev/mem", O_SYNC | O_RDWR, 0);
set_fs(old_fs);
if (fd < 0)
return fd;
file = fget(fd);
if (file == NULL) {
sys_close(fd);
return(-EFAULT);
}
down_write(&current->mm->mmap_sem);
addr = do_mmap_pgoff(file, IA32_IOBASE,
IOLEN, PROT_READ|PROT_WRITE, MAP_SHARED,
(ia64_iobase & ~PAGE_OFFSET) >> PAGE_SHIFT);
up_write(&current->mm->mmap_sem);
if (addr >= 0) {
old = (old & ~0x3000) | (level << 12);
ia64_setreg(_IA64_REG_AR_EFLAG, old);
}
fput(file);
sys_close(fd);
return 0;
}
asmlinkage long
sys32_ioperm (unsigned int from, unsigned int num, int on)
{
/*
* Since IA64 doesn't have permission bits we'd have to go to
* a lot of trouble to simulate them in software. There's
* no point, only trusted programs can make this call so we'll
* just turn it into an iopl call and let the process have
* access to all I/O ports.
*
* XXX proper ioperm() support should be emulated by
* manipulating the page protections...
*/
return sys32_iopl(3);
}
typedef struct {
unsigned int ss_sp;
unsigned int ss_flags;
......
......@@ -587,6 +587,6 @@ mem_init (void)
setup_gate();
#ifdef CONFIG_IA32_SUPPORT
ia32_boot_gdt_init();
ia32_mem_init();
#endif
}
......@@ -272,7 +272,6 @@ CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_NAT=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_TOS=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set
......
......@@ -229,7 +229,6 @@ CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_NAT=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_TOS=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set
......
......@@ -1737,21 +1737,30 @@ sys32_timer_create(u32 clock, struct sigevent32 __user *se32,
}
asmlinkage long compat_sys_waitid(u32 which, u32 pid,
struct siginfo32 __user *uinfo, u32 options)
struct siginfo32 __user *uinfo, u32 options,
struct compat_rusage __user *uru)
{
siginfo_t info;
struct rusage ru;
long ret;
mm_segment_t old_fs = get_fs();
memset(&info, 0, sizeof(info));
set_fs (KERNEL_DS);
ret = sys_waitid((int)which, (compat_pid_t) pid,
(siginfo_t __user *) &info, (int) options);
ret = sys_waitid(which, pid, (siginfo_t __user *) &info,
options, uru ? &ru : NULL);
set_fs (old_fs);
if (ret < 0 || info.si_signo == 0)
return ret;
if (uru) {
ret = put_compat_rusage(&ru, uru);
if (ret)
return ret;
}
BUG_ON(info.si_code & __SI_MASK);
info.si_code |= __SI_CHLD;
return copy_siginfo_to_user32(uinfo, &info);
......
......@@ -1152,19 +1152,26 @@ asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp,
}
asmlinkage long sys32_waitid(int which, compat_pid_t pid,
siginfo_t32 __user *uinfo, int options)
siginfo_t32 __user *uinfo, int options,
struct compat_rusage __user *uru)
{
siginfo_t info;
struct rusage ru;
long ret;
mm_segment_t old_fs = get_fs();
info.si_signo = 0;
set_fs (KERNEL_DS);
ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options);
ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
uru ? &ru : NULL);
set_fs (old_fs);
if (ret < 0 || info.si_signo == 0)
return ret;
if (uru && (ret = put_compat_rusage(&ru, uru)))
return ret;
BUG_ON(info.si_code & __SI_MASK);
info.si_code |= __SI_CHLD;
return ia32_copy_siginfo_to_user(uinfo, &info);
......
......@@ -1667,7 +1667,7 @@ static int __devinit fs_init (struct fs_dev *dev)
dev->hw_base = pci_resource_start(pci_dev, 0);
dev->base = (ulong) ioremap(dev->hw_base, 0x1000);
dev->base = ioremap(dev->hw_base, 0x1000);
reset_chip (dev);
......@@ -1704,8 +1704,7 @@ static int __devinit fs_init (struct fs_dev *dev)
}
/* Try again after 10ms. */
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout ((HZ+99)/100);
msleep(10);
}
if (!to) {
......
......@@ -477,7 +477,7 @@ struct fs_dev {
struct timer_list timer;
unsigned long hw_base; /* mem base address */
unsigned long base; /* Mapping of base address */
void __iomem *base; /* Mapping of base address */
int channo;
unsigned long channel_mask;
......
......@@ -1007,6 +1007,7 @@ he_start(struct atm_dev *dev)
{
struct he_dev *he_dev;
struct pci_dev *pci_dev;
unsigned long membase;
u16 command;
u32 gen_cntl_0, host_cntl, lb_swap;
......@@ -1019,8 +1020,8 @@ he_start(struct atm_dev *dev)
he_dev = HE_DEV(dev);
pci_dev = he_dev->pci_dev;
he_dev->membase = pci_dev->resource[0].start;
HPRINTK("membase = 0x%lx irq = %d.\n", he_dev->membase, pci_dev->irq);
membase = pci_resource_start(pci_dev, 0);
HPRINTK("membase = 0x%lx irq = %d.\n", membase, pci_dev->irq);
/*
* pci bus controller initialization
......@@ -1080,7 +1081,7 @@ he_start(struct atm_dev *dev)
hprintk("can't set latency timer to %d\n", timer);
}
if (!(he_dev->membase = (unsigned long) ioremap(he_dev->membase, HE_REGMAP_SIZE))) {
if (!(he_dev->membase = ioremap(membase, HE_REGMAP_SIZE))) {
hprintk("can't set up page mapping\n");
return -EINVAL;
}
......@@ -1962,7 +1963,7 @@ he_service_tbrq(struct he_dev *he_dev, int group)
struct he_tpd *tpd;
int slot, updated = 0;
#ifdef USE_TPD_POOL
struct list_head *p;
struct he_tpd *__tpd;
#endif
/* 2.1.6 transmit buffer return queue */
......@@ -1977,8 +1978,7 @@ he_service_tbrq(struct he_dev *he_dev, int group)
TBRQ_MULTIPLE(he_dev->tbrq_head) ? " MULTIPLE" : "");
#ifdef USE_TPD_POOL
tpd = NULL;
list_for_each(p, &he_dev->outstanding_tpds) {
struct he_tpd *__tpd = list_entry(p, struct he_tpd, entry);
list_for_each_entry(__tpd, &he_dev->outstanding_tpds, entry) {
if (TPD_ADDR(__tpd->status) == TBRQ_TPD(he_dev->tbrq_head)) {
tpd = __tpd;
list_del(&__tpd->entry);
......@@ -2595,9 +2595,8 @@ he_close(struct atm_vcc *vcc)
while (((tx_inuse = atomic_read(&vcc->sk->sk_wmem_alloc)) > 0) &&
(retry < MAX_RETRY)) {
set_current_state(TASK_UNINTERRUPTIBLE);
(void) schedule_timeout(sleep);
if (sleep < HZ)
msleep(sleep);
if (sleep < 250)
sleep = sleep * 2;
++retry;
......
......@@ -265,7 +265,7 @@ struct he_cs_stper
struct he_dev {
unsigned int number;
unsigned int irq;
unsigned long membase;
void __iomem *membase;
char prod_id[30];
char mac_addr[6];
......
......@@ -2516,7 +2516,7 @@ idt77252_close(struct atm_vcc *vcc)
struct vc_map *vc = vcc->dev_data;
unsigned long flags;
unsigned long addr;
int timeout;
unsigned long timeout;
down(&card->mutex);
......@@ -2566,9 +2566,9 @@ idt77252_close(struct atm_vcc *vcc)
}
spin_unlock_irqrestore(&vc->lock, flags);
timeout = 5 * HZ;
timeout = 5 * 1000;
while (atomic_read(&vc->scq->used) > 0) {
timeout = schedule_timeout(timeout);
timeout = msleep_interruptible(timeout);
if (!timeout)
break;
}
......@@ -3164,7 +3164,7 @@ deinit_card(struct idt77252_dev *card)
for (i = 0; i < 4; i++) {
if (card->fbq[i])
iounmap((void *) card->fbq[i]);
iounmap(card->fbq[i]);
}
if (card->membase)
......@@ -3722,7 +3722,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
card->tst_timer.function = tst_timer;
/* Do the I/O remapping... */
card->membase = (unsigned long) ioremap(membase, 1024);
card->membase = ioremap(membase, 1024);
if (!card->membase) {
printk("%s: can't ioremap() membase\n", card->name);
err = -EIO;
......@@ -3756,8 +3756,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
card->sramsize = probe_sram(card);
for (i = 0; i < 4; i++) {
card->fbq[i] = (unsigned long)
ioremap(srambase | 0x200000 | (i << 18), 4);
card->fbq[i] = ioremap(srambase | 0x200000 | (i << 18), 4);
if (!card->fbq[i]) {
printk("%s: can't ioremap() FBQ%d\n", card->name, i);
err = -EIO;
......
......@@ -355,9 +355,9 @@ struct idt77252_dev
struct pci_dev *pcidev; /* PCI handle (desriptor) */
struct atm_dev *atmdev; /* ATM device desriptor */
unsigned long membase; /* SAR's memory base address */
void __iomem *membase; /* SAR's memory base address */
unsigned long srambase; /* SAR's sram base address */
unsigned long fbq[4]; /* FBQ fill addresses */
void __iomem *fbq[4]; /* FBQ fill addresses */
struct semaphore mutex;
spinlock_t cmd_lock; /* for r/w utility/sram */
......
......@@ -191,7 +191,7 @@
#define LANAI_EEPROM_SIZE (128)
typedef int vci_t;
typedef unsigned long bus_addr_t;
typedef void __iomem *bus_addr_t;
/* DMA buffer in host memory for TX, RX, or service list. */
struct lanai_buffer {
......@@ -471,7 +471,7 @@ enum lanai_register {
static inline bus_addr_t reg_addr(const struct lanai_dev *lanai,
enum lanai_register reg)
{
return lanai->base + (bus_addr_t) reg;
return lanai->base + reg;
}
static inline u32 reg_read(const struct lanai_dev *lanai,
......@@ -651,7 +651,7 @@ static inline u32 cardvcc_read(const struct lanai_vcc *lvcc,
{
u32 val;
APRINTK(lvcc->vbase != 0, "cardvcc_read: unbound vcc!\n");
val= readl(lvcc->vbase + (bus_addr_t) offset);
val= readl(lvcc->vbase + offset);
RWDEBUG("VR vci=%04d 0x%02X = 0x%08X\n",
lvcc->vci, (int) offset, val);
return val;
......@@ -666,7 +666,7 @@ static inline void cardvcc_write(const struct lanai_vcc *lvcc,
(unsigned int) val, lvcc->vci, (unsigned int) offset);
RWDEBUG("VW vci=%04d 0x%02X > 0x%08X\n",
lvcc->vci, (unsigned int) offset, (unsigned int) val);
writel(val, lvcc->vbase + (bus_addr_t) offset);
writel(val, lvcc->vbase + offset);
}
/* -------------------- COMPUTE SIZE OF AN AAL5 PDU: */
......@@ -813,7 +813,7 @@ static void lanai_shutdown_tx_vci(struct lanai_dev *lanai,
DPRINTK("read, write = %d, %d\n", read, write);
break;
}
schedule_timeout(HZ / 25);
msleep(4);
}
/* 15.2.2 - clear out all tx registers */
cardvcc_write(lvcc, 0, vcc_txreadptr);
......@@ -2177,7 +2177,7 @@ static int __init lanai_dev_open(struct atm_dev *atmdev)
/* 3.2: PCI initialization */
if ((result = lanai_pci_start(lanai)) != 0)
goto error;
raw_base = (bus_addr_t) lanai->pci->resource[0].start;
raw_base = lanai->pci->resource[0].start;
lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE);
if (lanai->base == 0) {
printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n");
......
......@@ -467,6 +467,7 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
u32 u32d[4];
u32 ns_cfg_rctsize;
int bcount;
unsigned long membase;
error = 0;
......@@ -494,8 +495,8 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
card->index = i;
card->atmdev = NULL;
card->pcidev = pcidev;
card->membase = pci_resource_start(pcidev, 1);
card->membase = (unsigned long) ioremap(card->membase, NS_IOREMAP_SIZE);
membase = pci_resource_start(pcidev, 1);
card->membase = ioremap(membase, NS_IOREMAP_SIZE);
if (card->membase == 0)
{
printk("nicstar%d: can't ioremap() membase.\n",i);
......
......@@ -763,7 +763,7 @@ typedef struct ns_dev
{
int index; /* Card ID to the device driver */
int sram_size; /* In k x 32bit words. 32 or 128 */
unsigned long membase; /* Card's memory base address */
void __iomem *membase; /* Card's memory base address */
unsigned long max_pcr;
int rct_size; /* Number of entries */
int vpibits;
......
......@@ -162,7 +162,7 @@ nicstar_read_eprom_status( virt_addr_t base )
*/
static u_int8_t
read_eprom_byte(u_int32_t base, u_int8_t offset)
read_eprom_byte(virt_addr_t base, u_int8_t offset)
{
u_int32_t val = 0;
int i,j=0;
......
......@@ -7,7 +7,7 @@
******************************************************************************/
typedef unsigned int virt_addr_t;
typedef void __iomem *virt_addr_t;
u_int32_t nicstar_read_eprom_status( virt_addr_t base );
void nicstar_init_eprom( virt_addr_t base );
......
......@@ -52,10 +52,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __HAVE_COUNTERS
#define __HAVE_COUNTERS 0
#endif
#ifndef DRIVER_IOCTLS
#define DRIVER_IOCTLS
#endif
......@@ -195,41 +191,6 @@ static int DRM(setup)( drm_device_t *dev )
return i;
}
dev->counters = 6 + __HAVE_COUNTERS;
dev->types[0] = _DRM_STAT_LOCK;
dev->types[1] = _DRM_STAT_OPENS;
dev->types[2] = _DRM_STAT_CLOSES;
dev->types[3] = _DRM_STAT_IOCTLS;
dev->types[4] = _DRM_STAT_LOCKS;
dev->types[5] = _DRM_STAT_UNLOCKS;
#ifdef __HAVE_COUNTER6
dev->types[6] = __HAVE_COUNTER6;
#endif
#ifdef __HAVE_COUNTER7
dev->types[7] = __HAVE_COUNTER7;
#endif
#ifdef __HAVE_COUNTER8
dev->types[8] = __HAVE_COUNTER8;
#endif
#ifdef __HAVE_COUNTER9
dev->types[9] = __HAVE_COUNTER9;
#endif
#ifdef __HAVE_COUNTER10
dev->types[10] = __HAVE_COUNTER10;
#endif
#ifdef __HAVE_COUNTER11
dev->types[11] = __HAVE_COUNTER11;
#endif
#ifdef __HAVE_COUNTER12
dev->types[12] = __HAVE_COUNTER12;
#endif
#ifdef __HAVE_COUNTER13
dev->types[13] = __HAVE_COUNTER13;
#endif
#ifdef __HAVE_COUNTER14
dev->types[14] = __HAVE_COUNTER14;
#endif
for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
atomic_set( &dev->counts[i], 0 );
......@@ -511,6 +472,15 @@ static int DRM(probe)(struct pci_dev *pdev)
/* dev_priv_size can be changed by a driver in driver_register_fns */
dev->dev_priv_size = sizeof(u32);
/* the DRM has 6 basic counters - drivers add theirs in register_fns */
dev->counters = 6;
dev->types[0] = _DRM_STAT_LOCK;
dev->types[1] = _DRM_STAT_OPENS;
dev->types[2] = _DRM_STAT_CLOSES;
dev->types[3] = _DRM_STAT_IOCTLS;
dev->types[4] = _DRM_STAT_LOCKS;
dev->types[5] = _DRM_STAT_UNLOCKS;
DRM(init_fn_table)(dev);
DRM(driver_register_fns)(dev);
......
......@@ -74,10 +74,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] = { i810_flip_bufs, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
#endif
......@@ -1412,5 +1412,11 @@ void i810_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.release = i810_driver_release;
dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent;
dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers;
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
}
......@@ -73,12 +73,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
/* Driver will work either way: IRQ's save cpu time when waiting for
* the card, but are subject to subtle interactions between bios,
* hardware and the driver.
......
......@@ -1615,5 +1615,10 @@ void i830_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i830_driver_irq_handler;
#endif
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
}
......@@ -45,12 +45,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I915_INIT_HEAP)] = { i915_mem_init_heap, 1, 1 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I915_CMDBUFFER)] = { i915_cmdbuffer, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
/* We use our own dma mechanisms, not the drm template code. However,
* the shared IRQ code is useful to us:
*/
......
......@@ -746,4 +746,10 @@ void i915_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i915_driver_irq_handler;
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
}
......@@ -60,9 +60,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_MGA_GETPARAM)]= { mga_getparam, 1, 0 },
#define __HAVE_COUNTERS 3
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#endif
......@@ -819,4 +819,9 @@ void mga_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall;
dev->fn_tbl.irq_handler = mga_driver_irq_handler;
dev->counters += 3;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
}
......@@ -58,6 +58,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_SIS_AGP_FREE)] = { sis_ioctl_agp_free, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_SIS_FB_INIT)] = { sis_fb_init, 1, 1 }
#define __HAVE_COUNTERS 5
#endif
......@@ -428,11 +428,7 @@ static int mmc_blk_suspend(struct mmc_card *card, u32 state)
struct mmc_blk_data *md = mmc_get_drvdata(card);
if (md) {
unsigned long flags;
spin_lock_irqsave(&md->lock, flags);
blk_stop_queue(md->queue.queue);
spin_unlock_irqrestore(&md->lock, flags);
mmc_queue_suspend(&md->queue);
}
return 0;
}
......@@ -442,12 +438,8 @@ static int mmc_blk_resume(struct mmc_card *card)
struct mmc_blk_data *md = mmc_get_drvdata(card);
if (md) {
unsigned long flags;
mmc_blk_set_blksize(md, card);
spin_lock_irqsave(&md->lock, flags);
blk_start_queue(md->queue.queue);
spin_unlock_irqrestore(&md->lock, flags);
mmc_queue_resume(&md->queue);
}
return 0;
}
......
......@@ -15,6 +15,9 @@
#include <linux/mmc/host.h>
#include "mmc_queue.h"
#define MMC_QUEUE_EXIT (1 << 0)
#define MMC_QUEUE_SUSPENDED (1 << 1)
/*
* Prepare a MMC request. Essentially, this means passing the
* preparation off to the media driver. The media driver will
......@@ -66,14 +69,9 @@ static int mmc_queue_thread(void *d)
daemonize("mmcqd");
spin_lock_irq(&current->sighand->siglock);
sigfillset(&current->blocked);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
mq->thread = current;
complete(&mq->thread_complete);
down(&mq->thread_sem);
add_wait_queue(&mq->thread_wq, &wait);
do {
struct request *req = NULL;
......@@ -85,9 +83,11 @@ static int mmc_queue_thread(void *d)
spin_unlock(q->queue_lock);
if (!req) {
if (!mq->thread)
if (mq->flags & MMC_QUEUE_EXIT)
break;
up(&mq->thread_sem);
schedule();
down(&mq->thread_sem);
continue;
}
set_current_state(TASK_RUNNING);
......@@ -95,6 +95,7 @@ static int mmc_queue_thread(void *d)
mq->issue_fn(mq, req);
} while (1);
remove_wait_queue(&mq->thread_wq, &wait);
up(&mq->thread_sem);
complete_and_exit(&mq->thread_complete, 0);
return 0;
......@@ -148,6 +149,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
init_completion(&mq->thread_complete);
init_waitqueue_head(&mq->thread_wq);
init_MUTEX(&mq->thread_sem);
ret = kernel_thread(mmc_queue_thread, mq, CLONE_KERNEL);
if (ret < 0) {
......@@ -160,17 +162,61 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
return ret;
}
EXPORT_SYMBOL(mmc_init_queue);
void mmc_cleanup_queue(struct mmc_queue *mq)
{
mq->thread = NULL;
mq->flags |= MMC_QUEUE_EXIT;
wake_up(&mq->thread_wq);
wait_for_completion(&mq->thread_complete);
blk_cleanup_queue(mq->queue);
mq->card = NULL;
}
EXPORT_SYMBOL(mmc_cleanup_queue);
/**
* mmc_queue_suspend - suspend a MMC request queue
* @mq: MMC queue to suspend
*
* Stop the block request queue, and wait for our thread to
* complete any outstanding requests. This ensures that we
* won't suspend while a request is being processed.
*/
void mmc_queue_suspend(struct mmc_queue *mq)
{
request_queue_t *q = mq->queue;
unsigned long flags;
if (!(mq->flags & MMC_QUEUE_SUSPENDED)) {
mq->flags |= MMC_QUEUE_SUSPENDED;
spin_lock_irqsave(q->queue_lock, flags);
blk_stop_queue(q);
spin_unlock_irqrestore(q->queue_lock, flags);
down(&mq->thread_sem);
}
}
EXPORT_SYMBOL(mmc_queue_suspend);
/**
* mmc_queue_resume - resume a previously suspended MMC request queue
* @mq: MMC queue to resume
*/
void mmc_queue_resume(struct mmc_queue *mq)
{
request_queue_t *q = mq->queue;
unsigned long flags;
if (mq->flags & MMC_QUEUE_SUSPENDED) {
mq->flags &= ~MMC_QUEUE_SUSPENDED;
up(&mq->thread_sem);
spin_lock_irqsave(q->queue_lock, flags);
blk_start_queue(q);
spin_unlock_irqrestore(q->queue_lock, flags);
}
}
EXPORT_SYMBOL(mmc_queue_resume);
......@@ -8,7 +8,8 @@ struct mmc_queue {
struct mmc_card *card;
struct completion thread_complete;
wait_queue_head_t thread_wq;
struct task_struct *thread;
struct semaphore thread_sem;
unsigned int flags;
struct request *req;
int (*prep_fn)(struct mmc_queue *, struct request *);
int (*issue_fn)(struct mmc_queue *, struct request *);
......@@ -25,5 +26,7 @@ struct mmc_io_request {
extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *);
extern void mmc_cleanup_queue(struct mmc_queue *);
extern void mmc_queue_suspend(struct mmc_queue *);
extern void mmc_queue_resume(struct mmc_queue *);
#endif
......@@ -33,6 +33,8 @@
#include <asm/irq.h>
#include <asm/sizes.h>
#include <asm/arch/mmc.h>
#include "pxamci.h"
#ifdef CONFIG_MMC_DEBUG
......@@ -52,6 +54,7 @@ struct pxamci_host {
unsigned int cmdat;
unsigned int imask;
unsigned int power_mode;
struct pxamci_platform_data *pdata;
struct mmc_request *mrq;
struct mmc_command *cmd;
......@@ -384,9 +387,8 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (host->power_mode != ios->power_mode) {
host->power_mode = ios->power_mode;
/*
* power control? none on the lubbock.
*/
if (host->pdata && host->pdata->setpower)
host->pdata->setpower(mmc->dev, ios->vdd);
if (ios->power_mode == MMC_POWER_ON)
host->cmdat |= CMDAT_INIT;
......@@ -407,6 +409,12 @@ static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs)
DCSR(dma) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
}
static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
{
mmc_detect_change(devid);
return IRQ_HANDLED;
}
static int pxamci_probe(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
......@@ -433,11 +441,14 @@ static int pxamci_probe(struct device *dev)
mmc->ops = &pxamci_ops;
mmc->f_min = 312500;
mmc->f_max = 20000000;
mmc->ocr_avail = MMC_VDD_32_33;
host = mmc_priv(mmc);
host->mmc = mmc;
host->dma = -1;
host->pdata = pdev->dev.platform_data;
mmc->ocr_avail = host->pdata ?
host->pdata->ocr_mask :
MMC_VDD_32_33|MMC_VDD_33_34;
host->sg_cpu = dma_alloc_coherent(dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);
if (!host->sg_cpu) {
......@@ -464,6 +475,7 @@ static int pxamci_probe(struct device *dev)
pxamci_stop_clock(host);
writel(0, host->base + MMC_SPI);
writel(64, host->base + MMC_RESTO);
writel(host->imask, host->base + MMC_I_MASK);
pxa_gpio_mode(GPIO6_MMCCLK_MD);
pxa_gpio_mode(GPIO8_MMCCS0_MD);
......@@ -481,6 +493,9 @@ static int pxamci_probe(struct device *dev)
dev_set_drvdata(dev, mmc);
if (host->pdata && host->pdata->init)
host->pdata->init(dev, pxamci_detect_irq, mmc);
mmc_add_host(mmc);
return 0;
......@@ -509,6 +524,9 @@ static int pxamci_remove(struct device *dev)
if (mmc) {
struct pxamci_host *host = mmc_priv(mmc);
if (host->pdata && host->pdata->exit)
host->pdata->exit(dev, mmc);
mmc_remove_host(mmc);
pxamci_stop_clock(host);
......@@ -516,6 +534,8 @@ static int pxamci_remove(struct device *dev)
END_CMD_RES|PRG_DONE|DATA_TRAN_DONE,
host->base + MMC_I_MASK);
pxa_set_cken(CKEN12_MMC, 0);
free_irq(host->irq, host);
pxa_free_dma(host->dma);
iounmap(host->base);
......
......@@ -49,6 +49,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <net/sock.h>
#include <net/checksum.h>
#include <linux/if_ether.h> /* For the statistics structure. */
......@@ -183,6 +184,17 @@ static struct net_device_stats *get_stats(struct net_device *dev)
return stats;
}
u32 loopback_get_link(struct net_device *dev)
{
return 1;
}
static struct ethtool_ops loopback_ethtool_ops = {
.get_link = loopback_get_link,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso,
};
struct net_device loopback_dev = {
.name = "lo",
.mtu = (16 * 1024) + 20 + 20 + 12,
......@@ -199,6 +211,7 @@ struct net_device loopback_dev = {
.features = NETIF_F_SG|NETIF_F_FRAGLIST
|NETIF_F_NO_CSUM|NETIF_F_HIGHDMA
|NETIF_F_LLTX,
.ethtool_ops = &loopback_ethtool_ops,
};
/* Setup and register the of the LOOPBACK device. */
......
......@@ -40,9 +40,7 @@ config TULIP
(smc9332dst), you can also try the driver for "Generic DECchip"
cards, above. However, most people with a network card of this type
will say Y here.) Do read the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>. More specific
information is contained in
<file:Documentation/networking/tulip.txt>.
<http://www.tldp.org/docs.html#howto>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
......
......@@ -126,26 +126,28 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
i = 0;
read_lock(&GlobalSMBSeslock);
list_for_each(tmp, &GlobalTreeConnectionList) {
__u32 dev_type;
i++;
tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
length =
sprintf(buf,
"\n%d) %s Uses: %d Type: %s Characteristics: 0x%x Attributes: 0x%x\nPathComponentMax: %d Status: %d",
i, tcon->treeName,
atomic_read(&tcon->useCount),
tcon->nativeFileSystem,
tcon->fsDevInfo.DeviceCharacteristics,
tcon->fsAttrInfo.Attributes,
tcon->fsAttrInfo.MaxPathNameComponentLength,tcon->tidStatus);
le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
le32_to_cpu(tcon->fsAttrInfo.Attributes),
le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),
tcon->tidStatus);
buf += length;
if (tcon->fsDevInfo.DeviceType == FILE_DEVICE_DISK)
if (dev_type == FILE_DEVICE_DISK)
length = sprintf(buf, " type: DISK ");
else if (tcon->fsDevInfo.DeviceType == FILE_DEVICE_CD_ROM)
else if (dev_type == FILE_DEVICE_CD_ROM)
length = sprintf(buf, " type: CDROM ");
else
length =
sprintf(buf, " type: %d ",
tcon->fsDevInfo.DeviceType);
sprintf(buf, " type: %d ", dev_type);
buf += length;
if(tcon->tidStatus == CifsNeedReconnect) {
buf += sprintf(buf, "\tDISCONNECTED ");
......
......@@ -61,7 +61,7 @@ int cifs_sign_smb(struct smb_hdr * cifs_pdu, struct cifsSesInfo * ses,
if((cifs_pdu == NULL) || (ses == NULL))
return -EINVAL;
if((le32_to_cpu(cifs_pdu->Flags2) & SMBFLG2_SECURITY_SIGNATURE) == 0)
if((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0)
return rc;
spin_lock(&GlobalMid_Lock);
......@@ -107,13 +107,11 @@ int cifs_verify_signature(struct smb_hdr * cifs_pdu, const char * mac_key,
if(memcmp(cifs_pdu->Signature.SecuritySignature,"BSRSPYL ",8)==0)
cFYI(1,("dummy signature received for smb command 0x%x",cifs_pdu->Command));
expected_sequence_number = cpu_to_le32(expected_sequence_number);
/* save off the origiginal signature so we can modify the smb and check
its signature against what the server sent */
memcpy(server_response_sig,cifs_pdu->Signature.SecuritySignature,8);
cifs_pdu->Signature.Sequence.SequenceNumber = expected_sequence_number;
cifs_pdu->Signature.Sequence.SequenceNumber = cpu_to_le32(expected_sequence_number);
cifs_pdu->Signature.Sequence.Reserved = 0;
rc = cifs_calculate_signature(cifs_pdu, mac_key,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -76,6 +76,9 @@ cifs_get_inode_info_unix(struct inode **pinode,
} else {
struct cifsInodeInfo *cifsInfo;
__u32 type = le32_to_cpu(findData.Type);
__u64 num_of_bytes = le64_to_cpu(findData.NumOfBytes);
__u64 end_of_file = le64_to_cpu(findData.EndOfFile);
/* get new inode */
if (*pinode == NULL) {
......@@ -101,37 +104,34 @@ cifs_get_inode_info_unix(struct inode **pinode,
inode->i_ctime =
cifs_NTtimeToUnix(le64_to_cpu(findData.LastStatusChange));
inode->i_mode = le64_to_cpu(findData.Permissions);
findData.Type = le32_to_cpu(findData.Type);
if (findData.Type == UNIX_FILE) {
if (type == UNIX_FILE) {
inode->i_mode |= S_IFREG;
} else if (findData.Type == UNIX_SYMLINK) {
} else if (type == UNIX_SYMLINK) {
inode->i_mode |= S_IFLNK;
} else if (findData.Type == UNIX_DIR) {
} else if (type == UNIX_DIR) {
inode->i_mode |= S_IFDIR;
} else if (findData.Type == UNIX_CHARDEV) {
} else if (type == UNIX_CHARDEV) {
inode->i_mode |= S_IFCHR;
inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor),
le64_to_cpu(findData.DevMinor) & MINORMASK);
} else if (findData.Type == UNIX_BLOCKDEV) {
} else if (type == UNIX_BLOCKDEV) {
inode->i_mode |= S_IFBLK;
inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor),
le64_to_cpu(findData.DevMinor) & MINORMASK);
} else if (findData.Type == UNIX_FIFO) {
} else if (type == UNIX_FIFO) {
inode->i_mode |= S_IFIFO;
} else if (findData.Type == UNIX_SOCKET) {
} else if (type == UNIX_SOCKET) {
inode->i_mode |= S_IFSOCK;
}
inode->i_uid = le64_to_cpu(findData.Uid);
inode->i_gid = le64_to_cpu(findData.Gid);
inode->i_nlink = le64_to_cpu(findData.Nlinks);
findData.NumOfBytes = le64_to_cpu(findData.NumOfBytes);
findData.EndOfFile = le64_to_cpu(findData.EndOfFile);
if(is_size_safe_to_change(cifsInfo)) {
/* can not safely change the file size here if the
client is writing to it due to potential races */
i_size_write(inode,findData.EndOfFile);
i_size_write(inode, end_of_file);
/* blksize needs to be multiple of two. So safer to default to blksize
and blkbits set in superblock so 2**blkbits and blksize will match */
/* inode->i_blksize =
......@@ -143,14 +143,14 @@ cifs_get_inode_info_unix(struct inode **pinode,
/* inode->i_blocks =
(inode->i_blksize - 1 + findData.NumOfBytes) >> inode->i_blkbits;*/
(inode->i_blksize - 1 + num_of_bytes) >> inode->i_blkbits;*/
/* 512 bytes (2**9) is the fake blocksize that must be used */
/* for this calculation */
inode->i_blocks = (512 - 1 + findData.NumOfBytes) >> 9;
inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
}
if (findData.NumOfBytes < findData.EndOfFile)
if (num_of_bytes < end_of_file)
cFYI(1, ("Server inconsistency Error: it says allocation size less than end of file "));
cFYI(1,
("Size %ld and blocks %ld ",
......@@ -237,6 +237,7 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
}
} else {
struct cifsInodeInfo *cifsInfo;
__u32 attr = le32_to_cpu(pfindData->Attributes);
/* get new inode */
if (*pinode == NULL) {
......@@ -247,8 +248,7 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
}
inode = *pinode;
cifsInfo = CIFS_I(inode);
pfindData->Attributes = le32_to_cpu(pfindData->Attributes);
cifsInfo->cifsAttrs = pfindData->Attributes;
cifsInfo->cifsAttrs = attr;
cFYI(1, (" Old time %ld ", cifsInfo->time));
cifsInfo->time = jiffies;
cFYI(1, (" New time %ld ", cifsInfo->time));
......@@ -266,17 +266,17 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
inode->i_ctime =
cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
cFYI(0,
(" Attributes came in as 0x%x ", pfindData->Attributes));
(" Attributes came in as 0x%x ", attr));
/* set default mode. will override for dirs below */
if(atomic_read(&cifsInfo->inUse) == 0)
/* new inode, can safely set these fields */
inode->i_mode = cifs_sb->mnt_file_mode;
if (pfindData->Attributes & ATTR_REPARSE) {
if (attr & ATTR_REPARSE) {
/* Can IFLNK be set as it basically is on windows with IFREG or IFDIR? */
inode->i_mode |= S_IFLNK;
} else if (pfindData->Attributes & ATTR_DIRECTORY) {
} else if (attr & ATTR_DIRECTORY) {
/* override default perms since we do not do byte range locking on dirs */
inode->i_mode = cifs_sb->mnt_dir_mode;
inode->i_mode |= S_IFDIR;
......@@ -298,7 +298,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
inode->i_blocks = (512 - 1 + le64_to_cpu(pfindData->AllocationSize))
>> 9;
}
pfindData->AllocationSize = le64_to_cpu(pfindData->AllocationSize);
inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks);
......@@ -951,7 +950,7 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
} else
time_buf.ChangeTime = 0;
if (set_time | time_buf.Attributes) {
if (set_time || time_buf.Attributes) {
/* BB what if setting one attribute fails
(such as size) but time setting works */
time_buf.CreationTime = 0; /* do not change */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -86,7 +86,7 @@ flush_tlb(void)
static inline void
flush_tlb_other(struct mm_struct *mm)
{
long *mmc = &mm->context[smp_processor_id()];
unsigned long *mmc = &mm->context[smp_processor_id()];
/* Check it's not zero first to avoid cacheline ping pong
when possible. */
if (*mmc) *mmc = 0;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment