Re: [PATCH]: [MPC5200] Add ATA DMA support

2009-07-09 Thread Roman Fietze
Hallo,

On Monday 05 January 2009 16:31:33 Grant Likely wrote:

 DMA support is now in mainline, but it is disabled by
 default ...

I had problems using ATA DMA on an own MPC5200B board, too. This board
has no problems at all using DMA33 with DENX 2.4.25, with all kinds of
automotive disks from 20 to 40GB. I definitively tested all three
listed drives below, but we are using other drives as well
(e.g. Hitachi 20 and 40 GB variants).

On exactly those boards I'm now running the 2.6.30 from DENX. The
following harddisks work well on this board, including network traffic
in parallel (which sometimes was a problem on old kernels or MPC5200's
w/o a 'B'):

- Toshiba MK4036GA
- Hitachi HEJ423020F9AT00


But an old 20GB Seagate ST940813AM shows the following problem when
booting the system:

PHY: f0003000:00 - Link is Up - 100/Half
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
ata1.00: BMDMA stat 0x5
ata1.00: cmd ca/00:08:1f:10:9c/00:00:00:00:00/e0 tag 0 dma 4096 out
 res 51/84:08:1f:10:9c/00:00:00:00:00/e0 Emask 0x10 (ATA bus error)
ata1.00: status: { DRDY ERR }
ata1.00: error: { ICRC ABRT }
ata1: soft resetting link
ata1.00: configured for UDMA/33
ata1: EH complete


I think this is similar to the errors reported after the ATA DMA patch
for the MPC5200B was introduced in this mailing list.

I even tried to use some modified timings from the 2.4.25 kernel, but
(of course) w/o success.

Are there any other patches I should try? Anything I could do to help
you to get this problem fixed?


Roman

-- 
Roman Fietze  Telemotive AG  Büro Mühlhausen

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-12-19 Thread Grant Likely
On Tue, Nov 25, 2008 at 8:19 AM, Matt Sealey m...@genesi-usa.com wrote:


 On Tue, Nov 25, 2008 at 8:45 AM, Lehmann, Hans (Ritter Elektronik)
 hans.lehm...@ritter-elektronik.de wrote:

 Tim, Grant,

 just an info.

 Very often the Bestcomm-FEC crashed without any error logs if I initiate a
 transaction over FEC and save the file to disk (I rememeber I have read
 something like that). A restart of FEC don't work.
 But no I figured out, if I connect to the other ethernet port of our board
 (natsemi) the FEC will awake to life again, if I initiate a new transaction
 over natsemi. This seems a little oddly to me.

 Hi guys,

 We tried to get the SUSE guys to push the patch into openSUSE 11.1 release
 and the tests came back negative here too with regards to FEC support; for
 some odd reason, it does this;

 https://bugzilla.novell.com/show_bug.cgi?id=445856#c10

 There is some weird interaction here, but I can't imagine what it might be.
 Tim, did you ever see any ethernet problems like this?

It looks like something getting messed up during allocation of buffers
and not DMA operation related at all.  I don't see the problem here...

Digging deeper I think the problem is due to this:

   --- Comment #6 From Olaf Hering 2008-11-18 01:32:52 MST  ---

 Also, the patches do not seem to apply and compile with our kernel-source.
 bcom_task-bd changed to void*, this breaks sound/ppc/mpc52xx_ac97.c. It looks
 like an unneeded cosmetic change.
 The Kconfig changes are appearently also not required for an existing .config.

 I removed the bcom_task-bd  change.

The patch does depend on bcom_task-bd being (void *).  Without it the
calculation of BD offsets is entirely wrong in bcom_get_bd().

That being said, the next version of the patch will leave the pointer
as (bcom_bd *) and handle the offset calculation in a different way.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


AW: [PATCH]: [MPC5200] Add ATA DMA support

2008-11-25 Thread Lehmann, Hans (Ritter Elektronik)
Tim, Grant,

just an info.

Very often the Bestcomm-FEC crashed without any error logs if I initiate a 
transaction over FEC and save the file to disk (I rememeber I have read 
something like that). A restart of FEC don't work.   
But no I figured out, if I connect to the other ethernet port of our board 
(natsemi) the FEC will awake to life again, if I initiate a new transaction 
over natsemi. This seems a little oddly to me.

Cheers  

Mit freundlichen Grüßen

Hans Lehmann
Softwareentwicklung

Telefon +49 (0)2191-67-2520
Fax +49 (0)2191-67-703408
e-mail  [EMAIL PROTECTED]

 

Ritter Elektronik GmbH
Leverkuser Straße 65
D-42897 Remscheid
www.ritter-elektronik.de http://www.ritter-elektronik.de/start.html 

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader
Sitz der Gesellschaft: Oberhausen
HRB 17168 Duisburg  /  USt-ID DE 814009849



___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-11-25 Thread Matt Sealey
On Tue, Nov 25, 2008 at 8:45 AM, Lehmann, Hans (Ritter Elektronik) 
[EMAIL PROTECTED] wrote:

 Tim, Grant,

 just an info.

 Very often the Bestcomm-FEC crashed without any error logs if I initiate a
 transaction over FEC and save the file to disk (I rememeber I have read
 something like that). A restart of FEC don't work.
 But no I figured out, if I connect to the other ethernet port of our board
 (natsemi) the FEC will awake to life again, if I initiate a new transaction
 over natsemi. This seems a little oddly to me.


Hi guys,

We tried to get the SUSE guys to push the patch into openSUSE 11.1 release
and the tests came back negative here too with regards to FEC support; for
some odd reason, it does this;

https://bugzilla.novell.com/show_bug.cgi?id=445856#c10

There is some weird interaction here, but I can't imagine what it might be.
Tim, did you ever see any ethernet problems like this?

-- 
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

AW: [PATCH]: [MPC5200] Add ATA DMA support

2008-11-25 Thread Lehmann, Hans (Ritter Elektronik)
Tim, Grant 
 
here are some more information. 
I think there is a also a problem with memory after FEC crasched.
 
[EMAIL PROTECTED]:~ free
  total used free   shared  buffers
   Mem:   12710026424   1006760  432
  Swap:000
Total:   12710026424   100676
[EMAIL PROTECTED]:~
[EMAIL PROTECTED]:~
[EMAIL PROTECTED]:~ ifdown eth0
net eth0: queues didn't drain
net eth0:   tx: index: 10, outdex: 6
net eth0:   rx: index: 117, outdex: 118
[EMAIL PROTECTED]:~ ifup eth0
net eth0: attached phy 0 to driver Generic PHY
[EMAIL PROTECTED]:~ freePHY: f0003000:00 - Link is Up - 100/Full
[EMAIL PROTECTED]:~ free
  total used free   shared  buffers
  Mem:   12710035028920720  760
 Swap:000
