Commit 4e621204 authored by David S. Miller's avatar David S. Miller

Merge nuts.davemloft.net:/disk1/BK/network-2.6

into nuts.davemloft.net:/disk1/BK/net-2.6
parents 02e9e39f 568c3285
The Linux kernel supports three overcommit handling modes The Linux kernel supports the following overcommit handling modes
0 - Heuristic overcommit handling. Obvious overcommits of 0 - Heuristic overcommit handling. Obvious overcommits of
address space are refused. Used for a typical system. It address space are refused. Used for a typical system. It
...@@ -7,10 +7,10 @@ The Linux kernel supports three overcommit handling modes ...@@ -7,10 +7,10 @@ The Linux kernel supports three overcommit handling modes
allocate slighly more memory in this mode. This is the allocate slighly more memory in this mode. This is the
default. default.
1 - No overcommit handling. Appropriate for some scientific 1 - Always overcommit. Appropriate for some scientific
applications. applications.
2 - (NEW) strict overcommit. The total address space commit 2 - Don't overcommit. The total address space commit
for the system is not permitted to exceed swap + a for the system is not permitted to exceed swap + a
configurable percentage (default is 50) of physical RAM. configurable percentage (default is 50) of physical RAM.
Depending on the percentage you use, in most situations Depending on the percentage you use, in most situations
...@@ -27,7 +27,7 @@ Gotchas ...@@ -27,7 +27,7 @@ Gotchas
The C language stack growth does an implicit mremap. If you want absolute The C language stack growth does an implicit mremap. If you want absolute
guarantees and run close to the edge you MUST mmap your stack for the guarantees and run close to the edge you MUST mmap your stack for the
largest size you think you will need. For typical stack usage is does largest size you think you will need. For typical stack usage this does
not matter much but it's a corner case if you really really care not matter much but it's a corner case if you really really care
In mode 2 the MAP_NORESERVE flag is ignored. In mode 2 the MAP_NORESERVE flag is ignored.
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 6 PATCHLEVEL = 6
SUBLEVEL = 9 SUBLEVEL = 9
EXTRAVERSION = -rc2 EXTRAVERSION = -rc3
NAME=Zonked Quokka NAME=Zonked Quokka
# *DOCUMENTATION* # *DOCUMENTATION*
......
...@@ -35,21 +35,15 @@ __XScale_start: ...@@ -35,21 +35,15 @@ __XScale_start:
mcr p15, 0, r0, c1, c0, 0 mcr p15, 0, r0, c1, c0, 0
#ifdef CONFIG_ARCH_IQ80321 #ifdef CONFIG_ARCH_IQ80321
orr pc, pc, #PHYS_OFFSET @ jump to physical memory if we are not there.
nop
mov r7, #MACH_TYPE_IQ80321 mov r7, #MACH_TYPE_IQ80321
#endif #endif
#ifdef CONFIG_ARCH_IQ31244 #ifdef CONFIG_ARCH_IQ31244
orr pc, pc, #PHYS_OFFSET @ jump to physical memory if we are not there.
nop
mov r7, #(MACH_TYPE_IQ31244 & 0xff) mov r7, #(MACH_TYPE_IQ31244 & 0xff)
orr r7, r7, #(MACH_TYPE_IQ31244 & 0xff00) orr r7, r7, #(MACH_TYPE_IQ31244 & 0xff00)
#endif #endif
#ifdef CONFIG_ARCH_IQ80331 #ifdef CONFIG_ARCH_IQ80331
orr pc, pc, #PHYS_OFFSET @ jump to physical memory if we are not there.
nop
mov r7, #(MACH_TYPE_IQ80331 & 0xff) mov r7, #(MACH_TYPE_IQ80331 & 0xff)
orr r7, r7, #(MACH_TYPE_IQ80331 & 0xff00) orr r7, r7, #(MACH_TYPE_IQ80331 & 0xff00)
#endif #endif
......
...@@ -23,17 +23,17 @@ unsigned int __machine_arch_type; ...@@ -23,17 +23,17 @@ unsigned int __machine_arch_type;
#include <asm/arch/uncompress.h> #include <asm/arch/uncompress.h>
#ifdef STANDALONE_DEBUG #ifdef STANDALONE_DEBUG
#define puts printf #define putstr printf
#endif #endif
#ifdef CONFIG_DEBUG_ICEDCC #ifdef CONFIG_DEBUG_ICEDCC
#define puts icedcc_puts #define putstr icedcc_putstr
#define putc icedcc_putc #define putc icedcc_putc
extern void idedcc_putc(int ch); extern void idedcc_putc(int ch);
static void static void
icedcc_puts(const char *ptr) icedcc_putstr(const char *ptr)
{ {
for (; *ptr != '\0'; ptr++) { for (; *ptr != '\0'; ptr++) {
icedcc_putc(*ptr); icedcc_putc(*ptr);
...@@ -191,7 +191,7 @@ static void error(char *m); ...@@ -191,7 +191,7 @@ static void error(char *m);
static void gzip_mark(void **); static void gzip_mark(void **);
static void gzip_release(void **); static void gzip_release(void **);
static void puts(const char *); static void putstr(const char *);
extern int end; extern int end;
static ulg free_mem_ptr; static ulg free_mem_ptr;
...@@ -280,14 +280,14 @@ void flush_window(void) ...@@ -280,14 +280,14 @@ void flush_window(void)
bytes_out += (ulg)outcnt; bytes_out += (ulg)outcnt;
output_ptr += (ulg)outcnt; output_ptr += (ulg)outcnt;
outcnt = 0; outcnt = 0;
puts("."); putstr(".");
} }
static void error(char *x) static void error(char *x)
{ {
puts("\n\n"); putstr("\n\n");
puts(x); putstr(x);
puts("\n\n -- System halted"); putstr("\n\n -- System halted");
while(1); /* Halt */ while(1); /* Halt */
} }
...@@ -306,9 +306,9 @@ decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p, ...@@ -306,9 +306,9 @@ decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p,
arch_decomp_setup(); arch_decomp_setup();
makecrc(); makecrc();
puts("Uncompressing Linux..."); putstr("Uncompressing Linux...");
gunzip(); gunzip();
puts(" done, booting the kernel.\n"); putstr(" done, booting the kernel.\n");
return output_ptr; return output_ptr;
} }
#else #else
...@@ -320,9 +320,9 @@ int main() ...@@ -320,9 +320,9 @@ int main()
output_data = output_buffer; output_data = output_buffer;
makecrc(); makecrc();
puts("Uncompressing Linux..."); putstr("Uncompressing Linux...");
gunzip(); gunzip();
puts("done.\n"); putstr("done.\n");
return 0; return 0;
} }
#endif #endif
......
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
#ifdef CONFIG_ARCH_PXA
#include <asm/arch/pxa-regs.h>
#endif
extern void __init sa1110_mb_enable(void); extern void __init sa1110_mb_enable(void);
/* /*
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/arch/pxa-regs.h>
static struct dma_channel { static struct dma_channel {
char *name; char *name;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/udc.h> #include <asm/arch/udc.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
#include <asm/arch/mmc.h> #include <asm/arch/mmc.h>
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/idp.h> #include <asm/arch/idp.h>
#include "generic.h" #include "generic.h"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include "generic.h" #include "generic.h"
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/leds.h> #include <asm/leds.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/lubbock.h> #include <asm/arch/lubbock.h>
#include "leds.h" #include "leds.h"
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/leds.h> #include <asm/leds.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/mainstone.h> #include <asm/arch/mainstone.h>
#include "leds.h" #include "leds.h"
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/lubbock.h> #include <asm/arch/lubbock.h>
#include <asm/arch/udc.h> #include <asm/arch/udc.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/mainstone.h> #include <asm/arch/mainstone.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/memory.h> #include <asm/memory.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/lubbock.h> #include <asm/arch/lubbock.h>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/pm.h> #include <linux/pm.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/arch/pxa-regs.h>
#include "generic.h" #include "generic.h"
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/arch/pxa-regs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/pm.h> #include <linux/pm.h>
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/arch/pxa-regs.h>
static inline unsigned long pxa_get_rtc_time(void) static inline unsigned long pxa_get_rtc_time(void)
......
...@@ -590,7 +590,7 @@ void __init mem_init(void) ...@@ -590,7 +590,7 @@ void __init mem_init(void)
* anywhere without overcommit, so turn * anywhere without overcommit, so turn
* it on by default. * it on by default.
*/ */
sysctl_overcommit_memory = 1; sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
} }
} }
......
...@@ -376,7 +376,7 @@ void __init mem_init(void) ...@@ -376,7 +376,7 @@ void __init mem_init(void)
* Turn on overcommit on tiny machines * Turn on overcommit on tiny machines
*/ */
if (PAGE_SIZE >= 16384 && num_physpages <= 128) { if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
sysctl_overcommit_memory = 1; sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
printk("Turning on overcommit\n"); printk("Turning on overcommit\n");
} }
} }
......
This diff is collapsed.
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.9-rc2 # Linux kernel version: 2.6.9-rc2
# Fri Sep 17 13:58:32 2004 # Fri Sep 24 08:59:00 2004
# #
# #
...@@ -79,7 +79,7 @@ CONFIG_IA64_SGI_SN_SIM=y ...@@ -79,7 +79,7 @@ CONFIG_IA64_SGI_SN_SIM=y
CONFIG_FORCE_MAX_ZONEORDER=18 CONFIG_FORCE_MAX_ZONEORDER=18
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_NR_CPUS=512 CONFIG_NR_CPUS=512
CONFIG_HOTPLUG_CPU=y # CONFIG_HOTPLUG_CPU is not set
CONFIG_PREEMPT=y CONFIG_PREEMPT=y
CONFIG_HAVE_DEC_LOCK=y CONFIG_HAVE_DEC_LOCK=y
CONFIG_IA32_SUPPORT=y CONFIG_IA32_SUPPORT=y
......
This diff is collapsed.
This diff is collapsed.
...@@ -437,8 +437,9 @@ acpi_numa_arch_fixup (void) ...@@ -437,8 +437,9 @@ acpi_numa_arch_fixup (void)
{ {
int i, j, node_from, node_to; int i, j, node_from, node_to;
/* If there's no SRAT, fix the phys_id */ /* If there's no SRAT, fix the phys_id and mark node 0 online */
if (srat_num_cpus == 0) { if (srat_num_cpus == 0) {
node_set_online(0);
node_cpuid[0].phys_id = hard_smp_processor_id(); node_cpuid[0].phys_id = hard_smp_processor_id();
return; return;
} }
......
...@@ -2286,7 +2286,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon ...@@ -2286,7 +2286,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
* if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur) * if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur)
* return -ENOMEM; * return -ENOMEM;
*/ */
if (size > task->rlim[RLIMIT_MEMLOCK].rlim_cur) return -EAGAIN; if (size > task->rlim[RLIMIT_MEMLOCK].rlim_cur) return -ENOMEM;
/* /*
* We do the easy to undo allocations first. * We do the easy to undo allocations first.
...@@ -2601,7 +2601,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task) ...@@ -2601,7 +2601,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task)
*/ */
if (task == current) return 0; if (task == current) return 0;
if (task->state != TASK_STOPPED) { if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task->pid, task->state)); DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task->pid, task->state));
return -EBUSY; return -EBUSY;
} }
...@@ -4755,7 +4755,7 @@ pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags) ...@@ -4755,7 +4755,7 @@ pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags)
* the task must be stopped. * the task must be stopped.
*/ */
if (PFM_CMD_STOPPED(cmd)) { if (PFM_CMD_STOPPED(cmd)) {
if (task->state != TASK_STOPPED) { if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
DPRINT(("[%d] task not in stopped state\n", task->pid)); DPRINT(("[%d] task not in stopped state\n", task->pid));
return -EBUSY; return -EBUSY;
} }
......
...@@ -269,7 +269,6 @@ paging_init (void) ...@@ -269,7 +269,6 @@ paging_init (void)
vmem_map = (struct page *) 0; vmem_map = (struct page *) 0;
free_area_init_node(0, &contig_page_data, zones_size, 0, free_area_init_node(0, &contig_page_data, zones_size, 0,
zholes_size); zholes_size);
mem_map = contig_page_data.node_mem_map;
} else { } else {
unsigned long map_size; unsigned long map_size;
...@@ -280,11 +279,10 @@ paging_init (void) ...@@ -280,11 +279,10 @@ paging_init (void)
vmem_map = (struct page *) vmalloc_end; vmem_map = (struct page *) vmalloc_end;
efi_memmap_walk(create_mem_map_page_table, 0); efi_memmap_walk(create_mem_map_page_table, 0);
contig_page_data.node_mem_map = vmem_map; mem_map = contig_page_data.node_mem_map = vmem_map;
free_area_init_node(0, &contig_page_data, zones_size, free_area_init_node(0, &contig_page_data, zones_size,
0, zholes_size); 0, zholes_size);
mem_map = contig_page_data.node_mem_map;
printk("Virtual mem_map starts at 0x%p\n", mem_map); printk("Virtual mem_map starts at 0x%p\n", mem_map);
} }
#else /* !CONFIG_VIRTUAL_MEM_MAP */ #else /* !CONFIG_VIRTUAL_MEM_MAP */
......
...@@ -631,12 +631,10 @@ void paging_init(void) ...@@ -631,12 +631,10 @@ void paging_init(void)
unsigned long max_dma; unsigned long max_dma;
unsigned long zones_size[MAX_NR_ZONES]; unsigned long zones_size[MAX_NR_ZONES];
unsigned long zholes_size[MAX_NR_ZONES]; unsigned long zholes_size[MAX_NR_ZONES];
unsigned long max_gap, pfn_offset = 0; unsigned long pfn_offset = 0;
int node; int node;
max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;
max_gap = 0;
efi_memmap_walk(find_largest_hole, &max_gap);
/* so min() will work in count_node_pages */ /* so min() will work in count_node_pages */
for (node = 0; node < numnodes; node++) for (node = 0; node < numnodes; node++)
......
This diff is collapsed.
...@@ -407,13 +407,13 @@ void hpte_init_native(void) ...@@ -407,13 +407,13 @@ void hpte_init_native(void)
model = get_property(root, "model", NULL); model = get_property(root, "model", NULL);
if (!strcmp(model, "CHRP IBM,9076-N81")) { if (!strcmp(model, "CHRP IBM,9076-N81")) {
of_node_put(root); of_node_put(root);
return; goto bail;
} }
of_node_put(root); of_node_put(root);
} }
#endif /* CONFIG_PPC_PSERIES */ #endif /* CONFIG_PPC_PSERIES */
ppc_md.flush_hash_range = native_flush_hash_range; ppc_md.flush_hash_range = native_flush_hash_range;
bail:
htab_finish_init(); htab_finish_init();
} }
...@@ -646,7 +646,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) ...@@ -646,7 +646,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
kfree_skb(skb); kfree_skb(skb);
(void)capiminor_del_ack(mp, datahandle); (void)capiminor_del_ack(mp, datahandle);
if (mp->tty) if (mp->tty)
tty_wakeup(tty); tty_wakeup(mp->tty);
(void)handle_minor_send(mp); (void)handle_minor_send(mp);
} else { } else {
......
...@@ -2673,7 +2673,7 @@ isdn_tty_modem_result(int code, modem_info * info) ...@@ -2673,7 +2673,7 @@ isdn_tty_modem_result(int code, modem_info * info)
if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) { if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) {
return; return;
} }
tty_ldisc_flush(tty); tty_ldisc_flush(info->tty);
if ((info->flags & ISDN_ASYNC_CHECK_CD) && if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
(!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) && (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
(info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) { (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
......
...@@ -270,8 +270,7 @@ static inline void mmc_delay(unsigned int ms) ...@@ -270,8 +270,7 @@ static inline void mmc_delay(unsigned int ms)
yield(); yield();
mdelay(ms); mdelay(ms);
} else { } else {
set_current_state(TASK_INTERRUPTIBLE); msleep_interruptible (ms);
schedule_timeout(ms * HZ / 1000);
} }
} }
...@@ -450,12 +449,27 @@ mmc_alloc_card(struct mmc_host *host, u32 *raw_cid, unsigned int *frca) ...@@ -450,12 +449,27 @@ mmc_alloc_card(struct mmc_host *host, u32 *raw_cid, unsigned int *frca)
return card; return card;
} }
/*
* Tell attached cards to go to IDLE state
*/
static void mmc_idle_cards(struct mmc_host *host)
{
struct mmc_command cmd;
cmd.opcode = MMC_GO_IDLE_STATE;
cmd.arg = 0;
cmd.flags = MMC_RSP_NONE;
mmc_wait_for_cmd(host, &cmd, 0);
mmc_delay(1);
}
/* /*
* Apply power to the MMC stack. * Apply power to the MMC stack.
*/ */
static void mmc_power_up(struct mmc_host *host) static void mmc_power_up(struct mmc_host *host)
{ {
struct mmc_command cmd;
int bit = fls(host->ocr_avail) - 1; int bit = fls(host->ocr_avail) - 1;
host->ios.vdd = bit; host->ios.vdd = bit;
...@@ -470,12 +484,6 @@ static void mmc_power_up(struct mmc_host *host) ...@@ -470,12 +484,6 @@ static void mmc_power_up(struct mmc_host *host)
host->ops->set_ios(host, &host->ios); host->ops->set_ios(host, &host->ios);
mmc_delay(2); mmc_delay(2);
cmd.opcode = MMC_GO_IDLE_STATE;
cmd.arg = 0;
cmd.flags = MMC_RSP_NONE;
mmc_wait_for_cmd(host, &cmd, 0);
} }
static void mmc_power_off(struct mmc_host *host) static void mmc_power_off(struct mmc_host *host)
...@@ -505,6 +513,8 @@ static int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) ...@@ -505,6 +513,8 @@ static int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
break; break;
err = MMC_ERR_TIMEOUT; err = MMC_ERR_TIMEOUT;
mmc_delay(10);
} }
if (rocr) if (rocr)
...@@ -647,12 +657,22 @@ static void mmc_setup(struct mmc_host *host) ...@@ -647,12 +657,22 @@ static void mmc_setup(struct mmc_host *host)
u32 ocr; u32 ocr;
mmc_power_up(host); mmc_power_up(host);
mmc_idle_cards(host);
err = mmc_send_op_cond(host, 0, &ocr); err = mmc_send_op_cond(host, 0, &ocr);
if (err != MMC_ERR_NONE) if (err != MMC_ERR_NONE)
return; return;
host->ocr = mmc_select_voltage(host, ocr); host->ocr = mmc_select_voltage(host, ocr);
/*
* Since we're changing the OCR value, we seem to
* need to tell some cards to go back to the idle
* state. We wait 1ms to give cards time to
* respond.
*/
if (host->ocr)
mmc_idle_cards(host);
} else { } else {
host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
host->ios.clock = host->f_min; host->ios.clock = host->f_min;
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
*/ */
#define MMC_SHIFT 3 #define MMC_SHIFT 3
static int mmc_major; static int major;
/* /*
* There is one mmc_blk_data per slot. * There is one mmc_blk_data per slot.
...@@ -323,7 +323,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) ...@@ -323,7 +323,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
md->queue.issue_fn = mmc_blk_issue_rq; md->queue.issue_fn = mmc_blk_issue_rq;
md->queue.data = md; md->queue.data = md;
md->disk->major = mmc_major; md->disk->major = major;
md->disk->first_minor = devidx << MMC_SHIFT; md->disk->first_minor = devidx << MMC_SHIFT;
md->disk->fops = &mmc_bdops; md->disk->fops = &mmc_bdops;
md->disk->private_data = md; md->disk->private_data = md;
...@@ -462,14 +462,14 @@ static int __init mmc_blk_init(void) ...@@ -462,14 +462,14 @@ static int __init mmc_blk_init(void)
{ {
int res = -ENOMEM; int res = -ENOMEM;
res = register_blkdev(mmc_major, "mmc"); res = register_blkdev(major, "mmc");
if (res < 0) { if (res < 0) {
printk(KERN_WARNING "Unable to get major %d for MMC media: %d\n", printk(KERN_WARNING "Unable to get major %d for MMC media: %d\n",
mmc_major, res); major, res);
goto out; goto out;
} }
if (mmc_major == 0) if (major == 0)
mmc_major = res; major = res;
devfs_mk_dir("mmc"); devfs_mk_dir("mmc");
return mmc_register_driver(&mmc_driver); return mmc_register_driver(&mmc_driver);
...@@ -482,7 +482,7 @@ static void __exit mmc_blk_exit(void) ...@@ -482,7 +482,7 @@ static void __exit mmc_blk_exit(void)
{ {
mmc_unregister_driver(&mmc_driver); mmc_unregister_driver(&mmc_driver);
devfs_remove("mmc"); devfs_remove("mmc");
unregister_blkdev(mmc_major, "mmc"); unregister_blkdev(major, "mmc");
} }
module_init(mmc_blk_init); module_init(mmc_blk_init);
...@@ -490,3 +490,6 @@ module_exit(mmc_blk_exit); ...@@ -490,3 +490,6 @@ module_exit(mmc_blk_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver"); MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver");
module_param(major, int, 0444);
MODULE_PARM_DESC(major, "specify the major device number for MMC block driver");
...@@ -75,10 +75,11 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) ...@@ -75,10 +75,11 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
1 << data->blksz_bits, data->blocks, data->flags); 1 << data->blksz_bits, data->blocks, data->flags);
host->data = data; host->data = data;
host->offset = 0;
host->size = data->blocks << data->blksz_bits; host->size = data->blocks << data->blksz_bits;
host->data_xfered = 0; host->data_xfered = 0;
mmci_init_sg(host, data);
timeout = data->timeout_clks + timeout = data->timeout_clks +
((unsigned long long)data->timeout_ns * host->cclk) / ((unsigned long long)data->timeout_ns * host->cclk) /
1000000000ULL; 1000000000ULL;
...@@ -190,160 +191,124 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, ...@@ -190,160 +191,124 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
} }
} }
static int mmci_pio_read(struct mmci_host *host, struct request *req, u32 status) static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int remain)
{ {
void *base = host->base; void *base = host->base;
int ret = 0; char *ptr = buffer;
u32 status;
do { do {
unsigned long flags; int count = host->size - (readl(base + MMCIFIFOCNT) << 2);
unsigned int bio_remain;
char *buffer;
/* if (count > remain)
* Check for data available. count = remain;
*/
if (!(status & MCI_RXDATAAVLBL))
break;
/* if (count <= 0)
* Map the BIO buffer. break;
*/
buffer = bio_kmap_irq(req->cbio, &flags);
bio_remain = (req->current_nr_sectors << 9) - host->offset;
do { readsl(base + MMCIFIFO, ptr, count >> 2);
int count = host->size - (readl(base + MMCIFIFOCNT) << 2);
if (count > bio_remain) ptr += count;
count = bio_remain; remain -= count;
if (count > 0) { if (remain == 0)
ret = 1; break;
readsl(base + MMCIFIFO, buffer + host->offset, count >> 2);
host->offset += count;
host->size -= count;
bio_remain -= count;
if (bio_remain == 0)
goto next_bio;
}
status = readl(base + MMCISTATUS); status = readl(base + MMCISTATUS);
} while (status & MCI_RXDATAAVLBL); } while (status & MCI_RXDATAAVLBL);
bio_kunmap_irq(buffer, &flags); return ptr - buffer;
break; }
next_bio: static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int remain, u32 status)
bio_kunmap_irq(buffer, &flags); {
void *base = host->base;
char *ptr = buffer;
/* do {
* Ok, we've completed that BIO, move on to next unsigned int count, maxcnt;
* BIO in the chain. Note: this doesn't actually
* complete the BIO! maxcnt = status & MCI_TXFIFOEMPTY ? MCI_FIFOSIZE : MCI_FIFOHALFSIZE;
*/ count = min(remain, maxcnt);
if (!process_that_request_first(req, req->current_nr_sectors))
writesl(base + MMCIFIFO, ptr, count >> 2);
ptr += count;
remain -= count;
if (remain == 0)
break; break;
host->offset = 0;
status = readl(base + MMCISTATUS); status = readl(base + MMCISTATUS);
} while (1); } while (status & MCI_TXFIFOHALFEMPTY);
/*
* If we're nearing the end of the read, switch to
* "any data available" mode.
*/
if (host->size < MCI_FIFOSIZE)
writel(MCI_RXDATAAVLBLMASK, base + MMCIMASK1);
return ret; return ptr - buffer;
} }
static int mmci_pio_write(struct mmci_host *host, struct request *req, u32 status) /*
* PIO data transfer IRQ handler.
*/
static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct mmci_host *host = dev_id;
void *base = host->base; void *base = host->base;
int ret = 0; u32 status;
status = readl(base + MMCISTATUS);
DBG(host, "irq1 %08x\n", status);
do { do {
unsigned long flags; unsigned long flags;
unsigned int bio_remain; unsigned int remain, len;
char *buffer; char *buffer;
/* /*
* We only need to test the half-empty flag here - if * For write, we only need to test the half-empty flag
* the FIFO is completely empty, then by definition * here - if the FIFO is completely empty, then by
* it is more than half empty. * definition it is more than half empty.
*
* For read, check for data available.
*/ */
if (!(status & MCI_TXFIFOHALFEMPTY)) if (!(status & (MCI_TXFIFOHALFEMPTY|MCI_RXDATAAVLBL)))
break; break;
/* /*
* Map the BIO buffer. * Map the current scatter buffer.
*/ */
buffer = bio_kmap_irq(req->cbio, &flags); buffer = mmci_kmap_atomic(host, &flags) + host->sg_off;
bio_remain = (req->current_nr_sectors << 9) - host->offset; remain = host->sg_ptr->length - host->sg_off;
do {
unsigned int count, maxcnt;
maxcnt = status & MCI_TXFIFOEMPTY ?
MCI_FIFOSIZE : MCI_FIFOHALFSIZE;
count = min(bio_remain, maxcnt);
writesl(base + MMCIFIFO, buffer + host->offset, count >> 2); len = 0;
host->offset += count; if (status & MCI_RXACTIVE)
host->size -= count; len = mmci_pio_read(host, buffer, remain);
bio_remain -= count; if (status & MCI_TXACTIVE)
len = mmci_pio_write(host, buffer, remain, status);
ret = 1; /*
* Unmap the buffer.
*/
mmci_kunmap_atomic(host, &flags);
if (bio_remain == 0) host->sg_off += len;
goto next_bio; host->size -= len;
remain -= len;
status = readl(base + MMCISTATUS); if (remain)
} while (status & MCI_TXFIFOHALFEMPTY);
bio_kunmap_irq(buffer, &flags);
break; break;
next_bio: if (!mmci_next_sg(host))
bio_kunmap_irq(buffer, &flags);
/*
* Ok, we've completed that BIO, move on to next
* BIO in the chain. Note: this doesn't actually
* complete the BIO!
*/
if (!process_that_request_first(req, req->current_nr_sectors))
break; break;
host->offset = 0;
status = readl(base + MMCISTATUS); status = readl(base + MMCISTATUS);
} while (1); } while (1);
return ret; /*
} * If we're nearing the end of the read, switch to
* "any data available" mode.
/*
* PIO data transfer IRQ handler.
*/ */
static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs) if (status & MCI_RXACTIVE && host->size < MCI_FIFOSIZE)
{ writel(MCI_RXDATAAVLBLMASK, base + MMCIMASK1);
struct mmci_host *host = dev_id;
struct request *req;
void *base = host->base;
u32 status;
int ret = 0;
status = readl(base + MMCISTATUS);
DBG(host, "irq1 %08x\n", status);
req = host->data->req;
if (status & MCI_RXACTIVE)
ret = mmci_pio_read(host, req, status);
else if (status & MCI_TXACTIVE)
ret = mmci_pio_write(host, req, status);
/* /*
* If we run out of data, disable the data IRQs; this * If we run out of data, disable the data IRQs; this
...@@ -356,7 +321,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -356,7 +321,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs)
writel(readl(base + MMCIMASK0) | MCI_DATAENDMASK, base + MMCIMASK0); writel(readl(base + MMCIMASK0) | MCI_DATAENDMASK, base + MMCIMASK0);
} }
return IRQ_RETVAL(ret); return IRQ_HANDLED;
} }
/* /*
......
...@@ -115,6 +115,8 @@ ...@@ -115,6 +115,8 @@
#define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2) #define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2)
#define NR_SG 16
struct clk; struct clk;
struct mmci_host { struct mmci_host {
...@@ -137,7 +139,45 @@ struct mmci_host { ...@@ -137,7 +139,45 @@ struct mmci_host {
struct timer_list timer; struct timer_list timer;
unsigned int oldstat; unsigned int oldstat;
struct scatterlist sg[NR_SG];
unsigned int sg_len;
/* pio stuff */ /* pio stuff */
unsigned int offset; struct scatterlist *sg_ptr;
unsigned int sg_off;
unsigned int size; unsigned int size;
}; };
static inline void mmci_init_sg(struct mmci_host *host, struct mmc_data *data)
{
struct scatterlist *sg = host->sg;
struct request *req = data->req;
/*
* Ideally, we want the higher levels to pass us a scatter list.
*/
host->sg_len = blk_rq_map_sg(req->q, req, sg);
host->sg_ptr = sg;
host->sg_off = 0;
}
static inline int mmci_next_sg(struct mmci_host *host)
{
host->sg_ptr++;
host->sg_off = 0;
return --host->sg_len;
}
static inline char *mmci_kmap_atomic(struct mmci_host *host, unsigned long *flags)
{
struct scatterlist *sg = host->sg_ptr;
local_irq_save(*flags);
return kmap_atomic(sg->page, KM_BIO_SRC_IRQ) + sg->offset;
}
static inline void mmci_kunmap_atomic(struct mmci_host *host, unsigned long *flags)
{
kunmap_atomic(host->sg_ptr->page, KM_BIO_SRC_IRQ);
local_irq_restore(*flags);
}
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/mmc.h> #include <asm/arch/mmc.h>
#include "pxamci.h" #include "pxamci.h"
......
This diff is collapsed.
...@@ -704,7 +704,7 @@ static void cpc_tty_rx_work(void * data) ...@@ -704,7 +704,7 @@ static void cpc_tty_rx_work(void * data)
ld = tty_ldisc_ref(cpc_tty); ld = tty_ldisc_ref(cpc_tty);
if(ld) if(ld)
{ {
if (ld->receive_buf)) { if (ld->receive_buf) {
CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name); CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name);
ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size); ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size);
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/arch/pxa-regs.h>
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
#include <pcmcia/ss.h> #include <pcmcia/ss.h>
...@@ -178,39 +179,6 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev) ...@@ -178,39 +179,6 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev)
first = ops->first; first = ops->first;
nr = ops->nr; nr = ops->nr;
/* Setup GPIOs for PCMCIA/CF alternate function mode.
*
* It would be nice if set_GPIO_mode included support
* for driving GPIO outputs to default high/low state
* before programming GPIOs as outputs. Setting GPIO
* outputs to default high/low state via GPSR/GPCR
* before defining them as outputs should reduce
* the possibility of glitching outputs during GPIO
* setup. This of course assumes external terminators
* are present to hold GPIOs in a defined state.
*
* In the meantime, setup default state of GPIO
* outputs before we enable them as outputs.
*/
GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
GPIO_bit(GPIO49_nPWE) |
GPIO_bit(GPIO50_nPIOR) |
GPIO_bit(GPIO51_nPIOW) |
GPIO_bit(GPIO52_nPCE_1) |
GPIO_bit(GPIO53_nPCE_2);
pxa_gpio_mode(GPIO48_nPOE_MD);
pxa_gpio_mode(GPIO49_nPWE_MD);
pxa_gpio_mode(GPIO50_nPIOR_MD);
pxa_gpio_mode(GPIO51_nPIOW_MD);
pxa_gpio_mode(GPIO52_nPCE_1_MD);
pxa_gpio_mode(GPIO53_nPCE_2_MD);
pxa_gpio_mode(GPIO54_pSKTSEL_MD); /* REVISIT: s/b dependent on num sockets */
pxa_gpio_mode(GPIO55_nPREG_MD);
pxa_gpio_mode(GPIO56_nPWAIT_MD);
pxa_gpio_mode(GPIO57_nIOIS16_MD);
/* Provide our PXA2xx specific timing routines. */ /* Provide our PXA2xx specific timing routines. */
ops->set_timing = pxa2xx_pcmcia_set_timing; ops->set_timing = pxa2xx_pcmcia_set_timing;
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
......
...@@ -25,10 +25,40 @@ ...@@ -25,10 +25,40 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/lubbock.h> #include <asm/arch/lubbock.h>
#include "sa1111_generic.h" #include "sa1111_generic.h"
static int
lubbock_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
{
/*
* Setup default state of GPIO outputs
* before we enable them as outputs.
*/
GPSR(GPIO48_nPOE) =
GPIO_bit(GPIO48_nPOE) |
GPIO_bit(GPIO49_nPWE) |
GPIO_bit(GPIO50_nPIOR) |
GPIO_bit(GPIO51_nPIOW) |
GPIO_bit(GPIO52_nPCE_1) |
GPIO_bit(GPIO53_nPCE_2);
pxa_gpio_mode(GPIO48_nPOE_MD);
pxa_gpio_mode(GPIO49_nPWE_MD);
pxa_gpio_mode(GPIO50_nPIOR_MD);
pxa_gpio_mode(GPIO51_nPIOW_MD);
pxa_gpio_mode(GPIO52_nPCE_1_MD);
pxa_gpio_mode(GPIO53_nPCE_2_MD);
pxa_gpio_mode(GPIO54_pSKTSEL_MD);
pxa_gpio_mode(GPIO55_nPREG_MD);
pxa_gpio_mode(GPIO56_nPWAIT_MD);
pxa_gpio_mode(GPIO57_nIOIS16_MD);
return sa1111_pcmcia_hw_init(skt);
}
static int static int
lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
const socket_state_t *state) const socket_state_t *state)
...@@ -201,7 +231,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, ...@@ -201,7 +231,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
static struct pcmcia_low_level lubbock_pcmcia_ops = { static struct pcmcia_low_level lubbock_pcmcia_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.hw_init = sa1111_pcmcia_hw_init, .hw_init = lubbock_pcmcia_hw_init,
.hw_shutdown = sa1111_pcmcia_hw_shutdown, .hw_shutdown = sa1111_pcmcia_hw_shutdown,
.socket_state = sa1111_pcmcia_socket_state, .socket_state = sa1111_pcmcia_socket_state,
.configure_socket = lubbock_pcmcia_configure_socket, .configure_socket = lubbock_pcmcia_configure_socket,
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/mainstone.h> #include <asm/arch/mainstone.h>
#include "soc_common.h" #include "soc_common.h"
...@@ -38,6 +39,29 @@ static struct pcmcia_irqs irqs[] = { ...@@ -38,6 +39,29 @@ static struct pcmcia_irqs irqs[] = {
static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt) static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
{ {
/*
* Setup default state of GPIO outputs
* before we enable them as outputs.
*/
GPSR(GPIO48_nPOE) =
GPIO_bit(GPIO48_nPOE) |
GPIO_bit(GPIO49_nPWE) |
GPIO_bit(GPIO50_nPIOR) |
GPIO_bit(GPIO51_nPIOW) |
GPIO_bit(GPIO85_nPCE_1) |
GPIO_bit(GPIO54_nPCE_2);
pxa_gpio_mode(GPIO48_nPOE_MD);
pxa_gpio_mode(GPIO49_nPWE_MD);
pxa_gpio_mode(GPIO50_nPIOR_MD);
pxa_gpio_mode(GPIO51_nPIOW_MD);
pxa_gpio_mode(GPIO85_nPCE_1_MD);
pxa_gpio_mode(GPIO54_nPCE_2_MD);
pxa_gpio_mode(GPIO79_pSKTSEL_MD);
pxa_gpio_mode(GPIO55_nPREG_MD);
pxa_gpio_mode(GPIO56_nPWAIT_MD);
pxa_gpio_mode(GPIO57_nIOIS16_MD);
skt->irq = (skt->nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ; skt->irq = (skt->nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ;
return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
} }
......
...@@ -49,6 +49,11 @@ ...@@ -49,6 +49,11 @@
#include "soc_common.h" #include "soc_common.h"
/* FIXME: platform dependent resource declaration has to move out of this file */
#ifdef CONFIG_ARCH_PXA
#include <asm/arch/pxa-regs.h>
#endif
#ifdef DEBUG #ifdef DEBUG
static int pc_debug; static int pc_debug;
......
...@@ -1091,6 +1091,7 @@ static struct pci_device_id yenta_table [] = { ...@@ -1091,6 +1091,7 @@ static struct pci_device_id yenta_table [] = {
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4410, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4410, TI12XX),
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4450, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4450, TI12XX),
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4451, TI12XX), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4451, TI12XX),
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_4520, TI12XX),
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1250, TI1250), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1250, TI1250),
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1410, TI1250), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1410, TI1250),
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/arch/pxa-regs.h>
#if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ #define SUPPORT_SYSRQ
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/arch/pxa-regs.h>
#include <linux/usb_ch9.h> #include <linux/usb_ch9.h>
#include <linux/usb_gadget.h> #include <linux/usb_gadget.h>
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/bitfield.h> #include <asm/arch/bitfield.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
......
...@@ -67,8 +67,6 @@ endif ...@@ -67,8 +67,6 @@ endif
xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o
xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o
xfs-$(CONFIG_XFS_POSIX_CAP) += xfs_cap.o
xfs-$(CONFIG_XFS_POSIX_MAC) += xfs_mac.o
xfs-$(CONFIG_PROC_FS) += linux-2.6/xfs_stats.o xfs-$(CONFIG_PROC_FS) += linux-2.6/xfs_stats.o
xfs-$(CONFIG_SYSCTL) += linux-2.6/xfs_sysctl.o xfs-$(CONFIG_SYSCTL) += linux-2.6/xfs_sysctl.o
xfs-$(CONFIG_COMPAT) += linux-2.6/xfs_ioctl32.o xfs-$(CONFIG_COMPAT) += linux-2.6/xfs_ioctl32.o
......
...@@ -552,18 +552,21 @@ xfs_submit_page( ...@@ -552,18 +552,21 @@ xfs_submit_page(
struct page *page, struct page *page,
struct writeback_control *wbc, struct writeback_control *wbc,
struct buffer_head *bh_arr[], struct buffer_head *bh_arr[],
int cnt) int bh_count,
int probed_page,
int clear_dirty)
{ {
struct buffer_head *bh; struct buffer_head *bh;
int i; int i;
BUG_ON(PageWriteback(page)); BUG_ON(PageWriteback(page));
set_page_writeback(page); set_page_writeback(page);
if (clear_dirty)
clear_page_dirty(page); clear_page_dirty(page);
unlock_page(page); unlock_page(page);
if (cnt) { if (bh_count) {
for (i = 0; i < cnt; i++) { for (i = 0; i < bh_count; i++) {
bh = bh_arr[i]; bh = bh_arr[i];
mark_buffer_async_write(bh); mark_buffer_async_write(bh);
if (buffer_unwritten(bh)) if (buffer_unwritten(bh))
...@@ -572,8 +575,11 @@ xfs_submit_page( ...@@ -572,8 +575,11 @@ xfs_submit_page(
clear_buffer_dirty(bh); clear_buffer_dirty(bh);
} }
for (i = 0; i < cnt; i++) for (i = 0; i < bh_count; i++)
submit_bh(WRITE, bh_arr[i]); submit_bh(WRITE, bh_arr[i]);
if (probed_page && clear_dirty)
wbc->nr_to_write--; /* Wrote an "extra" page */
} else { } else {
end_page_writeback(page); end_page_writeback(page);
wbc->pages_skipped++; /* We didn't write this page */ wbc->pages_skipped++; /* We didn't write this page */
...@@ -612,11 +618,13 @@ xfs_convert_page( ...@@ -612,11 +618,13 @@ xfs_convert_page(
bh = head = page_buffers(page); bh = head = page_buffers(page);
do { do {
offset = i << bbits; offset = i << bbits;
if (offset >= end)
break;
if (!(PageUptodate(page) || buffer_uptodate(bh))) if (!(PageUptodate(page) || buffer_uptodate(bh)))
continue; continue;
if (buffer_mapped(bh) && all_bh && if (buffer_mapped(bh) && all_bh &&
!buffer_unwritten(bh) && !buffer_delay(bh)) { !(buffer_unwritten(bh) || buffer_delay(bh))) {
if (startio && (offset < end)) { if (startio) {
lock_buffer(bh); lock_buffer(bh);
bh_arr[index++] = bh; bh_arr[index++] = bh;
} }
...@@ -644,7 +652,7 @@ xfs_convert_page( ...@@ -644,7 +652,7 @@ xfs_convert_page(
ASSERT(private); ASSERT(private);
} }
} }
if (startio && (offset < end)) { if (startio) {
bh_arr[index++] = bh; bh_arr[index++] = bh;
} else { } else {
set_buffer_dirty(bh); set_buffer_dirty(bh);
...@@ -654,8 +662,7 @@ xfs_convert_page( ...@@ -654,8 +662,7 @@ xfs_convert_page(
} while (i++, (bh = bh->b_this_page) != head); } while (i++, (bh = bh->b_this_page) != head);
if (startio) { if (startio) {
wbc->nr_to_write--; xfs_submit_page(page, wbc, bh_arr, index, 1, index == i);
xfs_submit_page(page, wbc, bh_arr, index);
} else { } else {
unlock_page(page); unlock_page(page);
} }
...@@ -867,7 +874,7 @@ xfs_page_state_convert( ...@@ -867,7 +874,7 @@ xfs_page_state_convert(
SetPageUptodate(page); SetPageUptodate(page);
if (startio) if (startio)
xfs_submit_page(page, wbc, bh_arr, cnt); xfs_submit_page(page, wbc, bh_arr, cnt, 0, 1);
if (iomp) { if (iomp) {
tlast = (iomp->iomap_offset + iomp->iomap_bsize - 1) >> tlast = (iomp->iomap_offset + iomp->iomap_bsize - 1) >>
...@@ -1174,7 +1181,7 @@ linvfs_writepage( ...@@ -1174,7 +1181,7 @@ linvfs_writepage(
return 0; return 0;
out_fail: out_fail:
set_page_dirty(page); redirty_page_for_writepage(wbc, page);
unlock_page(page); unlock_page(page);
return 0; return 0;
out_unlock: out_unlock:
......
/*
* Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
#include "xfs.h"
STATIC int xfs_cap_allow_set(vnode_t *);
/*
* Test for existence of capability attribute as efficiently as possible.
*/
int
xfs_cap_vhascap(
vnode_t *vp)
{
int error;
int len = sizeof(xfs_cap_set_t);
int flags = ATTR_KERNOVAL|ATTR_ROOT;
VOP_ATTR_GET(vp, SGI_CAP_LINUX, NULL, &len, flags, sys_cred, error);
return (error == 0);
}
/*
* Convert from extended attribute representation to in-memory for XFS.
*/
STATIC int
posix_cap_xattr_to_xfs(
posix_cap_xattr *src,
size_t size,
xfs_cap_set_t *dest)
{
if (!src || !dest)
return EINVAL;
if (src->c_version != cpu_to_le32(POSIX_CAP_XATTR_VERSION))
return EINVAL;
if (src->c_abiversion != cpu_to_le32(_LINUX_CAPABILITY_VERSION))
return EINVAL;
if (size < sizeof(posix_cap_xattr))
return EINVAL;
ASSERT(sizeof(dest->cap_effective) == sizeof(src->c_effective));
dest->cap_effective = src->c_effective;
dest->cap_permitted = src->c_permitted;
dest->cap_inheritable = src->c_inheritable;
return 0;
}
/*
* Convert from in-memory XFS to extended attribute representation.
*/
STATIC int
posix_cap_xfs_to_xattr(
xfs_cap_set_t *src,
posix_cap_xattr *xattr_cap,
size_t size)
{
size_t new_size = posix_cap_xattr_size();
if (size < new_size)
return -ERANGE;
ASSERT(sizeof(xattr_cap->c_effective) == sizeof(src->cap_effective));
xattr_cap->c_version = cpu_to_le32(POSIX_CAP_XATTR_VERSION);
xattr_cap->c_abiversion = cpu_to_le32(_LINUX_CAPABILITY_VERSION);
xattr_cap->c_effective = src->cap_effective;
xattr_cap->c_permitted = src->cap_permitted;
xattr_cap->c_inheritable= src->cap_inheritable;
return new_size;
}
int
xfs_cap_vget(
vnode_t *vp,
void *cap,
size_t size)
{
int error;
int len = sizeof(xfs_cap_set_t);
int flags = ATTR_ROOT;
xfs_cap_set_t xfs_cap = { 0 };
posix_cap_xattr *xattr_cap = cap;
char *data = (char *)&xfs_cap;
VN_HOLD(vp);
if ((error = _MAC_VACCESS(vp, NULL, VREAD)))
goto out;
if (!size) {
flags |= ATTR_KERNOVAL;
data = NULL;
}
VOP_ATTR_GET(vp, SGI_CAP_LINUX, data, &len, flags, sys_cred, error);
if (error)
goto out;
ASSERT(len == sizeof(xfs_cap_set_t));
error = (size)? -posix_cap_xattr_size() :
-posix_cap_xfs_to_xattr(&xfs_cap, xattr_cap, size);
out:
VN_RELE(vp);
return -error;
}
int
xfs_cap_vremove(
vnode_t *vp)
{
int error;
VN_HOLD(vp);
error = xfs_cap_allow_set(vp);
if (!error) {
VOP_ATTR_REMOVE(vp, SGI_CAP_LINUX, ATTR_ROOT, sys_cred, error);
if (error == ENOATTR)
error = 0; /* 'scool */
}
VN_RELE(vp);
return -error;
}
int
xfs_cap_vset(
vnode_t *vp,
void *cap,
size_t size)
{
posix_cap_xattr *xattr_cap = cap;
xfs_cap_set_t xfs_cap;
int error;
if (!cap)
return -EINVAL;
error = posix_cap_xattr_to_xfs(xattr_cap, size, &xfs_cap);
if (error)
return -error;
VN_HOLD(vp);
error = xfs_cap_allow_set(vp);
if (error)
goto out;
VOP_ATTR_SET(vp, SGI_CAP_LINUX, (char *)&xfs_cap,
sizeof(xfs_cap_set_t), ATTR_ROOT, sys_cred, error);
out:
VN_RELE(vp);
return -error;
}
STATIC int
xfs_cap_allow_set(
vnode_t *vp)
{
vattr_t va;
int error;
if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
return EROFS;
if (vp->v_inode.i_flags & (S_IMMUTABLE|S_APPEND))
return EPERM;
if ((error = _MAC_VACCESS(vp, NULL, VWRITE)))
return error;
va.va_mask = XFS_AT_UID;
VOP_GETATTR(vp, &va, 0, NULL, error);
if (error)
return error;
if (va.va_uid != current->fsuid && !capable(CAP_FOWNER))
return EPERM;
return error;
}
/*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
#include "xfs.h"
static xfs_mac_label_t *mac_low_high_lp;
static xfs_mac_label_t *mac_high_low_lp;
static xfs_mac_label_t *mac_admin_high_lp;
static xfs_mac_label_t *mac_equal_equal_lp;
/*
* Test for the existence of a MAC label as efficiently as possible.
*/
int
xfs_mac_vhaslabel(
vnode_t *vp)
{
int error;
int len = sizeof(xfs_mac_label_t);
int flags = ATTR_KERNOVAL|ATTR_ROOT;
VOP_ATTR_GET(vp, SGI_MAC_FILE, NULL, &len, flags, sys_cred, error);
return (error == 0);
}
int
xfs_mac_iaccess(xfs_inode_t *ip, mode_t mode, struct cred *cr)
{
xfs_mac_label_t mac;
xfs_mac_label_t *mp = mac_high_low_lp;
if (cr == NULL || sys_cred == NULL ) {
return EACCES;
}
if (xfs_attr_fetch(ip, SGI_MAC_FILE, (char *)&mac, sizeof(mac)) == 0) {
if ((mp = mac_add_label(&mac)) == NULL) {
return mac_access(mac_high_low_lp, cr, mode);
}
}
return mac_access(mp, cr, mode);
}
...@@ -841,18 +841,18 @@ xfs_setattr( ...@@ -841,18 +841,18 @@ xfs_setattr(
if (vap->va_xflags & XFS_XFLAG_NODUMP) if (vap->va_xflags & XFS_XFLAG_NODUMP)
di_flags |= XFS_DIFLAG_NODUMP; di_flags |= XFS_DIFLAG_NODUMP;
if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) {
if (vap->va_xflags & XFS_XFLAG_REALTIME) {
ip->i_iocore.io_flags |= XFS_IOCORE_RT;
di_flags |= XFS_DIFLAG_REALTIME;
}
if (vap->va_xflags & XFS_XFLAG_RTINHERIT) if (vap->va_xflags & XFS_XFLAG_RTINHERIT)
di_flags |= XFS_DIFLAG_RTINHERIT; di_flags |= XFS_DIFLAG_RTINHERIT;
if (vap->va_xflags & XFS_XFLAG_NOSYMLINKS) if (vap->va_xflags & XFS_XFLAG_NOSYMLINKS)
di_flags |= XFS_DIFLAG_NOSYMLINKS; di_flags |= XFS_DIFLAG_NOSYMLINKS;
} else { } else {
if (!(vap->va_xflags & XFS_XFLAG_REALTIME)) if (vap->va_xflags & XFS_XFLAG_REALTIME) {
di_flags |= XFS_DIFLAG_REALTIME;
ip->i_iocore.io_flags |= XFS_IOCORE_RT;
} else {
ip->i_iocore.io_flags &= ~XFS_IOCORE_RT; ip->i_iocore.io_flags &= ~XFS_IOCORE_RT;
} }
}
ip->i_d.di_flags = di_flags; ip->i_d.di_flags = di_flags;
} }
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
......
...@@ -16,7 +16,7 @@ static __inline__ void putc(char c) ...@@ -16,7 +16,7 @@ static __inline__ void putc(char c)
/* /*
* This does not append a newline * This does not append a newline
*/ */
static void puts(const char *s) static void putstr(const char *s)
{ {
while (*s) { while (*s) {
putc(*s); putc(*s);
......
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.
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.
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