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

Commit ac1aebd4 authored by Damien Le Moal's avatar Damien Le Moal Committed by Greg Kroah-Hartman
Browse files

ata: libata-core: Do not register PM operations for SAS ports



commit 75e2bd5f1ede42a2bc88aa34b431e1ace8e0bea0 upstream.

libsas does its own domain based power management of ports. For such
ports, libata should not use a device type defining power management
operations as executing these operations for suspend/resume in addition
to libsas calls to ata_sas_port_suspend() and ata_sas_port_resume() is
not necessary (and likely dangerous to do, even though problems are not
seen currently).

Introduce the new ata_port_sas_type device_type for ports managed by
libsas. This new device type is used in ata_tport_add() and is defined
without power management operations.

Fixes: 2fcbdcb4 ("[SCSI] libata: export ata_port suspend/resume infrastructure for sas")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Tested-by: default avatarChia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9313aab5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5942,7 +5942,7 @@ void ata_host_resume(struct ata_host *host)
#endif

const struct device_type ata_port_type = {
	.name = "ata_port",
	.name = ATA_PORT_TYPE_NAME,
#ifdef CONFIG_PM
	.pm = &ata_port_pm_ops,
#endif
+8 −1
Original line number Diff line number Diff line
@@ -266,6 +266,10 @@ void ata_tport_delete(struct ata_port *ap)
	put_device(dev);
}

static const struct device_type ata_port_sas_type = {
	.name = ATA_PORT_TYPE_NAME,
};

/** ata_tport_add - initialize a transport ATA port structure
 *
 * @parent:	parent device
@@ -283,6 +287,9 @@ int ata_tport_add(struct device *parent,
	struct device *dev = &ap->tdev;

	device_initialize(dev);
	if (ap->flags & ATA_FLAG_SAS_HOST)
		dev->type = &ata_port_sas_type;
	else
		dev->type = &ata_port_type;

	dev->parent = parent;
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ enum {
	ATA_DNXFER_QUIET	= (1 << 31),
};

#define ATA_PORT_TYPE_NAME	"ata_port"

extern atomic_t ata_print_id;
extern int atapi_passthru16;
extern int libata_fua;