1. 24 Jul, 2014 1 commit
  2. 23 Jul, 2014 2 commits
    • Nishanth Menon's avatar
      power: twl4030_charger: detect battery presence prior to enabling charger · 61a7784e
      Nishanth Menon authored
      TWL4030's Battery Charger seems to be designed for non-hotpluggable
      batteries.
      
      If battery is not present in the system, BATSTS is always set with the
      expectation that software will take actions to move to a required safe
      state (could be power down or disable various charger paths).
      
      It does not seem possible even by manipulating the edge detection
      of the event (using BCIEDR2 register) to have a consistent hotplug
      handling. This seems to be the result of BATSTS interrupt generated
      when the thermistor of the battery pack is disconnected from the
      dedicated ADIN1 pin. Clearing the status just results in the status
      being regenerated by the monitoring ADC(MADC) and disabling the
      edges of event just makes hotplug no longer function. The only
      other option is to disable the detection of the MADC by disabling
      BCIMFEN4::BATSTSMCHGEN (battery presence detector) - but then, we can
      never again detect battery reconnection.
      
      So, detect battery presence based on precharge(which is hardware
      automatic state) or default main charger configuration at the time of
      probe and enable charger logic only if battery was present.
      Reported-by: default avatarRussell King <linux@arm.linux.org.uk>
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarNishanth Menon <nm@ti.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      61a7784e
    • Marc Carino's avatar
      power: reset: Add reboot driver for brcmstb · 030494e7
      Marc Carino authored
      Add support for reboot functionality on boards with ARM-based
      Broadcom STB chipsets. Make it built-in by default for ARCH_BRCMSTB,
      but allow it to be configurable under COMPILE_TEST.
      Signed-off-by: default avatarMarc Carino <marc.ceeeee@gmail.com>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      030494e7
  3. 20 Jul, 2014 1 commit
  4. 18 Jul, 2014 21 commits
    • Jenny TC's avatar
      power_supply: Add inlmt,iterm, min/max temp props · 6bb1d272
      Jenny TC authored
      Add new power supply properties for input current, charge termination
      current, min and max temperature
      
      POWER_SUPPLY_PROP_TEMP_MIN - minimum operatable temperature
      POWER_SUPPLY_PROP_TEMP_MAX - maximum operatable temperature
      
      POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT - input current limit programmed
      by charger. Indicates the input current for a charging source.
      
      POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT - Charge termination current used
      to detect the end of charge condition
      Signed-off-by: default avatarJenny TC <jenny.tc@intel.com>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      6bb1d272
    • Doug Anderson's avatar
      charger: tps65090: Allow charger module to be used when no irq · 193dcced
      Doug Anderson authored
      On the ARM Chromebook tps65090 has two masters: the AP (the main
      processor running linux) and the EC (the embedded controller).  The AP
      is allowed to mess with FETs but the EC is in charge of charge control.
      
      The tps65090 interupt line is routed to both the AP and the EC, which
      can cause quite a headache.  Having two people adjusting masks and
      acking interrupts is a recipe for disaster.
      
      In the shipping kernel we had a hack to have the AP pay attention to
      the IRQ but not to ack it.  It also wasn't supposed to configure the
      IRQ in any way.  That hack allowed us to detect when the device was
      charging without messing with the EC's state.
      
      The current tps65090 infrastructure makes the above difficult, and it
      was a bit of a hack to begin with.  Rather than uglify the driver to
      support it, just extend the driver's existing notion of "no irq" to
      the charger.  This makes the charger code poll every 2 seconds for AC
      detect, which is sufficient.
      
      For proper functioning, requires (mfd: tps65090: Don't tell child
      devices we have an IRQ if we don't).  If we don't have that patch
      we'll simply fail to probe on devices without an interrupt (just like
      we did before this patch).
      Signed-off-by: default avatarDoug Anderson <dianders@chromium.org>
      Reviewed-by: default avatarJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Tested-by: default avatarJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      [sre@kernel.org: Use -ENXIO instead of NO_IRQ for missing interrupt,
      since NO_IRQ is not available on all architectures.]
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      193dcced
    • Bjorn Helgaas's avatar
      power/reset: Fix GPL v2 license string typo · 661468b4
      Bjorn Helgaas authored
      Per license_is_gpl_compatible(), the MODULE_LICENSE() string for GPL v2 is
      "GPL v2", not "GPLv2".  Use "GPL v2" so this module doesn't taint the
      kernel.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      661468b4
    • Linus Walleij's avatar
      power: poweroff: gpio: convert to use descriptors · 86336ba4
      Linus Walleij authored
      This switches the GPIO poweroff driver to use GPIO descriptors
      rather than numeral GPIOs. We get rid of the specific inversion
      handling as GPIO descriptors know if they are active low or
      high and can assert the line properly, so we do not need to
      check the flag OF_GPIO_ACTIVE_LOW returned from the old call
      of_get_gpio_flags() anymore.
      
      Also convert to use managed resources and use dev_* message
      printing while we're at it.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      86336ba4
    • Marek Belisko's avatar
      bq27000: report missing device better. · 3dd843e1
      Marek Belisko authored
      One an hdq buss, a missing device reads as 0xff, not -1.
      So do a translation to allow detecting of a missing bus.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      3dd843e1
    • Himangi Saraogi's avatar
      bq27x00_battery: Introduce the use of the managed version of kzalloc · 1cb82fdb
      Himangi Saraogi authored
      This patch moves data allocated using kzalloc to managed data allocated
      using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
      functions for both platform and i2c drivers. Also, the unecessary
      variable ret and labels batt_failed3, err_free were removed.
      
      The following Coccinele script was used for making the change:
      
      @platform@
      identifier p, probefn, removefn;
      @@
      struct platform_driver p = {
        .probe = probefn,
        .remove = removefn,
      };
      
      @prb@
      identifier platform.probefn, pdev;
      expression e, e1, e2;
      @@
      probefn(struct platform_device *pdev, ...) {
        <+...
      - e = kzalloc(e1, e2)
      + e = devm_kzalloc(&pdev->dev, e1, e2)
        ...
      ?-kfree(e);
        ...+>
      }
      
      @rem depends on prb@
      identifier platform.removefn;
      expression e;
      @@
      removefn(...) {
        <...
      - kfree(e);
        ...>
      }
      Signed-off-by: default avatarHimangi Saraogi <himangi774@gmail.com>
      Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      1cb82fdb
    • Sebastian Reichel's avatar
      Documentation: DT: Document rx51-battery binding · c93e12c0
      Sebastian Reichel authored
      Add devicetree binding documentation for rx51-battery,
      which is a simple A/D converter consumer.
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      c93e12c0
    • Sebastian Reichel's avatar
      rx51_battery: convert to iio consumer · 57da5e86
      Sebastian Reichel authored
      Update rx51-battery driver to use the new IIO API of
      twl4030-madc and add DT support.
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      57da5e86
    • Sebastian Reichel's avatar
      bq2415x_charger: Fix Atomic Sleep Bug · 3c018504
      Sebastian Reichel authored
      Move sysfs_notify and i2c_transfer calls from bq2415x_notifier_call
      to bq2415x_timer_work to avoid sleeping in atomic context.
      
      This fixes the following bug:
      
      [ 7.667449] Workqueue: events power_supply_changed_work
      [ 7.673034] [<c0015c28>] (unwind_backtrace+0x0/0xe0) from [<c0011e1c>] (show_stack+0x10/0x14)
      [ 7.682098] [<c0011e1c>] (show_stack+0x10/0x14) from [<c052cdd0>] (dump_stack+0x78/0xac)
      [ 7.690704] [<c052cdd0>] (dump_stack+0x78/0xac) from [<c052a044>] (__schedule_bug+0x48/0x60)
      [ 7.699645] [<c052a044>] (__schedule_bug+0x48/0x60) from [<c053071c>] (__schedule+0x74/0x638)
      [ 7.708618] [<c053071c>] (__schedule+0x74/0x638) from [<c05301fc>] (schedule_timeout+0x1dc/0x24c)
      [ 7.718017] [<c05301fc>] (schedule_timeout+0x1dc/0x24c) from [<c05316ec>] (wait_for_common+0x138/0x17c)
      [ 7.727966] [<c05316ec>] (wait_for_common+0x138/0x17c) from [<c0362a70>] (omap_i2c_xfer+0x340/0x4a0)
      [ 7.737640] [<c0362a70>] (omap_i2c_xfer+0x340/0x4a0) from [<c035d928>] (__i2c_transfer+0x40/0x74)
      [ 7.747039] [<c035d928>] (__i2c_transfer+0x40/0x74) from [<c035e22c>] (i2c_transfer+0x6c/0x90)
      [ 7.756195] [<c035e22c>] (i2c_transfer+0x6c/0x90) from [<c037ad24>] (bq2415x_i2c_write+0x48/0x78)
      [ 7.765563] [<c037ad24>] (bq2415x_i2c_write+0x48/0x78) from [<c037ae60>] (bq2415x_set_weak_battery_voltage+0x4c/0x50)
      [ 7.776824] [<c037ae60>] (bq2415x_set_weak_battery_voltage+0x4c/0x50) from [<c037bce8>] (bq2415x_set_mode+0xdc/0x14c)
      [ 7.788085] [<c037bce8>] (bq2415x_set_mode+0xdc/0x14c) from [<c037bfb8>] (bq2415x_notifier_call+0xa8/0xb4)
      [ 7.798309] [<c037bfb8>] (bq2415x_notifier_call+0xa8/0xb4) from [<c005f228>] (notifier_call_chain+0x38/0x68)
      [ 7.808715] [<c005f228>] (notifier_call_chain+0x38/0x68) from [<c005f284>] (__atomic_notifier_call_chain+0x2c/0x3c)
      [ 7.819732] [<c005f284>] (__atomic_notifier_call_chain+0x2c/0x3c) from [<c005f2a8>] (atomic_notifier_call_chain+0x14/0x18)
      [ 7.831420] [<c005f2a8>] (atomic_notifier_call_chain+0x14/0x18) from [<c0378078>] (power_supply_changed_work+0x6c/0xb8)
      [ 7.842864] [<c0378078>] (power_supply_changed_work+0x6c/0xb8) from [<c00556c0>] (process_one_work+0x248/0x440)
      [ 7.853546] [<c00556c0>] (process_one_work+0x248/0x440) from [<c0055d6c>] (worker_thread+0x208/0x350)
      [ 7.863372] [<c0055d6c>] (worker_thread+0x208/0x350) from [<c005b0ac>] (kthread+0xc8/0xdc)
      [ 7.872131] [<c005b0ac>] (kthread+0xc8/0xdc) from [<c000e138>] (ret_from_fork+0x14/0x3c)
      
      Fixes: 32260308 ("bq2415x_charger: Use power_supply notifier for automode")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      3c018504
    • Linus Torvalds's avatar
      Merge tag 'gfs2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes · f8397191
      Linus Torvalds authored
      Pull gfs2 fixes from Steven Whitehouse:
       "This patch set contains two minor docs/spelling fixes, some fixes for
        flock, a change to use GFP_NOFS to avoid recursion on a rarely used
        code path and a fix for a race relating to the glock lru"
      
      * tag 'gfs2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes:
        GFS2: fs/gfs2/rgrp.c: kernel-doc warning fixes
        GFS2: memcontrol: Spelling s/invlidate/invalidate/
        GFS2: Allow caching of glocks for flock
        GFS2: Allow flocks to use normal glock dq rather than dq_wait
        GFS2: replace count*size kzalloc by kcalloc
        GFS2: Use GFP_NOFS when allocating glocks
        GFS2: Fix race in glock lru glock disposal
        GFS2: Only wait for demote when last holder is dequeued
      f8397191
    • Linus Torvalds's avatar
      Merge tag 'dm-3.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm · 55ae1bd0
      Linus Torvalds authored
      Pull device mapper fixes from Mike Snitzer:
       "Fix the dm-thinp and dm-cache targets to disallow changing the data
        device's block size"
      
      * tag 'dm-3.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm cache metadata: do not allow the data block size to change
        dm thin metadata: do not allow the data block size to change
      55ae1bd0
    • Linus Torvalds's avatar
      Merge tag 'upstream-3.16-rc6' of git://git.infradead.org/linux-ubifs · 033ead82
      Linus Torvalds authored
      Pull UBI fixes from Artem Bityutskiy:
       "Two UBI fastmap-related fixes for v3.16:
      
         - fix UBI fastmap support which we broke in 3.16-rc1 by reversing the
           volumes RB-tree sorting criteria.
         - make sure that we scrub all PEBs where we see bit-flips - we were
           missing some of them when the fastmap feature was enabled"
      
      * tag 'upstream-3.16-rc6' of git://git.infradead.org/linux-ubifs:
        UBI: fastmap: do not miss bit-flips
        UBI: fix the volumes tree sorting criteria
      033ead82
    • Linus Torvalds's avatar
      Merge tag 'xfs-for-linus-3.16-rc5' of git://oss.sgi.com/xfs/xfs · 847f56eb
      Linus Torvalds authored
      Pull xfs fixes from Dave Chinner:
       "Fixes for low memory perforamnce regressions and a quota inode
        handling regression.
      
        These are regression fixes for issues recently introduced - the change
        in the stack switch location is fairly important, so I've held off
        sending this update until I was sure that it still addresses the stack
        usage problem the original solved.  So while the commits in the xfs
        tree are recent, it has been under tested for several weeks now"
      
      * tag 'xfs-for-linus-3.16-rc5' of git://oss.sgi.com/xfs/xfs:
        xfs: null unused quota inodes when quota is on
        xfs: refine the allocation stack switch
        Revert "xfs: block allocation work needs to be kswapd aware"
      847f56eb
    • Fabian Frederick's avatar
      GFS2: fs/gfs2/rgrp.c: kernel-doc warning fixes · 27ff6a0f
      Fabian Frederick authored
      Cc: cluster-devel@redhat.com
      Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      27ff6a0f
    • Geert Uytterhoeven's avatar
      GFS2: memcontrol: Spelling s/invlidate/invalidate/ · 6b49d1d9
      Geert Uytterhoeven authored
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: cluster-devel@redhat.com
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      6b49d1d9
    • Bob Peterson's avatar
      GFS2: Allow caching of glocks for flock · 97a4f1d7
      Bob Peterson authored
      This patch removes the GLF_NOCACHE flag from the glocks associated with
      flocks. There should be no good reason not to cache glocks for flocks:
      they only force the glock to be demoted before they can be reacquired,
      which can slow down performance and even cause glock hangs, especially
      in cases where the flocks are held in Shared (SH) mode.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      97a4f1d7
    • Bob Peterson's avatar
      GFS2: Allow flocks to use normal glock dq rather than dq_wait · 5bef3e7c
      Bob Peterson authored
      This patch allows flock glocks to use a non-blocking dequeue rather
      than dq_wait. It also reverts the previous patch I had posted regarding
      dq_wait. The reverted patch isn't necessarily a bad idea, but I decided
      this might avoid unforeseen side effects, and was therefore safer.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      5bef3e7c
    • Fabian Frederick's avatar
      GFS2: replace count*size kzalloc by kcalloc · 6ec43b18
      Fabian Frederick authored
      kcalloc manages count*sizeof overflow.
      
      Cc: cluster-devel@redhat.com
      Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      6ec43b18
    • Steven Whitehouse's avatar
      GFS2: Use GFP_NOFS when allocating glocks · fe0bbd29
      Steven Whitehouse authored
      Normally GFP_KERNEL is ok here, but there is now a rarely used code path
      relating to deallocation of unlinked inodes (in certain corner cases)
      which if hit at times of memory shortage can cause recursion while
      trying to free memory.
      
      One solution would be to try and move the gfs2_glock_get() call so
      that it is no longer called while another glock is held, but that
      doesn't look at all easy, so GFP_NOFS is the best solution for the
      time being.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      fe0bbd29
    • Steven Whitehouse's avatar
      GFS2: Fix race in glock lru glock disposal · 94a09a39
      Steven Whitehouse authored
      We must not leave items on the LRU list with GLF_LOCK set, since
      they can be removed if the glock is brought back into use, which
      may then potentially result in a hang, waiting for GLF_LOCK to
      clear.
      
      It doesn't happen very often, since it requires a glock that has
      not been used for a long time to be brought back into use at the
      same moment that the shrinker is part way through disposing of
      glocks.
      
      The fix is to set GLF_LOCK at a later time, when we already know
      that the other locks can be obtained. Also, we now only release
      the lru_lock in case a resched is needed, rather than on every
      iteration.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      94a09a39
    • Bob Peterson's avatar
      GFS2: Only wait for demote when last holder is dequeued · 79272b35
      Bob Peterson authored
      Function gfs2_glock_dq_wait is supposed to dequeue a glock and then
      wait for the lock to be demoted. The problem is, if this is a shared
      lock, its demote will depend on the other holders, which means you
      might end up waiting forever because the other process is blocked.
      This problem is especially apparent when dealing with nested flocks.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      79272b35
  5. 17 Jul, 2014 2 commits
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.16-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 59ca9ee4
      Linus Torvalds authored
      Pull Xen fixes from Konrad Rzeszutek Wilk:
       "Two fixes found during migration of PV guests.  David would be the one
        doing this pull but he is on vacation.
      
        Fixes:
         - fix console deadlock when resuming PV guests
         - fix regression hit when ballooning and resuming PV guests"
      
      * tag 'stable/for-linus-3.16-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/balloon: set ballooned out pages as invalid in p2m
        xen/manage: fix potential deadlock when resuming the console
      59ca9ee4
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.16-rc5-v2' of... · 22d36854
      Linus Torvalds authored
      Merge tag 'trace-fixes-v3.16-rc5-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull tracing fixes from Steven Rostedt:
       "A few more fixes for ftrace infrastructure.
      
        I was cleaning out my INBOX and found two fixes from zhangwei from a
        year ago that were lost in my mail.  These fix an inconsistency
        between trace_puts() and the way trace_printk() works.  The reason
        this is important to fix is because when trace_printk() doesn't have
        any arguments, it turns into a trace_puts().  Not being able to enable
        a stack trace against trace_printk() because it does not have any
        arguments is quite confusing.  Also, the fix is rather trivial and low
        risk.
      
        While porting some changes to PowerPC I discovered that it still has
        the function graph tracer filter bug that if you also enable stack
        tracing the function graph tracer filter is ignored.  I fixed that up.
      
        Finally, Martin Lau, fixed a bug that would cause readers of the
        ftrace ring buffer to block forever even though it was suppose to be
        NONBLOCK"
      
      This also includes the fix from an earlier pull request:
      
       "Oleg Nesterov fixed a memory leak that happens if a user creates a
        tracing instance, sets up a filter in an event, and then removes that
        instance.  The filter allocates memory that is never freed when the
        instance is destroyed"
      
      * tag 'trace-fixes-v3.16-rc5-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ring-buffer: Fix polling on trace_pipe
        tracing: Add TRACE_ITER_PRINTK flag check in __trace_puts/__trace_bputs
        tracing: Fix graph tracer with stack tracer on other archs
        tracing: Add ftrace_trace_stack into __trace_puts/__trace_bputs
        tracing: instance_rmdir() leaks ftrace_event_file->filter
      22d36854
  6. 16 Jul, 2014 7 commits
  7. 15 Jul, 2014 6 commits