[no subject]

2007-08-18 Thread Conke Hu
subscribe linux-kernel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[no subject]

2007-08-18 Thread Conke Hu
subscribe linux-kernel
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] nand/s3c2410.c: fix header file include path

2007-08-14 Thread Conke Hu
regs-nand.h and nand.h for s3c nand driver have been moved to plat-s3c/ dir.

Signed-off-by: [EMAIL PROTECTED]
---
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 5fac4c4..b79a9cf 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -60,8 +60,8 @@

 #include 

-#include 
-#include 
+#include 
+#include 

 #ifdef CONFIG_MTD_NAND_S3C2410_HWECC
 static int hardware_ecc = 1;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rtc-dev.c: remove to_rtc_device macro

2007-08-14 Thread Conke Hu
hi,
  According to rtc_dev_open() in file rtc-dev.c (see below), all the
to_rtc_device macro in rtc file_operations functions should be
removed, namely:
  "struct rtc_device *rtc = to_rtc_device(file->private_data);"
should be modified to: "struct rtc_device *rtc = file->private_data;"

  to_rtc_device is not a correct usage here, what's more, pls consider
when dev were not the first member of struct rtc_device :)

static int rtc_dev_open(struct inode *inode, struct file *file)
{
int err;
//...

file->private_data = rtc;

//...
}

Signed-off-by: [EMAIL PROTECTED]

--
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 005fff3..9552577 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -142,7 +142,7 @@ static int set_uie(struct rtc_device *rtc)
 static ssize_t
 rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
-   struct rtc_device *rtc = to_rtc_device(file->private_data);
+   struct rtc_device *rtc = file->private_data;