Total:   1271003502892072
 
Cheers


Mit freundlichen Grüßen

Hans Lehmann

Softwareentwicklung

Telefon +49 (0)2191-67-2520

Fax +49 (0)2191-67-703408

e-mail  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 

Ritter Elektronik GmbH

Leverkuser Straße 65

D-42897 Remscheid

www.ritter-elektronik.de http://www.ritter-elektronik.de/start.html 

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader

Sitz der Gesellschaft: Oberhausen

HRB 17168 Duisburg  /  USt-ID DE 814009849

 



Von: Matt Sealey [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 25. November 2008 16:19
An: Lehmann, Hans (Ritter Elektronik)
Cc: Tim Yamin; Grant Likely; linuxppc-dev@ozlabs.org
Betreff: Re: [PATCH]: [MPC5200] Add ATA DMA support




On Tue, Nov 25, 2008 at 8:45 AM, Lehmann, Hans (Ritter Elektronik) [EMAIL 
PROTECTED] wrote:


Tim, Grant,

just an info.

Very often the Bestcomm-FEC crashed without any error logs if I 
initiate a transaction over FEC and save the file to disk (I rememeber I have 
read something like that). A restart of FEC don't work.
But no I figured out, if I connect to the other ethernet port of our 
board (natsemi) the FEC will awake to life again, if I initiate a new 
transaction over natsemi. This seems a little oddly to me.



Hi guys,

We tried to get the SUSE guys to push the patch into openSUSE 11.1 release and 
the tests came back negative here too with regards to FEC support; for some odd 
reason, it does this;

https://bugzilla.novell.com/show_bug.cgi?id=445856#c10 


There is some weird interaction here, but I can't imagine what it might be. 
Tim, did you ever see any ethernet problems like this?

-- 
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


AW: [PATCH]: [MPC5200] Add ATA DMA support

2008-11-11 Thread Lehmann, Hans (Ritter Elektronik)
We take a vanilla kernel with rt11 patches from Ingo Mollnar.

Here are the section of my boot messages

ata: MPC52xx IDE/ATA libata driver
scsi0 : mpc52xx_ata
ata1: PATA max UDMA/33 ata_regs 0xf0003a00 irq 135
ata1.00: ATA-0: ELITE PRO CF CARD 1GB, 20070131, max MWDMA2
ata1.00: 2031120 sectors, multi 0: LBA
ata1.00: configured for MWDMA2
ata1.00: configured for MWDMA2
ata1: EH complete
scsi 0:0:0:0: Direct-Access ATA  ELITE PRO CF CAR 2007 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 2031120 512-byte hardware sectors (1040 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: [sda] 2031120 512-byte hardware sectors (1040 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support 
DPO or FUA
 sda: sda1 

Greetings

Mit freundlichen Grüßen

Hans Lehmann
Softwareentwicklung

Telefon +49 (0)2191-67-2520
Fax +49 (0)2191-67-703408
e-mail  [EMAIL PROTECTED]



Ritter Elektronik GmbH
Leverkuser Straße 65
D-42897 Remscheid
www.ritter-elektronik.de

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader
Sitz der Gesellschaft: Oberhausen
HRB 17168 Duisburg  /  USt-ID DE 814009849


-Ursprüngliche Nachricht-
Von: Matt Sealey [mailto:[EMAIL PROTECTED] Im Auftrag von Matt Sealey
Gesendet: Dienstag, 11. November 2008 15:36
An: Lehmann, Hans (Ritter Elektronik)
Cc: Tim Yamin; Grant Likely; linuxppc-dev@ozlabs.org
Betreff: Re: [PATCH]: [MPC5200] Add ATA DMA support

Oddly I built 2.6.27.2 with the patch and the Efika waited for a disk to 
appear and didn't get anywhere. If I set libata.dma=0 then it complained about 
missing symbols (but not with it enabled!).

This was a clean SUSE kernel from Factory, with only the ATA patch applied with 
a few hand-merges (pata_mpc52xx.c has had a line of whitespace removed at some 
point, but otherwise identical).

Lehmann, Hans (Ritter Elektronik) wrote:
 Tim, Grant,
 
 I have tested the patch on our MPC5200B based board with Kingston Elite Pro 
 CF-card and it worked fine with DMA2. I have port the patch back to 2.6.24.7 
 Kernel and I can't detect problems our errors, even with big files (40 mB) 
 over FEC wich I save to card . We get performance up to 10,5mB/s which is 
 near to the max. speed.
 
 Greetings
 
 
 
 
 Mit freundlichen Grüßen
 
 Hans Lehmann
 Softwareentwicklung
 
 Telefon   +49 (0)2191-67-2520
 Fax   +49 (0)2191-67-703408
 e-mail[EMAIL PROTECTED]
 
 
 
 Ritter Elektronik GmbH
 Leverkuser Straße 65
 D-42897 Remscheid
 www.ritter-elektronik.de
 
 Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader Sitz der 
 Gesellschaft: Oberhausen HRB 17168 Duisburg  /  USt-ID DE 814009849
 
 
 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]
 org] Im Auftrag von Tim Yamin
 Gesendet: Mittwoch, 13. August 2008 11:07
 An: Grant Likely
 Cc: linuxppc-dev@ozlabs.org
 Betreff: [WW Spam: medium] Re: [PATCH]: [MPC5200] Add ATA DMA support
 
 On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED] wrote:
 Sounds good to me.  You will get more testers that way.  I can pick 
 it up for -next if everything else looks good.
 
 Here are the new patches; tested against 2.6.27-rc3.
 
 Thanks,
 
 Tim
 
 ___
 Linuxppc-dev mailing list
 Linuxppc-dev@ozlabs.org
 https://ozlabs.org/mailman/listinfo/linuxppc-dev

--
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: AW: [PATCH]: [MPC5200] Add ATA DMA support

2008-11-11 Thread Matt Sealey

Hmm even with DMA built in my disk (Seagate 5400.8) still configured for
PIO4.

This is probably my fault. Tim, could you respin the patch anyway since
it doesn't apply cleanly to the 2.6.27 kernel? :)

This did work for me once but we were still using a SUSE kernel (from
11.0) to patch it onto and another interrupt controller patch crippled
performance so it wasn't a really good test..

--
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations

Lehmann, Hans (Ritter Elektronik) wrote:

We take a vanilla kernel with rt11 patches from Ingo Mollnar.

Here are the section of my boot messages

ata: MPC52xx IDE/ATA libata driver
scsi0 : mpc52xx_ata
ata1: PATA max UDMA/33 ata_regs 0xf0003a00 irq 135
ata1.00: ATA-0: ELITE PRO CF CARD 1GB, 20070131, max MWDMA2
ata1.00: 2031120 sectors, multi 0: LBA
ata1.00: configured for MWDMA2
ata1.00: configured for MWDMA2
ata1: EH complete
scsi 0:0:0:0: Direct-Access ATA  ELITE PRO CF CAR 2007 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 2031120 512-byte hardware sectors (1040 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: [sda] 2031120 512-byte hardware sectors (1040 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support 
DPO or FUA
 sda: sda1 


Greetings

Mit freundlichen Grüßen

Hans Lehmann
Softwareentwicklung

Telefon +49 (0)2191-67-2520
Fax +49 (0)2191-67-703408
e-mail  [EMAIL PROTECTED]



Ritter Elektronik GmbH
Leverkuser Straße 65
D-42897 Remscheid
www.ritter-elektronik.de

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader
Sitz der Gesellschaft: Oberhausen
HRB 17168 Duisburg  /  USt-ID DE 814009849


-Ursprüngliche Nachricht-
Von: Matt Sealey [mailto:[EMAIL PROTECTED] Im Auftrag von Matt Sealey
Gesendet: Dienstag, 11. November 2008 15:36
An: Lehmann, Hans (Ritter Elektronik)
Cc: Tim Yamin; Grant Likely; linuxppc-dev@ozlabs.org
Betreff: Re: [PATCH]: [MPC5200] Add ATA DMA support

Oddly I built 2.6.27.2 with the patch and the Efika waited for a disk to 
appear and didn't get anywhere. If I set libata.dma=0 then it complained about missing 
symbols (but not with it enabled!).

This was a clean SUSE kernel from Factory, with only the ATA patch applied with 
a few hand-merges (pata_mpc52xx.c has had a line of whitespace removed at some 
point, but otherwise identical).

Lehmann, Hans (Ritter Elektronik) wrote:

Tim, Grant,

I have tested the patch on our MPC5200B based board with Kingston Elite Pro 
CF-card and it worked fine with DMA2. I have port the patch back to 2.6.24.7 
Kernel and I can't detect problems our errors, even with big files (40 mB) over 
FEC wich I save to card . We get performance up to 10,5mB/s which is near to 
the max. speed.

Greetings




Mit freundlichen Grüßen

Hans Lehmann
Softwareentwicklung

Telefon +49 (0)2191-67-2520
Fax +49 (0)2191-67-703408
e-mail  [EMAIL PROTECTED]



Ritter Elektronik GmbH
Leverkuser Straße 65
D-42897 Remscheid
www.ritter-elektronik.de

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader Sitz der 
Gesellschaft: Oberhausen HRB 17168 Duisburg  /  USt-ID DE 814009849



-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]

org] Im Auftrag von Tim Yamin
Gesendet: Mittwoch, 13. August 2008 11:07
An: Grant Likely
Cc: linuxppc-dev@ozlabs.org
Betreff: [WW Spam: medium] Re: [PATCH]: [MPC5200] Add ATA DMA support

On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED] wrote:
Sounds good to me.  You will get more testers that way.  I can pick 
it up for -next if everything else looks good.

Here are the new patches; tested against 2.6.27-rc3.

Thanks,

Tim

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


--
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations



___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-11-11 Thread Lehmann, Hans (Ritter Elektronik)
Tim, Grant,

I have tested the patch on our MPC5200B based board with Kingston Elite Pro 
CF-card and it worked fine with DMA2. I have port the patch back to 2.6.24.7 
Kernel and I can't detect problems our errors, even with big files (40 mB) over 
FEC wich I save to card . We get performance up to 10,5mB/s which is near to 
the max. speed.

Greetings




Mit freundlichen Grüßen

Hans Lehmann
Softwareentwicklung

Telefon +49 (0)2191-67-2520
Fax +49 (0)2191-67-703408
e-mail  [EMAIL PROTECTED]



Ritter Elektronik GmbH
Leverkuser Straße 65
D-42897 Remscheid
www.ritter-elektronik.de

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader
Sitz der Gesellschaft: Oberhausen
HRB 17168 Duisburg  /  USt-ID DE 814009849


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Tim Yamin
Gesendet: Mittwoch, 13. August 2008 11:07
An: Grant Likely
Cc: linuxppc-dev@ozlabs.org
Betreff: [WW Spam: medium] Re: [PATCH]: [MPC5200] Add ATA DMA support

On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED] wrote:
 Sounds good to me.  You will get more testers that way.  I can pick it 
 up for -next if everything else looks good.

