Skip to contentSkip to conversation

Comments about commit 'PCI: docking station: remove dock uevents'?

DISCUSSION Holger Macht 3 participants 8 messages Nov 12, 2006 – Nov 13, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 10 lines

commit 5669021e40964303994a20633548732c6bb26636

Author: Kristen Carlson Accardi <[email protected]>
Date:   Tue Aug 1 14:59:19 2006 -0700

PCI: docking station: remove dock uevents

Remove uevent dock notifications. There are no consumers of these events at present, and uevents are likely not the correct way to send this type of event anyway.

Quoted 5 lines

Until I get some kind of idea if anyone in userspace cares about dock events, I will just not send any.

I'm currently looking at docking station support for various laptops/vendors and what can be done to get them working. At the moment, userspace has to do some quirks to get support for them. For instance, when docking an X60 into a docking station where a SATA DVD drive is located, userland has to rescan the scsi host for the drive to show up. So I need a notification from the kernel on dock/undock events. Currently I'm using the ibm_acpi driver to either get the ibm/hotkey or the ibm/dock event. Due to the fact that I also want to support other laptops and because of the existance of a common dock station driver, I'm considering to use it. A notification is of course only needed if triggering something in userspace is the right way to go at all. So if ideally everything should happen inside the kernel anyway, please tell me. In this case maybe I will have a look at the kernel and will use ibm_acpi meanwhile. However, if it's possible to readd the notification, I could just skip the ibm_acpi way for docking and could use the common driver. Maybe it even shouldn't be done via uevent, maybe an acpi event is enough?

Additionally, currently the dock driver automatically executes the _DCK method when it detects a dock/undock event. Wouldn't it be good to have common sysfs interface for docking so that userland can trigger the dock/undock? This way userland would also be able to do 'something before' docking/undocking, such as unregistering a device, showing a poput that it is now save to physically undock, etc.

Regards,
Holger

#1 lore raw
Quoted 5 lines · Holger Macht

I'm currently looking at docking station support for various laptops/vendors and what can be done to get them working. At the moment, userspace has to do some quirks to get support for them. For instance, when docking an X60 into a docking station where a SATA DVD drive is located, userland has to rescan the scsi host for the drive to show up.

Does the docking not generate a bus rescan event on the SATA bus? If it does, it's just a special case of ACPI drive hotplugging. You can't do it reliably from userspace, but I think Kirsten has been looking at doing it properly in the kernel.

Quoted 6 lines

Additionally, currently the dock driver automatically executes the _DCK method when it detects a dock/undock event. Wouldn't it be good to have common sysfs interface for docking so that userland can trigger the dock/undock? This way userland would also be able to do 'something before' docking/undocking, such as unregistering a device, showing a poput that it is now save to physically undock, etc.

When the dock contains a drive, I think there's possibly an argument in favour of this. Otherwise, the hardware should be able to deal with it - every ACPI-based dock I've played with has had some indication to inform the user that the device has disconnected.

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw
Quoted 9 lines · Matthew Garrett
Quoted 5 lines · Holger Macht

I'm currently looking at docking station support for various laptops/vendors and what can be done to get them working. At the moment, userspace has to do some quirks to get support for them. For instance, when docking an X60 into a docking station where a SATA DVD drive is located, userland has to rescan the scsi host for the drive to show up.

Does the docking not generate a bus rescan event on the SATA bus? If it

Maybe it does, I'll have to recheck.

Quoted 3 lines

does, it's just a special case of ACPI drive hotplugging. You can't do it reliably from userspace, but I think Kirsten has been looking at doing it properly in the kernel.

What I'm doing at the moment (for about a week ;-) is to echo "- - -" to /sys/class/scsi_host/host*/scan for all unoccupied hosts on a dock event. And this works pretty good. But it's of course only a workaround if the scsi bus generates an event.

Quoted 7 lines
Quoted 7 lines

Additionally, currently the dock driver automatically executes the _DCK method when it detects a dock/undock event. Wouldn't it be good to have common sysfs interface for docking so that userland can trigger the dock/undock? This way userland would also be able to do 'something before' docking/undocking, such as unregistering a device, showing a poput that it is now save to physically undock, etc.

