Unverified Commit 60c70978 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents f377abcb 8fbb2ccc
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -301,6 +301,31 @@ static int sas_ata_clear_pending(struct domain_device *dev, struct ex_phy *phy)
		return 1;
}

int smp_ata_check_ready_type(struct ata_link *link)
{
	struct domain_device *dev = link->ap->private_data;
	struct sas_phy *phy = sas_get_local_phy(dev);
	struct domain_device *ex_dev = dev->parent;
	enum sas_device_type type = SAS_PHY_UNUSED;
	u8 sas_addr[SAS_ADDR_SIZE];
	int res;

	res = sas_get_phy_attached_dev(ex_dev, phy->number, sas_addr, &type);
	sas_put_local_phy(phy);
	if (res)
		return res;

	switch (type) {
	case SAS_SATA_PENDING:
		return 0;
	case SAS_END_DEVICE:
		return 1;
	default:
		return -ENODEV;
	}
}
EXPORT_SYMBOL_GPL(smp_ata_check_ready_type);

static int smp_ata_check_ready(struct ata_link *link)
{
	int res;
+2 −2
Original line number Diff line number Diff line
@@ -1727,7 +1727,7 @@ static int sas_get_phy_change_count(struct domain_device *dev,
	return res;
}

static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id,
int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id,
			     u8 *sas_addr, enum sas_device_type *type)
{
	int res;
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id);
int sas_ex_phy_discover(struct domain_device *dev, int single);
int sas_get_report_phy_sata(struct domain_device *dev, int phy_id,
			    struct smp_resp *rps_resp);
int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id,
			     u8 *sas_addr, enum sas_device_type *type);
int sas_try_ata_reset(struct asd_sas_phy *phy);
void sas_hae_reset(struct work_struct *work);

+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ void sas_suspend_sata(struct asd_sas_port *port);
void sas_resume_sata(struct asd_sas_port *port);
void sas_ata_end_eh(struct ata_port *ap);
int sas_ata_wait_after_reset(struct domain_device *dev, unsigned long deadline);
int smp_ata_check_ready_type(struct ata_link *link);
#else


@@ -92,6 +93,11 @@ static inline int sas_ata_wait_after_reset(struct domain_device *dev,
{
	return -ETIMEDOUT;
}

static inline int smp_ata_check_ready_type(struct ata_link *link)
{
	return 0;
}
#endif

#endif /* _SAS_ATA_H_ */