* Re: [PATCH] fix appletouch geyser 1 breakage
From: Dmitry Torokhov @ 2007-10-28 5:00 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev list, Benjamin Berg, Anton Ekblad
In-Reply-To: <1193430697.15686.1.camel@johannes.berg>
On Friday 26 October 2007 16:31, Johannes Berg wrote:
>
> > Johannes, and what is product ID for your touchpad?
>
> It's 0x20e, listed as 'fountain'
>
OK, then maybe instead of reverting the change outright we could try the
patch below?
--
Dmitry
Input: appletouch - idle reset logic broke older Fountains
Older models of fountains do not support change mode request and
therefore shoudl be excluded from idle reset attempts.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/mouse/appletouch.c | 83 +++++++++++++++++++++++----------------
1 file changed, 49 insertions(+), 34 deletions(-)
Index: work/drivers/input/mouse/appletouch.c
===================================================================
--- work.orig/drivers/input/mouse/appletouch.c
+++ work/drivers/input/mouse/appletouch.c
@@ -130,11 +130,11 @@ MODULE_DEVICE_TABLE (usb, atp_table);
#define ATP_THRESHOLD 5
/* MacBook Pro (Geyser 3 & 4) initialization constants */
-#define ATP_GEYSER3_MODE_READ_REQUEST_ID 1
-#define ATP_GEYSER3_MODE_WRITE_REQUEST_ID 9
-#define ATP_GEYSER3_MODE_REQUEST_VALUE 0x300
-#define ATP_GEYSER3_MODE_REQUEST_INDEX 0
-#define ATP_GEYSER3_MODE_VENDOR_VALUE 0x04
+#define ATP_GEYSER_MODE_READ_REQUEST_ID 1
+#define ATP_GEYSER_MODE_WRITE_REQUEST_ID 9
+#define ATP_GEYSER_MODE_REQUEST_VALUE 0x300
+#define ATP_GEYSER_MODE_REQUEST_INDEX 0
+#define ATP_GEYSER_MODE_VENDOR_VALUE 0x04
/* Structure to hold all of our device specific stuff */
struct atp {
@@ -188,6 +188,14 @@ static int debug = 1;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Activate debugging output");
+static inline int atp_is_old_fountain(struct atp *dev)
+{
+ u16 productId = le16_to_cpu(dev->udev->descriptor.idProduct);
+
+ return productId == FOUNTAIN_ANSI_PRODUCT_ID ||
+ productId == FOUNTAIN_ISO_PRODUCT_ID;
+}
+
/* Checks if the device a Geyser 2 (ANSI, ISO, JIS) */
static inline int atp_is_geyser_2(struct atp *dev)
{
@@ -211,52 +219,55 @@ static inline int atp_is_geyser_3(struct
}
/*
- * By default Geyser 3 device sends standard USB HID mouse
+ * By default newer Geyser devices send standard USB HID mouse
* packets (Report ID 2). This code changes device mode, so it
* sends raw sensor reports (Report ID 5).
*/
-static int atp_geyser3_init(struct usb_device *udev)
+static int atp_geyser_init(struct usb_device *udev)
{
char data[8];
int size;
size = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
- ATP_GEYSER3_MODE_READ_REQUEST_ID,
+ ATP_GEYSER_MODE_READ_REQUEST_ID,
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
- ATP_GEYSER3_MODE_REQUEST_VALUE,
- ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000);
+ ATP_GEYSER_MODE_REQUEST_VALUE,
+ ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
if (size != 8) {
err("Could not do mode read request from device"
- " (Geyser 3 mode)");
+ " (Geyser Raw mode)");
return -EIO;
}
/* Apply the mode switch */
- data[0] = ATP_GEYSER3_MODE_VENDOR_VALUE;
+ data[0] = ATP_GEYSER_MODE_VENDOR_VALUE;
size = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
- ATP_GEYSER3_MODE_WRITE_REQUEST_ID,
+ ATP_GEYSER_MODE_WRITE_REQUEST_ID,
USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
- ATP_GEYSER3_MODE_REQUEST_VALUE,
- ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000);
+ ATP_GEYSER_MODE_REQUEST_VALUE,
+ ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
if (size != 8) {
err("Could not do mode write request to device"
- " (Geyser 3 mode)");
+ " (Geyser Raw mode)");
return -EIO;
}
return 0;
}
-/* Reinitialise the device if it's a geyser 3 */
+/*
+ * Reinitialise the device. This usually stops stream of empty packets
+ * coming form it.
+ */
static void atp_reinit(struct work_struct *work)
{
struct atp *dev = container_of(work, struct atp, work);
struct usb_device *udev = dev->udev;
dev->idlecount = 0;
- atp_geyser3_init(udev);
+ atp_geyser_init(udev);
}
static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact,
@@ -507,19 +518,23 @@ static void atp_complete(struct urb* urb
input_report_key(dev->input, BTN_LEFT, key);
input_sync(dev->input);
- /* Many Geysers will continue to send packets continually after
- the first touch unless reinitialised. Do so if it's been
- idle for a while in order to avoid waking the kernel up
- several hundred times a second */
-
- if (!x && !y && !key) {
- dev->idlecount++;
- if (dev->idlecount == 10) {
- dev->valid = 0;
- schedule_work(&dev->work);
- }
- } else
- dev->idlecount = 0;
+ /*
+ * Many Geysers will continue to send packets continually after
+ * the first touch unless reinitialised. Do so if it's been
+ * idle for a while in order to avoid waking the kernel up
+ * several hundred times a second. Re-initialization does not
+ * work on older versions of Fountain touchpads.
+ */
+ if (!atp_is_old_fountain(dev)) {
+ if (!x && !y && !key) {
+ dev->idlecount++;
+ if (dev->idlecount == 10) {
+ dev->valid = 0;
+ schedule_work(&dev->work);
+ }
+ } else
+ dev->idlecount = 0;
+ }
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
@@ -593,12 +608,12 @@ static int atp_probe(struct usb_interfac
else
dev->datalen = 81;
- if (atp_is_geyser_3(dev)) {
+ if (!atp_is_old_fountain(dev)) {
/* switch to raw sensor mode */
- if (atp_geyser3_init(udev))
+ if (atp_geyser_init(udev))
goto err_free_devs;
- printk("appletouch Geyser 3 inited.\n");
+ printk(KERN_INFO "appletouch: Geyser mode initialized.\n");
}
dev->urb = usb_alloc_urb(0, GFP_KERNEL);
^ permalink raw reply
* Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Olof Johansson @ 2007-10-28 2:02 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, paulus, linux-kernel, Arnd Bergmann
In-Reply-To: <20071028123850.e5b9c555.sfr@canb.auug.org.au>
On Sun, Oct 28, 2007 at 12:38:50PM +1100, Stephen Rothwell wrote:
> Hi Olof,
>
> Just a trivial thing ...
>
> On Sat, 27 Oct 2007 12:28:51 -0500 Olof Johansson <olof@lixom.net> wrote:
> >
> > +u8 iic_get_target_id(int cpu)
> > +{
> > + return per_cpu(iic, cpu).target_id;
> > +}
> > +
> > +EXPORT_SYMBOL_GPL(iic_get_target_id);
>
> We don't normally put a blank line between a function and its EXPORT...
Yeah, sloppy of me, I thought I just copied and pasted. Paulus: feel
free to fix up before applying.
Thanks for your feedback,
-Olof
^ permalink raw reply
* Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Stephen Rothwell @ 2007-10-28 1:38 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev, paulus, linux-kernel, Arnd Bergmann
In-Reply-To: <20071027172851.GA11930@lixom.net>
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Hi Olof,
Just a trivial thing ...
On Sat, 27 Oct 2007 12:28:51 -0500 Olof Johansson <olof@lixom.net> wrote:
>
> +u8 iic_get_target_id(int cpu)
> +{
> + return per_cpu(iic, cpu).target_id;
> +}
> +
> +EXPORT_SYMBOL_GPL(iic_get_target_id);
We don't normally put a blank line between a function and its EXPORT...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH] powerpc: Fix cache line vs. block size confusion
From: Benjamin Herrenschmidt @ 2007-10-27 21:49 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev list, Ronald L Rockhold, Lixin Zhang
We had an historical confusion in the kernel between cache line
and cache block size. The former is an implementation detail of
the L1 cache which can be useful for performance optimisations,
the later is the actual size on which the cache control
instructions operate, which can be different.
For some reason, we had a weird hack reading the right property
on powermac and the wrong one on any other 64 bits (32 bits is
unaffected as it only uses the cputable for cache block size
infos at this stage).
This fixes the booting-without-of.txt documentation to mention
the right properties, and fixes the 64 bits initialization code
to look for the block size first, with a fallback to the line
size if the property is missing.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Note: I didn't update all the .dts files which is fine as only
64 bits currently cares about those properties and the code has
a fallback to the line size property. So they can be fixed
gradually if necessary.
Index: linux-work/Documentation/powerpc/booting-without-of.txt
===================================================================
--- linux-work.orig/Documentation/powerpc/booting-without-of.txt 2007-10-28 08:45:27.000000000 +1100
+++ linux-work/Documentation/powerpc/booting-without-of.txt 2007-10-28 08:45:38.000000000 +1100
@@ -851,12 +851,18 @@ address which can extend beyond that lim
/cpus/PowerPC,970FX@0
/cpus/PowerPC,970FX@1
(unit addresses do not require leading zeroes)
- - d-cache-line-size : one cell, L1 data cache line size in bytes
- - i-cache-line-size : one cell, L1 instruction cache line size in
+ - d-cache-block-size : one cell, L1 data cache block size in bytes (*)
+ - i-cache-block-size : one cell, L1 instruction cache block size in
bytes
- d-cache-size : one cell, size of L1 data cache in bytes
- i-cache-size : one cell, size of L1 instruction cache in bytes
+(*) The cache "block" size is the size on which the cache management
+instructions operate. Historically, this document used the cache
+"line" size here which is incorrect. The kernel will prefer the cache
+block size and will fallback to cache line size for backward
+compatibility.
+
Recommended properties:
- timebase-frequency : a cell indicating the frequency of the
@@ -870,6 +876,10 @@ address which can extend beyond that lim
for the above, the common code doesn't use that property, but
you are welcome to re-use the pSeries or Maple one. A future
kernel version might provide a common function for this.
+ - d-cache-line-size : one cell, L1 data cache line size in bytes
+ if different from the block size
+ - i-cache-line-size : one cell, L1 instruction cache line size in
+ bytes if different from the block size
You are welcome to add any property you find relevant to your board,
like some information about the mechanism used to soft-reset the
Index: linux-work/arch/powerpc/kernel/setup_64.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/setup_64.c 2007-10-28 08:45:27.000000000 +1100
+++ linux-work/arch/powerpc/kernel/setup_64.c 2007-10-28 08:46:19.000000000 +1100
@@ -291,23 +291,16 @@ static void __init initialize_cache_info
if ( num_cpus == 1 ) {
const u32 *sizep, *lsizep;
u32 size, lsize;
- const char *dc, *ic;
-
- /* Then read cache informations */
- if (machine_is(powermac)) {
- dc = "d-cache-block-size";
- ic = "i-cache-block-size";
- } else {
- dc = "d-cache-line-size";
- ic = "i-cache-line-size";
- }
size = 0;
lsize = cur_cpu_spec->dcache_bsize;
sizep = of_get_property(np, "d-cache-size", NULL);
if (sizep != NULL)
size = *sizep;
- lsizep = of_get_property(np, dc, NULL);
+ lsizep = of_get_property(np, "d-cache-block-size", NULL);
+ /* fallback if block size missing */
+ if (lsizep == NULL)
+ lsizep = of_get_property(np, "d-cache-line-size", NULL);
if (lsizep != NULL)
lsize = *lsizep;
if (sizep == 0 || lsizep == 0)
@@ -324,7 +317,9 @@ static void __init initialize_cache_info
sizep = of_get_property(np, "i-cache-size", NULL);
if (sizep != NULL)
size = *sizep;
- lsizep = of_get_property(np, ic, NULL);
+ lsizep = of_get_property(np, "i-cache-block-size", NULL);
+ if (lsizep == NULL)
+ lsizep = of_get_property(np, "i-cache-line-size", NULL);
if (lsizep != NULL)
lsize = *lsizep;
if (sizep == 0 || lsizep == 0)
^ permalink raw reply
* RE: [i2c] i2c-mpc.c driver issues
From: Joakim Tjernlund @ 2007-10-27 20:52 UTC (permalink / raw)
To: 'Jean Delvare'; +Cc: linuxppc-dev, i2c
In-Reply-To: <20071026115329.0307e207@hyperion.delvare>
> -----Original Message-----
> From:
> linuxppc-dev-bounces+joakim.tjernlund=transmode.se@ozlabs.org
> [mailto:linuxppc-dev-bounces+joakim.tjernlund=transmode.se@ozl
abs.org] On Behalf Of Jean Delvare
> Sent: den 26 oktober 2007 11:53
> To: Tjernlund
> Cc: linuxppc-dev@ozlabs.org; i2c@lm-sensors.org
> Subject: Re: [i2c] i2c-mpc.c driver issues
>
> Hi Jocke,
>
> On Wed, 24 Oct 2007 23:06:13 +0200, Tjernlund wrote:
> > While browsing the i2c-mpc.c driver I noticed some things
> that look odd
> > to me so I figured I report them. Could not find a
> maintainer in the MAINTANERS file
> > so I sent here, cc:ed linuxppc-dev as well.
> >
> > 1) There are a lot of return -1 error code that is
> propagated back to
> > userspace. Should be changed to proper -Exxx codes.
>
> This is true of many Linux i2c bus drivers, unfortunately.
> While nothing
> actually prevents drivers from returning -1 to userspace on error,
> meaningful error codes would of course be preferred.
>
> > 2) mpc_read(), according to the comment below it sends a
> STOP condition here but
> > this function does not known if this is the last read or
> not. mpc_xfer is
> > the one that knows when the transaction is over and
> should send the stop, which it already
> > does.
> >
> > /* Generate stop on last byte */
> > if (i == length - 1)
> > writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_TXAK);
>
> Probably correct, although I am not familiar with this specific
> hardware. I guess that the same is true of mpc_write as well, which is
> even worse because write + read combined transactions are very common
> (while read + write are not.)
>
> I'm not completely sure that mpc_xfer sends the stop. mpc_i2c_stop
> doesn't seem to do much.
Don't have the manual handy, but there is something bothering me with
the read function. After reading the last char there is nothing that
wait for the STOP to complete, instead one just exits and call
mpc_i2c_stop(). It might be so that the i2c_wait() won't complete until
the STOP has been sent, but I would not bet on it.
Jocke
^ permalink raw reply
* [PATCH] fix breakage in pegasos_eth (fallout from commit b45d9147f1582333e180e1023624c003874b7312)
From: Al Viro @ 2007-10-27 20:02 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, linux-kernel, buytenh
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 3f27239..8df230a 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -8,6 +8,9 @@
#define MV643XX_ETH_NAME "mv643xx_eth"
#define MV643XX_ETH_SHARED_REGS 0x2000
#define MV643XX_ETH_SHARED_REGS_SIZE 0x2000
+#define MV643XX_ETH_BAR_4 0x220
+#define MV643XX_ETH_SIZE_REG_4 0x224
+#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x0290
struct mv643xx_eth_platform_data {
int port_number;
^ permalink raw reply related
* Re: 2.6.24-rc1 sysctl table check failed on PowerMac
From: Mikael Pettersson @ 2007-10-27 19:37 UTC (permalink / raw)
To: adobriyan, mikpe; +Cc: linuxppc-dev, paulus, linux-kernel
On Sat, 27 Oct 2007 22:34:53 +0400, Alexey Dobriyan wrote:
> On Sat, Oct 27, 2007 at 07:57:38PM +0200, Mikael Pettersson wrote:
> > Booting 2.6.24-rc1 on my PowerMac the kernel now spits
> > out a sysctl warning early in the boot sequence:
> >
> > --- dmesg-2.6.23
> > +++ dmesg-2.6.24-rc1
> > ...
> > IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
> > TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
> > TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
> > TCP: Hash tables configured (established 131072 bind 65536)
> > TCP reno registered
> > +sysctl table check failed: /kernel .1 Writable sysctl directory
>
> [PATCH] powerpc: fix sysctl whining re kernel.powersave-nap
>
> kernel was marked with 0755. Everywhere else it's 0555.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
> arch/powerpc/kernel/idle.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/powerpc/kernel/idle.c
> +++ b/arch/powerpc/kernel/idle.c
> @@ -122,7 +122,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
> {
> .ctl_name = CTL_KERN,
> .procname = "kernel",
> - .mode = 0755,
> + .mode = 0555,
> .child = powersave_nap_ctl_table,
> },
> {}
>
This eliminated the warning. Thanks.
^ permalink raw reply
* Re: 2.6.24-rc1 sysctl table check failed on PowerMac
From: Alexey Dobriyan @ 2007-10-27 18:34 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <200710271757.l9RHvcY9021751@harpo.it.uu.se>
On Sat, Oct 27, 2007 at 07:57:38PM +0200, Mikael Pettersson wrote:
> Booting 2.6.24-rc1 on my PowerMac the kernel now spits
> out a sysctl warning early in the boot sequence:
>
> --- dmesg-2.6.23
> +++ dmesg-2.6.24-rc1
> ...
> IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
> TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
> TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
> TCP: Hash tables configured (established 131072 bind 65536)
> TCP reno registered
> +sysctl table check failed: /kernel .1 Writable sysctl directory
[PATCH] powerpc: fix sysctl whining re kernel.powersave-nap
kernel was marked with 0755. Everywhere else it's 0555.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
arch/powerpc/kernel/idle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -122,7 +122,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
{
.ctl_name = CTL_KERN,
.procname = "kernel",
- .mode = 0755,
+ .mode = 0555,
.child = powersave_nap_ctl_table,
},
{}
^ permalink raw reply
* Re: [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Arnd Bergmann @ 2007-10-27 18:08 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <20071027172851.GA11930@lixom.net>
On Saturday 27 October 2007, Olof Johansson wrote:
> Fix two build errors on powerpc allyesconfig + CONFIG_SMP=n:
>
> arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':
> arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to `.iic_get_target_id'
> arch/powerpc/platforms/built-in.o: In function `iic_init_IRQ':
> arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
^ permalink raw reply
* 2.6.24-rc1 sysctl table check failed on PowerMac
From: Mikael Pettersson @ 2007-10-27 17:57 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, linux-kernel
Booting 2.6.24-rc1 on my PowerMac the kernel now spits
out a sysctl warning early in the boot sequence:
--- dmesg-2.6.23
+++ dmesg-2.6.24-rc1
...
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
+sysctl table check failed: /kernel .1 Writable sysctl directory
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
^ permalink raw reply
* Re: [PATCH] [Powerpc] fix switch_slb handling of 1T ESID values
From: Will Schmidt @ 2007-10-27 17:36 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, paulus
In-Reply-To: <1193458771.18243.55.camel@pasglop>
On Sat, 2007-10-27 at 14:19 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2007-10-26 at 15:46 -0500, Will Schmidt wrote:
> > [Powerpc] fix switch_slb handling of 1T ESID values
> >
> > Now that we have 1TB segment size support, we need to be using the
> > GET_ESID_1T macro when comparing ESID values for pc,stack, and
> > unmapped_base within switch_slb() when we're on a CPU that supports it.
> >
> > This also happens to fix a duplicate-slb-entry inspired machine-check
> > exception I was seeing when trying to run java on a power6 partition.
> >
> > Tested on power6 and power5.
> >
> > Signed-Off-By: Will Schmidt <will_schmidt@vnet.ibm.com>
>
> Good catch !
>
> A minor comment is maybe you could factor out the code better doing
> something like a ESID_COMPARE() macro ?
Yeah, thats a good idea. I'll spin up a new patch in the next day or
so.
It occurred to me that I should continue to use GET_ESID when the user
address is < 1T too.
>
> > ---
> >
> > There is a similar bit of code in stab.c switch_stab(). Should this change also be made there?
> > ---
>
> There is no machine that does stab and 1T segments.
Ok, thanks for the clarification.
-Will
>
> Ben.
>
> >
> > arch/powerpc/mm/slb.c | 19 ++++++++++++++-----
> > 1 files changed, 14 insertions(+), 5 deletions(-)
> >
> >
> > diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
> > index bbd2c51..0c527d7 100644
> > --- a/arch/powerpc/mm/slb.c
> > +++ b/arch/powerpc/mm/slb.c
> > @@ -193,16 +193,25 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
> > return;
> > slb_allocate(pc);
> >
> > - if (GET_ESID(pc) == GET_ESID(stack))
> > - return;
> > + if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) {
> > + if (GET_ESID_1T(pc) == GET_ESID_1T(stack))
> > + return;
> > + } else
> > + if (GET_ESID(pc) == GET_ESID(stack))
> > + return;
> >
> > if (is_kernel_addr(stack))
> > return;
> > slb_allocate(stack);
> >
> > - if ((GET_ESID(pc) == GET_ESID(unmapped_base))
> > - || (GET_ESID(stack) == GET_ESID(unmapped_base)))
> > - return;
> > + if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) {
> > + if ((GET_ESID_1T(pc) == GET_ESID_1T(unmapped_base))
> > + || (GET_ESID_1T(stack) == GET_ESID_1T(unmapped_base)))
> > + return;
> > + } else
> > + if ((GET_ESID(pc) == GET_ESID(unmapped_base))
> > + || (GET_ESID(stack) == GET_ESID(unmapped_base)))
> > + return;
> >
> > if (is_kernel_addr(unmapped_base))
> > return;
> >
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
^ permalink raw reply
* [PATCH v2] [POWERPC] Fix CONFIG_SMP=n build break
From: Olof Johansson @ 2007-10-27 17:28 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, paulus, linux-kernel
In-Reply-To: <200710262019.12094.arnd@arndb.de>
Fix two build errors on powerpc allyesconfig + CONFIG_SMP=n:
arch/powerpc/platforms/built-in.o: In function `cpu_affinity_set':
arch/powerpc/platforms/cell/spu_priv1_mmio.c:78: undefined reference to `.iic_get_target_id'
arch/powerpc/platforms/built-in.o: In function `iic_init_IRQ':
arch/powerpc/platforms/cell/interrupt.c:397: undefined reference to `.iic_setup_cpu'
Signed-off-by: Olof Johansson <olof@lixom.net>
---
On Fri, Oct 26, 2007 at 08:19:10PM +0200, Arnd Bergmann wrote:
> I think here it would be better to move iic_get_target_id out of
> CONFIG_SMP as well. We might want to kexec from an SMP kernel into
> a UP kernel, and in that case, cpu_affinity_set() should better
> reset the routing to CPU 0.
Makes sense. New patch.
-Olof
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 151fd8b..04f74f9 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -158,6 +158,18 @@ static unsigned int iic_get_irq(void)
return virq;
}
+void iic_setup_cpu(void)
+{
+ out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
+}
+
+u8 iic_get_target_id(int cpu)
+{
+ return per_cpu(iic, cpu).target_id;
+}
+
+EXPORT_SYMBOL_GPL(iic_get_target_id);
+
#ifdef CONFIG_SMP
/* Use the highest interrupt priorities for IPI */
@@ -166,29 +178,17 @@ static inline int iic_ipi_to_irq(int ipi)
return IIC_IRQ_TYPE_IPI + 0xf - ipi;
}
-void iic_setup_cpu(void)
-{
- out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
-}
-
void iic_cause_IPI(int cpu, int mesg)
{
out_be64(&per_cpu(iic, cpu).regs->generate, (0xf - mesg) << 4);
}
-u8 iic_get_target_id(int cpu)
-{
- return per_cpu(iic, cpu).target_id;
-}
-EXPORT_SYMBOL_GPL(iic_get_target_id);
-
struct irq_host *iic_get_irq_host(int node)
{
return iic_host;
}
EXPORT_SYMBOL_GPL(iic_get_irq_host);
-
static irqreturn_t iic_ipi_action(int irq, void *dev_id)
{
int ipi = (int)(long)dev_id;
^ permalink raw reply related
* Re: [PATCH] ucc_geth: add support for netpoll
From: Anton Vorontsov @ 2007-10-27 14:37 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linuxppc-dev, netdev, leoli, linux-kernel
In-Reply-To: <4723389F.7010109@ru.mvista.com>
On Sat, Oct 27, 2007 at 05:09:51PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> Anton Vorontsov wrote:
>
> > This patch adds netpoll support for the QE UCC Gigabit Ethernet
> > driver. The approach is very similar to the gianfar driver.
>
> It's rather contrarywise -- this is standard approach and gianfar with its
> 3 TSEC IRQs has a quite non-standard poll_controller() implementation.
Oh.. well, right -- gianfar a bit more comlex in that regard.
>
> > Tested using netconsole.
>
> KGDBoE is considered a better test (I hope you've also tested with it).
At the time of posting it was tested using netconsole only, a few
days later it's was tested using KGDBoE also. So, it works indeed.
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> > index 18a6f48..06807ce 100644
> > --- a/drivers/net/ucc_geth.c
> > +++ b/drivers/net/ucc_geth.c
> > @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
> > return IRQ_HANDLED;
> > }
> >
> > +#ifdef CONFIG_NET_POLL_CONTROLLER
> > +/*
> > + * Polling 'interrupt' - used by things like netconsole to send skbs
> > + * without having to re-enable interrupts. It's not called while
> > + * the interrupt routine is executing.
> > + */
> > +static void ucc_netpoll(struct net_device *dev)
> > +{
> > + struct ucc_geth_private *ugeth = netdev_priv(dev);
> > +
> > + disable_irq(ugeth->ug_info->uf_info.irq);
> > + ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> > + enable_irq(ugeth->ug_info->uf_info.irq);
>
> Why not make it less complex (for a reader and gcc too :-) ?
Yup, I'm agree here but it's too late. Again. ;-)
This patch already accepted into the -mm (a week or so after the
silence), so.. now I'd rather not bother Andrew with such really
cosmetic changes. But if Jeff would directly apply modfied patch,
I'll send it. ;-)
Anyhow, I'm sincerely appreciate your comments.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] Free when ioremap fails in powerpc/platforms/52xx/mpc52xx_pci.c
From: Roel Kluin @ 2007-10-27 14:11 UTC (permalink / raw)
To: linuxppc-dev
Free hose when ioremap fails
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 4c6c82a..50f9655 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -395,8 +395,10 @@ mpc52xx_add_bridge(struct device_node *node)
hose->ops = &mpc52xx_pci_ops;
pci_regs = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
- if (!pci_regs)
+ if (!pci_regs) {
+ pcibios_free_controller(hose);
return -ENOMEM;
+ }
pci_process_bridge_OF_ranges(hose, node, 1);
^ permalink raw reply related
* [PATCH] allocation fix in ppc/platforms/4xx/luan.c
From: Roel Kluin @ 2007-10-27 14:22 UTC (permalink / raw)
To: linuxppc-dev
Don't allocate hose2 when when hose1 can't be allocated and free hose1 when
hose2 can't be allocated.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c
index 4b16961..b79ebb8 100644
--- a/arch/ppc/platforms/4xx/luan.c
+++ b/arch/ppc/platforms/4xx/luan.c
@@ -230,9 +230,14 @@ luan_setup_hoses(void)
/* Allocate hoses for PCIX1 and PCIX2 */
hose1 = pcibios_alloc_controller();
+ if (!hose1)
+ return;
+
hose2 = pcibios_alloc_controller();
- if (!hose1 || !hose2)
+ if (!hose2) {
+ pcibios_free_controller(hose1);
return;
+ }
/* Setup PCIX1 */
hose1->first_busno = 0;
^ permalink raw reply related
* Re: [PATCH] ucc_geth: add support for netpoll
From: Sergei Shtylyov @ 2007-10-27 13:09 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: netdev, leoli, linux-kernel, linuxppc-dev
In-Reply-To: <20071011124842.GB13963@localhost.localdomain>
Hello.
Anton Vorontsov wrote:
> This patch adds netpoll support for the QE UCC Gigabit Ethernet
> driver. The approach is very similar to the gianfar driver.
It's rather contrarywise -- this is standard approach and gianfar with its
3 TSEC IRQs has a quite non-standard poll_controller() implementation.
> Tested using netconsole.
KGDBoE is considered a better test (I hope you've also tested with it).
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index 18a6f48..06807ce 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
> return IRQ_HANDLED;
> }
>
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +/*
> + * Polling 'interrupt' - used by things like netconsole to send skbs
> + * without having to re-enable interrupts. It's not called while
> + * the interrupt routine is executing.
> + */
> +static void ucc_netpoll(struct net_device *dev)
> +{
> + struct ucc_geth_private *ugeth = netdev_priv(dev);
> +
> + disable_irq(ugeth->ug_info->uf_info.irq);
> + ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> + enable_irq(ugeth->ug_info->uf_info.irq);
Why not make it less complex (for a reader and gcc too :-) ?
struct ucc_geth_private *ugeth = netdev_priv(dev);
int irq = ugeth->ug_info->uf_info.irq;
disable_irq(irq);
ucc_geth_irq_handler(irq, dev);
enable_irq(irq);
> +}
> +#endif /* CONFIG_NET_POLL_CONTROLLER */
> +
> /* Called when something needs to use the ethernet device */
> /* Returns 0 for success. */
> static int ucc_geth_open(struct net_device *dev)
WBR, Sergei
^ permalink raw reply
* Re: arch/powerpc/boot/wrapper broken
From: Michael Buesch @ 2007-10-27 13:01 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20071027165549.3288d76e@kernel.crashing.org>
On Saturday 27 October 2007 14:55:49 Vitaly Bordug wrote:
> On Sat, 27 Oct 2007 14:42:49 +0200
> Michael Buesch wrote:
>
> > It calls the "mkimage" command, which does not exist
> > in my $PATH.
> >
> well, mkImage is a part of u-boot and there was some talk to make it part of kernel too,
> since it does not take alot of place but still mandatory for a number of platforms to work.
>
> I think, Paul will clarify the details, meanwhile you can install mkImage say building u-boot, and
> some distros may have such a package.
>
Ubuntu doesn't seem to, though.
In any case, I think that the name "mkimage" is bad for a tool installed
globally in /usr. Does it make a iso9660 image? (No it doesn't, I know :) )
I'd vote for shipping it with the kernel in /scripts or something like that.
--
Greetings Michael.
^ permalink raw reply
* Re: arch/powerpc/boot/wrapper broken
From: Vitaly Bordug @ 2007-10-27 12:55 UTC (permalink / raw)
To: Michael Buesch; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <200710271442.50158.mb@bu3sch.de>
On Sat, 27 Oct 2007 14:42:49 +0200
Michael Buesch wrote:
> It calls the "mkimage" command, which does not exist
> in my $PATH.
>
well, mkImage is a part of u-boot and there was some talk to make it part of kernel too,
since it does not take alot of place but still mandatory for a number of platforms to work.
I think, Paul will clarify the details, meanwhile you can install mkImage say building u-boot, and
some distros may have such a package.
--
Sincerely, Vitaly
^ permalink raw reply
* arch/powerpc/boot/wrapper broken
From: Michael Buesch @ 2007-10-27 12:42 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
It calls the "mkimage" command, which does not exist
in my $PATH.
--
Greetings Michael.
^ permalink raw reply
* Re: [PATCH] compat_ioctl: fix block device compat ioctl regression
From: Jens Axboe @ 2007-10-27 11:34 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, linuxppc-dev, Geert Uytterhoeven, akpm,
Johannes Berg, Philip Langdale
In-Reply-To: <200710271138.06456.arnd@arndb.de>
On Sat, Oct 27 2007, Arnd Bergmann wrote:
> From: Philip Langdale <philipl@overt.org>
> The conversion of handlers to compat_blkdev_ioctl accidentally
> disabled handling of most ioctl numbers on block devices because
> of a typo. Fix the one line to enable it all again.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>
> Mea Culpa. This should have been found by my testing, as it's clear
> that most of my big patch never worked at all. Sorry for causing
> problems for everyone involved here.
>
> I'm attributing the patch to Philip, as he's the one who pointed
> out to me what the fix is.
Oops, added for swift inclusion.
--
Jens Axboe
^ permalink raw reply
* Re: [PATCH 6/7] mpc83xx: timer driver for PM wakeup
From: Anton Vorontsov @ 2007-10-27 10:46 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, paulus
In-Reply-To: <20071023212502.GE30959@loki.buserror.net>
Hi Scott,
On Tue, Oct 23, 2007 at 04:25:02PM -0500, Scott Wood wrote:
> This is a driver for the mpc83xx's GTM4 timer. It's functionality
> is limited to providing a wakeup source for suspend-to-RAM.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
I think you can use dev_err(&dev->dev
> +static int __devinit gtm_probe(struct of_device *dev,
> + const struct of_device_id *match)
> +{
> + struct device_node *np = dev->node;
> + struct resource res;
> + int ret = 0;
> + u32 busfreq = fsl_get_sys_freq();
> + struct gtm_priv *priv;
> +
> + if (busfreq == 0) {
> + printk(KERN_ERR "gtm: No bus frequency in device tree.\n");
here
> + return -ENODEV;
> + }
> +
> + priv = kmalloc(sizeof(struct gtm_priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + spin_lock_init(&priv->lock);
> + dev_set_drvdata(&dev->dev, priv);
> +
> + ret = of_address_to_resource(np, 0, &res);
> + if (ret)
> + goto out;
> +
> + priv->irq = irq_of_parse_and_map(np, 0);
> + if (priv->irq == NO_IRQ) {
> + printk(KERN_ERR "mpc83xx-gtm exists in device tree "
> + "without an IRQ.\n");
and here.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] compat_ioctl: fix block device compat ioctl regression
From: Arnd Bergmann @ 2007-10-27 9:38 UTC (permalink / raw)
To: akpm, linuxppc-dev, Geert Uytterhoeven, Johannes Berg, Jens Axboe
Cc: linux-kernel, Philip Langdale
In-Reply-To: <47228A9E.80505@overt.org>
From: Philip Langdale <philipl@overt.org>
The conversion of handlers to compat_blkdev_ioctl accidentally
disabled handling of most ioctl numbers on block devices because
of a typo. Fix the one line to enable it all again.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Mea Culpa. This should have been found by my testing, as it's clear
that most of my big patch never worked at all. Sorry for causing
problems for everyone involved here.
I'm attributing the patch to Philip, as he's the one who pointed
out to me what the fix is.
Arnd <><
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -581,7 +581,7 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, struct file *file,
{
int ret;
- switch (arg) {
+ switch (cmd) {
case HDIO_GET_UNMASKINTR:
case HDIO_GET_MULTCOUNT:
case HDIO_GET_KEEPSETTINGS:
^ permalink raw reply
* Re: [PATCH 1/2] PowerPC: Add 44x NDFC device-tree aware support
From: Thomas Gleixner @ 2007-10-27 8:46 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev, linux-mtd
In-Reply-To: <200710270653.32459.sr@denx.de>
On Sat, 27 Oct 2007, Stefan Roese wrote:
> Hi Valentine,
>
> On Friday 26 October 2007, Valentine Barshak wrote:
> > This adds device-tree aware PowerPC 44x NDFC (NAND Flash Controller)
> > driver. The code is based on the original ndfc.c driver by Thomas Gleixner.
> > The major difference is that here we try to handle all chips found as one
> > mtd device instead of having a separate one on each chip.
> > The partition handling code is based on the physmap_of one.
> > The the first 4 bits of the "bank-mask" property show which of the 4 NDFC
> > banks have chips attached. The "bank-width" property is 1 for 8-bit flash
> > and 2 for a 16-bit one.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
>
> Are you sure you have the Signed-off-by from Thomas already on this?
Definitely not.
tglx
^ permalink raw reply
* [PATCH] ppc4xx: mmu_mapin_ram bugfix for booting with mem<16 MB
From: Magnus Hjorth @ 2007-10-27 8:35 UTC (permalink / raw)
To: Grant Likely; +Cc: Linuxppc-embedded
In-Reply-To: <fa686aa40710261254r105530d4u2e95d96948030ed7@mail.gmail.com>
From: Magnus Hjorth <mh@omnisys.se>
This patch (for 2.6.23.1) fixes an unsigned arithmetic bug causing the
kernel to hang when booting with less than 16 MB of memory on ppc4xx.
Signed-off-by: Magnus Hjorth <mh@omnisys.se>
---
OK, trying to do this by the book now...
--- linux-2.6.23.1/arch/ppc/mm/4xx_mmu.c.orig 2007-10-27 10:14:42.000000000 +0200
+++ linux-2.6.23.1/arch/ppc/mm/4xx_mmu.c 2007-10-27 10:15:34.000000000 +0200
@@ -105,7 +105,7 @@ unsigned long __init mmu_mapin_ram(void)
return s;
}
- while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) {
+ while (s + LARGE_PAGE_SIZE_16M <= total_lowmem) {
pmd_t *pmdp;
unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
@@ -120,7 +120,7 @@ unsigned long __init mmu_mapin_ram(void)
s += LARGE_PAGE_SIZE_16M;
}
- while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) {
+ while (s + LARGE_PAGE_SIZE_4M <= total_lowmem) {
pmd_t *pmdp;
unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
^ permalink raw reply
* [PATCH/RFC] powerpc: Pass PID argument to _tlbie (WAS: Apparent kernel bug with GDB on ppc405)
From: Benjamin Herrenschmidt @ 2007-10-27 7:32 UTC (permalink / raw)
To: Matt Mackall; +Cc: linuxppc-dev list, Josh Boyer, Kumar Gala, linuxppc-embedded
In-Reply-To: <1193448653.18243.9.camel@pasglop>
Allright, so Matt, let me know if that fixes your problem with gdb, and
I'll clean the patch up a bit and submit it. I want to double check if
something similar may be needed for freescale booke.
Basically, the problem is that things like get_user_pages() can cause
COW operations which in turn call _tlbie() to be called for translations
that aren't in the current address space.
The current 40x and 44x implementation of _tlbie doesn't handle that
properly as it only invalidates entries in the current PID.
This is an attempt at fixing it. Untested, I just checked it builds for
arch/powerpc and arch/ppc. I also haven't looked whether the freescale
BookE _tlbie needs similar treatement (it will get passed the pid in r4
with that patch, so if it needs to do something with it, it can). Kumar,
can you have a look ?
Index: linux-work/arch/powerpc/mm/fault.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/fault.c 2007-10-27 14:44:05.000000000 +1000
+++ linux-work/arch/powerpc/mm/fault.c 2007-10-27 16:57:50.000000000 +1000
@@ -309,7 +309,7 @@ good_area:
set_bit(PG_arch_1, &page->flags);
}
pte_update(ptep, 0, _PAGE_HWEXEC);
- _tlbie(address);
+ _tlbie(address, mm->context.id);
pte_unmap_unlock(ptep, ptl);
up_read(&mm->mmap_sem);
return 0;
Index: linux-work/include/asm-powerpc/tlbflush.h
===================================================================
--- linux-work.orig/include/asm-powerpc/tlbflush.h 2007-10-27 14:44:19.000000000 +1000
+++ linux-work/include/asm-powerpc/tlbflush.h 2007-10-27 16:57:50.000000000 +1000
@@ -1,5 +1,8 @@
#ifndef _ASM_POWERPC_TLBFLUSH_H
#define _ASM_POWERPC_TLBFLUSH_H
+
+#include <linux/mm.h>
+
/*
* TLB flushing:
*
@@ -16,9 +19,6 @@
*/
#ifdef __KERNEL__
-struct mm_struct;
-struct vm_area_struct;
-
#if defined(CONFIG_4xx) || defined(CONFIG_8xx) || defined(CONFIG_FSL_BOOKE)
/*
* TLB flushing for software loaded TLB chips
@@ -28,7 +28,7 @@ struct vm_area_struct;
* specific tlbie's
*/
-extern void _tlbie(unsigned long address);
+extern void _tlbie(unsigned long address, unsigned int pid);
#if defined(CONFIG_40x) || defined(CONFIG_8xx)
#define _tlbia() asm volatile ("tlbia; sync" : : : "memory")
@@ -44,13 +44,13 @@ static inline void flush_tlb_mm(struct m
static inline void flush_tlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{
- _tlbie(vmaddr);
+ _tlbie(vmaddr, vma->vm_mm->context.id);
}
static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
unsigned long vmaddr)
{
- _tlbie(vmaddr);
+ _tlbie(vmaddr, vma->vm_mm->context.id);
}
static inline void flush_tlb_range(struct vm_area_struct *vma,
Index: linux-work/arch/powerpc/kernel/misc_32.S
===================================================================
--- linux-work.orig/arch/powerpc/kernel/misc_32.S 2007-10-27 16:58:33.000000000 +1000
+++ linux-work/arch/powerpc/kernel/misc_32.S 2007-10-27 17:08:32.000000000 +1000
@@ -288,7 +288,16 @@ _GLOBAL(_tlbia)
*/
_GLOBAL(_tlbie)
#if defined(CONFIG_40x)
+ /* We run the search with interrupts disabled because we have to change
+ * the PID and I don't want to preempt when that happens.
+ */
+ mfmsr r5
+ mfspr r6,SPRN_PID
+ wrteei 0
+ mtspr SPRN_PID,r4
tlbsx. r3, 0, r3
+ mtspr SPRN_PID,r6
+ wrtee r5
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
@@ -297,23 +306,23 @@ _GLOBAL(_tlbie)
tlbwe r3, r3, TLB_TAG
isync
10:
+
#elif defined(CONFIG_44x)
- mfspr r4,SPRN_MMUCR
- mfspr r5,SPRN_PID /* Get PID */
- rlwimi r4,r5,0,24,31 /* Set TID */
+ mfspr r5,SPRN_MMUCR
+ rlwimi r5,r4,0,24,31 /* Set TID */
/* We have to run the search with interrupts disabled, even critical
* and debug interrupts (in fact the only critical exceptions we have
* are debug and machine check). Otherwise an interrupt which causes
* a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
- mfmsr r5
+ mfmsr r4
lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
- andc r6,r5,r6
+ andc r6,r4,r6
mtmsr r6
- mtspr SPRN_MMUCR,r4
+ mtspr SPRN_MMUCR,r5
tlbsx. r3, 0, r3
- mtmsr r5
+ mtmsr r4
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64,
Index: linux-work/arch/powerpc/mm/mmu_decl.h
===================================================================
--- linux-work.orig/arch/powerpc/mm/mmu_decl.h 2007-10-27 17:11:33.000000000 +1000
+++ linux-work/arch/powerpc/mm/mmu_decl.h 2007-10-27 17:11:58.000000000 +1000
@@ -61,12 +61,12 @@ extern unsigned long total_lowmem;
#define mmu_mapin_ram() (0UL)
#elif defined(CONFIG_4xx)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
#elif defined(CONFIG_FSL_BOOKE)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
extern void adjust_total_lowmem(void);
Index: linux-work/arch/ppc/kernel/misc.S
===================================================================
--- linux-work.orig/arch/ppc/kernel/misc.S 2007-10-27 17:15:25.000000000 +1000
+++ linux-work/arch/ppc/kernel/misc.S 2007-10-27 17:15:59.000000000 +1000
@@ -224,7 +224,16 @@ _GLOBAL(_tlbia)
*/
_GLOBAL(_tlbie)
#if defined(CONFIG_40x)
+ /* We run the search with interrupts disabled because we have to change
+ * the PID and I don't want to preempt when that happens.
+ */
+ mfmsr r5
+ mfspr r6,SPRN_PID
+ wrteei 0
+ mtspr SPRN_PID,r4
tlbsx. r3, 0, r3
+ mtspr SPRN_PID,r6
+ wrtee r5
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
@@ -234,22 +243,21 @@ _GLOBAL(_tlbie)
isync
10:
#elif defined(CONFIG_44x)
- mfspr r4,SPRN_MMUCR
- mfspr r5,SPRN_PID /* Get PID */
- rlwimi r4,r5,0,24,31 /* Set TID */
+ mfspr r5,SPRN_MMUCR
+ rlwimi r5,r4,0,24,31 /* Set TID */
/* We have to run the search with interrupts disabled, even critical
* and debug interrupts (in fact the only critical exceptions we have
* are debug and machine check). Otherwise an interrupt which causes
* a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
- mfmsr r5
+ mfmsr r4
lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
- andc r6,r5,r6
+ andc r6,r4,r6
mtmsr r6
- mtspr SPRN_MMUCR,r4
+ mtspr SPRN_MMUCR,r5
tlbsx. r3, 0, r3
- mtmsr r5
+ mtmsr r4
bne 10f
sync
/* There are only 64 TLB entries, so r3 < 64,
Index: linux-work/arch/ppc/mm/fault.c
===================================================================
--- linux-work.orig/arch/ppc/mm/fault.c 2007-10-27 17:14:09.000000000 +1000
+++ linux-work/arch/ppc/mm/fault.c 2007-10-27 17:14:13.000000000 +1000
@@ -227,7 +227,7 @@ good_area:
set_bit(PG_arch_1, &page->flags);
}
pte_update(ptep, 0, _PAGE_HWEXEC);
- _tlbie(address);
+ _tlbie(address, mm->context.id);
pte_unmap_unlock(ptep, ptl);
up_read(&mm->mmap_sem);
return 0;
Index: linux-work/arch/ppc/mm/mmu_decl.h
===================================================================
--- linux-work.orig/arch/ppc/mm/mmu_decl.h 2007-10-27 17:14:43.000000000 +1000
+++ linux-work/arch/ppc/mm/mmu_decl.h 2007-10-27 17:14:54.000000000 +1000
@@ -54,12 +54,12 @@ extern unsigned int num_tlbcam_entries;
#define mmu_mapin_ram() (0UL)
#elif defined(CONFIG_4xx)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
#elif defined(CONFIG_FSL_BOOKE)
-#define flush_HPTE(X, va, pg) _tlbie(va)
+#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(void);
extern void adjust_total_lowmem(void);
Index: linux-work/arch/ppc/platforms/4xx/ebony.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/4xx/ebony.c 2007-10-27 17:13:38.000000000 +1000
+++ linux-work/arch/ppc/platforms/4xx/ebony.c 2007-10-27 17:13:40.000000000 +1000
@@ -236,7 +236,7 @@ ebony_early_serial_map(void)
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
- _tlbie(UART0_IO_BASE);
+ _tlbie(UART0_IO_BASE, 0);
#endif
port.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
Index: linux-work/arch/ppc/platforms/4xx/ocotea.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/4xx/ocotea.c 2007-10-27 17:13:26.000000000 +1000
+++ linux-work/arch/ppc/platforms/4xx/ocotea.c 2007-10-27 17:13:28.000000000 +1000
@@ -259,7 +259,7 @@ ocotea_early_serial_map(void)
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
- _tlbie(UART0_IO_BASE);
+ _tlbie(UART0_IO_BASE, 0);
#endif
port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
Index: linux-work/arch/ppc/platforms/4xx/taishan.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/4xx/taishan.c 2007-10-27 17:13:47.000000000 +1000
+++ linux-work/arch/ppc/platforms/4xx/taishan.c 2007-10-27 17:13:50.000000000 +1000
@@ -316,7 +316,7 @@ taishan_early_serial_map(void)
gen550_init(0, &port);
/* Purge TLB entry added in head_44x.S for early serial access */
- _tlbie(UART0_IO_BASE);
+ _tlbie(UART0_IO_BASE, 0);
#endif
port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox