Skip to content

Commit 75e2bd5

Browse files
committed
ata: libata-core: Do not register PM operations for SAS ports
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: 2fcbdcb ("[SCSI] libata: export ata_port suspend/resume infrastructure for sas") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Tested-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 8b4d946 commit 75e2bd5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

drivers/ata/libata-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5335,7 +5335,7 @@ EXPORT_SYMBOL_GPL(ata_host_resume);
53355335
#endif
53365336

53375337
const struct device_type ata_port_type = {
5338-
.name = "ata_port",
5338+
.name = ATA_PORT_TYPE_NAME,
53395339
#ifdef CONFIG_PM
53405340
.pm = &ata_port_pm_ops,
53415341
#endif

drivers/ata/libata-transport.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ void ata_tport_delete(struct ata_port *ap)
266266
put_device(dev);
267267
}
268268

269+
static const struct device_type ata_port_sas_type = {
270+
.name = ATA_PORT_TYPE_NAME,
271+
};
272+
269273
/** ata_tport_add - initialize a transport ATA port structure
270274
*
271275
* @parent: parent device
@@ -283,7 +287,10 @@ int ata_tport_add(struct device *parent,
283287
struct device *dev = &ap->tdev;
284288

285289
device_initialize(dev);
286-
dev->type = &ata_port_type;
290+
if (ap->flags & ATA_FLAG_SAS_HOST)
291+
dev->type = &ata_port_sas_type;
292+
else
293+
dev->type = &ata_port_type;
287294

288295
dev->parent = parent;
289296
ata_host_get(ap->host);

drivers/ata/libata.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ enum {
3030
ATA_DNXFER_QUIET = (1 << 31),
3131
};
3232

33+
#define ATA_PORT_TYPE_NAME "ata_port"
34+
3335
extern atomic_t ata_print_id;
3436
extern int atapi_passthru16;
3537
extern int libata_fua;

0 commit comments

Comments
 (0)