Re: [PATCH 2.6.22-rc4]: libata: PATA-mode fixes for sis_sata

2007-07-16 Thread yulin

Alan Cox 写道:
So one leader of our IT, who is a Windows expert, suggested we can use 
int 13h and I/O in Linux. But int 13h just is used in real mode.


Can you give me some advice to persuade him? If it is feasible, can you 
introduce me?



int13 is real mode only, runs polled and 16bit with one command at a
time. As far as I know even Windows no longer uses it for anything but
booting.

  

Even can you give some good solutions to solve the compatibility problem?



For hardware where we have info the right answer is to report bugs and
get them fixed (or indeed send fixes). For the more general case the
ata_generic driver will drive anything that is SFF8038i compliant and you
can just add PCI identifiers to it for anything you hit.

I am working on a generic ACPI driver to go with it for such cases.

Alan


  


Thank you for your help and explanations.

I will do some research work on ata_generic driver. Can you give me some 
advice or related information to do deeper research?


I alse found the problem of ACPI in our product, so we turn it off, but 
always caused some other problems. So i think a generic ACPI driver will 
be welcome.


And your mail is the best message received today before going home.

:)

From YuLin
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2.6.22-rc4]: libata: PATA-mode fixes for sis_sata

2007-07-16 Thread Alan Cox
> So one leader of our IT, who is a Windows expert, suggested we can use 
> int 13h and I/O in Linux. But int 13h just is used in real mode.
> 
> Can you give me some advice to persuade him? If it is feasible, can you 
> introduce me?

int13 is real mode only, runs polled and 16bit with one command at a
time. As far as I know even Windows no longer uses it for anything but
booting.

> Even can you give some good solutions to solve the compatibility problem?

For hardware where we have info the right answer is to report bugs and
get them fixed (or indeed send fixes). For the more general case the
ata_generic driver will drive anything that is SFF8038i compliant and you
can just add PCI identifiers to it for anything you hit.

I am working on a generic ACPI driver to go with it for such cases.

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


Re: [PATCH 2.6.22-rc4]: libata: PATA-mode fixes for sis_sata

2007-07-15 Thread yulin

Hi,all,

I have a question about Generic int13h driver.

There is a message about it, 
http://lists.freebsd.org/pipermail/freebsd-drivers/2007-May/000403.html.


Because our product is to maintain Windows Desktop in Linux, so it 
requires the great compatibility of hardware. Now we have solved the 
problem of display, but harddisk still is a problem.


The motherboards from OEM always have some problem, for example, the 
same SiS671 motherboards from ASUS and FOXCONN have different phenomenon.


So one leader of our IT, who is a Windows expert, suggested we can use 
int 13h and I/O in Linux. But int 13h just is used in real mode.


Can you give me some advice to persuade him? If it is feasible, can you 
introduce me?


Even can you give some good solutions to solve the compatibility problem?


From YuLin


Uwe Koziolek 写道:

Changed PATA handler for PATA-ports used by sata_sis.
This patch was originally submitted by Jeff Garzik.

Added PCI-ID 1180 for SiS966 Controller in pata_sis.
The 1180 mode is fully compatible to other SiS PATA-controller.

The PCI-ID 1183 is SATA in PATA-emulation, but not fully compatible
to SiS5513/5518. sata_sis.c is forwarding this ID to pata_sis.
1183 is not working if simply added to pata_sis.
This handling fixes issues with SiS968.

Signed-off-by: Uwe Koziolek <[EMAIL PROTECTED]>

--- a/drivers/ata/pata_sis.c2007-06-14 22:41:34.0 +0200
+++ b/drivers/ata/pata_sis.c2007-06-12 22:15:04.0 +0200
@@ -560,6 +560,40 @@
.port_start = ata_port_start,
 };
 
+static const struct ata_port_operations sis_133_for_sata_ops = {

+   .port_disable   = ata_port_disable,
+   .set_piomode= sis_133_set_piomode,
+   .set_dmamode= sis_133_set_dmamode,
+   .mode_filter= ata_pci_default_filter,
+
+   .tf_load= ata_tf_load,
+   .tf_read= ata_tf_read,
+   .check_status   = ata_check_status,
+   .exec_command   = ata_exec_command,
+   .dev_select = ata_std_dev_select,
+
+   .freeze = ata_bmdma_freeze,
+   .thaw   = ata_bmdma_thaw,
+   .error_handler  = ata_bmdma_error_handler,
+   .post_internal_cmd  = ata_bmdma_post_internal_cmd,
+   .cable_detect   = sis_133_cable_detect,
+
+   .bmdma_setup= ata_bmdma_setup,
+   .bmdma_start= ata_bmdma_start,
+   .bmdma_stop = ata_bmdma_stop,
+   .bmdma_status   = ata_bmdma_status,
+   .qc_prep= ata_qc_prep,
+   .qc_issue   = ata_qc_issue_prot,
+   .data_xfer  = ata_data_xfer,
+
+   .irq_handler= ata_interrupt,
+   .irq_clear  = ata_bmdma_irq_clear,
+   .irq_on = ata_irq_on,
+   .irq_ack= ata_irq_ack,
+
+   .port_start = ata_port_start,
+};
+
 static const struct ata_port_operations sis_133_early_ops = {
.port_disable   = ata_port_disable,
.set_piomode= sis_100_set_piomode,
@@ -733,13 +767,20 @@
.pio_mask   = 0x1f, /* pio0-4 */
.port_ops   = &sis_66_ops,
 };