DECLARE_WAITQUEUE(wait, current);
unsigned long data;
@@ -196,7 +196,7 @@ rtc_dev_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)

 static unsigned int rtc_dev_poll(struct file *file, poll_table *wait)
 {
-   struct rtc_device *rtc = to_rtc_device(file->private_data);
+   struct rtc_device *rtc = file->private_data;
unsigned long data;

poll_wait(file, >irq_queue, wait);
@@ -405,7 +405,7 @@ static int rtc_dev_ioctl(struct inode *inode,
struct file *file,

 static int rtc_dev_release(struct inode *inode, struct file *file)
 {
-   struct rtc_device *rtc = to_rtc_device(file->private_data);
+   struct rtc_device *rtc = file->private_data;

 #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
clear_uie(rtc);
@@ -419,7 +419,7 @@ static int rtc_dev_release(struct inode *inode,
struct file *file)

 static int rtc_dev_fasync(int fd, struct file *file, int on)
 {
-   struct rtc_device *rtc = to_rtc_device(file->private_data);
+   struct rtc_device *rtc = file->private_data;
return fasync_helper(fd, file, on, >async_queue);
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rtc-dev.c: remove to_rtc_device macro

2007-08-14 Thread Conke Hu
hi,
  According to rtc_dev_open() in file rtc-dev.c (see below), all the
to_rtc_device macro in rtc file_operations functions should be
removed, namely:
  struct rtc_device *rtc = to_rtc_device(file-private_data);
should be modified to: struct rtc_device *rtc = file-private_data;

  to_rtc_device is not a correct usage here, what's more, pls consider
when dev were not the first member of struct rtc_device :)

static int rtc_dev_open(struct inode *inode, struct file *file)
{
int err;
//...snip

file-private_data = rtc;

//...snip
}

Signed-off-by: [EMAIL PROTECTED]

--
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 005fff3..9552577 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -142,7 +142,7 @@ static int set_uie(struct rtc_device *rtc)
 static ssize_t
 rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
-   struct rtc_device *rtc = to_rtc_device(file-private_data);
+   struct rtc_device *rtc = file-private_data;

DECLARE_WAITQUEUE(wait, current);
unsigned long data;
@@ -196,7 +196,7 @@ rtc_dev_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)

 static unsigned int rtc_dev_poll(struct file *file, poll_table *wait)
 {
-   struct rtc_device *rtc = to_rtc_device(file-private_data);
+   struct rtc_device *rtc = file-private_data;
unsigned long data;

poll_wait(file, rtc-irq_queue, wait);
@@ -405,7 +405,7 @@ static int rtc_dev_ioctl(struct inode *inode,
struct file *file,

 static int rtc_dev_release(struct inode *inode, struct file *file)
 {
-   struct rtc_device *rtc = to_rtc_device(file-private_data);
+   struct rtc_device *rtc = file-private_data;

 #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
clear_uie(rtc);
@@ -419,7 +419,7 @@ static int rtc_dev_release(struct inode *inode,
struct file *file)

 static int rtc_dev_fasync(int fd, struct file *file, int on)
 {
-   struct rtc_device *rtc = to_rtc_device(file-private_data);
+   struct rtc_device *rtc = file-private_data;
return fasync_helper(fd, file, on, rtc-async_queue);
 }
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] nand/s3c2410.c: fix header file include path

2007-08-14 Thread Conke Hu
regs-nand.h and nand.h for s3c nand driver have been moved to plat-s3c/ dir.

Signed-off-by: [EMAIL PROTECTED]
---
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 5fac4c4..b79a9cf 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -60,8 +60,8 @@

 #include asm/io.h

-#include asm/arch/regs-nand.h
-#include asm/arch/nand.h
+#include asm/plat-s3c/regs-nand.h
+#include asm/plat-s3c/nand.h

 #ifdef CONFIG_MTD_NAND_S3C2410_HWECC
 static int hardware_ecc = 1;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: remove non-existing SB600 raid id (re-send)

2007-04-11 Thread Conke Hu

   SB600 RAID and SB600 SATA is the same controller and share the
same PCI ID 0x4380. There is no such PCI ID 0x4381.

   Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
-
diff -Nur linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c
linux-2.6.21-rc6-git3/drivers/ata/ahci.c
--- linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c   2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/drivers/ata/ahci.c2007-04-22 18:39:12.0 
+0800
@@ -413,8 +413,7 @@
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
-   { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */

/* VIA */
{ PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */
diff -Nur linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h
linux-2.6.21-rc6-git3/include/linux/pci_ids.h
--- linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h  2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/include/linux/pci_ids.h   2007-04-22
18:39:35.0 +0800
@@ -368,7 +368,6 @@
#define PCI_DEVICE_ID_ATI_IXP400_SATA   0x4379
#define PCI_DEVICE_ID_ATI_IXP400_SATA2  0x437a
#define PCI_DEVICE_ID_ATI_IXP600_SATA   0x4380
-#define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381
#define PCI_DEVICE_ID_ATI_IXP600_SMBUS  0x4385
#define PCI_DEVICE_ID_ATI_IXP600_IDE0x438c
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ahci.c: remove non-existing SB600 raid id

2007-04-11 Thread Conke Hu

On 4/11/07, Tejun Heo <[EMAIL PROTECTED]> wrote:

Conke Hu wrote:
>SB600 RAID and SB600 SATA is the same controller and share the
> same PCI ID 0x4380. There is such PCI ID 0x4381.

I assume 'no' is missing in the last sentence.  :-)

--
tejun



Oh, sorry :(
so, should I re-send the mail?

conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: remove non-existing SB600 raid id

2007-04-11 Thread Conke Hu

   SB600 RAID and SB600 SATA is the same controller and share the
same PCI ID 0x4380. There is such PCI ID 0x4381.

   Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
-
diff -Nur linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c
linux-2.6.21-rc6-git3/drivers/ata/ahci.c
--- linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c   2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/drivers/ata/ahci.c2007-04-22 18:39:12.0 
+0800
@@ -413,8 +413,7 @@
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
-   { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */

/* VIA */
{ PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */
diff -Nur linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h
linux-2.6.21-rc6-git3/include/linux/pci_ids.h
--- linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h  2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/include/linux/pci_ids.h   2007-04-22
18:39:35.0 +0800
@@ -368,7 +368,6 @@
#define PCI_DEVICE_ID_ATI_IXP400_SATA   0x4379
#define PCI_DEVICE_ID_ATI_IXP400_SATA2  0x437a
#define PCI_DEVICE_ID_ATI_IXP600_SATA   0x4380
-#define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381
#define PCI_DEVICE_ID_ATI_IXP600_SMBUS  0x4385
#define PCI_DEVICE_ID_ATI_IXP600_IDE0x438
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: remove non-existing SB600 raid id

2007-04-11 Thread Conke Hu

   SB600 RAID and SB600 SATA is the same controller and share the
same PCI ID 0x4380. There is such PCI ID 0x4381.

   Signed-off-by: Conke Hu [EMAIL PROTECTED]
-
diff -Nur linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c
linux-2.6.21-rc6-git3/drivers/ata/ahci.c
--- linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c   2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/drivers/ata/ahci.c2007-04-22 18:39:12.0 
+0800
@@ -413,8 +413,7 @@
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
-   { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */

/* VIA */
{ PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */
diff -Nur linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h
linux-2.6.21-rc6-git3/include/linux/pci_ids.h
--- linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h  2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/include/linux/pci_ids.h   2007-04-22
18:39:35.0 +0800
@@ -368,7 +368,6 @@
#define PCI_DEVICE_ID_ATI_IXP400_SATA   0x4379
#define PCI_DEVICE_ID_ATI_IXP400_SATA2  0x437a
#define PCI_DEVICE_ID_ATI_IXP600_SATA   0x4380
-#define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381
#define PCI_DEVICE_ID_ATI_IXP600_SMBUS  0x4385
#define PCI_DEVICE_ID_ATI_IXP600_IDE0x438
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ahci.c: remove non-existing SB600 raid id

2007-04-11 Thread Conke Hu

On 4/11/07, Tejun Heo [EMAIL PROTECTED] wrote:

Conke Hu wrote:
SB600 RAID and SB600 SATA is the same controller and share the
 same PCI ID 0x4380. There is such PCI ID 0x4381.

I assume 'no' is missing in the last sentence.  :-)

--
tejun



Oh, sorry :(
so, should I re-send the mail?

conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: remove non-existing SB600 raid id (re-send)

2007-04-11 Thread Conke Hu

   SB600 RAID and SB600 SATA is the same controller and share the
same PCI ID 0x4380. There is no such PCI ID 0x4381.

   Signed-off-by: Conke Hu [EMAIL PROTECTED]
-
diff -Nur linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c
linux-2.6.21-rc6-git3/drivers/ata/ahci.c
--- linux-2.6.21-rc6-git3.orig/drivers/ata/ahci.c   2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/drivers/ata/ahci.c2007-04-22 18:39:12.0 
+0800
@@ -413,8 +413,7 @@
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
-   { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */

/* VIA */
{ PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */
diff -Nur linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h
linux-2.6.21-rc6-git3/include/linux/pci_ids.h
--- linux-2.6.21-rc6-git3.orig/include/linux/pci_ids.h  2007-04-22
18:38:39.0 +0800
+++ linux-2.6.21-rc6-git3/include/linux/pci_ids.h   2007-04-22
18:39:35.0 +0800
@@ -368,7 +368,6 @@
#define PCI_DEVICE_ID_ATI_IXP400_SATA   0x4379
#define PCI_DEVICE_ID_ATI_IXP400_SATA2  0x437a
#define PCI_DEVICE_ID_ATI_IXP600_SATA   0x4380
-#define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381
#define PCI_DEVICE_ID_ATI_IXP600_SMBUS  0x4385
#define PCI_DEVICE_ID_ATI_IXP600_IDE0x438c
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Use C++ in kernel module?

2007-03-29 Thread Conke Hu

Is it possible to use C++ in linux kernel module? how?
I've tested but failed, there is an unknown symbol in the .o file from
c++ source code.

Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Use C++ in kernel module?

2007-03-29 Thread Conke Hu

Is it possible to use C++ in linux kernel module? how?
I've tested but failed, there is an unknown symbol in the .o file from
c++ source code.

Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: walkaround for SB600 SATA internal error issue

2007-03-27 Thread Conke Hu

  There is a HW issue in ATI SB600 SATA that PxSERR.E should not be
set on some conditions, for example, when there is no media in SATA
CD/DVD drive or media is not ready, AHCI controller fails to execute
ATAPI commands and reports PORT_IRQ_TF_ERR, but ATI SB600 SATA
controller sets PxSERR.E at the
same time, which is not necessary.
   This patch is just to ignore the INTERNAL ERROR in such case.
Without this patch, ahci error handler will report many errors as
below:
   --- cut from dmesg ---
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
   res 51/24:03:00:00:20/00:00:00:00:00/a0 Emask 0x40 (internal error)
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x43 data 12 in
   res 51/24:03:00:00:00/00:00:00:00:00/a0 Emask 0x40 (internal error)
    end cut -

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>

--- 2.6.21-rc5-git1/drivers/ata/ahci.c.orig 2007-04-07 22:36:51.0 
+0800
+++ 2.6.21-rc5-git1/drivers/ata/ahci.c  2007-04-07 22:44:42.0 +0800
@@ -80,6 +80,7 @@ enum {
board_ahci_pi   = 1,
board_ahci_vt8251   = 2,
board_ahci_ign_iferr= 3,
+   board_ahci_sb600= 4,

/* global controller registers */
HOST_CAP= 0x00, /* host capabilities */
@@ -168,6 +169,7 @@ enum {
AHCI_FLAG_NO_NCQ= (1 << 24),
AHCI_FLAG_IGN_IRQ_IF_ERR= (1 << 25), /* ignore IRQ_IF_ERR */
AHCI_FLAG_HONOR_PI  = (1 << 26), /* honor PORTS_IMPL */
+   AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */
};

struct ahci_cmd_hdr {
@@ -362,6 +364,18 @@ static const struct ata_port_info ahci_p
.udma_mask  = 0x7f, /* udma0-6 ; FIXME */
.port_ops   = _ops,
},
+   /* board_ahci_sb600 */
+   {
+   .sht= _sht,
+   .flags  = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+ ATA_FLAG_SKIP_D2H_BSY |
+ AHCI_FLAG_IGN_SERR_INTERNAL,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = 0x7f, /* udma0-6 ; FIXME */
+   .port_ops   = _ops,
+   },
+
};

static const struct pci_device_id ahci_pci_tbl[] = {
@@ -399,7 +413,7 @@ static const struct pci_device_id ahci_p
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
{ PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */

/* VIA */
@@ -1067,8 +1081,11 @@ static void ahci_error_intr(struct ata_p
if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR)
irq_stat &= ~PORT_IRQ_IF_ERR;

-   if (irq_stat & PORT_IRQ_TF_ERR)
+   if (irq_stat & PORT_IRQ_TF_ERR) {
err_mask |= AC_ERR_DEV;
+   if (ap->flags & AHCI_FLAG_IGN_SERR_INTERNAL)
+   serror &= ~SERR_INTERNAL;
+   }

if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) {
err_mask |= AC_ERR_HOST_BUS;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ahci.c: fix ati sb600 sata IRQ_TF_ERR

2007-03-27 Thread Conke Hu

On 3/15/07, Tejun Heo <[EMAIL PROTECTED]> wrote:

Conke Hu wrote:
>> E  Internal error: The host bus adapter experienced an internal error
>> that caused the operation to fail and may have put the host bus adapter
>> into an error state. Host software should reset the interface before
>> re-trying the operation. If the condition persists, the host bus adapter
>> may suffer from a design issue rendering it incompatible with the
>> attached device.
>>
>
> Yes, I saw this too :) and I am contacting the hardware engineers to
> check if there is any hardware bug.
> But, even though this were a hardware bug and could be fixed, we would
> still need this patch since many SB600 boards have already come into
> the market and those ASICs can never be fixed :(

Yeap, we certainly need the workaround.  I was just having a little fun.
 :-)

>> 4381 isn't affected while 4380 is?
>
> I never see such an ID, and plan to remove 0x4381.
> The patch which added the PCI IDs was not sent out by myself. I
> checked all SB600 boards, and not found any 0x4381 controller, only
> 0x4380 instead. In fact, SB600 RAID and Non-RAID share the same PCI
> device ID, only with class code different.

I see.

>> Anyways, Conke Hu, can you please take a look at my patch from a month
>> ago?  It's almost identical but SERR_INTERNAL is always ignored on both
>> SB600 PCI IDs, which I think is safer.  Does this fix what you're seeing?
>>
>
> I just read your patch. Another difference is that my patch ignores
> SERR_INTERNAL only when the command is ATAPI and IRQ_TF_ERR occurs. In
> other cases, I think, we'd better not ignore the SERR_INTERNEL. Right?

Yeah, I noticed the difference.  I don't really care but I was thinking
that SERR_INTERNAL might be set in other similar situations too.  e.g.
TF error from ATA device or what not, so I thought it would be safer to
ignore the bit altogether.  You probably need to consult your hardware
people about when exactly the bit misbehaves but unless proven
otherwise, I'd prefer to always ignore the bit.  Also, please rename the
enum constant and flag name.



Thank you, Tejun!
I was discussing with our HW designers on this topic. It is a HW
design issue and will be fixed in SB700, the next generation of
AMD/ATI southbridge.

The correct walkaround/solution for SB600 SATA is:
1. ignore SERR_INTERNAL for both ATA and ATAPI device (as you suggested :p ).
2. ignore SERR_INTERNAL only on IRQ_TF_ERR.

I'll re-create the patch.

Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ahci.c: fix ati sb600 sata IRQ_TF_ERR

2007-03-27 Thread Conke Hu

On 3/15/07, Tejun Heo [EMAIL PROTECTED] wrote:

Conke Hu wrote:
 E  Internal error: The host bus adapter experienced an internal error
 that caused the operation to fail and may have put the host bus adapter
 into an error state. Host software should reset the interface before
 re-trying the operation. If the condition persists, the host bus adapter
 may suffer from a design issue rendering it incompatible with the
 attached device.


 Yes, I saw this too :) and I am contacting the hardware engineers to
 check if there is any hardware bug.
 But, even though this were a hardware bug and could be fixed, we would
 still need this patch since many SB600 boards have already come into
 the market and those ASICs can never be fixed :(

Yeap, we certainly need the workaround.  I was just having a little fun.
 :-)

 4381 isn't affected while 4380 is?

 I never see such an ID, and plan to remove 0x4381.
 The patch which added the PCI IDs was not sent out by myself. I
 checked all SB600 boards, and not found any 0x4381 controller, only
 0x4380 instead. In fact, SB600 RAID and Non-RAID share the same PCI
 device ID, only with class code different.

I see.

 Anyways, Conke Hu, can you please take a look at my patch from a month
 ago?  It's almost identical but SERR_INTERNAL is always ignored on both
 SB600 PCI IDs, which I think is safer.  Does this fix what you're seeing?


 I just read your patch. Another difference is that my patch ignores
 SERR_INTERNAL only when the command is ATAPI and IRQ_TF_ERR occurs. In
 other cases, I think, we'd better not ignore the SERR_INTERNEL. Right?

Yeah, I noticed the difference.  I don't really care but I was thinking
that SERR_INTERNAL might be set in other similar situations too.  e.g.
TF error from ATA device or what not, so I thought it would be safer to
ignore the bit altogether.  You probably need to consult your hardware
people about when exactly the bit misbehaves but unless proven
otherwise, I'd prefer to always ignore the bit.  Also, please rename the
enum constant and flag name.



Thank you, Tejun!
I was discussing with our HW designers on this topic. It is a HW
design issue and will be fixed in SB700, the next generation of
AMD/ATI southbridge.

The correct walkaround/solution for SB600 SATA is:
1. ignore SERR_INTERNAL for both ATA and ATAPI device (as you suggested :p ).
2. ignore SERR_INTERNAL only on IRQ_TF_ERR.

I'll re-create the patch.

Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: walkaround for SB600 SATA internal error issue

2007-03-27 Thread Conke Hu

  There is a HW issue in ATI SB600 SATA that PxSERR.E should not be
set on some conditions, for example, when there is no media in SATA
CD/DVD drive or media is not ready, AHCI controller fails to execute
ATAPI commands and reports PORT_IRQ_TF_ERR, but ATI SB600 SATA
controller sets PxSERR.E at the
same time, which is not necessary.
   This patch is just to ignore the INTERNAL ERROR in such case.
Without this patch, ahci error handler will report many errors as
below:
   --- cut from dmesg ---
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
   res 51/24:03:00:00:20/00:00:00:00:00/a0 Emask 0x40 (internal error)
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x43 data 12 in
   res 51/24:03:00:00:00/00:00:00:00:00/a0 Emask 0x40 (internal error)
    end cut -

Signed-off-by: Conke Hu [EMAIL PROTECTED]

--- 2.6.21-rc5-git1/drivers/ata/ahci.c.orig 2007-04-07 22:36:51.0 
+0800
+++ 2.6.21-rc5-git1/drivers/ata/ahci.c  2007-04-07 22:44:42.0 +0800
@@ -80,6 +80,7 @@ enum {
board_ahci_pi   = 1,
board_ahci_vt8251   = 2,
board_ahci_ign_iferr= 3,
+   board_ahci_sb600= 4,

/* global controller registers */
HOST_CAP= 0x00, /* host capabilities */
@@ -168,6 +169,7 @@ enum {
AHCI_FLAG_NO_NCQ= (1  24),
AHCI_FLAG_IGN_IRQ_IF_ERR= (1  25), /* ignore IRQ_IF_ERR */
AHCI_FLAG_HONOR_PI  = (1  26), /* honor PORTS_IMPL */
+   AHCI_FLAG_IGN_SERR_INTERNAL = (1  27), /* ignore SERR_INTERNAL */
};

struct ahci_cmd_hdr {
@@ -362,6 +364,18 @@ static const struct ata_port_info ahci_p
.udma_mask  = 0x7f, /* udma0-6 ; FIXME */
.port_ops   = ahci_ops,
},
+   /* board_ahci_sb600 */
+   {
+   .sht= ahci_sht,
+   .flags  = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+ ATA_FLAG_SKIP_D2H_BSY |
+ AHCI_FLAG_IGN_SERR_INTERNAL,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = 0x7f, /* udma0-6 ; FIXME */
+   .port_ops   = ahci_ops,
+   },
+
};

static const struct pci_device_id ahci_pci_tbl[] = {
@@ -399,7 +413,7 @@ static const struct pci_device_id ahci_p
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
{ PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */

/* VIA */
@@ -1067,8 +1081,11 @@ static void ahci_error_intr(struct ata_p
if (ap-flags  AHCI_FLAG_IGN_IRQ_IF_ERR)
irq_stat = ~PORT_IRQ_IF_ERR;

-   if (irq_stat  PORT_IRQ_TF_ERR)
+   if (irq_stat  PORT_IRQ_TF_ERR) {
err_mask |= AC_ERR_DEV;
+   if (ap-flags  AHCI_FLAG_IGN_SERR_INTERNAL)
+   serror = ~SERR_INTERNAL;
+   }

if (irq_stat  (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) {
err_mask |= AC_ERR_HOST_BUS;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ahci.c: fix ati sb600 sata IRQ_TF_ERR

2007-03-15 Thread Conke Hu

On 3/14/07, Tejun Heo <[EMAIL PROTECTED]> wrote:

Hello,

Conke Hu wrote:
>When there is no media in SATA CD/DVD drive or media is not ready,
> AHCI controller fails to execute the ATAPI commands TEST_UNIT_READY,
> READ_CAPACITY or READ_TOC and reports PORT_IRQ_TF_ERR. But ATI SB600
> SATA controller sets SERR_INTERNAL bit in the error register at the
> same time, which is not necessary. This patch is just to ignore the
> INTERNAL ERROR in such case. Without this patch, ahci error handler
> will report many errors as below:

Whoa, SERR_INTERNAL on ATAPI check condition?  Just for fun, here's what
the spec says about SERR_INTERNAL.



When media is not ready, command TEST_UNIT_READY fails with ahci irq
status == 0x4001(IRQ_TF_ERROR) and serror == SERR_INTERNEL, then
ahci error handler calls atapi_eh_request_sense() and sets
ATA_QCFLAG_SENSE_VALID. Command REQUEST_SENSE executes successfully
and atapi_qc_complete() sets result = SAM_STAT_CHECK_CONDITION, and
now the whole TEST_UNIT_READY request is done and returns .



E  Internal error: The host bus adapter experienced an internal error
that caused the operation to fail and may have put the host bus adapter
into an error state. Host software should reset the interface before
re-trying the operation. If the condition persists, the host bus adapter
may suffer from a design issue rendering it incompatible with the
attached device.



Yes, I saw this too :) and I am contacting the hardware engineers to
check if there is any hardware bug.
But, even though this were a hardware bug and could be fixed, we would
still need this patch since many SB600 boards have already come into
the market and those ASICs can never be fixed :(
So, if no errors in this patch, could Jeff please apply it ASAP?



Anyways thanks for fixing this.  Just a few comments.

> --- linux-2.6.21-rc3-git8/drivers/ata/ahci.c.orig2007-03-25
> 20:57:31.0 +0800
> +++ linux-2.6.21-rc3-git8/drivers/ata/ahci.c2007-03-25
> 21:03:54.0 +0800
> @@ -80,6 +80,7 @@ enum {
> board_ahci_pi= 1,
> board_ahci_vt8251= 2,
> board_ahci_ign_iferr= 3,
> +board_ahci_ati= 4,
>
> /* global controller registers */
> HOST_CAP= 0x00, /* host capabilities */
> @@ -168,6 +169,7 @@ enum {
> AHCI_FLAG_NO_NCQ= (1 << 24),
> AHCI_FLAG_IGN_IRQ_IF_ERR= (1 << 25), /* ignore IRQ_IF_ERR */
> AHCI_FLAG_HONOR_PI= (1 << 26), /* honor PORTS_IMPL */
> +AHCI_FLAG_TF_ERR_FIX= (1 << 27), /* ignore INTERNAL ERROR on
> IRQ_TF_ERROR */

Can we use board_ahci_ign_interr and AHCI_FLAG_IGN_SERR_INTERNAL to keep
it more consistent with the other IGN flag?

> -{ PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
> +{ PCI_VDEVICE(ATI, 0x4380), board_ahci_ati }, /* ATI SB600 non-raid */
> { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */

4381 isn't affected while 4380 is?


I never see such an ID, and plan to remove 0x4381.
The patch which added the PCI IDs was not sent out by myself. I
checked all SB600 boards, and not found any 0x4381 controller, only
0x4380 instead. In fact, SB600 RAID and Non-RAID share the same PCI
device ID, only with class code different.




Hmmm... Okay, this is weird.  I'm feeling very strong deja vu.

Well, I must be getting alzheimer.  I did almost the same patch a month
ago and was waiting for verification to properly submit the patch.

  http://thread.gmane.org/gmane.linux.ide/16049/focus=16437

Anyways, Conke Hu, can you please take a look at my patch from a month
ago?  It's almost identical but SERR_INTERNAL is always ignored on both
SB600 PCI IDs, which I think is safer.  Does this fix what you're seeing?



I just read your patch. Another difference is that my patch ignores
SERR_INTERNAL only when the command is ATAPI and IRQ_TF_ERR occurs. In
other cases, I think, we'd better not ignore the SERR_INTERNEL. Right?
The following is some detail:
// your patch:
+   if (ap->flags & AHCI_FLAG_IGN_SERR_INTERNAL)
+   serr &= ~SERR_INTERNAL;

// mine:
-   if (irq_stat & PORT_IRQ_TF_ERR)
+   if (irq_stat & PORT_IRQ_TF_ERR) {
  err_mask |= AC_ERR_DEV;
+
+   /* some controllers set INTERNAL ERROR on ATAPI
IRQ_TF_ERROR, ignore it */
+   if ((serror & SERR_INTERNAL) &&
+(ap->flags & AHCI_FLAG_TF_ERR_FIX) &&
+ qc && qc->dev->class == ATA_DEV_ATAPI) {
+   serror &= ~SERR_INTERNAL;
+   }
+   }

Tejun, you do me a great favor, thank you so much! for your previous
help, too :)

Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ahci.c: fix ati sb600 sata IRQ_TF_ERR

2007-03-15 Thread Conke Hu

On 3/14/07, Tejun Heo [EMAIL PROTECTED] wrote:

Hello,

Conke Hu wrote:
When there is no media in SATA CD/DVD drive or media is not ready,
 AHCI controller fails to execute the ATAPI commands TEST_UNIT_READY,
 READ_CAPACITY or READ_TOC and reports PORT_IRQ_TF_ERR. But ATI SB600
 SATA controller sets SERR_INTERNAL bit in the error register at the
 same time, which is not necessary. This patch is just to ignore the
 INTERNAL ERROR in such case. Without this patch, ahci error handler
 will report many errors as below:

Whoa, SERR_INTERNAL on ATAPI check condition?  Just for fun, here's what
the spec says about SERR_INTERNAL.



When media is not ready, command TEST_UNIT_READY fails with ahci irq
status == 0x4001(IRQ_TF_ERROR) and serror == SERR_INTERNEL, then
ahci error handler calls atapi_eh_request_sense() and sets
ATA_QCFLAG_SENSE_VALID. Command REQUEST_SENSE executes successfully
and atapi_qc_complete() sets result = SAM_STAT_CHECK_CONDITION, and
now the whole TEST_UNIT_READY request is done and returns .



E  Internal error: The host bus adapter experienced an internal error
that caused the operation to fail and may have put the host bus adapter
into an error state. Host software should reset the interface before
re-trying the operation. If the condition persists, the host bus adapter
may suffer from a design issue rendering it incompatible with the
attached device.



Yes, I saw this too :) and I am contacting the hardware engineers to
check if there is any hardware bug.
But, even though this were a hardware bug and could be fixed, we would
still need this patch since many SB600 boards have already come into
the market and those ASICs can never be fixed :(
So, if no errors in this patch, could Jeff please apply it ASAP?



Anyways thanks for fixing this.  Just a few comments.

 --- linux-2.6.21-rc3-git8/drivers/ata/ahci.c.orig2007-03-25
 20:57:31.0 +0800
 +++ linux-2.6.21-rc3-git8/drivers/ata/ahci.c2007-03-25
 21:03:54.0 +0800
 @@ -80,6 +80,7 @@ enum {
 board_ahci_pi= 1,
 board_ahci_vt8251= 2,
 board_ahci_ign_iferr= 3,
 +board_ahci_ati= 4,

 /* global controller registers */
 HOST_CAP= 0x00, /* host capabilities */
 @@ -168,6 +169,7 @@ enum {
 AHCI_FLAG_NO_NCQ= (1  24),
 AHCI_FLAG_IGN_IRQ_IF_ERR= (1  25), /* ignore IRQ_IF_ERR */
 AHCI_FLAG_HONOR_PI= (1  26), /* honor PORTS_IMPL */
 +AHCI_FLAG_TF_ERR_FIX= (1  27), /* ignore INTERNAL ERROR on
 IRQ_TF_ERROR */

Can we use board_ahci_ign_interr and AHCI_FLAG_IGN_SERR_INTERNAL to keep
it more consistent with the other IGN flag?

 -{ PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
 +{ PCI_VDEVICE(ATI, 0x4380), board_ahci_ati }, /* ATI SB600 non-raid */
 { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */

4381 isn't affected while 4380 is?


I never see such an ID, and plan to remove 0x4381.
The patch which added the PCI IDs was not sent out by myself. I
checked all SB600 boards, and not found any 0x4381 controller, only
0x4380 instead. In fact, SB600 RAID and Non-RAID share the same PCI
device ID, only with class code different.




Hmmm... Okay, this is weird.  I'm feeling very strong deja vu.

Well, I must be getting alzheimer.  I did almost the same patch a month
ago and was waiting for verification to properly submit the patch.

  http://thread.gmane.org/gmane.linux.ide/16049/focus=16437

Anyways, Conke Hu, can you please take a look at my patch from a month
ago?  It's almost identical but SERR_INTERNAL is always ignored on both
SB600 PCI IDs, which I think is safer.  Does this fix what you're seeing?



I just read your patch. Another difference is that my patch ignores
SERR_INTERNAL only when the command is ATAPI and IRQ_TF_ERR occurs. In
other cases, I think, we'd better not ignore the SERR_INTERNEL. Right?
The following is some detail:
// your patch:
+   if (ap-flags  AHCI_FLAG_IGN_SERR_INTERNAL)
+   serr = ~SERR_INTERNAL;

// mine:
-   if (irq_stat  PORT_IRQ_TF_ERR)
+   if (irq_stat  PORT_IRQ_TF_ERR) {
  err_mask |= AC_ERR_DEV;
+
+   /* some controllers set INTERNAL ERROR on ATAPI
IRQ_TF_ERROR, ignore it */
+   if ((serror  SERR_INTERNAL) 
+(ap-flags  AHCI_FLAG_TF_ERR_FIX) 
+ qc  qc-dev-class == ATA_DEV_ATAPI) {
+   serror = ~SERR_INTERNAL;
+   }
+   }

Tejun, you do me a great favor, thank you so much! for your previous
help, too :)

Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: fix ati sb600 sata IRQ_TF_ERR

2007-03-14 Thread Conke Hu

   When there is no media in SATA CD/DVD drive or media is not ready,
AHCI controller fails to execute the ATAPI commands TEST_UNIT_READY,
READ_CAPACITY or READ_TOC and reports PORT_IRQ_TF_ERR. But ATI SB600
SATA controller sets SERR_INTERNAL bit in the error register at the
same time, which is not necessary. This patch is just to ignore the
INTERNAL ERROR in such case. Without this patch, ahci error handler
will report many errors as below:
--- cut from dmesg ---
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
res 51/24:03:00:00:20/00:00:00:00:00/a0 Emask 0x40 (internal error)
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x43 data 12 in
res 51/24:03:00:00:00/00:00:00:00:00/a0 Emask 0x40 (internal error)
 end cut -

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>

--- linux-2.6.21-rc3-git8/drivers/ata/ahci.c.orig   2007-03-25
20:57:31.0 +0800
+++ linux-2.6.21-rc3-git8/drivers/ata/ahci.c2007-03-25 21:03:54.0 
+0800
@@ -80,6 +80,7 @@ enum {
board_ahci_pi   = 1,
board_ahci_vt8251   = 2,
board_ahci_ign_iferr= 3,
+   board_ahci_ati  = 4,

/* global controller registers */
HOST_CAP= 0x00, /* host capabilities */
@@ -168,6 +169,7 @@ enum {
AHCI_FLAG_NO_NCQ= (1 << 24),
AHCI_FLAG_IGN_IRQ_IF_ERR= (1 << 25), /* ignore IRQ_IF_ERR */
AHCI_FLAG_HONOR_PI  = (1 << 26), /* honor PORTS_IMPL */
+   AHCI_FLAG_TF_ERR_FIX= (1 << 27), /* ignore INTERNAL ERROR on 
IRQ_TF_ERROR */
};

struct ahci_cmd_hdr {
@@ -362,6 +364,16 @@ static const struct ata_port_info ahci_p
.udma_mask  = 0x7f, /* udma0-6 ; FIXME */
.port_ops   = _ops,
},
+   /* board_ahci_ati */
+   {
+   .sht= _sht,
+   .flags  = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+ ATA_FLAG_SKIP_D2H_BSY | AHCI_FLAG_TF_ERR_FIX,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = 0x7f, /* udma0-6 ; FIXME */
+   .port_ops   = _ops,
+   },  
};

static const struct pci_device_id ahci_pci_tbl[] = {
@@ -399,7 +411,7 @@ static const struct pci_device_id ahci_p
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_ati }, /* ATI SB600 non-raid */
{ PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */

/* VIA */
@@ -1063,12 +1075,22 @@ static void ahci_error_intr(struct ata_p
/* analyze @irq_stat */
ata_ehi_push_desc(ehi, "irq_stat 0x%08x", irq_stat);

+   qc = ata_qc_from_tag(ap, ap->active_tag);
+
/* some controllers set IRQ_IF_ERR on device errors, ignore it */
if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR)
irq_stat &= ~PORT_IRQ_IF_ERR;

-   if (irq_stat & PORT_IRQ_TF_ERR)
+   if (irq_stat & PORT_IRQ_TF_ERR) {
err_mask |= AC_ERR_DEV;
+   
+   /* some controllers set INTERNAL ERROR on ATAPI IRQ_TF_ERROR, 
ignore it */
+   if ((serror & SERR_INTERNAL) &&
+(ap->flags & AHCI_FLAG_TF_ERR_FIX) &&
+ qc && qc->dev->class == ATA_DEV_ATAPI) {
+   serror &= ~SERR_INTERNAL;
+   }
+   }

if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) {
err_mask |= AC_ERR_HOST_BUS;
@@ -1100,7 +1122,6 @@ static void ahci_error_intr(struct ata_p
ehi->serror |= serror;
ehi->action |= action;

-   qc = ata_qc_from_tag(ap, ap->active_tag);
if (qc)
qc->err_mask |= err_mask;
else
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci.c: fix ati sb600 sata IRQ_TF_ERR

2007-03-14 Thread Conke Hu

   When there is no media in SATA CD/DVD drive or media is not ready,
AHCI controller fails to execute the ATAPI commands TEST_UNIT_READY,
READ_CAPACITY or READ_TOC and reports PORT_IRQ_TF_ERR. But ATI SB600
SATA controller sets SERR_INTERNAL bit in the error register at the
same time, which is not necessary. This patch is just to ignore the
INTERNAL ERROR in such case. Without this patch, ahci error handler
will report many errors as below:
--- cut from dmesg ---
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
res 51/24:03:00:00:20/00:00:00:00:00/a0 Emask 0x40 (internal error)
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x4001)
ata9.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x43 data 12 in
res 51/24:03:00:00:00/00:00:00:00:00/a0 Emask 0x40 (internal error)
 end cut -

Signed-off-by: Conke Hu [EMAIL PROTECTED]

--- linux-2.6.21-rc3-git8/drivers/ata/ahci.c.orig   2007-03-25
20:57:31.0 +0800
+++ linux-2.6.21-rc3-git8/drivers/ata/ahci.c2007-03-25 21:03:54.0 
+0800
@@ -80,6 +80,7 @@ enum {
board_ahci_pi   = 1,
board_ahci_vt8251   = 2,
board_ahci_ign_iferr= 3,
+   board_ahci_ati  = 4,

/* global controller registers */
HOST_CAP= 0x00, /* host capabilities */
@@ -168,6 +169,7 @@ enum {
AHCI_FLAG_NO_NCQ= (1  24),
AHCI_FLAG_IGN_IRQ_IF_ERR= (1  25), /* ignore IRQ_IF_ERR */
AHCI_FLAG_HONOR_PI  = (1  26), /* honor PORTS_IMPL */
+   AHCI_FLAG_TF_ERR_FIX= (1  27), /* ignore INTERNAL ERROR on 
IRQ_TF_ERROR */
};

struct ahci_cmd_hdr {
@@ -362,6 +364,16 @@ static const struct ata_port_info ahci_p
.udma_mask  = 0x7f, /* udma0-6 ; FIXME */
.port_ops   = ahci_ops,
},
+   /* board_ahci_ati */
+   {
+   .sht= ahci_sht,
+   .flags  = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+ ATA_FLAG_SKIP_D2H_BSY | AHCI_FLAG_TF_ERR_FIX,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = 0x7f, /* udma0-6 ; FIXME */
+   .port_ops   = ahci_ops,
+   },  
};

static const struct pci_device_id ahci_pci_tbl[] = {
@@ -399,7 +411,7 @@ static const struct pci_device_id ahci_p
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },

/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_ati }, /* ATI SB600 non-raid */
{ PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */

/* VIA */
@@ -1063,12 +1075,22 @@ static void ahci_error_intr(struct ata_p
/* analyze @irq_stat */
ata_ehi_push_desc(ehi, irq_stat 0x%08x, irq_stat);

+   qc = ata_qc_from_tag(ap, ap-active_tag);
+
/* some controllers set IRQ_IF_ERR on device errors, ignore it */
if (ap-flags  AHCI_FLAG_IGN_IRQ_IF_ERR)
irq_stat = ~PORT_IRQ_IF_ERR;

-   if (irq_stat  PORT_IRQ_TF_ERR)
+   if (irq_stat  PORT_IRQ_TF_ERR) {
err_mask |= AC_ERR_DEV;
+   
+   /* some controllers set INTERNAL ERROR on ATAPI IRQ_TF_ERROR, 
ignore it */
+   if ((serror  SERR_INTERNAL) 
+(ap-flags  AHCI_FLAG_TF_ERR_FIX) 
+ qc  qc-dev-class == ATA_DEV_ATAPI) {
+   serror = ~SERR_INTERNAL;
+   }
+   }

if (irq_stat  (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) {
err_mask |= AC_ERR_HOST_BUS;
@@ -1100,7 +1122,6 @@ static void ahci_error_intr(struct ata_p
ehi-serror |= serror;
ehi-action |= action;

-   qc = ata_qc_from_tag(ap, ap-active_tag);
if (qc)
qc-err_mask |= err_mask;
else
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] ATAPI command TEST_UNIT_READY never succeeds!

2007-03-09 Thread Conke Hu

On 3/7/07, Tejun Heo <[EMAIL PROTECTED]> wrote:

(snip)
I've read your last posting about this, but forgot to follow up.  TUR is
supposed to fail if ATAPI device doesn't have media loaded.  TUR fails
and sense data returns device not ready - media not present.  That's the
normal operation.  Does TUR fail even with media loaded or is sense data
not properly fetched?



Thank you, Tejun! I did forget to load any media :(
When I load media and retry, TUR succeeds but there is still a
problem: when using ahci driver, TUR will not succeed unless it runs
twice, and the following loop always runs till retries==2
 code in sr.c, get_capabilities() -
retries = 0;
do {
memset((void *)cmd, 0, MAX_COMMAND_SIZE);
cmd[0] = TEST_UNIT_READY;

the_result = scsi_execute_req (cd->device, cmd, DMA_NONE, NULL,
   0, , SR_TIMEOUT,
   MAX_RETRIES);

retries++;
} while (retries < 5 &&
 (!scsi_status_is_good(the_result) ||
  (scsi_sense_valid() &&
   sshdr.sense_key == UNIT_ATTENTION)));
- end code
-

this issue only occurs in ahci driver,  and libata + pata driver is OK.

Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] ATAPI command TEST_UNIT_READY never succeeds!

2007-03-09 Thread Conke Hu

On 3/7/07, Tejun Heo [EMAIL PROTECTED] wrote:

(snip)
I've read your last posting about this, but forgot to follow up.  TUR is
supposed to fail if ATAPI device doesn't have media loaded.  TUR fails
and sense data returns device not ready - media not present.  That's the
normal operation.  Does TUR fail even with media loaded or is sense data
not properly fetched?



Thank you, Tejun! I did forget to load any media :(
When I load media and retry, TUR succeeds but there is still a
problem: when using ahci driver, TUR will not succeed unless it runs
twice, and the following loop always runs till retries==2
 code in sr.c, get_capabilities() -
retries = 0;
do {
memset((void *)cmd, 0, MAX_COMMAND_SIZE);
cmd[0] = TEST_UNIT_READY;

the_result = scsi_execute_req (cd-device, cmd, DMA_NONE, NULL,
   0, sshdr, SR_TIMEOUT,
   MAX_RETRIES);

retries++;
} while (retries  5 
 (!scsi_status_is_good(the_result) ||
  (scsi_sense_valid(sshdr) 
   sshdr.sense_key == UNIT_ATTENTION)));
- end code
-

this issue only occurs in ahci driver,  and libata + pata driver is OK.

Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] ATAPI command TEST_UNIT_READY never succeeds!

2007-03-07 Thread Conke Hu

On 3/7/07, Conke Hu <[EMAIL PROTECTED]> wrote:

Hi,
Do you ever noticed that the ATAPI command TEST_UNIT_READY always
fails to execute !?
I debugged in the following environments:
piix + Intel ICH6/ICH7 PATA
atiixp + ATI SB600 PATA
libata + ata_piix + Intel ICH6/ICH7 PATA
libata + sata_sil24 + Silicon Image 3132
libata + ahci + ATI SB600 SATA
libata + ahci + Intel AHCI
but none of them can execute TEST_UNIT_READY command successfully.
For example, in ahci driver, ahci_interrupt() reads port status as
0x4000_, which indicates an taskfile error.

~~

0x4000_0001, not 0x4000_, sorry.

more precisely speaking, ahci_host_intr() reads PORT_IRQ_STAT as
0x4000_0001, not the  expected 0x_0001.

Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[BUG] ATAPI command TEST_UNIT_READY never succeeds!

2007-03-07 Thread Conke Hu

Hi,
   Do you ever noticed that the ATAPI command TEST_UNIT_READY always
fails to execute !?
   I debugged in the following environments:
   piix + Intel ICH6/ICH7 PATA
   atiixp + ATI SB600 PATA
   libata + ata_piix + Intel ICH6/ICH7 PATA
   libata + sata_sil24 + Silicon Image 3132
   libata + ahci + ATI SB600 SATA
   libata + ahci + Intel AHCI
   but none of them can execute TEST_UNIT_READY command successfully.
   For example, in ahci driver, ahci_interrupt() reads port status as
0x4000_, which indicates an taskfile error.


Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[BUG] ATAPI command TEST_UNIT_READY never succeeds!

2007-03-07 Thread Conke Hu

Hi,
   Do you ever noticed that the ATAPI command TEST_UNIT_READY always
fails to execute !?
   I debugged in the following environments:
   piix + Intel ICH6/ICH7 PATA
   atiixp + ATI SB600 PATA
   libata + ata_piix + Intel ICH6/ICH7 PATA
   libata + sata_sil24 + Silicon Image 3132
   libata + ahci + ATI SB600 SATA
   libata + ahci + Intel AHCI
   but none of them can execute TEST_UNIT_READY command successfully.
   For example, in ahci driver, ahci_interrupt() reads port status as
0x4000_, which indicates an taskfile error.


Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] ATAPI command TEST_UNIT_READY never succeeds!

2007-03-07 Thread Conke Hu

On 3/7/07, Conke Hu [EMAIL PROTECTED] wrote:

Hi,
Do you ever noticed that the ATAPI command TEST_UNIT_READY always
fails to execute !?
I debugged in the following environments:
piix + Intel ICH6/ICH7 PATA
atiixp + ATI SB600 PATA
libata + ata_piix + Intel ICH6/ICH7 PATA
libata + sata_sil24 + Silicon Image 3132
libata + ahci + ATI SB600 SATA
libata + ahci + Intel AHCI
but none of them can execute TEST_UNIT_READY command successfully.
For example, in ahci driver, ahci_interrupt() reads port status as
0x4000_, which indicates an taskfile error.

~~

0x4000_0001, not 0x4000_, sorry.

more precisely speaking, ahci_host_intr() reads PORT_IRQ_STAT as
0x4000_0001, not the  expected 0x_0001.

Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-14 Thread Conke Hu

On 2/13/07, Conke Hu <[EMAIL PROTECTED]> wrote:

On 2/2/07, Conke Hu <[EMAIL PROTECTED]> wrote:
> On Wed, 2007-02-07 at 07:40 -0500, Jeff Garzik wrote:
> > Conke Hu wrote:
> > > Hi,
> > >TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
> > > see below) always returns error.
> > >
> > >    code begin -
> > > retries = 0;
> > > do {
> > > memset((void *)cmd, 0, MAX_COMMAND_SIZE);
> > > cmd[0] = TEST_UNIT_READY;
> > >
> > > the_result = scsi_execute_req (cd->device, cmd, DMA_NONE, NULL,
> > >0, , SR_TIMEOUT,
> > >MAX_RETRIES);
> > >
> > > retries++;
> > > } while (retries < 5 &&
> > >  (!scsi_status_is_good(the_result) ||
> > >   (scsi_sense_valid() &&
> > >sshdr.sense_key == UNIT_ATTENTION)));
> > >    code end -
> > >
> > >   I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
> > > and other vendor's PATA/IDE controllers, and I get the_result==0x802
> > > and retries==5; on silicon image 3132, i get the_result=0x2eb.
> > >   Does 0x802 mean ((DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION)?
> > > what's wrong?
> >
> > What does the sense data returned in the sense buffer say is wrong?
> >
> >   Jeff
>
> I dump scsi_sense_hdr as follows:
> sshdr.response_code = 0x70
> sshdr.sense_key = 0x2
> sshdr.asc = 0x3a
> sshdr.ascq = 0x1
> sshdr.additional_length = 0x0
>
> the sense_key is 0x2 (NOT_READY), but the expected UNIT_ATTENTION :(
but "NOT" the expected UNIT_ATTENTION.

>
> BTW, I am sorry for a mistake, Sil3132 also returns 0x802, not 0x2eb
> as I said in the first mail. In a word, all cases return "the_result" as
> 0x802.
>


the bytes 0 ~ 13 in sense buffer are:
70 00 02 00 00 00 00 0a 00 00 00 00 3a
other bytes are all 0x00;

in fact this issue can be reproduced in any libata driver, either sata or pata.

Conke



[resend]
any suggestion ?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-14 Thread Conke Hu

On 2/13/07, Conke Hu [EMAIL PROTECTED] wrote:

On 2/2/07, Conke Hu [EMAIL PROTECTED] wrote:
 On Wed, 2007-02-07 at 07:40 -0500, Jeff Garzik wrote:
  Conke Hu wrote:
   Hi,
  TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
   see below) always returns error.
  
  code begin -
   retries = 0;
   do {
   memset((void *)cmd, 0, MAX_COMMAND_SIZE);
   cmd[0] = TEST_UNIT_READY;
  
   the_result = scsi_execute_req (cd-device, cmd, DMA_NONE, NULL,
  0, sshdr, SR_TIMEOUT,
  MAX_RETRIES);
  
   retries++;
   } while (retries  5 
(!scsi_status_is_good(the_result) ||
 (scsi_sense_valid(sshdr) 
  sshdr.sense_key == UNIT_ATTENTION)));
  code end -
  
 I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
   and other vendor's PATA/IDE controllers, and I get the_result==0x802
   and retries==5; on silicon image 3132, i get the_result=0x2eb.
 Does 0x802 mean ((DRIVER_SENSE  24) | SAM_STAT_CHECK_CONDITION)?
   what's wrong?
 
  What does the sense data returned in the sense buffer say is wrong?
 
Jeff

 I dump scsi_sense_hdr as follows:
 sshdr.response_code = 0x70
 sshdr.sense_key = 0x2
 sshdr.asc = 0x3a
 sshdr.ascq = 0x1
 sshdr.additional_length = 0x0

 the sense_key is 0x2 (NOT_READY), but the expected UNIT_ATTENTION :(
but NOT the expected UNIT_ATTENTION.


 BTW, I am sorry for a mistake, Sil3132 also returns 0x802, not 0x2eb
 as I said in the first mail. In a word, all cases return the_result as
 0x802.



the bytes 0 ~ 13 in sense buffer are:
70 00 02 00 00 00 00 0a 00 00 00 00 3a
other bytes are all 0x00;

in fact this issue can be reproduced in any libata driver, either sata or pata.

Conke



[resend]
any suggestion ?
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-12 Thread Conke Hu

On 2/2/07, Conke Hu <[EMAIL PROTECTED]> wrote:

On Wed, 2007-02-07 at 07:40 -0500, Jeff Garzik wrote:
> Conke Hu wrote:
> > Hi,
> >TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
> > see below) always returns error.
> >
> >    code begin -
> > retries = 0;
> > do {
> > memset((void *)cmd, 0, MAX_COMMAND_SIZE);
> > cmd[0] = TEST_UNIT_READY;
> >
> > the_result = scsi_execute_req (cd->device, cmd, DMA_NONE, NULL,
> >0, , SR_TIMEOUT,
> >MAX_RETRIES);
> >
> > retries++;
> > } while (retries < 5 &&
> >  (!scsi_status_is_good(the_result) ||
> >   (scsi_sense_valid() &&
> >sshdr.sense_key == UNIT_ATTENTION)));
> >    code end -
> >
> >   I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
> > and other vendor's PATA/IDE controllers, and I get the_result==0x802
> > and retries==5; on silicon image 3132, i get the_result=0x2eb.
> >   Does 0x802 mean ((DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION)?
> > what's wrong?
>
> What does the sense data returned in the sense buffer say is wrong?
>
>   Jeff

I dump scsi_sense_hdr as follows:
sshdr.response_code = 0x70
sshdr.sense_key = 0x2
sshdr.asc = 0x3a
sshdr.ascq = 0x1
sshdr.additional_length = 0x0

the sense_key is 0x2 (NOT_READY), but the expected UNIT_ATTENTION :(

but "NOT" the expected UNIT_ATTENTION.



BTW, I am sorry for a mistake, Sil3132 also returns 0x802, not 0x2eb
as I said in the first mail. In a word, all cases return "the_result" as
0x802.




the bytes 0 ~ 13 in sense buffer are:
70 00 02 00 00 00 00 0a 00 00 00 00 3a
other bytes are all 0x00;

in fact this issue can be reproduced in any libata driver, either sata or pata.

Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-12 Thread Conke Hu

On 2/2/07, Conke Hu [EMAIL PROTECTED] wrote:

On Wed, 2007-02-07 at 07:40 -0500, Jeff Garzik wrote:
 Conke Hu wrote:
  Hi,
 TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
  see below) always returns error.
 
 code begin -
  retries = 0;
  do {
  memset((void *)cmd, 0, MAX_COMMAND_SIZE);
  cmd[0] = TEST_UNIT_READY;
 
  the_result = scsi_execute_req (cd-device, cmd, DMA_NONE, NULL,
 0, sshdr, SR_TIMEOUT,
 MAX_RETRIES);
 
  retries++;
  } while (retries  5 
   (!scsi_status_is_good(the_result) ||
(scsi_sense_valid(sshdr) 
 sshdr.sense_key == UNIT_ATTENTION)));
 code end -
 
I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
  and other vendor's PATA/IDE controllers, and I get the_result==0x802
  and retries==5; on silicon image 3132, i get the_result=0x2eb.
Does 0x802 mean ((DRIVER_SENSE  24) | SAM_STAT_CHECK_CONDITION)?
  what's wrong?

 What does the sense data returned in the sense buffer say is wrong?

   Jeff

I dump scsi_sense_hdr as follows:
sshdr.response_code = 0x70
sshdr.sense_key = 0x2
sshdr.asc = 0x3a
sshdr.ascq = 0x1
sshdr.additional_length = 0x0

the sense_key is 0x2 (NOT_READY), but the expected UNIT_ATTENTION :(

but NOT the expected UNIT_ATTENTION.



BTW, I am sorry for a mistake, Sil3132 also returns 0x802, not 0x2eb
as I said in the first mail. In a word, all cases return the_result as
0x802.




the bytes 0 ~ 13 in sense buffer are:
70 00 02 00 00 00 00 0a 00 00 00 00 3a
other bytes are all 0x00;

in fact this issue can be reproduced in any libata driver, either sata or pata.

Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-08 Thread Conke Hu
On Wed, 2007-02-07 at 07:40 -0500, Jeff Garzik wrote:
> Conke Hu wrote:
> > Hi,
> >TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
> > see below) always returns error.
> > 
> >    code begin -
> > retries = 0;
> > do {
> > memset((void *)cmd, 0, MAX_COMMAND_SIZE);
> > cmd[0] = TEST_UNIT_READY;
> > 
> > the_result = scsi_execute_req (cd->device, cmd, DMA_NONE, NULL,
> >0, , SR_TIMEOUT,
> >MAX_RETRIES);
> > 
> > retries++;
> > } while (retries < 5 &&
> >  (!scsi_status_is_good(the_result) ||
> >   (scsi_sense_valid() &&
> >sshdr.sense_key == UNIT_ATTENTION)));
> >    code end -
> > 
> >   I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
> > and other vendor's PATA/IDE controllers, and I get the_result==0x802
> > and retries==5; on silicon image 3132, i get the_result=0x2eb.
> >   Does 0x802 mean ((DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION)?
> > what's wrong?
> 
> What does the sense data returned in the sense buffer say is wrong?
> 
>   Jeff

I dump scsi_sense_hdr as follows:
sshdr.response_code = 0x70
sshdr.sense_key = 0x2
sshdr.asc = 0x3a
sshdr.ascq = 0x1
sshdr.additional_length = 0x0

the sense_key is 0x2 (NOT_READY), but the expected UNIT_ATTENTION :(

BTW, I am sorry for a mistake, Sil3132 also returns 0x802, not 0x2eb
as I said in the first mail. In a word, all cases return "the_result" as
0x802.

Conke



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-08 Thread Conke Hu
On Wed, 2007-02-07 at 07:40 -0500, Jeff Garzik wrote:
 Conke Hu wrote:
  Hi,
 TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
  see below) always returns error.
  
 code begin -
  retries = 0;
  do {
  memset((void *)cmd, 0, MAX_COMMAND_SIZE);
  cmd[0] = TEST_UNIT_READY;
  
  the_result = scsi_execute_req (cd-device, cmd, DMA_NONE, NULL,
 0, sshdr, SR_TIMEOUT,
 MAX_RETRIES);
  
  retries++;
  } while (retries  5 
   (!scsi_status_is_good(the_result) ||
(scsi_sense_valid(sshdr) 
 sshdr.sense_key == UNIT_ATTENTION)));
 code end -
  
I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
  and other vendor's PATA/IDE controllers, and I get the_result==0x802
  and retries==5; on silicon image 3132, i get the_result=0x2eb.
Does 0x802 mean ((DRIVER_SENSE  24) | SAM_STAT_CHECK_CONDITION)?
  what's wrong?
 
 What does the sense data returned in the sense buffer say is wrong?
 
   Jeff

I dump scsi_sense_hdr as follows:
sshdr.response_code = 0x70
sshdr.sense_key = 0x2
sshdr.asc = 0x3a
sshdr.ascq = 0x1
sshdr.additional_length = 0x0

the sense_key is 0x2 (NOT_READY), but the expected UNIT_ATTENTION :(

BTW, I am sorry for a mistake, Sil3132 also returns 0x802, not 0x2eb
as I said in the first mail. In a word, all cases return the_result as
0x802.

Conke



-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-07 Thread Conke Hu
Hi,
   TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
see below) always returns error.

   code begin -
retries = 0;
do {
memset((void *)cmd, 0, MAX_COMMAND_SIZE);
cmd[0] = TEST_UNIT_READY;

the_result = scsi_execute_req (cd->device, cmd, DMA_NONE, NULL,
   0, , SR_TIMEOUT,
   MAX_RETRIES);

retries++;
} while (retries < 5 &&
 (!scsi_status_is_good(the_result) ||
  (scsi_sense_valid() &&
   sshdr.sense_key == UNIT_ATTENTION)));
   code end -

  I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
and other vendor's PATA/IDE controllers, and I get the_result==0x802
and retries==5; on silicon image 3132, i get the_result=0x2eb.
  Does 0x802 mean ((DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION)?
what's wrong?


Conke 



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[LIBATA BUG] sr.c: TEST_UNIT_READY error

2007-02-07 Thread Conke Hu
Hi,
   TEST_UNIT_READY in get_capabilities (drivers/scsi/sr.c line 743, or
see below) always returns error.

   code begin -
retries = 0;
do {
memset((void *)cmd, 0, MAX_COMMAND_SIZE);
cmd[0] = TEST_UNIT_READY;

the_result = scsi_execute_req (cd-device, cmd, DMA_NONE, NULL,
   0, sshdr, SR_TIMEOUT,
   MAX_RETRIES);

retries++;
} while (retries  5 
 (!scsi_status_is_good(the_result) ||
  (scsi_sense_valid(sshdr) 
   sshdr.sense_key == UNIT_ATTENTION)));
   code end -

  I debugged all kernel versions from 2.6.17 to 2.6.20 on several AMD
and other vendor's PATA/IDE controllers, and I get the_result==0x802
and retries==5; on silicon image 3132, i get the_result=0x2eb.
  Does 0x802 mean ((DRIVER_SENSE  24) | SAM_STAT_CHECK_CONDITION)?
what's wrong?


Conke 



-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git patches] libata fixes

2007-02-06 Thread Conke Hu
On Fri, 2007-02-02 at 11:58 -0500, Jeff Garzik wrote:
> Brian and Tejun's patches fix really ugly bugs, Alan's are of less
> importance
> 
> Please pull from 'upstream-linus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
> upstream-linus
> 
> to receive the following updates:
> 
>  drivers/ata/libata-core.c  |1 +
>  drivers/ata/pata_atiixp.c  |   11 +--
>  drivers/ata/pata_jmicron.c |   18 +-
>  drivers/ata/pata_via.c |3 ++-
>  drivers/pci/quirks.c   |4 ++--
>  include/linux/libata.h |2 ++
>  6 files changed, 21 insertions(+), 18 deletions(-)
> 
> Alan (3):
>   pata_atiixp: propogate cable detection hack from drivers/ide to the new 
> driver
>   pata_via: Correct missing comments
>   libata: Fix ata_busy_wait() kernel docs
> 
> Brian King (1):
>   libata: Initialize nbytes for internal sg commands
> 
> Tejun Heo (1):
>   ahci/pata_jmicron: fix JMicron quirk
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index cf70702..667acd2 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
>  
>   ata_sg_init(qc, sg, n_elem);
>   qc->nsect = buflen / ATA_SECT_SIZE;
> + qc->nbytes = buflen;
>   }
>  
>   qc->private_data = 
> diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
> index 6f6672c..504e1db 100644
> --- a/drivers/ata/pata_atiixp.c
> +++ b/drivers/ata/pata_atiixp.c
> @@ -36,15 +36,22 @@ enum {
>  static int atiixp_pre_reset(struct ata_port *ap)
>  {
>   struct pci_dev *pdev = to_pci_dev(ap->host->dev);
> - static struct pci_bits atiixp_enable_bits[] = {
> + static const struct pci_bits atiixp_enable_bits[] = {
>   { 0x48, 1, 0x01, 0x00 },
>   { 0x48, 1, 0x08, 0x00 }
>   };
> + u8 udma;
>  
>   if (!pci_test_config_bits(pdev, _enable_bits[ap->port_no]))
>   return -ENOENT;
>  
> - ap->cbl = ATA_CBL_PATA80;
> + /* Hack from drivers/ide/pci. Really we want to know how to do the
> +raw detection not play follow the bios mode guess */
> + pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, );
> + if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40)
> + ap->cbl = ATA_CBL_PATA80;
> + else
> + ap->cbl = ATA_CBL_PATA40;
>   return ata_std_prereset(ap);
>  }
> (snip)
>  

Alan's patch is also important. Thank you :)

Without the patch, OS on 40-pin cable maybe get IDE DMA error (CRC
error, system hang, or even data crash).

Conke


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: what does "busses" (drivers/i2c/busses) mean?

2007-02-06 Thread Conke Hu
On Mon, 2007-02-05 at 08:17 -0800, Randy Dunlap wrote:
> On Mon, 5 Feb 2007 14:23:35 +0800 Conke Hu wrote:
> 
> > what does the directory name drivers/i2c/busses mean? did it mean bus(es)?
> 
> "busses" is an acceptable spelling of "buses" in some places,
> so Yes, I believe that it means "bus(es)".
> 
> or is your question more than that?
> 
> ---
> ~Randy

Thank you, Randy
I look up in www.stardict.org which tells me the word "buss" means
"kiss", so i was confused :)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: what does busses (drivers/i2c/busses) mean?

2007-02-06 Thread Conke Hu
On Mon, 2007-02-05 at 08:17 -0800, Randy Dunlap wrote:
 On Mon, 5 Feb 2007 14:23:35 +0800 Conke Hu wrote:
 
  what does the directory name drivers/i2c/busses mean? did it mean bus(es)?
 
 busses is an acceptable spelling of buses in some places,
 so Yes, I believe that it means bus(es).
 
 or is your question more than that?
 
 ---
 ~Randy

Thank you, Randy
I look up in www.stardict.org which tells me the word buss means
kiss, so i was confused :)


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [git patches] libata fixes

2007-02-06 Thread Conke Hu
On Fri, 2007-02-02 at 11:58 -0500, Jeff Garzik wrote:
 Brian and Tejun's patches fix really ugly bugs, Alan's are of less
 importance
 
 Please pull from 'upstream-linus' branch of
 master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
 upstream-linus
 
 to receive the following updates:
 
  drivers/ata/libata-core.c  |1 +
  drivers/ata/pata_atiixp.c  |   11 +--
  drivers/ata/pata_jmicron.c |   18 +-
  drivers/ata/pata_via.c |3 ++-
  drivers/pci/quirks.c   |4 ++--
  include/linux/libata.h |2 ++
  6 files changed, 21 insertions(+), 18 deletions(-)
 
 Alan (3):
   pata_atiixp: propogate cable detection hack from drivers/ide to the new 
 driver
   pata_via: Correct missing comments
   libata: Fix ata_busy_wait() kernel docs
 
 Brian King (1):
   libata: Initialize nbytes for internal sg commands
 
 Tejun Heo (1):
   ahci/pata_jmicron: fix JMicron quirk
 
 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
 index cf70702..667acd2 100644
 --- a/drivers/ata/libata-core.c
 +++ b/drivers/ata/libata-core.c
 @@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
  
   ata_sg_init(qc, sg, n_elem);
   qc-nsect = buflen / ATA_SECT_SIZE;
 + qc-nbytes = buflen;
   }
  
   qc-private_data = wait;
 diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
 index 6f6672c..504e1db 100644
 --- a/drivers/ata/pata_atiixp.c
 +++ b/drivers/ata/pata_atiixp.c
 @@ -36,15 +36,22 @@ enum {
  static int atiixp_pre_reset(struct ata_port *ap)
  {
   struct pci_dev *pdev = to_pci_dev(ap-host-dev);
 - static struct pci_bits atiixp_enable_bits[] = {
 + static const struct pci_bits atiixp_enable_bits[] = {
   { 0x48, 1, 0x01, 0x00 },
   { 0x48, 1, 0x08, 0x00 }
   };
 + u8 udma;
  
   if (!pci_test_config_bits(pdev, atiixp_enable_bits[ap-port_no]))
   return -ENOENT;
  
 - ap-cbl = ATA_CBL_PATA80;
 + /* Hack from drivers/ide/pci. Really we want to know how to do the
 +raw detection not play follow the bios mode guess */
 + pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap-port_no, udma);
 + if ((udma  0x07) = 0x04 || (udma  0x70) = 0x40)
 + ap-cbl = ATA_CBL_PATA80;
 + else
 + ap-cbl = ATA_CBL_PATA40;
   return ata_std_prereset(ap);
  }
 (snip)
  

Alan's patch is also important. Thank you :)

Without the patch, OS on 40-pin cable maybe get IDE DMA error (CRC
error, system hang, or even data crash).

Conke


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


what does "busses" (drivers/i2c/busses) mean?

2007-02-04 Thread Conke Hu

what does the directory name drivers/i2c/busses mean? did it mean bus(es)?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


what does busses (drivers/i2c/busses) mean?

2007-02-04 Thread Conke Hu

what does the directory name drivers/i2c/busses mean? did it mean bus(es)?
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] atiixp.c: add cable detection support for ATI IDE

2007-01-09 Thread Conke Hu

On 1/10/07, Andrew Morton <[EMAIL PROTECTED]> wrote:


Here are the three patches.  Conke, can you please tell us whether this is
all correct and complete?

From: "Conke Hu" <[EMAIL PROTECTED]>

A previous patch to atiixp.c was removed but some code has not been
cleaned. Now we remove these code sine they are no use any longer.

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
Cc: Alan Cox <[EMAIL PROTECTED]>
Cc: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
Cc: Greg KH <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/ide/pci/atiixp.c |   21 +
 1 files changed, 1 insertion(+), 20 deletions(-)

diff -puN drivers/ide/pci/atiixp.c~atiixpc-remove-unused-code 
drivers/ide/pci/atiixp.c
--- a/drivers/ide/pci/atiixp.c~atiixpc-remove-unused-code
+++ a/drivers/ide/pci/atiixp.c
@@ -320,19 +320,6 @@ static void __devinit init_hwif_atiixp(i
hwif->drives[0].autodma = hwif->autodma;
 }

-static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif)
-{
-
-   hwif->atapi_dma = 1;
-   hwif->ultra_mask = 0x7f;
-   hwif->mwdma_mask = 0x07;
-   hwif->swdma_mask = 0x07;
-
-   if (!noautodma)
-   hwif->autodma = 1;
-   hwif->drives[0].autodma = hwif->autodma;
-   hwif->drives[1].autodma = hwif->autodma;
-}

 static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
{   /* 0 */
@@ -342,13 +329,7 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },{ /* 1 */
-   .name   = "ATI SB600 SATA Legacy IDE",
-   .init_hwif  = init_hwif_sb600_legacy,
-   .channels   = 2,
-   .autodma= AUTODMA,
-   .bootable   = ON_BOARD,
-   }
+   },
 };

 /**
_



From: "Conke Hu" <[EMAIL PROTECTED]>

AMD/ATI SB600 IDE/PATA controller only has one channel.

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
Cc: Alan Cox <[EMAIL PROTECTED]>
Cc: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
Cc: Greg KH <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/ide/pci/atiixp.c |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -puN drivers/ide/pci/atiixp.c~atiixpc-sb600-ide-only-has-one-channel 
drivers/ide/pci/atiixp.c
--- a/drivers/ide/pci/atiixp.c~atiixpc-sb600-ide-only-has-one-channel
+++ a/drivers/ide/pci/atiixp.c
@@ -329,7 +329,14 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },
+   },{ /* 1 */
+   .name   = "SB600_PATA",
+   .init_hwif  = init_hwif_atiixp,
+   .channels   = 1,
+   .autodma= AUTODMA,
+   .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
+   .bootable   = ON_BOARD,
+   },
 };

 /**
@@ -350,7 +357,7 @@ static struct pci_device_id atiixp_pci_t
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
-   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
+   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 1},
{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
_


From: "Conke Hu" <[EMAIL PROTECTED]>

IDE HDD does not work if it uses a 40-pin PATA cable on ATI chipset.
This patch fixes the bug.

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
Cc: Alan Cox <[EMAIL PROTECTED]>
Cc: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
Cc: Greg KH <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/ide/pci/atiixp.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff -puN 
drivers/ide/pci/atiixp.c~atiixpc-add-cable-detection-support-for-ati-ide 
drivers/ide/pci/atiixp.c
--- a/drivers/ide/pci/atiixp.c~atiixpc-add-cable-detection-support-for-ati-ide
+++ a/drivers/ide/pci/atiixp.c
@@ -291,8 +291,12 @@ fast_ata_pio:

 static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
 {
+   u8 udma_mode = 0;
+   u8 ch = hwif->channel;
+   struct pci_dev *pdev = hwif->pci_dev;
+
if (!hwif->irq)
-   hwif->irq = hwif->channel ? 15 : 14;
+   hwif->irq = ch ? 15 : 14;

hwif->autodma = 0;
hwif->tuneproc = _tuneproc;
@@ -308,8 +312,12 @@ 

Re: [PATCH 3/3] atiixp.c: add cable detection support for ATI IDE

2007-01-09 Thread Conke Hu

On 1/7/07, Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> wrote:

On 1/6/07, Conke Hu <[EMAIL PROTECTED]> wrote:
> IDE HDD does not work if it uses a 40-pin PATA cable on ATI chipset.
> This patch fixes the bug.
>
> Signed-off-by: Conke Hu <[EMAIL PROTECTED]>

Acked-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>

[ the one is also line wrapped, please resend them ]



re-created.
pls apply it after the [patch 1/3] and [patch 2/3] :)

--- linux-2.6.20-rc4/drivers/ide/pci/atiixp.c.3 2007-01-09
15:37:42.0 +0800
+++ linux-2.6.20-rc4/drivers/ide/pci/atiixp.c   2007-01-09
15:40:08.0 +0800
@@ -291,8 +291,12 @@ fast_ata_pio:

static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
{
+   u8 udma_mode = 0;
+   u8 ch = hwif->channel;
+   struct pci_dev *pdev = hwif->pci_dev;
+
if (!hwif->irq)
-   hwif->irq = hwif->channel ? 15 : 14;
+   hwif->irq = ch ? 15 : 14;

hwif->autodma = 0;
hwif->tuneproc = _tuneproc;
@@ -308,8 +312,12 @@ static void __devinit init_hwif_atiixp(i
hwif->mwdma_mask = 0x06;
hwif->swdma_mask = 0x04;

-   /* FIXME: proper cable detection needed */
-   hwif->udma_four = 1;
+   pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, _mode);
+   if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
+   hwif->udma_four = 1;
+   else
+   hwif->udma_four = 0;
+
hwif->ide_dma_host_on = _ide_dma_host_on;
hwif->ide_dma_host_off = _ide_dma_host_off;
hwif->ide_dma_check = _dma_check;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] atiixp.c: sb600 ide only has one channel

2007-01-09 Thread Conke Hu

On 1/7/07, Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> wrote:

On 1/6/07, Conke Hu <[EMAIL PROTECTED]> wrote:
> AMD/ATI SB600 IDE/PATA controller only has one channel.
>
> Signed-off-by: Conke Hu <[EMAIL PROTECTED]>

Acked-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>

[ but the patch is line wrapped ]



Hi Bart,
   Thank you!
   I've re-created the patch based on 2.6.20-rc4, pls see below.
   I've sent out 3 patches for the same file atiixp.c, pls apply it
after the [patch 1/3] :)
---
--- linux-2.6.20-rc4/drivers/ide/pci/atiixp.c.2 2007-01-09
15:21:29.0 +0800
+++ linux-2.6.20-rc4/drivers/ide/pci/atiixp.c   2007-01-09
15:25:15.0 +0800
@@ -328,7 +328,14 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },
+   },{ /* 1 */
+   .name   = "SB600_PATA",
+   .init_hwif  = init_hwif_atiixp,
+   .channels   = 1,
+   .autodma= AUTODMA,
+   .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
+   .bootable   = ON_BOARD,
+   },
};

/**
@@ -349,7 +356,7 @@ static struct pci_device_id atiixp_pci_t
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
-   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
+   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] atiixp.c: remove unused code

2007-01-09 Thread Conke Hu

On 1/7/07, Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]> wrote:

On 1/6/07, Conke Hu <[EMAIL PROTECTED]> wrote:
> A previous patch to atiixp.c was removed but some code has not been

This one?

http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab17443a3df35abe4b7529e83511a591aa7384f3

Doesn't it break existing setups without giving ANY warning?

theoretical (I don't have hardware in question) scenario:
- user uses atiixp and has modular libata/ahci (or no libata/ahci et all)
- user does kernel upgrade
- boot fails
- ...

If this is true please add something like

printk(KERN_WARNING "PCI: setting SB600 SATA to AHCI mode"
" (please use ahci driver instead of atiixp)\n");

to quirk_sb600_sata() so people will at least know what is wrong...

> cleaned. Now we remove these code sine they are no use any longer.

Acked-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>

[ but the patch is line wrapped and unfortunately doesn't apply ]

PS: please always cc: linux-ide@vger.kernel.org on PATA/SATA patches

Thanks,
Bart




Hi Bart,
   I've tried to access the following link to make sure which it is,
but failed. The internet here   is almost broken.
   
http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab17443a3df35abe4b7529e83511a591aa7384f3

  I sent out 2 patches for the same SB600 legacy IDE issue. the later
(sb600 pci qurik) is better so we should clean the previous patch
which was applied to atiixp.c. -- that is what this patch does.

   BTW, I re-create and re-send the patch (see below) based on
2.6.20-rc4, in last patch I fogot to rename atiixp.c.1 to atiixp.c
which may lead to patch fail, nothing else different.
   And maybe no need to re-ACK if last one is accepted:)
   Thanks!


--- linux-2.6.20-rc4/drivers/ide/pci/atiixp.c.1 2007-01-09
15:19:05.0 +0800
+++ linux-2.6.20-rc4/drivers/ide/pci/atiixp.c   2007-01-09
15:17:54.0 +0800
@@ -320,20 +320,6 @@ static void __devinit init_hwif_atiixp(i
hwif->drives[0].autodma = hwif->autodma;
}

-static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif)
-{
-
-   hwif->atapi_dma = 1;
-   hwif->ultra_mask = 0x7f;
-   hwif->mwdma_mask = 0x07;
-   hwif->swdma_mask = 0x07;
-
-   if (!noautodma)
-   hwif->autodma = 1;
-   hwif->drives[0].autodma = hwif->autodma;
-   hwif->drives[1].autodma = hwif->autodma;
-}
-
static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
{   /* 0 */
.name   = "ATIIXP",
@@ -342,13 +328,7 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },{ /* 1 */
-   .name   = "ATI SB600 SATA Legacy IDE",
-   .init_hwif  = init_hwif_sb600_legacy,
-   .channels   = 2,
-   .autodma= AUTODMA,
-   .bootable   = ON_BOARD,
-   }
+   },
};

/**
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Add pci class code for SATA (patch updated)

2007-01-09 Thread Conke Hu

On 1/8/07, Jeff Garzik <[EMAIL PROTECTED]> wrote:

 ...
The above seems OK to me...

Jeff



add pci class code for SATA & AHCI, and replace some magic numbers.

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>

diff -Nur linux-2.6.20-rc4.orig/drivers/ata/ahci.c
linux-2.6.20-rc4/drivers/ata/ahci.c
--- linux-2.6.20-rc4.orig/drivers/ata/ahci.c2007-01-09 15:50:14.0 
+0800
+++ linux-2.6.20-rc4/drivers/ata/ahci.c 2007-01-09 15:53:52.0 +0800
@@ -426,7 +426,7 @@

/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- 0x010601, 0xff, board_ahci },
+ PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci },

{ } /* terminate list */
};
@@ -1594,11 +1594,11 @@
speed_s = "?";

pci_read_config_word(pdev, 0x0a, );
-   if (cc == 0x0101)
+   if (cc == PCI_CLASS_STORAGE_IDE)
scc_s = "IDE";
-   else if (cc == 0x0106)
+   else if (cc == PCI_CLASS_STORAGE_SATA)
scc_s = "SATA";
-   else if (cc == 0x0104)
+   else if (cc == PCI_CLASS_STORAGE_RAID)
scc_s = "RAID";
else
scc_s = "unknown";
diff -Nur linux-2.6.20-rc4.orig/drivers/pci/quirks.c
linux-2.6.20-rc4/drivers/pci/quirks.c
--- linux-2.6.20-rc4.orig/drivers/pci/quirks.c  2007-01-09
15:50:14.0 +0800
+++ linux-2.6.20-rc4/drivers/pci/quirks.c   2007-01-09 15:52:10.0 
+0800
@@ -862,7 +862,7 @@
pci_write_config_byte(pdev, 0xa, 6);
pci_write_config_byte(pdev, 0x40, tmp);

-   pdev->class = 0x010601;
+   pdev->class = PCI_CLASS_STORAGE_SATA_AHCI;
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI,
PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata);
diff -Nur linux-2.6.20-rc4.orig/include/linux/pci_ids.h
linux-2.6.20-rc4/include/linux/pci_ids.h
--- linux-2.6.20-rc4.orig/include/linux/pci_ids.h   2007-01-09
15:50:14.0 +0800
+++ linux-2.6.20-rc4/include/linux/pci_ids.h2007-01-09 15:51:42.0 
+0800
@@ -15,6 +15,8 @@
#define PCI_CLASS_STORAGE_FLOPPY0x0102
#define PCI_CLASS_STORAGE_IPI   0x0103
#define PCI_CLASS_STORAGE_RAID  0x0104
+#define PCI_CLASS_STORAGE_SATA 0x0106
+#define PCI_CLASS_STORAGE_SATA_AHCI0x010601
#define PCI_CLASS_STORAGE_SAS   0x0107
#define PCI_CLASS_STORAGE_OTHER 0x0180
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Add pci class code for SATA (patch updated)

2007-01-09 Thread Conke Hu

On 1/8/07, Jeff Garzik [EMAIL PROTECTED] wrote:

 ...
The above seems OK to me...

Jeff



add pci class code for SATA  AHCI, and replace some magic numbers.

Signed-off-by: Conke Hu [EMAIL PROTECTED]

diff -Nur linux-2.6.20-rc4.orig/drivers/ata/ahci.c
linux-2.6.20-rc4/drivers/ata/ahci.c
--- linux-2.6.20-rc4.orig/drivers/ata/ahci.c2007-01-09 15:50:14.0 
+0800
+++ linux-2.6.20-rc4/drivers/ata/ahci.c 2007-01-09 15:53:52.0 +0800
@@ -426,7 +426,7 @@

/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- 0x010601, 0xff, board_ahci },
+ PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci },

{ } /* terminate list */
};
@@ -1594,11 +1594,11 @@
speed_s = ?;

pci_read_config_word(pdev, 0x0a, cc);
-   if (cc == 0x0101)
+   if (cc == PCI_CLASS_STORAGE_IDE)
scc_s = IDE;
-   else if (cc == 0x0106)
+   else if (cc == PCI_CLASS_STORAGE_SATA)
scc_s = SATA;
-   else if (cc == 0x0104)
+   else if (cc == PCI_CLASS_STORAGE_RAID)
scc_s = RAID;
else
scc_s = unknown;
diff -Nur linux-2.6.20-rc4.orig/drivers/pci/quirks.c
linux-2.6.20-rc4/drivers/pci/quirks.c
--- linux-2.6.20-rc4.orig/drivers/pci/quirks.c  2007-01-09
15:50:14.0 +0800
+++ linux-2.6.20-rc4/drivers/pci/quirks.c   2007-01-09 15:52:10.0 
+0800
@@ -862,7 +862,7 @@
pci_write_config_byte(pdev, 0xa, 6);
pci_write_config_byte(pdev, 0x40, tmp);

-   pdev-class = 0x010601;
+   pdev-class = PCI_CLASS_STORAGE_SATA_AHCI;
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI,
PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata);
diff -Nur linux-2.6.20-rc4.orig/include/linux/pci_ids.h
linux-2.6.20-rc4/include/linux/pci_ids.h
--- linux-2.6.20-rc4.orig/include/linux/pci_ids.h   2007-01-09
15:50:14.0 +0800
+++ linux-2.6.20-rc4/include/linux/pci_ids.h2007-01-09 15:51:42.0 
+0800
@@ -15,6 +15,8 @@
#define PCI_CLASS_STORAGE_FLOPPY0x0102
#define PCI_CLASS_STORAGE_IPI   0x0103
#define PCI_CLASS_STORAGE_RAID  0x0104
+#define PCI_CLASS_STORAGE_SATA 0x0106
+#define PCI_CLASS_STORAGE_SATA_AHCI0x010601
#define PCI_CLASS_STORAGE_SAS   0x0107
#define PCI_CLASS_STORAGE_OTHER 0x0180
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] atiixp.c: remove unused code

2007-01-09 Thread Conke Hu

On 1/7/07, Bartlomiej Zolnierkiewicz [EMAIL PROTECTED] wrote:

On 1/6/07, Conke Hu [EMAIL PROTECTED] wrote:
 A previous patch to atiixp.c was removed but some code has not been

This one?

http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab17443a3df35abe4b7529e83511a591aa7384f3

Doesn't it break existing setups without giving ANY warning?

theoretical (I don't have hardware in question) scenario:
- user uses atiixp and has modular libata/ahci (or no libata/ahci et all)
- user does kernel upgrade
- boot fails
- ...

If this is true please add something like

printk(KERN_WARNING PCI: setting SB600 SATA to AHCI mode
 (please use ahci driver instead of atiixp)\n);

to quirk_sb600_sata() so people will at least know what is wrong...

 cleaned. Now we remove these code sine they are no use any longer.

Acked-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]

[ but the patch is line wrapped and unfortunately doesn't apply ]

PS: please always cc: linux-ide@vger.kernel.org on PATA/SATA patches

Thanks,
Bart




Hi Bart,
   I've tried to access the following link to make sure which it is,
but failed. The internet here   is almost broken.
   
http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab17443a3df35abe4b7529e83511a591aa7384f3

  I sent out 2 patches for the same SB600 legacy IDE issue. the later
(sb600 pci qurik) is better so we should clean the previous patch
which was applied to atiixp.c. -- that is what this patch does.

   BTW, I re-create and re-send the patch (see below) based on
2.6.20-rc4, in last patch I fogot to rename atiixp.c.1 to atiixp.c
which may lead to patch fail, nothing else different.
   And maybe no need to re-ACK if last one is accepted:)
   Thanks!


--- linux-2.6.20-rc4/drivers/ide/pci/atiixp.c.1 2007-01-09
15:19:05.0 +0800
+++ linux-2.6.20-rc4/drivers/ide/pci/atiixp.c   2007-01-09
15:17:54.0 +0800
@@ -320,20 +320,6 @@ static void __devinit init_hwif_atiixp(i
hwif-drives[0].autodma = hwif-autodma;
}

-static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif)
-{
-
-   hwif-atapi_dma = 1;
-   hwif-ultra_mask = 0x7f;
-   hwif-mwdma_mask = 0x07;
-   hwif-swdma_mask = 0x07;
-
-   if (!noautodma)
-   hwif-autodma = 1;
-   hwif-drives[0].autodma = hwif-autodma;
-   hwif-drives[1].autodma = hwif-autodma;
-}
-
static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
{   /* 0 */
.name   = ATIIXP,
@@ -342,13 +328,7 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },{ /* 1 */
-   .name   = ATI SB600 SATA Legacy IDE,
-   .init_hwif  = init_hwif_sb600_legacy,
-   .channels   = 2,
-   .autodma= AUTODMA,
-   .bootable   = ON_BOARD,
-   }
+   },
};

