Udev rule not working

I am trying to set power control of ahci port to auto using the following rule :

SUBSYSTEM=="ata_port", KERNEL=="ata*", ATTR{power/control}=="auto"

But it is not working.

sudo udevadm info -a /sys/class/ata_port/ata1

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:08.2/0000:05:00.0/ata1/ata_port/ata1':
    KERNEL=="ata1"
    SUBSYSTEM=="ata_port"
    DRIVER==""
    ATTR{idle_irq}=="0"
    ATTR{nr_pmp_links}=="0"
    ATTR{port_no}=="1"
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"

You should use β€œ=” to assign a value, not β€œ==”.

Even after correcting the error, it still does not work.

The attribute you want to change is actually device/power/control not power/control so you want a rule like:

SUBSYSTEM=="ata_port", KERNEL=="ata*", ATTR{device/power/control}="auto"
1 Like