-const struct ata_port_info sis_info133 = {
+static const struct ata_port_info sis_info133 = {
.sht= &sis_sht,
.flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
.pio_mask   = 0x1f, /* pio0-4 */
.udma_mask  = ATA_UDMA6,
.port_ops   = &sis_133_ops,
 };
+const struct ata_port_info sis_info133_for_sata = {
+   .sht= &sis_sht,
+   .flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = &sis_133_for_sata_ops,
+};
 static const struct ata_port_info sis_info133_early = {
.sht= &sis_sht,
.flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
@@ -749,7 +790,7 @@
 };
 
 /* Privately shared with the SiS180 SATA driver, not for use elsewhere */

-EXPORT_SYMBOL_GPL(sis_info133);
+EXPORT_SYMBOL_GPL(sis_info133_for_sata);
 
 static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis)

 {
@@ -975,6 +1016,7 @@
 static const struct pci_device_id sis_pci_tbl[] = {
{ PCI_VDEVICE(SI, 0x5513), },   /* SiS 5513 */
{ PCI_VDEVICE(SI, 0x5518), },   /* SiS 5518 */
+   { PCI_VDEVICE(SI, 0x1180), },   /* SiS 1180 */
 
 	{ }

 };
--- a/drivers/ata/sata_sis.c2007-06-14 22:41:34.0 +0200
+++ b/drivers/ata/sata_sis.c2007-06-12 22:16:11.0 +0200
@@ -72,8 +72,8 @@
{ PCI_VDEVICE(SI, 0x0181), sis_180 },   /* SiS 964/180 */
{ PCI_VDEVICE(SI, 0x0182), sis_180 },   /* SiS 965/965L */
{ PCI_VDEVICE(SI, 0x0183), sis_180 },   /* SiS 965/965L */
-   { PCI_VDEVICE(SI, 0x1182), sis_180 },   /* SiS 966/966L */
-   { PCI_VDEV

Re: [PATCH 2.6.22-rc4]: libata: PATA-mode fixes for sis_sata

2007-07-02 Thread Jeff Garzik

Uwe Koziolek wrote:

Changed PATA handler for PATA-ports used by sata_sis.
This patch was originally submitted by Jeff Garzik.

Added PCI-ID 1180 for SiS966 Controller in pata_sis.
The 1180 mode is fully compatible to other SiS PATA-controller.

The PCI-ID 1183 is SATA in PATA-emulation, but not fully compatible
to SiS5513/5518. sata_sis.c is forwarding this ID to pata_sis.
1183 is not working if simply added to pata_sis.
This handling fixes issues with SiS968.

Signed-off-by: Uwe Koziolek <[EMAIL PROTECTED]>


applied


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


[PATCH 2.6.22-rc4]: libata: PATA-mode fixes for sis_sata; resubmission

2007-06-25 Thread Uwe Koziolek
Changed PATA handler for PATA-ports used by sata_sis.
This patch was originally submitted by Jeff Garzik.

Added PCI-ID 1180 for SiS966 Controller in pata_sis.
The 1180 mode is fully compatible to other SiS PATA-controller.

The PCI-ID 1183 is SATA in PATA-emulation, but not fully compatible
to SiS5513/5518. sata_sis.c is forwarding this ID to pata_sis.
1183 is not working if simply added to pata_sis.
This handling fixes issues with SiS968.

Signed-off-by: Uwe Koziolek <[EMAIL PROTECTED]>

--- a/drivers/ata/pata_sis.c2007-06-14 22:41:34.0 +0200
+++ b/drivers/ata/pata_sis.c2007-06-12 22:15:04.0 +0200
@@ -560,6 +560,40 @@
.port_start = ata_port_start,
 };
 
+static const struct ata_port_operations sis_133_for_sata_ops = {
+   .port_disable   = ata_port_disable,
+   .set_piomode= sis_133_set_piomode,
+   .set_dmamode= sis_133_set_dmamode,
+   .mode_filter= ata_pci_default_filter,
+
+   .tf_load= ata_tf_load,
+   .tf_read= ata_tf_read,
+   .check_status   = ata_check_status,
+   .exec_command   = ata_exec_command,
+   .dev_select = ata_std_dev_select,
+
+   .freeze = ata_bmdma_freeze,
+   .thaw   = ata_bmdma_thaw,
+   .error_handler  = ata_bmdma_error_handler,
+   .post_internal_cmd  = ata_bmdma_post_internal_cmd,
+   .cable_detect   = sis_133_cable_detect,
+
+   .bmdma_setup= ata_bmdma_setup,
+   .bmdma_start= ata_bmdma_start,
+   .bmdma_stop = ata_bmdma_stop,
+   .bmdma_status   = ata_bmdma_status,
+   .qc_prep= ata_qc_prep,
+   .qc_issue   = ata_qc_issue_prot,
+   .data_xfer  = ata_data_xfer,
+
+   .irq_handler= ata_interrupt,
+   .irq_clear  = ata_bmdma_irq_clear,
+   .irq_on = ata_irq_on,
+   .irq_ack= ata_irq_ack,
+
+   .port_start = ata_port_start,
+};
+
 static const struct ata_port_operations sis_133_early_ops = {
.port_disable   = ata_port_disable,
.set_piomode= sis_100_set_piomode,
@@ -733,13 +767,20 @@
.pio_mask   = 0x1f, /* pio0-4 */
.port_ops   = &sis_66_ops,
 };
-const struct ata_port_info sis_info133 = {
+static const struct ata_port_info sis_info133 = {
.sht= &sis_sht,
.flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
.pio_mask   = 0x1f, /* pio0-4 */
.udma_mask  = ATA_UDMA6,
.port_ops   = &sis_133_ops,
 };
+const struct ata_port_info sis_info133_for_sata = {
+   .sht= &sis_sht,
+   .flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = &sis_133_for_sata_ops,
+};
 static const struct ata_port_info sis_info133_early = {
.sht= &sis_sht,
.flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
@@ -749,7 +790,7 @@
 };
 
 /* Privately shared with the SiS180 SATA driver, not for use elsewhere */
-EXPORT_SYMBOL_GPL(sis_info133);
+EXPORT_SYMBOL_GPL(sis_info133_for_sata);
 
 static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis)
 {
@@ -975,6 +1016,7 @@
 static const struct pci_device_id sis_pci_tbl[] = {
{ PCI_VDEVICE(SI, 0x5513), },   /* SiS 5513 */
{ PCI_VDEVICE(SI, 0x5518), },   /* SiS 5518 */
+   { PCI_VDEVICE(SI, 0x1180), },   /* SiS 1180 */
 
{ }
 };
--- a/drivers/ata/sata_sis.c2007-06-14 22:41:34.0 +0200
+++ b/drivers/ata/sata_sis.c2007-06-12 22:16:11.0 +0200
@@ -72,8 +72,8 @@
{ PCI_VDEVICE(SI, 0x0181), sis_180 },   /* SiS 964/180 */
{ PCI_VDEVICE(SI, 0x0182), sis_180 },   /* SiS 965/965L */
{ PCI_VDEVICE(SI, 0x0183), sis_180 },   /* SiS 965/965L */
-   { PCI_VDEVICE(SI, 0x1182), sis_180 },   /* SiS 966/966L */
-   { PCI_VDEVICE(SI, 0x1183), sis_180 },   /* SiS 966/966L */
+   { PCI_VDEVICE(SI, 0x1182), sis_180 },   /* SiS 966/680 */
+   { PCI_VDEVICE(SI, 0x1183), sis_180 },   /* SiS 966/966L/968/680 
*/
 
{ } /* terminate list */
 };
@@ -161,7 +161,6 @@
case 0x0182:
case 0x0183:
case 0x1182:
-   case 0x1183:
addr += SIS182_SATA1_OFS;
break;
}
@@ -183,8 +182,8 @@
 
