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
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 9
EXTRAVERSION = -rc4
EXTRAVERSION =
NAME=Zonked Quokka
# *DOCUMENTATION*
......
......@@ -7,7 +7,7 @@
* Copy data from IO memory space to "real" memory space.
* 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;
while (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.
* 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;
while (count) {
......@@ -37,7 +37,7 @@ void _memcpy_toio(unsigned long to, const void *from, size_t count)
* "memset" on IO memory space.
* 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) {
count--;
......
......@@ -46,6 +46,12 @@
#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 DECLARE_MUTEX(clocks_sem);
......@@ -277,9 +283,9 @@ static int __init s3c2410_init_clocks(void)
/* initialise the main system clocks */
clk_h.rate = s3c2410_hclk;
clk_p.rate = s3c2410_pclk;
clk_f.rate = s3c2410_fclk;
clk_h.rate = s3c24xx_hclk;
clk_p.rate = s3c24xx_pclk;
clk_f.rate = s3c24xx_fclk;
/* 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);
......
......@@ -18,3 +18,10 @@ struct clk {
unsigned long rate;
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)
int count;
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)
return tab;
}
......
......@@ -38,4 +38,3 @@ extern void s3c2440_map_io(struct map_desc *mach_desc, int size);
#endif
extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
......@@ -41,6 +41,7 @@
#include <asm/arch/regs-serial.h>
#include "s3c2410.h"
#include "clock.h"
#include "devs.h"
#include "cpu.h"
......@@ -56,7 +57,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
[0] = {
.hwport = 0,
.flags = 0,
.clock = &s3c2410_pclk,
.clock = &s3c24xx_pclk,
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
......@@ -64,7 +65,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
[1] = {
.hwport = 1,
.flags = 0,
.clock = &s3c2410_pclk,
.clock = &s3c24xx_pclk,
.ucon = 0x245,
.ulcon = 0x03,
.ufcon = 0x00,
......@@ -73,7 +74,7 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
[2] = {
.hwport = 2,
.flags = 0,
.clock = &s3c2410_pclk,
.clock = &s3c24xx_pclk,
.ucon = 0x3c5,
.ulcon = 0x43,
.ufcon = 0x51,
......
......@@ -15,6 +15,7 @@
* 05-Sep-2003 BJD Moved to kernel v2.6
* 18-Jan-2004 BJD Added serial port configuration
* 21-Aug-2004 BJD Added new struct s3c2410_board handler
* 28-Sep-2004 BJD Updates for new serial port bits
*/
#include <linux/kernel.h>
......@@ -38,6 +39,7 @@
#include "s3c2410.h"
#include "cpu.h"
#include "clock.h"
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;
/* clock info */
unsigned long s3c2410_fclk;
unsigned long s3c2410_hclk;
unsigned long s3c2410_pclk;
/* Initial IO mappings */
static struct map_desc s3c2410_iodesc[] __initdata = {
IODESC_ENT(USBHOST),
......@@ -131,6 +129,39 @@ static struct platform_device *uart_devices[] __initdata = {
&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)
{
unsigned long tmp;
......@@ -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(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
* 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);
//printk("tmp=%08x, fclk=%d\n", tmp, s3c2410_fclk);
/* work out clock scalings */
s3c2410_hclk = s3c2410_fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1);
s3c2410_pclk = s3c2410_hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1);
s3c24xx_hclk = s3c24xx_fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1);
s3c24xx_pclk = s3c24xx_hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1);
/* print brieft summary of clocks, etc */
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(s3c2410_pclk));
print_mhz(s3c24xx_fclk), print_mhz(s3c24xx_hclk),
print_mhz(s3c24xx_pclk));
}
static struct s3c2410_board *board;
......@@ -169,11 +198,6 @@ void s3c2410_set_board(struct s3c2410_board *b)
board = b;
}
void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
s3c2410_uartcfgs = cfg;
}
int __init s3c2410_init(void)
{
int ret;
......
......@@ -15,8 +15,12 @@
* 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_init_uarts(struct s3c2410_uartcfg *, int no);
extern void s3c2410_init_irq(void);
extern void s3c2410_init_time(void);
......
......@@ -10,7 +10,8 @@
* published by the Free Software Foundation.
*
* 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>
......@@ -33,19 +34,14 @@
#include <asm/arch/regs-serial.h>
#include "s3c2440.h"
#include "clock.h"
#include "cpu.h"
int s3c2440_clock_tick_rate = 12*1000*1000; /* current timers at 12MHz */
/* clock info */
unsigned long s3c2440_baseclk = 12*1000*1000; /* assume base is 12MHz */
unsigned long s3c2440_hdiv;
unsigned long s3c2440_fclk;
unsigned long s3c2440_hclk;
unsigned long s3c2440_pclk;
static struct map_desc s3c2440_iodesc[] __initdata = {
IODESC_ENT(USBHOST),
IODESC_ENT(CLKPWR),
......@@ -126,7 +122,7 @@ static struct platform_device *uart_devices[] __initdata = {
void __init s3c2440_map_io(struct map_desc *mach_desc, int size)
{
unsigned long tmp;
unsigned long clkdiv;
unsigned long camdiv;
/* register our io-tables */
......@@ -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
* clocks we've got */
s3c2440_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON),
s3c2440_baseclk);
s3c24xx_fclk = s3c2410_get_pll(__raw_readl(S3C2410_MPLLCON),
s3c24xx_xtal) * 2;
tmp = __raw_readl(S3C2410_CLKDIVN);
clkdiv = __raw_readl(S3C2410_CLKDIVN);
camdiv = __raw_readl(S3C2440_CAMDIVN);
/* work out clock scalings */
switch (tmp & S3C2440_CLKDIVN_HDIVN_MASK) {
switch (clkdiv & S3C2440_CLKDIVN_HDIVN_MASK) {
case S3C2440_CLKDIVN_HDIVN_1:
s3c2440_hdiv = 1;
break;
......@@ -159,18 +155,18 @@ void __init s3c2440_map_io(struct map_desc *mach_desc, int size)
break;
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;
}
s3c2440_hclk = s3c2440_fclk / s3c2440_hdiv;
s3c2440_pclk = s3c2440_hclk / ((tmp & S3C2440_CLKDIVN_PDIVN) ? 2 : 1);
s3c24xx_hclk = s3c24xx_fclk / s3c2440_hdiv;
s3c24xx_pclk = s3c24xx_hclk / ((clkdiv & S3C2440_CLKDIVN_PDIVN)? 2:1);
/* print brieft summary of clocks, etc */
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(s3c2440_pclk));
print_mhz(s3c24xx_fclk), print_mhz(s3c24xx_hclk),
print_mhz(s3c24xx_pclk));
}
......
......@@ -34,10 +34,11 @@
#include <asm/arch/regs-irq.h>
#include <asm/mach/time.h>
#include "clock.h"
static unsigned long timer_startval;
static unsigned long timer_ticks_usec;
/* with an 12MHz clock, we get 12 ticks per-usec
*/
......@@ -139,7 +140,7 @@ void __init s3c2410_init_time (void)
*/
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;
tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK;
......@@ -148,7 +149,7 @@ void __init s3c2410_init_time (void)
tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
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
bool
default y
config GENERIC_IOMAP
bool
default y
source "init/Kconfig"
menu "Processor"
......
......@@ -1709,6 +1709,32 @@ pci_init_resource(struct resource *res, unsigned long start, unsigned long end,
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
* find a hose.
......
......@@ -22,6 +22,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
......@@ -271,6 +272,18 @@ void iounmap(void *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
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 \
iSeries_IoMmTable.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 \
iSeries_VpdInfo.o XmPciLpEvent.o \
......
......@@ -697,121 +697,6 @@ void eeh_remove_device(struct pci_dev *dev)
}
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)
{
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)
unsigned long top = base + size;
unsigned long cnt = RELOC(mem_reserve_cnt);
if (size == 0)
return;
/* We need to always keep one empty entry so that we
* have our terminator with "size" set to 0 since we are
* dumb and just copy this entire array to the boot params
*/
base = _ALIGN_DOWN(base, PAGE_SIZE);
top = _ALIGN_DOWN(top, PAGE_SIZE);
top = _ALIGN_UP(top, PAGE_SIZE);
size = top - base;
if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
......
......@@ -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)
{
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;
/* At boot time the cpus are already spinning in hold
......
......@@ -39,29 +39,28 @@ ENTRY(swsusp_arch_resume)
/* set up cr3 */
leaq init_level4_pgt(%rip),%rax
subq $__START_KERNEL_map,%rax
movq %rax,%cr3
movq %rax,%cr3
movq mmu_cr4_features(%rip), %rax
movq %rax, %rdx
andq $~(1<<7), %rdx # PGE
movq %rdx, %cr4; # turn off PGE
movq %cr3, %rcx; # flush TLB
movq %rcx, %cr3;
movq %rax, %cr4; # turn PGE back on
movq %rdx, %cr4; # turn off PGE
movq %cr3, %rcx; # flush TLB
movq %rcx, %cr3;
movq %rax, %cr4; # turn PGE back on
movl nr_copy_pages(%rip), %eax
xorl %ecx, %ecx
movq $0, loop(%rip)
movq $0, %r10
testl %eax, %eax
je .L108
jz done
.L105:
xorl %esi, %esi
movq $0, loop2(%rip)
movq $0, %r11
jmp .L104
.p2align 4,,7
.L111:
movq loop(%rip), %rcx
copy_one_page:
movq %r10, %rcx
.L104:
movq pagedir_nosave(%rip), %rdx
movq %rcx, %rax
......@@ -71,27 +70,26 @@ ENTRY(swsusp_arch_resume)
movzbl (%rsi,%rax), %eax
movb %al, (%rsi,%rcx)
movq %cr3, %rax; # flush TLB
movq %rax, %cr3;
movq %cr3, %rax; # flush TLB
movq %rax, %cr3;
movq loop2(%rip), %rax
movq %r11, %rax
incq %rax
cmpq $4095, %rax
movq %rax, %rsi
movq %rax, loop2(%rip)
jbe .L111
movq loop(%rip), %rax
movq %rax, %r11
jbe copy_one_page
movq %r10, %rax
incq %rax
movq %rax, %rcx
movq %rax, loop(%rip)
movq %rax, %r10
mov nr_copy_pages(%rip), %eax
cmpq %rax, %rcx
jb .L105
.L108:
.align 4
done:
movl $24, %eax
movl %eax, %ds
movl %eax, %ds
movq saved_context_esp(%rip), %rsp
movq saved_context_ebp(%rip), %rbp
movq saved_context_eax(%rip), %rax
......@@ -111,10 +109,3 @@ ENTRY(swsusp_arch_resume)
pushq saved_context_eflags(%rip) ; popfq
call swsusp_restore
ret
.section .data.nosave
loop:
.quad 0
loop2:
.quad 0
.previous
......@@ -235,6 +235,8 @@ firmware_data_write(struct kobject *kobj,
struct firmware *fw;
ssize_t retval;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
down(&fw_lock);
fw = fw_priv->fw;
if (test_bit(FW_STATUS_DONE, &fw_priv->status)) {
......
......@@ -1778,7 +1778,7 @@ static struct pci_driver agp_intel_pci_driver = {
.name = "agpgart-intel",
.id_table = agp_intel_pci_table,
.probe = agp_intel_probe,
.remove = agp_intel_remove,
.remove = __devexit_p(agp_intel_remove),
.resume = agp_intel_resume,
};
......
......@@ -249,7 +249,7 @@ config JOYSTICK_AMIGA
config JOYSTICK_JOYDUMP
tristate "Gameport data dumper"
depends on INPUT && INPUT_JOYSTICK
depends on INPUT && INPUT_JOYSTICK && GAMEPORT
help
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
......
......@@ -603,6 +603,8 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
}
spin_unlock(&shared->lock);
}
} else {
spin_unlock(&shared->lock);
}
}
......
......@@ -362,7 +362,7 @@ static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev)
int rpaphp_unconfig_pci_adapter(struct slot *slot)
{
int retval = 0;
struct list_head *ln;
struct list_head *ln, *tmp;
dbg("Entry %s: slot[%s]\n", __FUNCTION__, slot->name);
if (list_empty(&slot->dev.pci_funcs)) {
......@@ -373,7 +373,7 @@ int rpaphp_unconfig_pci_adapter(struct slot *slot)
goto exit;
}
/* 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;
func = list_entry(ln, struct rpaphp_pci_func, sibling);
......
......@@ -397,10 +397,6 @@ static void usblp_cleanup (struct usblp *usblp)
{
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->statusbuf);
usb_free_urb(usblp->writeurb);
......@@ -1159,6 +1155,10 @@ static void usblp_disconnect(struct usb_interface *intf)
usb_set_intfdata (intf, NULL);
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)
usblp_cleanup (usblp);
......
......@@ -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
* 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 << CLEAR_EP_HIDE_STATUS_PHASE)
| (1 << CLEAR_INTERRUPT_MODE)
| (1 << CLEAR_ENDPOINT_TOGGLE)
| (1 << CLEAR_ENDPOINT_HALT)
, &ep->regs->ep_rsp);
| (1 << CLEAR_INTERRUPT_MODE);
if (ep->num != 0) {
tmp |= (1 << CLEAR_ENDPOINT_TOGGLE)
| (1 << CLEAR_ENDPOINT_HALT);
}
writel (tmp, &ep->regs->ep_rsp);
/* scrub most status bits, and flush any fifo state */
writel ( (1 << TIMEOUT)
......@@ -1920,8 +1923,6 @@ static void ep0_start (struct net2280 *dev)
, &dev->usb->stdrsp);
writel ( (1 << USB_ROOT_PORT_WAKEUP_ENABLE)
| (1 << SELF_POWERED_USB_DEVICE)
/* erratum 0102 workaround */
| ((dev->chiprev == 0100) ? 0 : 1) << SUSPEND_IMMEDIATELY
| (1 << REMOTE_WAKEUP_SUPPORT)
| (dev->softconnect << USB_DETECT_ENABLE)
| (1 << SELF_POWERED_STATUS)
......@@ -2047,6 +2048,8 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
stop_activity (dev, driver);
spin_unlock_irqrestore (&dev->lock, flags);
net2280_pullup (&dev->gadget, 0);
driver->unbind (&dev->gadget);
dev->gadget.dev.driver = NULL;
dev->driver = NULL;
......@@ -2552,8 +2555,6 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat)
if (stat & (1 << SUSPEND_REQUEST_INTERRUPT)) {
if (dev->driver->suspend)
dev->driver->suspend (&dev->gadget);
/* we use SUSPEND_IMMEDIATELY */
stat &= ~(1 << SUSPEND_REQUEST_INTERRUPT);
} else {
if (dev->driver->resume)
dev->driver->resume (&dev->gadget);
......
......@@ -695,9 +695,18 @@ static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs)
timer_action_done (ehci, TIMER_IO_WATCHDOG);
if (ehci->reclaim_ready)
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);
if (ehci->next_uframe != -1)
scan_periodic (ehci, regs);
ehci->scanning = 0;
/* the IO watchdog guards against hardware or driver bugs that
* misplace IRQs, and should let us run completely without IRQs.
......
......@@ -53,6 +53,7 @@ struct ehci_hcd { /* one per controller */
struct ehci_qh *async;
struct ehci_qh *reclaim;
unsigned reclaim_ready : 1;
unsigned scanning : 1;
/* periodic schedule support */
#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)
case -ENOENT:
case -ESHUTDOWN:
return;
case -ETIMEDOUT: /* NAK */
break;
default: /* error */
warn("input irq status %d received", urb->status);
}
......@@ -1859,8 +1861,8 @@ static int __init hid_init(void)
static void __exit hid_exit(void)
{
hiddev_exit();
usb_deregister(&hid_driver);
hiddev_exit();
}
module_init(hid_init);
......
......@@ -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)
len = konicawc_compress_iso(uvd, cam->last_data_urb, urb);
resubmit_urb(uvd, urb);
resubmit_urb(uvd, cam->last_data_urb);
resubmit_urb(uvd, urb);
cam->last_data_urb = NULL;
uvd->stats.urb_length = len;
uvd->stats.data_count += len;
......
......@@ -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 );
/* if disconnected, just clear flags */
if (!usb_get_intfdata(port->serial->interface))
goto exit;
/* do cleanup only after final close on this port */
spin_lock_irqsave( &priv->dp_port_lock, flags );
priv->dp_in_close = 1;
spin_unlock_irqrestore( &priv->dp_port_lock, flags );
/* tell line discipline to process only XON/XOFF */
tty->closing = 1;
tty->closing = 1;
/* wait for output to drain */
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
tty->closing = 0;
exit:
spin_lock_irqsave( &priv->dp_port_lock, flags );
priv->dp_write_urb_in_use = 0;
priv->dp_in_close = 0;
......
......@@ -1579,6 +1579,12 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
offset, nr_segs,
ext3_direct_io_get_blocks, NULL);
/*
* Reacquire the handle: ext3_direct_io_get_block() can restart the
* transaction
*/
handle = journal_current_handle();
out_stop:
if (handle) {
int err;
......
......@@ -16,6 +16,7 @@
* 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars
* 14-Sep-2004 BJD Added misccr and getpin to gpio
* 01-Oct-2004 BJD Added the new gpio functions
* 16-Oct-2004 BJD Removed the clock variables
*/
#ifndef __ASM_ARCH_HARDWARE_H
......@@ -23,11 +24,6 @@
#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
*
* 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>
* http://www.simtec.co.uk/products/SWLINUX/
......@@ -15,6 +15,7 @@
* 12-03-2004 BJD Updated include protection
* 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
* 17-10-2004 BJD Added GSTATUS1 register definitions
*/
......@@ -806,6 +807,10 @@
#define S3C2410_GSTATUS0_RnB (1<<1)
#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_OFFRESET (1<<1)
#define S3C2410_GSTATUS2_PONRESET (1<<0)
......
......@@ -16,6 +16,7 @@
* 04-Apr-1999 PJB Added check_signature.
* 12-Dec-1999 RMK More cleanups
* 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
#define __ASM_ARM_IO_H
......@@ -131,9 +132,9 @@ extern void __readwrite_bug(const char *fn);
/*
* String version of IO memory access ops:
*/
extern void _memcpy_fromio(void *, unsigned long, size_t);
extern void _memcpy_toio(unsigned long, const void *, size_t);
extern void _memset_io(unsigned long, int, size_t);
extern void _memcpy_fromio(void *, void __iomem *, size_t);
extern void _memcpy_toio(void __iomem *, const void *, size_t);
extern void _memset_io(void __iomem *, int, size_t);
/*
* Memory access primitives
......
......@@ -5,6 +5,10 @@
#define FASTCALL(x) x __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
#define __ALIGN .align 16,0x90
#define __ALIGN_STR ".align 16,0x90"
......
......@@ -398,6 +398,79 @@ static inline int isa_check_signature(unsigned long io_addr,
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 */
#ifdef CONFIG_8260_PCI9
......
......@@ -14,6 +14,10 @@
#define asmlinkage CPP_ASMLINKAGE
#endif
#ifndef prevent_tail_call
# define prevent_tail_call(ret) do { } while (0)
#endif
#ifndef __ALIGN
#define __ALIGN .align 4,0x90
#define __ALIGN_STR ".align 4,0x90"
......
......@@ -1376,6 +1376,8 @@ asmlinkage long sys_waitid(int which, pid_t pid,
struct siginfo __user *infop, int options,
struct rusage __user *ru)
{
long ret;
if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED))
return -EINVAL;
if (!(options & (WEXITED|WSTOPPED|WCONTINUED)))
......@@ -1398,15 +1400,25 @@ asmlinkage long sys_waitid(int which, pid_t pid,
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,
int options, struct rusage __user *ru)
{
long ret;
if (options & ~(WNOHANG|WUNTRACED|__WNOTHREAD|__WCLONE|__WALL))
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
......
......@@ -181,7 +181,7 @@ static int shrink_slab(unsigned long scanned, unsigned int gfp_mask,
struct shrinker *shrinker;
if (scanned == 0)
return 0;
scanned = SWAP_CLUSTER_MAX;
if (!down_read_trylock(&shrinker_rwsem))
return 0;
......@@ -1065,7 +1065,8 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
total_reclaimed += sc.nr_reclaimed;
if (zone->all_unreclaimable)
continue;
if (zone->pages_scanned > zone->present_pages * 2)
if (zone->pages_scanned >= (zone->nr_active +
zone->nr_inactive) * 4)
zone->all_unreclaimable = 1;
/*
* 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)
zone->prev_priority = zone->temp_priority;
}
if (!all_zones_ok)
if (!all_zones_ok) {
cond_resched();
goto loop_again;
}
return total_reclaimed;
}
......
......@@ -246,7 +246,7 @@ gss_parse_init_downcall(struct gss_api_mech *gm, struct xdr_netobj *buf,
spin_lock_init(&ctx->gc_seq_lock);
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;
/* FIXME: discarded timeout for now */
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