Changeset 1629

Show
Ignore:
Timestamp:
04/02/07 19:34:25 (3 years ago)
Author:
laforge
Message:

* resolve mutex deadlock in suspend path
* disable interrupt until we've been scheduled to serve last one
* make sure we cannot disable IOREG, since that powers PCF50606 I2C interface

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/target/kernel/patches/gta01-pcf50606.patch

    r1598 r1629  
    44=================================================================== 
    55--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
    6 +++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c 2007-04-01 13:09:02.000000000 +0200 
    7 @@ -0,0 +1,1896 @@ 
     6+++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c 2007-04-02 19:12:27.000000000 +0200 
     7@@ -0,0 +1,1921 @@ 
    88+/* Philips PCF50606 Power Management Unit (PMU) driver 
    99+ * 
     
    107107+       int allow_close; 
    108108+       int onkey_seconds; 
     109+       int irq; 
    109110+#ifdef CONFIG_PM 
    110111+       struct { 
     
    371372+       if (reg >= __NUM_PCF50606_REGULATORS) 
    372373+               return -EINVAL; 
     374+ 
     375+       /* IOREG cannot be powered off since it powers the PMU I2C */ 
     376+       if (reg == PCF50606_REGULATOR_IOREG) 
     377+               return -EIO; 
    373378+ 
    374379+       addr = regulator_registers[reg]; 
     
    732737+       input_sync(pcf->input_dev); 
    733738+       put_device(&pcf->client.dev); 
     739+ 
     740+       enable_irq(pcf->irq); 
    734741+} 
    735742+ 
     
    752759+               irq, _pcf); 
    753760+       pcf50606_schedule_work(pcf); 
     761+ 
     762+       /* Disable any further interrupts until we have processed 
     763+        * the current one */ 
     764+       disable_irq(irq); 
    754765+ 
    755766+       return IRQ_HANDLED; 
     
    15771588+       mutex_init(&data->lock); 
    15781589+       INIT_WORK(&data->work, pcf50606_work); 
     1590+       data->irq = irq; 
    15791591+       data->working = 0; 
    15801592+       data->onkey_seconds = -1; 
     
    17931805+       /* switch off power supplies that are not needed during suspend */ 
    17941806+       for (i = 0; i < __NUM_PCF50606_REGULATORS; i++) { 
    1795 +               if (!(pcf->pdata->rails[i].flags & PMU_VRAIL_F_SUSPEND_ON)) 
    1796 +                       pcf50606_onoff_set(pcf, i, 0); 
     1807+               if (!(pcf->pdata->rails[i].flags & PMU_VRAIL_F_SUSPEND_ON)) { 
     1808+                       u_int8_t tmp; 
     1809+ 
     1810+                       /* IOREG powers the I@C interface so we cannot switch 
     1811+                        * it off */ 
     1812+                       if (i == PCF50606_REGULATOR_IOREG) 
     1813+                               continue; 
     1814+ 
     1815+                       DEBUGP("disabling pcf50606 regulator %u\n", i); 
     1816+                       /* we cannot use pcf50606_onoff_set() because we're 
     1817+                        * already under the mutex */ 
     1818+                       tmp = __reg_read(pcf, regulator_registers[i]); 
     1819+                       tmp &= 0x1f; 
     1820+                       __reg_write(pcf, regulator_registers[i], tmp); 
     1821+               } 
    17971822+       } 
    17981823+