Commit 88c8199b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [BBC_I2C]: kmalloc + memset conversion to kzalloc
  [BBC_ENVCTRL]: kmalloc + memset conversion to kzalloc
  [SPARC]: Fix exec failures on sun4c.
  [SPARC] Videopix Frame Grabber: Fix unreleased lock in vfc_debug()
  [SPARC64]: Add missing dma_get_cache_alignment().
  [SUNLANCE]: Fix sparc32 crashes by using of_*() interfaces.
parents 0439208a 50aa485e
...@@ -1999,6 +1999,9 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p ...@@ -1999,6 +1999,9 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p
unsigned long flags; unsigned long flags;
int pseg; int pseg;
if (vma->vm_mm->context == NO_CONTEXT)
return;
local_irq_save(flags); local_irq_save(flags);
address &= PAGE_MASK; address &= PAGE_MASK;
if ((pseg = sun4c_get_segmap(address)) == invalid_segment) { if ((pseg = sun4c_get_segmap(address)) == invalid_segment) {
......
...@@ -99,8 +99,7 @@ static char lancestr[] = "LANCE"; ...@@ -99,8 +99,7 @@ static char lancestr[] = "LANCE";
#include <asm/byteorder.h> /* Used by the checksum routines */ #include <asm/byteorder.h> /* Used by the checksum routines */
#include <asm/idprom.h> #include <asm/idprom.h>
#include <asm/sbus.h> #include <asm/sbus.h>
#include <asm/openprom.h> #include <asm/prom.h>
#include <asm/oplib.h>
#include <asm/auxio.h> /* For tpe-link-test? setting */ #include <asm/auxio.h> /* For tpe-link-test? setting */
#include <asm/irq.h> #include <asm/irq.h>
...@@ -1326,6 +1325,7 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev, ...@@ -1326,6 +1325,7 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev,
struct sbus_dev *lebuffer) struct sbus_dev *lebuffer)
{ {
static unsigned version_printed; static unsigned version_printed;
struct device_node *dp = sdev->ofdev.node;
struct net_device *dev; struct net_device *dev;
struct lance_private *lp; struct lance_private *lp;
int i; int i;
...@@ -1389,54 +1389,46 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev, ...@@ -1389,54 +1389,46 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev,
lp->rx = lance_rx_dvma; lp->rx = lance_rx_dvma;
lp->tx = lance_tx_dvma; lp->tx = lance_tx_dvma;
} }
lp->busmaster_regval = prom_getintdefault(sdev->prom_node, lp->busmaster_regval = of_getintprop_default(dp, "busmaster-regval",
"busmaster-regval", (LE_C3_BSWP |
(LE_C3_BSWP | LE_C3_ACON | LE_C3_ACON |
LE_C3_BCON)); LE_C3_BCON));
lp->name = lancestr; lp->name = lancestr;
lp->ledma = ledma; lp->ledma = ledma;
lp->burst_sizes = 0; lp->burst_sizes = 0;
if (lp->ledma) { if (lp->ledma) {
char prop[6]; struct device_node *ledma_dp = ledma->sdev->ofdev.node;
const char *prop;
unsigned int sbmask; unsigned int sbmask;
u32 csr; u32 csr;
/* Find burst-size property for ledma */ /* Find burst-size property for ledma */
lp->burst_sizes = prom_getintdefault(ledma->sdev->prom_node, lp->burst_sizes = of_getintprop_default(ledma_dp,
"burst-sizes", 0); "burst-sizes", 0);
/* ledma may be capable of fast bursts, but sbus may not. */ /* ledma may be capable of fast bursts, but sbus may not. */
sbmask = prom_getintdefault(ledma->sdev->bus->prom_node, sbmask = of_getintprop_default(ledma_dp, "burst-sizes",
"burst-sizes", DMA_BURSTBITS); DMA_BURSTBITS);
lp->burst_sizes &= sbmask; lp->burst_sizes &= sbmask;
/* Get the cable-selection property */ /* Get the cable-selection property */
memset(prop, 0, sizeof(prop)); prop = of_get_property(ledma_dp, "cable-selection", NULL);
prom_getstring(ledma->sdev->prom_node, "cable-selection", if (!prop || prop[0] == '\0') {
prop, sizeof(prop)); struct device_node *nd;
if (prop[0] == 0) {
int topnd, nd;
printk(KERN_INFO "SunLance: using auto-carrier-detection.\n"); printk(KERN_INFO "SunLance: using "
"auto-carrier-detection.\n");
/* Is this found at /options .attributes in all nd = of_find_node_by_path("/options");
* Prom versions? XXX
*/
topnd = prom_getchild(prom_root_node);
nd = prom_searchsiblings(topnd, "options");
if (!nd) if (!nd)
goto no_link_test; goto no_link_test;
if (!prom_node_has_property(nd, "tpe-link-test?")) prop = of_get_property(nd, "tpe-link-test?", NULL);
if (!prop)
goto no_link_test; goto no_link_test;
memset(prop, 0, sizeof(prop));
prom_getstring(nd, "tpe-link-test?", prop,
sizeof(prop));
if (strcmp(prop, "true")) { if (strcmp(prop, "true")) {
printk(KERN_NOTICE "SunLance: warning: overriding option " printk(KERN_NOTICE "SunLance: warning: overriding option "
"'tpe-link-test?'\n"); "'tpe-link-test?'\n");
......
...@@ -479,11 +479,12 @@ static int kenvctrld(void *__unused) ...@@ -479,11 +479,12 @@ static int kenvctrld(void *__unused)
static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx) static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
{ {
struct bbc_cpu_temperature *tp = kmalloc(sizeof(*tp), GFP_KERNEL); struct bbc_cpu_temperature *tp;
tp = kzalloc(sizeof(*tp), GFP_KERNEL);
if (!tp) if (!tp)
return; return;
memset(tp, 0, sizeof(*tp));
tp->client = bbc_i2c_attach(echild); tp->client = bbc_i2c_attach(echild);
if (!tp->client) { if (!tp->client) {
kfree(tp); kfree(tp);
...@@ -525,11 +526,12 @@ static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx) ...@@ -525,11 +526,12 @@ static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx) static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx)
{ {
struct bbc_fan_control *fp = kmalloc(sizeof(*fp), GFP_KERNEL); struct bbc_fan_control *fp;
fp = kzalloc(sizeof(*fp), GFP_KERNEL);
if (!fp) if (!fp)
return; return;
memset(fp, 0, sizeof(*fp));
fp->client = bbc_i2c_attach(echild); fp->client = bbc_i2c_attach(echild);
if (!fp->client) { if (!fp->client) {
kfree(fp); kfree(fp);
......
...@@ -357,13 +357,13 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp) ...@@ -357,13 +357,13 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
static int __init attach_one_i2c(struct linux_ebus_device *edev, int index) static int __init attach_one_i2c(struct linux_ebus_device *edev, int index)
{ {
struct bbc_i2c_bus *bp = kmalloc(sizeof(*bp), GFP_KERNEL); struct bbc_i2c_bus *bp;
struct linux_ebus_child *echild; struct linux_ebus_child *echild;
int entry; int entry;
bp = kzalloc(sizeof(*bp), GFP_KERNEL);
if (!bp) if (!bp)
return -ENOMEM; return -ENOMEM;
memset(bp, 0, sizeof(*bp));
bp->i2c_control_regs = ioremap(edev->resource[0].start, 0x2); bp->i2c_control_regs = ioremap(edev->resource[0].start, 0x2);
if (!bp->i2c_control_regs) if (!bp->i2c_control_regs)
......
...@@ -127,6 +127,13 @@ static inline int dma_mapping_error(dma_addr_t dma_addr) ...@@ -127,6 +127,13 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
return (dma_addr == DMA_ERROR_CODE); return (dma_addr == DMA_ERROR_CODE);
} }
static inline int dma_get_cache_alignment(void)
{
/* no easy way to get cache size on all processors, so return
* the maximum possible, to be safe */
return (1 << INTERNODE_CACHE_SHIFT);
}
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
#define dma_is_consistent(d, h) (1) #define dma_is_consistent(d, h) (1)
......
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