/**
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] atiixp.c: sb600 ide only has one channel

2007-01-09 Thread Conke Hu

On 1/7/07, Bartlomiej Zolnierkiewicz [EMAIL PROTECTED] wrote:

On 1/6/07, Conke Hu [EMAIL PROTECTED] wrote:
 AMD/ATI SB600 IDE/PATA controller only has one channel.

 Signed-off-by: Conke Hu [EMAIL PROTECTED]

Acked-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]

[ but the patch is line wrapped ]



Hi Bart,
   Thank you!
   I've re-created the patch based on 2.6.20-rc4, pls see below.
   I've sent out 3 patches for the same file atiixp.c, pls apply it
after the [patch 1/3] :)
---
--- linux-2.6.20-rc4/drivers/ide/pci/atiixp.c.2 2007-01-09
15:21:29.0 +0800
+++ linux-2.6.20-rc4/drivers/ide/pci/atiixp.c   2007-01-09
15:25:15.0 +0800
@@ -328,7 +328,14 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },
+   },{ /* 1 */
+   .name   = SB600_PATA,
+   .init_hwif  = init_hwif_atiixp,
+   .channels   = 1,
+   .autodma= AUTODMA,
+   .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
+   .bootable   = ON_BOARD,
+   },
};

/**
@@ -349,7 +356,7 @@ static struct pci_device_id atiixp_pci_t
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
-   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
+   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] atiixp.c: add cable detection support for ATI IDE

2007-01-09 Thread Conke Hu

On 1/7/07, Bartlomiej Zolnierkiewicz [EMAIL PROTECTED] wrote:

On 1/6/07, Conke Hu [EMAIL PROTECTED] wrote:
 IDE HDD does not work if it uses a 40-pin PATA cable on ATI chipset.
 This patch fixes the bug.

 Signed-off-by: Conke Hu [EMAIL PROTECTED]

Acked-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]

[ the one is also line wrapped, please resend them ]



re-created.
pls apply it after the [patch 1/3] and [patch 2/3] :)

--- linux-2.6.20-rc4/drivers/ide/pci/atiixp.c.3 2007-01-09
15:37:42.0 +0800
+++ linux-2.6.20-rc4/drivers/ide/pci/atiixp.c   2007-01-09
15:40:08.0 +0800
@@ -291,8 +291,12 @@ fast_ata_pio:

static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
{
+   u8 udma_mode = 0;
+   u8 ch = hwif-channel;
+   struct pci_dev *pdev = hwif-pci_dev;
+
if (!hwif-irq)
-   hwif-irq = hwif-channel ? 15 : 14;
+   hwif-irq = ch ? 15 : 14;

hwif-autodma = 0;
hwif-tuneproc = atiixp_tuneproc;
@@ -308,8 +312,12 @@ static void __devinit init_hwif_atiixp(i
hwif-mwdma_mask = 0x06;
hwif-swdma_mask = 0x04;

-   /* FIXME: proper cable detection needed */
-   hwif-udma_four = 1;
+   pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, udma_mode);
+   if ((udma_mode  0x07) = 0x04 || (udma_mode  0x70) = 0x40)
+   hwif-udma_four = 1;
+   else
+   hwif-udma_four = 0;
+
hwif-ide_dma_host_on = atiixp_ide_dma_host_on;
hwif-ide_dma_host_off = atiixp_ide_dma_host_off;
hwif-ide_dma_check = atiixp_dma_check;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] atiixp.c: add cable detection support for ATI IDE

