Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bd99b4e authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

libata: normalize port_info, port_operations and sht tables



Over the time, port info, ops and sht structures developed quite a bit
of inconsistencies.  This patch updates drivers.

* Enable/disable_pm callbacks added to all ahci ops tables.

* Every driver for SFF controllers now uses ata_sff_port_start()
  instead of ata_port_start() unless the driver has custom
  implementation.

* Every driver for SFF controllers now uses ata_pci_default_filter()
  unless the driver has custom implementation.

* Removed an odd port_info->sht initialization from ata_piix.c.
  Likely a merge byproduct.

* A port which has ATA_FLAG_SATA set doesn't need to set cable_detect
  to ata_cable_sata().  Remove it from via and mv port ops.

* Some drivers had unnecessary .max_sectors initialization which is
  ignored and was missing .slave_destroy callback.  Fixed.

* Removed unnecessary sht initializations port_info's.

* Removed onsolete scsi device suspend/resume callbacks from
  pata_bf54x.

* No reason to set ata_pci_default_filter() and bmdma functions for
  PIO-only drivers.  Remove those callbacks and replace
  ata_bmdma_irq_clear with ata_noop_irq_clear.

* pata_platform sets port_start to ata_dummy_ret0.  port_start can
  just be set to NULL.

* sata_fsl supports NCQ but was missing qc_defer.  Fixed.

* pata_rb600_cf implements dummy port_start.  Removed.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent 358f9a77
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -336,6 +336,8 @@ static const struct ata_port_operations ahci_vt8251_ops = {
	.check_altstatus	= ahci_check_status,
	.dev_select		= ata_noop_dev_select,

	.dev_config		= ahci_dev_config,

	.tf_read		= ahci_tf_read,

	.qc_defer		= sata_pmp_qc_defer_cmd_switch,
@@ -360,6 +362,8 @@ static const struct ata_port_operations ahci_vt8251_ops = {
	.port_suspend		= ahci_port_suspend,
	.port_resume		= ahci_port_resume,
#endif
	.enable_pm		= ahci_enable_alpm,
	.disable_pm		= ahci_disable_alpm,

	.port_start		= ahci_port_start,
	.port_stop		= ahci_port_stop,
@@ -370,6 +374,8 @@ static const struct ata_port_operations ahci_p5wdh_ops = {
	.check_altstatus	= ahci_check_status,
	.dev_select		= ata_noop_dev_select,

	.dev_config		= ahci_dev_config,

	.tf_read		= ahci_tf_read,

	.qc_defer		= sata_pmp_qc_defer_cmd_switch,
@@ -394,6 +400,8 @@ static const struct ata_port_operations ahci_p5wdh_ops = {
	.port_suspend		= ahci_port_suspend,
	.port_resume		= ahci_port_resume,
#endif
	.enable_pm		= ahci_enable_alpm,
	.disable_pm		= ahci_disable_alpm,

	.port_start		= ahci_port_start,
	.port_stop		= ahci_port_stop,
+1 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ static struct scsi_host_template generic_sht = {

static struct ata_port_operations generic_port_ops = {
	.set_mode	= generic_set_mode,
	.mode_filter	= ata_pci_default_filter,

	.tf_load	= ata_tf_load,
	.tf_read	= ata_tf_read,
+7 −6
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ static const struct ata_port_operations piix_pata_ops = {
	.irq_clear		= ata_bmdma_irq_clear,
	.irq_on			= ata_irq_on,

	.port_start		= ata_port_start,
	.port_start		= ata_sff_port_start,
};

static const struct ata_port_operations ich_pata_ops = {
@@ -367,7 +367,7 @@ static const struct ata_port_operations ich_pata_ops = {
	.irq_clear		= ata_bmdma_irq_clear,
	.irq_on			= ata_irq_on,

	.port_start		= ata_port_start,
	.port_start		= ata_sff_port_start,
};

static const struct ata_port_operations piix_sata_ops = {
@@ -385,6 +385,7 @@ static const struct ata_port_operations piix_sata_ops = {
	.qc_issue		= ata_qc_issue_prot,
	.data_xfer		= ata_data_xfer,

	.mode_filter		= ata_pci_default_filter,
	.freeze			= ata_bmdma_freeze,
	.thaw			= ata_bmdma_thaw,
	.error_handler		= ata_bmdma_error_handler,
@@ -393,7 +394,7 @@ static const struct ata_port_operations piix_sata_ops = {
	.irq_clear		= ata_bmdma_irq_clear,
	.irq_on			= ata_irq_on,

	.port_start		= ata_port_start,
	.port_start		= ata_sff_port_start,
};

static const struct ata_port_operations piix_vmw_ops = {
@@ -425,7 +426,7 @@ static const struct ata_port_operations piix_vmw_ops = {
	.irq_clear		= ata_bmdma_irq_clear,
	.irq_on			= ata_irq_on,

	.port_start		= ata_port_start,
	.port_start		= ata_sff_port_start,
};

static const struct ata_port_operations piix_sidpr_sata_ops = {
@@ -446,6 +447,7 @@ static const struct ata_port_operations piix_sidpr_sata_ops = {
	.scr_read		= piix_sidpr_scr_read,
	.scr_write		= piix_sidpr_scr_write,

	.mode_filter		= ata_pci_default_filter,
	.freeze			= ata_bmdma_freeze,
	.thaw			= ata_bmdma_thaw,
	.error_handler		= piix_sidpr_error_handler,
@@ -454,7 +456,7 @@ static const struct ata_port_operations piix_sidpr_sata_ops = {
	.irq_clear		= ata_bmdma_irq_clear,
	.irq_on			= ata_irq_on,

	.port_start		= ata_port_start,
	.port_start		= ata_sff_port_start,
};

static const struct piix_map_db ich5_map_db = {
@@ -683,7 +685,6 @@ static struct ata_port_info piix_port_info[] = {

	[piix_pata_vmw] =
	{
		.sht		= &piix_sht,
		.flags		= PIIX_PATA_FLAGS,
		.pio_mask	= 0x1f,	/* pio0-4 */
		.mwdma_mask	= 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
+1 −0
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ static const struct ata_port_operations artop6210_ops = {
static const struct ata_port_operations artop6260_ops = {
	.set_piomode		= artop6260_set_piomode,
	.set_dmamode		= artop6260_set_dmamode,
	.mode_filter		= ata_pci_default_filter,

	.tf_load		= ata_tf_load,
	.tf_read		= ata_tf_read,
+0 −1
Original line number Diff line number Diff line
@@ -1409,7 +1409,6 @@ static const struct ata_port_operations bfin_pata_ops = {

static struct ata_port_info bfin_port_info[] = {
	{
		.sht		= &bfin_sht,
		.flags		= ATA_FLAG_SLAVE_POSS
				| ATA_FLAG_MMIO
				| ATA_FLAG_NO_LEGACY,
Loading