Here are the new patches; tested against 2.6.27-rc3.

Thanks,

Tim

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-11-11 Thread Matt Sealey

Oddly I built 2.6.27.2 with the patch and the Efika waited for a disk to 
appear
and didn't get anywhere. If I set libata.dma=0 then it complained about missing
symbols (but not with it enabled!).

This was a clean SUSE kernel from Factory, with only the ATA patch applied with
a few hand-merges (pata_mpc52xx.c has had a line of whitespace removed at some
point, but otherwise identical).

Lehmann, Hans (Ritter Elektronik) wrote:

Tim, Grant,

I have tested the patch on our MPC5200B based board with Kingston Elite Pro 
CF-card and it worked fine with DMA2. I have port the patch back to 2.6.24.7 
Kernel and I can't detect problems our errors, even with big files (40 mB) over 
FEC wich I save to card . We get performance up to 10,5mB/s which is near to 
the max. speed.

Greetings




Mit freundlichen Grüßen

Hans Lehmann
Softwareentwicklung

Telefon +49 (0)2191-67-2520
Fax +49 (0)2191-67-703408
e-mail  [EMAIL PROTECTED]



Ritter Elektronik GmbH
Leverkuser Straße 65
D-42897 Remscheid
www.ritter-elektronik.de

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader
Sitz der Gesellschaft: Oberhausen
HRB 17168 Duisburg  /  USt-ID DE 814009849


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Tim Yamin
Gesendet: Mittwoch, 13. August 2008 11:07
An: Grant Likely
Cc: linuxppc-dev@ozlabs.org
Betreff: [WW Spam: medium] Re: [PATCH]: [MPC5200] Add ATA DMA support

On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED] wrote:
Sounds good to me.  You will get more testers that way.  I can pick it 
up for -next if everything else looks good.


Here are the new patches; tested against 2.6.27-rc3.

Thanks,

Tim

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


--
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-10-29 Thread Matt Sealey



Grant Likely wrote:

On Wed, Aug 13, 2008 at 3:07 AM, Tim Yamin [EMAIL PROTECTED] wrote:

On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED] wrote:

Sounds good to me.  You will get more testers that way.  I can pick it
up for -next if everything else looks good.

Here are the new patches; tested against 2.6.27-rc3.


