Nigel Cunningham | 1 May 2004 02:03

Re: [PATCH] Hotplug for device power state changes

Hi.

Sorry for getting in on this conversion a little late; I've only just  
noticed it.

The usual way in which userspace notification of suspending/resuming is  
handled at the moment is via scripts which are run prior to suspending and  
after resuming. As has been noted, the first thing the kernel side  
implementations does is freeze userspace, keeping things static until post  
resume. This seems to me to be a good, simple model. DHCP releases can be  
handled from user space, prior to echo 4 > /proc/acpi/sleep (or  
alternatives) and the whole difficulty regarding interactions between  
userspace and kernelspace just goes away.

Note too that the actual invocation of a suspend can still be in response  
to kernel events. An ACPI event can be sent to the userspace ACPI daemon,  
which does userspace preparations and then invokes the kernel suspend  
mechanism. After resume, it can also do userspace reinitialisation.

Given this model, I would suggest that hotplug should silently drop any  
events that happen while suspending, and queue events that occur while  
resuming until the kernelspace part of resuming is complete and userspace  
can run as normal. It shouldn't rely upon device suspend/resume  
notifications because they can and do happen while we're still in the  
process of suspending and resuming. The means to detect whether we're  
suspending or resuming or running normally could be implemented as a  
simple function that could test the status of the different suspend  
implementations.

Is that at all helpful?
(Continue reading)

Todd Poynor | 1 May 2004 03:16

Re: [PATCH] Hotplug for device power state changes

Greg KH wrote:
> On Fri, Apr 30, 2004 at 12:59:40PM -0700, Todd Poynor wrote:
> 
>>* Changes to kobject to allow kobject hotplug to optionally be 
>>synchronous if desired.  I'd assume this is a new hotplug_ops field.
> 
> 
> Ick.

Is the objection to using kobject for synchronous hotplug events, or to 
using a hotplug_ops flag to indicate which kind is needed?  Would the 
addition of a kobject_hotplug_sync function be better?  Or a 
handshake-like interface as with firmware downloads?

>>* Synchronous hotplug events for system suspend and resume (without 
>>individual device notifications).  These events can probably be 
>>generated by the kobject hotplug methods by the existing power subsys 
>>(once the above enhancement is in place).
> 
> 
> But why?  Do you really need this?  Have you actually tested a system to
> see if it is needed?

This is something that was requested of me by others who build Linux 
into consumer electronics devices.  Perhaps some of the interested 
parties may speak up here to add more insight.  Among the intended uses 
that I'm aware of are: saving application state to stable storage (for 
example, to be prepared in case the battery dies during an extended 
"suspended" period, and such gadgets often do not have a device suitable 
for a complete system suspend-to-disk), terminating applications that 
(Continue reading)

Greg KH | 1 May 2004 03:48
Gravatar

Re: [PATCH] Hotplug for device power state changes

On Fri, Apr 30, 2004 at 06:16:22PM -0700, Todd Poynor wrote:
> Greg KH wrote:
> >On Fri, Apr 30, 2004 at 12:59:40PM -0700, Todd Poynor wrote:
> >
> >>* Changes to kobject to allow kobject hotplug to optionally be 
> >>synchronous if desired.  I'd assume this is a new hotplug_ops field.
> >
> >
> >Ick.
> 
> Is the objection to using kobject for synchronous hotplug events, or to 
> using a hotplug_ops flag to indicate which kind is needed?  Would the 
> addition of a kobject_hotplug_sync function be better?  Or a 
> handshake-like interface as with firmware downloads?

To add an option to the kobject_hotplug() function for a sync call is
one thing.  To make the option for the main kobject add and remove call
to be sync is a horribly misguided thought (the reason why is left as an
exercise for the reader...like go read the udev code for many reasons
why...)

I don't have an objection to add such a new paramater (or even a new
function call like you suggested), just don't go messing with the main
kobject hotplug call without thinking everything through :)

> >>* Synchronous hotplug events for system suspend and resume (without 
> >>individual device notifications).  These events can probably be 
> >>generated by the kobject hotplug methods by the existing power subsys 
> >>(once the above enhancement is in place).
> >
(Continue reading)

Kevin P. Fleming | 1 May 2004 17:54

raiddetect support for Linux software RAID?

I'm wondering if anyone has planned on putting Linux software RAID (md) 
detection into the raiddetect tool. Currently I use mdadm to scan all 
devices to look for my RAID(s), but it's got some problems:

- it's not hotplug driven, it has to be run over all devices
- it's noisy because it wants to scan everything in /dev
- i can't see what's there without trying to activate it

raiddetect would be a nice addition, I would be able to tell that a 
complete array has appeared and just use mdadm to start it up. Thoughts?

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
Wilfried Weissmann | 1 May 2004 18:31
Picon
Picon

Re: [RFC] [DRAFT] [udev PATCH] First attempt at vendor RAID support in 2.6

Hi,

I just returned from my vacation and checked my emails. That's why the 
response is so late.

Carl-Daniel Hailfinger wrote:
>>>- People checking the numerous FIXMEs
> 
> 
> I now have the following FIXMEs (aka "I have no idea about it"):
> - 5 FIXMEs in the Medley RAID code. Thomas, could you comment once you're
> back?
> - 3 FIXMEs in the Highpoint RAID code. Wilfried, could you please take a
> look at them?