With recent kernel I have to unregister from the drive from userspace to prevent confusion about if the drive is still there or not.

Quoted 4 lines

When the dock contains a drive, I think there's possibly an argument in favour of this. Otherwise, the hardware should be able to deal with it - every ACPI-based dock I've played with has had some indication to inform the user that the device has disconnected.

Yes, this one has such an indicator, too. I just thought notifying userspace could be helpful for other cases, that's why I'm asking for comments.

Thanks,
Holger

#3 lore raw
Quoted 4 lines · Holger Macht

What I'm doing at the moment (for about a week ;-) is to echo "- - -" to /sys/class/scsi_host/host*/scan for all unoccupied hosts on a dock event. And this works pretty good. But it's of course only a workaround if the scsi bus generates an event.

That's just about workable for adding a device, but it loses badly for removing one.

Quoted 2 lines

With recent kernel I have to unregister from the drive from userspace to prevent confusion about if the drive is still there or not.

Right. And that doesn't help in the case where the user undocks without waiting for everything to stop flashing first. Of course, in that case it's probably reasonable to tell the user that they lose, but we can do better than leaving a random drive lying around and a partially wedged sata bus...

Signature · 1 line
Matthew Garrett | [email protected]
#4 lore raw
Quoted 9 lines · Matthew Garrett
Quoted 4 lines · Holger Macht

What I'm doing at the moment (for about a week ;-) is to echo "- - -" to /sys/class/scsi_host/host*/scan for all unoccupied hosts on a dock event. And this works pretty good. But it's of course only a workaround if the scsi bus generates an event.

That's just about workable for adding a device, but it loses badly for removing one.

On before physically removing the laptop I did an echo 1 > /sys/.../device/delete . That's actually the reason why I need a undock event in userspace for now.

Quoted 8 lines
Quoted 2 lines

With recent kernel I have to unregister from the drive from userspace to prevent confusion about if the drive is still there or not.

Right. And that doesn't help in the case where the user undocks without waiting for everything to stop flashing first. Of course, in that case it's probably reasonable to tell the user that they lose, but we can do better than leaving a random drive lying around and a partially wedged sata bus...

User presses lever on dock station or presses Fn+F9 on a thinkpad generates a undock acpi event, then I'm unregistering the device, then I trigger the undock from userspace and at this point the indicator on the dock station turns green so the user knows that he can remove the laptop.

Regards,
Holger

#5 lore raw
Quoted 25 lines · On Mon, 13 Nov 2006 20:57:40 +0100 Holger Macht <[email protected]> wrote:
Quoted 9 lines · Matthew Garrett
Quoted 4 lines · Holger Macht

What I'm doing at the moment (for about a week ;-) is to echo "- - -" to /sys/class/scsi_host/host*/scan for all unoccupied hosts on a dock event. And this works pretty good. But it's of course only a workaround if the scsi bus generates an event.

That's just about workable for adding a device, but it loses badly for removing one.

On before physically removing the laptop I did an echo 1 > /sys/.../device/delete . That's actually the reason why I need a undock event in userspace for now.

Quoted 8 lines
Quoted 2 lines

With recent kernel I have to unregister from the drive from userspace to prevent confusion about if the drive is still there or not.

Right. And that doesn't help in the case where the user undocks without waiting for everything to stop flashing first. Of course, in that case it's probably reasonable to tell the user that they lose, but we can do better than leaving a random drive lying around and a partially wedged sata bus...

Quoted 7 lines

User presses lever on dock station or presses Fn+F9 on a thinkpad generates a undock acpi event, then I'm unregistering the device, then I trigger the undock from userspace and at this point the indicator on the dock station turns green so the user knows that he can remove the laptop.

Regards,
Holger

Brandon is working on adding a sysfs interface to the dock driver right now. We have so far only added a read only parameter that will display the dock status, however, it is possible to add a sysfs entry that would allow the user to undock by writing to it.

Brandon, can you add this to your sysfs patch?

Thanks,
Kristen

#6 lore raw
In reply to Matthew Garrett
Quoted 8 lines · On Mon, 13 Nov 2006 12:14:37 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 5 lines · Holger Macht

