LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PPC 4xx: Fix 4xx handler after pt_regs irq changes
From: Josh Boyer @ 2006-10-07 14:29 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

The following patch fixes 4xx on ARCH=ppc after the removal of pt_regs from
the irq handlers.

Signed-off-by: Josh Boyer <jdub@us.ibm.com>

---
 arch/ppc/syslib/ppc4xx_pic.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- linux-2.6.orig/arch/ppc/syslib/ppc4xx_pic.c
+++ linux-2.6/arch/ppc/syslib/ppc4xx_pic.c
@@ -96,7 +96,7 @@ UIC_HANDLERS(1);
 UIC_HANDLERS(2);
 UIC_HANDLERS(3);
 
-static int ppc4xx_pic_get_irq(struct pt_regs *regs)
+static int ppc4xx_pic_get_irq(void)
 {
 	u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0));
 	if (uic0 & UIC0_UIC1NC)
@@ -125,7 +125,7 @@ UIC_HANDLERS(0);
 UIC_HANDLERS(1);
 UIC_HANDLERS(2);
 
-static int ppc4xx_pic_get_irq(struct pt_regs *regs)
+static int ppc4xx_pic_get_irq(void)
 {
 	u32 uicb = mfdcr(DCRN_UIC_MSR(UICB));
 	if (uicb & UICB_UIC0NC)
@@ -158,7 +158,7 @@ static void __init ppc4xx_pic_impl_init(
 UIC_HANDLERS(0);
 UIC_HANDLERS(1);
 
-static int ppc4xx_pic_get_irq(struct pt_regs *regs)
+static int ppc4xx_pic_get_irq(void)
 {
 	u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0));
 	if (uic0 & UIC0_UIC1NC)
@@ -179,7 +179,7 @@ static void __init ppc4xx_pic_impl_init(
 #define ACK_UIC0_PARENT
 UIC_HANDLERS(0);
 
-static int ppc4xx_pic_get_irq(struct pt_regs *regs)
+static int ppc4xx_pic_get_irq(void)
 {
 	u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0));
 	return uic0 ? 32 - ffs(uic0) : -1;

^ permalink raw reply

* Re: vsdo_datapage.h WTF?
From: Anton Blanchard @ 2006-10-07 14:58 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, David Woodhouse, paulus
In-Reply-To: <1160170374.22232.135.camel@localhost.localdomain>


Hi,

> No. There -used- to be this systemcfg structure that was exposed to
> userspace on ppc64. I made it deprecated. However, for the sake of
> backward compatbility, I kept vdso datapage with the exact same layout
> for the first part of it (before the syscall maps) and haven't removed
> the mmap call for it, but it will be gone soon.

We need a way to export cache size/associativity information (sysfs,
/proc/device-tree parsing?) and a plan to fix the applications using it
first.

Anton

^ permalink raw reply

* Re: vsdo_datapage.h WTF?
From: David Woodhouse @ 2006-10-07 15:10 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: paulus, linuxppc-dev
In-Reply-To: <20061007145811.GA4043@krispykreme>

On Sun, 2006-10-08 at 00:58 +1000, Anton Blanchard wrote:
> We need a way to export cache size/associativity information (sysfs,
> /proc/device-tree parsing?) and a plan to fix the applications using
> it first. 

ELF auxvec?

-- 
dwmw2

^ permalink raw reply

* Re: vsdo_datapage.h WTF?
From: Segher Boessenkool @ 2006-10-07 15:16 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linuxppc-dev, paulus, Anton Blanchard
In-Reply-To: <1160233817.4795.85.camel@pmac.infradead.org>

>> We need a way to export cache size/associativity information (sysfs,
>> /proc/device-tree parsing?) and a plan to fix the applications using
>> it first.
>
> ELF auxvec?

sysfs is the only choice that stands a chance of being
cross-platform portable (which should be an important goal
of exporting this information at all).


Segher

^ permalink raw reply

* Re: vsdo_datapage.h WTF?
From: Anton Blanchard @ 2006-10-07 15:21 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linuxppc-dev, paulus
In-Reply-To: <1160233817.4795.85.camel@pmac.infradead.org>

 
> ELF auxvec?

Could do, but there may end up being a lot of information we need to
export (L2/L3 caches etc). ia64 stuffed it all into sysfs (but didnt
make it generic which was a bit annoying - arch/ia64/kernel/topology.c).

One other thing that would be nice is a generic way to detect SMT
siblings.  We could make our /proc/cpuinfo match x86 in this regard, but
/proc/cpuinfo has so many subtle differences between architectures it is
becoming a pain to parse.

Anton

^ permalink raw reply

* USB Disk Support
From: Jeff Stevens @ 2006-10-07 21:01 UTC (permalink / raw)
  To: linuxppc-embedded

I am having issues getting a uDiskOnChip to mount or
fdisk under linux.  I have a board running U-Boot on a
AMCC 440SP platform.  Linux seems to find the
uDiskOnChip fine, however, when I try to fdisk or
mount the device, the console hangs.  I have added
SCSI, SCSI storage, USB, USB OHCI, USB EHCI, USB Mass
Storage.  Here is my dmesg:

bash-3.00# dmesg | grep -i usb
usbcore: registered new driver usbfs
usbcore: registered new driver hub
usbmon: debugfs is not available
drivers/usb/core/inode.c: creating file 'devices'
drivers/usb/core/inode.c: creating file '001'
ehci_hcd 0002:02:08.2: new USB bus registered,
assigned bus number 1
ehci_hcd 0002:02:08.2: supports USB remote wakeup
ehci_hcd 0002:02:08.2: USB 2.0 started, EHCI 0.95,
driver 10 Dec 2004
usb usb1: default language 0x0409
usb usb1: new device strings: Mfr=3, Product=2,
SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.17.9 ehci_hcd
usb usb1: SerialNumber: 0002:02:08.2
usb usb1: configuration #1 chosen from 1 choice
usb usb1: adding 1-0:1.0 (config #1, interface 0)
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: USB hub found
drivers/usb/core/inode.c: creating file '001'
ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller
(OHCI) Driver (PCI)
drivers/usb/core/inode.c: creating file '002'
ohci_hcd 0002:02:08.0: new USB bus registered,
assigned bus number 2
usb usb2: default language 0x0409
usb usb2: new device strings: Mfr=3, Product=2,
SerialNumber=1
usb usb2: Product: OHCI Host Controller
usb usb2: Manufacturer: Linux 2.6.17.9 ohci_hcd
usb usb2: SerialNumber: 0002:02:08.0
usb usb2: configuration #1 chosen from 1 choice
usb usb2: adding 2-0:1.0 (config #1, interface 0)
hub 2-0:1.0: usb_probe_interface
hub 2-0:1.0: usb_probe_interface - got id
hub 2-0:1.0: USB hub found
hub 2-0:1.0: no power switching (usb 1.0)
usb 1-1: new high speed USB device using ehci_hcd and
address 2
usb 1-1: default language 0x0409
usb 1-1: new device strings: Mfr=1, Product=2,
SerialNumber=3
usb 1-1: Product: uDiskOnChip
usb 1-1: Manufacturer: M-Systems
usb 1-1: SerialNumber: 98B0FB510031E86E
usb 1-1: configuration #1 chosen from 1 choice
drivers/usb/core/inode.c: creating file '001'
drivers/usb/core/inode.c: creating file '003'
ohci_hcd 0002:02:08.1: new USB bus registered,
assigned bus number 3
usb 1-1: adding 1-1:1.0 (config #1, interface 0)
drivers/usb/core/inode.c: creating file '002'
usb usb3: default language 0x0409
usb usb3: new device strings: Mfr=3, Product=2,
SerialNumber=1
usb usb3: Product: OHCI Host Controller
usb usb3: Manufacturer: Linux 2.6.17.9 ohci_hcd
usb usb3: SerialNumber: 0002:02:08.1
usb usb3: configuration #1 chosen from 1 choice
usb usb3: adding 3-0:1.0 (config #1, interface 0)
hub 3-0:1.0: usb_probe_interface
hub 3-0:1.0: usb_probe_interface - got id
hub 3-0:1.0: USB hub found
hub 3-0:1.0: no power switching (usb 1.0)
drivers/usb/core/inode.c: creating file '001'
Initializing USB Mass Storage driver...
usb-storage 1-1:1.0: usb_probe_interface
usb-storage 1-1:1.0: usb_probe_interface - got id
usb-storage: USB Mass Storage device detected
usb-storage: -- associate_dev
usb-storage: Vendor: 0x08ec, Product: 0x1000,
Revision: 0x0200
usb-storage: Interface Subclass: 0x06, Protocol: 0x50
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: *** thread sleeping.
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 2
usb-storage: waiting for device to settle before
scanning
usb-storage: usb_stor_control_msg: rq=fe rqtype=a1
value=0000 index=00 len=1
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 24 00
usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F
128 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_sglist: xfer 36
bytes, 1 entries
usb-storage: Status code 0; transferred 36/36
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat
0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage:  00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x2 L 0 F 0
Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat
0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage:  25 00 00 00 00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x3 L 8 F 128
Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_sglist: xfer 8
bytes, 1 entries
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: command_abort called
usb-storage: usb_stor_stop_transport called
usb-storage: -- cancelling URB


-------------------------------------------------------
And a few other things:

bash-3.00# cat /proc/bus/usb/devices

T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1
Spd=12  MxCh= 1
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64
#Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.17.9 ohci_hcd
S:  Product=OHCI Host Controller
S:  SerialNumber=0002:02:08.1
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00
Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1
Spd=12  MxCh= 1
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64
#Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.17.9 ohci_hcd
S:  Product=OHCI Host Controller
S:  SerialNumber=0002:02:08.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00
Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1
Spd=480 MxCh= 2
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64
#Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.17.9 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0002:02:08.2
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00
Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2
Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64
#Cfgs=  1
P:  Vendor=08ec ProdID=1000 Rev= 2.00
S:  Manufacturer=M-Systems
S:  Product=uDiskOnChip
S:  SerialNumber=98B0FB510031E86E
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=140mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

bash-3.00# cat /proc/scsi/scsi
Attached devices:


It's probably just a kernel config issue, but I'm not
sure what else to try.  I would appreciate any input!

Thanks,
   Jeff

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply

* 2.6.19-rc1: known regressions (v2)
From: Adrian Bunk @ 2006-10-07 21:46 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: alsa-devel, Thierry Vignaud, fastboot, Torsten Kaiser, ak,
	linux-ide, Vivek Goyal, Pavel Machek, linux1394-devel,
	linux-usb-devel, Steve Fox, Alistair John Strachan, art,
	linux-acpi, Mel Gorman, Michael S. Tsirkin, jgarzik,
	Prakash Punnoor, len.brown, Olaf Hering, linux-pm,
	Trond Myklebust, Alex Romosan, Dave Kleikamp, Antonino Daplas,
	perex, discuss, linux-fbdev-devel, linuxppc-dev, netdev,
	Linux Kernel Mailing List, Jens Axboe, Sukadev Bhattiprolu,
	Stefan Richter, ebiederm, Matthieu Castet, Ernst Herzberg
In-Reply-To: <Pine.LNX.4.64.0610042017340.3952@g5.osdl.org>

This email lists some known regressions in 2.6.19-rc1 compared to 2.6.18
that are not yet fixed Linus' tree.

If you find your name in the Cc header, you are either submitter of one
of the bugs, maintainer of an affectected subsystem or driver, a patch
of you was declared guilty for a breakage or I'm considering you in any
other way possibly involved with one or more of these issues.

Due to the huge amount of recipients, please trim the Cc when answering.


Subject    : SMP x86_64 boot problem
References : http://lkml.org/lkml/2006/9/28/330
             http://lkml.org/lkml/2006/10/5/289
Submitter  : art@usfltd.com
Status     : submitter was asked to git bisect
             result of bisecting seems to be wrong


Subject    : snd-hda-intel <-> forcedeth MSI problem
References : http://lkml.org/lkml/2006/10/5/40
Submitter  : Prakash Punnoor <prakash@punnoor.de>
Status     : unknown


Subject    : oops in xfrm_register_mode
References : http://lkml.org/lkml/2006/10/4/170
Submitter  : Steve Fox <drfickle@us.ibm.com>
Status     : unknown


Subject    : T60 stops triggering any ACPI events
References : http://lkml.org/lkml/2006/10/4/425
Submitter  : "Michael S. Tsirkin" <mst@mellanox.co.il>
Status     : unknown


Subject    : thinkpad x60: brightness no longer adjustable in 2.6.18-git
References : http://lkml.org/lkml/2006/10/2/300
Submitter  : Pavel Machek <pavel@ucw.cz>
Status     : unknown, related to the issue above?


Subject    : monitor not active after boot
References : http://lkml.org/lkml/2006/10/5/338
Submitter  : Olaf Hering <olaf@aepfle.de>
Guilty     : Antonino Daplas <adaplas@pol.net>
             commit 346bc21026e7a92e1d7a4a1b3792c5e8b686133d
Status     : unknown


Subject    : sata-via doesn't detect anymore disks attached to VIA vt6421
References : http://bugzilla.kernel.org/show_bug.cgi?id=7255
Submitter  : Thierry Vignaud <tvignaud@mandriva.com>
Status     : unknown


Subject    : ueagle-atm Oops
References : http://lkml.org/lkml/2006/10/6/390
Submitter  : Ernst Herzberg <list-lkml@net4u.de>
Handled-By : Matthieu Castet <castet.matthieu@free.fr>
Status     : unknown


Subject    : DVD drive lost DVD capabilities
References : http://lkml.org/lkml/2006/10/1/45
Submitter  : Olaf Hering <olaf@aepfle.de>
Guilty     : Jens Axboe <axboe@oracle.com>
             commit 4aff5e2333c9a1609662f2091f55c3f6fffdad36
Handled-By : Jens Axboe <axboe@oracle.com>
Status     : Jens is working on a fix


Subject    : sleep/wakeup on powerbooks apparently busted
References : http://lkml.org/lkml/2006/10/5/13
Submitter  : Benjamin Herrenschmidt <benh@kernel.crashing.org>
Handled-By : Benjamin Herrenschmidt <benh@kernel.crashing.org>
Status     : Benjamin will investigate


Subject    : doesn't boot on iBook G4
References : http://lkml.org/lkml/2006/10/5/305
Submitter  : Andreas Schwab <schwab@suse.de>
Handled-By : Mel Gorman <mel@skynet.ie>
Patch      : http://lkml.org/lkml/2006/10/6/80
Status     : patch available


Subject    : airo suspend fails
References : http://lkml.org/lkml/2006/10/6/3
Submitter  : Alex Romosan <romosan@sycorax.lbl.gov>
Guilty     : Sukadev Bhattiprolu <sukadev@us.ibm.com>  (?)
             commit 3b4c7d640376dbccfe80fc4f7b8772ecc7de28c5  (?)
Handled-By : Dave Kleikamp <shaggy@austin.ibm.com>
Patch      : http://lkml.org/lkml/2006/10/7/139
Status     : patch available


Subject    : NFSv4 fails to mount (timeout)
References : http://bugzilla.kernel.org/show_bug.cgi?id=7274
Submitter  : Torsten Kaiser <kernel@bardioc.dyndns.org>
Guilty     : Trond Myklebust <Trond.Myklebust@netapp.com>
             commit 51b6ded4d9a94a61035deba1d8f51a54e3a3dd86
Handled-By : Trond Myklebust <Trond.Myklebust@netapp.com>
Patch      : http://bugzilla.kernel.org/show_bug.cgi?id=7274
Status     : patch available


Subject    : kexec broken on x86_64
References : http://lkml.org/lkml/2006/10/5/86
Submitter  : Magnus Damm <magnus.damm@gmail.com>
Handled-By : Vivek Goyal <vgoyal@in.ibm.com>
Patch      : http://lkml.org/lkml/2006/10/5/199
Status     : patch available


Subject    : strange ieee1394 messages
References : http://lkml.org/lkml/2006/10/5/154
Submitter  : "Alistair John Strachan" <s0348365@sms.ed.ac.uk>
Guilty     : Stefan Richter <stefanr@s5r6.in-berlin.de>
             commit d2f119fe319528da8c76a1107459d6f478cbf28c
Handled-By : Stefan Richter <stefanr@s5r6.in-berlin.de>
Patch      : http://lkml.org/lkml/2006/10/6/235
Status     : harmless, patch available

^ permalink raw reply

* Re: vsdo_datapage.h WTF?
From: Benjamin Herrenschmidt @ 2006-10-07 21:54 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: linuxppc-dev, David Woodhouse, paulus
In-Reply-To: <20061007145811.GA4043@krispykreme>

On Sun, 2006-10-08 at 00:58 +1000, Anton Blanchard wrote:
> Hi,
> 
> > No. There -used- to be this systemcfg structure that was exposed to
> > userspace on ppc64. I made it deprecated. However, for the sake of
> > backward compatbility, I kept vdso datapage with the exact same layout
> > for the first part of it (before the syscall maps) and haven't removed
> > the mmap call for it, but it will be gone soon.
> 
> We need a way to export cache size/associativity information (sysfs,
> /proc/device-tree parsing?) and a plan to fix the applications using it
> first.

The application using it can still use its own copy of the old header
tho. And that's why I haven't removed the /proc file and will probably
not do in the near future.

Regarding cache infos, I noticed the lack of anything useful in the
device-tree on Power5 LPAR or did I miss something ? Which means that on
recent machines, the kernel doesn't even know.

Ben.

^ permalink raw reply

* Re: vsdo_datapage.h WTF?
From: Benjamin Herrenschmidt @ 2006-10-07 21:56 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linuxppc-dev, paulus, Anton Blanchard
In-Reply-To: <1160233817.4795.85.camel@pmac.infradead.org>

On Sat, 2006-10-07 at 16:10 +0100, David Woodhouse wrote:
> On Sun, 2006-10-08 at 00:58 +1000, Anton Blanchard wrote:
> > We need a way to export cache size/associativity information (sysfs,
> > /proc/device-tree parsing?) and a plan to fix the applications using
> > it first. 
> 
> ELF auxvec?

No, we abuse them too much already.

I was thinking that the vDSO could have a mecanism for retreiving infos,
maybe based on name.

 int __kernel_query_config(const char *tag, void *buffer, int size);

Or something like that and we define a bunch of them in a header... Now
the problem is to get glibc to re-export that to apps...

Ben.

^ permalink raw reply

* [PATCH] cell: fix default zImage build target
From: Geoff Levand @ 2006-10-07 22:33 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann

Change CONFIG_PPC_CELL to CONFIG_PPC_IBM_CELL_BLADE in the powerpc boot
makefile.

CONFIG_PPC_CELL is used to build the generic cell processor support, and
is not an indication of platform.


Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>

---

Index: cell--common--5/arch/powerpc/boot/Makefile
===================================================================
--- cell--common--5.orig/arch/powerpc/boot/Makefile
+++ cell--common--5/arch/powerpc/boot/Makefile
@@ -151,12 +151,12 @@
 $(obj)/uImage: vmlinux $(wrapperbits)
 	$(call cmd,wrap,uboot)
 
-image-$(CONFIG_PPC_PSERIES)	+= zImage.pseries
-image-$(CONFIG_PPC_MAPLE)	+= zImage.pseries
-image-$(CONFIG_PPC_CELL)	+= zImage.pseries
-image-$(CONFIG_PPC_CHRP)	+= zImage.chrp
-image-$(CONFIG_PPC_PMAC)	+= zImage.pmac
-image-$(CONFIG_DEFAULT_UIMAGE)	+= uImage
+image-$(CONFIG_PPC_PSERIES)		+= zImage.pseries
+image-$(CONFIG_PPC_MAPLE)		+= zImage.pseries
+image-$(CONFIG_PPC_IBM_CELL_BLADE)	+= zImage.pseries
+image-$(CONFIG_PPC_CHRP)		+= zImage.chrp
+image-$(CONFIG_PPC_PMAC)		+= zImage.pmac
+image-$(CONFIG_DEFAULT_UIMAGE)		+= uImage
 
 # For 32-bit powermacs, build the COFF and miboot images
 # as well as the ELF images.

^ permalink raw reply

* Re: vsdo_datapage.h WTF?
From: Nathan Lynch @ 2006-10-07 23:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev, David Woodhouse, Anton Blanchard, paulus
In-Reply-To: <1160258075.7122.7.camel@localhost.localdomain>

Benjamin Herrenschmidt wrote:
> On Sun, 2006-10-08 at 00:58 +1000, Anton Blanchard wrote:
> > Hi,
> > 
> > > No. There -used- to be this systemcfg structure that was exposed to
> > > userspace on ppc64. I made it deprecated. However, for the sake of
> > > backward compatbility, I kept vdso datapage with the exact same layout
> > > for the first part of it (before the syscall maps) and haven't removed
> > > the mmap call for it, but it will be gone soon.
> > 
> > We need a way to export cache size/associativity information (sysfs,
> > /proc/device-tree parsing?) and a plan to fix the applications using it
> > first.
> 
> The application using it can still use its own copy of the old header
> tho. And that's why I haven't removed the /proc file and will probably
> not do in the near future.
> 
> Regarding cache infos, I noticed the lack of anything useful in the
> device-tree on Power5 LPAR or did I miss something ? Which means that on
> recent machines, the kernel doesn't even know.

On shared-processor partitions device nodes for caches are not
provided at all.  In dedicated mode the caches can be correlated to
their respective processors by looking at the "l2-cache" properties
iirc.

^ permalink raw reply

* Re: 2.6.19-rc1: known regressions (v2)
From: Trond Myklebust @ 2006-10-08  4:43 UTC (permalink / raw)
  To: Adrian Bunk

Cc: Linus Torvalds <torvalds@osdl.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, art@usfltd.com, ak@suse.de, discuss@x86-64.org,  Prakash Punnoor <prakash@punnoor.de>, perex@suse.cz, alsa-devel@alsa-project.org, Steve Fox <drfickle@us.ibm.com>,  netdev@vger.kernel.org, "Michael S. Tsirkin" <mst@mellanox.co.il>,  len.brown@intel.com, linux-acpi@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,  Olaf Hering <olaf@aepfle.de>, Antonino Daplas <adaplas@pol.net>, linux-fbdev-devel@lists.sourceforge.net,  Thierry Vignaud <tvignaud@mandriva.com>, jgarzik@pobox.com, linux-ide@vger.kernel.org, Ernst Herzberg <list-lkml@net4u.de>, Matthieu Castet <castet.matthieu@free.fr>,  linux-usb-devel@lists.sourceforge.net, Jens Axboe <axboe@oracle.com>,  Benjamin Herrenschmidt <benh@kernel.crashing.org>, linux-pm@osdl.org, linuxppc-dev@ozlabs.org, Andreas Schwab <schwab@suse.de>,  Mel Gorman <mel@skynet.ie>, Alex Romosan <romosan@sycorax.lbl.gov>, Sukadev Bhattiprolu <sukadev@us.ibm.!
 com>, Dave Kleikamp <shaggy@austin.ibm.com>, Torsten Kaiser <kernel@bardioc.dyndns.org>, Magnus Damm <magnus.damm@gmail.com>, Vivek Goyal <vgoyal@in.ibm.com>, ebiederm@xmission.com, fastboot@osdl.org, Alistair John Strachan <s0348365@sms.ed.ac.uk>, Stefan Richter <stefanr@s5r6.in-berlin.de>,  linux1394-devel@lists.sourceforge.net
In-Reply-To: <20061007214620.GB8810@stusta.de>
References: <Pine.LNX.4.64.0610042017340.3952@g5.osdl.org>
	 <20061007214620.GB8810@stusta.de>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Organization: Network Appliance Inc
Date: Sun, 08 Oct 2006 00:43:35 -0400
Message-Id: <1160282615.5506.9.camel@lade.trondhjem.org>
Mime-Version: 1.0
X-Mailer: Evolution 2.8.1 

On Sat, 2006-10-07 at 23:46 +0200, Adrian Bunk wrote:

> Subject    : NFSv4 fails to mount (timeout)
> References : http://bugzilla.kernel.org/show_bug.cgi?id=7274
> Submitter  : Torsten Kaiser <kernel@bardioc.dyndns.org>
> Guilty     : Trond Myklebust <Trond.Myklebust@netapp.com>
>              commit 51b6ded4d9a94a61035deba1d8f51a54e3a3dd86
> Handled-By : Trond Myklebust <Trond.Myklebust@netapp.com>
> Patch      : http://bugzilla.kernel.org/show_bug.cgi?id=7274
> Status     : patch available

Thanks... Always nice to hear that you have been judged and found
guilty. Now go and reread that fucking bug report...

^ permalink raw reply

* [PATCH] fix PReP SMP build
From: Olaf Hering @ 2006-10-08  8:32 UTC (permalink / raw)
  To: Paul Mackeras, linuxppc-dev


  CC      arch/ppc/kernel/smp.o
arch/ppc/kernel/smp.c:88: error: conflicting types for 'smp_message_recv'
include2/asm/smp.h:42: error: previous declaration of 'smp_message_recv' was here
make[2]: *** [arch/ppc/kernel/smp.o] Error 1

Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
 arch/ppc/kernel/smp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/ppc/kernel/smp.c
===================================================================
--- linux-2.6.orig/arch/ppc/kernel/smp.c
+++ linux-2.6/arch/ppc/kernel/smp.c
@@ -84,7 +84,7 @@ smp_message_pass(int target, int msg)
 /*
  * Common functions
  */
-void smp_message_recv(int msg, struct pt_regs *regs)
+void smp_message_recv(int msg)
 {
 	atomic_inc(&ipi_recv);
 

^ permalink raw reply

* [PATCH] fix compile warnings in mpc7448_hpc2
From: Olaf Hering @ 2006-10-08  8:59 UTC (permalink / raw)
  To: Roy Zang, Paul Mackeras, linuxppc-dev


arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c: In function 'mpc7448_hpc2_fixup_irq':
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c:114: warning: passing argument 1 of 'find_slot_by_devfn' discards qualifiers from pointer target type

make interrupt_map as const

make local functions static, which leads to:
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c:264: warning: 'mpc7448_hpc2_halt' defined but not used
add currently unused halt and power_off functions to machdep.


Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
 arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Index: linux-2.6/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ linux-2.6/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -63,7 +63,7 @@ extern void _nmask_and_or_msr(unsigned l
 extern void tsi108_pci_int_init(void);
 extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
 
-int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn)
+static int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn)
 {
 	if (bus == 0 && PCI_SLOT(devfn) == 0)
 		return PCIBIOS_DEVICE_NOT_FOUND;
@@ -74,7 +74,7 @@ int mpc7448_hpc2_exclude_device(u_char b
 /*
  * find pci slot by devfn in interrupt map of OF tree
  */
-u8 find_slot_by_devfn(unsigned int *interrupt_map, unsigned int devfn)
+static u8 find_slot_by_devfn(const unsigned int *interrupt_map, unsigned int devfn)
 {
 	int i;
 	unsigned int tmp;
@@ -89,7 +89,7 @@ u8 find_slot_by_devfn(unsigned int *inte
 /*
  * Scans the interrupt map for pci device
  */
-void mpc7448_hpc2_fixup_irq(struct pci_dev *dev)
+static void mpc7448_hpc2_fixup_irq(struct pci_dev *dev)
 {
 	struct pci_controller *hose;
 	struct device_node *node;
@@ -121,7 +121,7 @@ void mpc7448_hpc2_fixup_irq(struct pci_d
 }
 /* temporary pci irq map fixup*/
 
-void __init mpc7448_hpc2_pcibios_fixup(void)
+static void __init mpc7448_hpc2_pcibios_fixup(void)
 {
 	struct pci_dev *dev = NULL;
 	for_each_pci_dev(dev) {
@@ -238,13 +238,13 @@ static void __init mpc7448_hpc2_init_IRQ
 	of_node_put(tsi_pic);
 }
 
-void mpc7448_hpc2_show_cpuinfo(struct seq_file *m)
+static void mpc7448_hpc2_show_cpuinfo(struct seq_file *m)
 {
 	seq_printf(m, "vendor\t\t: Freescale Semiconductor\n");
 	seq_printf(m, "machine\t\t: MPC7448hpc2\n");
 }
 
-void mpc7448_hpc2_restart(char *cmd)
+static void mpc7448_hpc2_restart(char *cmd)
 {
 	local_irq_disable();
 
@@ -254,13 +254,13 @@ void mpc7448_hpc2_restart(char *cmd)
 	for (;;) ;		/* Spin until reset happens */
 }
 
-void mpc7448_hpc2_power_off(void)
+static void mpc7448_hpc2_power_off(void)
 {
 	local_irq_disable();
 	for (;;) ;		/* No way to shut power off with software */
 }
 
-void mpc7448_hpc2_halt(void)
+static void mpc7448_hpc2_halt(void)
 {
 	mpc7448_hpc2_power_off();
 }
@@ -302,6 +302,8 @@ define_machine(mpc7448_hpc2){
 	.get_irq 		= mpic_get_irq,
 	.pcibios_fixup 		= mpc7448_hpc2_pcibios_fixup,
 	.restart 		= mpc7448_hpc2_restart,
+	.power_off		= mpc7448_hpc2_power_off,
+	.halt			= mpc7448_hpc2_halt,
 	.calibrate_decr 	= generic_calibrate_decr,
 	.machine_check_exception= mpc7448_machine_check_exception,
 	.progress 		= udbg_progress,

^ permalink raw reply

* Re: 2.6.19-rc1: known regressions (v2)
From: matthieu castet @ 2006-10-08  8:56 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: alsa-devel, Thierry Vignaud, fastboot, Torsten Kaiser, ak,
	linux-ide, Vivek Goyal, Pavel Machek, linux1394-devel,
	linux-usb-devel, Steve Fox, Alistair John Strachan, linux-acpi,
	Mel Gorman, Michael S. Tsirkin, jgarzik, Prakash Punnoor,
	len.brown, Olaf Hering, linux-pm, Trond Myklebust, Alex Romosan,
	Linus Torvalds, Dave Kleikamp, Antonino Daplas, perex, discuss,
	linux-fbdev-devel, linuxppc-dev, netdev,
	Linux Kernel Mailing List, Jens Axboe, Sukadev Bhattiprolu,
	Stefan Richter, ebiederm, Ernst Herzberg
In-Reply-To: <20061007214620.GB8810@stusta.de>

Hi,

Adrian Bunk wrote:
> This email lists some known regressions in 2.6.19-rc1 compared to 2.6.18
> that are not yet fixed Linus' tree.
> 
> If you find your name in the Cc header, you are either submitter of one
> of the bugs, maintainer of an affectected subsystem or driver, a patch
> of you was declared guilty for a breakage or I'm considering you in any
> other way possibly involved with one or more of these issues.
> 
> Due to the huge amount of recipients, please trim the Cc when answering.
> 
> 

> 
> Subject    : ueagle-atm Oops
> References : http://lkml.org/lkml/2006/10/6/390
> Submitter  : Ernst Herzberg <list-lkml@net4u.de>
> Handled-By : Matthieu Castet <castet.matthieu@free.fr>
> Status     : unknown
> 
> 
Guilty     :
http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e7ccdfec087f02930c5cdc81143d4a045ae8d361

Patch available at 
https://mail.gna.org/public/ueagleatm-dev/2006-10/msg00022.html , but 
some cleaning is need (I wasn't aware of "USB: fix __must_check warnings 
in drivers/usb/atm/" patch).

Matthieu

^ permalink raw reply

* Re: [PATCH] powerpc: Don't get PCI IRQ from OF for devices with no IRQ
From: Olaf Hering @ 2006-10-08  9:42 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Paul Mackerras
In-Reply-To: <1160030441.22232.33.camel@localhost.localdomain>

On Thu, Oct 05, Benjamin Herrenschmidt wrote:

> This patch adds checking of the PCI_INTERRUPT_PIN register before
> using standard OF parsing to retreive PCI interrupts. The reason is
> that some PCI devices may have no PCI interrupt, though they may have
> interrupts attached via other means. In this case, we shall not use
> irq->pdev, but device-specific code can later retreive those interrupts
> instead.
> 
> Without that patch, Maple and derivatives don't get the right interrupt
> for the second IDE channel as the linux IDE code fallsback to the PCI
> irq instead of trying to use the legacy ones for the on-board controller
> (which has no PCI_INTERRUPT_PIN). Having no PCI IRQ assign to it (as it
> doesn't request any) fixes it.

This breaks at least G5, IDE is probed twice, the first try uses IRQ 0.
SATA doesnt get an interrupt either.

^ permalink raw reply

* Re: USB Disk Support
From: Jeff Stevens @ 2006-10-08 16:26 UTC (permalink / raw)
  To: Jeff Stevens, linuxppc-embedded
In-Reply-To: <20061007210105.23485.qmail@web33402.mail.mud.yahoo.com>

I have more information.  I am using a Phillips
ISP1562 USB host controller.  I ran the same kernel
config on the actual Luan board (with an ISP1563 PCI
eval board from Phillips), and the USB storage works
fine.  I compared the dmesg from both the Luan board
and our 440SP custom system, and here are the
differences:

The custom system stops at:
...
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage:  25 00 00 00 00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x3 L 8 F 128
Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_sglist: xfer 8
bytes, 1 entries
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: command_abort called
usb-storage: usb_stor_stop_transport called
usb-storage: -- cancelling URB

It seems to fail on Attempting to get CSW...  On the
Luan board it gets passed this:

usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage:  25 00 00 00 00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x3 L 8 F 128
Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_sglist: xfer 8
bytes, 1 entries
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x3 R 0 Stat
0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE (6 bytes)
usb-storage:  1a 00 3f 00 c0 00
usb-storage: Bulk Command S 0x43425355 T 0x4 L 192 F
128 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
... <continues>

Could this be a noisy usb port?  The USB controller
used is the same, the only difference is that on the
custom board, the USB controller is onboard, where as
on the Luan board it is a PCI card.  U-boot is also
using practically the same board specific config file
and board file, other than the flash and DDR stuff. 
On the custom board, the card reader never ends up in
/proc/scsi/scsi, but it does on the luan board.

Thanks,
   Jeff Stevens


--- Jeff Stevens <jsteve17@yahoo.com> wrote:

> I am having issues getting a uDiskOnChip to mount or
> fdisk under linux.  I have a board running U-Boot on
> a
> AMCC 440SP platform.  Linux seems to find the
> uDiskOnChip fine, however, when I try to fdisk or
> mount the device, the console hangs.  I have added
> SCSI, SCSI storage, USB, USB OHCI, USB EHCI, USB
> Mass
> Storage.  Here is my dmesg:
> 
> bash-3.00# dmesg | grep -i usb
> usbcore: registered new driver usbfs
> usbcore: registered new driver hub
> usbmon: debugfs is not available
> drivers/usb/core/inode.c: creating file 'devices'
> drivers/usb/core/inode.c: creating file '001'
> ehci_hcd 0002:02:08.2: new USB bus registered,
> assigned bus number 1
> ehci_hcd 0002:02:08.2: supports USB remote wakeup
> ehci_hcd 0002:02:08.2: USB 2.0 started, EHCI 0.95,
> driver 10 Dec 2004
> usb usb1: default language 0x0409
> usb usb1: new device strings: Mfr=3, Product=2,
> SerialNumber=1
> usb usb1: Product: EHCI Host Controller
> usb usb1: Manufacturer: Linux 2.6.17.9 ehci_hcd
> usb usb1: SerialNumber: 0002:02:08.2
> usb usb1: configuration #1 chosen from 1 choice
> usb usb1: adding 1-0:1.0 (config #1, interface 0)
> hub 1-0:1.0: usb_probe_interface
> hub 1-0:1.0: usb_probe_interface - got id
> hub 1-0:1.0: USB hub found
> drivers/usb/core/inode.c: creating file '001'
> ohci_hcd: 2005 April 22 USB 1.1 'Open' Host
> Controller
> (OHCI) Driver (PCI)
> drivers/usb/core/inode.c: creating file '002'
> ohci_hcd 0002:02:08.0: new USB bus registered,
> assigned bus number 2
> usb usb2: default language 0x0409
> usb usb2: new device strings: Mfr=3, Product=2,
> SerialNumber=1
> usb usb2: Product: OHCI Host Controller
> usb usb2: Manufacturer: Linux 2.6.17.9 ohci_hcd
> usb usb2: SerialNumber: 0002:02:08.0
> usb usb2: configuration #1 chosen from 1 choice
> usb usb2: adding 2-0:1.0 (config #1, interface 0)
> hub 2-0:1.0: usb_probe_interface
> hub 2-0:1.0: usb_probe_interface - got id
> hub 2-0:1.0: USB hub found
> hub 2-0:1.0: no power switching (usb 1.0)
> usb 1-1: new high speed USB device using ehci_hcd
> and
> address 2
> usb 1-1: default language 0x0409
> usb 1-1: new device strings: Mfr=1, Product=2,
> SerialNumber=3
> usb 1-1: Product: uDiskOnChip
> usb 1-1: Manufacturer: M-Systems
> usb 1-1: SerialNumber: 98B0FB510031E86E
> usb 1-1: configuration #1 chosen from 1 choice
> drivers/usb/core/inode.c: creating file '001'
> drivers/usb/core/inode.c: creating file '003'
> ohci_hcd 0002:02:08.1: new USB bus registered,
> assigned bus number 3
> usb 1-1: adding 1-1:1.0 (config #1, interface 0)
> drivers/usb/core/inode.c: creating file '002'
> usb usb3: default language 0x0409
> usb usb3: new device strings: Mfr=3, Product=2,
> SerialNumber=1
> usb usb3: Product: OHCI Host Controller
> usb usb3: Manufacturer: Linux 2.6.17.9 ohci_hcd
> usb usb3: SerialNumber: 0002:02:08.1
> usb usb3: configuration #1 chosen from 1 choice
> usb usb3: adding 3-0:1.0 (config #1, interface 0)
> hub 3-0:1.0: usb_probe_interface
> hub 3-0:1.0: usb_probe_interface - got id
> hub 3-0:1.0: USB hub found
> hub 3-0:1.0: no power switching (usb 1.0)
> drivers/usb/core/inode.c: creating file '001'
> Initializing USB Mass Storage driver...
> usb-storage 1-1:1.0: usb_probe_interface
> usb-storage 1-1:1.0: usb_probe_interface - got id
> usb-storage: USB Mass Storage device detected
> usb-storage: -- associate_dev
> usb-storage: Vendor: 0x08ec, Product: 0x1000,
> Revision: 0x0200
> usb-storage: Interface Subclass: 0x06, Protocol:
> 0x50
> usb-storage: Transport: Bulk
> usb-storage: Protocol: Transparent SCSI
> scsi0 : SCSI emulation for USB Mass Storage devices
> usb-storage: *** thread sleeping.
> usbcore: registered new driver usb-storage
> USB Mass Storage support registered.
> usb-storage: device found at 2
> usb-storage: waiting for device to settle before
> scanning
> usb-storage: usb_stor_control_msg: rq=fe rqtype=a1
> value=0000 index=00 len=1
> usb-storage: GetMaxLUN command result is 1, data is
> 0
> usb-storage: queuecommand called
> usb-storage: *** thread awakened.
> usb-storage: Command INQUIRY (6 bytes)
> usb-storage:  12 00 00 00 24 00
> usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F
> 128 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31
> bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: usb_stor_bulk_transfer_sglist: xfer 36
> bytes, 1 entries
> usb-storage: Status code 0; transferred 36/36
> usb-storage: -- transfer complete
> usb-storage: Bulk data transfer result 0x0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13
> bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat
> 0x0
> usb-storage: scsi cmd done, result=0x0
> usb-storage: *** thread sleeping.
> usb-storage: queuecommand called
> usb-storage: *** thread awakened.
> usb-storage: Command TEST_UNIT_READY (6 bytes)
> usb-storage:  00 00 00 00 00 00
> usb-storage: Bulk Command S 0x43425355 T 0x2 L 0 F 0
> Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31
> bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13
> bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat
> 0x0
> usb-storage: scsi cmd done, result=0x0
> usb-storage: *** thread sleeping.
> usb-storage: queuecommand called
> usb-storage: *** thread awakened.
> usb-storage: Command READ_CAPACITY (10 bytes)
> usb-storage:  25 00 00 00 00 00 00 00 00 00
> usb-storage: Bulk Command S 0x43425355 T 0x3 L 8 F
> 128
> Trg 0 LUN 0 CL 10
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31
> bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: usb_stor_bulk_transfer_sglist: xfer 8
> bytes, 1 entries
> usb-storage: Status code 0; transferred 8/8
> usb-storage: -- transfer complete
> usb-storage: Bulk data transfer result 0x0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13
> bytes
> usb-storage: command_abort called
> usb-storage: usb_stor_stop_transport called
> usb-storage: -- cancelling URB
> 
> 
>
-------------------------------------------------------
> And a few other things:
> 
> bash-3.00# cat /proc/bus/usb/devices
> 
> T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1
> Spd=12  MxCh= 1
> B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64
> #Cfgs=  1
> P:  Vendor=0000 ProdID=0000 Rev= 2.06
> S:  Manufacturer=Linux 2.6.17.9 ohci_hcd
> S:  Product=OHCI Host Controller
> S:  SerialNumber=0002:02:08.1
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00
> Prot=00
> Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
> 
> T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1
> Spd=12  MxCh= 1
> B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64
> #Cfgs=  1
> P:  Vendor=0000 ProdID=0000 Rev= 2.06
> S:  Manufacturer=Linux 2.6.17.9 ohci_hcd
> S:  Product=OHCI Host Controller
> S:  SerialNumber=0002:02:08.0
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00
> Prot=00
> Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
> 
> T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1
> Spd=480 MxCh= 2
> B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64
> #Cfgs=  1
> P:  Vendor=0000 ProdID=0000 Rev= 2.06
> S:  Manufacturer=Linux 2.6.17.9 ehci_hcd
> S:  Product=EHCI Host Controller
> S:  SerialNumber=0002:02:08.2
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00
> Prot=00
> Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=256ms
> 
> T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2
> Spd=480 MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64
> #Cfgs=  1
> P:  Vendor=08ec ProdID=1000 Rev= 2.00
> S:  Manufacturer=M-Systems
> S:  Product=uDiskOnChip
> S:  SerialNumber=98B0FB510031E86E
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=140mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06
> Prot=50
> Driver=usb-storage
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> 
> bash-3.00# cat /proc/scsi/scsi
> Attached devices:
> 
> 
> It's probably just a kernel config issue, but I'm
> not
> sure what else to try.  I would appreciate any
> input!
> 
> Thanks,
>    Jeff
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
>
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply

* Re: [POWERPC] Don't get PCI IRQ from OF for devices with no IRQ
From: Benjamin Herrenschmidt @ 2006-10-08 20:53 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev list
In-Reply-To: <200610071959.k97JxIK9026331@hera.kernel.org>

On Sat, 2006-10-07 at 19:59 +0000, Linux Kernel Mailing List wrote:
> commit 41550c5128150175197257b6ceab2cd50dea7b51
> tree 9406c5680e5e7fd49804fe95104453b272533f28
> parent c998de146061db17787c1a31a3db1989f1341fdf
> author Benjamin Herrenschmidt <benh@kernel.crashing.org> 1160030441 +1000
> committer Paul Mackerras <paulus@samba.org> 1160133041 +1000
> 
> [POWERPC] Don't get PCI IRQ from OF for devices with no IRQ

Hi Linus !

Please revert this one for now. It seems to break G5s :( Looks like PCI
cells inside Apple IO ASICs don't have a PCI_INTERRUPT_LINE set. I need
to figure out a better fix.

Cheers,
Ben.

> This patch adds checking of the PCI_INTERRUPT_PIN register before
> using standard OF parsing to retreive PCI interrupts. The reason is
> that some PCI devices may have no PCI interrupt, though they may have
> interrupts attached via other means. In this case, we shall not use
> irq->pdev, but device-specific code can later retreive those interrupts
> instead.
> 
> Without that patch, Maple and derivatives don't get the right interrupt
> for the second IDE channel as the linux IDE code fallsback to the PCI
> irq instead of trying to use the legacy ones for the on-board controller
> (which has no PCI_INTERRUPT_PIN). Having no PCI IRQ assign to it (as it
> doesn't request any) fixes it.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
> 
>  arch/powerpc/kernel/prom_parse.c |   17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
> index 603dff3..17fcb48 100644
> --- a/arch/powerpc/kernel/prom_parse.c
> +++ b/arch/powerpc/kernel/prom_parse.c
> @@ -914,6 +914,17 @@ int of_irq_map_pci(struct pci_dev *pdev,
>  	u8 pin;
>  	int rc;
>  
> +	/* We need to first check if the PCI device has a PCI interrupt at all
> +	 * since we have cases where the device-node might expose non-PCI
> +	 * interrupts, but the device has no PCI interrupt to it
> +	 */
> +	rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
> +	if (rc != 0)
> +		return rc;
> +	/* No pin, exit */
> +	if (pin == 0)
> +		return -ENODEV;
> +
>  	/* Check if we have a device node, if yes, fallback to standard OF
>  	 * parsing
>  	 */
> @@ -925,12 +936,6 @@ int of_irq_map_pci(struct pci_dev *pdev,
>  	 * interrupt spec.  we assume #interrupt-cells is 1, which is standard
>  	 * for PCI. If you do different, then don't use that routine.
>  	 */
> -	rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
> -	if (rc != 0)
> -		return rc;
> -	/* No pin, exit */
> -	if (pin == 0)
> -		return -ENODEV;
>  
>  	/* Now we walk up the PCI tree */
>  	lspec = pin;
> -
> To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: powerpc: Fix make rules for dtc
From: David Gibson @ 2006-10-09  0:29 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <3711678A-7AA9-493F-B046-2F459604C028@kernel.crashing.org>


On Thu, Oct 05, 2006 at 07:58:59PM +0200, Segher Boessenkool wrote:
> >  clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
> > -		$(obj)/empty.c
> > +		$(obj)/empty.c *.dtb
> 
> If this wildcard works at all, it will still do the wrong thing:
> deleting all .dtb files (even the ones that the Makefile cannot
> create again, e.g., the user put them in the tree manually) is
> at best not very polite.

It certainly works at all (the preceding $(obj)/empty.c, however, is
wrong, I've sent a separate patch for that).  One could say the same
thing for *.o in clean targets, though I guess adding .dtb files is
rather more likely.  However, I can't seen an obvious way of
generating a list of the re-creatable dtbs, without an explicit
listing of every file in arch/powerpc/boot/dts which sounds like a bit
of a pain.  Suggestions?

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [PATCH] powerpc: make U4 PCIe work on maple (#3)
From: Benjamin Herrenschmidt @ 2006-10-09  3:25 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

The Maple support code was missing code for U4/CPC945 PCIe. This adds
it, enabling it to work on tigerwood boards, and possibly also js21
using SLOF. Also disable an obsolete firmware workaround.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/arch/powerpc/platforms/maple/pci.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/maple/pci.c	2006-10-05 16:00:29.000000000 +1000
+++ linux-work/arch/powerpc/platforms/maple/pci.c	2006-10-09 12:02:43.000000000 +1000
@@ -8,7 +8,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#define DEBUG
+#undef DEBUG
 
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -16,6 +16,7 @@
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
+#include <linux/irq.h>
 
 #include <asm/sections.h>
 #include <asm/io.h>
@@ -33,7 +34,7 @@
 #define DBG(x...)
 #endif
 
-static struct pci_controller *u3_agp, *u3_ht;
+static struct pci_controller *u3_agp, *u3_ht, *u4_pcie;
 
 static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
 {
@@ -287,6 +288,114 @@ static struct pci_ops u3_ht_pci_ops =
 	u3_ht_write_config
 };
 
+static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off)
+{
+	return (1 << PCI_SLOT(devfn))	|
+	       (PCI_FUNC(devfn) << 8)	|
+	       ((off >> 8) << 28) 	|
+	       (off & 0xfcu);
+}
+
+static unsigned int u4_pcie_cfa1(unsigned int bus, unsigned int devfn,
+				 unsigned int off)
+{
+        return (bus << 16)		|
+	       (devfn << 8)		|
+	       ((off >> 8) << 28)	|
+	       (off & 0xfcu)		| 1u;
+}
+
+static volatile void __iomem *u4_pcie_cfg_access(struct pci_controller* hose,
+                                        u8 bus, u8 dev_fn, int offset)
+{
+        unsigned int caddr;
+
+        if (bus == hose->first_busno)
+                caddr = u4_pcie_cfa0(dev_fn, offset);
+        else
+                caddr = u4_pcie_cfa1(bus, dev_fn, offset);
+
+        /* Uninorth will return garbage if we don't read back the value ! */
+        do {
+                out_le32(hose->cfg_addr, caddr);
+        } while (in_le32(hose->cfg_addr) != caddr);
+
+        offset &= 0x03;
+        return hose->cfg_data + offset;
+}
+
+static int u4_pcie_read_config(struct pci_bus *bus, unsigned int devfn,
+                               int offset, int len, u32 *val)
+{
+        struct pci_controller *hose;
+        volatile void __iomem *addr;
+
+        hose = pci_bus_to_host(bus);
+        if (hose == NULL)
+                return PCIBIOS_DEVICE_NOT_FOUND;
+        if (offset >= 0x1000)
+                return  PCIBIOS_BAD_REGISTER_NUMBER;
+        addr = u4_pcie_cfg_access(hose, bus->number, devfn, offset);
+        if (!addr)
+                return PCIBIOS_DEVICE_NOT_FOUND;
+        /*
+         * Note: the caller has already checked that offset is
+         * suitably aligned and that len is 1, 2 or 4.
+         */
+        switch (len) {
+        case 1:
+                *val = in_8(addr);
+                break;
+        case 2:
+                *val = in_le16(addr);
+                break;
+        default:
+                *val = in_le32(addr);
+                break;
+        }
+        return PCIBIOS_SUCCESSFUL;
+}
+static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
+                                int offset, int len, u32 val)
+{
+        struct pci_controller *hose;
+        volatile void __iomem *addr;
+
+        hose = pci_bus_to_host(bus);
+        if (hose == NULL)
+                return PCIBIOS_DEVICE_NOT_FOUND;
+        if (offset >= 0x1000)
+                return  PCIBIOS_BAD_REGISTER_NUMBER;
+        addr = u4_pcie_cfg_access(hose, bus->number, devfn, offset);
+        if (!addr)
+                return PCIBIOS_DEVICE_NOT_FOUND;
+        /*
+         * Note: the caller has already checked that offset is
+         * suitably aligned and that len is 1, 2 or 4.
+         */
+        switch (len) {
+        case 1:
+                out_8(addr, val);
+                (void) in_8(addr);
+                break;
+        case 2:
+                out_le16(addr, val);
+                (void) in_le16(addr);
+                break;
+        default:
+                out_le32(addr, val);
+                (void) in_le32(addr);
+                break;
+        }
+        return PCIBIOS_SUCCESSFUL;
+}
+
+static struct pci_ops u4_pcie_pci_ops =
+{
+        u4_pcie_read_config,
+        u4_pcie_write_config
+};
+
 static void __init setup_u3_agp(struct pci_controller* hose)
 {
 	/* On G5, we move AGP up to high bus number so we don't need
@@ -307,6 +416,26 @@ static void __init setup_u3_agp(struct p
 	u3_agp = hose;
 }
 
+static void __init setup_u4_pcie(struct pci_controller* hose)
+{
+        /* We currently only implement the "non-atomic" config space, to
+         * be optimised later.
+         */
+        hose->ops = &u4_pcie_pci_ops;
+        hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000);
+        hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000);
+
+        /* The bus contains a bridge from root -> device, we need to
+         * make it visible on bus 0 so that we pick the right type
+         * of config cycles. If we didn't, we would have to force all
+         * config cycles to be type 1. So we override the "bus-range"
+         * property here
+         */
+        hose->first_busno = 0x00;
+        hose->last_busno = 0xff;
+        u4_pcie = hose;
+}
+
 static void __init setup_u3_ht(struct pci_controller* hose)
 {
 	hose->ops = &u3_ht_pci_ops;
@@ -354,6 +483,10 @@ static int __init add_bridge(struct devi
 		setup_u3_ht(hose);
 		disp_name = "U3-HT";
 		primary = 1;
+        } else if (device_is_compatible(dev, "u4-pcie")) {
+                setup_u4_pcie(hose);
+                disp_name = "U4-PCIE";
+                primary = 0;
 	}
 	printk(KERN_INFO "Found %s PCI host bridge. Firmware bus number: %d->%d\n",
 		disp_name, hose->first_busno, hose->last_busno);
@@ -361,7 +494,6 @@ static int __init add_bridge(struct devi
 	/* Interpret the "ranges" property */
 	/* This also maps the I/O region and sets isa_io/mem_base */
 	pci_process_bridge_OF_ranges(hose, dev, primary);
-	pci_setup_phb_io(hose, primary);
 
 	/* Fixup "bus-range" OF property */
 	fixup_bus_range(dev);
@@ -376,8 +508,17 @@ void __init maple_pcibios_fixup(void)
 
 	DBG(" -> maple_pcibios_fixup\n");
 
-	for_each_pci_dev(dev)
-		pci_read_irq_line(dev);
+	for_each_pci_dev(dev) {
+		/* Fixup IRQ for PCIe host */
+		if (u4_pcie != NULL && dev->bus->number == 0 &&
+		    pci_bus_to_host(dev->bus) == u4_pcie) {
+			printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n");
+			dev->irq = irq_create_mapping(NULL, 1);
+			if (dev->irq != NO_IRQ)
+				set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
+		} else
+			pci_read_irq_line(dev);
+	}
 
 	DBG(" <- maple_pcibios_fixup\n");
 }
@@ -388,8 +529,10 @@ static void __init maple_fixup_phb_resou
 	
 	list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
 		unsigned long offset = (unsigned long)hose->io_base_virt - pci_io_base;
+
 		hose->io_resource.start += offset;
 		hose->io_resource.end += offset;
+
 		printk(KERN_INFO "PCI Host %d, io start: %llx; io end: %llx\n",
 		       hose->global_number,
 		       (unsigned long long)hose->io_resource.start,
@@ -431,6 +574,19 @@ void __init maple_pci_init(void)
 	if (ht && add_bridge(ht) != 0)
 		of_node_put(ht);
 
+        /*
+         * We need to call pci_setup_phb_io for the HT bridge first
+         * so it gets the I/O port numbers starting at 0, and we
+         * need to call it for the AGP bridge after that so it gets
+         * small positive I/O port numbers.
+         */
+        if (u3_ht)
+                pci_setup_phb_io(u3_ht, 1);
+        if (u3_agp)
+                pci_setup_phb_io(u3_agp, 0);
+        if (u4_pcie)
+                pci_setup_phb_io(u4_pcie, 0);
+
 	/* Fixup the IO resources on our host bridges as the common code
 	 * does it only for childs of the host bridges
 	 */
@@ -465,8 +621,11 @@ int maple_pci_get_legacy_ide_irq(struct 
 		return defirq;
 
 	np = pci_device_to_OF_node(pdev);
-	if (np == NULL)
+	if (np == NULL) {
+		printk("Failed to locate OF node for IDE %s\n",
+		       pci_name(pdev));
 		return defirq;
+	}
 	irq = irq_of_parse_and_map(np, channel & 0x1);
 	if (irq == NO_IRQ) {
 		printk("Failed to map onboard IDE interrupt for channel %d\n",
@@ -479,6 +638,9 @@ int maple_pci_get_legacy_ide_irq(struct 
 /* XXX: To remove once all firmwares are ok */
 static void fixup_maple_ide(struct pci_dev* dev)
 {
+	if (!machine_is(maple))
+		return;
+
 #if 0 /* Enable this to enable IDE port 0 */
 	{
 		u8 v;
@@ -495,7 +657,7 @@ static void fixup_maple_ide(struct pci_d
 	dev->resource[4].start = 0xcc00;
 	dev->resource[4].end = 0xcc10;
 #endif
-#if 1 /* Enable this to fixup IDE sense/polarity of irqs in IO-APICs */
+#if 0 /* Enable this to fixup IDE sense/polarity of irqs in IO-APICs */
 	{
 		struct pci_dev *apicdev;
 		u32 v;

^ permalink raw reply

* [PATCH] powerpc: Fix Maple secondary IDE interrupt
From: Benjamin Herrenschmidt @ 2006-10-09  3:27 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

The IDE driver will pick up the PCI IRQ for both channels on Maple
despite the fact that it's in legacy mode. This works around it by
"hiding" the PCI IRQ of the AMD8111 IDE controller when it's configured
in legacy mode on the Maple platform, thus causing the driver to call
pci_get_legacy_ide_irq() which will return the correct interrupts for
both channels.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


Index: linux-work/arch/powerpc/platforms/maple/pci.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/maple/pci.c	2006-10-09 11:50:35.000000000 +1000
+++ linux-work/arch/powerpc/platforms/maple/pci.c	2006-10-09 12:02:06.000000000 +1000
@@ -516,8 +516,21 @@ void __init maple_pcibios_fixup(void)
 			dev->irq = irq_create_mapping(NULL, 1);
 			if (dev->irq != NO_IRQ)
 				set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
-		} else
-			pci_read_irq_line(dev);
+			continue;
+		}
+
+		/* Hide AMD8111 IDE interrupt when in legacy mode so
+		 * the driver calls pci_get_legacy_ide_irq()
+		 */
+		if (dev->vendor == PCI_VENDOR_ID_AMD &&
+		    dev->device == PCI_DEVICE_ID_AMD_8111_IDE &&
+		    (dev->class & 5) != 5) {
+			dev->irq = NO_IRQ;
+			continue;
+		}
+
+		/* For all others, map the interrupt from the device-tree */
+		pci_read_irq_line(dev);
 	}
 
 	DBG(" <- maple_pcibios_fixup\n");

^ permalink raw reply

* [PATCH] Update maple defconfig
From: Benjamin Herrenschmidt @ 2006-10-09  3:28 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

This updates the Maple defconfig to 4 CPUs (along with current defaults)
to support the "tigerwood" 970MP evaluation board. 

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/arch/powerpc/configs/maple_defconfig
===================================================================
--- linux-work.orig/arch/powerpc/configs/maple_defconfig	2006-10-06 13:47:54.000000000 +1000
+++ linux-work/arch/powerpc/configs/maple_defconfig	2006-10-09 12:06:34.000000000 +1000
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc6
-# Sun Sep 10 10:24:55 2006
+# Linux kernel version: 2.6.18
+# Mon Oct  9 11:59:34 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -22,6 +22,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_PPC_UDBG_16550=y
 CONFIG_GENERIC_TBSYNC=y
+CONFIG_AUDIT_ARCH=y
 # CONFIG_DEFAULT_UIMAGE is not set
 
 #
@@ -34,7 +35,7 @@ CONFIG_PPC_FPU=y
 CONFIG_PPC_STD_MMU=y
 CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_SMP=y
-CONFIG_NR_CPUS=2
+CONFIG_NR_CPUS=4
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -51,10 +52,11 @@ CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-CONFIG_SYSCTL=y
+# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
@@ -62,7 +64,9 @@ CONFIG_IKCONFIG_PROC=y
 # CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
+# CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -71,12 +75,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
-CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -95,6 +99,7 @@ CONFIG_STOP_MACHINE=y
 #
 # Block layer
 #
+CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 
 #
@@ -114,16 +119,16 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # Platform support
 #
 CONFIG_PPC_MULTIPLATFORM=y
-# CONFIG_PPC_ISERIES is not set
 # CONFIG_EMBEDDED6xx is not set
 # CONFIG_APUS is not set
 # CONFIG_PPC_PSERIES is not set
+# CONFIG_PPC_ISERIES is not set
 # CONFIG_PPC_PMAC is not set
 CONFIG_PPC_MAPLE=y
+# CONFIG_PPC_PASEMI is not set
 # CONFIG_PPC_CELL is not set
 # CONFIG_PPC_CELL_NATIVE is not set
 # CONFIG_PPC_IBM_CELL_BLADE is not set
-# CONFIG_UDBG_RTAS_CONSOLE is not set
 CONFIG_U3_DART=y
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
@@ -157,6 +162,7 @@ CONFIG_IRQ_ALL_CPUS=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -184,6 +190,7 @@ CONFIG_GENERIC_ISA_DMA=y
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 # CONFIG_PCIEPORTBUS is not set
+# CONFIG_PCI_MULTITHREAD_PROBE is not set
 # CONFIG_PCI_DEBUG is not set
 
 #
@@ -211,6 +218,7 @@ CONFIG_PACKET_MMAP=y
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
@@ -232,10 +240,12 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_TUNNEL is not set
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
@@ -265,7 +275,6 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 
@@ -377,6 +386,7 @@ CONFIG_BLK_DEV_AMD74XX=y
 # CONFIG_BLK_DEV_CS5530 is not set
 # CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_JMICRON is not set
 # CONFIG_BLK_DEV_SC1200 is not set
 # CONFIG_BLK_DEV_PIIX is not set
 # CONFIG_BLK_DEV_IT821X is not set
@@ -399,6 +409,12 @@ CONFIG_IDEDMA_AUTO=y
 #
 # CONFIG_RAID_ATTRS is not set
 # CONFIG_SCSI is not set
+# CONFIG_SCSI_NETLINK is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -498,7 +514,7 @@ CONFIG_E1000=y
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_TIGON3=y
 # CONFIG_BNX2 is not set
-# CONFIG_MV643XX_ETH is not set
+# CONFIG_QLA3XXX is not set
 
 #
 # Ethernet (10000 Mbit)
@@ -545,6 +561,7 @@ CONFIG_TIGON3=y
 # Input device support
 #
 CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
 
 #
 # Userland interfaces
@@ -704,6 +721,7 @@ CONFIG_I2C_AMD8111=y
 #
 # Misc devices
 #
+# CONFIG_TIFM_CORE is not set
 
 #
 # Multimedia devices
@@ -779,7 +797,6 @@ CONFIG_USB_UHCI_HCD=y
 #
 # may also be needed; see USB_STORAGE Help for more information
 #
-# CONFIG_USB_STORAGE is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -802,6 +819,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -828,6 +846,7 @@ CONFIG_USB_MON=y
 CONFIG_USB_SERIAL=y
 # CONFIG_USB_SERIAL_CONSOLE is not set
 CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
 # CONFIG_USB_SERIAL_AIRPRIME is not set
 # CONFIG_USB_SERIAL_ARK3116 is not set
 # CONFIG_USB_SERIAL_BELKIN is not set
@@ -862,6 +881,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 # CONFIG_USB_SERIAL_KLSI is not set
 # CONFIG_USB_SERIAL_KOBIL_SCT is not set
 # CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
 # CONFIG_USB_SERIAL_NAVMAN is not set
 # CONFIG_USB_SERIAL_PL2303 is not set
 # CONFIG_USB_SERIAL_HP4X is not set
@@ -879,6 +899,7 @@ CONFIG_USB_EZUSB=y
 #
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
@@ -886,9 +907,9 @@ CONFIG_USB_EZUSB=y
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGETKIT is not set
-# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_PHIDGET is not set
 # CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
@@ -995,8 +1016,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
@@ -1129,6 +1152,7 @@ CONFIG_PLIST=y
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
@@ -1148,6 +1172,7 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
 # CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
@@ -1169,6 +1194,9 @@ CONFIG_BOOTX_TEXT=y
 # Cryptographic options
 #
 CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_MANAGER=m
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
@@ -1178,6 +1206,8 @@ CONFIG_CRYPTO_MD5=y
 # CONFIG_CRYPTO_SHA512 is not set
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set

^ permalink raw reply

* [PATCH] powerpc: Cell timebase bug workaround
From: Benjamin Herrenschmidt @ 2006-10-09  5:10 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

The Cell CPU timebase has an errata. When reading the entire 64 bits of
the timebase with one mftb instruction, there is a handful of cycles
window during which one might read a value with the low order 32 bits
already reset to 0x00000000 but the high order bits not yet incremeted
by one. Simply reading the timebase a second time if the low order bits
are 0 is enough (the second read will always miss that window).

Note that there is still a potential issue if the process gets
interrupted between the 2 reads for long enough that the second reads
pricely hits that same window on the next 32 bits wrap. However, this is
so extremely unlikely to happen that we choose not to do anything
against it (the 32 bits wrap happens every few seconds or so, in fact
every few minutes on IBM cell blades).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/arch/powerpc/kernel/vdso64/gettimeofday.S
===================================================================
--- linux-work.orig/arch/powerpc/kernel/vdso64/gettimeofday.S	2006-10-06 13:47:54.000000000 +1000
+++ linux-work/arch/powerpc/kernel/vdso64/gettimeofday.S	2006-10-09 13:28:54.000000000 +1000
@@ -11,6 +11,8 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
+
+#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
@@ -229,8 +231,13 @@ V_FUNCTION_BEGIN(__do_get_xsec)
 	xor	r0,r8,r8		/* create dependency */
 	add	r3,r3,r0
 
-	/* Get TB & offset it */
-	mftb	r7
+	/* Get TB & offset it. We use the MFTB macro which will generate
+	 * workaround code for Cell. The macro will generate the ELF bits
+	 * for the CPU feature fixup though those aren't actually applied
+	 * on the vDSO, which means that the workaround will always be
+	 * executed if CONFIG_PPC_CELL is set.
+	 */
+	MFTB(r7)
 	ld	r9,CFG_TB_ORIG_STAMP(r3)
 	subf	r7,r9,r7
 
Index: linux-work/include/asm-powerpc/cputable.h
===================================================================
--- linux-work.orig/include/asm-powerpc/cputable.h	2006-10-06 13:48:23.000000000 +1000
+++ linux-work/include/asm-powerpc/cputable.h	2006-10-09 13:30:02.000000000 +1000
@@ -144,6 +144,7 @@ extern void do_cpu_ftr_fixups(unsigned l
 #define CPU_FTR_CI_LARGE_PAGE		LONG_ASM_CONST(0x0000100000000000)
 #define CPU_FTR_PAUSE_ZERO		LONG_ASM_CONST(0x0000200000000000)
 #define CPU_FTR_PURR			LONG_ASM_CONST(0x0000400000000000)
+#define CPU_FTR_CELL_TB_BUG		LONG_ASM_CONST(0x0000800000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -332,7 +333,7 @@ extern void do_cpu_ftr_fixups(unsigned l
 #define CPU_FTRS_CELL	(CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
 	    CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
-	    CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE)
+	    CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG)
 #define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
 	    CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
 	    CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \
@@ -431,30 +432,34 @@ static inline int cpu_has_feature(unsign
 
 #ifdef __ASSEMBLY__
 
-#define BEGIN_FTR_SECTION		98:
+#define BEGIN_FTR_SECTION_NESTED(label)	label:
+#define BEGIN_FTR_SECTION		BEGIN_FTR_SECTION_NESTED(98)
 
 #ifndef __powerpc64__
-#define END_FTR_SECTION(msk, val)		\
+#define END_FTR_SECTION_NESTED(msk, val, label) \
 99:						\
 	.section __ftr_fixup,"a";		\
 	.align 2;				\
 	.long msk;				\
 	.long val;				\
-	.long 98b;				\
+	.long label##b;				\
 	.long 99b;				\
 	.previous
 #else /* __powerpc64__ */
-#define END_FTR_SECTION(msk, val)		\
+#define END_FTR_SECTION_NESTED(msk, val, label) \
 99:						\
 	.section __ftr_fixup,"a";		\
 	.align 3;				\
 	.llong msk;				\
 	.llong val;				\
-	.llong 98b;				\
+	.llong label##b;				\
 	.llong 99b;	 			\
 	.previous
 #endif /* __powerpc64__ */
 
+#define END_FTR_SECTION(msk, val)		\
+	END_FTR_SECTION_NESTED(msk, val, 98)
+
 #define END_FTR_SECTION_IFSET(msk)	END_FTR_SECTION((msk), (msk))
 #define END_FTR_SECTION_IFCLR(msk)	END_FTR_SECTION((msk), 0)
 #endif /* __ASSEMBLY__ */
Index: linux-work/include/asm-powerpc/ppc_asm.h
===================================================================
--- linux-work.orig/include/asm-powerpc/ppc_asm.h	2006-10-06 13:45:32.000000000 +1000
+++ linux-work/include/asm-powerpc/ppc_asm.h	2006-10-09 13:28:54.000000000 +1000
@@ -29,10 +29,10 @@
 BEGIN_FTR_SECTION;							\
 	mfspr	ra,SPRN_PURR;		/* get processor util. reg */	\
 END_FTR_SECTION_IFSET(CPU_FTR_PURR);					\
-BEGIN_FTR_SECTION;							\
-	mftb	ra;			/* or get TB if no PURR */	\
-END_FTR_SECTION_IFCLR(CPU_FTR_PURR);					\
-	ld	rb,PACA_STARTPURR(r13);				\
+BEGIN_FTR_SECTION_NESTED(96);						\
+	MFTB(ra);			/* or get TB if no PURR */	\
+END_FTR_SECTION_NESTED(CPU_FTR_PURR, 0, 96);				\
+	ld	rb,PACA_STARTPURR(r13);					\
 	std	ra,PACA_STARTPURR(r13);					\
 	subf	rb,rb,ra;		/* subtract start value */	\
 	ld	ra,PACA_USER_TIME(r13);					\
@@ -44,9 +44,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR);				
 BEGIN_FTR_SECTION;							\
 	mfspr	ra,SPRN_PURR;		/* get processor util. reg */	\
 END_FTR_SECTION_IFSET(CPU_FTR_PURR);					\
-BEGIN_FTR_SECTION;							\
-	mftb	ra;			/* or get TB if no PURR */	\
-END_FTR_SECTION_IFCLR(CPU_FTR_PURR);					\
+BEGIN_FTR_SECTION_NESTED(96);						\
+	MFTB(ra);			/* or get TB if no PURR */	\
+END_FTR_SECTION_NESTED(CPU_FTR_PURR, 0, 96);				\
 	ld	rb,PACA_STARTPURR(r13);				\
 	std	ra,PACA_STARTPURR(r13);					\
 	subf	rb,rb,ra;		/* subtract start value */	\
@@ -274,6 +274,18 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
 #define ISYNC_601
 #endif
 
+#ifdef CONFIG_PPC_CELL
+#define MFTB(dest)			\
+	mftb  dest;			\
+BEGIN_FTR_SECTION;			\
+	cmpwi dest,0;			\
+	bne+  97f;			\
+	mftb  dest;			\
+97:					\
+END_FTR_SECTION_IFSET(CPU_FTR_CELL_TB_BUG)
+#else
+#define MFTB(dest)			mftb dest
+#endif
 
 #ifndef CONFIG_SMP
 #define TLBSYNC
Index: linux-work/include/asm-powerpc/reg.h
===================================================================
--- linux-work.orig/include/asm-powerpc/reg.h	2006-10-09 12:03:34.000000000 +1000
+++ linux-work/include/asm-powerpc/reg.h	2006-10-09 13:28:54.000000000 +1000
@@ -617,9 +617,26 @@
 			asm volatile("mfspr %0," __stringify(rn) \
 				: "=r" (rval)); rval;})
 #define mtspr(rn, v)	asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
-
+#ifdef CONFIG_PPC_CELL
+#define mftb()		({unsigned long rval;				\
+			asm volatile(					\
+				"	mftb %0;\n"			\
+				"98:	cmpwi %0,0;\n"			\
+				"	bne+ 99f;\n"			\
+				"	mftb %0;\n"			\
+				"99:\n"					\
+				".section __ftr_fixup,\"a\"\n"		\
+				"	.llong %1\n"			\
+				"	.llong 0\n"			\
+				"	.llong 98b\n"			\
+				"	.llong 99b\n"			\
+				".previous"				\
+			: "=r" (rval) : "i" (CPU_FTR_CELL_TB_BUG)); rval;})
+#else
 #define mftb()		({unsigned long rval;	\
 			asm volatile("mftb %0" : "=r" (rval)); rval;})
+#endif
+
 #define mftbl()		({unsigned long rval;	\
 			asm volatile("mftbl %0" : "=r" (rval)); rval;})
 
Index: linux-work/include/asm-powerpc/time.h
===================================================================
--- linux-work.orig/include/asm-powerpc/time.h	2006-10-06 13:48:24.000000000 +1000
+++ linux-work/include/asm-powerpc/time.h	2006-10-09 13:28:54.000000000 +1000
@@ -85,26 +85,28 @@ struct div_result {
 /* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */
 static inline unsigned long get_tbl(void)
 {
-	unsigned long tbl;
-
 #if defined(CONFIG_403GCX)
+	unsigned long tbl;
 	asm volatile("mfspr %0, 0x3dd" : "=r" (tbl));
+	return tbl;
+#elif defined(CONFIG_PPC32)
+	return mftbl();
 #else
-	asm volatile("mftb %0" : "=r" (tbl));
+	return mftb();
 #endif
-	return tbl;
 }
 
 static inline unsigned int get_tbu(void)
 {
+#ifdef CONFIG_403GCX
 	unsigned int tbu;
-
-#if defined(CONFIG_403GCX)
 	asm volatile("mfspr %0, 0x3dc" : "=r" (tbu));
+	return tbu;
+#elif defined(CONFIG_PPC32)
+	return mftbu();
 #else
-	asm volatile("mftbu %0" : "=r" (tbu));
+	return mftb();
 #endif
-	return tbu;
 }
 
 static inline unsigned int get_rtcl(void)
Index: linux-work/include/asm-powerpc/timex.h
===================================================================
--- linux-work.orig/include/asm-powerpc/timex.h	2006-10-06 13:45:32.000000000 +1000
+++ linux-work/include/asm-powerpc/timex.h	2006-10-09 13:28:54.000000000 +1000
@@ -8,6 +8,7 @@
  */
 
 #include <asm/cputable.h>
+#include <asm/reg.h>
 
 #define CLOCK_TICK_RATE	1024000 /* Underlying HZ */
 
@@ -15,13 +16,11 @@ typedef unsigned long cycles_t;
 
 static inline cycles_t get_cycles(void)
 {
-	cycles_t ret;
-
 #ifdef __powerpc64__
-
-	__asm__ __volatile__("mftb %0" : "=r" (ret) : );
-
+	return mftb();
 #else
+	cycles_t ret;
+
 	/*
 	 * For the "cycle" counter we use the timebase lower half.
 	 * Currently only used on SMP.
@@ -39,9 +38,8 @@ static inline cycles_t get_cycles(void)
 		"	.long 99b\n"
 		".previous"
 		: "=r" (ret) : "i" (CPU_FTR_601));
-#endif
-
 	return ret;
+#endif
 }
 
 #endif	/* __KERNEL__ */

^ permalink raw reply

* Re: [PATCH] Add 8360 to platforms/83xx/Kconfig
From: Paul Mackerras @ 2006-10-09  6:24 UTC (permalink / raw)
  To: Kim Phillips; +Cc: linuxppc-dev
In-Reply-To: <20061006174006.1fe6c6e4.kim.phillips@freescale.com>

Kim Phillips writes:

> apparently this code didn't make it in last time,
> so I'm adding it back again here.

Not much of a commit message... :(

Care to resend with a paragraph saying what the patch does and why for
me?

Paul.

^ permalink raw reply

* Re: [PATCH] powerpc: Cell timebase bug workaround
From: Stephen Rothwell @ 2006-10-09  6:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Paul Mackerras
In-Reply-To: <1160370623.14601.42.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]

On Mon, 09 Oct 2006 15:10:22 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> Index: linux-work/arch/powerpc/kernel/vdso64/gettimeofday.S
> ===================================================================
> --- linux-work.orig/arch/powerpc/kernel/vdso64/gettimeofday.S	2006-10-06 13:47:54.000000000 +1000
> +++ linux-work/arch/powerpc/kernel/vdso64/gettimeofday.S	2006-10-09 13:28:54.000000000 +1000
> @@ -11,6 +11,8 @@
>   * as published by the Free Software Foundation; either version
>   * 2 of the License, or (at your option) any later version.
>   */
> +
> +#include <linux/config.h>

You don't need that (in fact someone just remoed them all).

>  #ifdef __ASSEMBLY__
>
> -#define BEGIN_FTR_SECTION		98:
> +#define BEGIN_FTR_SECTION_NESTED(label)	label:
> +#define BEGIN_FTR_SECTION		BEGIN_FTR_SECTION_NESTED(98)
>
>  #ifndef __powerpc64__
> -#define END_FTR_SECTION(msk, val)		\
> +#define END_FTR_SECTION_NESTED(msk, val, label) \
>  99:						\
>  	.section __ftr_fixup,"a";		\
>  	.align 2;				\
>  	.long msk;				\
>  	.long val;				\
> -	.long 98b;				\
> +	.long label##b;				\
>  	.long 99b;				\
>  	.previous
>  #else /* __powerpc64__ */
> -#define END_FTR_SECTION(msk, val)		\
> +#define END_FTR_SECTION_NESTED(msk, val, label) \
>  99:						\
>  	.section __ftr_fixup,"a";		\
>  	.align 3;				\
>  	.llong msk;				\
>  	.llong val;				\
> -	.llong 98b;				\
> +	.llong label##b;				\
>  	.llong 99b;	 			\
>  	.previous
>  #endif /* __powerpc64__ */
>
> +#define END_FTR_SECTION(msk, val)		\
> +	END_FTR_SECTION_NESTED(msk, val, 98)
> +

The above should be in a separate patch.

> +#ifdef CONFIG_PPC_CELL
> +#define MFTB(dest)			\
> +	mftb  dest;			\
> +BEGIN_FTR_SECTION;			\
> +	cmpwi dest,0;			\
> +	bne+  97f;			\
> +	mftb  dest;			\
> +97:					\
> +END_FTR_SECTION_IFSET(CPU_FTR_CELL_TB_BUG)

Why not branch back to the mftb if the lower word is zero (this would
also take care of the very unlikely "hitting the bug more than once" case
and the "normal" case would then not have to branch at all.  (And it uses
one less instruction.)

> +#ifdef CONFIG_PPC_CELL
> +#define mftb()		({unsigned long rval;				\
> +			asm volatile(					\
> +				"	mftb %0;\n"			\
> +				"98:	cmpwi %0,0;\n"			\
> +				"	bne+ 99f;\n"			\
> +				"	mftb %0;\n"			\
> +				"99:\n"					\

Ditto.

--
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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox