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

Commit 9508a66f authored by Dan Williams's avatar Dan Williams Committed by James Bottomley
Browse files

[SCSI] libsas: async ata scanning



libsas ata error handling is already async but this does not help the
scan case.  Move initial link recovery out from under host->scan_mutex,
and delay synchronization with eh until after all port probe/recovery
work has been queued.

Device ordering is maintained with scan order by still calling
sas_rphy_add() in order of domain discovery.

Since we now scan the domain list when invoking libata-eh we need to be
careful to check for fully initialized ata ports.

Acked-by: default avatarJack Wang <jack_wang@usish.com>
Acked-by: default avatarJeff Garzik <jgarzik@redhat.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 92625f9b
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -5936,12 +5936,8 @@ void ata_host_init(struct ata_host *host, struct device *dev,
	host->ops = ops;
}

int ata_port_probe(struct ata_port *ap)
void __ata_port_probe(struct ata_port *ap)
{
	int rc = 0;

	/* probe */
	if (ap->ops->error_handler) {
	struct ata_eh_info *ehi = &ap->link.eh_info;
	unsigned long flags;

@@ -5957,8 +5953,14 @@ int ata_port_probe(struct ata_port *ap)
	ata_port_schedule_eh(ap);

	spin_unlock_irqrestore(ap->lock, flags);
}

		/* wait for EH to finish */
int ata_port_probe(struct ata_port *ap)
{
	int rc = 0;

	if (ap->ops->error_handler) {
		__ata_port_probe(ap);
		ata_port_wait_eh(ap);
	} else {
		DPRINTK("ata%u: bus probe begin\n", ap->print_id);
+13 −0
Original line number Diff line number Diff line
@@ -3838,6 +3838,19 @@ void ata_sas_port_stop(struct ata_port *ap)
}
EXPORT_SYMBOL_GPL(ata_sas_port_stop);

int ata_sas_async_port_init(struct ata_port *ap)
{
	int rc = ap->ops->port_start(ap);

	if (!rc) {
		ap->print_id = ata_print_id++;
		__ata_port_probe(ap);
	}

	return rc;
}
EXPORT_SYMBOL_GPL(ata_sas_async_port_init);

/**
 *	ata_sas_port_init - Initialize a SATA device
 *	@ap: SATA port to initialize
+1 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
extern struct ata_port *ata_port_alloc(struct ata_host *host);
extern const char *sata_spd_string(unsigned int spd);
extern int ata_port_probe(struct ata_port *ap);
extern void __ata_port_probe(struct ata_port *ap);

/* libata-acpi.c */
#ifdef CONFIG_ATA_ACPI
+0 −1
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@ static struct scsi_host_template aic94xx_sht = {
	.use_clustering		= ENABLE_CLUSTERING,
	.eh_device_reset_handler	= sas_eh_device_reset_handler,
	.eh_bus_reset_handler	= sas_eh_bus_reset_handler,
	.slave_alloc		= sas_slave_alloc,
	.target_destroy		= sas_target_destroy,
	.ioctl			= sas_ioctl,
};
+0 −1
Original line number Diff line number Diff line
@@ -165,7 +165,6 @@ static struct scsi_host_template isci_sht = {
	.sg_tablesize			= SG_ALL,
	.max_sectors			= SCSI_DEFAULT_MAX_SECTORS,
	.use_clustering			= ENABLE_CLUSTERING,
	.slave_alloc			= sas_slave_alloc,
	.target_destroy			= sas_target_destroy,
	.ioctl				= sas_ioctl,
	.shost_attrs			= isci_host_attrs,
Loading