Commit f9f20d02 authored by Martin K. Petersen's avatar Martin K. Petersen
Browse files

Merge patch series "scsi: pm80xx: Fix expander support"

Niklas Cassel <cassel@kernel.org> says:

Hello all,

Some recent patches broke expander support for the pm80xx driver.

The first two patches in this series make sure that expanders work with
the pm80xx driver again.

It also fixes a bug in pm8001_abort_task() that was found through code
review.

There is also some patches that make the pm80xx driver more robust, so it
is less likely that the expander support will break again in the future.

There is also some minor changes to some other libsas drivers to make use
of the new dev_parent_is_expander() helper.

Please test and review.

Kind regards,
Niklas

Link: https://lore.kernel.org/r/20250814173215.1765055-12-cassel@kernel.org


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents dc60a408 03f69351
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -876,7 +876,7 @@ static int hisi_sas_dev_found(struct domain_device *device)
	device->lldd_dev = sas_dev;
	hisi_hba->hw->setup_itct(hisi_hba, sas_dev);

	if (parent_dev && dev_is_expander(parent_dev->dev_type)) {
	if (dev_parent_is_expander(device)) {
		int phy_no;

		phy_no = sas_find_attached_phy_id(&parent_dev->ex_dev, device);
+2 −4
Original line number Diff line number Diff line
@@ -925,7 +925,6 @@ static void setup_itct_v2_hw(struct hisi_hba *hisi_hba,
	struct device *dev = hisi_hba->dev;
	u64 qw0, device_id = sas_dev->device_id;
	struct hisi_sas_itct *itct = &hisi_hba->itct[device_id];
	struct domain_device *parent_dev = device->parent;
	struct asd_sas_port *sas_port = device->port;
	struct hisi_sas_port *port = to_hisi_sas_port(sas_port);
	u64 sas_addr;
@@ -942,7 +941,7 @@ static void setup_itct_v2_hw(struct hisi_hba *hisi_hba,
		break;
	case SAS_SATA_DEV:
	case SAS_SATA_PENDING:
		if (parent_dev && dev_is_expander(parent_dev->dev_type))
		if (dev_parent_is_expander(device))
			qw0 = HISI_SAS_DEV_TYPE_STP << ITCT_HDR_DEV_TYPE_OFF;
		else
			qw0 = HISI_SAS_DEV_TYPE_SATA << ITCT_HDR_DEV_TYPE_OFF;
@@ -2494,7 +2493,6 @@ static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
{
	struct sas_task *task = slot->task;
	struct domain_device *device = task->dev;
	struct domain_device *parent_dev = device->parent;
	struct hisi_sas_device *sas_dev = device->lldd_dev;
	struct hisi_sas_cmd_hdr *hdr = slot->cmd_hdr;
	struct asd_sas_port *sas_port = device->port;
@@ -2509,7 +2507,7 @@ static void prep_ata_v2_hw(struct hisi_hba *hisi_hba,
	/* create header */
	/* dw0 */
	dw0 = port->id << CMD_HDR_PORT_OFF;
	if (parent_dev && dev_is_expander(parent_dev->dev_type)) {
	if (dev_parent_is_expander(device)) {
		dw0 |= 3 << CMD_HDR_CMD_OFF;
	} else {
		phy_id = device->phy->identify.phy_identifier;
+2 −4
Original line number Diff line number Diff line
@@ -874,7 +874,6 @@ static void setup_itct_v3_hw(struct hisi_hba *hisi_hba,
	struct device *dev = hisi_hba->dev;
	u64 qw0, device_id = sas_dev->device_id;
	struct hisi_sas_itct *itct = &hisi_hba->itct[device_id];
	struct domain_device *parent_dev = device->parent;
	struct asd_sas_port *sas_port = device->port;
	struct hisi_sas_port *port = to_hisi_sas_port(sas_port);
	u64 sas_addr;
@@ -891,7 +890,7 @@ static void setup_itct_v3_hw(struct hisi_hba *hisi_hba,
		break;
	case SAS_SATA_DEV:
	case SAS_SATA_PENDING:
		if (parent_dev && dev_is_expander(parent_dev->dev_type))
		if (dev_parent_is_expander(device))
			qw0 = HISI_SAS_DEV_TYPE_STP << ITCT_HDR_DEV_TYPE_OFF;
		else
			qw0 = HISI_SAS_DEV_TYPE_SATA << ITCT_HDR_DEV_TYPE_OFF;
@@ -1476,7 +1475,6 @@ static void prep_ata_v3_hw(struct hisi_hba *hisi_hba,
{
	struct sas_task *task = slot->task;
	struct domain_device *device = task->dev;
	struct domain_device *parent_dev = device->parent;
	struct hisi_sas_device *sas_dev = device->lldd_dev;
	struct hisi_sas_cmd_hdr *hdr = slot->cmd_hdr;
	struct asd_sas_port *sas_port = device->port;
@@ -1487,7 +1485,7 @@ static void prep_ata_v3_hw(struct hisi_hba *hisi_hba,
	u32 dw1 = 0, dw2 = 0;

	hdr->dw0 = cpu_to_le32(port->id << CMD_HDR_PORT_OFF);
	if (parent_dev && dev_is_expander(parent_dev->dev_type)) {
	if (dev_parent_is_expander(device)) {
		hdr->dw0 |= cpu_to_le32(3 << CMD_HDR_CMD_OFF);
	} else {
		phy_id = device->phy->identify.phy_identifier;
+1 −1
Original line number Diff line number Diff line
@@ -1434,7 +1434,7 @@ static enum sci_status isci_remote_device_construct(struct isci_port *iport,
	struct domain_device *dev = idev->domain_dev;
	enum sci_status status;

	if (dev->parent && dev_is_expander(dev->parent->dev_type))
	if (dev_parent_is_expander(dev))
		status = sci_remote_device_ea_construct(iport, idev);
	else
		status = sci_remote_device_da_construct(iport, idev);
+1 −4
Original line number Diff line number Diff line
@@ -1313,10 +1313,7 @@ static int sas_check_parent_topology(struct domain_device *child)
	int i;
	int res = 0;

	if (!child->parent)
		return 0;

	if (!dev_is_expander(child->parent->dev_type))
	if (!dev_parent_is_expander(child))
		return 0;

	parent_ex = &child->parent->ex_dev;
Loading