pci_read_config_dword(pdev, cfg_addr, &val);
 
-   if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || 
(pdev->device == 0x1182) ||
-   (pdev->device == 0x1183) || (pmr & SIS_PMR_COMBINED))
+   if ((pdev->device == 0x0182) || (pdev->device 

[PATCH 2.6.22-rc4]: libata: PATA-mode fixes for sis_sata

2007-06-14 Thread Uwe Koziolek
Changed PATA handler for PATA-ports used by sata_sis.
This patch was originally submitted by Jeff Garzik.

Added PCI-ID 1180 for SiS966 Controller in pata_sis.
The 1180 mode is fully compatible to other SiS PATA-controller.

The PCI-ID 1183 is SATA in PATA-emulation, but not fully compatible
to SiS5513/5518. sata_sis.c is forwarding this ID to pata_sis.
1183 is not working if simply added to pata_sis.
This handling fixes issues with SiS968.

Signed-off-by: Uwe Koziolek <[EMAIL PROTECTED]>

--- a/drivers/ata/pata_sis.c2007-06-14 22:41:34.0 +0200
+++ b/drivers/ata/pata_sis.c2007-06-12 22:15:04.0 +0200
@@ -560,6 +560,40 @@
.port_start = ata_port_start,
 };
 
+static const struct ata_port_operations sis_133_for_sata_ops = {
+   .port_disable   = ata_port_disable,
+   .set_piomode= sis_133_set_piomode,
+   .set_dmamode= sis_133_set_dmamode,
+   .mode_filter= ata_pci_default_filter,
+
+   .tf_load= ata_tf_load,
+   .tf_read= ata_tf_read,
+   .check_status   = ata_check_status,
+   .exec_command   = ata_exec_command,
+   .dev_select = ata_std_dev_select,
+
+   .freeze = ata_bmdma_freeze,
+   .thaw   = ata_bmdma_thaw,
+   .error_handler  = ata_bmdma_error_handler,
+   .post_internal_cmd  = ata_bmdma_post_internal_cmd,
+   .cable_detect   = sis_133_cable_detect,
+
+   .bmdma_setup= ata_bmdma_setup,
+   .bmdma_start= ata_bmdma_start,
+   .bmdma_stop = ata_bmdma_stop,
+   .bmdma_status   = ata_bmdma_status,
+   .qc_prep= ata_qc_prep,
+   .qc_issue   = ata_qc_issue_prot,
+   .data_xfer  = ata_data_xfer,
+
+   .irq_handler= ata_interrupt,
+   .irq_clear  = ata_bmdma_irq_clear,
+   .irq_on = ata_irq_on,
+   .irq_ack= ata_irq_ack,
+
+   .port_start = ata_port_start,
+};
+
 static const struct ata_port_operations sis_133_early_ops = {
.port_disable   = ata_port_disable,
.set_piomode= sis_100_set_piomode,
@@ -733,13 +767,20 @@
.pio_mask   = 0x1f, /* pio0-4 */
.port_ops   = &sis_66_ops,
 };
-const struct ata_port_info sis_info133 = {
+static const struct ata_port_info sis_info133 = {
.sht= &sis_sht,
.flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
.pio_mask   = 0x1f, /* pio0-4 */
.udma_mask  = ATA_UDMA6,
.port_ops   = &sis_133_ops,
 };
+const struct ata_port_info sis_info133_for_sata = {
+   .sht= &sis_sht,
+   .flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = &sis_133_for_sata_ops,
+};
 static const struct ata_port_info sis_info133_early = {
.sht= &sis_sht,
.flags  = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
@@ -749,7 +790,7 @@
 };
 
 /* Privately shared with the SiS180 SATA driver, not for use elsewhere */
-EXPORT_SYMBOL_GPL(sis_info133);
+EXPORT_SYMBOL_GPL(sis_info133_for_sata);
 
 static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis)
 {
@@ -975,6 +1016,7 @@
 static const struct pci_device_id sis_pci_tbl[] = {
{ PCI_VDEVICE(SI, 0x5513), },   /* SiS 5513 */
{ PCI_VDEVICE(SI, 0x5518), },   /* SiS 5518 */
+   { PCI_VDEVICE(SI, 0x1180), },   /* SiS 1180 */
 
{ }
 };
--- a/drivers/ata/sata_sis.c2007-06-14 22:41:34.0 +0200
+++ b/drivers/ata/sata_sis.c2007-06-12 22:16:11.0 +0200
@@ -72,8 +72,8 @@
{ PCI_VDEVICE(SI, 0x0181), sis_180 },   /* SiS 964/180 */
{ PCI_VDEVICE(SI, 0x0182), sis_180 },   /* SiS 965/965L */
{ PCI_VDEVICE(SI, 0x0183), sis_180 },   /* SiS 965/965L */
-   { PCI_VDEVICE(SI, 0x1182), sis_180 },   /* SiS 966/966L */
-   { PCI_VDEVICE(SI, 0x1183), sis_180 },   /* SiS 966/966L */
+   { PCI_VDEVICE(SI, 0x1182), sis_180 },   /* SiS 966/680 */
+   { PCI_VDEVICE(SI, 0x1183), sis_180 },   /* SiS 966/966L/968/680 
*/
 
{ } /* terminate list */
 };
@@ -161,7 +161,6 @@
case 0x0182:
case 0x0183:
case 0x1182:
-   case 0x1183:
addr += SIS182_SATA1_OFS;
break;
}
@@ -183,8 +182,8 @@
 
pci_read_config_dword(pdev, cfg_addr, &val);
 
-   if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || 
(pdev->device == 0x1182) ||
-   (pdev->device == 0x1183) || (pmr & SIS_PMR_COMBINED))
+   if ((pdev->device == 0x0182) || (pdev->device