Hi Tim,

I finally got a chance to try out your patches on my lite5200 board.
Unfortunately, I wasn't able to get it to work easily.  I'm very early
in the debugging this issue, but I thought I'd send you my results in
case you've seen it before.  I've tried this with both an STEC 1GB CF
and a Transcend Ultra industrial 1GB CF card.


[snip]

Grant, Tim,

Any chance of this being picked up even though it doesn't work?

I'm going to be rolling a couple kernels this weekend (2.6.27.4
for Efika, ADS512101, 8610HPCN and 8641DHPCD) and I'll patch this
in and see what happens and give some more test data (since my
Efika is nice and trashed it won't matter if I trash it some
more).

We at Genesi still hold by the fact that ATA DMA is irrevocably
broken but hold some bittersweet hope that Freescale might fix
it after the fact in some useless future revision, the biggest
problem is that if nobody writes a driver for it, nobody experiences
the problem!

Once the patch is in maybe someone will be willing to use the
BestComm-assisted PIO idea as implemented in the bplan 2.6.19
kernel and compare results?

--
Matt Sealey [EMAIL PROTECTED]
Genesi, Manager, Developer Relations
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-09-14 Thread Grant Likely
On Wed, Aug 13, 2008 at 3:07 AM, Tim Yamin [EMAIL PROTECTED] wrote:
 On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED] wrote:
 Sounds good to me.  You will get more testers that way.  I can pick it
 up for -next if everything else looks good.

 Here are the new patches; tested against 2.6.27-rc3.

Hi Tim,

I finally got a chance to try out your patches on my lite5200 board.
Unfortunately, I wasn't able to get it to work easily.  I'm very early
in the debugging this issue, but I thought I'd send you my results in
case you've seen it before.  I've tried this with both an STEC 1GB CF
and a Transcend Ultra industrial 1GB CF card.

When the patch is enabled, Linux boots to the point of probing the ATA
bus.  The first attempt to probe uses UDMA/33 which ends in a timeout.
 Second attempt limits it to UDMA/25 which also times out.  Third
attempt falls back to PIO4 mode which then succeeds and the boot
process continues.  I haven't dug into the details of MPC5200 UDMA
support yet, but I'd like to know if you have any ideas.

Cheers,
g.

Full boot log below:

U-Boot 1.3.4-rc2 (Aug  1 2008 - 14:11:20)

CPU:   MPC5200B v2.2, Core v1.4 at 462 MHz
   Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
Board: Freescale Lite5200B
I2C:   85 kHz, ready
DRAM:  256 MB
FLASH: 32 MB
PCI:   Bus Dev VenId DevId Class Int
00  1a  1057  5809  0680  00
In:serial
Out:   serial
Err:   serial
Net:   FEC ETHERNET
IDE:   Bus 0: OK
  Device 0: Model: TRANSCEND Firm: 20070418 Ser#: 0   521143E8
Type: Hard Disk
Capacity: 971.5 MB = 0.9 GB (1989792 x 512)
  Device 1: Model:  Firm:  Ser#:
Type: # 1F #
Capacity: not available
Hit any key to stop autoboot:  0
= boot
Using FEC ETHERNET device
TFTP from server 192.168.0.200; our IP address is 192.168.0.70
Filename 'mpc5200/uImage.gcl'.
Load address: 0x40
Loading: #
 #
done
Bytes transferred = 1376680 (1501a8 hex)
Using FEC ETHERNET device
TFTP from server 192.168.0.200; our IP address is 192.168.0.70
Filename 'mpc5200/lite5200b.dtb'.
Load address: 0x3f
Loading: #
done
Bytes transferred = 8192 (2000 hex)
## Booting kernel from Legacy Image at 0040 ...
   Image Name:   Linux-2.6.27-rc6-00038-gc03fbd9
   Created:  2008-09-14   3:16:24 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:1376616 Bytes =  1.3 MB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Flattened Device Tree blob at 003f
   Booting using the fdt blob at 0x3f
[0.00] Using lite5200 machine description
[0.00] Linux version 2.6.27-rc6-00038-gc03fbd9
([EMAIL PROTECTED]) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #465 Sat
Sep 13 21:15:54 MDT 2008
[0.00] PCI host bridge /[EMAIL PROTECTED] (primary) ranges:
[0.00]  MEM 0x8000..0x9fff -
0x8000 Prefetch
[0.00]  MEM 0xa000..0xafff -
0xa000
[0.00]   IO 0xb000..0xb0ff - 0x
[0.00] Zone PFN ranges:
[0.00]   DMA  0x - 0x0001
[0.00]   Normal   0x0001 - 0x0001
[0.00] Movable zone start PFN for each node
[0.00] early_node_map[1] active PFN ranges
[0.00] 0: 0x - 0x0001
[0.00] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 65024
[0.00] Kernel command line: root=/dev/nfs rw
nfsroot=192.168.0.200:/home/srv/nfs/gdc/lite5200-1
ip=192.168.0.70:192.168.0.200:192.168.0.1:255.255.255.0:lite5200-1:eth0:off
console=ttyPSC0,115200
[0.00] MPC52xx PIC is up and running!
[0.00] PID hash table entries: 1024 (order: 10, 4096 bytes)
[0.00] clocksource: timebase mult[79364d9] shift[22] registered
[0.000194] console [ttyPSC0] enabled
[0.120005] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[0.128964] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[0.166748] Memory: 256572k/262144k available (2740k kernel code,
5272k reserved, 108k data, 108k bss, 168k init)
[0.177420] SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0,
CPUs=1, Nodes=1
[0.185307] Calibrating delay loop... 65.79 BogoMIPS (lpj=131584)
[0.280159] Mount-cache hash table entries: 512
[0.288690] net_namespace: 288 bytes
[0.293054] NET: Registered protocol family 16
[0.314694] PCI: Probing PCI hardware
[0.319804] bus: 00 index 0 io port: [ff, 100c03f2000]
[0.325470] bus: 00 index 1 mmio: [80009fff, a0b]
[0.331081] bus: 00 index 2 mmio: [a000afff, a4b]
[0.336808] DMA: MPC52xx BestComm driver
[0.341125] DMA: MPC52xx BestComm engine @f0001200 ok !
[0.355586] SCSI subsystem initialized
[0.376841] NET: Registered protocol family 2
[0.415732] 

Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-09-05 Thread WITTROCK


Tim Yamin-2 wrote:
 
 On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED]
 wrote:
 Sounds good to me.  You will get more testers that way.  I can pick it
 up for -next if everything else looks good.
 
 Here are the new patches; tested against 2.6.27-rc3.
 
 Thanks,
 
 Tim
 