2007-01-09 Thread Conke Hu

On 1/10/07, Andrew Morton [EMAIL PROTECTED] wrote:

snip
Here are the three patches.  Conke, can you please tell us whether this is
all correct and complete?

From: Conke Hu [EMAIL PROTECTED]

A previous patch to atiixp.c was removed but some code has not been
cleaned. Now we remove these code sine they are no use any longer.

Signed-off-by: Conke Hu [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Cc: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
Cc: Greg KH [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/ide/pci/atiixp.c |   21 +
 1 files changed, 1 insertion(+), 20 deletions(-)

diff -puN drivers/ide/pci/atiixp.c~atiixpc-remove-unused-code 
drivers/ide/pci/atiixp.c
--- a/drivers/ide/pci/atiixp.c~atiixpc-remove-unused-code
+++ a/drivers/ide/pci/atiixp.c
@@ -320,19 +320,6 @@ static void __devinit init_hwif_atiixp(i
hwif-drives[0].autodma = hwif-autodma;
 }

-static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif)
-{
-
-   hwif-atapi_dma = 1;
-   hwif-ultra_mask = 0x7f;
-   hwif-mwdma_mask = 0x07;
-   hwif-swdma_mask = 0x07;
-
-   if (!noautodma)
-   hwif-autodma = 1;
-   hwif-drives[0].autodma = hwif-autodma;
-   hwif-drives[1].autodma = hwif-autodma;
-}

 static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
{   /* 0 */
@@ -342,13 +329,7 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },{ /* 1 */
-   .name   = ATI SB600 SATA Legacy IDE,
-   .init_hwif  = init_hwif_sb600_legacy,
-   .channels   = 2,
-   .autodma= AUTODMA,
-   .bootable   = ON_BOARD,
-   }
+   },
 };

 /**
_



From: Conke Hu [EMAIL PROTECTED]

AMD/ATI SB600 IDE/PATA controller only has one channel.

Signed-off-by: Conke Hu [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Cc: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
Cc: Greg KH [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/ide/pci/atiixp.c |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -puN drivers/ide/pci/atiixp.c~atiixpc-sb600-ide-only-has-one-channel 
drivers/ide/pci/atiixp.c
--- a/drivers/ide/pci/atiixp.c~atiixpc-sb600-ide-only-has-one-channel
+++ a/drivers/ide/pci/atiixp.c
@@ -329,7 +329,14 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },
+   },{ /* 1 */
+   .name   = SB600_PATA,
+   .init_hwif  = init_hwif_atiixp,
+   .channels   = 1,
+   .autodma= AUTODMA,
+   .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
+   .bootable   = ON_BOARD,
+   },
 };

 /**
@@ -350,7 +357,7 @@ static struct pci_device_id atiixp_pci_t
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
-   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0},
+   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 1},
{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
_


From: Conke Hu [EMAIL PROTECTED]

IDE HDD does not work if it uses a 40-pin PATA cable on ATI chipset.
This patch fixes the bug.

Signed-off-by: Conke Hu [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Cc: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
Cc: Greg KH [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/ide/pci/atiixp.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff -puN 
drivers/ide/pci/atiixp.c~atiixpc-add-cable-detection-support-for-ati-ide 
drivers/ide/pci/atiixp.c
--- a/drivers/ide/pci/atiixp.c~atiixpc-add-cable-detection-support-for-ati-ide
+++ a/drivers/ide/pci/atiixp.c
@@ -291,8 +291,12 @@ fast_ata_pio:

 static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
 {
+   u8 udma_mode = 0;
+   u8 ch = hwif-channel;
+   struct pci_dev *pdev = hwif-pci_dev;
+
if (!hwif-irq)
-   hwif-irq = hwif-channel ? 15 : 14;
+   hwif-irq = ch ? 15 : 14;

hwif-autodma = 0;
hwif-tuneproc = atiixp_tuneproc;
@@ -308,8 +312,12 @@ static void __devinit init_hwif_atiixp(i
hwif-mwdma_mask = 0x06;
hwif-swdma_mask = 0x04;

-   /* FIXME: proper cable detection needed */
-   hwif-udma_four = 1;
+   pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, udma_mode);
+   if ((udma_mode  0x07

[PATCH 3/3] atiixp.c: add cable detection support for ATI IDE

2007-01-06 Thread Conke Hu

IDE HDD does not work if it uses a 40-pin PATA cable on ATI chipset.
This patch fixes the bug.

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
---
--- linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.22007-01-06
19:19:35.0 +0800
+++ linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c  2007-01-06
19:22:34.0 +0800
@@ -289,8 +289,12 @@ fast_ata_pio:

static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
{
+   u8 udma_mode = 0;
+   u8 ch = hwif->channel;
+   struct pci_dev *pdev = hwif->pci_dev;
+
if (!hwif->irq)
-   hwif->irq = hwif->channel ? 15 : 14;
+   hwif->irq = ch ? 15 : 14;

hwif->autodma = 0;
hwif->tuneproc = _tuneproc;
@@ -306,8 +310,12 @@ static void __devinit init_hwif_atiixp(i
hwif->mwdma_mask = 0x06;
hwif->swdma_mask = 0x04;

-   /* FIXME: proper cable detection needed */
-   hwif->udma_four = 1;
+   pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, _mode);
+   if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
+   hwif->udma_four = 1;
+   else
+   hwif->udma_four = 0;
+
hwif->ide_dma_host_on = _ide_dma_host_on;
hwif->ide_dma_host_off = _ide_dma_host_off;
hwif->ide_dma_check = _dma_check;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] atiixp.c: sb600 ide only has one channel

2007-01-06 Thread Conke Hu

AMD/ATI SB600 IDE/PATA controller only has one channel.

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
---
--- linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.12007-01-06
19:13:55.0 +0800
+++ linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.22007-01-06
19:19:35.0 +0800
@@ -327,7 +327,14 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },
+   },{ /* 1 */
+   .name   = "SB600_PATA",
+   .init_hwif  = init_hwif_atiixp,
+   .channels   = 1,
+   .autodma= AUTODMA,
+   .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
+   .bootable   = ON_BOARD,
+   },
};

