linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.22-rc4] libata: SiS180 pata support
@ 2007-06-05 23:04 Uwe Koziolek
  2007-06-05 23:08 ` Jeff Garzik
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Uwe Koziolek @ 2007-06-05 23:04 UTC (permalink / raw)
  To: Alan, Jeff Garzik; +Cc: linux-ide

the PATA-port of SiS180 controller does not support a drive present status
in the pci configspace like the other SiS PATA controllers, check skipped.

Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net>

--- a/drivers/ata/pata_sis.c	2007-06-05 22:17:10.000000000 +0200
+++ b/drivers/ata/pata_sis.c	2007-06-06 00:06:08.000000000 +0200
@@ -130,6 +130,20 @@
 
 
 /**
+ *	sis_enables_supported - Check if enable_bits are supported
+ *	@pdev: pci device
+ *
+ *	The combined PATA/SATA controller SiS180 does not support
+ *	the enable_bits in the PCI configspace
+ */
+
+static inline int sis_enables_supported(struct pci_dev *pdev)
+{
+	return ((pdev->device != 0x0180) && (pdev->device != 0x0181));
+}
+
+
+/**
  *	sis_pre_reset		-	probe begin
  *	@ap: ATA port
  *	@deadline: deadline jiffies for the operation
@@ -146,7 +160,8 @@
 
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 
-	if (!pci_test_config_bits(pdev, &sis_enable_bits[ap->port_no]))
+	if (sis_enables_supported(pdev) && 
+	    !pci_test_config_bits(pdev, &sis_enable_bits[ap->port_no]))
 		return -ENOENT;
 
 	return ata_std_prereset(ap, deadline);


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.22-rc4] libata: SiS180 pata support
  2007-06-05 23:04 [PATCH 2.6.22-rc4] libata: SiS180 pata support Uwe Koziolek
@ 2007-06-05 23:08 ` Jeff Garzik
  2007-06-05 23:12 ` Alan Cox
  2007-06-05 23:19 ` Jeff Garzik
  2 siblings, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2007-06-05 23:08 UTC (permalink / raw)
  To: Uwe Koziolek; +Cc: Alan, linux-ide

On Wed, Jun 06, 2007 at 01:04:17AM +0200, Uwe Koziolek wrote:
> the PATA-port of SiS180 controller does not support a drive present status
> in the pci configspace like the other SiS PATA controllers, check skipped.
> 
> Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net>
> 
> --- a/drivers/ata/pata_sis.c	2007-06-05 22:17:10.000000000 +0200
> +++ b/drivers/ata/pata_sis.c	2007-06-06 00:06:08.000000000 +0200
> @@ -130,6 +130,20 @@
>  
>  
>  /**
> + *	sis_enables_supported - Check if enable_bits are supported
> + *	@pdev: pci device
> + *
> + *	The combined PATA/SATA controller SiS180 does not support
> + *	the enable_bits in the PCI configspace
> + */
> +
> +static inline int sis_enables_supported(struct pci_dev *pdev)
> +{
> +	return ((pdev->device != 0x0180) && (pdev->device != 0x0181));
> +}
> +
> +
> +/**
>   *	sis_pre_reset		-	probe begin
>   *	@ap: ATA port
>   *	@deadline: deadline jiffies for the operation
> @@ -146,7 +160,8 @@
>  
>  	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
>  
> -	if (!pci_test_config_bits(pdev, &sis_enable_bits[ap->port_no]))
> +	if (sis_enables_supported(pdev) && 
> +	    !pci_test_config_bits(pdev, &sis_enable_bits[ap->port_no]))
>  		return -ENOENT;

Should work, but please split up the operations like I've repeatedly
requested.

For the devices where enable_bits are not supported, you can use the
standard error handler.

Let me know if this needs further explanation.

	Jeff




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.22-rc4] libata: SiS180 pata support
  2007-06-05 23:04 [PATCH 2.6.22-rc4] libata: SiS180 pata support Uwe Koziolek
  2007-06-05 23:08 ` Jeff Garzik
@ 2007-06-05 23:12 ` Alan Cox
  2007-06-05 23:19 ` Jeff Garzik
  2 siblings, 0 replies; 8+ messages in thread
From: Alan Cox @ 2007-06-05 23:12 UTC (permalink / raw)
  To: Uwe Koziolek; +Cc: Jeff Garzik, linux-ide

On Wed, 6 Jun 2007 01:04:17 +0200
Uwe Koziolek <uwe.koziolek@gmx.net> wrote:

> the PATA-port of SiS180 controller does not support a drive present status
> in the pci configspace like the other SiS PATA controllers, check skipped.
> 
> Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net>

Acked-by: Alan Cox <alan@redhat.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.22-rc4] libata: SiS180 pata support
  2007-06-05 23:04 [PATCH 2.6.22-rc4] libata: SiS180 pata support Uwe Koziolek
  2007-06-05 23:08 ` Jeff Garzik
  2007-06-05 23:12 ` Alan Cox
@ 2007-06-05 23:19 ` Jeff Garzik
  2007-06-28 21:02   ` Uwe Koziolek
  2 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2007-06-05 23:19 UTC (permalink / raw)
  To: Uwe Koziolek; +Cc: Alan, linux-ide


Nevermind, I did it myself:

This ensures that we can easily make changes specific to the PATA port
on the newer SATA chips, and also does what I've been requesting -- use
the standard ata_bmdma_error_handler(), rather than creating custom code
that achieves the same effect.


diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index ec3ae93..0752104 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -560,6 +560,40 @@ static const struct ata_port_operations sis_133_ops = {
 	.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 @@ static const struct ata_port_info sis_info100_early = {
 	.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,
 };
+static 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 @@ static const struct ata_port_info sis_info133_early = {
 };
 
 /* 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)
 {
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 221099d..40afa39 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -293,11 +293,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 		/* The PATA-handling is provided by pata_sis */
 		switch (pmr & 0x30) {
 		case 0x10:
-			ppi[1] = &sis_info133;
+			ppi[1] = &sis_info133_for_sata;
 			break;
 
 		case 0x30:
-			ppi[0] = &sis_info133;
+			ppi[0] = &sis_info133_for_sata;
 			break;
 		}
 		if ((pmr & SIS_PMR_COMBINED) == 0) {
diff --git a/drivers/ata/sis.h b/drivers/ata/sis.h
index 0f2208d..f7f3eeb 100644
--- a/drivers/ata/sis.h
+++ b/drivers/ata/sis.h
@@ -2,4 +2,4 @@
 struct ata_port_info;
 
 /* pata_sis.c */
-extern const struct ata_port_info sis_info133;
+extern const struct ata_port_info sis_info133_for_sata;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.22-rc4] libata: SiS180 pata support
  2007-06-05 23:19 ` Jeff Garzik
@ 2007-06-28 21:02   ` Uwe Koziolek
  2007-06-28 21:17     ` Jeff Garzik
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Koziolek @ 2007-06-28 21:02 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan, linux-ide

Nevermind, I did it myself:
> This ensures that we can easily make changes specific to the PATA port
> on the newer SATA chips, and also does what I've been requesting -- use
> the standard ata_bmdma_error_handler(), rather than creating custom code
> that achieves the same effect.
>
>
> diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
> index ec3ae93..0752104 100644
> --- a/drivers/ata/pata_sis.c
> +++ b/drivers/ata/pata_sis.c
>   
Jeff,
Did you have added  the patch you have  mailed on 06.06. anywhere or is
this patch an email only patch. And how to continue?

Uwe

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.22-rc4] libata: SiS180 pata support
  2007-06-28 21:02   ` Uwe Koziolek