I have been trying this patch against 2.6.26.3 on our own MPC5200B based
board.  I am using a seagate  ST980815A.  The drive mounts O.K, and I can
transfer small files, but during large transfers there is the following
problem.

.

## Booting kernel from Legacy Image at 0050 ...
   Image Name:   Linux-2.6.26.3
   Created:  2008-09-05  17:01:31 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:1409558 Bytes =  1.3 MB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Flattened Device Tree blob at 0040
   Booting using the fdt blob at 0x40
[0.00] Using m9000 machine description
[0.00] Linux version 2.6.26.3 ([EMAIL PROTECTED]) (gcc version
4.1.2) #2 Fri Sep 5 13:01:26 EDT 2008
[0.00] Zone PFN ranges:
[0.00]   DMA 0 -32767
[0.00]   Normal  32767 -32767



[0.796907] Driver 'sd' needs updating - please use bus_type methods
[0.803944] ata: MPC52xx IDE/ATA libata driver
[0.809300] scsi0 : mpc52xx_ata
[0.813246] ata1: PATA max UDMA/33 ata_regs 0xf0003a00 irq 135
[0.980196] ata1.00: ATA-6: ST980815A, 3.ALC, max UDMA/100
[0.985864] ata1.00: 156301488 sectors, multi 0: LBA48 
[1.004074] ata1.00: configured for UDMA/33
[1.009047] scsi 0:0:0:0: Direct-Access ATA  ST980815A   
3.AL PQ: 0 ANSI: 5
[1.018652] sd 0:0:0:0: [sda] 156301488 512-byte hardware sectors (80026
MB)
[1.026104] sd 0:0:0:0: [sda] Write Protect is off
[1.031419] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled,
doesn't support DPO or FUA
[1.041235] sd 0:0:0:0: [sda] 156301488 512-byte hardware sectors (80026
MB)
[1.048681] sd 0:0:0:0: [sda] Write Protect is off
[1.053994] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled,
doesn't support DPO or FUA
[1.063308]  sda: unknown partition table
[1.077092] sd 0:0:0:0: [sda] Attached SCSI disk

...

-sh-2.05b# 
-sh-2.05b# cp test.txt  /mnt/hd/writetest
-sh-2.05b# cp test2.txt  /mnt/hd/writetest
-sh-2.05b# cp -R  /test /mnt/hd/writetest
[  170.239726] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
frozen
[  170.247020] ata1.00: cmd ca/00:18:30:00:00/00:00:00:00:00/e0 tag 0 dma
12288 out
[  170.247033]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4
(timeout)
[  170.262180] ata1.00: status: { DRDY }
[  170.265995] ata1: soft resetting link
[  170.423867] ata1.00: revalidation failed (errno=-2)
[  170.428902] ata1: failed to recover some devices, retrying in 5 secs
[  175.435694] ata1: soft resetting link
[  175.591873] ata1.00: revalidation failed (errno=-2)
[  175.596909] ata1: failed to recover some devices, retrying in 5 secs
[  180.603697] ata1: soft resetting link
[  180.759873] ata1.00: revalidation failed (errno=-2)
[  180.764907] ata1.00: disabled
[  181.271725] ata1: soft resetting link
[  181.427741] ata1: EH complete
[  181.430856] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.437358] end_request: I/O error, dev sda, sector 48
[  181.442652] Buffer I/O error on device sda, logical block 6
[  181.448386] lost page write due to I/O error on sda
[  181.453429] Buffer I/O error on device sda, logical block 7
[  181.459165] lost page write due to I/O error on sda
[  181.464205] Buffer I/O error on device sda, logical block 8
[  181.469939] lost page write due to I/O error on sda
[  181.475076] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.481580] end_request: I/O error, dev sda, sector 8
[  181.486782] Buffer I/O error on device sda, logical block 1
[  181.492515] lost page write due to I/O error on sda
[  181.497653] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.504158] end_request: I/O error, dev sda, sector 0
[  181.509361] Buffer I/O error on device sda, logical block 0
[  181.515091] lost page write due to I/O error on sda
[  181.520252] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.526762] end_request: I/O error, dev sda, sector 180232
[  181.532441] Buffer I/O error on device sda, logical block 22540
[  181.538534] lost page write due to I/O error on sda
[  181.543784] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.550259] end_request: I/O error, dev sda, sector 180328
[  181.556223] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.562707] end_request: I/O error, dev sda, sector 181352
[  181.568659] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.575144] end_request: I/O error, dev sda, sector 182376
[  181.581094] sd 0:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
[  181.587579] 

Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-13 Thread Grant Likely
On Tue, Aug 12, 2008 at 11:57 PM, Tim Yamin [EMAIL PROTECTED] wrote:
 On Tue, Aug 12, 2008 at 6:30 PM, Daniel Schnell
 [EMAIL PROTECTED] wrote:
 Hi Tim,

 Continuing the discussion on the mailing list ...

 Looking at the original patch I don't undestand why you had to duplicate
 the bestcomm data structures and functions. The only apparent difference
 is that you have a minimal data length of 2 bytes instead of 1. Does
 this make any difference as the bd_size will be filled with the correct
 length value anyway ?

 The new version of the patch does this the correct way. I just
 haven't back ported this to the 2.6.24 version that I sent you.

While on this topic; have you had a chance to address the comments you
received on v2 of your patch?  I'm keen to get your change merged in,
but there are a few more things that need to be sorted out.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-13 Thread Tim Yamin
On Wed, Aug 13, 2008 at 7:02 AM, Grant Likely [EMAIL PROTECTED] wrote:
 While on this topic; have you had a chance to address the comments you
 received on v2 of your patch?  I'm keen to get your change merged in,
 but there are a few more things that need to be sorted out.

I'm still trying to determine whether the locking stuff is needed or
not. I think ultimately it might be a bug caused by hardware problems
at this end as opposed to silicon problems affecting everybody, but I
won't have an answer regarding this for a while because new hardware
needs to be prototyped to test out this theory.

I think the patch can probably be resubmitted with the locking stuff
removed, and the driver can be marked as experimental for everybody to
try out: if people experience any corruption problems I'm sure they
can speak up :-)

Any objections?

Tim
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-13 Thread Tim Yamin
On Wed, Aug 13, 2008 at 7:11 AM, Grant Likely [EMAIL PROTECTED] wrote:
 Sounds good to me.  You will get more testers that way.  I can pick it
 up for -next if everything else looks good.

Here are the new patches; tested against 2.6.27-rc3.

Thanks,

Tim
1) ata.h has dst_pa in the wrong place (needs to match what the BestComm
   task microcode in bcom_ata_task.c expects); fix it.

2) The BestComm ATA task priority was changed to maximum in bestcomm_priv.h;
   this fixes a deadlock issue I was experiencing when heavy DMA was
   occuring on both the ATA and Ethernet BestComm tasks, e.g. when
   downloading a large file over a LAN to disk.

