Commit d78d2844 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-scsi.bkbits.net/scsi-for-linus-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents e270e1b2 0d377ebc
No related merge requests found
VERSION = 2 VERSION = 2
PATCHLEVEL = 6 PATCHLEVEL = 6
SUBLEVEL = 9 SUBLEVEL = 9
EXTRAVERSION = -rc4 EXTRAVERSION =
NAME=Zonked Quokka NAME=Zonked Quokka
# *DOCUMENTATION* # *DOCUMENTATION*
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copy data from IO memory space to "real" memory space. * Copy data from IO memory space to "real" memory space.
* This needs to be optimized. * This needs to be optimized.
*/ */
void _memcpy_fromio(void *to, unsigned long from, size_t count) void _memcpy_fromio(void *to, void __iomem *from, size_t count)
{ {
unsigned char *t = to; unsigned char *t = to;
while (count) { while (count) {
...@@ -22,7 +22,7 @@ void _memcpy_fromio(void *to, unsigned long from, size_t count) ...@@ -22,7 +22,7 @@ void _memcpy_fromio(void *to, unsigned long from, size_t count)
* Copy data from "real" memory space to IO memory space. * Copy data from "real" memory space to IO memory space.
* This needs to be optimized. * This needs to be optimized.
*/ */
void _memcpy_toio(unsigned long to, const void *from, size_t count) void _memcpy_toio(void __iomem *to, const void *from, size_t count)
{ {
const unsigned char *f = from; const unsigned char *f = from;
while (count) { while (count) {
...@@ -37,7 +37,7 @@ void _memcpy_toio(unsigned long to, const void *from, size_t count) ...@@ -37,7 +37,7 @@ void _memcpy_toio(unsigned long to, const void *from, size_t count)
* "memset" on IO memory space. * "memset" on IO memory space.
* This needs to be optimized. * This needs to be optimized.
*/ */
void _memset_io(unsigned long dst, int c, size_t count) void _memset_io(void __iomem *dst, int c, size_t count)
{ {
while (count) { while (count) {
count--; count--;
......
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
#include "clock.h" #include "clock.h"
/* clock information */
unsigned long s3c24xx_xtal = 12*1000*1000; /* default 12MHz */
unsigned long s3c24xx_fclk;
unsigned long s3c24xx_hclk;
unsigned long s3c24xx_pclk;
static LIST_HEAD(clocks); static LIST_HEAD(clocks);
static DECLARE_MUTEX(clocks_sem); static DECLARE_MUTEX(clocks_sem);
...@@ -277,9 +283,9 @@ static int __init s3c2410_init_clocks(void) ...@@ -277,9 +283,9 @@ static int __init s3c2410_init_clocks(void)
/* initialise the main system clocks */ /* initialise the main system clocks */
clk_h.rate = s3c2410_hclk; clk_h.rate = s3c24xx_hclk;
clk_p.rate = s3c2410_pclk; clk_p.rate = s3c24xx_pclk;
clk_f.rate = s3c2410_fclk; clk_f.rate = s3c24xx_fclk;
/* set the enabled clocks to a minimal (known) state */ /* set the enabled clocks to a minimal (known) state */
__raw_writel(S3C2410_CLKCON_PWMT | S3C2410_CLKCON_UART0 | S3C2410_CLKCON_UART1 | S3C2410_CLKCON_UART2 | S3C2410_CLKCON_GPIO | S3C2410_CLKCON_RTC, S3C2410_CLKCON); __raw_writel(S3C2410_CLKCON_PWMT | S3C2410_CLKCON_UART0 | S3C2410_CLKCON_UART1 | S3C2410_CLKCON_UART2 | S3C2410_CLKCON_GPIO | S3C2410_CLKCON_RTC, S3C2410_CLKCON);
......
...@@ -18,3 +18,10 @@ struct clk { ...@@ -18,3 +18,10 @@ struct clk {
unsigned long rate; unsigned long rate;
unsigned long ctrlbit; unsigned long ctrlbit;
}; };
/* processor clock settings, in Hz */
extern unsigned long s3c24xx_xtal;
extern unsigned long s3c24xx_pclk;
extern unsigned long s3c24xx_hclk;
extern unsigned long s3c24xx_fclk;
...@@ -104,7 +104,7 @@ s3c_lookup_cpu(unsigned long idcode) ...@@ -104,7 +104,7 @@ s3c_lookup_cpu(unsigned long idcode)
int count; int count;
tab = cpu_ids; tab = cpu_ids;
for (count = 0; count < ARRAY_SIZE(cpu_ids); count++) { for (count = 0; count < ARRAY_SIZE(cpu_ids); count++, tab++) {
if ((idcode & tab->idmask) == tab->idcode) if ((idcode & tab->idmask) == tab->idcode)
return tab; return tab;
} }
......
...@@ -38,4 +38,3 @@ extern void s3c2440_map_io(struct map_desc *mach_desc, int size); ...@@ -38,4 +38,3 @@ extern void s3c2440_map_io(struct map_desc *mach_desc, int size);
#endif #endif
extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <asm/arch/regs-serial.h> #include <asm/arch/regs-serial.h>
#include "s3c2410.h" #include "s3c2410.h"
#include "clock.h"
#include "devs.h" #include "devs.h"
#include "cpu.h" #include "cpu.h"
...@@ -56,7 +57,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { ...@@ -56,7 +57,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
[0] = { [0] = {
.hwport = 0, .hwport = 0,
.flags = 0, .flags = 0,
.clock = &s3c2410_pclk, .clock = &s3c24xx_pclk,
.ucon = 0x3c5, .ucon = 0x3c5,
.ulcon = 0x03, .ulcon = 0x03,
.ufcon = 0x51, .ufcon = 0x51,
...@@ -64,7 +65,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { ...@@ -64,7 +65,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
[1] = { [1] = {
.hwport = 1, .hwport = 1,
.flags = 0, .flags = 0,
.clock = &s3c2410_pclk, .clock = &s3c24xx_pclk,
.ucon = 0x245, .ucon = 0x245,
.ulcon = 0x03, .ulcon = 0x03,
.ufcon = 0x00, .ufcon = 0x00,
...@@ -73,7 +74,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { ...@@ -73,7 +74,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
[2] = { [2] = {
.hwport = 2, .hwport = 2,
.flags = 0, .flags = 0,
.clock = &s3c2410_pclk, .clock = &s3c24xx_pclk,
.ucon = 0x3c5, .ucon = 0x3c5,
.ulcon = 0x43, .ulcon = 0x43,
.ufcon = 0x51, .ufcon = 0x51,
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* 05-Sep-2003 BJD Moved to kernel v2.6 * 05-Sep-2003 BJD Moved to kernel v2.6
* 18-Jan-2004 BJD Added serial port configuration * 18-Jan-2004 BJD Added serial port configuration
* 21-Aug-2004 BJD Added new struct s3c2410_board handler * 21-Aug-2004 BJD Added new struct s3c2410_board handler
* 28-Sep-2004 BJD Updates for new serial port bits
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
#include "s3c2410.h" #include "s3c2410.h"
#include "cpu.h" #include "cpu.h"
#include "clock.h"
int s3c2410_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */ int s3c2410_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */
...@@ -45,11 +47,7 @@ int s3c2410_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */ ...@@ -45,11 +47,7 @@ int s3c2410_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */
struct s3c2410_uartcfg *s3c2410_uartcfgs; struct s3c2410_uartcfg *s3c2410_uartcfgs;
/* clock info */ /* Initial IO mappings */
unsigned long s3c2410_fclk;
unsigned long s3c2410_hclk;
unsigned long s3c2410_pclk;
static struct map_desc s3c2410_iodesc[] __initdata = { static struct map_desc s3c2410_iodesc[] __initdata = {
IODESC_ENT(USBHOST), IODESC_ENT(USBHOST),
...@@ -131,6 +129,39 @@ static struct platform_device *uart_devices[] __initdata = { ...@@ -131,6 +129,39 @@ static struct platform_device *uart_devices[] __initdata = {
&s3c_uart2 &s3c_uart2
}; };
/* store our uart devices for the serial driver console */
struct platform_device *s3c2410_uart_devices[3];
static int s3c2410_uart_count = 0;
/* uart registration process */
void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
struct platform_device *platdev;
int uart;
s3c2410_uartcfgs = cfg; /* compatibility */
for (uart = 0; uart < no; uart++, cfg++) {
platdev = uart_devices[cfg->hwport];
s3c2410_uart_devices[uart] = platdev;
platdev->dev.platform_data = cfg;
}
s3c2410_uart_count = uart;
}
/* s3c2410_map_io
*
* register the standard cpu IO areas, and any passed in from the
* machine specific initialisation.
*
* this function also sets the initial clock frequencies from the
* settings passed in
*/
void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size) void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size)
{ {
unsigned long tmp; unsigned long tmp;
...@@ -140,26 +171,24 @@ void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size) ...@@ -140,26 +171,24 @@ void __init s3c2410_map_io(struct map_desc *mach_desc, int mach_size)
iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc)); iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
iotable_init(mach_desc, mach_size); iotable_init(mach_desc, mach_size);
printk("machine_initted %p,%d\n", mach_desc, mach_size);
/* now we've got our machine bits initialised, work out what /* now we've got our machine bits initialised, work out what
* clocks we've got */ * clocks we've got */
s3c2410_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), 12*MHZ); s3c24xx_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON),
s3c24xx_xtal);
tmp = __raw_readl(S3C2410_CLKDIVN); tmp = __raw_readl(S3C2410_CLKDIVN);
//printk("tmp=%08x, fclk=%d\n", tmp, s3c2410_fclk);
/* work out clock scalings */ /* work out clock scalings */
s3c2410_hclk = s3c2410_fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1); s3c24xx_hclk = s3c24xx_fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1);
s3c2410_pclk = s3c2410_hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1); s3c24xx_pclk = s3c24xx_hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1);
/* print brieft summary of clocks, etc */ /* print brieft summary of clocks, etc */
printk("S3C2410: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n", printk("S3C2410: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
print_mhz(s3c2410_fclk), print_mhz(s3c2410_hclk), print_mhz(s3c24xx_fclk), print_mhz(s3c24xx_hclk),
print_mhz(s3c2410_pclk)); print_mhz(s3c24xx_pclk));
} }
static struct s3c2410_board *board; static struct s3c2410_board *board;
...@@ -169,11 +198,6 @@ void s3c2410_set_board(struct s3c2410_board *b) ...@@ -169,11 +198,6 @@ void s3c2410_set_board(struct s3c2410_board *b)
board = b; board = b;
} }
void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
s3c2410_uartcfgs = cfg;
}
int __init s3c2410_init(void) int __init s3c2410_init(void)
{ {
int ret; int ret;
......
...@@ -15,8 +15,12 @@ ...@@ -15,8 +15,12 @@
* 04-Sep-2004 BJD Added s3c2410_init_uarts() call * 04-Sep-2004 BJD Added s3c2410_init_uarts() call
*/ */
struct s3c2410_uartcfg;
extern void s3c2410_map_io(struct map_desc *, int count); extern void s3c2410_map_io(struct map_desc *, int count);
extern void s3c2410_init_uarts(struct s3c2410_uartcfg *, int no);
extern void s3c2410_init_irq(void); extern void s3c2410_init_irq(void);
extern void s3c2410_init_time(void); extern void s3c2410_init_time(void);
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
* Modifications: * Modifications:
* 24-Aug-2004 BJD Start of s3c2440 support * 24-Aug-2004 BJD Start of s3c2440 support
* 12-Oct-2004 BJD Moved clock info out to clock.c
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -33,19 +34,14 @@ ...@@ -33,19 +34,14 @@
#include <asm/arch/regs-serial.h> #include <asm/arch/regs-serial.h>
#include "s3c2440.h" #include "s3c2440.h"
#include "clock.h"
#include "cpu.h" #include "cpu.h"
int s3c2440_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */ int s3c2440_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */
/* clock info */ /* clock info */
unsigned long s3c2440_baseclk = 12*1000*1000; /* assume base is 12MHz */
unsigned long s3c2440_hdiv; unsigned long s3c2440_hdiv;
unsigned long s3c2440_fclk;
unsigned long s3c2440_hclk;
unsigned long s3c2440_pclk;
static struct map_desc s3c2440_iodesc[] __initdata = { static struct map_desc s3c2440_iodesc[] __initdata = {
IODESC_ENT(USBHOST), IODESC_ENT(USBHOST),
IODESC_ENT(CLKPWR), IODESC_ENT(CLKPWR),
...@@ -126,7 +122,7 @@ static struct platform_device *uart_devices[] __initdata = { ...@@ -126,7 +122,7 @@ static struct platform_device *uart_devices[] __initdata = {
void __init s3c2440_map_io(struct map_desc *mach_desc, int size) void __init s3c2440_map_io(struct map_desc *mach_desc, int size)
{ {
unsigned long tmp; unsigned long clkdiv;
unsigned long camdiv; unsigned long camdiv;
/* register our io-tables */ /* register our io-tables */
...@@ -137,15 +133,15 @@ void __init s3c2440_map_io(struct map_desc *mach_desc, int size) ...@@ -137,15 +133,15 @@ void __init s3c2440_map_io(struct map_desc *mach_desc, int size)
/* now we've got our machine bits initialised, work out what /* now we've got our machine bits initialised, work out what
* clocks we've got */ * clocks we've got */
s3c2440_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON), s3c24xx_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON),
s3c2440_baseclk); s3c24xx_xtal) * 2;
tmp = __raw_readl(S3C2410_CLKDIVN); clkdiv = __raw_readl(S3C2410_CLKDIVN);
camdiv = __raw_readl(S3C2440_CAMDIVN); camdiv = __raw_readl(S3C2440_CAMDIVN);
/* work out clock scalings */ /* work out clock scalings */
switch (tmp & S3C2440_CLKDIVN_HDIVN_MASK) { switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) {
case S3C2440_CLKDIVN_HDIVN_1: case S3C2440_CLKDIVN_HDIVN_1:
s3c2440_hdiv = 1; s3c2440_hdiv = 1;
break; break;
...@@ -159,18 +155,18 @@ void __init s3c2440_map_io(struct map_desc *mach_desc, int size) ...@@ -159,18 +155,18 @@ void __init s3c2440_map_io(struct map_desc *mach_desc, int size)
break; break;
case S3C2440_CLKDIVN_HDIVN_3_6: case S3C2440_CLKDIVN_HDIVN_3_6:
s3c2440_hdiv = (camdiv & S3C2440_CAMDIVN_HCLK4_HALF) ? 6 : 3; s3c2440_hdiv = (camdiv & S3C2440_CAMDIVN_HCLK3_HALF) ? 6 : 3;
break; break;
} }
s3c2440_hclk = s3c2440_fclk / s3c2440_hdiv; s3c24xx_hclk = s3c24xx_fclk / s3c2440_hdiv;
s3c2440_pclk = s3c2440_hclk / ((tmp & S3C2440_CLKDIVN_PDIVN) ? 2 : 1); s3c24xx_pclk = s3c24xx_hclk / ((clkdiv & S3C2440_CLKDIVN_PDIVN)? 2:1);
/* print brieft summary of clocks, etc */ /* print brieft summary of clocks, etc */
printk("S3C2440: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n", printk("S3C2440: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
print_mhz(s3c2440_fclk), print_mhz(s3c2440_hclk), print_mhz(s3c24xx_fclk), print_mhz(s3c24xx_hclk),
print_mhz(s3c2440_pclk)); print_mhz(s3c24xx_pclk));
} }
......
...@@ -34,10 +34,11 @@ ...@@ -34,10 +34,11 @@
#include <asm/arch/regs-irq.h> #include <asm/arch/regs-irq.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include "clock.h"
static unsigned long timer_startval; static unsigned long timer_startval;
static unsigned long timer_ticks_usec; static unsigned long timer_ticks_usec;
/* with an 12MHz clock, we get 12 ticks per-usec /* with an 12MHz clock, we get 12 ticks per-usec
*/ */
...@@ -139,7 +140,7 @@ void __init s3c2410_init_time (void) ...@@ -139,7 +140,7 @@ void __init s3c2410_init_time (void)
*/ */
if (machine_is_h1940() || machine_is_smdk2410() ) { if (machine_is_h1940() || machine_is_smdk2410() ) {
timer_ticks_usec = s3c2410_pclk / (1000*1000); timer_ticks_usec = s3c24xx_pclk / (1000*1000);
timer_ticks_usec /= 6; timer_ticks_usec /= 6;
tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK; tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
...@@ -148,7 +149,7 @@ void __init s3c2410_init_time (void) ...@@ -148,7 +149,7 @@ void __init s3c2410_init_time (void)
tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK; tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT; tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT;
tcnt = (s3c2410_pclk / 6) / HZ; tcnt = (s3c24xx_pclk / 6) / HZ;
} }
......
...@@ -35,10 +35,6 @@ config GENERIC_NVRAM ...@@ -35,10 +35,6 @@ config GENERIC_NVRAM
bool bool
default y default y
config GENERIC_IOMAP
bool
default y
source "init/Kconfig" source "init/Kconfig"
menu "Processor" menu "Processor"
......
...@@ -1709,6 +1709,32 @@ pci_init_resource(struct resource *res, unsigned long start, unsigned long end, ...@@ -1709,6 +1709,32 @@ pci_init_resource(struct resource *res, unsigned long start, unsigned long end,
res->child = NULL; res->child = NULL;
} }
void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
{
unsigned long start = pci_resource_start(dev, bar);
unsigned long len = pci_resource_len(dev, bar);
unsigned long flags = pci_resource_flags(dev, bar);
if (!len)
return NULL;
if (max && len > max)
len = max;
if (flags & IORESOURCE_IO)
return ioport_map(start, len);
if (flags & IORESOURCE_MEM)
return (void __iomem *) start;
/* What? */
return NULL;
}
void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
{
/* Nothing to do */
}
EXPORT_SYMBOL(pci_iomap);
EXPORT_SYMBOL(pci_iounmap);
/* /*
* Null PCI config access functions, for the case when we can't * Null PCI config access functions, for the case when we can't
* find a hose. * find a hose.
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
...@@ -271,6 +272,18 @@ void iounmap(void *addr) ...@@ -271,6 +272,18 @@ void iounmap(void *addr)
vunmap((void *) (PAGE_MASK & (unsigned long)addr)); vunmap((void *) (PAGE_MASK & (unsigned long)addr));
} }
void __iomem *ioport_map(unsigned long port, unsigned int len)
{
return (void __iomem *) (port + _IO_BASE);
}
void ioport_unmap(void __iomem *addr)
{
/* Nothing to do */
}
EXPORT_SYMBOL(ioport_map);
EXPORT_SYMBOL(ioport_unmap);
int int
map_page(unsigned long va, phys_addr_t pa, int flags) map_page(unsigned long va, phys_addr_t pa, int flags)
{ {
......
...@@ -19,7 +19,7 @@ pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o \ ...@@ -19,7 +19,7 @@ pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o \
iSeries_IoMmTable.o iSeries_IoMmTable.o
pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_dma_direct.o pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_dma_direct.o
obj-$(CONFIG_PCI) += pci.o pci_iommu.o $(pci-obj-y) obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y)
obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \ obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
iSeries_VpdInfo.o XmPciLpEvent.o \ iSeries_VpdInfo.o XmPciLpEvent.o \
......
...@@ -697,121 +697,6 @@ void eeh_remove_device(struct pci_dev *dev) ...@@ -697,121 +697,6 @@ void eeh_remove_device(struct pci_dev *dev)
} }
EXPORT_SYMBOL(eeh_remove_device); EXPORT_SYMBOL(eeh_remove_device);
/*
* Here comes the EEH implementation of the IOMAP
* interfaces.
*/
unsigned int fastcall ioread8(void __iomem *addr)
{
return readb(addr);
}
unsigned int fastcall ioread16(void __iomem *addr)
{
return readw(addr);
}
unsigned int fastcall ioread32(void __iomem *addr)
{
return readl(addr);
}
EXPORT_SYMBOL(ioread8);
EXPORT_SYMBOL(ioread16);
EXPORT_SYMBOL(ioread32);
void fastcall iowrite8(u8 val, void __iomem *addr)
{
writeb(val, addr);
}
void fastcall iowrite16(u16 val, void __iomem *addr)
{
writew(val, addr);
}
void fastcall iowrite32(u32 val, void __iomem *addr)
{
writel(val, addr);
}
EXPORT_SYMBOL(iowrite8);
EXPORT_SYMBOL(iowrite16);
EXPORT_SYMBOL(iowrite32);
/*
* These are the "repeat read/write" functions. Note the
* non-CPU byte order. We do things in "IO byteorder"
* here.
*
* FIXME! We could make these do EEH handling if we really
* wanted. Not clear if we do.
*/
void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insb((u8 __force *) addr, dst, count);
}
void ioread16_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insw_ns((u16 __force *) addr, dst, count);
}
void ioread32_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insl_ns((u32 __force *) addr, dst, count);
}
EXPORT_SYMBOL(ioread8_rep);
EXPORT_SYMBOL(ioread16_rep);
EXPORT_SYMBOL(ioread32_rep);
void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsb((u8 __force *) addr, src, count);
}
void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsw_ns((u16 __force *) addr, src, count);
}
void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsl_ns((u32 __force *) addr, src, count);
}
EXPORT_SYMBOL(iowrite8_rep);
EXPORT_SYMBOL(iowrite16_rep);
EXPORT_SYMBOL(iowrite32_rep);
void __iomem *ioport_map(unsigned long port, unsigned int len)
{
if (!_IO_IS_VALID(port))
return NULL;
return (void __iomem *) (port+pci_io_base);
}
void ioport_unmap(void __iomem *addr)
{
/* Nothing to do */
}
EXPORT_SYMBOL(ioport_map);
EXPORT_SYMBOL(ioport_unmap);
void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
{
unsigned long start = pci_resource_start(dev, bar);
unsigned long len = pci_resource_len(dev, bar);
unsigned long flags = pci_resource_flags(dev, bar);
if (!len)
return NULL;
if (max && len > max)
len = max;
if (flags & IORESOURCE_IO)
return ioport_map(start, len);
if (flags & IORESOURCE_MEM)
return (void __iomem *) start;
/* What? */
return NULL;
}
void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
{
/* Nothing to do */
}
EXPORT_SYMBOL(pci_iomap);
EXPORT_SYMBOL(pci_iounmap);
static int proc_eeh_show(struct seq_file *m, void *v) static int proc_eeh_show(struct seq_file *m, void *v)
{ {
unsigned int cpu; unsigned int cpu;
......
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <asm/io.h>
/*
* Here comes the ppc64 implementation of the IOMAP
* interfaces.
*/
unsigned int fastcall ioread8(void __iomem *addr)
{
return readb(addr);
}
unsigned int fastcall ioread16(void __iomem *addr)
{
return readw(addr);
}
unsigned int fastcall ioread32(void __iomem *addr)
{
return readl(addr);
}
EXPORT_SYMBOL(ioread8);
EXPORT_SYMBOL(ioread16);
EXPORT_SYMBOL(ioread32);
void fastcall iowrite8(u8 val, void __iomem *addr)
{
writeb(val, addr);
}
void fastcall iowrite16(u16 val, void __iomem *addr)
{
writew(val, addr);
}
void fastcall iowrite32(u32 val, void __iomem *addr)
{
writel(val, addr);
}
EXPORT_SYMBOL(iowrite8);
EXPORT_SYMBOL(iowrite16);
EXPORT_SYMBOL(iowrite32);
/*
* These are the "repeat read/write" functions. Note the
* non-CPU byte order. We do things in "IO byteorder"
* here.
*
* FIXME! We could make these do EEH handling if we really
* wanted. Not clear if we do.
*/
void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insb((u8 __force *) addr, dst, count);
}
void ioread16_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insw_ns((u16 __force *) addr, dst, count);
}
void ioread32_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insl_ns((u32 __force *) addr, dst, count);
}
EXPORT_SYMBOL(ioread8_rep);
EXPORT_SYMBOL(ioread16_rep);
EXPORT_SYMBOL(ioread32_rep);
void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsb((u8 __force *) addr, src, count);
}
void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsw_ns((u16 __force *) addr, src, count);
}
void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsl_ns((u32 __force *) addr, src, count);
}
EXPORT_SYMBOL(iowrite8_rep);
EXPORT_SYMBOL(iowrite16_rep);
EXPORT_SYMBOL(iowrite32_rep);
void __iomem *ioport_map(unsigned long port, unsigned int len)
{
if (!_IO_IS_VALID(port))
return NULL;
return (void __iomem *) (port+pci_io_base);
}
void ioport_unmap(void __iomem *addr)
{
/* Nothing to do */
}
EXPORT_SYMBOL(ioport_map);
EXPORT_SYMBOL(ioport_unmap);
void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
{
unsigned long start = pci_resource_start(dev, bar);
unsigned long len = pci_resource_len(dev, bar);
unsigned long flags = pci_resource_flags(dev, bar);
if (!len)
return NULL;
if (max && len > max)
len = max;
if (flags & IORESOURCE_IO)
return ioport_map(start, len);
if (flags & IORESOURCE_MEM)
return (void __iomem *) start;
/* What? */
return NULL;
}
void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
{
/* Nothing to do */
}
EXPORT_SYMBOL(pci_iomap);
EXPORT_SYMBOL(pci_iounmap);
...@@ -590,12 +590,15 @@ static void reserve_mem(unsigned long base, unsigned long size) ...@@ -590,12 +590,15 @@ static void reserve_mem(unsigned long base, unsigned long size)
unsigned long top = base + size; unsigned long top = base + size;
unsigned long cnt = RELOC(mem_reserve_cnt); unsigned long cnt = RELOC(mem_reserve_cnt);
if (size == 0)
return;
/* We need to always keep one empty entry so that we /* We need to always keep one empty entry so that we
* have our terminator with "size" set to 0 since we are * have our terminator with "size" set to 0 since we are
* dumb and just copy this entire array to the boot params * dumb and just copy this entire array to the boot params
*/ */
base = _ALIGN_DOWN(base, PAGE_SIZE); base = _ALIGN_DOWN(base, PAGE_SIZE);
top = _ALIGN_DOWN(top, PAGE_SIZE); top = _ALIGN_UP(top, PAGE_SIZE);
size = top - base; size = top - base;
if (cnt >= (MEM_RESERVE_MAP_SIZE - 1)) if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
......
...@@ -390,7 +390,8 @@ static unsigned int find_physical_cpu_to_start(unsigned int old_hwindex) ...@@ -390,7 +390,8 @@ static unsigned int find_physical_cpu_to_start(unsigned int old_hwindex)
static inline int __devinit smp_startup_cpu(unsigned int lcpu) static inline int __devinit smp_startup_cpu(unsigned int lcpu)
{ {
int status; int status;
unsigned long start_here = __pa(pseries_secondary_smp_init); unsigned long start_here = __pa((u32)*((unsigned long *)
pseries_secondary_smp_init));
unsigned int pcpu; unsigned int pcpu;
/* At boot time the cpus are already spinning in hold /* At boot time the cpus are already spinning in hold
......
...@@ -39,29 +39,28 @@ ENTRY(swsusp_arch_resume) ...@@ -39,29 +39,28 @@ ENTRY(swsusp_arch_resume)
/* set up cr3 */ /* set up cr3 */
leaq init_level4_pgt(%rip),%rax leaq init_level4_pgt(%rip),%rax
subq $__START_KERNEL_map,%rax subq $__START_KERNEL_map,%rax
movq %rax,%cr3 movq %rax,%cr3
movq mmu_cr4_features(%rip), %rax movq mmu_cr4_features(%rip), %rax
movq %rax, %rdx movq %rax, %rdx
andq $~(1<<7), %rdx # PGE andq $~(1<<7), %rdx # PGE
movq %rdx, %cr4; # turn off PGE movq %rdx, %cr4; # turn off PGE
movq %cr3, %rcx; # flush TLB movq %cr3, %rcx; # flush TLB
movq %rcx, %cr3; movq %rcx, %cr3;
movq %rax, %cr4; # turn PGE back on movq %rax, %cr4; # turn PGE back on
movl nr_copy_pages(%rip), %eax movl nr_copy_pages(%rip), %eax
xorl %ecx, %ecx xorl %ecx, %ecx
movq $0, loop(%rip) movq $0, %r10
testl %eax, %eax testl %eax, %eax
je .L108 jz done
.L105: .L105:
xorl %esi, %esi xorl %esi, %esi
movq $0, loop2(%rip) movq $0, %r11
jmp .L104 jmp .L104
.p2align 4,,7 .p2align 4,,7
.L111: copy_one_page:
movq loop(%rip), %rcx movq %r10, %rcx
.L104: .L104:
movq pagedir_nosave(%rip), %rdx movq pagedir_nosave(%rip), %rdx
movq %rcx, %rax movq %rcx, %rax
...@@ -71,27 +70,26 @@ ENTRY(swsusp_arch_resume) ...@@ -71,27 +70,26 @@ ENTRY(swsusp_arch_resume)
movzbl (%rsi,%rax), %eax movzbl (%rsi,%rax), %eax
movb %al, (%rsi,%rcx) movb %al, (%rsi,%rcx)
movq %cr3, %rax; # flush TLB movq %cr3, %rax; # flush TLB
movq %rax, %cr3; movq %rax, %cr3;
movq loop2(%rip), %rax movq %r11, %rax
incq %rax incq %rax
cmpq $4095, %rax cmpq $4095, %rax
movq %rax, %rsi movq %rax, %rsi
movq %rax, loop2(%rip) movq %rax, %r11
jbe .L111 jbe copy_one_page
movq loop(%rip), %rax movq %r10, %rax
incq %rax incq %rax
movq %rax, %rcx movq %rax, %rcx
movq %rax, loop(%rip) movq %rax, %r10
mov nr_copy_pages(%rip), %eax mov nr_copy_pages(%rip), %eax
cmpq %rax, %rcx cmpq %rax, %rcx
jb .L105 jb .L105
.L108: done:
.align 4
movl $24, %eax movl $24, %eax
movl %eax, %ds
movl %eax, %ds
movq saved_context_esp(%rip), %rsp movq saved_context_esp(%rip), %rsp
movq saved_context_ebp(%rip), %rbp movq saved_context_ebp(%rip), %rbp
movq saved_context_eax(%rip), %rax movq saved_context_eax(%rip), %rax
...@@ -111,10 +109,3 @@ ENTRY(swsusp_arch_resume) ...@@ -111,10 +109,3 @@ ENTRY(swsusp_arch_resume)
pushq saved_context_eflags(%rip) ; popfq pushq saved_context_eflags(%rip) ; popfq
call swsusp_restore call swsusp_restore
ret ret
.section .data.nosave
loop:
.quad 0
loop2:
.quad 0
.previous
...@@ -235,6 +235,8 @@ firmware_data_write(struct kobject *kobj, ...@@ -235,6 +235,8 @@ firmware_data_write(struct kobject *kobj,
struct firmware *fw; struct firmware *fw;
ssize_t retval; ssize_t retval;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
down(&fw_lock); down(&fw_lock);
fw = fw_priv->fw; fw = fw_priv->fw;
if (test_bit(FW_STATUS_DONE, &fw_priv->status)) { if (test_bit(FW_STATUS_DONE, &fw_priv->status)) {
......
...@@ -1778,7 +1778,7 @@ static struct pci_driver agp_intel_pci_driver = { ...@@ -1778,7 +1778,7 @@ static struct pci_driver agp_intel_pci_driver = {
.name = "agpgart-intel", .name = "agpgart-intel",
.id_table = agp_intel_pci_table, .id_table = agp_intel_pci_table,
.probe = agp_intel_probe, .probe = agp_intel_probe,
.remove = agp_intel_remove, .remove = __devexit_p(agp_intel_remove),
.resume = agp_intel_resume, .resume = agp_intel_resume,
}; };
......
...@@ -249,7 +249,7 @@ config JOYSTICK_AMIGA ...@@ -249,7 +249,7 @@ config JOYSTICK_AMIGA
config JOYSTICK_JOYDUMP config JOYSTICK_JOYDUMP
tristate "Gameport data dumper" tristate "Gameport data dumper"
depends on INPUT && INPUT_JOYSTICK depends on INPUT && INPUT_JOYSTICK && GAMEPORT
help help
Say Y here if you want to dump data from your joystick into the system Say Y here if you want to dump data from your joystick into the system
log for debugging purposes. Say N if you are making a production log for debugging purposes. Say N if you are making a production
......
...@@ -603,6 +603,8 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad ...@@ -603,6 +603,8 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
} }
spin_unlock(&shared->lock); spin_unlock(&shared->lock);
} }
} else {
spin_unlock(&shared->lock);
} }
} }
......
...@@ -362,7 +362,7 @@ static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev) ...@@ -362,7 +362,7 @@ static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev)
int rpaphp_unconfig_pci_adapter(struct slot *slot) int rpaphp_unconfig_pci_adapter(struct slot *slot)
{ {
int retval = 0; int retval = 0;
struct list_head *ln; struct list_head *ln, *tmp;
dbg("Entry %s: slot[%s]\n", __FUNCTION__, slot->name); dbg("Entry %s: slot[%s]\n", __FUNCTION__, slot->name);
if (list_empty(&slot->dev.pci_funcs)) { if (list_empty(&slot->dev.pci_funcs)) {
...@@ -373,7 +373,7 @@ int rpaphp_unconfig_pci_adapter(struct slot *slot) ...@@ -373,7 +373,7 @@ int rpaphp_unconfig_pci_adapter(struct slot *slot)
goto exit; goto exit;
} }
/* remove the devices from the pci core */ /* remove the devices from the pci core */
list_for_each (ln, &slot->dev.pci_funcs) { list_for_each_safe (ln, tmp, &slot->dev.pci_funcs) {
struct rpaphp_pci_func *func; struct rpaphp_pci_func *func;
func = list_entry(ln, struct rpaphp_pci_func, sibling); func = list_entry(ln, struct rpaphp_pci_func, sibling);
......
...@@ -397,10 +397,6 @@ static void usblp_cleanup (struct usblp *usblp) ...@@ -397,10 +397,6 @@ static void usblp_cleanup (struct usblp *usblp)
{ {
info("usblp%d: removed", usblp->minor); info("usblp%d: removed", usblp->minor);
usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
usblp->writebuf, usblp->writeurb->transfer_dma);
usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
usblp->readbuf, usblp->readurb->transfer_dma);
kfree (usblp->device_id_string); kfree (usblp->device_id_string);
kfree (usblp->statusbuf); kfree (usblp->statusbuf);
usb_free_urb(usblp->writeurb); usb_free_urb(usblp->writeurb);
...@@ -1159,6 +1155,10 @@ static void usblp_disconnect(struct usb_interface *intf) ...@@ -1159,6 +1155,10 @@ static void usblp_disconnect(struct usb_interface *intf)
usb_set_intfdata (intf, NULL); usb_set_intfdata (intf, NULL);
usblp_unlink_urbs(usblp); usblp_unlink_urbs(usblp);
usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
usblp->writebuf, usblp->writeurb->transfer_dma);
usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
usblp->readbuf, usblp->readurb->transfer_dma);
if (!usblp->used) if (!usblp->used)
usblp_cleanup (usblp); usblp_cleanup (usblp);
......
...@@ -303,13 +303,16 @@ static void ep_reset (struct net2280_regs __iomem *regs, struct net2280_ep *ep) ...@@ -303,13 +303,16 @@ static void ep_reset (struct net2280_regs __iomem *regs, struct net2280_ep *ep)
/* init to our chosen defaults, notably so that we NAK OUT /* init to our chosen defaults, notably so that we NAK OUT
* packets until the driver queues a read (+note erratum 0112) * packets until the driver queues a read (+note erratum 0112)
*/ */
writel ( (1 << SET_NAK_OUT_PACKETS_MODE) tmp = (1 << SET_NAK_OUT_PACKETS_MODE)
| (1 << SET_NAK_OUT_PACKETS) | (1 << SET_NAK_OUT_PACKETS)
| (1 << CLEAR_EP_HIDE_STATUS_PHASE) | (1 << CLEAR_EP_HIDE_STATUS_PHASE)
| (1 << CLEAR_INTERRUPT_MODE) | (1 << CLEAR_INTERRUPT_MODE);
| (1 << CLEAR_ENDPOINT_TOGGLE)
| (1 << CLEAR_ENDPOINT_HALT) if (ep->num != 0) {
, &ep->regs->ep_rsp); tmp |= (1 << CLEAR_ENDPOINT_TOGGLE)
| (1 << CLEAR_ENDPOINT_HALT);
}
writel (tmp, &ep->regs->ep_rsp);
/* scrub most status bits, and flush any fifo state */ /* scrub most status bits, and flush any fifo state */
writel ( (1 << TIMEOUT) writel ( (1 << TIMEOUT)
...@@ -1920,8 +1923,6 @@ static void ep0_start (struct net2280 *dev) ...@@ -1920,8 +1923,6 @@ static void ep0_start (struct net2280 *dev)
, &dev->usb->stdrsp); , &dev->usb->stdrsp);
writel ( (1 << USB_ROOT_PORT_WAKEUP_ENABLE) writel ( (1 << USB_ROOT_PORT_WAKEUP_ENABLE)
| (1 << SELF_POWERED_USB_DEVICE) | (1 << SELF_POWERED_USB_DEVICE)
/* erratum 0102 workaround */
| ((dev->chiprev == 0100) ? 0 : 1) << SUSPEND_IMMEDIATELY
| (1 << REMOTE_WAKEUP_SUPPORT) | (1 << REMOTE_WAKEUP_SUPPORT)
| (dev->softconnect << USB_DETECT_ENABLE) | (dev->softconnect << USB_DETECT_ENABLE)
| (1 << SELF_POWERED_STATUS) | (1 << SELF_POWERED_STATUS)
...@@ -2047,6 +2048,8 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) ...@@ -2047,6 +2048,8 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
stop_activity (dev, driver); stop_activity (dev, driver);
spin_unlock_irqrestore (&dev->lock, flags); spin_unlock_irqrestore (&dev->lock, flags);
net2280_pullup (&dev->gadget, 0);
driver->unbind (&dev->gadget); driver->unbind (&dev->gadget);
dev->gadget.dev.driver = NULL; dev->gadget.dev.driver = NULL;
dev->driver = NULL; dev->driver = NULL;
...@@ -2552,8 +2555,6 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat) ...@@ -2552,8 +2555,6 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat)
if (stat & (1 << SUSPEND_REQUEST_INTERRUPT)) { if (stat & (1 << SUSPEND_REQUEST_INTERRUPT)) {
if (dev->driver->suspend) if (dev->driver->suspend)
dev->driver->suspend (&dev->gadget); dev->driver->suspend (&dev->gadget);
/* we use SUSPEND_IMMEDIATELY */
stat &= ~(1 << SUSPEND_REQUEST_INTERRUPT);
} else { } else {
if (dev->driver->resume) if (dev->driver->resume)
dev->driver->resume (&dev->gadget); dev->driver->resume (&dev->gadget);
......
...@@ -695,9 +695,18 @@ static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs) ...@@ -695,9 +695,18 @@ static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs)
timer_action_done (ehci, TIMER_IO_WATCHDOG); timer_action_done (ehci, TIMER_IO_WATCHDOG);
if (ehci->reclaim_ready) if (ehci->reclaim_ready)
end_unlink_async (ehci, regs); end_unlink_async (ehci, regs);
/* another CPU may drop ehci->lock during a schedule scan while
* it reports urb completions. this flag guards against bogus
* attempts at re-entrant schedule scanning.
*/
if (ehci->scanning)
return;
ehci->scanning = 1;
scan_async (ehci, regs); scan_async (ehci, regs);
if (ehci->next_uframe != -1) if (ehci->next_uframe != -1)
scan_periodic (ehci, regs); scan_periodic (ehci, regs);
ehci->scanning = 0;
/* the IO watchdog guards against hardware or driver bugs that /* the IO watchdog guards against hardware or driver bugs that
* misplace IRQs, and should let us run completely without IRQs. * misplace IRQs, and should let us run completely without IRQs.
......
...@@ -53,6 +53,7 @@ struct ehci_hcd { /* one per controller */ ...@@ -53,6 +53,7 @@ struct ehci_hcd { /* one per controller */
struct ehci_qh *async; struct ehci_qh *async;
struct ehci_qh *reclaim; struct ehci_qh *reclaim;
unsigned reclaim_ready : 1; unsigned reclaim_ready : 1;
unsigned scanning : 1;
/* periodic schedule support */ /* periodic schedule support */
#define DEFAULT_I_TDPS 1024 /* some HCs can do less */ #define DEFAULT_I_TDPS 1024 /* some HCs can do less */
......
...@@ -926,6 +926,8 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs) ...@@ -926,6 +926,8 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
case -ETIMEDOUT: /* NAK */
break;
default: /* error */ default: /* error */
warn("input irq status %d received", urb->status); warn("input irq status %d received", urb->status);
} }
...@@ -1859,8 +1861,8 @@ static int __init hid_init(void) ...@@ -1859,8 +1861,8 @@ static int __init hid_init(void)
static void __exit hid_exit(void) static void __exit hid_exit(void)
{ {
hiddev_exit();
usb_deregister(&hid_driver); usb_deregister(&hid_driver);
hiddev_exit();
} }
module_init(hid_init); module_init(hid_init);
......
...@@ -362,8 +362,8 @@ static void konicawc_isoc_irq(struct urb *urb, struct pt_regs *regs) ...@@ -362,8 +362,8 @@ static void konicawc_isoc_irq(struct urb *urb, struct pt_regs *regs)
else if (!urb->status && !cam->last_data_urb->status) else if (!urb->status && !cam->last_data_urb->status)
len = konicawc_compress_iso(uvd, cam->last_data_urb, urb); len = konicawc_compress_iso(uvd, cam->last_data_urb, urb);
resubmit_urb(uvd, urb);
resubmit_urb(uvd, cam->last_data_urb); resubmit_urb(uvd, cam->last_data_urb);
resubmit_urb(uvd, urb);
cam->last_data_urb = NULL; cam->last_data_urb = NULL;
uvd->stats.urb_length = len; uvd->stats.urb_length = len;
uvd->stats.data_count += len; uvd->stats.data_count += len;
......
...@@ -1546,13 +1546,17 @@ static void digi_close( struct usb_serial_port *port, struct file *filp ) ...@@ -1546,13 +1546,17 @@ static void digi_close( struct usb_serial_port *port, struct file *filp )
dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_count ); dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_count );
/* if disconnected, just clear flags */
if (!usb_get_intfdata(port->serial->interface))
goto exit;
/* do cleanup only after final close on this port */ /* do cleanup only after final close on this port */
spin_lock_irqsave( &priv->dp_port_lock, flags ); spin_lock_irqsave( &priv->dp_port_lock, flags );
priv->dp_in_close = 1; priv->dp_in_close = 1;
spin_unlock_irqrestore( &priv->dp_port_lock, flags ); spin_unlock_irqrestore( &priv->dp_port_lock, flags );
/* tell line discipline to process only XON/XOFF */ /* tell line discipline to process only XON/XOFF */
tty->closing = 1; tty->closing = 1;
/* wait for output to drain */ /* wait for output to drain */
if( (filp->f_flags&(O_NDELAY|O_NONBLOCK)) == 0 ) { if( (filp->f_flags&(O_NDELAY|O_NONBLOCK)) == 0 ) {
...@@ -1616,6 +1620,7 @@ dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_co ...@@ -1616,6 +1620,7 @@ dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_co
tty->closing = 0; tty->closing = 0;
exit:
spin_lock_irqsave( &priv->dp_port_lock, flags ); spin_lock_irqsave( &priv->dp_port_lock, flags );
priv->dp_write_urb_in_use = 0; priv->dp_write_urb_in_use = 0;
priv->dp_in_close = 0; priv->dp_in_close = 0;
......
...@@ -1579,6 +1579,12 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, ...@@ -1579,6 +1579,12 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
offset, nr_segs, offset, nr_segs,
ext3_direct_io_get_blocks, NULL); ext3_direct_io_get_blocks, NULL);
/*
* Reacquire the handle: ext3_direct_io_get_block() can restart the
* transaction
*/
handle = journal_current_handle();
out_stop: out_stop:
if (handle) { if (handle) {
int err; int err;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
* 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars * 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars
* 14-Sep-2004 BJD Added misccr and getpin to gpio * 14-Sep-2004 BJD Added misccr and getpin to gpio
* 01-Oct-2004 BJD Added the new gpio functions * 01-Oct-2004 BJD Added the new gpio functions
* 16-Oct-2004 BJD Removed the clock variables
*/ */
#ifndef __ASM_ARCH_HARDWARE_H #ifndef __ASM_ARCH_HARDWARE_H
...@@ -23,11 +24,6 @@ ...@@ -23,11 +24,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* processor clock settings, in Hz */
extern unsigned long s3c2410_pclk;
extern unsigned long s3c2410_hclk;
extern unsigned long s3c2410_fclk;
/* external functions for GPIO support /* external functions for GPIO support
* *
* These allow various different clients to access the same GPIO * These allow various different clients to access the same GPIO
......
/* linux/include/asm/hardware/s3c2410/ /* linux/include/asm/hardware/s3c2410/regs-gpio.h
* *
* Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk> * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk>
* http://www.simtec.co.uk/products/SWLINUX/ * http://www.simtec.co.uk/products/SWLINUX/
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* 12-03-2004 BJD Updated include protection * 12-03-2004 BJD Updated include protection
* 20-07-2004 BJD Added GPIO pin numbers, added Port A definitions * 20-07-2004 BJD Added GPIO pin numbers, added Port A definitions
* 04-10-2004 BJD Fixed number of bugs, added EXT IRQ filter defs * 04-10-2004 BJD Fixed number of bugs, added EXT IRQ filter defs
* 17-10-2004 BJD Added GSTATUS1 register definitions
*/ */
...@@ -806,6 +807,10 @@ ...@@ -806,6 +807,10 @@
#define S3C2410_GSTATUS0_RnB (1<<1) #define S3C2410_GSTATUS0_RnB (1<<1)
#define S3C2410_GSTATUS0_nBATTFLT (1<<0) #define S3C2410_GSTATUS0_nBATTFLT (1<<0)
#define S3C2410_GSTATUS1_IDMASK (0xffff0000)
#define S3C2410_GSTATUS1_2410 (0x32410000)
#define S3C2410_GSTATUS1_2440 (0x32440000)
#define S3C2410_GSTATUS2_WTRESET (1<<2) #define S3C2410_GSTATUS2_WTRESET (1<<2)
#define S3C2410_GSTATUs2_OFFRESET (1<<1) #define S3C2410_GSTATUs2_OFFRESET (1<<1)
#define S3C2410_GSTATUS2_PONRESET (1<<0) #define S3C2410_GSTATUS2_PONRESET (1<<0)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
* 04-Apr-1999 PJB Added check_signature. * 04-Apr-1999 PJB Added check_signature.
* 12-Dec-1999 RMK More cleanups * 12-Dec-1999 RMK More cleanups
* 18-Jun-2000 RMK Removed virt_to_* and friends definitions * 18-Jun-2000 RMK Removed virt_to_* and friends definitions
* 05-Oct-2004 BJD Moved memory string functions to use void __iomem
*/ */
#ifndef __ASM_ARM_IO_H #ifndef __ASM_ARM_IO_H
#define __ASM_ARM_IO_H #define __ASM_ARM_IO_H
...@@ -131,9 +132,9 @@ extern void __readwrite_bug(const char *fn); ...@@ -131,9 +132,9 @@ extern void __readwrite_bug(const char *fn);
/* /*
* String version of IO memory access ops: * String version of IO memory access ops:
*/ */
extern void _memcpy_fromio(void *, unsigned long, size_t); extern void _memcpy_fromio(void *, void __iomem *, size_t);
extern void _memcpy_toio(unsigned long, const void *, size_t); extern void _memcpy_toio(void __iomem *, const void *, size_t);
extern void _memset_io(unsigned long, int, size_t); extern void _memset_io(void __iomem *, int, size_t);
/* /*
* Memory access primitives * Memory access primitives
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#define FASTCALL(x) x __attribute__((regparm(3))) #define FASTCALL(x) x __attribute__((regparm(3)))
#define fastcall __attribute__((regparm(3))) #define fastcall __attribute__((regparm(3)))
#ifdef CONFIG_REGPARM
# define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret))
#endif
#ifdef CONFIG_X86_ALIGNMENT_16 #ifdef CONFIG_X86_ALIGNMENT_16
#define __ALIGN .align 16,0x90 #define __ALIGN .align 16,0x90
#define __ALIGN_STR ".align 16,0x90" #define __ALIGN_STR ".align 16,0x90"
......
...@@ -398,6 +398,79 @@ static inline int isa_check_signature(unsigned long io_addr, ...@@ -398,6 +398,79 @@ static inline int isa_check_signature(unsigned long io_addr,
return 0; return 0;
} }
/*
* Here comes the ppc implementation of the IOMAP
* interfaces.
*/
static inline unsigned int ioread8(void __iomem *addr)
{
return readb(addr);
}
static inline unsigned int ioread16(void __iomem *addr)
{
return readw(addr);
}
static inline unsigned int ioread32(void __iomem *addr)
{
return readl(addr);
}
static inline void iowrite8(u8 val, void __iomem *addr)
{
writeb(val, addr);
}
static inline void iowrite16(u16 val, void __iomem *addr)
{
writew(val, addr);
}
static inline void iowrite32(u32 val, void __iomem *addr)
{
writel(val, addr);
}
static inline void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insb((u8 __force *) addr, dst, count);
}
static inline void ioread16_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insw_ns((u16 __force *) addr, dst, count);
}
static inline void ioread32_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insl_ns((u32 __force *) addr, dst, count);
}
static inline void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsb((u8 __force *) addr, src, count);
}
static inline void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsw_ns((u16 __force *) addr, src, count);
}
static inline void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
{
_outsl_ns((u32 __force *) addr, src, count);
}
/* Create a virtual mapping cookie for an IO port range */
extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
extern void ioport_unmap(void __iomem *);
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
struct pci_dev;
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
#endif /* _PPC_IO_H */ #endif /* _PPC_IO_H */
#ifdef CONFIG_8260_PCI9 #ifdef CONFIG_8260_PCI9
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
#define asmlinkage CPP_ASMLINKAGE #define asmlinkage CPP_ASMLINKAGE
#endif #endif
#ifndef prevent_tail_call
# define prevent_tail_call(ret) do { } while (0)
#endif
#ifndef __ALIGN #ifndef __ALIGN
#define __ALIGN .align 4,0x90 #define __ALIGN .align 4,0x90
#define __ALIGN_STR ".align 4,0x90" #define __ALIGN_STR ".align 4,0x90"
......
...@@ -1376,6 +1376,8 @@ asmlinkage long sys_waitid(int which, pid_t pid, ...@@ -1376,6 +1376,8 @@ asmlinkage long sys_waitid(int which, pid_t pid,
struct siginfo __user *infop, int options, struct siginfo __user *infop, int options,
struct rusage __user *ru) struct rusage __user *ru)
{ {
long ret;
if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED)) if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED))
return -EINVAL; return -EINVAL;
if (!(options & (WEXITED|WSTOPPED|WCONTINUED))) if (!(options & (WEXITED|WSTOPPED|WCONTINUED)))
...@@ -1398,15 +1400,25 @@ asmlinkage long sys_waitid(int which, pid_t pid, ...@@ -1398,15 +1400,25 @@ asmlinkage long sys_waitid(int which, pid_t pid,
return -EINVAL; return -EINVAL;
} }
return do_wait(pid, options, infop, NULL, ru); ret = do_wait(pid, options, infop, NULL, ru);
/* avoid REGPARM breakage on x86: */
prevent_tail_call(ret);
return ret;
} }
asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
int options, struct rusage __user *ru) int options, struct rusage __user *ru)
{ {
long ret;
if (options & ~(WNOHANG|WUNTRACED|__WNOTHREAD|__WCLONE|__WALL)) if (options & ~(WNOHANG|WUNTRACED|__WNOTHREAD|__WCLONE|__WALL))
return -EINVAL; return -EINVAL;
return do_wait(pid, options | WEXITED, NULL, stat_addr, ru); ret = do_wait(pid, options | WEXITED, NULL, stat_addr, ru);
/* avoid REGPARM breakage on x86: */
prevent_tail_call(ret);
return ret;
} }
#ifdef __ARCH_WANT_SYS_WAITPID #ifdef __ARCH_WANT_SYS_WAITPID
......
...@@ -181,7 +181,7 @@ static int shrink_slab(unsigned long scanned, unsigned int gfp_mask, ...@@ -181,7 +181,7 @@ static int shrink_slab(unsigned long scanned, unsigned int gfp_mask,
struct shrinker *shrinker; struct shrinker *shrinker;
if (scanned == 0) if (scanned == 0)
return 0; scanned = SWAP_CLUSTER_MAX;
if (!down_read_trylock(&shrinker_rwsem)) if (!down_read_trylock(&shrinker_rwsem))
return 0; return 0;
...@@ -1065,7 +1065,8 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages) ...@@ -1065,7 +1065,8 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
total_reclaimed += sc.nr_reclaimed; total_reclaimed += sc.nr_reclaimed;
if (zone->all_unreclaimable) if (zone->all_unreclaimable)
continue; continue;
if (zone->pages_scanned > zone->present_pages * 2) if (zone->pages_scanned >= (zone->nr_active +
zone->nr_inactive) * 4)
zone->all_unreclaimable = 1; zone->all_unreclaimable = 1;
/* /*
* If we've done a decent amount of scanning and * If we've done a decent amount of scanning and
...@@ -1102,8 +1103,10 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages) ...@@ -1102,8 +1103,10 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
zone->prev_priority = zone->temp_priority; zone->prev_priority = zone->temp_priority;
} }
if (!all_zones_ok) if (!all_zones_ok) {
cond_resched();
goto loop_again; goto loop_again;
}
return total_reclaimed; return total_reclaimed;
} }
......
...@@ -246,7 +246,7 @@ gss_parse_init_downcall(struct gss_api_mech *gm, struct xdr_netobj *buf, ...@@ -246,7 +246,7 @@ gss_parse_init_downcall(struct gss_api_mech *gm, struct xdr_netobj *buf,
spin_lock_init(&ctx->gc_seq_lock); spin_lock_init(&ctx->gc_seq_lock);
atomic_set(&ctx->count,1); atomic_set(&ctx->count,1);
if (simple_get_bytes(&p, end, uid, sizeof(uid))) if (simple_get_bytes(&p, end, uid, sizeof(*uid)))
goto err_free_ctx; goto err_free_ctx;
/* FIXME: discarded timeout for now */ /* FIXME: discarded timeout for now */
if (simple_get_bytes(&p, end, &timeout, sizeof(timeout))) if (simple_get_bytes(&p, end, &timeout, sizeof(timeout)))
......
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