@ 2007-06-28 21:17     ` Jeff Garzik
  2007-06-28 21:36       ` Uwe Koziolek
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2007-06-28 21:17 UTC (permalink / raw)
  To: Uwe Koziolek; +Cc: Alan, linux-ide

Uwe Koziolek wrote:
> Nevermind, I did it myself:
>> This ensures that we can easily make changes specific to the PATA port
>> on the newer SATA chips, and also does what I've been requesting -- use
>> the standard ata_bmdma_error_handler(), rather than creating custom code
>> that achieves the same effect.
>>
>>
>> diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
>> index ec3ae93..0752104 100644
>> --- a/drivers/ata/pata_sis.c
>> +++ b/drivers/ata/pata_sis.c
>>   
> Jeff,
> Did you have added  the patch you have  mailed on 06.06. anywhere or is
> this patch an email only patch. And how to continue?

It's in my mbox queue, should be in my next "run"... :)

	Jeff




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.22-rc4] libata: SiS180 pata support
  2007-06-28 21:17     ` Jeff Garzik
@ 2007-06-28 21:36       ` Uwe Koziolek
  2007-06-29 10:57         ` Jeff Garzik
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Koziolek @ 2007-06-28 21:36 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan, linux-ide

Jeff Garzik wrote:
>>>   
>> Jeff,
>> Did you have added  the patch you have  mailed on 06.06. anywhere or is
>> this patch an email only patch. And how to continue?
>
> It's in my mbox queue, should be in my next "run"... :)
>
>     Jeff
>
I have 3 fixes that i want to add on top
- a compilation fix for your fix
- an additional PCI-ID
- a changed handling for SATA-devices in IDE-emulation mode, this fixes
issues for the SiS968

I have submitted these fixes 2 times in a single patch, but i can also
split the three fixes in separate patches
if wanted.

Uwe



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6.22-rc4] libata: SiS180 pata support
  2007-06-28 21:36       ` Uwe Koziolek
@ 2007-06-29 10:57         ` Jeff Garzik
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2007-06-29 10:57 UTC (permalink / raw)
  To: Uwe Koziolek; +Cc: Alan, linux-ide

Uwe Koziolek wrote:
> Jeff Garzik wrote:
>>>>   
>>> Jeff,
>>> Did you have added  the patch you have  mailed on 06.06. anywhere or is
>>> this patch an email only patch. And how to continue?
>> It's in my mbox queue, should be in my next "run"... :)
>>
>>     Jeff
>>
> I have 3 fixes that i want to add on top
> - a compilation fix for your fix
> - an additional PCI-ID
> - a changed handling for SATA-devices in IDE-emulation mode, this fixes
> issues for the SiS968
> 
> I have submitted these fixes 2 times in a single patch, but i can also
> split the three fixes in separate patches
> if wanted.

Easiest for me would be three separate patches (after which I can 
combine the first with the existing patch in my mbox).

	Jeff




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-06-29 10:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-05 23:04 [PATCH 2.6.22-rc4] libata: SiS180 pata support Uwe Koziolek
2007-06-05 23:08 ` Jeff Garzik
2007-06-05 23:12 ` Alan Cox
2007-06-05 23:19 ` Jeff Garzik
2007-06-28 21:02   ` Uwe Koziolek
2007-06-28 21:17     ` Jeff Garzik
2007-06-28 21:36       ` Uwe Koziolek
2007-06-29 10:57         ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).