3) The ATA BestComm driver uses bcom_ata_bd which is bigger than bcom_bd
   and this causes problems because the various bcom_... functions do not
   dereference the correct location. I've introduced bcom_get_bd which
   uses bcom_task.bd_size and this fixes the problem.

Signed-off-by: Tim Yamin [EMAIL PROTECTED]

diff -urp linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/ata.h linux-2.6.26-rc6-ata/arch/powerpc/sysdev/bestcomm/ata.h
--- linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/ata.h	2008-04-17 03:49:44.0 +0100
+++ linux-2.6.26-rc6-ata/arch/powerpc/sysdev/bestcomm/ata.h	2008-07-03 16:17:05.0 +0100
@@ -16,8 +16,8 @@
 
 struct bcom_ata_bd {
 	u32	status;
-	u32	dst_pa;
 	u32	src_pa;
+	u32	dst_pa;
 };
 
 extern struct bcom_task *
diff -urp linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm.h linux-2.6.26-rc6-ata/arch/powerpc/sysdev/bestcomm/bestcomm.h
--- linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm.h	2008-04-17 03:49:44.0 +0100
+++ linux-2.6.26-rc6-ata/arch/powerpc/sysdev/bestcomm/bestcomm.h	2008-07-03 16:17:05.0 +0100
@@ -38,7 +38,7 @@ struct bcom_task {
 	unsigned int	flags;
 	int		irq;
 
-	struct bcom_bd	*bd;
+	void		*bd;
 	phys_addr_t	bd_pa;
 	void		**cookie;
 	unsigned short	index;
@@ -140,15 +140,29 @@ bcom_queue_full(struct bcom_task *tsk)
 }
 
 /**
+ * bcom_get_bd - Get a BD from the queue
+ * @tsk: The BestComm task structure
+ * index: Index of the BD to fetch
+ */
+static inline struct bcom_bd
+*bcom_get_bd(struct bcom_task *tsk, unsigned int index)
+{
+	return tsk-bd + index * tsk-bd_size;
+}
+
+/**
  * bcom_buffer_done - Checks if a BestComm 
  * @tsk: The BestComm task structure
  */
 static inline int
 bcom_buffer_done(struct bcom_task *tsk)
 {
+	struct bcom_bd *bd;
 	if (bcom_queue_empty(tsk))
 		return 0;
-	return !(tsk-bd[tsk-outdex].status  BCOM_BD_READY);
+
+	bd = bcom_get_bd(tsk, tsk-outdex);
+	return !(bd-status  BCOM_BD_READY);
 }
 
 /**
@@ -160,16 +174,21 @@ bcom_buffer_done(struct bcom_task *tsk)
 static inline struct bcom_bd *
 bcom_prepare_next_buffer(struct bcom_task *tsk)
 {
-	tsk-bd[tsk-index].status = 0;	/* cleanup last status */
-	return tsk-bd[tsk-index];
+	struct bcom_bd *bd;
+
+	bd = bcom_get_bd(tsk, tsk-index);
+	bd-status = 0;	/* cleanup last status */
+	return bd;
 }
 
 static inline void
 bcom_submit_next_buffer(struct bcom_task *tsk, void *cookie)
 {
+	struct bcom_bd *bd = bcom_get_bd(tsk, tsk-index);
+
 	tsk-cookie[tsk-index] = cookie;
 	mb();	/* ensure the bd is really up-to-date */
-	tsk-bd[tsk-index].status |= BCOM_BD_READY;
+	bd-status |= BCOM_BD_READY;
 	tsk-index = _bcom_next_index(tsk);
 	if (tsk-flags  BCOM_FLAGS_ENABLE_TASK)
 		bcom_enable(tsk);
@@ -179,10 +198,12 @@ static inline void *
 bcom_retrieve_buffer(struct bcom_task *tsk, u32 *p_status, struct bcom_bd **p_bd)
 {
 	void *cookie = tsk-cookie[tsk-outdex];
+	struct bcom_bd *bd = bcom_get_bd(tsk, tsk-outdex);
+
 	if (p_status)
-		*p_status = tsk-bd[tsk-outdex].status;
+		*p_status = bd-status;
 	if (p_bd)
-		*p_bd = tsk-bd[tsk-outdex];
+		*p_bd = bd;
 	tsk-outdex = _bcom_next_outdex(tsk);
 	return cookie;
 }
diff -urp linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm_priv.h linux-2.6.26-rc6-ata/arch/powerpc/sysdev/bestcomm/bestcomm_priv.h
--- linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm_priv.h	2008-04-17 03:49:44.0 +0100
+++ linux-2.6.26-rc6-ata/arch/powerpc/sysdev/bestcomm/bestcomm_priv.h	2008-07-03 16:17:05.0 +0100
@@ -198,8 +198,8 @@ struct bcom_task_header {
 #define BCOM_IPR_SCTMR_1	2
 #define BCOM_IPR_FEC_RX		6
 #define BCOM_IPR_FEC_TX		5
-#define BCOM_IPR_ATA_RX		4
-#define BCOM_IPR_ATA_TX		3
+#define BCOM_IPR_ATA_RX		7
+#define BCOM_IPR_ATA_TX		7
 #define BCOM_IPR_SCPCI_RX	2
 #define BCOM_IPR_SCPCI_TX	2
 #define BCOM_IPR_PSC3_RX	2
This patch adds MDMA/UDMA support (using BestComm for DMA) on the MPC5200
platform. Patch requires the ATA BestComm fixes to function properly.

Based heavily on previous work by Freescale (Bernard Kuhn, John Rigby)
and Domen Puncer.

Using a SanDisk Extreme IV CF card I get read speeds of approximately
26.70 MB/sec.

Comments and testing would of course be very welcome.

Thanks,

Signed-off-by: Tim Yamin [EMAIL PROTECTED]

diff -urp linux-2.6.27-rc3/arch/powerpc/sysdev/bestcomm/bestcomm.c linux-2.6.27-rc3-ata/arch/powerpc/sysdev/bestcomm/bestcomm.c
--- 

RE: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-12 Thread Daniel Schnell
Hi Tim,

Continuing the discussion on the mailing list ...


Looking at the original patch I don't undestand why you had to duplicate
the bestcomm data structures and functions. The only apparent difference
is that you have a minimal data length of 2 bytes instead of 1. Does
this make any difference as the bd_size will be filled with the correct
length value anyway ?

Moreover what is the difference between bcom_submit_next_buffer() and
bcom_submit_next_buffer2() ? The same with bcom_retrieve_buffer() and
bcom_retrieve_buffer2(). Why are these functions implemented unequally ?


Best regards,

Daniel Schnell.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-12 Thread Tim Yamin
On Tue, Aug 12, 2008 at 6:30 PM, Daniel Schnell
[EMAIL PROTECTED] wrote:
 Hi Tim,

 Continuing the discussion on the mailing list ...

 Looking at the original patch I don't undestand why you had to duplicate
 the bestcomm data structures and functions. The only apparent difference
 is that you have a minimal data length of 2 bytes instead of 1. Does
 this make any difference as the bd_size will be filled with the correct
 length value anyway ?

The new version of the patch does this the correct way. I just
haven't back ported this to the 2.6.24 version that I sent you.

Tim
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-06 Thread Daniel Schnell
Hi,

Tim Yamin wrote:
 This patch adds MDMA/UDMA support (using BestComm for DMA) on the
 MPC5200 platform. 
 
 Based heavily on previous work by Freescale (Bernard Kuhn, John
 Rigby) and Domen Puncer. 
 
 Using a SanDisk Extreme IV CF card I get read speeds of approximately
 26.70 MB/sec. 
 
 The BestComm ATA task priority was changed to maximum in
 bestcomm_priv.h; this fixes a deadlock issue I was experiencing when
 heavy DMA was occuring on both the ATA and Ethernet BestComm tasks,
 e.g. when downloading a large file over a LAN to disk.   
 
 There's also what I believe to be a hardware bug if you have high
 levels of BestComm ATA DMA activity along with heavy LocalPlus Bus
 activity; the address bus seems to sometimes get corrupted with ATA
 commands while the LocalPlus Bus operation is still active (i.e. Chip
 Select is asserted).
 
 I've asked Freescale about this but have not received a reply yet --
 if anybody from Freescale has any ideas please contact me; I can
 supply some analyzer traces if needed. Therefore, for now, do not
 enable DMA if you need reliable LocalPlus Bus unless you do a fixup
 in your driver as follows:   
 
 Locking example:
 
 while (test_and_set_bit(0, pata_mpc52xx_ata_dma_lock) != 0)
 {
 struct bcom_task_2 *tsk = pata_mpc52xx_ata_dma_task;
 
 if(bcom_buffer_done_2(tsk))
 return 1;
 }
 
   return 0;
 
 (Save the return value to `flags`)
 
 Unlocking example:
 
 if(flags == 0)
 clear_bit(0, pata_mpc52xx_ata_dma_lock);
 
 Comments and testing would of course be very welcome.
 
 Thanks,
 
 Signed-off-by: Tim Yamin [EMAIL PROTECTED]

Sorry for testing this patch so late, but I get these if I apply your
patch to 2.6.24.7 and use it with my Sandisk Extreme IV 4GB card:

...
[0.999514] ata: MPC52xx IDE/ATA libata driver
[1.00] scsi0 : mpc52xx_ata
[1.010969] ata1: PATA max UDMA/33 ata_regs 0xf0003a00 irq 135
[1.168588] ata1.00: CFA: SanDisk SDCFX3-4096, HDX 4.31, max MWDMA2
[1.175156] ata1.00: 8027712 sectors, multi 0: LBA
[1.181098] ata1.00: configured for MWDMA2
[1.196589] scsi 0:0:0:0: Direct-Access ATA  SanDisk SDCFX3-4
HDX  PQ: 0 ANSI: 5
[1.206949] sd 0:0:0:0: [sda] 8027712 512-byte hardware sectors (4110
MB)
[1.214281] sd 0:0:0:0: [sda] Write Protect is off
[1.219803] sd 0:0:0:0: [sda] Write cache: disabled, read cache:
enabled, doesn't support DPO or FUA
[1.230407] sd 0:0:0:0: [sda] 8027712 512-byte hardware sectors (4110
MB)
[1.237678] sd 0:0:0:0: [sda] Write Protect is off
[1.243129] sd 0:0:0:0: [sda] Write cache: disabled, read cache:
enabled, doesn't support DPO or FUA
[1.252684]  sda:3ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0
action 0x2 frozen
[   31.260361] ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0
dma 4096 in
[   31.260377]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask
0x4 (timeout)
[   31.275689] ata1.00: status: { DRDY }
[   31.279545] ata1: soft resetting link
[   31.435535] ata1.00: configured for MWDMA2
[   31.439933] ata1: EH complete
[   61.443060] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2
frozen
[   61.450451] ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0
dma 4096 in
[   61.450467]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask
0x4 (timeout)
[   61.465777] ata1.00: status: { DRDY }
[   61.469632] ata1: soft resetting link
[   61.625541] ata1.00: configured for MWDMA2
[   61.629938] ata1: EH complete

...
[  363.394140] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2
frozen
[  363.401534] ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0
dma 4096 in
[  363.401550]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask
0x4 (timeout)
[  363.416889] ata1.00: status: { DRDY }
[  363.420717] ata1: soft resetting link
[  363.576538] ata1.00: configured for MWDMA1
[  363.580927] sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08
[  363.587499] sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
[  363.594157] Descriptor sense data with sense descriptors (in hex):
[  363.600593] 72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00
[  363.607248] 00 00 00 00
[  363.610615] sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
[  363.615334] end_request: I/O error, dev sda, sector 0
[  363.620600] Buffer I/O error on device sda, logical block 0
[  363.626475]  unable to read partition table
[  363.631014] ata1: EH complete
[  363.635081] sd 0:0:0:0: [sda] Attached SCSI removable disk


And if I boot via NFS, the kernel can continue to boot after that point.

With a non-DMA card everything is fine.


Best regards,

Daniel.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-06 Thread Tim Yamin
On Wed, Aug 6, 2008 at 12:58 PM, Daniel Schnell
[EMAIL PROTECTED] wrote:
 Hi,

 Sorry for testing this patch so late, but I get these if I apply your
 patch to 2.6.24.7 and use it with my Sandisk Extreme IV 4GB card:

Hi,

What board are you using? DMA requires a few more signals to be routed
through correctly to the CF card slot so maybe that's your problem...

Tim
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-06 Thread Daniel Schnell
Tim Yamin wrote:
 On Wed, Aug 6, 2008 at 12:58 PM, Daniel Schnell
 [EMAIL PROTECTED] wrote: 
 Hi,
 
 Sorry for testing this patch so late, but I get these if I apply your
 patch to 2.6.24.7 and use it with my Sandisk Extreme IV 4GB card:
 
 Hi,
 
 What board are you using? DMA requires a few more signals to be
 routed through correctly to the CF card slot so maybe that's your
 problem...  
 

Hi,

We are using our own MPC5200B based board. Can you be a bit more
specific about which signals have to be routed ?


Best regards,

Daniel Schnell.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH]: [MPC5200] Add ATA DMA support

2008-08-06 Thread Daniel Schnell
Hi,

Daniel Schnell wrote:
 Tim Yamin wrote:
 On Wed, Aug 6, 2008 at 12:58 PM, Daniel Schnell
 [EMAIL PROTECTED] wrote:
 Hi,
 
 Sorry for testing this patch so late, but I get these if I apply
 your patch to 2.6.24.7 and use it with my Sandisk Extreme IV 4GB
 card: 
 
 Hi,
 
 What board are you using? DMA requires a few more signals to be
 routed through correctly to the CF card slot so maybe that's your
 problem... 
 
 
 Hi,
 
 We are using our own MPC5200B based board. Can you be a bit more
 specific about which signals have to be routed ? 
 

After checking our schematics with Tim Yamin, we found that our board
has not the DMA lines connected. It seems I have to wait some time
before I get an updated board and can test UDMA again 


Sorry for the noise, although this was important for us to know.


Best regards,

Daniel.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH]: [MPC5200] Add ATA DMA support