/**
@@ -348,7 +355,7 @@ static struct pci_device_id atiixp_pci_t
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
-   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
+   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] atiixp.c: remove unused code

2007-01-06 Thread Conke Hu

A previous patch to atiixp.c was removed but some code has not been
cleaned. Now we remove these code sine they are no use any longer.

Signed-off-by: Conke Hu <[EMAIL PROTECTED]>
-
--- linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.orig 2007-01-06
18:45:28.0 +0800
+++ linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.12007-01-06
19:13:55.0 +0800
@@ -318,19 +318,6 @@ static void __devinit init_hwif_atiixp(i
hwif->drives[0].autodma = hwif->autodma;
}

-static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif)
-{
-
-   hwif->atapi_dma = 1;
-   hwif->ultra_mask = 0x7f;
-   hwif->mwdma_mask = 0x07;
-   hwif->swdma_mask = 0x07;
-
-   if (!noautodma)
-   hwif->autodma = 1;
-   hwif->drives[0].autodma = hwif->autodma;
-   hwif->drives[1].autodma = hwif->autodma;
-}

static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
{   /* 0 */
@@ -340,13 +327,7 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },{ /* 1 */
-   .name   = "ATI SB600 SATA Legacy IDE",
-   .init_hwif  = init_hwif_sb600_legacy,
-   .channels   = 2,
-   .autodma= AUTODMA,
-   .bootable   = ON_BOARD,
-   }
+   },
};

