Re: [patch 1/2] Enable link power management for ata drivers

2007-10-24 Thread Jeff Garzik
applied as the attached two patches to jgarzik/libata-dev.git#alpm open issues: 1) need to check ata_dev_set_feature() return value in ata_dev_set_dipm() and do something useful with it 2) as the name implies, this probably better belongs in ata_link. 3) however, the feature is tightly

Re: [patch 1/2] Enable link power management for ata drivers

2007-10-24 Thread Jeff Garzik
applied as the attached two patches to jgarzik/libata-dev.git#alpm open issues: 1) need to check ata_dev_set_feature() return value in ata_dev_set_dipm() and do something useful with it 2) as the name implies, this probably better belongs in ata_link. 3) however, the feature is tightly

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-25 Thread Jeff Garzik
Alan Cox wrote: It converts several macros to inline functions (encouraged), and also illustrates a nice, clean way of testing an ID word's validity. [obviously the final implementation varies, depending on that ID word's history] Its in -mm and I thought you put a copy in your tree after I

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-25 Thread Alan Cox
> It converts several macros to inline functions (encouraged), and also > illustrates a nice, clean way of testing an ID word's validity. > [obviously the final implementation varies, depending on that ID word's > history] Its in -mm and I thought you put a copy in your tree after I said it

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-25 Thread Alan Cox
It converts several macros to inline functions (encouraged), and also illustrates a nice, clean way of testing an ID word's validity. [obviously the final implementation varies, depending on that ID word's history] Its in -mm and I thought you put a copy in your tree after I said it hadn't

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-25 Thread Jeff Garzik
Alan Cox wrote: It converts several macros to inline functions (encouraged), and also illustrates a nice, clean way of testing an ID word's validity. [obviously the final implementation varies, depending on that ID word's history] Its in -mm and I thought you put a copy in your tree after I

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread roel
Davide Libenzi wrote: > On Tue, 25 Sep 2007, roel wrote: > >>> + if (!(ap->flags & ATA_FLAG_IPM) || !ata_dev_enabled(dev)) { >> if (!((ap->flags & ATA_FLAG_IPM) && ata_dev_enabled(dev))) { > > int foo(int i, int j) { > > return !(i & 8) || !j; > } > > int moo(int i, int

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread Jeff Garzik
Kristen Carlson Accardi wrote: On Tue, 25 Sep 2007 01:12:32 +0200 roel <[EMAIL PROTECTED]> wrote: #define ata_id_cdb_intr(id)(((id)[0] & 0x60) == 0x20) +#define ata_id_has_hipm(id)\ + ( (((id)[76] != 0x) && ((id)[76] != 0x)) && \ + ((id)[76] & (1 << 9)) )

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread Kristen Carlson Accardi
On Tue, 25 Sep 2007 01:12:32 +0200 roel <[EMAIL PROTECTED]> wrote: > > #define ata_id_cdb_intr(id)(((id)[0] & 0x60) == 0x20) > > +#define ata_id_has_hipm(id)\ > > + ( (((id)[76] != 0x) && ((id)[76] != 0x)) && \ > > + ((id)[76] & (1 << 9)) ) > ^ >

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread Davide Libenzi
On Tue, 25 Sep 2007, roel wrote: > > + if (!(ap->flags & ATA_FLAG_IPM) || !ata_dev_enabled(dev)) { > > if (!((ap->flags & ATA_FLAG_IPM) && ata_dev_enabled(dev))) { int foo(int i, int j) { return !(i & 8) || !j; } int moo(int i, int j) { return !((i &

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread roel
Kristen Carlson Accardi wrote: > Device Initiated Power Management, which is defined > in SATA 2.5 can be enabled for disks which support it. > This patch enables DIPM when the user sets the link > power management policy to "min_power". > > Additionally, libata drivers can define a function >

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread roel
Kristen Carlson Accardi wrote: Device Initiated Power Management, which is defined in SATA 2.5 can be enabled for disks which support it. This patch enables DIPM when the user sets the link power management policy to min_power. Additionally, libata drivers can define a function

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread Davide Libenzi
On Tue, 25 Sep 2007, roel wrote: + if (!(ap-flags ATA_FLAG_IPM) || !ata_dev_enabled(dev)) { if (!((ap-flags ATA_FLAG_IPM) ata_dev_enabled(dev))) { int foo(int i, int j) { return !(i 8) || !j; } int moo(int i, int j) { return !((i 8) j); }

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread Kristen Carlson Accardi
On Tue, 25 Sep 2007 01:12:32 +0200 roel [EMAIL PROTECTED] wrote: #define ata_id_cdb_intr(id)(((id)[0] 0x60) == 0x20) +#define ata_id_has_hipm(id)\ + ( (((id)[76] != 0x) ((id)[76] != 0x)) \ + ((id)[76] (1 9)) ) ^ | are you

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread Jeff Garzik
Kristen Carlson Accardi wrote: On Tue, 25 Sep 2007 01:12:32 +0200 roel [EMAIL PROTECTED] wrote: #define ata_id_cdb_intr(id)(((id)[0] 0x60) == 0x20) +#define ata_id_has_hipm(id)\ + ( (((id)[76] != 0x) ((id)[76] != 0x)) \ + ((id)[76] (1 9)) )

Re: [patch 1/2] Enable link power management for ata drivers

2007-09-24 Thread roel
Davide Libenzi wrote: On Tue, 25 Sep 2007, roel wrote: + if (!(ap-flags ATA_FLAG_IPM) || !ata_dev_enabled(dev)) { if (!((ap-flags ATA_FLAG_IPM) ata_dev_enabled(dev))) { int foo(int i, int j) { return !(i 8) || !j; } int moo(int i, int j) {