1. 10 2月, 2012 2 次提交
    • R
      ARM: omap: fix broken twl-core dependencies and ifdefs · 6252547b
      Russell King 提交于
      In commit aeb5032b, a dependency on IRQ_DOMAIN was added, which causes
      regressions on previously working setups: a previously working non-DT
      kernel configuration now loses its PMIC support.  The lack of PMIC
      support in turn causes the loss of other functionality the kernel had.
      
      This dependency was added because the driver now registers its
      interrupts with the IRQ domain code, presumably to prevent a build error.
      
      The result is that OMAP3 oopses in the vp.c code (fixed by a previous
      commit) due to the lack of PMIC support.
      
      However, even with IRQ_DOMAIN enabled, the driver oopses:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = c0004000
      [00000000] *pgd=00000000
      Internal error: Oops: 5 [#1] SMP
      Modules linked in:
      CPU: 1    Not tainted  (3.3.0-rc2+ #271)
      PC is at irq_domain_add+0x1c/0x134
      LR is at twl_probe+0xd0/0x370
      pc : [<c007bad0>]    lr : [<c029baac>]    psr: 00000113
      sp : df843c48  ip : df843c68  fp : df843c64
      r10: c02b93e4  r9 : 00000000  r8 : c029b9dc
      r7 : df9d8a00  r6 : c03bef90  r5 : 00000000  r4 : c03f5240
      r3 : 00000000  r2 : c03f5240  r1 : 00000015  r0 : c03f5240
      Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5387d  Table: 8000404a  DAC: 00000015
      Process swapper/0 (pid: 1, stack limit = 0xdf8422f0)
      Stack: (0xdf843c48 to 0xdf844000)
      3c40:                   00000014 00000170 00000014 c03bef90 df843c9c df843c68
      3c60: c029baac c007bac0 00000000 df9d8a20 00000001 c03cd238 c02b93e4 df9d8a20
      3c80: df9d8a04 df9d8a00 c029b9dc df8cae08 df843cc4 df843ca0 c01eee70 c029b9e8
      ...
      Backtrace:
      [<c007bab4>] (irq_domain_add+0x0/0x134) from [<c029baac>] (twl_probe+0xd0/0x370)
       r6:c03bef90 r5:00000014 r4:00000170
      [<c029b9dc>] (twl_probe+0x0/0x370) from [<c01eee70>] (i2c_device_probe+0xb0/0xe4)
      [<c01eedc0>] (i2c_device_probe+0x0/0xe4) from [<c01d1f34>] (really_probe+0xa0/0x178)
       r8:df8f0070 r7:c03cd238 r6:df9d8a20 r5:df9d8a20 r4:df9d8a20
      [<c01d1e94>] (really_probe+0x0/0x178) from [<c01d205c>] (driver_probe_device+0x50/0x68)
       r7:df843d18 r6:df9d8a20 r5:c03cd238 r4:df9d8a20
      [<c01d200c>] (driver_probe_device+0x0/0x68) from [<c01d2148>] (__device_attach+0x44/0x48)
       r5:df9d8a20 r4:c03cd238
      [<c01d2104>] (__device_attach+0x0/0x48) from [<c01d0840>] (bus_for_each_drv+0x58/0x98)
       r5:c01d2104 r4:00000000
      [<c01d07e8>] (bus_for_each_drv+0x0/0x98) from [<c01d21f8>] (device_attach+0x80/0xac)
       r7:df9d8a28 r6:df9d8a54 r5:c03cd978 r4:df9d8a20
      [<c01d2178>] (device_attach+0x0/0xac) from [<c01d1430>] (bus_probe_device+0x34/0xa4)
       r6:df9d8a20 r5:c03cd978 r4:df9d8a20
      [<c01d13fc>] (bus_probe_device+0x0/0xa4) from [<c01cffb0>] (device_add+0x2a0/0x420)
       r6:00000000 r5:df9d8a20 r4:df9d8a20
      [<c01cfd10>] (device_add+0x0/0x420) from [<c01d0150>] (device_register+0x20/0x24)
       r8:df9d8a00 r7:df9d8a04 r6:df8f0048 r5:df9d8a00 r4:df9d8a20
      [<c01d0130>] (device_register+0x0/0x24) from [<c01ef8d4>] (i2c_new_device+0x118/0x180)
       r4:df9d8a20
      [<c01ef7bc>] (i2c_new_device+0x0/0x180) from [<c01efc88>] (i2c_register_adapter+0x140/0x204)
       r8:c03cd970 r7:00000000 r6:df8f0070 r5:df8a6300 r4:df8f0048
      [<c01efb48>] (i2c_register_adapter+0x0/0x204) from [<c01efe9c>] (i2c_add_numbered_adapter+0xb4/0xcc)
       r8:df8a4c54 r7:df8cae00 r6:df843e2c r5:df8f0048 r4:00000000
      [<c01efde8>] (i2c_add_numbered_adapter+0x0/0xcc) from [<c029ce1c>] (omap_i2c_probe+0x2f8/0x3b4)
       r6:00000000 r5:df8f0000 r4:df8f0070
      [<c029cb24>] (omap_i2c_probe+0x0/0x3b4) from [<c01d3484>] (platform_drv_probe+0x20/0x24)
      [<c01d3464>] (platform_drv_probe+0x0/0x24) from [<c01d1f34>] (really_probe+0xa0/0x178)
      [<c01d1e94>] (really_probe+0x0/0x178) from [<c01d205c>] (driver_probe_device+0x50/0x68)
       r7:df843ef0 r6:c03cdb2c r5:c03cdb2c r4:df8cae08
      [<c01d200c>] (driver_probe_device+0x0/0x68) from [<c01d20e0>] (__driver_attach+0x6c/0x90)
       r5:df8cae3c r4:df8cae08
      [<c01d2074>] (__driver_attach+0x0/0x90) from [<c01d08d8>] (bus_for_each_dev+0x58/0x98)
       r6:c03cdb2c r5:c01d2074 r4:00000000
      [<c01d0880>] (bus_for_each_dev+0x0/0x98) from [<c01d1d80>] (driver_attach+0x20/0x28)
       r7:df880b80 r6:c03cdb2c r5:c03cdb2c r4:c0394f28
      [<c01d1d60>] (driver_attach+0x0/0x28) from [<c01d115c>] (bus_add_driver+0xb4/0x230)
      [<c01d10a8>] (bus_add_driver+0x0/0x230) from [<c01d278c>] (driver_register+0xc8/0x154)
      [<c01d26c4>] (driver_register+0x0/0x154) from [<c01d37e4>] (platform_driver_register+0x4c/0x60)
       r8:00000000 r7:00000013 r6:c00384c8 r5:c0395180 r4:c0394f28
      [<c01d3798>] (platform_driver_register+0x0/0x60) from [<c038626c>] (omap_i2c_init_driver+0x14/0x1c)
      [<c0386258>] (omap_i2c_init_driver+0x0/0x1c) from [<c00087b8>] (do_one_initcall+0x9c/0x164)
      [<c000871c>] (do_one_initcall+0x0/0x164) from [<c036c2f4>] (kernel_init+0x90/0x138)
      [<c036c264>] (kernel_init+0x0/0x138) from [<c00384c8>] (do_exit+0x0/0x2ec)
       r5:c036c264 r4:00000000
      <0>Code: e24dd004 e5903014 e1a04000 e5905010 (e5933000)
      <4>---[ end trace 1b75b31a2719ed1c ]---
      
      This happens because we try to register an IRQ domain with a NULL ops
      structure, and the first thing irq_domain_add() does is try to
      dereference this ops structure.
      
      So, fix the problem by getting rid of the incorrect OF_IRQ ifdef and
      wrapping the IRQ domain bits of the driver with an IRQ_DOMAIN ifdef
      instead.
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6252547b
    • R
      ARM: omap: fix oops in drivers/video/omap2/dss/dpi.c · 40410715
      Russell King 提交于
      When a PMIC is not found, this driver is unable to obtain its
      'vdds_dsi_reg' regulator.  Even through its initialization function
      fails, other code still calls its enable function, which fails to
      check whether it has this regulator before asking for it to be enabled.
      
      This fixes the oops, however a better fix would be to sort out the
      upper layers to prevent them calling into a module which failed to
      initialize.
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000038
      pgd = c0004000
      [00000038] *pgd=00000000
      Internal error: Oops: 5 [#1] PREEMPT
      Modules linked in:
      CPU: 0    Not tainted  (3.3.0-rc2+ #228)
      PC is at regulator_enable+0x10/0x70
      LR is at omapdss_dpi_display_enable+0x54/0x15c
      pc : [<c01b9a08>]    lr : [<c01af994>]    psr: 60000013
      sp : c181fd90  ip : c181fdb0  fp : c181fdac
      r10: c042eff0  r9 : 00000060  r8 : c044a164
      r7 : c042c0e4  r6 : c042bd60  r5 : 00000000  r4 : c042bd60
      r3 : c084de48  r2 : c181e000  r1 : c042bd60  r0 : 00000000
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5387d  Table: 80004019  DAC: 00000015
      Process swapper (pid: 1, stack limit = 0xc181e2e8)
      Stack: (0xc181fd90 to 0xc1820000)
      fd80:                                     c001754c c042bd60 00000000 c042bd60
      fda0: c181fdcc c181fdb0 c01af994 c01b9a04 c0016104 c042bd60 c042bd60 c044a338
      fdc0: c181fdec c181fdd0 c01b5ed0 c01af94c c042bd60 c042bd60 c1aa8000 c1aa8a0c
      fde0: c181fe04 c181fdf0 c01b5f54 c01b5ea8 c02fc18c c042bd60 c181fe3c c181fe08
      fe00: c01b2a18 c01b5f48 c01aed14 c02fc160 c01df8ec 00000002 c042bd60 00000003
      fe20: c042bd60 c1aa8000 c1aa8a0c c042eff8 c181fe84 c181fe40 c01b3874 c01b29fc
      fe40: c042eff8 00000000 c042f000 c0449db8 c044ed78 00000000 c181fe74 c042eff8
      fe60: c042eff8 c0449db8 c0449db8 c044ed78 00000000 00000000 c181fe94 c181fe88
      fe80: c01e452c c01b35e8 c181feb4 c181fe98 c01e2fdc c01e4518 c042eff8 c0449db8
      fea0: c0449db8 c181fef0 c181fecc c181feb8 c01e3104 c01e2f48 c042eff8 c042f02c
      fec0: c181feec c181fed0 c01e3190 c01e30c0 c01e311c 00000000 c01e311c c0449db8
      fee0: c181ff14 c181fef0 c01e1998 c01e3128 c18330a8 c1892290 c04165e8 c0449db8
      ff00: c0449db8 c1ab60c0 c181ff24 c181ff18 c01e2e28 c01e194c c181ff54 c181ff28
      ff20: c01e2218 c01e2e14 c039afed c181ff38 c04165e8 c041660c c0449db8 00000013
      ff40: 00000000 c03ffdb8 c181ff7c c181ff58 c01e384c c01e217c c181ff7c c04165e8
      ff60: c041660c c003a37c 00000013 00000000 c181ff8c c181ff80 c01e488c c01e3790
      ff80: c181ff9c c181ff90 c03ffdcc c01e484c c181ffdc c181ffa0 c0008798 c03ffdc4
      ffa0: c181ffc4 c181ffb0 c0056440 c0187810 c003a37c c04165e8 c041660c c003a37c
      ffc0: 00000013 00000000 00000000 00000000 c181fff4 c181ffe0 c03ea284 c0008708
      ffe0: 00000000 c03ea208 00000000 c181fff8 c003a37c c03ea214 1073cec0 01f7ee08
      Backtrace:
      [<c01b99f8>] (regulator_enable+0x0/0x70) from [<c01af994>] (omapdss_dpi_display_enable+0x54/0x15c)
       r6:c042bd60 r5:00000000 r4:c042bd60
      [<c01af940>] (omapdss_dpi_display_enable+0x0/0x15c) from [<c01b5ed0>] (generic_dpi_panel_power_on+0x34/0x78)
       r6:c044a338 r5:c042bd60 r4:c042bd60
      [<c01b5e9c>] (generic_dpi_panel_power_on+0x0/0x78) from [<c01b5f54>] (generic_dpi_panel_enable+0x18/0x28)
       r7:c1aa8a0c r6:c1aa8000 r5:c042bd60 r4:c042bd60
      [<c01b5f3c>] (generic_dpi_panel_enable+0x0/0x28) from [<c01b2a18>] (omapfb_init_display+0x28/0x150)
       r4:c042bd60
      [<c01b29f0>] (omapfb_init_display+0x0/0x150) from [<c01b3874>] (omapfb_probe+0x298/0x318)
       r8:c042eff8 r7:c1aa8a0c r6:c1aa8000 r5:c042bd60 r4:00000003
      [<c01b35dc>] (omapfb_probe+0x0/0x318) from [<c01e452c>] (platform_drv_probe+0x20/0x24)
      [<c01e450c>] (platform_drv_probe+0x0/0x24) from [<c01e2fdc>] (really_probe+0xa0/0x178)
      [<c01e2f3c>] (really_probe+0x0/0x178) from [<c01e3104>] (driver_probe_device+0x50/0x68)
       r7:c181fef0 r6:c0449db8 r5:c0449db8 r4:c042eff8
      [<c01e30b4>] (driver_probe_device+0x0/0x68) from [<c01e3190>] (__driver_attach+0x74/0x98)
       r5:c042f02c r4:c042eff8
      [<c01e311c>] (__driver_attach+0x0/0x98) from [<c01e1998>] (bus_for_each_dev+0x58/0x98)
       r6:c0449db8 r5:c01e311c r4:00000000
      [<c01e1940>] (bus_for_each_dev+0x0/0x98) from [<c01e2e28>] (driver_attach+0x20/0x28)
       r7:c1ab60c0 r6:c0449db8 r5:c0449db8 r4:c04165e8
      [<c01e2e08>] (driver_attach+0x0/0x28) from [<c01e2218>] (bus_add_driver+0xa8/0x22c)
      [<c01e2170>] (bus_add_driver+0x0/0x22c) from [<c01e384c>] (driver_register+0xc8/0x154)
      [<c01e3784>] (driver_register+0x0/0x154) from [<c01e488c>] (platform_driver_register+0x4c/0x60)
       r8:00000000 r7:00000013 r6:c003a37c r5:c041660c r4:c04165e8
      [<c01e4840>] (platform_driver_register+0x0/0x60) from [<c03ffdcc>] (omapfb_init+0x14/0x34)
      [<c03ffdb8>] (omapfb_init+0x0/0x34) from [<c0008798>] (do_one_initcall+0x9c/0x164)
      [<c00086fc>] (do_one_initcall+0x0/0x164) from [<c03ea284>] (kernel_init+0x7c/0x120)
      [<c03ea208>] (kernel_init+0x0/0x120) from [<c003a37c>] (do_exit+0x0/0x2d8)
       r5:c03ea208 r4:00000000
      Code: e1a0c00d e92dd870 e24cb004 e24dd004 (e5906038)
      ---[ end trace 9e2474c2e193b223 ]---
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      40410715
  2. 09 2月, 2012 2 次提交
    • R
      pcmcia: fix socket refcount decrementing on each resume · 025e4ab3
      Russell King 提交于
      This fixes a memory-corrupting bug: not only does it cause the warning,
      but as a result of dropping the refcount to zero, it causes the
      pcmcia_socket0 device structure to be freed while it still has
      references, causing slab caches corruption.  A fatal oops quickly
      follows this warning - often even just a 'dmesg' following the warning
      causes the kernel to oops.
      
      While testing suspend/resume on an ARM device with PCMCIA support, and a
      CF card inserted, I found that after five suspend and resumes, the
      kernel would complain, and shortly die after with slab corruption.
      
        WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50()
      
      As the message doesn't give a clue about which kobject, and the built-in
      debugging in drivers/base/power/main.c happens too late, this was added
      right before each get_device():
      
        printk("%s: %p [%s] %u\n", __func__, dev, kobject_name(&dev->kobj), atomic_read(&dev->kobj.kref.refcount));
      
      and on the 3rd s2ram cycle, the following behaviour observed:
      
      On the 3rd suspend/resume cycle:
      
        dpm_prepare: c1a0d998 [pcmcia_socket0] 3
        dpm_suspend: c1a0d998 [pcmcia_socket0] 3
        dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 3
        dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 3
        dpm_resume: c1a0d998 [pcmcia_socket0] 3
        dpm_complete: c1a0d998 [pcmcia_socket0] 2
      
      4th:
      
        dpm_prepare: c1a0d998 [pcmcia_socket0] 2
        dpm_suspend: c1a0d998 [pcmcia_socket0] 2
        dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 2
        dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 2
        dpm_resume: c1a0d998 [pcmcia_socket0] 2
        dpm_complete: c1a0d998 [pcmcia_socket0] 1
      
      5th:
      
        dpm_prepare: c1a0d998 [pcmcia_socket0] 1
        dpm_suspend: c1a0d998 [pcmcia_socket0] 1
        dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 1
        dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 1
        dpm_resume: c1a0d998 [pcmcia_socket0] 1
        dpm_complete: c1a0d998 [pcmcia_socket0] 0
        ------------[ cut here ]------------
        WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50()
        Modules linked in: ucb1x00_core
        Backtrace:
        [<c0212090>] (dump_backtrace+0x0/0x110) from [<c04799dc>] (dump_stack+0x18/0x1c)
        [<c04799c4>] (dump_stack+0x0/0x1c) from [<c021cba0>] (warn_slowpath_common+0x50/0x68)
        [<c021cb50>] (warn_slowpath_common+0x0/0x68) from [<c021cbdc>] (warn_slowpath_null+0x24/0x28)
        [<c021cbb8>] (warn_slowpath_null+0x0/0x28) from [<c0335374>] (kobject_get+0x28/0x50)
        [<c033534c>] (kobject_get+0x0/0x50) from [<c03804f4>] (get_device+0x1c/0x24)
        [<c0388c90>] (dpm_complete+0x0/0x1a0) from [<c0389cc0>] (dpm_resume_end+0x1c/0x20)
        ...
      
      Looking at commit 7b24e798 ("pcmcia: split up central event handler"),
      the following change was made to cs.c:
      
                      return 0;
              }
       #endif
      -
      -       send_event(skt, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW);
      +       if (!(skt->state & SOCKET_CARDBUS) && (skt->callback))
      +               skt->callback->early_resume(skt);
              return 0;
       }
      
      And the corresponding change in ds.c is from:
      
      -static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
      -{
      -       struct pcmcia_socket *s = pcmcia_get_socket(skt);
      ...
      -       switch (event) {
      ...
      -       case CS_EVENT_PM_RESUME:
      -               if (verify_cis_cache(skt) != 0) {
      -                       dev_dbg(&skt->dev, "cis mismatch - different card\n");
      -                       /* first, remove the card */
      -                       ds_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH);
      -                       mutex_lock(&s->ops_mutex);
      -                       destroy_cis_cache(skt);
      -                       kfree(skt->fake_cis);
      -                       skt->fake_cis = NULL;
      -                       s->functions = 0;
      -                       mutex_unlock(&s->ops_mutex);
      -                       /* now, add the new card */
      -                       ds_event(skt, CS_EVENT_CARD_INSERTION,
      -                                CS_EVENT_PRI_LOW);
      -               }
      -               break;
      ...
      -    }
      
      -    pcmcia_put_socket(s);
      
      -    return 0;
      -} /* ds_event */
      
      to:
      
      +static int pcmcia_bus_early_resume(struct pcmcia_socket *skt)
      +{
      +       if (!verify_cis_cache(skt)) {
      +               pcmcia_put_socket(skt);
      +               return 0;
      +       }
      
      +       dev_dbg(&skt->dev, "cis mismatch - different card\n");
      
      +       /* first, remove the card */
      +       pcmcia_bus_remove(skt);
      +       mutex_lock(&skt->ops_mutex);
      +       destroy_cis_cache(skt);
      +       kfree(skt->fake_cis);
      +       skt->fake_cis = NULL;
      +       skt->functions = 0;
      +       mutex_unlock(&skt->ops_mutex);
      
      +       /* now, add the new card */
      +       pcmcia_bus_add(skt);
      +       return 0;
      +}
      
      As can be seen, the original function called pcmcia_get_socket() and
      pcmcia_put_socket() around the guts, whereas the replacement code
      calls pcmcia_put_socket() only in one path.  This creates an imbalance
      in the refcounting.
      
      Testing with pcmcia_put_socket() put removed shows that the bug is gone:
      
        dpm_suspend: c1a10998 [pcmcia_socket0] 5
        dpm_suspend_noirq: c1a10998 [pcmcia_socket0] 5
        dpm_resume_noirq: c1a10998 [pcmcia_socket0] 5
        dpm_resume: c1a10998 [pcmcia_socket0] 5
        dpm_complete: c1a10998 [pcmcia_socket0] 5
      Tested-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      025e4ab3
    • A
      drivers/leds/leds-lm3530.c: fix setting pltfm->als_vmax · ec44fd42
      Axel Lin 提交于
      In current code, pltfm->als_vmin is set to LM3530_ALS_WINDOW_mV and
      pltfm->als_vmax is 0.  This does not make sense.  I think what we want
      here is setting pltfm->als_vmax to LM3530_ALS_WINDOW_mV.
      
      Both als_vmin and als_vmax local variables will be set to
      pltfm->als_vmin and pltfm->als_vmax by a few lines latter.  Thus also
      remove a redundant assignment for als_vmin and als_vmax in this patch.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Cc: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
      Acked-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Tested-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ec44fd42
  3. 08 2月, 2012 1 次提交
  4. 07 2月, 2012 12 次提交
  5. 06 2月, 2012 3 次提交
  6. 05 2月, 2012 1 次提交
  7. 04 2月, 2012 6 次提交
  8. 03 2月, 2012 6 次提交
  9. 02 2月, 2012 7 次提交
    • I
      drm/radeon/kms/blit: fix blit copy for very large buffers · 52b53a0b
      Ilija Hadzic 提交于
      Evergreen and NI blit copy was broken if the buffer maps to a rectangle
      whose one dimension is 16384 (max dimension allowed by these chips).
      In the mainline kernel, the problem is exposed only when buffers are
      very large (1G), but it's still a problem. The problem could be exposed
      for smaller buffers if anyone modifies the algorithm for rectangle
      construction in r600_blit_create_rect() (the reason why someone would
      modify that algorithm is to tune the performance of buffer moves).
      
      The root cause was in i2f() function which only operated on range between
      0 and 16383. Fix this by extending the range of i2f() function to 0 to
      32767.
      
      While at it improve the function so that the range can be easily
      extended in the future (if it becomes necessary), cleanup lines
      over 80 characters, and replace in-line comments with one strategic
      comment that explains the crux of the function.
      
      Credits to michel@daenzer.net for pointing out the root cause of
      the bug.
      
      v2: Fix I2F_MAX_INPUT constant definition goof and warn only once
          if input argument is out of range. Edit the comment a little
          bit to avoid some linguistic confusion and make it look better
          in general.
      Signed-off-by: NIlija Hadzic <ihadzic@research.bell-labs.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NMichel Dänzer <michel@daenzer.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      52b53a0b
    • A
      drm/radeon/kms: fix TRAVIS panel setup · 304a4840
      Alex Deucher 提交于
      Different versions of the DP to LVDS bridge chip
      need different panel mode settings depending on
      the chip version used.
      
      Fixes:
      https://bugs.freedesktop.org/show_bug.cgi?id=41569Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      304a4840
    • D
      drm/radeon: fix use after free in ATRM bios reading code. · de47a9cd
      Dave Airlie 提交于
      Fixes:
      https://bugs.freedesktop.org/show_bug.cgi?id=45503
      
      Reported-and-Debugged-by: mlambda@gmail.com
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      de47a9cd
    • K
      HID: hyperv: Properly disconnect the input device · c1c454b8
      K. Y. Srinivasan 提交于
      When we unload the mouse driver, properly disconnect the input device.
      Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Reported-by: NFuzhou Chen <fuzhouch@microsoft.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      c1c454b8
    • M
      HID: usbhid: fix dead lock between open and disconect · ba18311d
      Ming Lei 提交于
      There is no reason to hold hiddev->existancelock before
      calling usb_deregister_dev, so move it out of the lock.
      
      The patch fixes the lockdep warning below.
      
      [ 5733.386271] ======================================================
      [ 5733.386274] [ INFO: possible circular locking dependency detected ]
      [ 5733.386278] 3.2.0-custom-next-20120111+ #1 Not tainted
      [ 5733.386281] -------------------------------------------------------
      [ 5733.386284] khubd/186 is trying to acquire lock:
      [ 5733.386288]  (minor_rwsem){++++.+}, at: [<ffffffffa0011a04>] usb_deregister_dev+0x37/0x9e [usbcore]
      [ 5733.386311]
      [ 5733.386312] but task is already holding lock:
      [ 5733.386315]  (&hiddev->existancelock){+.+...}, at: [<ffffffffa0094d17>] hiddev_disconnect+0x26/0x87 [usbhid]
      [ 5733.386328]
      [ 5733.386329] which lock already depends on the new lock.
      [ 5733.386330]
      [ 5733.386333]
      [ 5733.386334] the existing dependency chain (in reverse order) is:
      [ 5733.386336]
      [ 5733.386337] -> #1 (&hiddev->existancelock){+.+...}:
      [ 5733.386346]        [<ffffffff81082d26>] lock_acquire+0xcb/0x10e
      [ 5733.386357]        [<ffffffff813df961>] __mutex_lock_common+0x60/0x465
      [ 5733.386366]        [<ffffffff813dfe4d>] mutex_lock_nested+0x36/0x3b
      [ 5733.386371]        [<ffffffffa0094ad6>] hiddev_open+0x113/0x193 [usbhid]
      [ 5733.386378]        [<ffffffffa0011971>] usb_open+0x66/0xc2 [usbcore]
      [ 5733.386390]        [<ffffffff8111a8b5>] chrdev_open+0x12b/0x154
      [ 5733.386402]        [<ffffffff811159a8>] __dentry_open.isra.16+0x20b/0x355
      [ 5733.386408]        [<ffffffff811165dc>] nameidata_to_filp+0x43/0x4a
      [ 5733.386413]        [<ffffffff81122ed5>] do_last+0x536/0x570
      [ 5733.386419]        [<ffffffff8112300b>] path_openat+0xce/0x301
      [ 5733.386423]        [<ffffffff81123327>] do_filp_open+0x33/0x81
      [ 5733.386427]        [<ffffffff8111664d>] do_sys_open+0x6a/0xfc
      [ 5733.386431]        [<ffffffff811166fb>] sys_open+0x1c/0x1e
      [ 5733.386434]        [<ffffffff813e7c79>] system_call_fastpath+0x16/0x1b
      [ 5733.386441]
      [ 5733.386441] -> #0 (minor_rwsem){++++.+}:
      [ 5733.386448]        [<ffffffff8108255d>] __lock_acquire+0xa80/0xd74
      [ 5733.386454]        [<ffffffff81082d26>] lock_acquire+0xcb/0x10e
      [ 5733.386458]        [<ffffffff813e01f5>] down_write+0x44/0x77
      [ 5733.386464]        [<ffffffffa0011a04>] usb_deregister_dev+0x37/0x9e [usbcore]
      [ 5733.386475]        [<ffffffffa0094d2d>] hiddev_disconnect+0x3c/0x87 [usbhid]
      [ 5733.386483]        [<ffffffff8132df51>] hid_disconnect+0x3f/0x54
      [ 5733.386491]        [<ffffffff8132dfb4>] hid_device_remove+0x4e/0x7a
      [ 5733.386496]        [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
      [ 5733.386502]        [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
      [ 5733.386507]        [<ffffffff812c0564>] bus_remove_device+0x114/0x128
      [ 5733.386512]        [<ffffffff812bdd6f>] device_del+0x131/0x183
      [ 5733.386519]        [<ffffffff8132def3>] hid_destroy_device+0x1e/0x3d
      [ 5733.386525]        [<ffffffffa00916b0>] usbhid_disconnect+0x36/0x42 [usbhid]
      [ 5733.386530]        [<ffffffffa000fb60>] usb_unbind_interface+0x57/0x11f [usbcore]
      [ 5733.386542]        [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
      [ 5733.386547]        [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
      [ 5733.386552]        [<ffffffff812c0564>] bus_remove_device+0x114/0x128
      [ 5733.386557]        [<ffffffff812bdd6f>] device_del+0x131/0x183
      [ 5733.386562]        [<ffffffffa000de61>] usb_disable_device+0xa8/0x1d8 [usbcore]
      [ 5733.386573]        [<ffffffffa0006bd2>] usb_disconnect+0xab/0x11f [usbcore]
      [ 5733.386583]        [<ffffffffa0008aa0>] hub_thread+0x73b/0x1157 [usbcore]
      [ 5733.386593]        [<ffffffff8105dc0f>] kthread+0x95/0x9d
      [ 5733.386601]        [<ffffffff813e90b4>] kernel_thread_helper+0x4/0x10
      [ 5733.386607]
      [ 5733.386608] other info that might help us debug this:
      [ 5733.386609]
      [ 5733.386612]  Possible unsafe locking scenario:
      [ 5733.386613]
      [ 5733.386615]        CPU0                    CPU1
      [ 5733.386618]        ----                    ----
      [ 5733.386620]   lock(&hiddev->existancelock);
      [ 5733.386625]                                lock(minor_rwsem);
      [ 5733.386630]                                lock(&hiddev->existancelock);
      [ 5733.386635]   lock(minor_rwsem);
      [ 5733.386639]
      [ 5733.386640]  *** DEADLOCK ***
      [ 5733.386641]
      [ 5733.386644] 6 locks held by khubd/186:
      [ 5733.386646]  #0:  (&__lockdep_no_validate__){......}, at: [<ffffffffa00084af>] hub_thread+0x14a/0x1157 [usbcore]
      [ 5733.386661]  #1:  (&__lockdep_no_validate__){......}, at: [<ffffffffa0006b77>] usb_disconnect+0x50/0x11f [usbcore]
      [ 5733.386677]  #2:  (hcd->bandwidth_mutex){+.+.+.}, at: [<ffffffffa0006bc8>] usb_disconnect+0xa1/0x11f [usbcore]
      [ 5733.386693]  #3:  (&__lockdep_no_validate__){......}, at: [<ffffffff812c09bb>] device_release_driver+0x18/0x2d
      [ 5733.386704]  #4:  (&__lockdep_no_validate__){......}, at: [<ffffffff812c09bb>] device_release_driver+0x18/0x2d
      [ 5733.386714]  #5:  (&hiddev->existancelock){+.+...}, at: [<ffffffffa0094d17>] hiddev_disconnect+0x26/0x87 [usbhid]
      [ 5733.386727]
      [ 5733.386727] stack backtrace:
      [ 5733.386731] Pid: 186, comm: khubd Not tainted 3.2.0-custom-next-20120111+ #1
      [ 5733.386734] Call Trace:
      [ 5733.386741]  [<ffffffff81062881>] ? up+0x34/0x3b
      [ 5733.386747]  [<ffffffff813d9ef3>] print_circular_bug+0x1f8/0x209
      [ 5733.386752]  [<ffffffff8108255d>] __lock_acquire+0xa80/0xd74
      [ 5733.386756]  [<ffffffff810808b4>] ? trace_hardirqs_on_caller+0x15d/0x1a3
      [ 5733.386763]  [<ffffffff81043a3f>] ? vprintk+0x3f4/0x419
      [ 5733.386774]  [<ffffffffa0011a04>] ? usb_deregister_dev+0x37/0x9e [usbcore]
      [ 5733.386779]  [<ffffffff81082d26>] lock_acquire+0xcb/0x10e
      [ 5733.386789]  [<ffffffffa0011a04>] ? usb_deregister_dev+0x37/0x9e [usbcore]
      [ 5733.386797]  [<ffffffff813e01f5>] down_write+0x44/0x77
      [ 5733.386807]  [<ffffffffa0011a04>] ? usb_deregister_dev+0x37/0x9e [usbcore]
      [ 5733.386818]  [<ffffffffa0011a04>] usb_deregister_dev+0x37/0x9e [usbcore]
      [ 5733.386825]  [<ffffffffa0094d2d>] hiddev_disconnect+0x3c/0x87 [usbhid]
      [ 5733.386830]  [<ffffffff8132df51>] hid_disconnect+0x3f/0x54
      [ 5733.386834]  [<ffffffff8132dfb4>] hid_device_remove+0x4e/0x7a
      [ 5733.386839]  [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
      [ 5733.386844]  [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
      [ 5733.386848]  [<ffffffff812c0564>] bus_remove_device+0x114/0x128
      [ 5733.386854]  [<ffffffff812bdd6f>] device_del+0x131/0x183
      [ 5733.386859]  [<ffffffff8132def3>] hid_destroy_device+0x1e/0x3d
      [ 5733.386865]  [<ffffffffa00916b0>] usbhid_disconnect+0x36/0x42 [usbhid]
      [ 5733.386876]  [<ffffffffa000fb60>] usb_unbind_interface+0x57/0x11f [usbcore]
      [ 5733.386882]  [<ffffffff812c0957>] __device_release_driver+0x81/0xcd
      [ 5733.386886]  [<ffffffff812c09c3>] device_release_driver+0x20/0x2d
      [ 5733.386890]  [<ffffffff812c0564>] bus_remove_device+0x114/0x128
      [ 5733.386895]  [<ffffffff812bdd6f>] device_del+0x131/0x183
      [ 5733.386905]  [<ffffffffa000de61>] usb_disable_device+0xa8/0x1d8 [usbcore]
      [ 5733.386916]  [<ffffffffa0006bd2>] usb_disconnect+0xab/0x11f [usbcore]
      [ 5733.386921]  [<ffffffff813dff82>] ? __mutex_unlock_slowpath+0x130/0x141
      [ 5733.386929]  [<ffffffffa0008aa0>] hub_thread+0x73b/0x1157 [usbcore]
      [ 5733.386935]  [<ffffffff8106a51d>] ? finish_task_switch+0x78/0x150
      [ 5733.386941]  [<ffffffff8105e396>] ? __init_waitqueue_head+0x4c/0x4c
      [ 5733.386950]  [<ffffffffa0008365>] ? usb_remote_wakeup+0x56/0x56 [usbcore]
      [ 5733.386955]  [<ffffffff8105dc0f>] kthread+0x95/0x9d
      [ 5733.386961]  [<ffffffff813e90b4>] kernel_thread_helper+0x4/0x10
      [ 5733.386966]  [<ffffffff813e24b8>] ? retint_restore_args+0x13/0x13
      [ 5733.386970]  [<ffffffff8105db7a>] ? __init_kthread_worker+0x55/0x55
      [ 5733.386974]  [<ffffffff813e90b0>] ? gs_change+0x13/0x13
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ba18311d
    • P
      i.MX SDMA: Fix burstsize settings · 94ac27a5
      Philippe Rétornaz 提交于
      Commit 6584cb88 (ARM i.MX dma: Fix burstsize settings) fixed
      the mxcmmc driver but forgot to fix the SDMA driver to handle the
      correct burtsize.
      This make the SD card access works again with DMA on i.MX31 boards.
      Signed-off-by: NPhilippe Rétornaz <philippe.retornaz@epfl.ch>
      Tested-by: NSascha Hauer <s.hauer@pengutronix.de>
      Acked-by: NSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      94ac27a5
    • A
      gpio: Add missing spin_lock_init in gpio-ml-ioh driver · 7e3a70fb
      Axel Lin 提交于
      This bug was introduced by commit 54be5663
      "gpio-ml-ioh: Support interrupt function" which adds a spinlock to struct
      ioh_gpio but never init the spinlock.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      7e3a70fb