Daniel Mack [Thu, 23 Jul 2009 18:35:54 +0000 (20:35 +0200)]
ds2760_battery: implement set_charged() feature
The ds2760's internal current meter is not reliable enough as it has an
inacurracy of around ~15%. Without any correction for that error, the
current accumulator is couting up all the time, even though the battery
is already fully charged and hence destroys the static information. The
longer it is connected, the worse is the aberration.
Fortunately, this can be corrected by the DS2760_CURRENT_OFFSET_BIAS
register. Using the external power_supply_set_battery_charged()
function, this register is now gauging the measurement.
A delayed work is used to debounce flaky GPIO signals and to let the
current value settle. Also see Maxim's application note AN4188.
Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu> Cc: Matt Reimer <mreimer@vpop.net> Cc: Anton Vorontsov <cbou@mail.ru> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Daniel Mack [Thu, 23 Jul 2009 18:35:53 +0000 (20:35 +0200)]
power_supply: get_by_name and set_charged functionality
This adds a function that indicates that a battery is fully charged.
It also includes functions to get a power_supply device from the class
of registered devices by name reference. These can be used to find a
specific battery to call power_supply_set_battery_charged() on.
Some battery drivers might need this information to calibrate
themselves.
Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Ian Molton <spyro@f2s.com> Cc: Anton Vorontsov <cbou@mail.ru> Cc: Matt Reimer <mreimer@vpop.net> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Daniel Mack [Thu, 30 Jul 2009 13:42:31 +0000 (17:42 +0400)]
power_supply: EXPORT_SYMBOL cleanups
While I'm at it, cleanup the power supply code so that EXPORT_SYMBOL_GPL
appears directly after the symbole declaration. checkpatch.pl wants it
that way.
Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Ian Molton <spyro@f2s.com> Cc: Matt Reimer <mreimer@vpop.net> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
When connecting a ds2760 to a partly loaded battery the first time,
there must be a way to bootstrap the current_accum value. Without that,
the current capactity value is bogus until the battery is fully charged
for the first time.
Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu> Cc: Matt Reimer <mreimer@vpop.net> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Daniel Mack [Wed, 15 Jul 2009 16:20:41 +0000 (18:20 +0200)]
ds2760_battery: handle full_active_uAh == 0 case correctly
In systems where the battery monitor is not part of the battery pack and
is hence not bootstrapped with sane values, the full_active_uAh is
likely to be zero.
Handle that case by defaulting to the rated_capacity information which
can be passed to the driver using the new module parameter.
Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu> Acked-by: Matt Reimer <mreimer@vpop.net> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
For systems where the ds2760 is soldered directly on the PCB, the 'rated
capacity' register is not set to anything useful.
In order to allow users to bootstrap this value, introduce a new module
parameter 'rated_capacity' and use it to write the internal EEPROM in
case the value differes from what's been given.
Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu> Acked-by: Matt Reimer <mreimer@vpop.net> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Andres Salomon [Thu, 2 Jul 2009 13:45:18 +0000 (09:45 -0400)]
power_supply: Add a charge_type property, and use it for olpc driver
This adds a new sysfs file called 'charge_type' which displays the
type of charging (unknown, n/a, trickle charge, or fast charging).
This allows things like battery diagnostics to determine what the
battery/EC is doing without resorting to changing the 'status' sysfs
output.
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Andres Salomon [Tue, 30 Jun 2009 06:15:26 +0000 (02:15 -0400)]
olpc_battery: Add an 'error' sysfs device that displays raw errors
Grab the error code from EC_BAT_ERRCODE and let the user see it (rather
than attempting to decode it as we do with PROP_HEALTH) with a separate
error sysfs file.
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Andres Salomon [Tue, 30 Jun 2009 06:16:17 +0000 (02:16 -0400)]
olpc_battery: Ensure that the TRICKLE bit is checked
There are times when the battery is present but trickle charging,
and the EC sets only the TRICKLE bit. So we must check for the bit
when we're checking the charging/present status.
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
ide: memory overrun in ide_get_identity_ioctl() on big endian machines using ioctl HDIO_OBSOLETE_IDENTITY
ide: fix resume for CONFIG_BLK_DEV_IDEACPI=y
ide-cd: handle fragmented packet commands gracefully
ide: always kill the whole request on error
ide: fix ide_kill_rq() for special ide-{floppy,tape} driver requests
ide: memory overrun in ide_get_identity_ioctl() on big endian machines using ioctl HDIO_OBSOLETE_IDENTITY
This patch fixes a memory overrun in function ide_get_identity_ioctl() which
chooses the size of a memory buffer depending on the ioctl command that led
to the function call, however, passes that buffer to a function which needs the
buffer size to be always chosen unconditionally.
Due to conditional compilation the memory overrun can only happen on big endian
machines. The error can be triggered using ioctl HDIO_OBSOLETE_IDENTITY. Usage
of ioctl HDIO_GET_IDENTITY is safe.
Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com> Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2f0d0fd2a605666d38e290c5c0d2907484352dc4 ("ide-acpi: cleanup
do_drive_get_GTF()") didn't account for the lack of hwif->acpidata
check in generic_ide_suspend() [ indirect user of do_drive_get_GTF()
through ide_acpi_exec_tfs() ] resulting in broken resume when ACPI
support is enabled but ACPI data is unavailable.
Fix it by adding ide_port_acpi() helper for checking if port needs
ACPI handling and cleaning generic_ide_{suspend,resume}() to use it
instead of hiding hwif->acpidata and ide_noacpi checks in IDE ACPI
helpers (this should help in preventing similar bugs in the future).
While at it:
- kill superfluous debugging printks in ide_acpi_{get,push}_timing()
Reported-and-tested-by: Etienne Basset <etienne.basset@numericable.fr> Also-reported-and-tested-by: Jeff Chua <jeff.chua.linux@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Mon, 29 Jun 2009 16:46:12 +0000 (09:46 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
sound: OSS: mpu401, fix deadlock
ALSA: hda - Add missing initializations for ALC268 and ALC269
ALSA: cmi8330: fix MPU-401 PnP init copy&paste bug
ALSA: hda - Line In for Acer Inspire 6530G model
sound: oxygen: make mic volume control mono
MAINTAINERS: Add entry for twl4030 series soc codec driver
ALSA: lx6464es - configure ethersound io channels
sound: Use PCI_VDEVICE for CREATIVE and ECTIVA
sound: Use PCI_VDEVICE
ALSA: hda - Use model=acer-aspire-6530g for Acer Aspire 6930G
ALSA: hda - Fix acer-aspire-6530g model quirk
ALSA: hda - Add pin-sense trigger when needed for Realtek codecs
ALSA: hda - Fix support for Samsung P50 with AD1986A codec
ALSA: hda - Generalize the pin-detect quirk for Lenovo N100
ALSA: hda - Simplify AD1986A mixer definitions
Linus Torvalds [Mon, 29 Jun 2009 16:42:01 +0000 (09:42 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
Revert "x86: cap iomem_resource to addressable physical memory"
Ingo Molnar [Mon, 29 Jun 2009 08:07:54 +0000 (10:07 +0200)]
eeepc-laptop: Fix build failure with HOTPLUG_PCI && !SYSFS
FYI, there's a post-rc1 build regression with certain configs:
drivers/built-in.o: In function `pci_hp_deregister':
(.text+0xb166): undefined reference to `pci_hp_remove_module_link'
drivers/built-in.o: In function `pci_hp_deregister':
(.text+0xb19f): undefined reference to `pci_destroy_slot'
drivers/built-in.o: In function `__pci_hp_register':
(.text+0xb583): undefined reference to `pci_create_slot'
drivers/built-in.o: In function `__pci_hp_register':
(.text+0xb5b1): undefined reference to `pci_hp_create_module_link'
make: *** [.tmp_vmlinux1] Error 1
Alan Cox [Mon, 29 Jun 2009 14:21:47 +0000 (15:21 +0100)]
tty: Fix the leak in tty_ldisc_release
Currently we reinit the ldisc on final tty close which is what the old code
did to ensure that if the device retained its termios settings then it had the
right ldisc. tty_ldisc_reinit does that but also leaves us with the reset
ldisc reference which is then leaked.
At this point we know the port will be recycled so we can kill the ldisc
off completely rather than try and add another ldisc free up when the kref
count hits zero.
At this point it is safe to keep the ldisc closed as tty_ldisc waiting
methods are only used from the user side, and as the final close we are
the last such reference. Interrupt/driver side methods will always use the
non wait version and get back a NULL.
Found with kmemleak and investigated/identified by Catalin Marinas.
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Takashi Iwai [Mon, 29 Jun 2009 16:05:02 +0000 (18:05 +0200)]
Merge branch 'fix/hda' into for-linus
* fix/hda:
ALSA: hda - Add missing initializations for ALC268 and ALC269
ALSA: hda - Line In for Acer Inspire 6530G model
ALSA: hda - Use model=acer-aspire-6530g for Acer Aspire 6930G
ALSA: hda - Fix acer-aspire-6530g model quirk
ALSA: hda - Add pin-sense trigger when needed for Realtek codecs
Jeremy Kerr [Mon, 29 Jun 2009 06:31:58 +0000 (14:31 +0800)]
fs: allow d_instantiate to be called with negative parent dentry
The new fsnotify infrastructure (starting at 90586523) causes an oops in
spufs, where we populate a directory with files before instantiating the
directory itself. The new changes seem to have introduced an assumption
that a dentry's parent will be positive when instantiating.
This change makes it once again possible to d_instantiate a dentry
with a negative parent, and brings __fsnotify_d_instantiate() into
line with inotify_d_instantiate(), which already has this NULL check.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Eric Paris <eparis@redhat.com>
Nicolas Ferre [Mon, 29 Jun 2009 11:11:50 +0000 (12:11 +0100)]
[ARM] 5562/2: at91: add gpio button support for at91sam9g20ek
This adds input keyboard gpio support on at91sam9g20ek board.
It adds button 3 and 4.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Takashi Iwai [Mon, 29 Jun 2009 09:33:53 +0000 (11:33 +0200)]
ALSA: hda - Add missing initializations for ALC268 and ALC269
During the changes to clean up / fix the realtek codec initialization
routines in commit 4a79ba34cada6a5a4ee86ed53aa8a73ba1e6fc51,
I forgot to add the check for ALC268 and ALC269.
This resulted in the missing EAPD and COEF setup for these codecs.
This patch adds the missing checks for these codecs.
Tony Vroon [Fri, 26 Jun 2009 08:27:50 +0000 (09:27 +0100)]
ALSA: hda - Line In for Acer Inspire 6530G model
The Line In connector is set up as PIN_IN by default, using
VREF_HIZ. It is connected to both ADCs, so add it to both
input selectors.
Also add the ability to use the input mix (on a SoundBlaster
one would call this "What You Hear").
Signed-off-by: Tony Vroon <tony@linx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
be2net: Fix to avoid a crash seen on PPC with LRO and Jumbo frames.
gro: Flush GRO packets in napi_disable_pending path
inet: Call skb_orphan before tproxy activates
mac80211: Use rcu_barrier() on unload.
sunrpc: Use rcu_barrier() on unload.
bridge: Use rcu_barrier() instead of syncronize_net() on unload.
ipv6: Use rcu_barrier() on module unload.
decnet: Use rcu_barrier() on module unload.
sky2: Fix checksum endianness
mdio add missing GPL flag
sh_eth: remove redundant test on unsigned
fsl_pq_mdio: Fix fsl_pq_mdio to work with modules
ipv6: avoid wraparound for expired preferred lifetime
tcp: missing check ACK flag of received segment in FIN-WAIT-2 state
atl1*: add device_set_wakeup_enable to atl1*_set_wol
Phonet: generate Netlink RTM_DELADDR when destroying a device
Phonet: publicize the Netlink notification function
Revert "veth: prevent oops caused by netdev destructor"
cpmac: fix compilation failure introduced with netdev_ops conversion
ipsec: Fix name of CAST algorithm
Ajit Khaparde [Fri, 26 Jun 2009 02:51:07 +0000 (02:51 +0000)]
be2net: Fix to avoid a crash seen on PPC with LRO and Jumbo frames.
While testing the driver on PPC, we ran into a crash with LRO, Jumbo frames.
With CONFIG_PPC_64K_PAGES configured (a default in PPC), MAX_SKB_FRAGS drops to 3 and we were crossing the array limits on skb_shinfo(skb)->frags[].
Now we coalesce the frags from the same physical page into one slot in
skb_shinfo(skb)->frags[] and go to the next index when the frag is from
different physical page.
This patch is against the net-2.6 tree.
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Mimi Zohar [Fri, 26 Jun 2009 18:05:27 +0000 (14:05 -0400)]
integrity: add ima_counts_put (updated)
This patch fixes an imbalance message as reported by J.R. Okajima.
The IMA file counters are incremented in ima_path_check. If the
actual open fails, such as ETXTBSY, decrement the counters to
prevent unnecessary imbalance messages.
Linus Torvalds [Sun, 28 Jun 2009 18:12:52 +0000 (11:12 -0700)]
Merge branch 'kvm-updates/2.6.31' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.31' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: shut up uninit compiler warning in paging_tmpl.h
KVM: Ignore reads to K7 EVNTSEL MSRs
KVM: VMX: Handle vmx instruction vmexits
KVM: s390: Allow stfle instruction in the guest
KVM: kvm/x86_emulate.c toggle_interruptibility() should be static
KVM: ia64: fix ia64 build due to missing kallsyms_lookup() and double export
KVM: protect concurrent make_all_cpus_request
KVM: MMU: Allow 4K ptes with bit 7 (PAT) set
KVM: Fix dirty bit tracking for slots with large pages
Linus Torvalds [Sun, 28 Jun 2009 18:05:28 +0000 (11:05 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, delay: tsc based udelay should have rdtsc_barrier
x86, setup: correct include file in <asm/boot.h>
x86, setup: Fix typo "CONFIG_x86_64" in <asm/boot.h>
x86, mce: percpu mcheck_timer should be pinned
x86: Add sysctl to allow panic on IOCK NMI error
x86: Fix uv bau sending buffer initialization
x86, mce: Fix mce resume on 32bit
x86: Move init_gbpages() to setup_arch()
x86: ensure percpu lpage doesn't consume too much vmalloc space
x86: implement percpu_alloc kernel parameter
x86: fix pageattr handling for lpage percpu allocator and re-enable it
x86: reorganize cpa_process_alias()
x86: prepare setup_pcpu_lpage() for pageattr fix
x86: rename remap percpu first chunk allocator to lpage
x86: fix duplicate free in setup_pcpu_remap() failure path
percpu: fix too lazy vunmap cache flushing
x86: Set cpu_llc_id on AMD CPUs
Linus Torvalds [Sun, 28 Jun 2009 18:05:16 +0000 (11:05 -0700)]
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
timer stats: Optimize by adding quick check to avoid function calls
timers: Fix timer_migration interface which accepts any number as input
Linus Torvalds [Sun, 28 Jun 2009 18:05:04 +0000 (11:05 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
ftrace: Fix the output of profile
ring-buffer: Make it generally available
ftrace: Remove duplicate newline
tracing: Fix trace_buf_size boot option
ftrace: Fix t_hash_start()
ftrace: Don't manipulate @pos in t_start()
ftrace: Don't increment @pos in g_start()
tracing: Reset iterator in t_start()
trace_stat: Don't increment @pos in seq start()
tracing_bprintk: Don't increment @pos in t_start()
tracing/events: Don't increment @pos in s_start()
Linus Torvalds [Sun, 28 Jun 2009 18:02:32 +0000 (11:02 -0700)]
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
leds: Futher document blink_set
leds: Add options to have GPIO LEDs start on or keep their state
leds: LED driver for National Semiconductor LP3944 Funlight Chip
leds: pca9532 - Indent using tabs, not spaces.
leds: Remove an orphan Kconfig entry
leds: Further document parameters for blink_set()
leds: alix-leds2 fixed for Award BIOS
leds: leds-gpio - fix a section mismatch
leds: add the sysfs interface into the leds-bd2802 driver for changing wave pattern and led current.
leds: change the license information
leds: fix led-bd2802 errors while resuming
KVM: shut up uninit compiler warning in paging_tmpl.h
Dixes compilation warning:
CC arch/x86/kernel/io_delay.o
arch/x86/kvm/paging_tmpl.h: In function ‘paging64_fetch’:
arch/x86/kvm/paging_tmpl.h:279: warning: ‘sptep’ may be used uninitialized in this function
arch/x86/kvm/paging_tmpl.h: In function ‘paging32_fetch’:
arch/x86/kvm/paging_tmpl.h:279: warning: ‘sptep’ may be used uninitialized in this function
warning is bogus (always have a least one level), but need to shut the compiler
up.
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2.6.31-rc introduced an architecture level set checker based on facility
bits. e.g. if the kernel is compiled to run only on z9, several facility
bits are checked very early and the kernel refuses to boot if a z9 specific
facility is missing.
Until now kvm on s390 did not implement the store facility extended (STFLE)
instruction. A 2.6.31-rc kernel that was compiled for z9 or higher did not
boot in kvm. This patch implements stfle.
This patch should go in before 2.6.31.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
H. Peter Anvin [Sat, 27 Jun 2009 19:22:27 +0000 (12:22 -0700)]
Revert "x86: cap iomem_resource to addressable physical memory"
This reverts commit 95ee14e4379c5e19c0897c872350570402014742.
Mikael Petterson <mikepe@it.uu.se> reported that at least one of his
systems will not boot as a result. We have ruled out the detection
algorithm malfunctioning, so it is not a matter of producing the
incorrect bitmasks; rather, something in the application of them
fails.
Revert the commit until we can root cause and correct this problem.
-stable team: this means the underlying commit should be rejected.
Reported-and-isolated-by: Mikael Petterson <mikpe@it.uu.se> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <200906261559.n5QFxJH8027336@pilspetsen.it.uu.se> Cc: stable@kernel.org Cc: Grant Grundler <grundler@parisc-linux.org>
When this lock was converted to a mutex, the locks were turned into
unlocks and vice-versa.
Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
Here is a little update to the at91sam9rlek lcd interface.
This will correct the power pin of the LCD.
It will also add precision to the struct atmel_lcdfb_info
scructure: backlight enabling and wiring mode correction:
RGB wiring on the -EK board.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Herbert Xu [Sat, 27 Jun 2009 02:27:04 +0000 (19:27 -0700)]
gro: Flush GRO packets in napi_disable_pending path
When NAPI is disabled while we're in net_rx_action, we end up
calling __napi_complete without flushing GRO packets. This is
a bug as it would cause the GRO packets to linger, of course it
also literally BUGs to catch error like this :)
This patch changes it to napi_complete, with the obligatory IRQ
reenabling. This should be safe because we've only just disabled
IRQs and it does not materially affect the test conditions in
between.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Sat, 27 Jun 2009 02:22:37 +0000 (19:22 -0700)]
inet: Call skb_orphan before tproxy activates
As transparent proxying looks up the socket early and assigns
it to the skb for later processing, we must drop any existing
socket ownership prior to that in order to distinguish between
the case where tproxy is active and where it is not.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
The mac80211 module uses rcu_call() thus it should use rcu_barrier()
on module unload.
The rcu_barrier() is placed in mech.c ieee80211_stop_mesh() which is
invoked from ieee80211_stop() in case vif.type == NL80211_IFTYPE_MESH_POINT.
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
The sunrpc module uses rcu_call() thus it should use rcu_barrier() on
module unload.
Have not verified that the possibility for new call_rcu() callbacks
has been disabled. As a hint for checking, the functions calling
call_rcu() (unx_destroy_cred and generic_destroy_cred) are
registered as crdestroy function pointer in struct rpc_credops.
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
bridge: Use rcu_barrier() instead of syncronize_net() on unload.
When unloading modules that uses call_rcu() callbacks, then we must
use rcu_barrier(). This module uses syncronize_net() which is not
enough to be sure that all callback has been completed.
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
The ipv6 module uses rcu_call() thus it should use rcu_barrier() on
module unload.
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
The decnet module unloading as been disabled with a '#if 0' statement,
because it have had issues.
We add a rcu_barrier() anyhow for correctness.
The maintainer (Chrissie Caulfield) will look into the unload issue
when time permits.
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Chrissie Caulfield <christine.caulfield@googlemail.com> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
There are some devices in the wild that clear the DRQ bit during the
last word of a packet command and therefore could use a "second chance"
for that last word of data to be xferred instead of simply failing the
request. Do that by attempting to suck in those last bytes in PIO mode.
In addition, the ATA_ERR bit has to be cleared for we cannot be sure the
data is valid otherwise.
See http://bugzilla.kernel.org/show_bug.cgi?id=13399 for details.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Fri, 26 Jun 2009 16:39:40 +0000 (09:39 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
amd64_edac: misc small cleanups
amd64_edac: fix ecc_enable_override handling
amd64_edac: check only ECC bit in amd64_determine_edac_cap
Linus Torvalds [Fri, 26 Jun 2009 16:39:02 +0000 (09:39 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (29 commits)
powerpc/rtas: Fix watchdog driver temperature read functionality
powerpc/mm: Fix potential access to freed pages when using hugetlbfs
powerpc/440: Fix warning early debug code
powerpc/of: Fix usage of dev_set_name() in of_device_alloc()
powerpc/pasemi: Use raw spinlock in SMP TB sync
powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock
powerpc/rtas: Turn rtas lock into a raw spinlock
powerpc: Add irqtrace support for 32-bit powerpc
powerpc/BSR: Fix BSR to allow mmap of small BSR on 64k kernel
powerpc/BSR: add 4096 byte BSR size
powerpc: Map more memory early on 601 processors
powerpc/pmac: Fix DMA ops for MacIO devices
powerpc/mm: Make k(un)map_atomic out of line
powerpc: Fix mpic alloc warning
powerpc: Fix output from show_regs
powerpc/pmac: Fix issues with PowerMac "PowerSurge" SMP
powerpc/amigaone: Limit ISA I/O range to 4k in the device tree
powerpc/warp: Platform fix for i2c change
powerpc: Have git ignore generated files from dtc compile
powerpc/mpic: Fix mapping of "DCR" based MPIC variants
...
Linus Torvalds [Fri, 26 Jun 2009 16:37:52 +0000 (09:37 -0700)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI: video: prevent NULL deref in acpi_get_pci_dev()
eeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 Go
eeepc-laptop: get the right value for CMSG
eeepc-laptop: makes get_acpi() returns -ENODEV
eeepc-laptop: right parent device
eeepc-laptop: rfkill refactoring
eeepc-laptop.c: use pr_fmt and pr_<level>
eeepc-laptop: Register as a pci-hotplug device
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] remove unknown mount option warning message
[CIFS] remove bkl usage from umount begin
cifs: Fix incorrect return code being printed in cFYI messages
[CIFS] cleanup asn handling for ntlmssp
[CIFS] Copy struct *after* setting the port, instead of before.
cifs: remove rw/ro options
cifs: fix problems with earlier patches
cifs: have cifs parse scope_id out of IPv6 addresses and use it
[CIFS] Do not send tree disconnect if session is already disconnected
[CIFS] Fix build break
cifs: display scopeid in /proc/mounts
cifs: add new routine for converting AF_INET and AF_INET6 addrs
cifs: have cifs_show_options show forceuid/forcegid options
cifs: remove unneeded NULL checks from cifs_show_options
Borislav Petkov [Mon, 22 Jun 2009 17:42:24 +0000 (19:42 +0200)]
amd64_edac: fix ecc_enable_override handling
amd64_check_ecc_enabled() returns non-zero status when ECC
checking/correcting is disabled and this fails further loading of the
driver even when 'ecc_enable_override' boot param is used.
Borislav Petkov [Wed, 10 Jun 2009 16:29:54 +0000 (18:29 +0200)]
amd64_edac: check only ECC bit in amd64_determine_edac_cap
Checking whether the machine is using ECC enabled DRAM is done through
testing the DimmEccEn bit in the DRAM Cfg Low register (F2x[1,0]90). Do
that instead of testing all bits from the DimmEccEn upwards.
Also, remove mci->edac_cap assignment and use value returned from
amd64_determine_edac_cap().
* Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_kill_rq()
and ide_floppy_do_request() for failed requests.
[ bugfix part ]
* Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_do_devset()
and ide_complete_drive_reset(). Then remove ide_rq_bytes().
[ cleanup part ]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Adrian Reber [Thu, 26 Mar 2009 02:05:42 +0000 (02:05 +0000)]
powerpc/rtas: Fix watchdog driver temperature read functionality
Using the RTAS watchdog driver to read out the temperature crashes
on a PXCAB:
Unable to handle kernel paging request for data at address 0xfe347b50
Faulting instruction address: 0xc00000000001af64
Oops: Kernel access of bad area, sig: 11 [#1]
The wrong usage of "(void *)__pa(&temperature)" in rtas_call() is
removed by using the function rtas_get_sensor() which does the
right thing.
Signed-off-by: Adrian Reber <adrian@lisas.de> Acked-by: Utz Bacher <utz.bacher@de.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
powerpc/mm: Fix potential access to freed pages when using hugetlbfs
When using 64k page sizes, our PTE pages are split in two halves,
the second half containing the "extension" used to keep track of
individual 4k pages when not using HW 64k pages.
However, our page tables used for hugetlb have a slightly different
format and don't carry that "second half".
Our code that batched PTEs to be invalidated unconditionally reads
the "second half" (to put it into the batch), which means that when
called to invalidate hugetlb PTEs, it will access unrelated memory.
It breaks when CONFIG_DEBUG_PAGEALLOC is enabled.
This fixes it by only accessing the second half when the _PAGE_COMBO
bit is set in the first half, which indicates that we are dealing with
a "combo" page which represents 16x4k subpages. Anything else shouldn't
have this bit set and thus not require loading from the second half.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock
Several platforms use their own copy of what is essentially the same code,
using RTAS to synchronize the timebases when bringing up new CPUs. This
moves it all into a single common implementation and additionally
turns the spinlock into a raw spinlock since the former can rely on
the timebase not being frozen when spinlock debugging is enabled, and finally
masks interrupts while the timebase is disabled.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
RTAS currently uses a normal spinlock. However it can be called from
contexts where this is not necessarily a good idea. For example, it
can be called while syncing timebases, with the core timebase being
frozen. Unfortunately, that will deadlock in case of lock contention
when spinlock debugging is enabled as the spin lock debugging code
will try to use __delay() which ... relies on the timebase being
enabled.
Also RTAS can be used in some low level IRQ handling code path so it
may as well be a raw spinlock for -rt sake.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Based on initial work from: Dale Farnsworth <dale@farnsworth.org>
Add the low level irq tracing hooks for 32-bit powerpc needed
to enable full lockdep functionality.
The approach taken to deal with the code in entry_32.S is that
we don't trace all the transitions of MSR:EE when we just turn
it off to peek at TI_FLAGS without races. Only when we are
calling into C code or returning from exceptions with a state
that have changed from what lockdep thinks.
There's a little bugger though: If we take an exception that
keeps interrupts enabled (such as an alignment exception) while
interrupts are enabled, we will call trace_hardirqs_on() on the
way back spurriously. Not a big deal, but to get rid of it would
require remembering in pt_regs that the exception was one of the
type that kept interrupts enabled which we don't know at this
stage. (Well, we could test all cases for regs->trap but that
sucks too much).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Tested-by: Kumar Gala <galak@kernel.crashing.org>
Sonny Rao [Thu, 18 Jun 2009 15:13:04 +0000 (15:13 +0000)]
powerpc/BSR: Fix BSR to allow mmap of small BSR on 64k kernel
On Mon, Nov 17, 2008 at 01:26:13AM -0600, Sonny Rao wrote:
> On Fri, Nov 07, 2008 at 04:28:29PM +1100, Paul Mackerras wrote:
> > Sonny Rao writes:
> >
> > > Fix the BSR driver to allow small BSR devices, which are limited to a
> > > single 4k space, on a 64k page kernel. Previously the driver would
> > > reject the mmap since the size was smaller than PAGESIZE (or because
> > > the size was greater than the size of the device). Now, we check for
> > > this case use remap_4k_pfn(). Also, take out code to set vm_flags,
> > > as the remap_pfn functions will do this for us.
> >
> > Thanks.
> >
> > Do we know that the BSR size will always be 4k if it's not a multiple
> > of 64k? Is it possible that we could get 8k, 16k or 32k or BSRs?
> > If it is possible, what does the user need to be able to do? Do they
> > just want to map 4k, or might then want to map the whole thing?
>
>
> Hi Paul, I took a look at changing the driver to reject a request for
> mapping more than a single 4k page, however the only indication we get
> of the requested size in the mmap function is the vma size, and this
> is always one page at minimum. So, it's not possible to determine if
> the user wants one 4k page or more. As I noted in my first response,
> there is only one case where this is even possible and I don't think
> it is a significant concern.
>
> I did notice that I left out the check to see if the user is trying to
> map more than the device length, so I fixed that. Here's the revised
> patch.
Alright, I've reworked this now so that if we get one of these cases
where there's a bsr that's > 4k and < 64k on a 64k kernel we'll only
advertise that it is a 4k BSR to userspace. I think this is the best
solution since user programs are only supposed to look at sysfs to
determine how much can be mapped, and libbsr does this as well.
Please consider for 2.6.31 as a fix, thanks.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Sonny Rao [Thu, 18 Jun 2009 15:14:36 +0000 (15:14 +0000)]
powerpc/BSR: add 4096 byte BSR size
Add a 4096 byte BSR size which will be used on new machines. Also, remove
the warning when we run into an unknown size, as this can spam the kernel
log excessively.
Signed-off-by: Sonny Rao <sonnyrao@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
The 32-bit kernel relies on some memory being mapped covering
the kernel text,data and bss at least, early during boot before
the full MMU setup is done. On 32-bit "classic" processors, this
is done using BAT registers.
On 601, the size of BATs is limited to 8M and we use 2 of them
for that initial mapping. This can become quite tight when enabling
features like lockdep, so let's use a 3rd one to bump that mapping
from 16M to 24M. We keep the 4th BAT free as it can be useful for
debugging early boot code to map things like serial ports.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>