1) FIXME: Does "no array defined" correspond to HPT_T_SINGLEDISK?
I have to check this but I believe it is so.

2) FIXME: Is HPT_T_RAID_01_RAID_1 a value that can ever be found?
I think this is the new style raid-10 format that is supported by hpt374 
and upwards. I do not have such a controller so I cannot verify this.

3) FIXME: what does HPT_MAGIC_BAD mean?
You get this if you pull one disk out of a raid-0 array for example. The 
HPT-BIOS detects that the raid is not operational and marks the array as 
bad (writes the HPT_MAGIC_BAD to the remaining disks).

[snip]

>>>- More data about Medley/Highpoint vendor superblocks (can I check for
(Continue reading)

Kevin P. Fleming | 2 May 2004 02:15

[RFC] udev processing _all_ symlink rules?

I brought this up a week or two ago, and Kay agreed it might be a good 
change, but I don't want it to get lost.

I'd like to see the rule searching loop in namedev.c continue scanning 
through all remaining rules even after is has found a matching NAME 
rule, so that SYMLINK rules for the same device don't have to be located 
earlier in the list. It appears that this is a simple code change: 
instead of "goto found", just set a flag for future passes through the 
loop to ignore any NAME rules that may be found, then exit the loop when 
all rules have been checked.

If you want I'll make up the small patch... it seems to be a pretty safe 
change IMHO, but I could be missing something.

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
Patrick Hornung | 2 May 2004 14:38
Picon
Favicon

alsa sound device configuration within udev

Hello list,

i had switched from devfs to sysfs using hotplug and udev.
Ths was necessary, because i want to identify some different usb storage devices
by plugging them into the computer.

But now my dsp and adsp devices doesnt exist under /dev or any
subdirectory. Only some pcm*, control* and timer devices can be found
within /dev/snd.

Trying to play some sound with 'mpg321 test.mp3 -a /dev/snd/pcmC0D0c'
only ends up with the error message 'libao - OSS cannot set channels to 2'

On the Internet they say that alsa isn't supportet by udev yet, but I
dont know how actual these frases are.

Is it possible to create some rules to get the old dsp and adsp devices
back?

KERNEL="dsp*",          NAME="snd/%k"

or

NUMBER, BUS="pci", ID="0000:00:11.5", NAME="dsp0"

doesn't work...
Who know how to do things right?
My Kernel Version is 2.6.5 with alsa build as modules.
Thanks for your help!

(Continue reading)

Andrew Robinson | 3 May 2004 07:09
Picon

Problem mounting USB external drive

I've got an external drive in a USB 2.0 enclosure that I would like to 
have mounted when I plug it in. I'm running Fedora Core 1. I have 
created an entry in /etc/updfstab.conf that successfully adds an entry 
to the /etc/fstab and creates a mount point in /mnt. I can then mount 
the drive from the CLI. Poking around the Fedora mailing list, the 
answer to automated mounting seemed to lie in the 
/etc/hotplug/usb/usb-storage script. I created the script and verified 
that it was executed. However, updfstab does not seem to get run until 
after usb-storage is completed. Hence, no automatic mount.

My question is this. What is the correct way within the hotplug 
framework to get a hot-plugged drive to mount automatically?

If this is the wrong forum to ask this question, I apologize. Could 
someone point me in the right direction to ask it.

Thanks!

Andrew Robinson

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
David Clemmer | 3 May 2004 15:51
Favicon

fake hotplug questions


Hi all,

I was looking at the fakephp code, and noted that it just refuses to touch
a bridge.  I was wondering if this is because of not wanting to handle
recursively disabling devices behind the bridge, or not having code
available to re-enable them afterwards, or something else I didn't think
of.  (I'm asking because I'd like to fake replugging a bridge.)

I also have a couple of specific questions.  Is there a better way to find
which hotplug_slot is associated with a (pci_dev*) device than walking the
dummy slot list, and looking for one with a matching dev field?  Also, when
re-enabling a device, I'm assuming that storing the hotplug_slot object
(and a copy of the pci_dev object) would be needed, probably along with
something indicative of which bus something was attached to (and,
presumably, a copy of the pci_bus object, for bridges).

The problem I'm having now is that I have a number of cardbus bridges, most
of which are behind a pci2pci bridge.  The ones in front I got working by
setting the p2cclk flag on (per suggestion of David Hinds), and by
disabling IRQs 10 and 11 in the BIOS (there was an IRQ routing conflict
between 9 & 11).  The ones behind the p2p bridge, on the other hand,
recognize very few cards, and don't do anything with the ones that do get
recognized (they never show up with correct info in cardctl ident, and
nothing shows up via lspci).

The one specific sign of a problem that I have is that both the secondary
and subordinate numbers for the p2p bridge show up as 2.  This doesn't
prevent the cardbus bridges behind from being (apparently) correctly
configured (memory, port, and bridge allocations all appear ok).  I've
(Continue reading)

Greg KH | 3 May 2004 07:38
Gravatar

Re: Problem mounting USB external drive

On Mon, May 03, 2004 at 12:09:14AM -0500, Andrew Robinson wrote:
> 
> My question is this. What is the correct way within the hotplug 
> framework to get a hot-plugged drive to mount automatically?

Use something like devlabel.  It should handle it for you just fine.

Good luck,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click

Gmane