2008-06-17 Thread Tim Yamin
This patch adds MDMA/UDMA support (using BestComm for DMA) on the MPC5200
platform.

Based heavily on previous work by Freescale (Bernard Kuhn, John Rigby)
and Domen Puncer.

Using a SanDisk Extreme IV CF card I get read speeds of approximately
26.70 MB/sec.

The BestComm ATA task priority was changed to maximum in bestcomm_priv.h;
this fixes a deadlock issue I was experiencing when heavy DMA was
occuring on both the ATA and Ethernet BestComm tasks, e.g. when
downloading a large file over a LAN to disk.

There's also what I believe to be a hardware bug if you have high levels
of BestComm ATA DMA activity along with heavy LocalPlus Bus activity;
the address bus seems to sometimes get corrupted with ATA commands while
the LocalPlus Bus operation is still active (i.e. Chip Select is asserted).

I've asked Freescale about this but have not received a reply yet -- if
anybody from Freescale has any ideas please contact me; I can supply some
analyzer traces if needed. Therefore, for now, do not enable DMA if you
need reliable LocalPlus Bus unless you do a fixup in your driver as
follows:

Locking example:

while (test_and_set_bit(0, pata_mpc52xx_ata_dma_lock) != 0)
{
struct bcom_task_2 *tsk = pata_mpc52xx_ata_dma_task;

if(bcom_buffer_done_2(tsk))
return 1;
}