I'm currently looking at docking station support for various laptops/vendors and what can be done to get them working. At the moment, userspace has to do some quirks to get support for them. For instance, when docking an X60 into a docking station where a SATA DVD drive is located, userland has to rescan the scsi host for the drive to show up.

Quoted 4 lines

Does the docking not generate a bus rescan event on the SATA bus? If it does, it's just a special case of ACPI drive hotplugging. You can't do it reliably from userspace, but I think Kirsten has been looking at doing it properly in the kernel.

When you use the "bay" driver in addition to the "dock" driver (bay is in -mm right now) you would get a notification on dock/undock in the driver which would then cause the bay driver to notify user space about the drive event. I've not found any other devices that require user space notification.

Quoted 8 lines
Quoted 7 lines

Additionally, currently the dock driver automatically executes the _DCK method when it detects a dock/undock event. Wouldn't it be good to have common sysfs interface for docking so that userland can trigger the dock/undock? This way userland would also be able to do 'something before' docking/undocking, such as unregistering a device, showing a poput that it is now save to physically undock, etc.

Quoted 4 lines

When the dock contains a drive, I think there's possibly an argument in favour of this. Otherwise, the hardware should be able to deal with it - every ACPI-based dock I've played with has had some indication to inform the user that the device has disconnected.

I think there is an arguement in favor of this, but there are more arguments in favor of not waiting for user space before executing the acpi _DCK to undock - mainly because not all dock stations actually lock the laptop in the dock, and so the user is going to just do it anyway. by undocking as soon as we get the hardware notification, we can at least clean up after this activity. Also, most people who have commented on my bay driver (which does assume user space handles the actual eject) have complained about the fact that I wait for user space. they general feedback I've gotten is that these activities should "just happen" and not require user intervention.

Quoted 3 lines
Signature · 2 lines
-- 
Matthew Garrett | [email protected]
#7 lore raw
Quoted 16 lines · Kristen Carlson Accardi
Quoted 8 lines · On Mon, 13 Nov 2006 12:14:37 +0000 Matthew Garrett <[email protected]> wrote:
Quoted 5 lines · Holger Macht

I'm currently looking at docking station support for various laptops/vendors and what can be done to get them working. At the moment, userspace has to do some quirks to get support for them. For instance, when docking an X60 into a docking station where a SATA DVD drive is located, userland has to rescan the scsi host for the drive to show up.

Quoted 4 lines

Does the docking not generate a bus rescan event on the SATA bus? If it does, it's just a special case of ACPI drive hotplugging. You can't do it reliably from userspace, but I think Kirsten has been looking at doing it properly in the kernel.

Quoted 5 lines

When you use the "bay" driver in addition to the "dock" driver (bay is in -mm right now) you would get a notification on dock/undock in the driver which would then cause the bay driver to notify user space about the drive event. I've not found any other devices that require user space notification.

Ok, thanks for the pointer, I'll have a look at it.

Regards,
Holger

Quoted 30 lines
Quoted 9 lines
Quoted 8 lines

Additionally, currently the dock driver automatically executes the _DCK method when it detects a dock/undock event. Wouldn't it be good to have common sysfs interface for docking so that userland can trigger the dock/undock? This way userland would also be able to do 'something before' docking/undocking, such as unregistering a device, showing a poput that it is now save to physically undock, etc.

Quoted 4 lines

When the dock contains a drive, I think there's possibly an argument in favour of this. Otherwise, the hardware should be able to deal with it - every ACPI-based dock I've played with has had some indication to inform the user that the device has disconnected.

I think there is an arguement in favor of this, but there are more arguments in favor of not waiting for user space before executing the acpi _DCK to undock - mainly because not all dock stations actually lock the laptop in the dock, and so the user is going to just do it anyway. by undocking as soon as we get the hardware notification, we can at least clean up after this activity. Also, most people who have commented on my bay driver (which does assume user space handles the actual eject) have complained about the fact that I wait for user space. they general feedback I've gotten is that these activities should "just happen" and not require user intervention.

Quoted 1 line

-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html