summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/mca.c14
-rw-r--r--arch/i386/kernel/setup.c51
-rw-r--r--drivers/ide/Kconfig2
-rw-r--r--drivers/ide/ide-io.c5
-rw-r--r--drivers/ide/ide.c4
-rw-r--r--drivers/net/natsemi.c4
-rw-r--r--drivers/net/s2io.c5
-rw-r--r--drivers/net/wireless/strip.c4
-rw-r--r--drivers/pci/pci.c2
-rw-r--r--drivers/video/aty/radeon_accel.c39
-rw-r--r--fs/buffer.c3
-rw-r--r--include/asm-m32r/bitops.h5
12 files changed, 114 insertions, 24 deletions
diff --git a/arch/i386/kernel/mca.c b/arch/i386/kernel/mca.c
index 740eb6379940..8600faeea29d 100644
--- a/arch/i386/kernel/mca.c
+++ b/arch/i386/kernel/mca.c
@@ -123,13 +123,13 @@ static void mca_configure_adapter_status(struct mca_device *mca_dev) {
/*--------------------------------------------------------------------*/
static struct resource mca_standard_resources[] = {
- { "system control port B (MCA)", 0x60, 0x60 },
- { "arbitration (MCA)", 0x90, 0x90 },
- { "card Select Feedback (MCA)", 0x91, 0x91 },
- { "system Control port A (MCA)", 0x92, 0x92 },
- { "system board setup (MCA)", 0x94, 0x94 },
- { "POS (MCA)", 0x96, 0x97 },
- { "POS (MCA)", 0x100, 0x107 }
+ { .start = 0x60, .end = 0x60, .name = "system control port B (MCA)" },
+ { .start = 0x90, .end = 0x90, .name = "arbitration (MCA)" },
+ { .start = 0x91, .end = 0x91, .name = "card Select Feedback (MCA)" },
+ { .start = 0x92, .end = 0x92, .name = "system Control port A (MCA)" },
+ { .start = 0x94, .end = 0x94, .name = "system board setup (MCA)" },
+ { .start = 0x96, .end = 0x97, .name = "POS (MCA)" },
+ { .start = 0x100, .end = 0x107, .name = "POS (MCA)" }
};
#define MCA_STANDARD_RESOURCES (sizeof(mca_standard_resources)/sizeof(struct resource))
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index b6f2d5995836..55ce1b114cdf 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1166,9 +1166,10 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
/*
* Request address space for all standard resources
*/
-static void __init register_memory(unsigned long max_low_pfn)
+static void __init register_memory(void)
{
- unsigned long low_mem_size;
+ unsigned long gapstart, gapsize;
+ unsigned long long last;
int i;
if (efi_enabled)
@@ -1183,10 +1184,46 @@ static void __init register_memory(unsigned long max_low_pfn)
for (i = 0; i < STANDARD_IO_RESOURCES; i++)
request_resource(&ioport_resource, &standard_io_resources[i]);
- /* Tell the PCI layer not to allocate too close to the RAM area.. */
- low_mem_size = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
- if (low_mem_size > pci_mem_start)
- pci_mem_start = low_mem_size;
+ /*
+ * Search for the bigest gap in the low 32 bits of the e820
+ * memory space.
+ */
+ last = 0x100000000ull;
+ gapstart = 0x10000000;
+ gapsize = 0x400000;
+ i = e820.nr_map;
+ while (--i >= 0) {
+ unsigned long long start = e820.map[i].addr;
+ unsigned long long end = start + e820.map[i].size;
+
+ /*
+ * Since "last" is at most 4GB, we know we'll
+ * fit in 32 bits if this condition is true
+ */
+ if (last > end) {
+ unsigned long gap = last - end;
+
+ if (gap > gapsize) {
+ gapsize = gap;
+ gapstart = end;
+ }
+ }
+ if (start < last)
+ last = start;
+ }
+
+ /*
+ * Start allocating dynamic PCI memory a bit into the gap,
+ * aligned up to the nearest megabyte.
+ *
+ * Question: should we try to pad it up a bit (do something
+ * like " + (gapsize >> 3)" in there too?). We now have the
+ * technology.
+ */
+ pci_mem_start = (gapstart + 0xfffff) & ~0xfffff;
+
+ printk("Allocating PCI resources starting at %08lx (gap: %08lx:%08lx)\n",
+ pci_mem_start, gapstart, gapsize);
}
/* Use inline assembly to define this because the nops are defined
@@ -1432,7 +1469,7 @@ void __init setup_arch(char **cmdline_p)
get_smp_config();
#endif
- register_memory(max_low_pfn);
+ register_memory();
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index cc5aeb202d52..5a21d809c43a 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -812,7 +812,7 @@ config BLK_DEV_IDE_RAPIDE
config BLK_DEV_IDE_BAST
tristate "Simtec BAST / Thorcom VR1000 IDE support"
- depends on ARM && (ARCH_BAST || MACH_VR100)
+ depends on ARM && (ARCH_BAST || MACH_VR1000)
help
Say Y here if you want to support the onboard IDE channels on the
Simtec BAST or the Thorcom VR1000
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 04705878fea6..3cf32f23bea2 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -238,9 +238,10 @@ u64 ide_get_error_location(ide_drive_t *drive, char *args)
high = ide_read_24(drive);
} else {
u8 cur = HWIF(drive)->INB(IDE_SELECT_REG);
- if (cur & 0x40)
+ if (cur & 0x40) {
+ high = cur & 0xf;
low = (hcyl << 16) | (lcyl << 8) | sect;
- else {
+ } else {
low = hcyl * drive->head * drive->sect;
low += lcyl * drive->sect;
low += sect - 1;
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index bb9960601096..15b643afc118 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -335,10 +335,14 @@ static void __init init_ide_data (void)
static int ide_system_bus_speed(void)
{
+#ifdef CONFIG_PCI
static struct pci_device_id pci_default[] = {
{ PCI_DEVICE(PCI_ANY_ID, PCI_ANY_ID) },
{ }
};
+#else
+#define pci_default 0
+#endif /* CONFIG_PCI */
if (!system_bus_speed) {
if (idebus_parameter) {
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index c6211439ac9c..df0961ab99fa 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -441,6 +441,7 @@ enum register_offsets {
#define DSPCFG_VAL 0x5040
#define SDCFG_VAL 0x008c /* set voltage thresholds for Signal Detect */
#define DSPCFG_LOCK 0x20 /* coefficient lock bit in DSPCFG */
+#define DSPCFG_COEF 0x1000 /* see coefficient (in TSTDAT) bit in DSPCFG */
#define TSTDAT_FIXED 0xe8 /* magic number for bad coefficients */
/* misc PCI space registers */
@@ -1243,7 +1244,8 @@ static void init_phy_fixup(struct net_device *dev)
writew(1, ioaddr + PGSEL);
writew(PMDCSR_VAL, ioaddr + PMDCSR);
writew(TSTDAT_VAL, ioaddr + TSTDAT);
- np->dspcfg = DSPCFG_VAL;
+ np->dspcfg = (np->srr <= SRR_DP83815_C)?
+ DSPCFG_VAL : (DSPCFG_COEF | readw(ioaddr + DSPCFG));
writew(np->dspcfg, ioaddr + DSPCFG);
writew(SDCFG_VAL, ioaddr + SDCFG);
writew(0, ioaddr + PGSEL);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index f8ef1606c30f..001a56254efc 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3025,6 +3025,8 @@ static void s2io_set_multicast(struct net_device *dev)
for (i = 0; i < prev_cnt; i++) {
writeq(RMAC_ADDR_DATA0_MEM_ADDR(dis_addr),
&bar0->rmac_addr_data0_mem);
+ writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),
+ &bar0->rmac_addr_data1_mem);
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
RMAC_ADDR_CMD_MEM_OFFSET
@@ -3049,8 +3051,11 @@ static void s2io_set_multicast(struct net_device *dev)
mac_addr |= mclist->dmi_addr[j];
mac_addr <<= 8;
}
+ mac_addr >>= 8;
writeq(RMAC_ADDR_DATA0_MEM_ADDR(mac_addr),
&bar0->rmac_addr_data0_mem);
+ writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),
+ &bar0->rmac_addr_data1_mem);
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 0acb45971d57..5d351973174f 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -2398,7 +2398,7 @@ static int set_mac_address(struct strip *strip_info,
return 0;
}
-static int dev_set_mac_address(struct net_device *dev, void *addr)
+static int strip_set_mac_address(struct net_device *dev, void *addr)
{
struct strip *strip_info = (struct strip *) (dev->priv);
struct sockaddr *sa = addr;
@@ -2552,7 +2552,7 @@ static void strip_dev_setup(struct net_device *dev)
dev->hard_start_xmit = strip_xmit;
dev->hard_header = strip_header;
dev->rebuild_header = strip_rebuild_header;
- dev->set_mac_address = dev_set_mac_address;
+ dev->set_mac_address = strip_set_mac_address;
dev->get_stats = strip_get_stats;
dev->change_mtu = strip_change_mtu;
}
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4700386db37c..b17ba2d0e511 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -268,7 +268,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
return -EIO;
pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);
- if ((pmc & PCI_PM_CAP_VER_MASK) != 2) {
+ if ((pmc & PCI_PM_CAP_VER_MASK) > 2) {
printk(KERN_DEBUG
"PCI: %s has unsupported PM cap regs version (%u)\n",
dev->slot_name, pmc & PCI_PM_CAP_VER_MASK);
diff --git a/drivers/video/aty/radeon_accel.c b/drivers/video/aty/radeon_accel.c
index e3883cff184d..dc8598dacbcb 100644
--- a/drivers/video/aty/radeon_accel.c
+++ b/drivers/video/aty/radeon_accel.c
@@ -4,6 +4,41 @@
* "ACCEL_MMIO" ifdef branches in XFree86
* --dte
*/
+
+static void radeon_fixup_offset(struct radeonfb_info *rinfo)
+{
+ u32 local_base;
+
+ /* *** Ugly workaround *** */
+ /*
+ * On some platforms, the video memory is mapped at 0 in radeon chip space
+ * (like PPCs) by the firmware. X will always move it up so that it's seen
+ * by the chip to be at the same address as the PCI BAR.
+ * That means that when switching back from X, there is a mismatch between
+ * the offsets programmed into the engine. This means that potentially,
+ * accel operations done before radeonfb has a chance to re-init the engine
+ * will have incorrect offsets, and potentially trash system memory !
+ *
+ * The correct fix is for fbcon to never call any accel op before the engine
+ * has properly been re-initialized (by a call to set_var), but this is a
+ * complex fix. This workaround in the meantime, called before every accel
+ * operation, makes sure the offsets are in sync.
+ */
+
+ radeon_fifo_wait (1);
+ local_base = INREG(MC_FB_LOCATION) << 16;
+ if (local_base == rinfo->fb_local_base)
+ return;
+
+ rinfo->fb_local_base = local_base;
+
+ radeon_fifo_wait (3);
+ OUTREG(DEFAULT_PITCH_OFFSET, (rinfo->pitch << 0x16) |
+ (rinfo->fb_local_base >> 10));
+ OUTREG(DST_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
+ OUTREG(SRC_PITCH_OFFSET, (rinfo->pitch << 0x16) | (rinfo->fb_local_base >> 10));
+}
+
static void radeonfb_prim_fillrect(struct radeonfb_info *rinfo,
const struct fb_fillrect *region)
{
@@ -38,6 +73,8 @@ void radeonfb_fillrect(struct fb_info *info, const struct fb_fillrect *region)
return;
}
+ radeon_fixup_offset(rinfo);
+
vxres = info->var.xres_virtual;
vyres = info->var.yres_virtual;
@@ -105,6 +142,8 @@ void radeonfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
return;
}
+ radeon_fixup_offset(rinfo);
+
vxres = info->var.xres_virtual;
vyres = info->var.yres_virtual;
diff --git a/fs/buffer.c b/fs/buffer.c
index 2a6285bf9a88..3c40d6382925 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -550,7 +550,8 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
set_buffer_uptodate(bh);
} else {
clear_buffer_uptodate(bh);
- buffer_io_error(bh);
+ if (printk_ratelimit())
+ buffer_io_error(bh);
SetPageError(page);
}
diff --git a/include/asm-m32r/bitops.h b/include/asm-m32r/bitops.h
index dd8c7eb7263a..e78443981349 100644
--- a/include/asm-m32r/bitops.h
+++ b/include/asm-m32r/bitops.h
@@ -405,9 +405,10 @@ static __inline__ unsigned long ffz(unsigned long word)
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
-static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
+static __inline__ int find_next_zero_bit(const unsigned long *addr,
+ int size, int offset)
{
- unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
+ const unsigned long *p = addr + (offset >> 5);
unsigned long result = offset & ~31UL;
unsigned long tmp;