* Re: [PATCH 3/5] powerpc/86xx: Enable NVRAM on GE Fanuc's SBC610
From: Martyn Welch @ 2009-11-05 14:23 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <DAE90CFA-DC33-4BF6-9381-35B0BC1D45C4@kernel.crashing.org>
Kumar Gala wrote:
>
> On Jul 2, 2009, at 11:12 AM, Martyn Welch wrote:
>
>> This patch enables the NVRAM found on the GE Fanuc SBC610
>>
>> Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
>> ---
>>
>> arch/powerpc/boot/dts/gef_sbc610.dts | 6 ++++++
>> arch/powerpc/configs/86xx/gef_sbc610_defconfig | 4 ++--
>> arch/powerpc/platforms/86xx/Kconfig | 1 +
>> arch/powerpc/platforms/86xx/gef_sbc610.c | 5 +++++
>> 4 files changed, 14 insertions(+), 2 deletions(-)
>
> I assume these still work w/the updates to the other patches?
>
> - k
I'm just updating your tree to ensure that the patches still apply (and
compile) cleanly. I'm fairly confident that they will.
Martyn
--
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748
GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales
Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square,
Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 927559189
^ permalink raw reply
* term_adt746x: Invert bit required on this Powerbook G4
From: Max Vozeler @ 2009-11-04 12:23 UTC (permalink / raw)
To: Michel Dänzer; +Cc: linuxppc-dev
I installed Ubuntu 8.10 on this Powerbook G4 ("alu" I think)
for a friend of mine. As soon as therm_adt746x got loaded, the
fan turned into a noise steam engine.
This was on Ubuntu's 2.6.31 kernel (2.6.31-14-powerpc) which
includes 0512a9a8e277a9de2. I could reproduce it with latest
mainline as well.
The effect was just as Michel described in the changelog; The
fan was running while temps were well below any of the limits,
and it stopped only when I set ridiculously low limits.
[ 1087.141482] adt746x: version 1 (supported)
[ 1087.141495] adt746x: Thermostat bus: 1, address: 0x2e, limit_adjust: 0, fan_speed: -1
[ 1087.141503] sensor 0: HDD BOTTOMSIDE
[ 1087.141507] sensor 1: CPU TOPSIDE
[ 1087.141512] sensor 2: GPU ON DIE
[ 1087.161365] adt746x: ADT7460 initializing
[ 1087.165245] adt746x: Lowering max temperatures from 73, 80, 109 to 70, 50, 70
[ 1087.165261] adt746x: Setting speed to 0 for CPU TOPSIDE fan.
[ 1087.166302] adt746x: Setting speed to 0 for GPU ON DIE fan.
(What "worked" was limit_adjust=-30, fan did turn off, but so did
the Powerbook shortly after, despite being cold.)
After some poking around, in which everything seemed to be
according to plan including write of 0 to both FAN_SPD_SET regs,
I noticed that explicitly *setting* the invert bit as in
- write_reg(th, MANUAL_MODE[fan],
- (manual|MANUAL_MASK) & (~INVERT_MASK));
+ write_reg(th, MANUAL_MODE[fan],
+ (manual|MANUAL_MASK|INVERT_MASK));
seems to cure it. The fan appears to behave normally now, it
turns on slowly when the temp limits are reached, otherwise it
stays off. The temperature is reasonable (ie, no too hot).
So, puzzeled, I checked the spec, and it appears very clear on
the question of invert: It should be off by default.
I'm about to give the laptop back to my friend, but I suppose I
could borrow it for further tests if anyone could guide me how
to dig further into this.
Any hw/openfirmware details interesting?
Max
^ permalink raw reply
* Re: term_adt746x: Invert bit required on this Powerbook G4
From: Max Vozeler @ 2009-11-04 12:39 UTC (permalink / raw)
To: Michel Dänzer; +Cc: linuxppc-dev
In-Reply-To: <20091104122355.GA7269@quark.vpn.nusquama.org>
On Wed, Nov 04, 2009 at 01:23:55PM +0100, Max Vozeler wrote:
> After some poking around, in which everything seemed to be
> according to plan including write of 0 to both FAN_SPD_SET regs,
> I noticed that explicitly *setting* the invert bit as in
>
> - write_reg(th, MANUAL_MODE[fan],
> - (manual|MANUAL_MASK) & (~INVERT_MASK));
> + write_reg(th, MANUAL_MODE[fan],
> + (manual|MANUAL_MASK|INVERT_MASK));
>
> seems to cure it. The fan appears to behave normally now, it
> turns on slowly when the temp limits are reached, otherwise it
> stays off. The temperature is reasonable (ie, no too hot).
>
> So, puzzeled, I checked the spec, and it appears very clear on
> the question of invert: It should be off by default.
Another datapoint:
The PRAM battery in this Powerbook is old, so it forgets e.g.
clock state completely when not connected to the power supply.
These are the PWM1/PWM2 registers during probe_thermostat()
after such a complete poweroff:
[ 28.332700] adt746x: ADT7460 initializing
[ 28.385266] ZZZ MANUAL_MODE[0] 0xd2
[ 28.385832] ZZZ MANUAL_MODE[1] 0x82
So if I'm reading this correctly, PWM1 starts off with the
invert bit (0x10) set, for some reason.
Max
^ permalink raw reply
* Please pull from 'merge' branch for 2.6.32 (updated)
From: Kumar Gala @ 2009-11-05 14:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
( Added defconfig updates )
- k
The following changes since commit 38634e6769920929385f1ffc8820dc3e893cc630:
Benjamin Herrenschmidt (1):
powerpc/kvm: Remove problematic BUILD_BUG_ON statement
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git merge
Anton Vorontsov (2):
powerpc/85xx: Fix USB GPIOs for MPC8569E-MDS boards
powerpc/83xx: Fix u-boot partion size for MPC8377E-WLAN boards
Kim Phillips (1):
powerpc/8xxx: enable IPsec ESP by default on mpc83xx/mpc85xx
Kumar Gala (1):
powerpc: 2.6.32 update of defconfigs for embedded 6xx/7xxx, 8xx, 8{3,5,6}xxx
Paul Gortmaker (1):
powerpc/85xx: sbc8548 - fixup of PCI-e related DTS fields
Roel Kluin (1):
powerpc/82xx: kmalloc failure ignored in ep8248e_mdio_probe()
arch/powerpc/boot/dts/mpc8377_wlan.dts | 2 +-
arch/powerpc/boot/dts/mpc8569mds.dts | 4 +-
arch/powerpc/boot/dts/sbc8548.dts | 17 ++--
arch/powerpc/configs/83xx/asp8347_defconfig | 60 ++++++++-----
arch/powerpc/configs/83xx/kmeter1_defconfig | 46 +++++-----
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig | 73 ++++++++++-----
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig | 76 +++++++++++-----
arch/powerpc/configs/83xx/mpc832x_mds_defconfig | 62 ++++++++-----
arch/powerpc/configs/83xx/mpc832x_rdb_defconfig | 66 +++++++++-----
arch/powerpc/configs/83xx/mpc834x_itx_defconfig | 60 ++++++++-----
arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig | 58 ++++++++-----
arch/powerpc/configs/83xx/mpc834x_mds_defconfig | 58 +++++++-----
arch/powerpc/configs/83xx/mpc836x_mds_defconfig | 64 ++++++++-----
arch/powerpc/configs/83xx/mpc836x_rdk_defconfig | 60 ++++++++-----
arch/powerpc/configs/83xx/mpc837x_mds_defconfig | 64 +++++++++-----
arch/powerpc/configs/83xx/mpc837x_rdb_defconfig | 70 ++++++++++-----
arch/powerpc/configs/83xx/sbc834x_defconfig | 61 ++++++++-----
arch/powerpc/configs/85xx/ksi8560_defconfig | 61 ++++++++-----
arch/powerpc/configs/85xx/mpc8540_ads_defconfig | 57 ++++++++-----
arch/powerpc/configs/85xx/mpc8560_ads_defconfig | 63 +++++++++-----
arch/powerpc/configs/85xx/mpc85xx_cds_defconfig | 58 ++++++++-----
arch/powerpc/configs/85xx/sbc8548_defconfig | 53 +++++++----
arch/powerpc/configs/85xx/sbc8560_defconfig | 57 ++++++++-----
arch/powerpc/configs/85xx/socrates_defconfig | 68 +++++++++-----
arch/powerpc/configs/85xx/stx_gp3_defconfig | 77 +++++++++++-----
arch/powerpc/configs/85xx/tqm8540_defconfig | 59 ++++++++-----
arch/powerpc/configs/85xx/tqm8541_defconfig | 64 +++++++++-----
arch/powerpc/configs/85xx/tqm8548_defconfig | 64 ++++++++-----
arch/powerpc/configs/85xx/tqm8555_defconfig | 64 +++++++++-----
arch/powerpc/configs/85xx/tqm8560_defconfig | 64 +++++++++-----
arch/powerpc/configs/85xx/xes_mpc85xx_defconfig | 76 +++++++++++-----
arch/powerpc/configs/86xx/gef_ppc9a_defconfig | 74 +++++++++++-----
arch/powerpc/configs/86xx/gef_sbc310_defconfig | 72 ++++++++++-----
arch/powerpc/configs/86xx/gef_sbc610_defconfig | 80 +++++++++++------
arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig | 64 ++++++++-----
arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig | 65 +++++++++-----
arch/powerpc/configs/86xx/sbc8641d_defconfig | 66 ++++++++------
arch/powerpc/configs/adder875_defconfig | 48 ++++++----
arch/powerpc/configs/c2k_defconfig | 77 +++++++++++-----
arch/powerpc/configs/ep8248e_defconfig | 49 +++++++----
arch/powerpc/configs/ep88xc_defconfig | 47 ++++++----
arch/powerpc/configs/linkstation_defconfig | 72 ++++++++++-----
arch/powerpc/configs/mgcoge_defconfig | 51 +++++++----
arch/powerpc/configs/mgsuvd_defconfig | 45 ++++++----
arch/powerpc/configs/mpc7448_hpc2_defconfig | 58 ++++++++----
arch/powerpc/configs/mpc8272_ads_defconfig | 52 +++++++----
arch/powerpc/configs/mpc83xx_defconfig | 90 ++++++++++++-------
arch/powerpc/configs/mpc85xx_defconfig | 98 +++++++++++++--------
arch/powerpc/configs/mpc85xx_smp_defconfig | 99 +++++++++++++--------
arch/powerpc/configs/mpc866_ads_defconfig | 54 +++++++-----
arch/powerpc/configs/mpc86xx_defconfig | 70 ++++++++++-----
arch/powerpc/configs/mpc885_ads_defconfig | 47 ++++++----
arch/powerpc/configs/pq2fads_defconfig | 55 ++++++++----
arch/powerpc/configs/prpmc2800_defconfig | 67 +++++++++-----
arch/powerpc/configs/storcenter_defconfig | 54 +++++++-----
arch/powerpc/platforms/82xx/ep8248e.c | 15 +++-
56 files changed, 2142 insertions(+), 1213 deletions(-)
^ permalink raw reply
* Re: [PATCH RFC] gianfar: Make polling safe with IRQs disabled
From: Jon Loeliger @ 2009-11-05 14:01 UTC (permalink / raw)
To: Anton Vorontsov
Cc: linuxppc-dev, Jason Wessel, Andy Fleming, David Miller, netdev
In-Reply-To: <20091104225711.GA30844@oksana.dev.rtsoft.ru>
> When using KGDBoE, gianfar driver spits 'Interrupt problem' messages,
> which appears to be a legitimate warning, i.e. we may end up calling
> netif_receive_skb() or vlan_hwaccel_receive_skb() with IRQs disabled.
>
> This patch reworks the RX path so that if netpoll is enabled (the
> only case when the driver don't know from what context the polling
> may be called), we check whether IRQs are disabled, and if so we
> fall back to safe variants of skb receiving functions.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>
> I'm not sure if this is suitable for mainline since it doesn't
> have KGDBoE support. Jason, if the patch is OK, would you like
> to merge it into KGDB tree?
It's a legitimate problem with or without KGDBoE. I see it
occasionally when conn_track is enabled as well, for example.
jdl
^ permalink raw reply
* Re: [PATCH RFC] gianfar: Make polling safe with IRQs disabled
From: Jon Loeliger @ 2009-11-05 14:41 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, Jason Wessel, Andy Fleming, David Miller, netdev
In-Reply-To: <20091105142028.GB17171@oksana.dev.rtsoft.ru>
>
> Hm, then I'd better remove the #ifdef CONFIG_NETPOLL.
>
> Interestingly though, why conn_track does the polling with irqs
> disabled, could be a bug in the conn_track? Because pretty much
> drivers assume that polling is called with IRQs enabled.
>
> If it's easily reproducible, could you replace the printk() with
> WARN_ON(1) and post the backtrace? Or I can try to reproduce the
> issue if you tell me how.
>
> Thanks!
Yeah, I can reproduce it. I'll try and get that for you.
jdl
^ permalink raw reply
* Re: [PATCH 3/5] powerpc/86xx: Enable NVRAM on GE Fanuc's SBC610
From: Kumar Gala @ 2009-11-05 14:41 UTC (permalink / raw)
To: Martyn Welch; +Cc: linuxppc-dev
In-Reply-To: <4AF2DFC4.80307@gefanuc.com>
On Nov 5, 2009, at 8:23 AM, Martyn Welch wrote:
> Kumar Gala wrote:
>>
>> On Jul 2, 2009, at 11:12 AM, Martyn Welch wrote:
>>
>>> This patch enables the NVRAM found on the GE Fanuc SBC610
>>>
>>> Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
>>> ---
>>>
>>> arch/powerpc/boot/dts/gef_sbc610.dts | 6 ++++++
>>> arch/powerpc/configs/86xx/gef_sbc610_defconfig | 4 ++--
>>> arch/powerpc/platforms/86xx/Kconfig | 1 +
>>> arch/powerpc/platforms/86xx/gef_sbc610.c | 5 +++++
>>> 4 files changed, 14 insertions(+), 2 deletions(-)
>>
>> I assume these still work w/the updates to the other patches?
>>
>> - k
> I'm just updating your tree to ensure that the patches still apply
> (and compile) cleanly. I'm fairly confident that they will.
looks like I'm getting some defconfig merge conflicts. I'll deal with
them but will apply these after defconfig updates make it into benh's
next tree.
- k
^ permalink raw reply
* Re: System hangs when exceeding a certain initramfs size
From: Lee Nipper @ 2009-11-05 14:42 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <29DC34A6B43468409F5A371CFE34E849F9AFBA@ex01.ads.ubidyne.de>
On Thu, Nov 5, 2009 at 04:02, Frank Prepelica
<Frank.Prepelica@ubidyne.com> wrote:
>
> I experience the issue when the kernel image (including the initramfs)
> exceeds a
> certain size (>6MB) that after unpacking the kernel the systems hangs
> at:
>
> bootm 2000000 - 3000000
> ## Booting image at 02000000 ...
> =A0 Image Name: =A0 Linux-2.6.29
> =A0 Created: =A0 =A0 =A02009-11-04 =A014:25:01 UTC
> =A0 Image Type: =A0 PowerPC Linux Kernel Image (gzip compressed)
> =A0 Data Size: =A0 =A06798037 Bytes =3D =A06.5 MB
> =A0 Load Address: 00000000
> =A0 Entry Point: =A000000000
> =A0 Verifying Checksum ... OK
> =A0 Uncompressing Kernel Image ... OK
> =A0 Booting using the fdt at 0x3000000
> =A0 Loading Device Tree to 00ffc000, end 00ffefff ... OK
>
>
> I've found some hints regarding this problem (load_address in the
> wrapper script)
> but this doesn't works for me.
>
> I'm using Kernel v2.6.29 and U-Boot v1.3.0 on a customized MPC8313ERDB
> board
>
I think it's possibly because the expansion of the compressed image
extends into the region where u-boot puts the device tree (0x00FFC000).
I remember seeing this situation with 2.6.31 when using a large initramfs.
If this _is_ this case, it would be useful if there were a way to
protect against clobbering a loaded device tree with kernel/initramfs.
ln
^ permalink raw reply
* Re: [PATCH 0/2] Setting GPIOs simultaneously
From: Kumar Gala @ 2009-11-05 14:49 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, David Brownell, linux-kernel
In-Reply-To: <20090713151911.GA28114@oksana.dev.rtsoft.ru>
On Jul 13, 2009, at 10:19 AM, Anton Vorontsov wrote:
> Hi all,
>
> I've been sitting on these patches for some time, but now it appears
> that the set_sync() feature is needed elsewhere. So here are the
> patches.
>
> Joakim, I think this is what you need.
>
> Thanks,
What this resolved or dropped?
- k
^ permalink raw reply
* Re: [PATCH 3/5] powerpc/86xx: Enable NVRAM on GE Fanuc's SBC610
From: Martyn Welch @ 2009-11-05 14:53 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <E79EA452-7A7B-4496-ACC8-9B4EF45E8D1A@kernel.crashing.org>
Kumar Gala wrote:
>
> On Nov 5, 2009, at 8:23 AM, Martyn Welch wrote:
>
>> Kumar Gala wrote:
>>>
>>> On Jul 2, 2009, at 11:12 AM, Martyn Welch wrote:
>>>
>>>> This patch enables the NVRAM found on the GE Fanuc SBC610
>>>>
>>>> Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
>>>> ---
>>>>
>>>> arch/powerpc/boot/dts/gef_sbc610.dts | 6 ++++++
>>>> arch/powerpc/configs/86xx/gef_sbc610_defconfig | 4 ++--
>>>> arch/powerpc/platforms/86xx/Kconfig | 1 +
>>>> arch/powerpc/platforms/86xx/gef_sbc610.c | 5 +++++
>>>> 4 files changed, 14 insertions(+), 2 deletions(-)
>>>
>>> I assume these still work w/the updates to the other patches?
>>>
>>> - k
>> I'm just updating your tree to ensure that the patches still apply
>> (and compile) cleanly. I'm fairly confident that they will.
>
> looks like I'm getting some defconfig merge conflicts. I'll deal with
> them but will apply these after defconfig updates make it into benh's
> next tree.
>
> - k
The patches are sitting in stgit here - I noticed the offset of the
defconfig changes was different, but didn't notice anything else
different. I can resend if that's easier?
Martyn
--
Martyn Welch MEng MPhil MIET (Principal Software Engineer) T:+44(0)1327322748
GE Fanuc Intelligent Platforms Ltd, |Registered in England and Wales
Tove Valley Business Park, Towcester, |(3828642) at 100 Barbirolli Square,
Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB VAT:GB 927559189
^ permalink raw reply
* Re: [PATCH 1/3] powerpc/83xx/suspend: Clear deep_sleeping after devices resume
From: Kumar Gala @ 2009-11-05 14:57 UTC (permalink / raw)
To: Scott Wood; +Cc: linux-ppc list
In-Reply-To: <20090923190113.GA19932@oksana.dev.rtsoft.ru>
On Sep 23, 2009, at 2:01 PM, Anton Vorontsov wrote:
> Currently 83xx PMC driver clears deep_sleeping variable very early,
> before devices are resumed. This makes fsl_deep_sleep() unusable in
> drivers' resume() callback.
>
> Sure, drivers can store fsl_deep_sleep() value on suspend and use
> the stored value on resume. But a better solution is to postpone
> clearing the deep_sleeping variable, i.e. move it into finish()
> callback.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/platforms/83xx/suspend.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
Scott, any comments or an ack?
- k
^ permalink raw reply
* Re: [PATCH 0/2] Setting GPIOs simultaneously
From: Anton Vorontsov @ 2009-11-05 14:58 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, David Brownell, linux-kernel
In-Reply-To: <AB7471E8-F924-418B-83A3-2DC48CC707CA@kernel.crashing.org>
On Thu, Nov 05, 2009 at 08:49:38AM -0600, Kumar Gala wrote:
>
> On Jul 13, 2009, at 10:19 AM, Anton Vorontsov wrote:
>
> >Hi all,
> >
> >I've been sitting on these patches for some time, but now it appears
> >that the set_sync() feature is needed elsewhere. So here are the
> >patches.
> >
> >Joakim, I think this is what you need.
> >
> >Thanks,
>
> What this resolved or dropped?
That was something like an RFC. There are no mainline users for
this support (yet), so we can drop it for now.
Thanks,
p.s.
As David didn't comment on the patches, I'd assume there are no
strong objections against this feature if we'll want to mainline
the support in future. ;-)
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH 1/3] powerpc/fsl: Make fsl_deep_sleep() usable w/ modules and non-83xx builds
From: Kumar Gala @ 2009-11-05 14:58 UTC (permalink / raw)
To: Anton Vorontsov
Cc: linux-usb, Jerry Huang, Greg Kroah-Hartman, linuxppc-dev,
Scott Wood
In-Reply-To: <20090923185238.GA18755@oksana.dev.rtsoft.ru>
On Sep 23, 2009, at 1:52 PM, Anton Vorontsov wrote:
> Export is needed for modular builds, and a static inline stub is
> needed
> for non-MPC83xx builds.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/platforms/83xx/suspend.c | 1 +
> include/linux/fsl_devices.h | 4 ++++
> 2 files changed, 5 insertions(+), 0 deletions(-)
applied to next
- k
^ permalink raw reply
* Re: [PATCH] sata_fsl: Split hard and soft reset
From: Kumar Gala @ 2009-11-05 15:02 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide, linux-ppc list, Ashish Kalra, Jiang Yutang
In-Reply-To: <20091016164436.GA12897@oksana.dev.rtsoft.ru>
On Oct 16, 2009, at 11:44 AM, Anton Vorontsov wrote:
> From: Jiang Yutang <b14898@freescale.com>
>
> Split sata_fsl_softreset() into hard and soft resets to make
> error-handling more efficient & device and PMP detection more
> reliable.
>
> Also includes fix for PMP support, driver tested with Sil3726,
> Sil4726 & Exar PMP controllers.
>
> [AV: Also fixes resuming from deep sleep on MPC8315 CPUs]
>
> Signed-off-by: Jiang Yutang <b14898@freescale.com>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> drivers/ata/sata_fsl.c | 84 ++++++++++++++++++++++++
> +-----------------------
> 1 files changed, 44 insertions(+), 40 deletions(-)
Jeff,
any update on this going in for .32?
- k
^ permalink raw reply
* [PATCH] powerpc/85xx: Kconfig cleanup
From: Kumar Gala @ 2009-11-05 15:16 UTC (permalink / raw)
To: linuxppc-dev
Introduce new FSL_SOC_BOOKE Kconfig to handle both 85xx and QorIQ
based chips.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/85xx/Kconfig | 11 ++++++-----
arch/powerpc/platforms/Kconfig | 2 +-
arch/powerpc/platforms/Kconfig.cputype | 17 ++++++++---------
arch/powerpc/platforms/Makefile | 2 +-
arch/powerpc/sysdev/fsl_pci.c | 4 ++--
arch/powerpc/sysdev/fsl_soc.c | 2 +-
6 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index d3a975e..5de0d63 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -1,6 +1,7 @@
-menuconfig MPC85xx
- bool "Machine Type"
- depends on PPC_85xx
+menuconfig FSL_SOC_BOOKE
+ bool "Freescale Book-E Machine Type"
+ depends on PPC_85xx || PPC_BOOK3E
+ select FSL_SOC
select PPC_UDBG_16550
select MPIC
select PPC_PCI_CHOICE
@@ -8,7 +9,7 @@ menuconfig MPC85xx
select SERIAL_8250_SHARE_IRQ if SERIAL_8250
default y
-if MPC85xx
+if FSL_SOC_BOOKE
config MPC8540_ADS
bool "Freescale MPC8540 ADS"
@@ -144,7 +145,7 @@ config SBC8560
help
This option enables support for the Wind River SBC8560 board
-endif # MPC85xx
+endif # FSL_SOC_BOOKE
config TQM85xx
bool
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 56bf126..11c0852 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -260,7 +260,7 @@ config QE_GPIO
config CPM2
bool "Enable support for the CPM2 (Communications Processor Module)"
- depends on MPC85xx || 8260
+ depends on (FSL_SOC_BOOKE && PPC32) || 8260
select CPM
select PPC_LIB_RHEAP
select PPC_PCI_CHOICE
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index e382cae..2eab27a 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -28,8 +28,6 @@ config PPC_BOOK3S_32
config PPC_85xx
bool "Freescale 85xx"
select E500
- select FSL_SOC
- select MPC85xx
config PPC_8xx
bool "Freescale 8xx"
@@ -138,6 +136,14 @@ config PPC_FPU
bool
default y if PPC64
+config FSL_EMB_PERFMON
+ bool "Freescale Embedded Perfmon"
+ depends on E500 || PPC_83xx
+ help
+ This is the Performance Monitor support found on the e500 core
+ and some e300 cores (c3 and c4). Select this only if your
+ core supports the Embedded Performance Monitor APU
+
config 4xx
bool
depends on 40x || 44x
@@ -153,13 +159,6 @@ config FSL_BOOKE
depends on E200 || E500
default y
-config FSL_EMB_PERFMON
- bool "Freescale Embedded Perfmon"
- depends on E500 || PPC_83xx
- help
- This is the Performance Monitor support found on the e500 core
- and some e300 cores (c3 and c4). Select this only if your
- core supports the Embedded Performance Monitor APU
config PTE_64BIT
bool
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index a6812ee..fdb9f0b 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_PPC_MPC52xx) += 52xx/
obj-$(CONFIG_PPC_8xx) += 8xx/
obj-$(CONFIG_PPC_82xx) += 82xx/
obj-$(CONFIG_PPC_83xx) += 83xx/
-obj-$(CONFIG_PPC_85xx) += 85xx/
+obj-$(CONFIG_FSL_SOC_BOOKE) += 85xx/
obj-$(CONFIG_PPC_86xx) += 86xx/
obj-$(CONFIG_PPC_PSERIES) += pseries/
obj-$(CONFIG_PPC_ISERIES) += iseries/
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index ae88b14..cf57a42 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -56,7 +56,7 @@ static int __init fsl_pcie_check_link(struct pci_controller *hose)
return 0;
}
-#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
+#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
unsigned int index, const struct resource *res,
resource_size_t offset)
@@ -394,7 +394,7 @@ DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_header);
DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header);
DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020E, quirk_fsl_pcie_header);
DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020, quirk_fsl_pcie_header);
-#endif /* CONFIG_PPC_85xx || CONFIG_PPC_86xx */
+#endif /* CONFIG_FSL_SOC_BOOKE || CONFIG_PPC_86xx */
#if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x)
DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8314E, quirk_fsl_pcie_header);
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index adca4af..b91f7ac 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -372,7 +372,7 @@ err:
arch_initcall(fsl_usb_of_init);
-#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
+#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
static __be32 __iomem *rstcr;
static int __init setup_rstcr(void)
--
1.6.0.6
^ permalink raw reply related
* [PATCH] powerpc/fsl-booke: Rework TLB CAM code
From: Kumar Gala @ 2009-11-05 15:21 UTC (permalink / raw)
To: linuxppc-dev
Re-write the code so its more standalone and fixed some issues:
* Bump'd # of CAM entries to 64 to support e500mc
* Make the code handle MAS7 properly
* Use pr_cont instead of creating a string as we go
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/kernel/asm-offsets.c | 3 -
arch/powerpc/kernel/head_fsl_booke.S | 22 ------
arch/powerpc/mm/fsl_booke_mmu.c | 132 +++++++++++++++++++---------------
arch/powerpc/mm/mmu_decl.h | 11 ---
4 files changed, 74 insertions(+), 94 deletions(-)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index e2e2082..a6c2b63 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -421,9 +421,6 @@ int main(void)
DEFINE(PGD_T_LOG2, PGD_T_LOG2);
DEFINE(PTE_T_LOG2, PTE_T_LOG2);
#endif
-#ifdef CONFIG_FSL_BOOKE
- DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam));
-#endif
#ifdef CONFIG_KVM_EXIT_TIMING
DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 975788c..7f4bd7f 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -944,28 +944,6 @@ _GLOBAL(__setup_e500mc_ivors)
blr
/*
- * extern void loadcam_entry(unsigned int index)
- *
- * Load TLBCAM[index] entry in to the L2 CAM MMU
- */
-_GLOBAL(loadcam_entry)
- lis r4,TLBCAM@ha
- addi r4,r4,TLBCAM@l
- mulli r5,r3,TLBCAM_SIZE
- add r3,r5,r4
- lwz r4,0(r3)
- mtspr SPRN_MAS0,r4
- lwz r4,4(r3)
- mtspr SPRN_MAS1,r4
- lwz r4,8(r3)
- mtspr SPRN_MAS2,r4
- lwz r4,12(r3)
- mtspr SPRN_MAS3,r4
- tlbwe
- isync
- blr
-
-/*
* extern void giveup_altivec(struct task_struct *prev)
*
* The e500 core does not have an AltiVec unit.
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index dc93e95..b8fac4f 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -54,26 +54,35 @@
#include "mmu_decl.h"
-extern void loadcam_entry(unsigned int index);
unsigned int tlbcam_index;
-static unsigned long cam[CONFIG_LOWMEM_CAM_NUM];
-#define NUM_TLBCAMS (16)
+#define NUM_TLBCAMS (64)
#if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS)
#error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS"
#endif
-struct tlbcam TLBCAM[NUM_TLBCAMS];
+struct tlbcam {
+ u32 MAS0;
+ u32 MAS1;
+ unsigned long MAS2;
+ u32 MAS3;
+ u32 MAS7;
+} TLBCAM[NUM_TLBCAMS];
struct tlbcamrange {
- unsigned long start;
+ unsigned long start;
unsigned long limit;
phys_addr_t phys;
} tlbcam_addrs[NUM_TLBCAMS];
extern unsigned int tlbcam_index;
+unsigned long tlbcam_sz(int idx)
+{
+ return tlbcam_addrs[idx].limit - tlbcam_addrs[idx].start + 1;
+}
+
/*
* Return PA for this VA if it is mapped by a CAM, or 0
*/
@@ -94,23 +103,36 @@ unsigned long p_mapped_by_tlbcam(phys_addr_t pa)
int b;
for (b = 0; b < tlbcam_index; ++b)
if (pa >= tlbcam_addrs[b].phys
- && pa < (tlbcam_addrs[b].limit-tlbcam_addrs[b].start)
+ && pa < (tlbcam_addrs[b].limit-tlbcam_addrs[b].start)
+tlbcam_addrs[b].phys)
return tlbcam_addrs[b].start+(pa-tlbcam_addrs[b].phys);
return 0;
}
+void loadcam_entry(int idx)
+{
+ mtspr(SPRN_MAS0, TLBCAM[idx].MAS0);
+ mtspr(SPRN_MAS1, TLBCAM[idx].MAS1);
+ mtspr(SPRN_MAS2, TLBCAM[idx].MAS2);
+ mtspr(SPRN_MAS3, TLBCAM[idx].MAS3);
+
+ if (cur_cpu_spec->cpu_features & MMU_FTR_BIG_PHYS)
+ mtspr(SPRN_MAS7, TLBCAM[idx].MAS7);
+
+ asm volatile("isync;tlbwe;isync" : : : "memory");
+}
+
/*
* Set up one of the I/D BAT (block address translation) register pairs.
* The parameters are not checked; in particular size must be a power
* of 4 between 4k and 256M.
*/
-void settlbcam(int index, unsigned long virt, phys_addr_t phys,
- unsigned int size, int flags, unsigned int pid)
+static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
+ unsigned long size, unsigned long flags, unsigned int pid)
{
unsigned int tsize, lz;
- asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size));
+ asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (size));
tsize = 21 - lz;
#ifdef CONFIG_SMP
@@ -128,8 +150,10 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys,
TLBCAM[index].MAS2 |= (flags & _PAGE_GUARDED) ? MAS2_G : 0;
TLBCAM[index].MAS2 |= (flags & _PAGE_ENDIAN) ? MAS2_E : 0;
- TLBCAM[index].MAS3 = (phys & PAGE_MASK) | MAS3_SX | MAS3_SR;
+ TLBCAM[index].MAS3 = (phys & MAS3_RPN) | MAS3_SX | MAS3_SR;
TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_SW : 0);
+ if (cur_cpu_spec->cpu_features & MMU_FTR_BIG_PHYS)
+ TLBCAM[index].MAS7 = phys >> 32;
#ifndef CONFIG_KGDB /* want user access for breakpoints */
if (flags & _PAGE_USER) {
@@ -148,27 +172,44 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys,
loadcam_entry(index);
}
-void invalidate_tlbcam_entry(int index)
-{
- TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index);
- TLBCAM[index].MAS1 = ~MAS1_VALID;
-
- loadcam_entry(index);
-}
-
-unsigned long __init mmu_mapin_ram(void)
+unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx)
{
+ int i;
unsigned long virt = PAGE_OFFSET;
phys_addr_t phys = memstart_addr;
+ unsigned long amount_mapped = 0;
+ unsigned long max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xf;
+
+ /* Convert (4^max) kB to (2^max) bytes */
+ max_cam = max_cam * 2 + 10;
- while (tlbcam_index < ARRAY_SIZE(cam) && cam[tlbcam_index]) {
- settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0);
- virt += cam[tlbcam_index];
- phys += cam[tlbcam_index];
- tlbcam_index++;
+ /* Calculate CAM values */
+ for (i = 0; ram && i < max_cam_idx; i++) {
+ unsigned int camsize = __ilog2(ram) & ~1U;
+ unsigned int align = __ffs(virt | phys) & ~1U;
+ unsigned long cam_sz;
+
+ if (camsize > align)
+ camsize = align;
+ if (camsize > max_cam)
+ camsize = max_cam;
+
+ cam_sz = 1UL << camsize;
+ settlbcam(i, virt, phys, cam_sz, PAGE_KERNEL_X, 0);
+
+ ram -= cam_sz;
+ amount_mapped += cam_sz;
+ virt += cam_sz;
+ phys += cam_sz;
}
+ tlbcam_index = i;
+
+ return amount_mapped;
+}
- return virt - PAGE_OFFSET;
+unsigned long __init mmu_mapin_ram(void)
+{
+ return tlbcam_addrs[tlbcam_index - 1].limit - PAGE_OFFSET + 1;
}
/*
@@ -179,46 +220,21 @@ void __init MMU_init_hw(void)
flush_instruction_cache();
}
-void __init
-adjust_total_lowmem(void)
+void __init adjust_total_lowmem(void)
{
- phys_addr_t ram;
- unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xff;
- char buf[ARRAY_SIZE(cam) * 5 + 1], *p = buf;
+ unsigned long ram;
int i;
- unsigned long virt = PAGE_OFFSET & 0xffffffffUL;
- unsigned long phys = memstart_addr & 0xffffffffUL;
-
- /* Convert (4^max) kB to (2^max) bytes */
- max_cam = max_cam * 2 + 10;
/* adjust lowmem size to __max_low_memory */
ram = min((phys_addr_t)__max_low_memory, (phys_addr_t)total_lowmem);
- /* Calculate CAM values */
- __max_low_memory = 0;
- for (i = 0; ram && i < ARRAY_SIZE(cam); i++) {
- unsigned int camsize = __ilog2(ram) & ~1U;
- unsigned int align = __ffs(virt | phys) & ~1U;
+ __max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM);
- if (camsize > align)
- camsize = align;
- if (camsize > max_cam)
- camsize = max_cam;
-
- cam[i] = 1UL << camsize;
- ram -= cam[i];
- __max_low_memory += cam[i];
- virt += cam[i];
- phys += cam[i];
-
- p += sprintf(p, "%lu/", cam[i] >> 20);
- }
- for (; i < ARRAY_SIZE(cam); i++)
- p += sprintf(p, "0/");
- p[-1] = '\0';
-
- pr_info("Memory CAM mapping: %s Mb, residual: %dMb\n", buf,
+ pr_info("Memory CAM mapping: ");
+ for (i = 0; i < tlbcam_index - 1; i++)
+ pr_cont("%lu/", tlbcam_sz(i) >> 20);
+ pr_cont("%lu Mb, residual: %dMb\n", tlbcam_sz(tlbcam_index - 1) >> 20,
(unsigned int)((total_lowmem - __max_low_memory) >> 20));
+
__initial_memory_limit_addr = memstart_addr + __max_low_memory;
}
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index d2e5321..e27a990 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -98,21 +98,10 @@ extern void _tlbia(void);
#ifdef CONFIG_PPC32
-struct tlbcam {
- u32 MAS0;
- u32 MAS1;
- u32 MAS2;
- u32 MAS3;
- u32 MAS7;
-};
-
extern void mapin_ram(void);
extern int map_page(unsigned long va, phys_addr_t pa, int flags);
extern void setbat(int index, unsigned long virt, phys_addr_t phys,
unsigned int size, int flags);
-extern void settlbcam(int index, unsigned long virt, phys_addr_t phys,
- unsigned int size, int flags, unsigned int pid);
-extern void invalidate_tlbcam_entry(int index);
extern int __map_without_bats;
extern unsigned long ioremap_base;
--
1.6.0.6
^ permalink raw reply related
* Re: [PATCH RFC] gianfar: Make polling safe with IRQs disabled
From: Jon Loeliger @ 2009-11-05 15:43 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, netdev, Andy Fleming, David Miller, Jason Wessel
In-Reply-To: <E1N63WM-0003xK-PN@jdl.com>
> >
> > If it's easily reproducible, could you replace the printk() with
> > WARN_ON(1) and post the backtrace? Or I can try to reproduce the
> > issue if you tell me how.
> >
> > Thanks!
>
> Yeah, I can reproduce it. I'll try and get that for you.
>
> jdl
This is with essentially a stock 2.6.31 kernel for an 8315.
I've seen the problem for both task 'insmod' and 'iptables'.
Um, conn_track is a module being loaded here. Our brief analysis
runs like this:
This is an issue with the gianfar driver. In gfar_poll(), irqs are
disabled for the handling of gfar_clean_tx_ring(dev) (line 1928).
In this call, skbs can call skb_recycle_check, which can release
head state (net/core/skbuff.c@506), which can cause conntrack
cleanup (net/core/skbuff.c@402->include/linux/skbuff.h@1923), which
cannot be done with IRQs disabled...that is the badness.
HTH,
jdl
[ 34.775619] nf_conntrack version 0.5.0 (1008 buckets, 4032 max)
[ 34.963135] ------------[ cut here ]------------
[ 34.967804] Badness at kernel/softirq.c:143
[ 34.972016] NIP: c003e3c4 LR: c423a528 CTR: c003e344
[ 34.977018] REGS: c15d1ab0 TRAP: 0700 Not tainted (2.6.31-xeno)
[ 34.983236] MSR: 00021032 <ME,CE,IR,DR> CR: 24000284 XER: 20000000
[ 34.989689] TASK = c343a060[977] 'insmod' THREAD: c15d0000
[ 34.995032] GPR00: 00000001 c15d1b60 c343a060 00000001 000000a4 00000052 00000001 00000000
[ 35.003501] GPR08: 00000101 c0450000 c3572d20 c003e344 24000282 100c5288 00000001 00000040
[ 35.011971] GPR16: c2e5c2f0 00009032 c2e5c2c0 c2e5c000 00000100 00000000 c2e5c340 00000098
[ 35.020440] GPR24: 00000260 c2428760 00000800 c153b800 00000000 c1018c98 c15d0000 c15d1b60
[ 35.029120] NIP [c003e3c4] local_bh_enable+0x80/0xc4
[ 35.034174] LR [c423a528] destroy_conntrack+0xd4/0x13c [nf_conntrack]
[ 35.040652] Call Trace:
[ 35.043128] [c15d1b60] [c003e32c] local_bh_disable+0x1c/0x34 (unreliable)
[ 35.050001] [c15d1b70] [c423a528] destroy_conntrack+0xd4/0x13c [nf_conntrack]
[ 35.057205] [c15d1b80] [c02c6370] nf_conntrack_destroy+0x3c/0x70
[ 35.063263] --- Exception: c428168c at 0xc15d1c50
[ 35.063272] LR = 0xc15d1c40
[ 35.071165] [c15d1ba0] [c0286f3c] skb_release_head_state+0x100/0x104 (unreliable)
[ 35.078718] [c15d1bb0] [c0288340] skb_recycle_check+0x8c/0x10c
[ 35.084611] [c15d1bc0] [c01e1688] gfar_poll+0x190/0x384
[ 35.089887] [c15d1c10] [c02935ac] net_rx_action+0xec/0x22c
[ 35.095432] [c15d1c50] [c003dd8c] __do_softirq+0xe8/0x224
[ 35.100885] [c15d1ca0] [c000624c] do_softirq+0x78/0x80
[ 35.106071] [c15d1cb0] [c003d868] irq_exit+0x60/0x78
[ 35.111082] [c15d1cc0] [c0006714] do_IRQ+0x98/0xb0
[ 35.115921] [c15d1ce0] [c0014af8] ret_from_except+0x0/0x14
[ 35.121474] --- Exception: 501 at strcmp+0xc/0x24
[ 35.121483] LR = find_symbol_in_section+0x38/0xc0
[ 35.131285] [c15d1da0] [00000000] (null) (unreliable)
[ 35.136390] [c15d1dc0] [c0064e08] each_symbol_in_section+0x7c/0xb4
[ 35.142623] [c15d1df0] [c0065340] each_symbol+0x34/0x148
[ 35.147983] [c15d1e70] [c0065488] find_symbol+0x34/0x78
[ 35.153257] [c15d1ea0] [c00681d8] load_module+0x8e4/0x12ec
[ 35.158792] [c15d1f20] [c0068c60] sys_init_module+0x80/0x208
[ 35.164501] [c15d1f40] [c0014460] ret_from_syscall+0x0/0x38
[ 35.170124] --- Exception: c01 at 0xfea6a8c
[ 35.170132] LR = 0x10016dcc
[ 35.177485] Instruction dump:
[ 35.180477] 70090004 40820068 81610000 800b0004 bbcbfff8 7d615b78 7c0803a6 4e800020
[ 35.188332] 3d20c045 8009b3c0 7c000034 5400d97e <0f000000> 2f800000 419effa8 38000001
^ permalink raw reply
* Re: [PATCH] [SCSI] mpt fusion: Fix 32 bit platforms with 64 bit resources.
From: James Bottomley @ 2009-11-05 16:07 UTC (permalink / raw)
To: Josh Boyer; +Cc: Eric.Moore, pbathija, linux-scsi, linuxppc-dev
In-Reply-To: <20091105134330.GA30489@zod.rchland.ibm.com>
On Thu, 2009-11-05 at 08:43 -0500, Josh Boyer wrote:
> On Tue, Sep 15, 2009 at 03:25:55PM -0700, pbathija@amcc.com wrote:
> >From: Pravin Bathija <pbathija@amcc.com>
> >
> >Powerpc 44x uses 36 bit real address while the real address defined
> >in MPT Fusion driver is of type 32 bit. This causes ioremap to fail and driver
> >fails to initialize. This fix changes the data types representing the real
> >address from unsigned long 32-bit types to "phys_addr_t" which is 64-bit. The
> >driver has been tested, the disks get discovered correctly and can do IO. Also,
> >replaced phys_addr_t with resource_size_t as suggested by Ben.
> >
> >Signed-off-by: Pravin Bathija <pbathija@amcc.com>
> >Acked-by: Feng Kan <fkan@amcc.com>
> >Acked-by: Prodyut Hazarika <phazarika@amcc.com>
> >Acked-by: Loc Ho <lho@amcc.com>
> >Acked-by: Tirumala Reddy Marri <tmarri@amcc.com>
> >Acked-by: Victor Gallardo <vgallardo@amcc.com>
>
> Is this patch included in the scsi tree at all? I can't seem to find it in
> linux-next and I know it's not in the powerpc tree. Are there further changes
> needed, or has it simply been missed?
What was the feedback from LSI ... I haven't seen any here?
> josh
>
> >
> >---
> > drivers/message/fusion/mptbase.c | 34 +++++++++++++++++++++++++---------
> > drivers/message/fusion/mptbase.h | 5 +++--
> > 2 files changed, 28 insertions(+), 11 deletions(-)
> >
> >diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
> >index 5d496a9..e296f2e 100644
> >--- a/drivers/message/fusion/mptbase.c
> >+++ b/drivers/message/fusion/mptbase.c
> >@@ -1510,11 +1510,12 @@ static int
> > mpt_mapresources(MPT_ADAPTER *ioc)
> > {
> > u8 __iomem *mem;
> >+ u8 __iomem *port;
> > int ii;
> >- unsigned long mem_phys;
> >- unsigned long port;
> >- u32 msize;
> >- u32 psize;
> >+ resource_size_t mem_phys;
> >+ resource_size_t port_phys;
> >+ resource_size_t msize;
> >+ resource_size_t psize;
> > u8 revision;
> > int r = -ENODEV;
> > struct pci_dev *pdev;
> >@@ -1552,13 +1553,13 @@ mpt_mapresources(MPT_ADAPTER *ioc)
> > }
> >
> > mem_phys = msize = 0;
> >- port = psize = 0;
> >+ port_phys = psize = 0;
> > for (ii = 0; ii < DEVICE_COUNT_RESOURCE; ii++) {
> > if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
> > if (psize)
> > continue;
> > /* Get I/O space! */
> >- port = pci_resource_start(pdev, ii);
> >+ port_phys = pci_resource_start(pdev, ii);
> > psize = pci_resource_len(pdev, ii);
> > } else {
> > if (msize)
> >@@ -1580,14 +1581,23 @@ mpt_mapresources(MPT_ADAPTER *ioc)
> > return -EINVAL;
> > }
> > ioc->memmap = mem;
> >- dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %lx\n",
> >- ioc->name, mem, mem_phys));
> >+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %llx\n",
> >+ ioc->name, mem, (u64)mem_phys));
> >
> > ioc->mem_phys = mem_phys;
> > ioc->chip = (SYSIF_REGS __iomem *)mem;
> >
> > /* Save Port IO values in case we need to do downloadboot */
> >- ioc->pio_mem_phys = port;
> >+ port = ioremap(port_phys, psize);
> >+ if (port == NULL) {
> >+ printk(MYIOC_s_ERR_FMT " : ERROR - Unable to map adapter"
> >+ " port !\n", ioc->name);
> >+ return -EINVAL;
So this looks problematic on a few platforms ... what happens to
platforms that have no IO space? They automatically fail here and it
looks like the adapter never attaches.
James
^ permalink raw reply
* Re: [PATCH] [SCSI] mpt fusion: Fix 32 bit platforms with 64 bit resources.
From: Josh Boyer @ 2009-11-05 16:25 UTC (permalink / raw)
To: James Bottomley; +Cc: Eric.Moore, pbathija, linux-scsi, linuxppc-dev
In-Reply-To: <1257437226.2753.64.camel@mulgrave.site>
On Thu, Nov 05, 2009 at 10:07:06AM -0600, James Bottomley wrote:
>On Thu, 2009-11-05 at 08:43 -0500, Josh Boyer wrote:
>> On Tue, Sep 15, 2009 at 03:25:55PM -0700, pbathija@amcc.com wrote:
>> >From: Pravin Bathija <pbathija@amcc.com>
>> >
>> >Powerpc 44x uses 36 bit real address while the real address defined
>> >in MPT Fusion driver is of type 32 bit. This causes ioremap to fail and driver
>> >fails to initialize. This fix changes the data types representing the real
>> >address from unsigned long 32-bit types to "phys_addr_t" which is 64-bit. The
>> >driver has been tested, the disks get discovered correctly and can do IO. Also,
>> >replaced phys_addr_t with resource_size_t as suggested by Ben.
>> >
>> >Signed-off-by: Pravin Bathija <pbathija@amcc.com>
>> >Acked-by: Feng Kan <fkan@amcc.com>
>> >Acked-by: Prodyut Hazarika <phazarika@amcc.com>
>> >Acked-by: Loc Ho <lho@amcc.com>
>> >Acked-by: Tirumala Reddy Marri <tmarri@amcc.com>
>> >Acked-by: Victor Gallardo <vgallardo@amcc.com>
>>
>> Is this patch included in the scsi tree at all? I can't seem to find it in
>> linux-next and I know it's not in the powerpc tree. Are there further changes
>> needed, or has it simply been missed?
>
>What was the feedback from LSI ... I haven't seen any here?
I've seen no feedback on it anywhere. The original patch used both
phys_addr_t and resource_size_t and Ben suggested they just use resource_size_t
everywhere. Pravin reposted (which is this current patch) and it has sat here
since then.
josh
^ permalink raw reply
* Re: [PATCH 5/7] powerpc/85xx: Add power management support for MPC85xxMDS boards
From: Scott Wood @ 2009-11-05 16:53 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Timur Tabi
In-Reply-To: <39FA5DC3-BE71-442B-9EDC-2764D1391074@kernel.crashing.org>
On Thu, Nov 05, 2009 at 08:06:51AM -0600, Kumar Gala wrote:
>
> On Nov 5, 2009, at 8:04 AM, Anton Vorontsov wrote:
>
>> On Thu, Nov 05, 2009 at 07:58:49AM -0600, Kumar Gala wrote:
>> [...]
>>> --- a/arch/powerpc/boot/dts/mpc8568mds.dts
>>> +++ b/arch/powerpc/boot/dts/mpc8568mds.dts
>>> @@ -40,6 +40,8 @@
>>> i-cache-line-size = <32>; // 32 bytes
>>> d-cache-size = <0x8000>; // L1, 32K
>>> i-cache-size = <0x8000>; // L1, 32K
>>> + sleep = <&pmc 0x00008000 // core
>>> + &pmc 0x00004000>; // timebase
>>>
>>> Just so I'm clear this is the devdisr bit position?
>>
>> Yep, as described in the bindings.
>
> I don't think the binding is clear that for 85xx these are DEVDISR bit
> positions for the given SoC.
>From dts-bindings/fsl/pmc.txt:
fsl,mpc8548-pmc: Sleep specifiers consist of one or two cells, the
first of which will be ORed into DEVDISR (and the second into
DEVDISR2, if present -- this cell should be zero or absent if the
hardware does not have DEVDISR2) upon a request for permanent device
disabling. This sleep controller does not support configuring devices
to disable during system sleep (unless supported by another compatible
match), or dynamically.
-Scott
^ permalink raw reply
* Re: [PATCH 1/3] powerpc/83xx/suspend: Clear deep_sleeping after devices resume
From: Scott Wood @ 2009-11-05 16:57 UTC (permalink / raw)
To: Kumar Gala; +Cc: linux-ppc list
In-Reply-To: <043A102D-9F70-4287-B34E-17FF9AE90EE1@kernel.crashing.org>
Kumar Gala wrote:
>
> On Sep 23, 2009, at 2:01 PM, Anton Vorontsov wrote:
>
>> Currently 83xx PMC driver clears deep_sleeping variable very early,
>> before devices are resumed. This makes fsl_deep_sleep() unusable in
>> drivers' resume() callback.
>>
>> Sure, drivers can store fsl_deep_sleep() value on suspend and use
>> the stored value on resume. But a better solution is to postpone
>> clearing the deep_sleeping variable, i.e. move it into finish()
>> callback.
>>
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>> ---
>> arch/powerpc/platforms/83xx/suspend.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> Scott, any comments or an ack?
ACK
-Scott
^ permalink raw reply
* [PATCH RFC] gianfar: Do not call skb recycling with disabled IRQs
From: Anton Vorontsov @ 2009-11-05 16:57 UTC (permalink / raw)
To: Jon Loeliger
Cc: netdev, linuxppc-dev, Andy Fleming, Jason Wessel,
Stephen Hemminger, David Miller, Lennert Buytenhek
In-Reply-To: <E1N64UY-00049g-Hb@jdl.com>
Before calling gfar_clean_tx_ring() we grab an irqsave spinlock, and
then try to recycle an skb, which requires IRQs to be enabled. This
leads to the following badness:
nf_conntrack version 0.5.0 (1008 buckets, 4032 max)
------------[ cut here ]------------
Badness at kernel/softirq.c:143
NIP: c003e3c4 LR: c423a528 CTR: c003e344
...
NIP [c003e3c4] local_bh_enable+0x80/0xc4
LR [c423a528] destroy_conntrack+0xd4/0x13c [nf_conntrack]
Call Trace:
[c15d1b60] [c003e32c] local_bh_disable+0x1c/0x34 (unreliable)
[c15d1b70] [c423a528] destroy_conntrack+0xd4/0x13c [nf_conntrack]
[c15d1b80] [c02c6370] nf_conntrack_destroy+0x3c/0x70
--- Exception: c428168c at 0xc15d1c50
LR = 0xc15d1c40
[c15d1ba0] [c0286f3c] skb_release_head_state+0x100/0x104 (unreliable)
[c15d1bb0] [c0288340] skb_recycle_check+0x8c/0x10c
[c15d1bc0] [c01e1688] gfar_poll+0x190/0x384
[c15d1c10] [c02935ac] net_rx_action+0xec/0x22c
[c15d1c50] [c003dd8c] __do_softirq+0xe8/0x224
[c15d1ca0] [c000624c] do_softirq+0x78/0x80
[c15d1cb0] [c003d868] irq_exit+0x60/0x78
...
We can't easily get rid of the irqsave spinlock, because we must
guard ourselves from start_xmit.
So, fix this by dropping the irqsave spinlock from both xmit_start
and clean_tx_ring routines. Instead, lock the whole tx queue via
netif_tx_lock_bh() in clean_tx_ring().
Reported-by: Jon Loeliger <jdl@jdl.com>
Not-yet-Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
On Thu, Nov 05, 2009 at 09:43:18AM -0600, Jon Loeliger wrote:
[...]
> This is with essentially a stock 2.6.31 kernel for an 8315.
> I've seen the problem for both task 'insmod' and 'iptables'.
> Um, conn_track is a module being loaded here. Our brief analysis
> runs like this:
>
> This is an issue with the gianfar driver. In gfar_poll(), irqs are
> disabled for the handling of gfar_clean_tx_ring(dev) (line 1928).
> In this call, skbs can call skb_recycle_check, which can release
> head state (net/core/skbuff.c@506), which can cause conntrack
> cleanup (net/core/skbuff.c@402->include/linux/skbuff.h@1923), which
> cannot be done with IRQs disabled...that is the badness.
Ugh.
We may try to call netif_tx_lock_bh() in gfar_clean_tx_ring() and
drop the irqsave spinlock start_xmit (sky2-like scheme).
But that basically means that with skb recycling we can't safely
use KGDBoE, though we can add something like this:
| diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
| index a00ec63..4d82bd7 100644
| --- a/drivers/net/gianfar.c
| +++ b/drivers/net/gianfar.c
| @@ -1619,7 +1619,8 @@ static int gfar_clean_tx_ring(struct net_device *dev)
| * If there's room in the queue (limit it to rx_buffer_size)
| * we add this skb back into the pool, if it's the right size
| */
| - if (skb_queue_len(&priv->rx_recycle) < priv->rx_ring_size &&
| + if (!irqs_disabled() &&
| + skb_queue_len(&priv->rx_recycle) < priv->rx_ring_size &&
| skb_recycle_check(skb, priv->rx_buffer_size +
| RXBUF_ALIGNMENT))
| __skb_queue_head(&priv->rx_recycle, skb);
So we won't recycle skbs with irqs disabled.
Anyway, apart from KGDBoE, the following patch might fix the conntrack
issue, can you try it?
With this patch the kernel boots via NFS, and survives netperf, though
I'd like to audit changes a little more and run some netperf tests, I
might also put the netif_tx_lock_bh() stuff out of the loop.
So this patch isn't for the merge.
drivers/net/gianfar.c | 19 +++----------------
1 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 197b358..a0ae604 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1899,10 +1899,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
u32 lstatus;
int i, rq = 0;
u32 bufaddr;
- unsigned long flags;
unsigned int nr_frags, length;
-
rq = skb->queue_mapping;
tx_queue = priv->tx_queue[rq];
txq = netdev_get_tx_queue(dev, rq);
@@ -1928,14 +1926,11 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* total number of fragments in the SKB */
nr_frags = skb_shinfo(skb)->nr_frags;
- spin_lock_irqsave(&tx_queue->txlock, flags);
-
/* check if there is space to queue this packet */
if ((nr_frags+1) > tx_queue->num_txbdfree) {
/* no space, stop the queue */
netif_tx_stop_queue(txq);
dev->stats.tx_fifo_errors++;
- spin_unlock_irqrestore(&tx_queue->txlock, flags);
return NETDEV_TX_BUSY;
}
@@ -2033,9 +2028,6 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Tell the DMA to go go go */
gfar_write(®s->tstat, TSTAT_CLEAR_THALT >> tx_queue->qindex);
- /* Unlock priv */
- spin_unlock_irqrestore(&tx_queue->txlock, flags);
-
return NETDEV_TX_OK;
}
@@ -2550,7 +2542,6 @@ static int gfar_poll(struct napi_struct *napi, int budget)
int tx_cleaned = 0, i, left_over_budget = budget;
unsigned long serviced_queues = 0;
int num_queues = 0;
- unsigned long flags;
num_queues = gfargrp->num_rx_queues;
budget_per_queue = budget/num_queues;
@@ -2570,13 +2561,9 @@ static int gfar_poll(struct napi_struct *napi, int budget)
rx_queue = priv->rx_queue[i];
tx_queue = priv->tx_queue[rx_queue->qindex];
- /* If we fail to get the lock,
- * don't bother with the TX BDs */
- if (spin_trylock_irqsave(&tx_queue->txlock, flags)) {
- tx_cleaned += gfar_clean_tx_ring(tx_queue);
- spin_unlock_irqrestore(&tx_queue->txlock,
- flags);
- }
+ netif_tx_lock_bh(priv->ndev);
+ tx_cleaned += gfar_clean_tx_ring(tx_queue);
+ netif_tx_unlock_bh(priv->ndev);
rx_cleaned_per_queue = gfar_clean_rx_ring(rx_queue,
budget_per_queue);
--
1.6.3.3
^ permalink raw reply related
* Re: [RFC PATCH 2/5] Merge dynamic OF code to of_dynamic.c
From: Nathan Fontenot @ 2009-11-05 16:59 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, devicetree-discuss, microblaze-uclinux
In-Reply-To: <fa686aa40911042355l73c7511bod3b2f651e9c9a5a4@mail.gmail.com>
Grant Likely wrote:
> Hi Nathan,
>
> Thanks for the patches. Comments below.
>
> On Wed, Nov 4, 2009 at 3:16 PM, Nathan Fontenot <nfont@austin.ibm.com> wrote:
>> Creation of the OF dynamic device tree update code in drivers/of. This
>> merges the common device tree updating routines to add/remove nodes and
>> properties from powerpc and microblaze. All of the new code is conditional
>> based on a new OF_DYNAMIC config option.
>
> Rather than one patch to create all the moved functions, and then
> subsequent patches to remove the duplicates from each arch, I've been
> using the pattern of one patch for each function or couple of
> functions to both remove from the old files and add to the new home.
> Would you be able to do the same for your patches here? The merging
> is complicated enough without having to track changes to a function
> between separate commits. Moving one function at a time will also
> make bisecting more friendly.
>
Shouldn't be a problem.
> Also, have you checked what impact these changes have on SPARC?
>
I took a look at sparc code, but will do again as I redo the patches to
make there are no impacts.
>> --- linux-next.orig/drivers/of/Makefile 2009-11-03 11:18:08.000000000 -0600
>> +++ linux-next/drivers/of/Makefile 2009-11-03 13:42:35.000000000 -0600
>> @@ -1,6 +1,7 @@
>> obj-y = base.o
>> -obj-$(CONFIG_OF_DEVICE) += device.o platform.o
>> -obj-$(CONFIG_OF_GPIO) += gpio.o
>> -obj-$(CONFIG_OF_I2C) += of_i2c.o
>> -obj-$(CONFIG_OF_SPI) += of_spi.o
>> -obj-$(CONFIG_OF_MDIO) += of_mdio.o
>> +obj-$(CONFIG_OF_DEVICE) += device.o platform.o
>> +obj-$(CONFIG_OF_GPIO) += gpio.o
>> +obj-$(CONFIG_OF_I2C) += of_i2c.o
>> +obj-$(CONFIG_OF_SPI) += of_spi.o
>> +obj-$(CONFIG_OF_MDIO) += of_mdio.o
>> +obj-$(CONFIG_OF_DYNAMIC) += of_dynamic.o
>
> Unrelated whitespace churn makes it hard to see what actually changed.
>
ok.
-Nathan Fontenot
^ permalink raw reply
* RE: [PATCH RFC] gianfar: Do not call skb recycling with disabled IRQs
From: Kumar Gopalpet-B05799 @ 2009-11-05 17:23 UTC (permalink / raw)
To: avorontsov, Jon Loeliger
Cc: netdev, linuxppc-dev, Fleming Andy-AFLEMING, Jason Wessel,
Stephen Hemminger, David Miller, Lennert Buytenhek
In-Reply-To: <20091105165738.GA31923@oksana.dev.rtsoft.ru>
=20
[.....]
> drivers/net/gianfar.c | 19 +++----------------
> 1 files changed, 3 insertions(+), 16 deletions(-)
>
>diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c=20
>index 197b358..a0ae604 100644
>--- a/drivers/net/gianfar.c
>+++ b/drivers/net/gianfar.c
>@@ -1899,10 +1899,8 @@ static int gfar_start_xmit(struct=20
>sk_buff *skb, struct net_device *dev)
> u32 lstatus;
> int i, rq =3D 0;
> u32 bufaddr;
>- unsigned long flags;
> unsigned int nr_frags, length;
>=20
>-
> rq =3D skb->queue_mapping;
> tx_queue =3D priv->tx_queue[rq];
> txq =3D netdev_get_tx_queue(dev, rq);
>@@ -1928,14 +1926,11 @@ static int gfar_start_xmit(struct=20
>sk_buff *skb, struct net_device *dev)
> /* total number of fragments in the SKB */
> nr_frags =3D skb_shinfo(skb)->nr_frags;
>=20
>- spin_lock_irqsave(&tx_queue->txlock, flags);
>-
> /* check if there is space to queue this packet */
> if ((nr_frags+1) > tx_queue->num_txbdfree) {
> /* no space, stop the queue */
> netif_tx_stop_queue(txq);
> dev->stats.tx_fifo_errors++;
>- spin_unlock_irqrestore(&tx_queue->txlock, flags);
> return NETDEV_TX_BUSY;
> }
>=20
>@@ -2033,9 +2028,6 @@ static int gfar_start_xmit(struct=20
>sk_buff *skb, struct net_device *dev)
> /* Tell the DMA to go go go */
> gfar_write(®s->tstat, TSTAT_CLEAR_THALT >> tx_queue->qindex);
>=20
>- /* Unlock priv */
>- spin_unlock_irqrestore(&tx_queue->txlock, flags);
>-
> return NETDEV_TX_OK;
> }
>=20
>@@ -2550,7 +2542,6 @@ static int gfar_poll(struct napi_struct=20
>*napi, int budget)
> int tx_cleaned =3D 0, i, left_over_budget =3D budget;
> unsigned long serviced_queues =3D 0;
> int num_queues =3D 0;
>- unsigned long flags;
>=20
> num_queues =3D gfargrp->num_rx_queues;
> budget_per_queue =3D budget/num_queues;
>@@ -2570,13 +2561,9 @@ static int gfar_poll(struct napi_struct=20
>*napi, int budget)
> rx_queue =3D priv->rx_queue[i];
> tx_queue =3D priv->tx_queue[rx_queue->qindex];
>=20
>- /* If we fail to get the lock,
>- * don't bother with the TX BDs */
>- if=20
>(spin_trylock_irqsave(&tx_queue->txlock, flags)) {
>- tx_cleaned +=3D=20
>gfar_clean_tx_ring(tx_queue);
>- =09
>spin_unlock_irqrestore(&tx_queue->txlock,
>- flags);
>- }
>+ netif_tx_lock_bh(priv->ndev);
Will this not lead to locking all the tx queues even though at this
point we are working on a "particular queue" ?
>+ tx_cleaned +=3D gfar_clean_tx_ring(tx_queue);
>+ netif_tx_unlock_bh(priv->ndev);
>=20
> rx_cleaned_per_queue =3D=20
>gfar_clean_rx_ring(rx_queue,
> =09
>budget_per_queue);
>--
--
Thanks
Sandeep
^ permalink raw reply
* [PATCH v2] powerpc/fsl-booke: Rework TLB CAM code
From: Kumar Gala @ 2009-11-05 17:27 UTC (permalink / raw)
To: linuxppc-dev
Re-write the code so its more standalone and fixed some issues:
* Bump'd # of CAM entries to 64 to support e500mc
* Make the code handle MAS7 properly
* Use pr_cont instead of creating a string as we go
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* Fix compile warning
arch/powerpc/kernel/asm-offsets.c | 3 -
arch/powerpc/kernel/head_fsl_booke.S | 22 ------
arch/powerpc/mm/fsl_booke_mmu.c | 132 +++++++++++++++++++---------------
arch/powerpc/mm/mmu_decl.h | 11 ---
4 files changed, 74 insertions(+), 94 deletions(-)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index e2e2082..a6c2b63 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -421,9 +421,6 @@ int main(void)
DEFINE(PGD_T_LOG2, PGD_T_LOG2);
DEFINE(PTE_T_LOG2, PTE_T_LOG2);
#endif
-#ifdef CONFIG_FSL_BOOKE
- DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam));
-#endif
#ifdef CONFIG_KVM_EXIT_TIMING
DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 975788c..7f4bd7f 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -944,28 +944,6 @@ _GLOBAL(__setup_e500mc_ivors)
blr
/*
- * extern void loadcam_entry(unsigned int index)
- *
- * Load TLBCAM[index] entry in to the L2 CAM MMU
- */
-_GLOBAL(loadcam_entry)
- lis r4,TLBCAM@ha
- addi r4,r4,TLBCAM@l
- mulli r5,r3,TLBCAM_SIZE
- add r3,r5,r4
- lwz r4,0(r3)
- mtspr SPRN_MAS0,r4
- lwz r4,4(r3)
- mtspr SPRN_MAS1,r4
- lwz r4,8(r3)
- mtspr SPRN_MAS2,r4
- lwz r4,12(r3)
- mtspr SPRN_MAS3,r4
- tlbwe
- isync
- blr
-
-/*
* extern void giveup_altivec(struct task_struct *prev)
*
* The e500 core does not have an AltiVec unit.
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index dc93e95..fcfcb6e 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -54,26 +54,35 @@
#include "mmu_decl.h"
-extern void loadcam_entry(unsigned int index);
unsigned int tlbcam_index;
-static unsigned long cam[CONFIG_LOWMEM_CAM_NUM];
-#define NUM_TLBCAMS (16)
+#define NUM_TLBCAMS (64)
#if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS)
#error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS"
#endif
-struct tlbcam TLBCAM[NUM_TLBCAMS];
+struct tlbcam {
+ u32 MAS0;
+ u32 MAS1;
+ unsigned long MAS2;
+ u32 MAS3;
+ u32 MAS7;
+} TLBCAM[NUM_TLBCAMS];
struct tlbcamrange {
- unsigned long start;
+ unsigned long start;
unsigned long limit;
phys_addr_t phys;
} tlbcam_addrs[NUM_TLBCAMS];
extern unsigned int tlbcam_index;
+unsigned long tlbcam_sz(int idx)
+{
+ return tlbcam_addrs[idx].limit - tlbcam_addrs[idx].start + 1;
+}
+
/*
* Return PA for this VA if it is mapped by a CAM, or 0
*/
@@ -94,23 +103,36 @@ unsigned long p_mapped_by_tlbcam(phys_addr_t pa)
int b;
for (b = 0; b < tlbcam_index; ++b)
if (pa >= tlbcam_addrs[b].phys
- && pa < (tlbcam_addrs[b].limit-tlbcam_addrs[b].start)
+ && pa < (tlbcam_addrs[b].limit-tlbcam_addrs[b].start)
+tlbcam_addrs[b].phys)
return tlbcam_addrs[b].start+(pa-tlbcam_addrs[b].phys);
return 0;
}
+void loadcam_entry(int idx)
+{
+ mtspr(SPRN_MAS0, TLBCAM[idx].MAS0);
+ mtspr(SPRN_MAS1, TLBCAM[idx].MAS1);
+ mtspr(SPRN_MAS2, TLBCAM[idx].MAS2);
+ mtspr(SPRN_MAS3, TLBCAM[idx].MAS3);
+
+ if (cur_cpu_spec->cpu_features & MMU_FTR_BIG_PHYS)
+ mtspr(SPRN_MAS7, TLBCAM[idx].MAS7);
+
+ asm volatile("isync;tlbwe;isync" : : : "memory");
+}
+
/*
* Set up one of the I/D BAT (block address translation) register pairs.
* The parameters are not checked; in particular size must be a power
* of 4 between 4k and 256M.
*/
-void settlbcam(int index, unsigned long virt, phys_addr_t phys,
- unsigned int size, int flags, unsigned int pid)
+static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
+ unsigned long size, unsigned long flags, unsigned int pid)
{
unsigned int tsize, lz;
- asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size));
+ asm (PPC_CNTLZL "%0,%1" : "=r" (lz) : "r" (size));
tsize = 21 - lz;
#ifdef CONFIG_SMP
@@ -128,8 +150,10 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys,
TLBCAM[index].MAS2 |= (flags & _PAGE_GUARDED) ? MAS2_G : 0;
TLBCAM[index].MAS2 |= (flags & _PAGE_ENDIAN) ? MAS2_E : 0;
- TLBCAM[index].MAS3 = (phys & PAGE_MASK) | MAS3_SX | MAS3_SR;
+ TLBCAM[index].MAS3 = (phys & MAS3_RPN) | MAS3_SX | MAS3_SR;
TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_SW : 0);
+ if (cur_cpu_spec->cpu_features & MMU_FTR_BIG_PHYS)
+ TLBCAM[index].MAS7 = (u64)phys >> 32;
#ifndef CONFIG_KGDB /* want user access for breakpoints */
if (flags & _PAGE_USER) {
@@ -148,27 +172,44 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys,
loadcam_entry(index);
}
-void invalidate_tlbcam_entry(int index)
-{
- TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index);
- TLBCAM[index].MAS1 = ~MAS1_VALID;
-
- loadcam_entry(index);
-}
-
-unsigned long __init mmu_mapin_ram(void)
+unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx)
{
+ int i;
unsigned long virt = PAGE_OFFSET;
phys_addr_t phys = memstart_addr;
+ unsigned long amount_mapped = 0;
+ unsigned long max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xf;
+
+ /* Convert (4^max) kB to (2^max) bytes */
+ max_cam = max_cam * 2 + 10;
- while (tlbcam_index < ARRAY_SIZE(cam) && cam[tlbcam_index]) {
- settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0);
- virt += cam[tlbcam_index];
- phys += cam[tlbcam_index];
- tlbcam_index++;
+ /* Calculate CAM values */
+ for (i = 0; ram && i < max_cam_idx; i++) {
+ unsigned int camsize = __ilog2(ram) & ~1U;
+ unsigned int align = __ffs(virt | phys) & ~1U;
+ unsigned long cam_sz;
+
+ if (camsize > align)
+ camsize = align;
+ if (camsize > max_cam)
+ camsize = max_cam;
+
+ cam_sz = 1UL << camsize;
+ settlbcam(i, virt, phys, cam_sz, PAGE_KERNEL_X, 0);
+
+ ram -= cam_sz;
+ amount_mapped += cam_sz;
+ virt += cam_sz;
+ phys += cam_sz;
}
+ tlbcam_index = i;
+
+ return amount_mapped;
+}
- return virt - PAGE_OFFSET;
+unsigned long __init mmu_mapin_ram(void)
+{
+ return tlbcam_addrs[tlbcam_index - 1].limit - PAGE_OFFSET + 1;
}
/*
@@ -179,46 +220,21 @@ void __init MMU_init_hw(void)
flush_instruction_cache();
}
-void __init
-adjust_total_lowmem(void)
+void __init adjust_total_lowmem(void)
{
- phys_addr_t ram;
- unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xff;
- char buf[ARRAY_SIZE(cam) * 5 + 1], *p = buf;
+ unsigned long ram;
int i;
- unsigned long virt = PAGE_OFFSET & 0xffffffffUL;
- unsigned long phys = memstart_addr & 0xffffffffUL;
-
- /* Convert (4^max) kB to (2^max) bytes */
- max_cam = max_cam * 2 + 10;
/* adjust lowmem size to __max_low_memory */
ram = min((phys_addr_t)__max_low_memory, (phys_addr_t)total_lowmem);
- /* Calculate CAM values */
- __max_low_memory = 0;
- for (i = 0; ram && i < ARRAY_SIZE(cam); i++) {
- unsigned int camsize = __ilog2(ram) & ~1U;
- unsigned int align = __ffs(virt | phys) & ~1U;
+ __max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM);
- if (camsize > align)
- camsize = align;
- if (camsize > max_cam)
- camsize = max_cam;
-
- cam[i] = 1UL << camsize;
- ram -= cam[i];
- __max_low_memory += cam[i];
- virt += cam[i];
- phys += cam[i];
-
- p += sprintf(p, "%lu/", cam[i] >> 20);
- }
- for (; i < ARRAY_SIZE(cam); i++)
- p += sprintf(p, "0/");
- p[-1] = '\0';
-
- pr_info("Memory CAM mapping: %s Mb, residual: %dMb\n", buf,
+ pr_info("Memory CAM mapping: ");
+ for (i = 0; i < tlbcam_index - 1; i++)
+ pr_cont("%lu/", tlbcam_sz(i) >> 20);
+ pr_cont("%lu Mb, residual: %dMb\n", tlbcam_sz(tlbcam_index - 1) >> 20,
(unsigned int)((total_lowmem - __max_low_memory) >> 20));
+
__initial_memory_limit_addr = memstart_addr + __max_low_memory;
}
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index d2e5321..e27a990 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -98,21 +98,10 @@ extern void _tlbia(void);
#ifdef CONFIG_PPC32
-struct tlbcam {
- u32 MAS0;
- u32 MAS1;
- u32 MAS2;
- u32 MAS3;
- u32 MAS7;
-};
-
extern void mapin_ram(void);
extern int map_page(unsigned long va, phys_addr_t pa, int flags);
extern void setbat(int index, unsigned long virt, phys_addr_t phys,
unsigned int size, int flags);
-extern void settlbcam(int index, unsigned long virt, phys_addr_t phys,
- unsigned int size, int flags, unsigned int pid);
-extern void invalidate_tlbcam_entry(int index);
extern int __map_without_bats;
extern unsigned long ioremap_base;
--
1.6.0.6
^ permalink raw reply related
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