RE: [PATCH] 460EX on-chip SATA driver<kernel 2.6.33> < resubmission : 02>

Previous thread: [GIT] Networking by David Miller on Tuesday, April 6, 2010 - 4:33 am. (1 message)

Next thread: High priority threads causing severe CPU load imbalances by Suresh Jayaraman on Tuesday, April 6, 2010 - 6:12 am. (8 messages)
From: Rupjyoti Sarmah
Date: Tuesday, April 6, 2010 - 4:41 am

This patch enables the on-chip DWC SATA controller of the AppliedMicro processor 460EX.

Signed-off-by: Rupjyoti Sarmah &lt;rsarmah@appliedmicro.com&gt; 
Signed-off-by: Mark Miesfeld &lt;mmiesfeld@appliedmicro.com&gt;
Signed-off-by: Prodyut Hazarika &lt;phazarika@appliedmicro.com&gt;
---
 arch/powerpc/boot/dts/canyonlands.dts |    8 +
 drivers/ata/Kconfig                   |    9 +
 drivers/ata/Makefile                  |    1 +
 drivers/ata/sata_dwc.c                | 1965 +++++++++++++++++++++++++++++++++
 4 files changed, 1983 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ata/sata_dwc.c

diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
index cd56bb5..d3b2c99 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -163,6 +163,14 @@
 			interrupts = &lt;0x1e 4&gt;;
 		};
 
+		SATA0: sata@bffd1000 {
+                        compatible = &quot;amcc,sata-460ex&quot;;
+			reg = &lt;4 0xbffd1000 0x800 4 0xbffd0800 0x400&gt;;
+                        interrupt-parent = &lt;&amp;UIC3&gt;;
+                        interrupts = &lt;0x0 0x4       /* SATA */
+                                      0x5 0x4&gt;;     /* AHBDMA */
+                };
+
 		POB0: opb {
 			compatible = &quot;ibm,opb-460ex&quot;, &quot;ibm,opb&quot;;
 			#address-cells = &lt;1&gt;;
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 56c6374..bba7b8a 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -82,6 +82,15 @@ config SATA_FSL
 
 	  If unsure, say N.
 
+config SATA_DWC
+	tristate &quot;DesignWare Cores SATA support&quot;
+	depends on 460EX
+	help
+	  This option enables support for the on-chip SATA controller of the
+	  AppliedMicro processor 460EX.
+
+	  If unsure, say N.
+
 config ATA_SFF
 	bool &quot;ATA SFF support&quot;
 	default y
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index fc936d4..0de7a33 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_SATA_INIC162X)	+= sata_inic162x.o
 obj-$(CONFIG_PDC_ADMA)		+= ...
From: Jeff Garzik
Subject:
Date: Tuesday, April 6, 2010 - 8:16 am

On 04/06/2010 07:41 AM, Rupjyoti Sarmah wrote:

General comment:  remove &quot;inline&quot; and let the compiler select those 



1) interrupt is not GFP_KERNEL

2) you must failure kmalloc failure


this should be defined in terms of scr_read/write functions defined 



either call -&gt;sff_check_status or ata_sff_check_status(), pick one.  in 




either you need spin_lock_irqsave(), or you don't need the lock at all. 

qc_prep is for setting up DMA internally, not on the hardware.  SActive 

What is the problem with NCQ?  It is better to submit a non-NCQ driver 

ditto... don't flag ATA_FLAG_NCQ if you note in the above comment that 
NCQ is broken

--

From: Benjamin Herrenschmidt
Date: Wednesday, April 7, 2010 - 12:41 am

And why the heck would you want to allocate it at interrupt time ? ? ?

BTW. Stefan mentioned earlier that they had some fixes for that driver
in the Denx tree. Are those fixes now included in that variant ?

Cheers,
Ben.


--

From: Stefan Roese
Date: Wednesday, April 7, 2010 - 1:22 am

Yes, from a first scan the fix I was referring to seems to be included.

Cheers,
Stefan
--

From: Rupjyoti Sarmah
Date: Wednesday, April 7, 2010 - 12:57 am

Hi Jeff,

Thanks. I would go through your suggestions and resubmit a newer
version.

Regards,
Rup

-----Original Message-----
From: Jeff Garzik [mailto:jgpobox@gmail.com] On Behalf Of Jeff Garzik
Sent: Tuesday, April 06, 2010 8:46 PM
To: Rupjyoti Sarmah
Cc: linux-ide@vger.kernel.org; linux-kernel@vger.kernel.org; sr@denx.de;
linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] 460EX on-chip SATA driver&lt;kernel 2.6.33&gt; &lt;
resubmission : 02&gt;

On 04/06/2010 07:41 AM, Rupjyoti Sarmah wrote:

General comment:  remove &quot;inline&quot; and let the compiler select those 



1) interrupt is not GFP_KERNEL

2) you must failure kmalloc failure


this should be defined in terms of scr_read/write functions defined 



either call -&gt;sff_check_status or ata_sff_check_status(), pick one.  in 




either you need spin_lock_irqsave(), or you don't need the lock at all. 

qc_prep is for setting up DMA internally, not on the hardware.  SAct