linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sata_via: kill SATA_PATA_SHARING register handling
@ 2007-09-21  8:55 Tejun Heo
  2007-09-26  2:27 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2007-09-21  8:55 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide

The SATA_PATA_SHARING register doesn't have anything to do with the
SATA part of the controller.  It indicates whether an extern SATA PHY
is attached to the PATA part of the controller and if so how it is
wired.  As the PATA part is driven by pata_via, sata_via has no reason
to care about that.  Also, pata_via should work fine under all
configurations.

This patch removes unnecessary attach failures.  It seems recent via
chipsets are defaulting to different values or are actually connected
to SATA PHY triggering this more often.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/sata_via.c |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index f075702..1dc9b4f 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -57,7 +57,6 @@ enum {
 	SATA_CHAN_ENAB		= 0x40, /* SATA channel enable */
 	SATA_INT_GATE		= 0x41, /* SATA interrupt gating */
 	SATA_NATIVE_MODE	= 0x42, /* Native mode enable */
-	SATA_PATA_SHARING	= 0x49, /* PATA/SATA sharing func ctrl */
 	PATA_UDMA_TIMING	= 0xB3, /* PATA timing for DMA/ cable detect */
 	PATA_PIO_TIMING		= 0xAB, /* PATA timing register */
 
@@ -68,7 +67,6 @@ enum {
 	NATIVE_MODE_ALL		= (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4),
 
 	SATA_EXT_PHY		= (1 << 6), /* 0==use PATA, 1==ext phy */
-	SATA_2DEV		= (1 << 5), /* SATA is master/slave */
 };
 
 static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
@@ -508,7 +506,6 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct ata_host *host;
 	int board_id = (int) ent->driver_data;
 	const int *bar_sizes;
-	u8 tmp8;
 
 	if (!printed_version++)
 		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
@@ -517,19 +514,10 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (rc)
 		return rc;
 
-	if (board_id == vt6420) {
-		pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8);
-		if (tmp8 & SATA_2DEV) {
-			dev_printk(KERN_ERR, &pdev->dev,
-				   "SATA master/slave not supported (0x%x)\n",
-		       		   (int) tmp8);
-			return -EIO;
-		}
-
+	if (board_id == vt6420)
 		bar_sizes = &svia_bar_sizes[0];
-	} else {
+	else
 		bar_sizes = &vt6421_bar_sizes[0];
-	}
 
 	for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++)
 		if ((pci_resource_start(pdev, i) == 0) ||

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

* Re: [PATCH] sata_via: kill SATA_PATA_SHARING register handling
  2007-09-21  8:55 [PATCH] sata_via: kill SATA_PATA_SHARING register handling Tejun Heo
@ 2007-09-26  2:27 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-09-26  2:27 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

Tejun Heo wrote:
> The SATA_PATA_SHARING register doesn't have anything to do with the
> SATA part of the controller.  It indicates whether an extern SATA PHY
> is attached to the PATA part of the controller and if so how it is
> wired.  As the PATA part is driven by pata_via, sata_via has no reason
> to care about that.  Also, pata_via should work fine under all
> configurations.
> 
> This patch removes unnecessary attach failures.  It seems recent via
> chipsets are defaulting to different values or are actually connected
> to SATA PHY triggering this more often.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
>  drivers/ata/sata_via.c |   16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)

applied to #upstream



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

end of thread, other threads:[~2007-09-26  2:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-21  8:55 [PATCH] sata_via: kill SATA_PATA_SHARING register handling Tejun Heo
2007-09-26  2:27 ` 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).