/**
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] atiixp.c: remove unused code

2007-01-06 Thread Conke Hu

A previous patch to atiixp.c was removed but some code has not been
cleaned. Now we remove these code sine they are no use any longer.

Signed-off-by: Conke Hu [EMAIL PROTECTED]
-
--- linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.orig 2007-01-06
18:45:28.0 +0800
+++ linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.12007-01-06
19:13:55.0 +0800
@@ -318,19 +318,6 @@ static void __devinit init_hwif_atiixp(i
hwif-drives[0].autodma = hwif-autodma;
}

-static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif)
-{
-
-   hwif-atapi_dma = 1;
-   hwif-ultra_mask = 0x7f;
-   hwif-mwdma_mask = 0x07;
-   hwif-swdma_mask = 0x07;
-
-   if (!noautodma)
-   hwif-autodma = 1;
-   hwif-drives[0].autodma = hwif-autodma;
-   hwif-drives[1].autodma = hwif-autodma;
-}

static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
{   /* 0 */
@@ -340,13 +327,7 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },{ /* 1 */
-   .name   = ATI SB600 SATA Legacy IDE,
-   .init_hwif  = init_hwif_sb600_legacy,
-   .channels   = 2,
-   .autodma= AUTODMA,
-   .bootable   = ON_BOARD,
-   }
+   },
};