return 0;

(Save the return value to `flags`)

Unlocking example:

if(flags == 0)
clear_bit(0, pata_mpc52xx_ata_dma_lock);

Comments and testing would of course be very welcome.

Thanks,

Signed-off-by: Tim Yamin [EMAIL PROTECTED]
This patch adds MDMA/UDMA support (using BestComm for DMA) on the MPC5200
platform.

Based heavily on previous work by Freescale (Bernard Kuhn, John Rigby)
and Domen Puncer.

Using a SanDisk Extreme IV CF card I get read speeds of approximately
26.70 MB/sec.

The BestComm ATA task priority was changed to maximum in bestcomm_priv.h;
this fixes a deadlock issue I was experiencing when heavy DMA was
occuring on both the ATA and Ethernet BestComm tasks, e.g. when
downloading a large file over a LAN to disk.

There's also what I believe to be a hardware bug if you have high levels
of BestComm ATA DMA activity along with heavy LocalPlus Bus activity;
the address bus seems to sometimes get corrupted with ATA commands while
the LocalPlus Bus operation is still active (i.e. Chip Select is asserted).

I've asked Freescale about this but have not received a reply yet -- if
anybody from Freescale has any ideas please contact me; I can supply some
analyzer traces if needed. Therefore, for now, do not enable DMA if you
need reliable LocalPlus Bus unless you do a fixup in your driver as
follows:

Locking example:

while (test_and_set_bit(0, pata_mpc52xx_ata_dma_lock) != 0)
{
struct bcom_task_2 *tsk = pata_mpc52xx_ata_dma_task;

if(bcom_buffer_done_2(tsk))
return 1;
}

	return 0;

(Save the return value to `flags`)

Unlocking example:

if(flags == 0)
clear_bit(0, pata_mpc52xx_ata_dma_lock);

Comments and testing would of course be very welcome.

Thanks,

Signed-off-by: Tim Yamin [EMAIL PROTECTED]

diff -Nurp linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/ata.h linux-2.6.26-rc6.new/arch/powerpc/sysdev/bestcomm/ata.h
--- linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/ata.h	2008-03-18 15:49:53.0 +
+++ linux-2.6.26-rc6.new/arch/powerpc/sysdev/bestcomm/ata.h	2008-04-15 10:42:38.0 +0100
@@ -16,8 +16,8 @@
 
 struct bcom_ata_bd {
 	u32	status;
-	u32	dst_pa;
 	u32	src_pa;
+	u32	dst_pa;
 };
 
 extern struct bcom_task *
diff -Nurp linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm.c linux-2.6.26-rc6.new/arch/powerpc/sysdev/bestcomm/bestcomm.c
--- linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm.c	2008-03-18 15:49:53.0 +
+++ linux-2.6.26-rc6.new/arch/powerpc/sysdev/bestcomm/bestcomm.c	2008-04-15 10:42:38.0 +0100
@@ -330,11 +330,10 @@
 	/* Init 'always' initiator */
 	out_8(bcom_eng-regs-ipr[BCOM_INITIATOR_ALWAYS], BCOM_IPR_ALWAYS);
 
-	/* Disable COMM Bus Prefetch on the original 5200; it's broken */
-	if ((mfspr(SPRN_SVR)  MPC5200_SVR_MASK) == MPC5200_SVR) {
-		regval = in_be16(bcom_eng-regs-PtdCntrl);
-		out_be16(bcom_eng-regs-PtdCntrl,  regval | 1);
-	}
+	/* Disable COMM Bus Prefetch; ATA DMA does not work properly with it
+	   enabled. */
+	regval = in_be16(bcom_eng-regs-PtdCntrl);
+	out_be16(bcom_eng-regs-PtdCntrl, regval | 1);
 
 	/* Init lock */
 	spin_lock_init(bcom_eng-lock);
diff -Nurp linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm.h linux-2.6.26-rc6.new/arch/powerpc/sysdev/bestcomm/bestcomm.h
--- linux-2.6.26-rc6/arch/powerpc/sysdev/bestcomm/bestcomm.h	2008-03-18 15:49:53.0 +
+++ linux-2.6.26-rc6.new/arch/powerpc/sysdev/bestcomm/bestcomm.h	2008-04-15 10:42:38.0 +0100
@@ -17,6 +17,7 @@
 #define __BESTCOMM_H__
 
 struct bcom_bd; /* defined later on ... */