08 Jul, 2011
7 commits
-
Fix warnings emitted by some versions of gcc:
drivers/power/twl4030_charger.c:490: warning: overflow in implicit constant conversion
drivers/power/twl4030_charger.c:498: warning: overflow in implicit constant conversionWhile at it, also fix module_param permissions and a typo in my name.
Signed-off-by: Grazvydas Ignotas
Signed-off-by: Jean Delvare
Signed-off-by: Anton Vorontsov -
If there are multiple wm831x devices in the system we need to assign
different names to the power supply devices in order to ensure we can
create the sysfs entries for them.Signed-off-by: Mark Brown
Signed-off-by: Anton Vorontsov -
If there are multiple wm831x devices in the system we need to assign
different names to the power supply devices in order to ensure we can
create the sysfs entries for them.Signed-off-by: Mark Brown
Signed-off-by: Anton Vorontsov -
Two macros in the changed file contained complex expressions which
were not enclosed by parentheses.Signed-off-by: Ken O'Brien
Signed-off-by: Anton Vorontsov -
A probe() function is used at device init time rather than system init
time.Signed-off-by: Mark Brown
Acked-by: Vasily Khoruzhick
Signed-off-by: Anton Vorontsov -
Need to enable detection, which is also blocking the unit conversion logic
after registering the power_supply.Signed-off-by: Rhyland Klein
Signed-off-by: Anton Vorontsov -
Adding support for external power change notification. One problem found
is that there is a lag time before the sensor will return a new status.
To ensure that we only fire off the power_supply_changed event when the
status returned from the sensor is actually different, we delay sending
the the notification, and instead poll on it looking for a change. The
amount of time to poll is configurable via platform data.Signed-off-by: Rhyland Klein
Signed-off-by: Anton Vorontsov
20 May, 2011
5 commits
-
Signed-off-by: Marek Vasut
Signed-off-by: Anton Vorontsov -
Fix rated capacity of the HP iPAQ hx4700 3.7V 1800mAh (359113-001) battery. For this battery the value of the rated capacity EEPROM register at 0x32 is 7; thus rated_capacities[7] = 1800.
Signed-off-by: Paul Parsons
Signed-off-by: Anton Vorontsov -
Fix indexing of the 4 active full EEPROM registers. The indexing was out by 1, accessing the EEPROM registers at 0x23 to 0x26 instead of 0x22 to 0x25.
Signed-off-by: Paul Parsons
Signed-off-by: Anton Vorontsov -
In 2008 Masashi YOKOTA created the virtual
battery driver found here:
http://downloads.pylone.jp/src/virtual_battery/virtual_battery-0.0.1.tar.bz2It found use out of tree, but was never merged upstream.
Since then the test_power driver has been merged, which provides
very similar functionality.This patch extends the test_power driver to be more dynamic
at runtime, by merging portions of the Virtual Battery Driver
by Masashi YOKOTA.With this patch, I can tweak the values in:
/sys/module/test_power/parameters/* and watch the behavior of
the gnome power managment daemon or other battery UI software.CC: Anton Vorontsov
CC: Akihiro MAEDA
CC: Masashi YOKOTA
Signed-off-by: John Stultz
Signed-off-by: Anton Vorontsov -
This patch fix using correct property POWER_SUPPLY_PROP_CYCLE_COUNT
for cycle count instead POWER_SUPPLY_PROP_CHARGE_COUNTERSigned-off-by: Pali Rohár
Tested-by: Pali Rohár
Signed-off-by: Anton Vorontsov
22 Apr, 2011
1 commit
-
S390 is special as it doesn't have IRQ lines, so these errors pop up:
drivers/built-in.o: In function 'max8903_remove':
drivers/power/max8903_charger.c:355: undefined reference to 'free_irq'
drivers/power/max8903_charger.c:357: undefined reference to 'free_irq'
drivers/power/max8903_charger.c:359: undefined reference to 'free_irq'This commit fixes the issue by making the driver depend on
GENERIC_HARDIRQS feature.Reported-by: Stephen Rothwell
Signed-off-by: Anton Vorontsov
20 Apr, 2011
4 commits
-
The isp1704 usb tranceiver is used for charging and can be
disabled when not in use. Provide the powering routine to
the driver via platform data.Also changed the indent of ".name" variable in rx51_charger_device
definition to use tabs same way as the new ".dev" variable indent.
Put this in the same patch since the indent fix is only needed
when there are multiple members in the struct definition.Loosely based on earlier patches from Heikki Krogerus in
Nokia N900 maemo kernel.Signed-off-by: Kalle Jokiniemi
Acked-By: Heikki Krogerus
Acked-by: Tony Lindgren
Signed-off-by: Anton Vorontsov -
The ISP1704/1707 chip can be put to full power down
state by asserting the CHIP_SEL line. This patch enables
platform or board specific hooks to put the device into
power down mode in case not needed.This patch is a preparation for enabling this powering
routine in n900 (rx-51) devices.Thanks to Heikki Krogerus for helping out with the patch.
Signed-off-by: Kalle Jokiniemi
Acked-By: Heikki Krogerus
Signed-off-by: Anton Vorontsov -
Gpio charger should notify if the gpio state had changed
during suspend. This will send a CHANGED event each time
the system resumes, ensuring a plug/unplug of the charger
is not missed.Signed-off-by: Benson Leung
Acked-By: Lars-Peter Clausen
Signed-off-by: Anton Vorontsov -
MAX8903 is an integrated battery charger and selector with two
power inputs (USB and AC adapter). This driver enables the charger,
handles interrupts, and provides power-supply-class information to
userland.Tested on Exynos4 NURI / S5PC210 SLP7 boards.
Signed-off-by: MyungJoo Ham
Signed-off-by: Kyungmin Park
Signed-off-by: Anton Vorontsov
19 Apr, 2011
10 commits
-
* 'for-39-rc4' of git://codeaurora.org/quic/kernel/davidb/linux-msm:
msm: timer: fix missing return value
msm: Remove extraneous ffa device check -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: xen-kbdfront - fix mouse getting stuck after save/restore
Input: estimate number of events per packet
Input: evdev - indicate buffer overrun with SYN_DROPPED
Input: document event types and codes and their intended use
Input: add KEY_IMAGES specifically for AL Image Browser
Input: twl4030_keypad - fix potential NULL dereference in twl4030_kp_probe()
Input: h3600_ts - fix error handling at connect
Input: twl4030_keypad - avoid potential NULL-pointer dereference -
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: add blk_run_queue_async
block: blk_delay_queue() should use kblockd workqueue
md: fix up raid1/raid10 unplugging.
md: incorporate new plugging into raid5.
md: provide generic support for handling unplug callbacks.
md - remove old plugging code.
md/dm - remove remains of plug_fn callback.
md: use new plugging interface for RAID IO.
block: drop queue lock before calling __blk_run_queue() for kblockd punt
Revert "block: add callback function for unplug notification"
block: Enhance new plugging support to support general callbacks -
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
powerpc/powermac: Build fix with SMP and CPU hotplug
powerpc/perf_event: Skip updating kernel counters if register value shrinks
powerpc: Don't write protect kernel text with CONFIG_DYNAMIC_FTRACE enabled
powerpc: Fix oops if scan_dispatch_log is called too early
powerpc/pseries: Use a kmem cache for DTL buffers
powerpc/kexec: Fix regression causing compile failure on UP
powerpc/85xx: disable Suspend support if SMP enabled
powerpc/e500mc: Remove CPU_FTR_MAYBE_CAN_NAP/CPU_FTR_MAYBE_CAN_DOZE
powerpc/book3e: Fix CPU feature handling on 64-bit e5500
powerpc: Check device status before adding serial device
powerpc/85xx: Don't add disabled PCIe devices -
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (24 commits)
Btrfs: fix free space cache leak
Btrfs: avoid taking the chunk_mutex in do_chunk_alloc
Btrfs end_bio_extent_readpage should look for locked bits
Btrfs: don't force chunk allocation in find_free_extent
Btrfs: Check validity before setting an acl
Btrfs: Fix incorrect inode nlink in btrfs_link()
Btrfs: Check if btrfs_next_leaf() returns error in btrfs_real_readdir()
Btrfs: Check if btrfs_next_leaf() returns error in btrfs_listxattr()
Btrfs: make uncache_state unconditional
btrfs: using cached extent_state in set/unlock combinations
Btrfs: avoid taking the trans_mutex in btrfs_end_transaction
Btrfs: fix subvolume mount by name problem when default mount subvolume is set
fix user annotation in ioctl.c
Btrfs: check for duplicate iov_base's when doing dio reads
btrfs: properly handle overlapping areas in memmove_extent_buffer
Btrfs: fix memory leaks in btrfs_new_inode()
Btrfs: check for duplicate iov_base's when doing dio reads
Btrfs: reuse the extent_map we found when calling btrfs_get_extent
Btrfs: do not use async submit for small DIO io's
Btrfs: don't split dio bios if we don't have to
... -
Rather than pass in some random truncated offset to the pid-related
functions, check that the offset is in range up-front.This is just cleanup, the previous commit fixed the real problem.
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds -
next_pidmap() just quietly accepted whatever 'last' pid that was passed
in, which is not all that safe when one of the users is /proc.Admittedly the proc code should do some sanity checking on the range
(and that will be the next commit), but that doesn't mean that the
helper functions should just do that pidmap pointer arithmetic without
checking the range of its arguments.So clamp 'last' to PID_MAX_LIMIT. The fact that we then do "last+1"
doesn't really matter, the for-loop does check against the end of the
pidmap array properly (it's only the actual pointer arithmetic overflow
case we need to worry about, and going one bit beyond isn't going to
overflow).[ Use PID_MAX_LIMIT rather than pid_max as per Eric Biederman ]
Reported-by: Tavis Ormandy
Analyzed-by: Robert Święcki
Cc: Eric W. Biederman
Cc: Pavel Emelyanov
Signed-off-by: Linus Torvalds -
Mouse gets "stuck" after restore of PV guest but buttons are in working
condition.If driver has been configured for ABS coordinates at start it will get
XENKBD_TYPE_POS events and then suddenly after restore it'll start getting
XENKBD_TYPE_MOTION events, that will be dropped later and they won't get
into user-space.Regression was introduced by hunk 5 and 6 of
5ea5254aa0ad269cfbd2875c973ef25ab5b5e9db
("Input: xen-kbdfront - advertise either absolute or relative
coordinates").Driver on restore should ask xen for request-abs-pointer again if it is
available. So restore parts that did it before 5ea5254.Acked-by: Olaf Hering
Signed-off-by: Igor Mammedov
[v1: Expanded the commit description]
Signed-off-by: Konrad Rzeszutek Wilk
Signed-off-by: Dmitry Torokhov -
Calculate a default based on the number of ABS axes, REL axes,
and MT slots for the device during input device registration.Signed-off-by: Jeff Brown
Reviewed-by: Henrik Rydberg
Signed-off-by: Dmitry Torokhov
18 Apr, 2011
13 commits
-
The free space caching code was recently reworked to
cache all the pages it needed instead of using find_get_page everywhere.One loop was missed though, so it ended up leaking pages. This fixes
it to use our page array instead of find_get_page.Signed-off-by: Chris Mason
-
Instead of overloading __blk_run_queue to force an offload to kblockd
add a new blk_run_queue_async helper to do it explicitly. I've kept
the blk_queue_stopped check for now, but I suspect it's not needed
as the check we do when the workqueue items runs should be enough.Signed-off-by: Christoph Hellwig
Signed-off-by: Jens Axboe -
Reported-by: Christoph Hellwig
Signed-off-by: Jens Axboe -
We just need to make sure that an unplug event wakes up the md
thread, which is exactly what mddev_check_plugged does.Also remove some plug-related code that is no longer needed.
Signed-off-by: NeilBrown
-
In raid5 plugging is used for 2 things:
1/ collecting writes that require a bitmap update
2/ collecting writes in the hope that we can create full
stripes - or at least more-full.We now release these different sets of stripes when plug_cnt
is zero.Also in make_request, we call mddev_check_plug to hopefully increase
plug_cnt, and wake up the thread at the end if plugging wasn't
achieved for some reason.Signed-off-by: NeilBrown
-
When an md device adds a request to a queue, it can call
mddev_check_plugged.
If this succeeds then we know that the md thread will be woken up
shortly, and ->plug_cnt will be non-zero until then, so some
processing can be delayed.If it fails, then no unplug callback is expected and the make_request
function needs to do whatever is required to make the request happen.Signed-off-by: NeilBrown
-
md has some plugging infrastructure for RAID5 to use because the
normal plugging infrastructure required a 'request_queue', and when
called from dm, RAID5 doesn't have one of those available.This relied on the ->unplug_fn callback which doesn't exist any more.
So remove all of that code, both in md and raid5. Subsequent patches
with restore the plugging functionality.Signed-off-by: NeilBrown
-
Now that unplugging is done differently, the unplug_fn callback is
never called, so it can be completely discarded.Signed-off-by: NeilBrown
-
md/raid submits a lot of IO from the various raid threads.
So adding start/finish plug calls to those so that some
plugging happens.Signed-off-by: NeilBrown
-
If we know we are going to punt to kblockd, we can drop the queue
lock before calling into __blk_run_queue() since it only does a
safe bit test and a workqueue call. Since kblockd needs to grab
this very lock as one of the first things it does, it's a good
optimization to drop the lock before waking kblockd.Signed-off-by: Jens Axboe
-
MD can't use this since it really requires us to be able to
keep more than a single piece of state for the unplug. Commit
048c9374 added the required support for MD, so get rid of this
now unused code.This reverts commit f75664570d8b75469cc468f23c2b27220984983b.
Conflicts:
block/blk-core.c
Signed-off-by: Jens Axboe
-
md/raid requires an unplug callback, but as it does not uses
requests the current code cannot provide one.So allow arbitrary callbacks to be attached to the blk_plug.
Signed-off-by: NeilBrown
Signed-off-by: Jens Axboe -
Signed-off-by: Benjamin Herrenschmidt