/**
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] atiixp.c: sb600 ide only has one channel

2007-01-06 Thread Conke Hu

AMD/ATI SB600 IDE/PATA controller only has one channel.

Signed-off-by: Conke Hu [EMAIL PROTECTED]
---
--- linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.12007-01-06
19:13:55.0 +0800
+++ linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.22007-01-06
19:19:35.0 +0800
@@ -327,7 +327,14 @@ static ide_pci_device_t atiixp_pci_info[
.autodma= AUTODMA,
.enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
.bootable   = ON_BOARD,
-   },
+   },{ /* 1 */
+   .name   = SB600_PATA,
+   .init_hwif  = init_hwif_atiixp,
+   .channels   = 1,
+   .autodma= AUTODMA,
+   .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
+   .bootable   = ON_BOARD,
+   },
};

/**
@@ -348,7 +355,7 @@ static struct pci_device_id atiixp_pci_t
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
-   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
+   { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] atiixp.c: add cable detection support for ATI IDE

2007-01-06 Thread Conke Hu

IDE HDD does not work if it uses a 40-pin PATA cable on ATI chipset.
This patch fixes the bug.

Signed-off-by: Conke Hu [EMAIL PROTECTED]
---
--- linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c.22007-01-06
19:19:35.0 +0800
+++ linux-2.6.20-rc3-git4/drivers/ide/pci/atiixp.c  2007-01-06
19:22:34.0 +0800
@@ -289,8 +289,12 @@ fast_ata_pio:

static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
{
+   u8 udma_mode = 0;
+   u8 ch = hwif-channel;
+   struct pci_dev *pdev = hwif-pci_dev;
+
if (!hwif-irq)
-   hwif-irq = hwif-channel ? 15 : 14;
+   hwif-irq = ch ? 15 : 14;

hwif-autodma = 0;
hwif-tuneproc = atiixp_tuneproc;
@@ -306,8 +310,12 @@ static void __devinit init_hwif_atiixp(i
hwif-mwdma_mask = 0x06;
hwif-swdma_mask = 0x04;

-   /* FIXME: proper cable detection needed */
-   hwif-udma_four = 1;
+   pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, udma_mode);
+   if ((udma_mode  0x07) = 0x04 || (udma_mode  0x70) = 0x40)
+   hwif-udma_four = 1;
+   else
+   hwif-udma_four = 0;
+
hwif-ide_dma_host_on = atiixp_ide_dma_host_on;
hwif-ide_dma_host_off = atiixp_ide_dma_host_off;
hwif-ide_dma_check = atiixp_dma_check;
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu

On 12/20/06, Conke Hu <[EMAIL PROTECTED]> wrote:

On 12/20/06, Conke Hu <[EMAIL PROTECTED]> wrote:
> On 12/20/06, Jeff Garzik <[EMAIL PROTECTED]> wrote:
> > Conke Hu wrote:
> > > Add pci class code 0x0106 for SATA to pci_ids.h
> > >
> > > signed-off-by: [EMAIL PROTECTED]
> > > 
> > > --- linux-2.6.20-rc1/include/linux/pci_ids.h.orig 2006-12-20
> > > 01:58:30.0 +0800
> > > +++ linux-2.6.20-rc1/include/linux/pci_ids.h  2006-12-20
> > > 01:59:07.0 +0800
> > > @@ -15,6 +15,7 @@
> > >  #define PCI_CLASS_STORAGE_FLOPPY 0x0102
> > >  #define PCI_CLASS_STORAGE_IPI0x0103
> > >  #define PCI_CLASS_STORAGE_RAID   0x0104
> > > +#define PCI_CLASS_STORAGE_SATA   0x0106
> > >  #define PCI_CLASS_STORAGE_SAS0x0107
> > >  #define PCI_CLASS_STORAGE_OTHER  0x0180
> >
> > Two comments:
> >
> > 1) I think "_SATA" is an inaccurate description.  It should be _AHCI AFAICS.
> >
> > 2) Typically we don't add constants unless they are used somewhere...
> >
> > Jeff
> >
>
> Hi Jeff,
> According to PCI spec 3.0, 0x0106 means SATA controller, 0x010601
> means AHCI and 0x010600 means vendor specific SATA controller. Pls see
> the following table (PCI spec 3.0 P296):
>
> Base Class  Sub-Class   Interface   Meaning
> 
> 00h 00h SCSI bus controller
> 
> 01h xxh IDE controller
> ---
> 02h 00h Floppy disk controller
> -
> 03h 00h IPI bus controller
> --
> 04h 00h RAID controller
> 01h 
> 20h ATA controller with ADMA 
interface
> 05h 
---
> 30h ATA controller with ADMA 
interface
> 
---
> 00h Serial ATA controller–vendor 
specific interface
> 06h 
-
> 01h Serial ATA controller–AHCI 
1.0 interface
> 
-
> 07h 00h Serial Attached SCSI (SAS) 
controller
> 
-
> 80h 00h Other mass storage controller
> --
>
>
> So, I think, the following macro is correct:
> #define PCI_CLASS_STORAGE_SATA   0x0106
> If you would define AHCI class code, it should be 0x010601, not 0x0106:
> #define PCI_CLASS_STORAGE_SATA_AHCI   0x010601
>
> And, I think that PCI_CLASS_STORAGE_SATA had better be added to
> pci_ids.h since the class code 0x0106 is used more than once. e.g.
> ahci.c uses the magic number 0x0106 twice, and it might be used more
> in future.
>
> Best regards,
> Conke
>


Here is a patch to show more details:
---
diff -Nur linux-2.6.20-rc1.orig/drivers/ata/ahci.c
linux-2.6.20-rc1/drivers/ata/ahci.c
--- linux-2.6.20-rc1.orig/drivers/ata/ahci.c2006-12-20 10:25:00.0 
+0800
+++ linux-2.6.20-rc1/drivers/ata/ahci.c 2006-12-20 10:13:24.0 +0800
@@ -418,7 +418,7 @@

/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- 0x010601, 0xff, board_ahci },
+ PCI_CLASS_STORAGE_SATA<<8|1, 0xff, board_ahci },

{ } /* terminate list */
 };
@@ -1586,11 +1586,11 @@
speed_s = "?";

pci_read_config_word(pdev, 0x0a, );
-   if (cc == 0x0101)
+   if (cc == PCI_CLASS_STORAGE_IDE)
scc_s = "IDE";
-   else if (cc == 0x0106)
+   else if (cc == PCI_CLASS_STORAGE_SATA)
scc_s = "SATA";
-   else if (cc == 0x0104)
+   else if (c

Re: [PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu

On 12/20/06, Conke Hu <[EMAIL PROTECTED]> wrote:

On 12/20/06, Jeff Garzik <[EMAIL PROTECTED]> wrote:
> Conke Hu wrote:
> > Add pci class code 0x0106 for SATA to pci_ids.h
> >
> > signed-off-by: [EMAIL PROTECTED]
> > 
> > --- linux-2.6.20-rc1/include/linux/pci_ids.h.orig 2006-12-20
> > 01:58:30.0 +0800
> > +++ linux-2.6.20-rc1/include/linux/pci_ids.h  2006-12-20
> > 01:59:07.0 +0800
> > @@ -15,6 +15,7 @@
> >  #define PCI_CLASS_STORAGE_FLOPPY 0x0102
> >  #define PCI_CLASS_STORAGE_IPI0x0103
> >  #define PCI_CLASS_STORAGE_RAID   0x0104
> > +#define PCI_CLASS_STORAGE_SATA   0x0106
> >  #define PCI_CLASS_STORAGE_SAS0x0107
> >  #define PCI_CLASS_STORAGE_OTHER  0x0180
>
> Two comments:
>
> 1) I think "_SATA" is an inaccurate description.  It should be _AHCI AFAICS.
>
> 2) Typically we don't add constants unless they are used somewhere...
>
> Jeff
>

Hi Jeff,
According to PCI spec 3.0, 0x0106 means SATA controller, 0x010601
means AHCI and 0x010600 means vendor specific SATA controller. Pls see
the following table (PCI spec 3.0 P296):

Base Class  Sub-Class   Interface   Meaning

00h 00h SCSI bus controller

01h xxh IDE controller
---
02h 00h Floppy disk controller
-
03h 00h IPI bus controller
--
04h 00h RAID controller
01h 
20h ATA controller with ADMA 
interface
05h 
---
30h ATA controller with ADMA 
interface

---
00h Serial ATA controller–vendor 
specific interface
06h 
-
01h Serial ATA controller–AHCI 1.0 
interface

-
07h 00h Serial Attached SCSI (SAS) 
controller

-
80h 00h Other mass storage controller
--


So, I think, the following macro is correct:
#define PCI_CLASS_STORAGE_SATA   0x0106
If you would define AHCI class code, it should be 0x010601, not 0x0106:
#define PCI_CLASS_STORAGE_SATA_AHCI   0x010601

And, I think that PCI_CLASS_STORAGE_SATA had better be added to
pci_ids.h since the class code 0x0106 is used more than once. e.g.
ahci.c uses the magic number 0x0106 twice, and it might be used more
in future.

Best regards,
Conke




Here is a patch to show more details:
---
diff -Nur linux-2.6.20-rc1.orig/drivers/ata/ahci.c
linux-2.6.20-rc1/drivers/ata/ahci.c
--- linux-2.6.20-rc1.orig/drivers/ata/ahci.c2006-12-20 10:25:00.0 
+0800
+++ linux-2.6.20-rc1/drivers/ata/ahci.c 2006-12-20 10:13:24.0 +0800
@@ -418,7 +418,7 @@

/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- 0x010601, 0xff, board_ahci },
+ PCI_CLASS_STORAGE_SATA<<8|1, 0xff, board_ahci },

{ } /* terminate list */
};
@@ -1586,11 +1586,11 @@
speed_s = "?";

pci_read_config_word(pdev, 0x0a, );
-   if (cc == 0x0101)
+   if (cc == PCI_CLASS_STORAGE_IDE)
scc_s = "IDE";
-   else if (cc == 0x0106)
+   else if (cc == PCI_CLASS_STORAGE_SATA)
scc_s = "SATA";
-   else if (cc == 0x0104)
+   else if (cc == PCI_CLASS_STORAGE_RAID)
scc_s = "RAID";
else
scc_s = "unknown";
diff -Nur linux-2.6.20-rc1.orig/include/linux/pci_ids.h
linux-2.6.20-rc1/include/linux/pci_ids.h
--- linux-2.6.20-rc1.orig/include/linux/pci_ids.h   2006-12-20
10:24:51.0 +0800
+++ linux-2.6.20-rc1/include/linux/pci_ids.h2006-12-20 10:08:15.0

Re: [PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu

On 12/20/06, Jeff Garzik <[EMAIL PROTECTED]> wrote:

Conke Hu wrote:
> Add pci class code 0x0106 for SATA to pci_ids.h
>
> signed-off-by: [EMAIL PROTECTED]
> 
> --- linux-2.6.20-rc1/include/linux/pci_ids.h.orig 2006-12-20
> 01:58:30.0 +0800
> +++ linux-2.6.20-rc1/include/linux/pci_ids.h  2006-12-20
> 01:59:07.0 +0800
> @@ -15,6 +15,7 @@
>  #define PCI_CLASS_STORAGE_FLOPPY 0x0102
>  #define PCI_CLASS_STORAGE_IPI0x0103
>  #define PCI_CLASS_STORAGE_RAID   0x0104
> +#define PCI_CLASS_STORAGE_SATA   0x0106
>  #define PCI_CLASS_STORAGE_SAS0x0107
>  #define PCI_CLASS_STORAGE_OTHER  0x0180

Two comments:

1) I think "_SATA" is an inaccurate description.  It should be _AHCI AFAICS.

2) Typically we don't add constants unless they are used somewhere...

Jeff



Hi Jeff,
   According to PCI spec 3.0, 0x0106 means SATA controller, 0x010601
means AHCI and 0x010600 means vendor specific SATA controller. Pls see
the following table (PCI spec 3.0 P296):

Base Class  Sub-Class   Interface   Meaning

00h 00h SCSI bus controller

01h xxh IDE controller
---
02h 00h Floppy disk controller
-
03h 00h IPI bus controller
--
04h 00h RAID controller
01h 
20h ATA controller with ADMA 
interface
05h 
---
30h ATA controller with ADMA 
interface

---
00h Serial ATA controller–vendor 
specific interface
06h 
-
01h Serial ATA controller–AHCI 1.0 
interface

-
07h 00h Serial Attached SCSI (SAS) 
controller

-
80h 00h Other mass storage controller
--


So, I think, the following macro is correct:
#define PCI_CLASS_STORAGE_SATA   0x0106
If you would define AHCI class code, it should be 0x010601, not 0x0106:
#define PCI_CLASS_STORAGE_SATA_AHCI   0x010601

And, I think that PCI_CLASS_STORAGE_SATA had better be added to
pci_ids.h since the class code 0x0106 is used more than once. e.g.
ahci.c uses the magic number 0x0106 twice, and it might be used more
in future.

Best regards,
Conke
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu
Add pci class code 0x0106 for SATA to pci_ids.h

signed-off-by: [EMAIL PROTECTED]

--- linux-2.6.20-rc1/include/linux/pci_ids.h.orig   2006-12-20
01:58:30.0 +0800
+++ linux-2.6.20-rc1/include/linux/pci_ids.h2006-12-20
01:59:07.0 +0800
@@ -15,6 +15,7 @@
 #define PCI_CLASS_STORAGE_FLOPPY   0x0102
 #define PCI_CLASS_STORAGE_IPI  0x0103
 #define PCI_CLASS_STORAGE_RAID 0x0104
+#define PCI_CLASS_STORAGE_SATA 0x0106
 #define PCI_CLASS_STORAGE_SAS  0x0107
 #define PCI_CLASS_STORAGE_OTHER0x0180

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu
Add pci class code 0x0106 for SATA to pci_ids.h

signed-off-by: [EMAIL PROTECTED]

--- linux-2.6.20-rc1/include/linux/pci_ids.h.orig   2006-12-20
01:58:30.0 +0800
+++ linux-2.6.20-rc1/include/linux/pci_ids.h2006-12-20
01:59:07.0 +0800
@@ -15,6 +15,7 @@
 #define PCI_CLASS_STORAGE_FLOPPY   0x0102
 #define PCI_CLASS_STORAGE_IPI  0x0103
 #define PCI_CLASS_STORAGE_RAID 0x0104
+#define PCI_CLASS_STORAGE_SATA 0x0106
 #define PCI_CLASS_STORAGE_SAS  0x0107
 #define PCI_CLASS_STORAGE_OTHER0x0180

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu

On 12/20/06, Jeff Garzik [EMAIL PROTECTED] wrote:

Conke Hu wrote:
 Add pci class code 0x0106 for SATA to pci_ids.h

 signed-off-by: [EMAIL PROTECTED]
 
 --- linux-2.6.20-rc1/include/linux/pci_ids.h.orig 2006-12-20
 01:58:30.0 +0800
 +++ linux-2.6.20-rc1/include/linux/pci_ids.h  2006-12-20
 01:59:07.0 +0800
 @@ -15,6 +15,7 @@
  #define PCI_CLASS_STORAGE_FLOPPY 0x0102
  #define PCI_CLASS_STORAGE_IPI0x0103
  #define PCI_CLASS_STORAGE_RAID   0x0104
 +#define PCI_CLASS_STORAGE_SATA   0x0106
  #define PCI_CLASS_STORAGE_SAS0x0107
  #define PCI_CLASS_STORAGE_OTHER  0x0180

