Re: [PATCH] libata: Register for dock events when the drive is inside a dock station
On Fri 22. Feb - 10:34:24, Tejun Heo wrote: If a device/bay is inside a docking station, we need to register for dock events additionally to bay events. If a dock event occurs, the dock driver will call the appropriate handler (ata_acpi_ap_notify() or ata_acpi_dev_notify()) for us. Signed-off-by: Holger Macht [EMAIL PROTECTED] --- diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 9e8ec19..563ad72 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -191,20 +191,33 @@ void ata_acpi_associate(struct ata_host *host) else ata_acpi_associate_ide_port(ap); - if (ap-acpi_handle) + if (ap-acpi_handle) { acpi_install_notify_handler (ap-acpi_handle, ACPI_SYSTEM_NOTIFY, ata_acpi_ap_notify, ap); +#ifdef CONFIG_ACPI_DOCK_MODULE Heh, you need #if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) Also, another question. Is there a way to tell whether the device or port is connected behind a dock or not? Just notifying hotplug signal is fine for hotplugging but to make hot unplug safe for PATA, libata should be able to tell whether the device is actually gonna go away and kill it explicitly. The hotplug handler is only called if the device is actually inside the dock station. If it is not, nothing will happen. I hope that I got your question right? However, if this would be helpful, it would be easy to add something like a am_I_on_dock_station?(...) function to the dock driver. Regards, Holger - To unsubscribe from this list: send the line unsubscribe linux-ide in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] libata: Register for dock events when the drive is inside a dock station
If a device/bay is inside a docking station, we need to register for dock events additionally to bay events. If a dock event occurs, the dock driver will call the appropriate handler (ata_acpi_ap_notify() or ata_acpi_dev_notify()) for us. Signed-off-by: Holger Macht [EMAIL PROTECTED] --- diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 9e8ec19..563ad72 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -191,20 +191,33 @@ void ata_acpi_associate(struct ata_host *host) else ata_acpi_associate_ide_port(ap); - if (ap-acpi_handle) + if (ap-acpi_handle) { acpi_install_notify_handler (ap-acpi_handle, ACPI_SYSTEM_NOTIFY, ata_acpi_ap_notify, ap); +#ifdef CONFIG_ACPI_DOCK_MODULE Heh, you need #if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) Also, another question. Is there a way to tell whether the device or port is connected behind a dock or not? Just notifying hotplug signal is fine for hotplugging but to make hot unplug safe for PATA, libata should be able to tell whether the device is actually gonna go away and kill it explicitly. Thanks. -- tejun - To unsubscribe from this list: send the line unsubscribe linux-ide in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] libata: Register for dock events when the drive is inside a dock station
On Thu 14. Feb - 13:40:48, Holger Macht wrote: If a device/bay is inside a docking station, we need to register for dock events additionally to bay events. If a dock event occurs, the dock driver will call the appropriate handler (ata_acpi_ap_notify() or ata_acpi_dev_notify()) for us. Signed-off-by: Holger Macht [EMAIL PROTECTED] Updated patch which only includes the dock specific function if the dock driver is actually compiled. Signed-off-by: Holger Macht [EMAIL PROTECTED] --- diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 9e8ec19..5f16055 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -191,20 +191,33 @@ void ata_acpi_associate(struct ata_host *host) else ata_acpi_associate_ide_port(ap); - if (ap-acpi_handle) + if (ap-acpi_handle) { acpi_install_notify_handler (ap-acpi_handle, ACPI_SYSTEM_NOTIFY, ata_acpi_ap_notify, ap); +#ifdef CONFIG_ACPI_DOCK + /* we might be on a docking station */ + register_hotplug_dock_device(ap-acpi_handle, +ata_acpi_ap_notify, ap); +#endif + } for (j = 0; j ata_link_max_devices(ap-link); j++) { struct ata_device *dev = ap-link.device[j]; - if (dev-acpi_handle) + if (dev-acpi_handle) { acpi_install_notify_handler (dev-acpi_handle, ACPI_SYSTEM_NOTIFY, ata_acpi_dev_notify, dev); +#ifdef CONFIG_ACPI_DOCK + /* we might be on a docking station */ + register_hotplug_dock_device(ap-acpi_handle, + ata_acpi_dev_notify, +ap); +#endif + } } } } - To unsubscribe from this list: send the line unsubscribe linux-ide in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html