diff mbox

[07/64] pata_atiixp: enable parallel scan

Message ID 20100118171447.14623.47438.sendpatchset@localhost
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Bartlomiej Zolnierkiewicz Jan. 18, 2010, 5:14 p.m. UTC
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pata_atiixp: enable parallel scan

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ata/pata_atiixp.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

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

Comments

Alan Cox Jan. 18, 2010, 5:52 p.m. UTC | #1
>  	const struct ata_port_info *ppi[] = { &info, &info };
> +	struct ata_host *host;
> +	int rc;
>  
> -	return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL);
> +	/* enable device and prepare host */
> +	rc = pcim_enable_device(pdev);
> +	if (rc)
> +		return rc;
> +
> +	rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
> +	if (rc)
> +		return rc;
> +
> +	host->flags |= ATA_HOST_PARALLEL_SCAN;
> +
> +	pci_set_master(pdev);
> +
> +	return ata_pci_sff_activate_host(host, ata_sff_interrupt, &atiixp_sht);
>  }

Adding a small essay to each host that activates parallel scan doesn't
make sense. This should be a helper (ignore that if you make it a helper
later in the patch set...)
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bartlomiej Zolnierkiewicz Jan. 18, 2010, 6:18 p.m. UTC | #2
On Monday 18 January 2010 06:52:56 pm Alan Cox wrote:
> >  	const struct ata_port_info *ppi[] = { &info, &info };
> > +	struct ata_host *host;
> > +	int rc;
> >  
> > -	return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL);
> > +	/* enable device and prepare host */
> > +	rc = pcim_enable_device(pdev);
> > +	if (rc)
> > +		return rc;
> > +
> > +	rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
> > +	if (rc)
> > +		return rc;
> > +
> > +	host->flags |= ATA_HOST_PARALLEL_SCAN;
> > +
> > +	pci_set_master(pdev);
> > +
> > +	return ata_pci_sff_activate_host(host, ata_sff_interrupt, &atiixp_sht);
> >  }
> 
> Adding a small essay to each host that activates parallel scan doesn't
> make sense. This should be a helper (ignore that if you make it a helper
> later in the patch set...)

Patch adding such helper would be probably a nice incremental improvement,
though 'a small essay' works just fine for the current needs as parallel
scanning functionality is added only to pata_atiixp and pata_efar hosts..

--
Bartlomiej Zolnierkiewicz
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: b/drivers/ata/pata_atiixp.c
===================================================================
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -189,8 +189,23 @@  static int atiixp_init_one(struct pci_de
 		.port_ops = &atiixp_port_ops
 	};
 	const struct ata_port_info *ppi[] = { &info, &info };
+	struct ata_host *host;
+	int rc;
 
-	return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL);
+	/* enable device and prepare host */
+	rc = pcim_enable_device(pdev);
+	if (rc)
+		return rc;
+
+	rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
+	if (rc)
+		return rc;
+
+	host->flags |= ATA_HOST_PARALLEL_SCAN;
+
+	pci_set_master(pdev);
+
+	return ata_pci_sff_activate_host(host, ata_sff_interrupt, &atiixp_sht);
 }
 
 static const struct pci_device_id atiixp[] = {