Two comments:

1) I think _SATA is an inaccurate description.  It should be _AHCI AFAICS.

2) Typically we don't add constants unless they are used somewhere...

Jeff



Hi Jeff,
   According to PCI spec 3.0, 0x0106 means SATA controller, 0x010601
means AHCI and 0x010600 means vendor specific SATA controller. Pls see
the following table (PCI spec 3.0 P296):

Base Class  Sub-Class   Interface   Meaning

00h 00h SCSI bus controller

01h xxh IDE controller
---
02h 00h Floppy disk controller
-
03h 00h IPI bus controller
--
04h 00h RAID controller
01h 
20h ATA controller with ADMA 
interface
05h 
---
30h ATA controller with ADMA 
interface

---
00h Serial ATA controller–vendor 
specific interface
06h 
-
01h Serial ATA controller–AHCI 1.0 
interface

-
07h 00h Serial Attached SCSI (SAS) 
controller

-
80h 00h Other mass storage controller
--


So, I think, the following macro is correct:
#define PCI_CLASS_STORAGE_SATA   0x0106
If you would define AHCI class code, it should be 0x010601, not 0x0106:
#define PCI_CLASS_STORAGE_SATA_AHCI   0x010601

And, I think that PCI_CLASS_STORAGE_SATA had better be added to
pci_ids.h since the class code 0x0106 is used more than once. e.g.
ahci.c uses the magic number 0x0106 twice, and it might be used more
in future.

Best regards,
Conke
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu

On 12/20/06, Conke Hu [EMAIL PROTECTED] wrote:

On 12/20/06, Jeff Garzik [EMAIL PROTECTED] wrote:
 Conke Hu wrote:
  Add pci class code 0x0106 for SATA to pci_ids.h
 
  signed-off-by: [EMAIL PROTECTED]
  
  --- linux-2.6.20-rc1/include/linux/pci_ids.h.orig 2006-12-20
  01:58:30.0 +0800
  +++ linux-2.6.20-rc1/include/linux/pci_ids.h  2006-12-20
  01:59:07.0 +0800
  @@ -15,6 +15,7 @@
   #define PCI_CLASS_STORAGE_FLOPPY 0x0102
   #define PCI_CLASS_STORAGE_IPI0x0103
   #define PCI_CLASS_STORAGE_RAID   0x0104
  +#define PCI_CLASS_STORAGE_SATA   0x0106
   #define PCI_CLASS_STORAGE_SAS0x0107
   #define PCI_CLASS_STORAGE_OTHER  0x0180

 Two comments:

 1) I think _SATA is an inaccurate description.  It should be _AHCI AFAICS.

 2) Typically we don't add constants unless they are used somewhere...

 Jeff


Hi Jeff,
According to PCI spec 3.0, 0x0106 means SATA controller, 0x010601
means AHCI and 0x010600 means vendor specific SATA controller. Pls see
the following table (PCI spec 3.0 P296):

Base Class  Sub-Class   Interface   Meaning

00h 00h SCSI bus controller

01h xxh IDE controller
---
02h 00h Floppy disk controller
-
03h 00h IPI bus controller
--
04h 00h RAID controller
01h 
20h ATA controller with ADMA 
interface
05h 
---
30h ATA controller with ADMA 
interface

---
00h Serial ATA controller–vendor 
specific interface
06h 
-
01h Serial ATA controller–AHCI 1.0 
interface

-
07h 00h Serial Attached SCSI (SAS) 
controller

-
80h 00h Other mass storage controller
--


So, I think, the following macro is correct:
#define PCI_CLASS_STORAGE_SATA   0x0106
If you would define AHCI class code, it should be 0x010601, not 0x0106:
#define PCI_CLASS_STORAGE_SATA_AHCI   0x010601

And, I think that PCI_CLASS_STORAGE_SATA had better be added to
pci_ids.h since the class code 0x0106 is used more than once. e.g.
ahci.c uses the magic number 0x0106 twice, and it might be used more
in future.

Best regards,
Conke




Here is a patch to show more details:
---
diff -Nur linux-2.6.20-rc1.orig/drivers/ata/ahci.c
linux-2.6.20-rc1/drivers/ata/ahci.c
--- linux-2.6.20-rc1.orig/drivers/ata/ahci.c2006-12-20 10:25:00.0 
+0800
+++ linux-2.6.20-rc1/drivers/ata/ahci.c 2006-12-20 10:13:24.0 +0800
@@ -418,7 +418,7 @@

/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- 0x010601, 0xff, board_ahci },
+ PCI_CLASS_STORAGE_SATA8|1, 0xff, board_ahci },

{ } /* terminate list */
};
@@ -1586,11 +1586,11 @@
speed_s = ?;

pci_read_config_word(pdev, 0x0a, cc);
-   if (cc == 0x0101)
+   if (cc == PCI_CLASS_STORAGE_IDE)
scc_s = IDE;
-   else if (cc == 0x0106)
+   else if (cc == PCI_CLASS_STORAGE_SATA)
scc_s = SATA;
-   else if (cc == 0x0104)
+   else if (cc == PCI_CLASS_STORAGE_RAID)
scc_s = RAID;
else
scc_s = unknown;
diff -Nur linux-2.6.20-rc1.orig/include/linux/pci_ids.h
linux-2.6.20-rc1/include/linux/pci_ids.h
--- linux-2.6.20-rc1.orig/include/linux/pci_ids.h   2006-12-20
10:24:51.0 +0800
+++ linux-2.6.20-rc1/include/linux/pci_ids.h2006-12-20 10:08:15.0 
+0800
@@ -15,6 +15,7 @@
#define PCI_CLASS_STORAGE_FLOPPY0x0102
#define PCI_CLASS_STORAGE_IPI   0x0103
#define PCI_CLASS_STORAGE_RAID  0x0104
+#define PCI_CLASS_STORAGE_SATA 0x0106
#define PCI_CLASS_STORAGE_SAS   0x0107
#define

Re: [PATCH] Add pci class code for SATA

2006-12-19 Thread Conke Hu

On 12/20/06, Conke Hu [EMAIL PROTECTED] wrote:

On 12/20/06, Conke Hu [EMAIL PROTECTED] wrote:
 On 12/20/06, Jeff Garzik [EMAIL PROTECTED] wrote:
  Conke Hu wrote:
   Add pci class code 0x0106 for SATA to pci_ids.h
  
   signed-off-by: [EMAIL PROTECTED]
   
   --- linux-2.6.20-rc1/include/linux/pci_ids.h.orig 2006-12-20
   01:58:30.0 +0800
   +++ linux-2.6.20-rc1/include/linux/pci_ids.h  2006-12-20
   01:59:07.0 +0800
   @@ -15,6 +15,7 @@
#define PCI_CLASS_STORAGE_FLOPPY 0x0102
#define PCI_CLASS_STORAGE_IPI0x0103
#define PCI_CLASS_STORAGE_RAID   0x0104
   +#define PCI_CLASS_STORAGE_SATA   0x0106
#define PCI_CLASS_STORAGE_SAS0x0107
#define PCI_CLASS_STORAGE_OTHER  0x0180
 
  Two comments:
 
  1) I think _SATA is an inaccurate description.  It should be _AHCI AFAICS.
 
  2) Typically we don't add constants unless they are used somewhere...
 
  Jeff
 

 Hi Jeff,
 According to PCI spec 3.0, 0x0106 means SATA controller, 0x010601
 means AHCI and 0x010600 means vendor specific SATA controller. Pls see
 the following table (PCI spec 3.0 P296):

 Base Class  Sub-Class   Interface   Meaning
 
 00h 00h SCSI bus controller
 
 01h xxh IDE controller
 ---
 02h 00h Floppy disk controller
 -
 03h 00h IPI bus controller
 --
 04h 00h RAID controller
 01h 
 20h ATA controller with ADMA 
interface
 05h 
---
 30h ATA controller with ADMA 
interface
 
---
 00h Serial ATA controller–vendor 
specific interface
 06h 
-
 01h Serial ATA controller–AHCI 
1.0 interface
 
-
 07h 00h Serial Attached SCSI (SAS) 
controller
 
-
 80h 00h Other mass storage controller
 --


 So, I think, the following macro is correct:
 #define PCI_CLASS_STORAGE_SATA   0x0106
 If you would define AHCI class code, it should be 0x010601, not 0x0106:
 #define PCI_CLASS_STORAGE_SATA_AHCI   0x010601

 And, I think that PCI_CLASS_STORAGE_SATA had better be added to
 pci_ids.h since the class code 0x0106 is used more than once. e.g.
 ahci.c uses the magic number 0x0106 twice, and it might be used more
 in future.

 Best regards,
 Conke



Here is a patch to show more details:
---
diff -Nur linux-2.6.20-rc1.orig/drivers/ata/ahci.c
linux-2.6.20-rc1/drivers/ata/ahci.c
--- linux-2.6.20-rc1.orig/drivers/ata/ahci.c2006-12-20 10:25:00.0 
+0800
+++ linux-2.6.20-rc1/drivers/ata/ahci.c 2006-12-20 10:13:24.0 +0800
@@ -418,7 +418,7 @@

/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- 0x010601, 0xff, board_ahci },
+ PCI_CLASS_STORAGE_SATA8|1, 0xff, board_ahci },

{ } /* terminate list */
 };
@@ -1586,11 +1586,11 @@
speed_s = ?;

pci_read_config_word(pdev, 0x0a, cc);
-   if (cc == 0x0101)
+   if (cc == PCI_CLASS_STORAGE_IDE)
scc_s = IDE;
-   else if (cc == 0x0106)
+   else if (cc == PCI_CLASS_STORAGE_SATA)
scc_s = SATA;
-   else if (cc == 0x0104)
+   else if (cc == PCI_CLASS_STORAGE_RAID)
scc_s = RAID;
else
scc_s = unknown;
diff -Nur linux-2.6.20-rc1.orig/include/linux/pci_ids.h
linux-2.6.20-rc1/include/linux/pci_ids.h
--- linux-2.6.20-rc1.orig/include/linux/pci_ids.h   2006-12-20
10:24:51.0 +0800
+++ linux-2.6.20-rc1/include/linux/pci_ids.h2006-12-20 10:08:15.0 
+0800
@@ -15,6 +15,7 @@
 #define PCI_CLASS_STORAGE_FLOPPY   0x0102
 #define PCI_CLASS_STORAGE_IPI  0x0103
 #define PCI_CLASS_STORAGE_RAID

Re: -mm merge plans for 2.6.20

2006-12-06 Thread Conke Hu
On Mon, 2006-12-04 at 21:41 -0800, Andrew Morton wrote:
> On Mon, 04 Dec 2006 23:56:42 -0500
> Jeff Garzik <[EMAIL PROTECTED]> wrote:
> 
> > Andrew Morton wrote:
> > > via-pata-controller-xfer-fixes.patch
> > > via-pata-controller-xfer-fixes-fix.patch
> > 
> > Tejun's 3d3cca37559e3ab2b574eda11ed5207ccdb8980a has been ack'd by the 
> > reporter as fixing things, so these two shouldn't be needed.
> 
> OK thanks, I dropped it.
> 
> > 
> > > libata_resume_fix.patch
> > 
> > I thought this was resolved long ago?  Are there still open reports that 
> > this solves, where upstream doesn't work?
> 
> Heck, I don't know.
> 
> > 
> > > ahci-ati-sb600-sata-support-for-various-modes.patch
> > 
> > With the PCI quirk, I thought ATI was finally sorted?
> 
> Was it?  I don't know that either.
> 
> I'll drop these too.
> -

Hi Jeff, Andrew
The following patch is ATI's final solution. It was ACKed by Alan.
Jeff, you're the maintainer of libata, but this patch is based on
pci/quirks.c, so I don't know who will apply this patch? You or somebody
else?
Andrew, could you please drop ATI's previous patch and add this one
in next -mm patch? The previous patch I sent
(ahci-ati-sb600-sata-support-for-various-modes.patch) is not as good as
this one :)


Best regards,
Conke @AMD/ATI


[--PATCH--]

--- linux-2.6.19-rc6-git4/drivers/pci/quirks.c.orig 2006-11-23
19:45:49.0 +0800
+++ linux-2.6.19-rc6-git4/drivers/pci/quirks.c  2006-11-23
19:34:23.0 +0800
@@ -795,6 +795,25 @@ static void __init quirk_mediagx_master(
   }
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CYRIX,
PCI_DEVICE_ID_CYRIX_PCI_MASTER, quirk_mediagx_master );
+
+#if defined(CONFIG_SATA_AHCI) || defined(CONFIG_SATA_AHCI_MODULE)
+static void __devinit quirk_sb600_sata(struct pci_dev *pdev)
+{
+   /* set sb600 sata to ahci mode */
+   if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
+   u8 tmp;
+
+   pci_read_config_byte(pdev, 0x40, );
+   pci_write_config_byte(pdev, 0x40, tmp|1);
+   pci_write_config_byte(pdev, 0x9, 1);
+   pci_write_config_byte(pdev, 0xa, 6);
+   pci_write_config_byte(pdev, 0x40, tmp);
+
+   pdev->class = 0x010601;
+   }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI,
PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata);
+#endif

 /*
 * As per PCI spec, ignore base address registers 0-3 of the IDE
controllers

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: -mm merge plans for 2.6.20

2006-12-06 Thread Conke Hu
On Mon, 2006-12-04 at 21:41 -0800, Andrew Morton wrote:
 On Mon, 04 Dec 2006 23:56:42 -0500
 Jeff Garzik [EMAIL PROTECTED] wrote:
 
  Andrew Morton wrote:
   via-pata-controller-xfer-fixes.patch
   via-pata-controller-xfer-fixes-fix.patch
  
  Tejun's 3d3cca37559e3ab2b574eda11ed5207ccdb8980a has been ack'd by the 
  reporter as fixing things, so these two shouldn't be needed.
 
 OK thanks, I dropped it.
 
  
   libata_resume_fix.patch
  
  I thought this was resolved long ago?  Are there still open reports that 
  this solves, where upstream doesn't work?
 
 Heck, I don't know.
 
  
   ahci-ati-sb600-sata-support-for-various-modes.patch
  
  With the PCI quirk, I thought ATI was finally sorted?
 
 Was it?  I don't know that either.
 
 I'll drop these too.
 -

Hi Jeff, Andrew
The following patch is ATI's final solution. It was ACKed by Alan.
Jeff, you're the maintainer of libata, but this patch is based on
pci/quirks.c, so I don't know who will apply this patch? You or somebody
else?
Andrew, could you please drop ATI's previous patch and add this one
in next -mm patch? The previous patch I sent
(ahci-ati-sb600-sata-support-for-various-modes.patch) is not as good as
this one :)


Best regards,
Conke @AMD/ATI


[--PATCH--]

--- linux-2.6.19-rc6-git4/drivers/pci/quirks.c.orig 2006-11-23
19:45:49.0 +0800
+++ linux-2.6.19-rc6-git4/drivers/pci/quirks.c  2006-11-23
19:34:23.0 +0800
@@ -795,6 +795,25 @@ static void __init quirk_mediagx_master(
   }
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CYRIX,
PCI_DEVICE_ID_CYRIX_PCI_MASTER, quirk_mediagx_master );
+
+#if defined(CONFIG_SATA_AHCI) || defined(CONFIG_SATA_AHCI_MODULE)
+static void __devinit quirk_sb600_sata(struct pci_dev *pdev)
+{
+   /* set sb600 sata to ahci mode */
+   if ((pdev-class  8) == PCI_CLASS_STORAGE_IDE) {
+   u8 tmp;
+
+   pci_read_config_byte(pdev, 0x40, tmp);
+   pci_write_config_byte(pdev, 0x40, tmp|1);
+   pci_write_config_byte(pdev, 0x9, 1);
+   pci_write_config_byte(pdev, 0xa, 6);
+   pci_write_config_byte(pdev, 0x40, tmp);
+
+   pdev-class = 0x010601;
+   }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI,
PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata);
+#endif

 /*
 * As per PCI spec, ignore base address registers 0-3 of the IDE
controllers

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/