Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ceaeee6a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Oprofile: Fix computation of number of counters.
  [MIPS] Alchemy: fix IRQ bases
  [MIPS] Alchemy: replace ffs() with __ffs()
  [MIPS] BCM1480: Fix interrupt routing, take 2.
parents 3743d33e 5e2862eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -859,7 +859,7 @@ dbdma_interrupt(int irq, void *dev_id)

	intstat = dbdma_gptr->ddma_intstat;
	au_sync();
	chan_index = ffs(intstat);
	chan_index = __ffs(intstat);

	ctp = chan_tab_ptr[chan_index];
	cp = ctp->chan_ptr;
+8 −8
Original line number Diff line number Diff line
@@ -462,9 +462,9 @@ static void intc0_req0_irqdispatch(void)
		return;
	}
#endif
	bit = ffs(intc0_req0);
	bit = __ffs(intc0_req0);
	intc0_req0 &= ~(1 << bit);
	do_IRQ(MIPS_CPU_IRQ_BASE + bit);
	do_IRQ(AU1000_INTC0_INT_BASE + bit);
}


@@ -478,9 +478,9 @@ static void intc0_req1_irqdispatch(void)
	if (!intc0_req1)
		return;

	bit = ffs(intc0_req1);
	bit = __ffs(intc0_req1);
	intc0_req1 &= ~(1 << bit);
	do_IRQ(bit);
	do_IRQ(AU1000_INTC0_INT_BASE + bit);
}


@@ -498,9 +498,9 @@ static void intc1_req0_irqdispatch(void)
	if (!intc1_req0)
		return;

	bit = ffs(intc1_req0);
	bit = __ffs(intc1_req0);
	intc1_req0 &= ~(1 << bit);
	do_IRQ(MIPS_CPU_IRQ_BASE + 32 + bit);
	do_IRQ(AU1000_INTC1_INT_BASE + bit);
}


@@ -514,9 +514,9 @@ static void intc1_req1_irqdispatch(void)
	if (!intc1_req1)
		return;

	bit = ffs(intc1_req1);
	bit = __ffs(intc1_req1);
	intc1_req1 &= ~(1 << bit);
	do_IRQ(MIPS_CPU_IRQ_BASE + 32 + bit);
	do_IRQ(AU1000_INTC1_INT_BASE + bit);
}

asmlinkage void plat_irq_dispatch(void)
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ irqreturn_t pb1200_cascade_handler( int irq, void *dev_id)
	bcsr->int_status = bisr;
	for( ; bisr; bisr &= (bisr-1) )
	{
		extirq_nr = PB1200_INT_BEGIN + ffs(bisr);
		extirq_nr = PB1200_INT_BEGIN + __ffs(bisr);
		/* Ack and dispatch IRQ */
		do_IRQ(extirq_nr);
	}
+38 −6
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
 * Copyright (C) 2004, 05, 06 by Ralf Baechle
 * Copyright (C) 2005 by MIPS Technologies, Inc.
 */
#include <linux/cpumask.h>
#include <linux/oprofile.h>
#include <linux/interrupt.h>
#include <linux/smp.h>
@@ -33,11 +34,45 @@
#ifdef CONFIG_MIPS_MT_SMP
#define WHAT		(M_TC_EN_VPE | M_PERFCTL_VPEID(smp_processor_id()))
#define vpe_id()	smp_processor_id()

/*
 * The number of bits to shift to convert between counters per core and
 * counters per VPE.  There is no reasonable interface atm to obtain the
 * number of VPEs used by Linux and in the 34K this number is fixed to two
 * anyways so we hardcore a few things here for the moment.  The way it's
 * done here will ensure that oprofile VSMP kernel will run right on a lesser
 * core like a 24K also or with maxcpus=1.
 */
static inline unsigned int vpe_shift(void)
{
	if (num_possible_cpus() > 1)
		return 1;

	return 0;
}

#else

#define WHAT		0
#define vpe_id()	0

static inline unsigned int vpe_shift(void)
{
	return 0;
}

#endif

static inline unsigned int counters_total_to_per_cpu(unsigned int counters)
{
	return counters >> vpe_shift();
}

static inline unsigned int counters_per_cpu_to_total(unsigned int counters)
{
	return counters << vpe_shift();
}

#define __define_perf_accessors(r, n, np)				\
									\
static inline unsigned int r_c0_ ## r ## n(void)			\
@@ -269,9 +304,7 @@ static int __init mipsxx_init(void)

	reset_counters(counters);

#ifdef CONFIG_MIPS_MT_SMP
	counters >>= 1;
#endif
	counters = counters_total_to_per_cpu(counters);

	op_model_mipsxx_ops.num_counters = counters;
	switch (current_cpu_type()) {
@@ -330,9 +363,8 @@ static int __init mipsxx_init(void)
static void mipsxx_exit(void)
{
	int counters = op_model_mipsxx_ops.num_counters;
#ifdef CONFIG_MIPS_MT_SMP
	counters <<= 1;
#endif

	counters = counters_per_cpu_to_total(counters);
	reset_counters(counters);

	perf_irq = null_perf_irq;
+4 −1
Original line number Diff line number Diff line
@@ -76,7 +76,10 @@ static inline void WRITECFG32(u32 addr, u32 data)

int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
	return K_BCM1480_INT_PCI_INTA + pin;
	if (pin == 0)
		return -1;

	return K_BCM1480_INT_PCI_INTA - 1 + pin;
}

/* Do platform specific device initialization at pci_enable_device() time */
Loading