]> Pileus Git - ~andy/linux/log
~andy/linux
13 years agogpio: adp5588-gpio: add i2c forward declaration
Michael Hennerich [Wed, 27 Oct 2010 22:33:20 +0000 (15:33 -0700)]
gpio: adp5588-gpio: add i2c forward declaration

Some ADP5588 functions take a pointer to an i2c_client, but if the i2c
header doesn't happen to be included first, we hit the standard "struct
declared inside parameter list" warnings from gcc.  So add a simple
forward decl of the i2c_client struct.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agogpio: adp5588-gpio: gpio_start must be signed
Michael Hennerich [Wed, 27 Oct 2010 22:33:20 +0000 (15:33 -0700)]
gpio: adp5588-gpio: gpio_start must be signed

Common code interprets this as a signed value (a negative value is used to
request dynamic ID allocation), so make sure the platform data has proper
types to support that.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agogpio: adp5588-gpio: support interrupt controller
Michael Hennerich [Wed, 27 Oct 2010 22:33:19 +0000 (15:33 -0700)]
gpio: adp5588-gpio: support interrupt controller

Implement irq_chip functionality on ADP5588/5587 GPIO expanders.  Only
level sensitive interrupts are supported.  Interrupts provided by this
irq_chip must be requested using request_threaded_irq().

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agogpio: add support for 74x164 serial-in/parallel-out 8-bit shift register
Miguel Gaio [Wed, 27 Oct 2010 22:33:18 +0000 (15:33 -0700)]
gpio: add support for 74x164 serial-in/parallel-out 8-bit shift register

Add support for generic 74x164 serial-in/parallel-out 8-bits shift
register.  This driver can be used as a GPIO output expander.

[akpm@linux-foundation.org: remove unused local `refresh']
Signed-off-by: Miguel Gaio <miguel.gaio@efixo.com>
Signed-off-by: Juhos Gabor <juhosg@openwrt.org>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agogpio: timbgpio: use a copy of the IER register to avoid it being trashed
Tomas Hallenberg [Wed, 27 Oct 2010 22:33:17 +0000 (15:33 -0700)]
gpio: timbgpio: use a copy of the IER register to avoid it being trashed

Some versions of the hardware can trash the IER register if simultaneous
interrupts occur.  This patch works around it by using a local copy of the
register and restoring it after every interrupt.

Signed-off-by: Tomas Hallenberg <tomas.hallenberg@pelagicore.com>
Acked-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agogpiolib: fix HAVE_GPIO_LIB leftovers in asm-generic/gpio.h
Anton Vorontsov [Wed, 27 Oct 2010 22:33:16 +0000 (15:33 -0700)]
gpiolib: fix HAVE_GPIO_LIB leftovers in asm-generic/gpio.h

commit 7444a72effa632fcd8edc566f88 ("gpiolib: allow user-selection")
removed HAVE_GPIO_LIB Kconfig symbol, but the header file still uses the
name [to confuse readers wrt #ifdef/#else/#endif location].

The real Kconfig symbol nowadays is CONFIG_GPIOLIB.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agogpio: add driver for basic memory-mapped GPIO controllers
Anton Vorontsov [Wed, 27 Oct 2010 22:33:15 +0000 (15:33 -0700)]
gpio: add driver for basic memory-mapped GPIO controllers

The basic GPIO controllers may be found in various on-board FPGA and ASIC
solutions that are used to control board's switches, LEDs, chip-selects,
Ethernet/USB PHY power, etc.

These controllers may not provide any means of pin setup
(in/out/open drain).

The driver supports:
- 8/16/32/64 bits registers;
- GPIO controllers with clear/set registers;
- GPIO controllers with a single "data" register;
- Big endian bits/GPIOs ordering (mostly used on PowerPC).

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodrivers/rtc/rtc-jz4740.c: add alarm function
Paul Cercueil [Wed, 27 Oct 2010 22:33:12 +0000 (15:33 -0700)]
drivers/rtc/rtc-jz4740.c: add alarm function

Add the "alarm" function to the jz4740 RTC.  Interrupts will now be raised
when the "alarm" time is reached.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodrivers/rtc/rtc-ds3232.c: add alarm function
Lan Chunhe-B25806 [Wed, 27 Oct 2010 22:33:12 +0000 (15:33 -0700)]
drivers/rtc/rtc-ds3232.c: add alarm function

The DS3232 RTC driver only has the tick function.  Add an alarm function
so the driver is complete.

Signed-off-by: Lan Chunhe-B25806 <b25806@freescale.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: rtc-s3c: add rtc_valid_tm in s3c_rtc_gettime()
Kukjin Kim [Wed, 27 Oct 2010 22:33:11 +0000 (15:33 -0700)]
rtc: rtc-s3c: add rtc_valid_tm in s3c_rtc_gettime()

Add "rtc_valid_tm" in s3c_rtc_gettime() as per Wan ZongShun's suggestion.

Suggested-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: rtc-s3c: fix RTC initialization method
Changhwan Youn [Wed, 27 Oct 2010 22:33:10 +0000 (15:33 -0700)]
rtc: rtc-s3c: fix RTC initialization method

Change RTC initialization method in probe().  The 'rtc_valid_tm(tm)' can
check whether RTC BCD is valid or not.  And change the method of checking
because the previous method cannot validate RTC BCD registers properly.

Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: rtc-s3c: Fix debug message format on RTC
Kukjin Kim [Wed, 27 Oct 2010 22:33:09 +0000 (15:33 -0700)]
rtc: rtc-s3c: Fix debug message format on RTC

Fix debug message format.

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: rtc-s3c: fix on support RTC Alarm
Changhwan Youn [Wed, 27 Oct 2010 22:33:09 +0000 (15:33 -0700)]
rtc: rtc-s3c: fix on support RTC Alarm

The alarm_irq_enable function should be implemented to support RTC alarm.
And fix tabs instead of white space around the proc field.

Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: rtc-s3c: fix setting missing field of getalarm
Changhwan Youn [Wed, 27 Oct 2010 22:33:08 +0000 (15:33 -0700)]
rtc: rtc-s3c: fix setting missing field of getalarm

Current s3c_rtc_getalarm() sets missing field of alarm time with 0xff.
But this value should be -1 according to drivers/rtc/interface.c.

Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: rtc-s3c: fix access unit from byte to word on RTCCON
Changhwan Youn [Wed, 27 Oct 2010 22:33:06 +0000 (15:33 -0700)]
rtc: rtc-s3c: fix access unit from byte to word on RTCCON

S3C2410_RTCCON of TYPE_S3C64XX RTC should be read/written by readw and
writew, because TYPE_S3C64XX RTC uses bit 8 and 9.  And TYPE_S3C2410 RTC
also can access it by readw and writew.

[atul.dahiya@samsung.com: tested on smdk2416]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Tested-by: Atul Dahiya <atul.dahiya@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: omap: let device wakeup capability be configured from chip init logic
Sekhar Nori [Wed, 27 Oct 2010 22:33:05 +0000 (15:33 -0700)]
rtc: omap: let device wakeup capability be configured from chip init logic

The rtc-omap driver currently hardcodes the RTC wakeup capability to be
"not capable".  While this seems to be true for existing OMAP1 boards
which are not wired for this, the DA850/OMAP-L138 SoC, the RTC can always
be wake up source from its "deep sleep" mode.

This patch lets the wakeup capability be set from platform data and does
not override the setting from the driver.  For DA850/OMAP-L138, this is
done from arch/arm/mach-davinci/devices-da8xx.c:da8xx_register_rtc()

Note that this patch does not change the behavior on any existing OMAP1
board since the platform device registration sets the wakeup capability to
0 by default.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodrivers/rtc/class.c: fix device_register() error handling
Vasiliy Kulikov [Wed, 27 Oct 2010 22:33:04 +0000 (15:33 -0700)]
drivers/rtc/class.c: fix device_register() error handling

If device_register() fails then call put_device().  See comment to
device_register.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc-bfin: add debug markers to suspend/resume paths
Mike Frysinger [Wed, 27 Oct 2010 22:33:04 +0000 (15:33 -0700)]
rtc-bfin: add debug markers to suspend/resume paths

The rest of the driver had debug markings already.  This also standardizes
the usage of "dev" a bit.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc-bfin: shrink/optimize interrupt handler a bit
Mike Frysinger [Wed, 27 Oct 2010 22:33:03 +0000 (15:33 -0700)]
rtc-bfin: shrink/optimize interrupt handler a bit

By unifying the RTC_ISTAT clearing steps, we shrink the interrupt handler
and avoid multiple writes to the hardware registers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agortc: rtc-lpc32xx: introduce RTC driver for the LPC32XX SoC
Kevin Wells [Wed, 27 Oct 2010 22:33:01 +0000 (15:33 -0700)]
rtc: rtc-lpc32xx: introduce RTC driver for the LPC32XX SoC

Add an RTC driver for the built-in RTC in the LPC32XX SoC.  This patch
includes updates from the initial review comments and updates from the v3
review.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
Signed-off-by: Durgesh Pattamatta <durgesh.pattamatta@nxp.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodrivers/char/vt_ioctl.c: fix VT_OPENQRY error value
Graham Gower [Wed, 27 Oct 2010 22:33:00 +0000 (15:33 -0700)]
drivers/char/vt_ioctl.c: fix VT_OPENQRY error value

When all VT's are in use, VT_OPENQRY casts -1 to unsigned char before
returning it to userspace as an int.  VT255 is not the next available
console.

Signed-off-by: Graham Gower <graham.gower@gmail.com>
Cc: Greg KH <greg@kroah.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodmi: log board, system, and BIOS information
Bjorn Helgaas [Wed, 27 Oct 2010 22:32:59 +0000 (15:32 -0700)]
dmi: log board, system, and BIOS information

Put basic system information in the dmesg log.  There are lots of dmesg
logs on the web, and it would be useful if they contained this information
for debugging platform problems.  "BOARD/PRODUCT" format copied from
show_regs_common(), which is used in the oops path.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agotile: enable ARCH_DMA_ADDR_T_64BIT
FUJITA Tomonori [Wed, 27 Oct 2010 22:32:58 +0000 (15:32 -0700)]
tile: enable ARCH_DMA_ADDR_T_64BIT

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agomm: fix race in kunmap_atomic()
Peter Zijlstra [Wed, 27 Oct 2010 22:32:58 +0000 (15:32 -0700)]
mm: fix race in kunmap_atomic()

Christoph reported a nice splat which illustrated a race in the new stack
based kmap_atomic implementation.

The problem is that we pop our stack slot before we're completely done
resetting its state -- in particular clearing the PTE (sometimes that's
CONFIG_DEBUG_HIGHMEM).  If an interrupt happens before we actually clear
the PTE used for the last slot, that interrupt can reuse the slot in a
dirty state, which triggers a BUG in kmap_atomic().

Fix this by introducing kmap_atomic_idx() which reports the current slot
index without actually releasing it and use that to find the PTE and delay
the _pop() until after we're completely done.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reported-by: Christoph Hellwig <hch@infradead.org>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agomm,x86: fix kmap_atomic_push vs ioremap_32.c
Peter Zijlstra [Wed, 27 Oct 2010 22:32:57 +0000 (15:32 -0700)]
mm,x86: fix kmap_atomic_push vs ioremap_32.c

It appears i386 uses kmap_atomic infrastructure regardless of
CONFIG_HIGHMEM which results in a compile error when highmem is disabled.

Cure this by providing the needed few bits for both CONFIG_HIGHMEM and
CONFIG_X86_32.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoquota: Fix possible oops in __dquot_initialize()
Jan Kara [Mon, 18 Oct 2010 22:24:21 +0000 (00:24 +0200)]
quota: Fix possible oops in __dquot_initialize()

When quotaon(8) races with __dquot_initialize() or dqget() fails because
of EIO, ENOSPC, or similar error, we could possibly dereference NULL pointer
in inode->i_dquot[cnt]. Add proper checking.

Reported-by: Dmitry Monakhov <dmonakhov@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3: Update kernel-doc comments
Namhyung Kim [Mon, 18 Oct 2010 15:34:35 +0000 (00:34 +0900)]
ext3: Update kernel-doc comments

Update missing/broken argument descriptions and fix formatting.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd/2: fixed typos
Andrea Gelmini [Sat, 16 Oct 2010 13:19:14 +0000 (15:19 +0200)]
jbd/2: fixed typos

"wakup"

Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext2: fixed typo.
Andrea Gelmini [Sat, 16 Oct 2010 13:19:11 +0000 (15:19 +0200)]
ext2: fixed typo.

"excpet"

Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3: Fix debug messages in ext3_group_extend()
Namhyung Kim [Sat, 16 Oct 2010 16:11:23 +0000 (01:11 +0900)]
ext3: Fix debug messages in ext3_group_extend()

Fix a typo, break long lines and use E3FSBLK on ext3_fsblk_t.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Convert atomic_inc() to get_bh()
Namhyung Kim [Sat, 16 Oct 2010 08:11:02 +0000 (17:11 +0900)]
jbd: Convert atomic_inc() to get_bh()

Convert atomic_inc(&bh->b_count) to get_bh(bh) for consistency.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3: Remove misplaced BUFFER_TRACE() in ext3_truncate()
Namhyung Kim [Fri, 15 Oct 2010 11:03:02 +0000 (20:03 +0900)]
ext3: Remove misplaced BUFFER_TRACE() in ext3_truncate()

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Fix debug message in do_get_write_access()
Namhyung Kim [Wed, 13 Oct 2010 14:14:07 +0000 (23:14 +0900)]
jbd: Fix debug message in do_get_write_access()

'buffer_head' should be 'journal_head'.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Check return value of __getblk()
Namhyung Kim [Wed, 13 Oct 2010 08:17:18 +0000 (17:17 +0900)]
jbd: Check return value of __getblk()

Fail journal creation if __getblk() returns NULL.  unlikely() is
added because it is called in a loop and we've been OK without
the check until now.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3: Use DIV_ROUND_UP() on group desc block counting
Namhyung Kim [Mon, 11 Oct 2010 10:38:39 +0000 (19:38 +0900)]
ext3: Use DIV_ROUND_UP() on group desc block counting

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3: Return proper error code on ext3_fill_super()
Namhyung Kim [Mon, 11 Oct 2010 10:08:06 +0000 (19:08 +0900)]
ext3: Return proper error code on ext3_fill_super()

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3: Remove unnecessary casts on bh->b_data
Namhyung Kim [Sun, 10 Oct 2010 17:10:45 +0000 (02:10 +0900)]
ext3: Remove unnecessary casts on bh->b_data

bh->b_data is already a pointer to char so casts to 'char *' should
be meaningless. Remove them.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3: Cleanup ext3_setup_super()
Namhyung Kim [Sun, 10 Oct 2010 12:36:59 +0000 (21:36 +0900)]
ext3: Cleanup ext3_setup_super()

Fix mount-count check to emit warning only if s_max_mnt_count
is greater than 0 according to man tune2fs(8). Also removes
unnecessary casts.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoquota: Fix issuing of warnings from dquot_transfer
Jan Kara [Mon, 11 Oct 2010 13:22:21 +0000 (15:22 +0200)]
quota: Fix issuing of warnings from dquot_transfer

__dquot_transfer accidentally called flush_warnings for a wrong set of
dquots which could result in quota warnings being issued with a wrong
identification. Also when operation fails because of EDQUOT, there's no
need check for issuing information message about user getting below limits
(no transfer has actually happened).

Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoquota: fix dquot_disable vs dquot_transfer race v2
Dmitry [Sat, 9 Oct 2010 19:15:30 +0000 (23:15 +0400)]
quota: fix dquot_disable vs dquot_transfer race v2

I've got following lockup:
dquot_disable                              dquot_transfer
                                            ->dqget()
       sb_has_quota_active
dqopt->flags &= ~dquot_state_flag(f, cnt)      atomic_inc(dq->dq_count)
 ->drop_dquot_ref(sb, cnt);
    down_write(dqptr_sem)
    inode->i_dquot[cnt] = NULL              ->__dquot_transfer
invalidate_dquots(sb, cnt);        down_write(&dqptr_sem)
  ->wait for dq_wait_unused        inode->i_dquot = new_dquot
  /* wait forever */                            ^^^^New quota user^^^^^^

We cannot allow new references to dquots from inodes after drop_dquot_ref()
has removed them.  We have to recheck quota state under dqptr_sem and before
assignment, as we do it in dquot_initialize().

Signed-off-by: Dmitry Monakhov <dmonakhov@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Convert bitops to buffer fns
Namhyung Kim [Fri, 8 Oct 2010 11:05:06 +0000 (20:05 +0900)]
jbd: Convert bitops to buffer fns

Convert set/clear_bit(BH_JWrite, ...) to set/clear_buffer_jwrite()
for consistency.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext3/jbd: Avoid WARN() messages when failing to write the superblock
Darrick J. Wong [Mon, 4 Oct 2010 19:35:05 +0000 (12:35 -0700)]
ext3/jbd: Avoid WARN() messages when failing to write the superblock

This fixes a WARN backtrace in mark_buffer_dirty() that occurs during unmount
when the underlying block device is removed.  This bug has been seen on System
Z when removing all paths from a multipath-backed ext3 mount; on System P when
injecting enough PCI EEH errors to make the SCSI controller go offline; and
similar warnings have been seen (and patched) with ext2/ext4.

The super block update from a previous operation has marked the buffer as in
error, and the flag has to be cleared before doing the update. Similar changes
have been made to ext4 by commit 914258bf2cb22bf4336a1b1d90c551b4b11ca5aa.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Use offset_in_page() instead of manual calculation
Namhyung Kim [Mon, 4 Oct 2010 16:03:40 +0000 (01:03 +0900)]
jbd: Use offset_in_page() instead of manual calculation

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Remove unnecessary goto statement
Namhyung Kim [Mon, 4 Oct 2010 15:13:59 +0000 (00:13 +0900)]
jbd: Remove unnecessary goto statement

Remove goto statement which jumps to very next line. Also remove
target label because it is no longer used anywhere.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Use printk_ratelimited() in journal_alloc_journal_head()
Namhyung Kim [Mon, 4 Oct 2010 10:12:13 +0000 (19:12 +0900)]
jbd: Use printk_ratelimited() in journal_alloc_journal_head()

Use printk_ratelimited() instead of doing it manually.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agojbd: Move debug message into #ifdef area
Namhyung Kim [Mon, 4 Oct 2010 08:26:53 +0000 (17:26 +0900)]
jbd: Move debug message into #ifdef area

Move call to jbd_debug() into #ifdef CONFIG_JBD_DEBUG block because
'dropped' is declared there. The code could be compiled without this
change anyway, simply because jbd_debug() expands to nothing if
!CONFIG_JBD_DEBUG but IMHO it doesn't look good in general.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoext2: fix comment on ext2_try_to_allocate()
Namhyung Kim [Sun, 26 Sep 2010 06:31:00 +0000 (15:31 +0900)]
ext2: fix comment on ext2_try_to_allocate()

@handle doesn't exist in ext2. Remove it.
Also, fit comment header into kernel-doc format.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
13 years agoehea: Fixing statistics
Breno Leitao [Wed, 27 Oct 2010 08:45:14 +0000 (08:45 +0000)]
ehea: Fixing statistics

(Applied over Eric's "ehea: fix use after free" patch)

Currently ehea stats are broken. The bytes counters are got from
the hardware, while the packets counters are got from the device
driver. Also, the device driver counters are resetted during the
the down process, and the hardware aren't, causing some weird
numbers.

This patch just consolidates the packets and bytes on the device
driver.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: Fix lockdep warning after bond_vlan_rx_register()
Jarek Poplawski [Wed, 27 Oct 2010 07:08:22 +0000 (07:08 +0000)]
bonding: Fix lockdep warning after bond_vlan_rx_register()

Fix lockdep warning:
[   52.991402] ======================================================
[   52.991511] [ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ]
[   52.991569] 2.6.36-04573-g4b60626-dirty #65
[   52.991622] ------------------------------------------------------
[   52.991696] ip/4842 [HC0[0]:SC0[4]:HE1:SE0] is trying to acquire:
[   52.991758]  (&bond->lock){++++..}, at: [<efe4d300>] bond_set_multicast_list+0x60/0x2c0 [bonding]
[   52.991966]
[   52.991967] and this task is already holding:
[   52.992008]  (&bonding_netdev_addr_lock_key){+.....}, at: [<c04e5530>] dev_mc_sync+0x50/0xa0
[   52.992008] which would create a new lock dependency:
[   52.992008]  (&bonding_netdev_addr_lock_key){+.....} -> (&bond->lock){++++..}
[   52.992008]
[   52.992008] but this new dependency connects a SOFTIRQ-irq-safe lock:
[   52.992008]  (&(&mc->mca_lock)->rlock){+.-...}
[   52.992008] ... which became SOFTIRQ-irq-safe at:
[   52.992008]   [<c0272beb>] __lock_acquire+0x96b/0x1960
[   52.992008]   [<c027415e>] lock_acquire+0x7e/0xf0
[   52.992008]   [<c05f356d>] _raw_spin_lock_bh+0x3d/0x50
[   52.992008]   [<c0584e40>] mld_ifc_timer_expire+0xf0/0x280
[   52.992008]   [<c024cee6>] run_timer_softirq+0x146/0x310
[   52.992008]   [<c024591d>] __do_softirq+0xad/0x1c0
[   52.992008]
[   52.992008] to a SOFTIRQ-irq-unsafe lock:
[   52.992008]  (&bond->lock){++++..}
[   52.992008] ... which became SOFTIRQ-irq-unsafe at:
[   52.992008] ...  [<c0272c3b>] __lock_acquire+0x9bb/0x1960
[   52.992008]   [<c027415e>] lock_acquire+0x7e/0xf0
[   52.992008]   [<c05f36b8>] _raw_write_lock+0x38/0x50
[   52.992008]   [<efe4cbe4>] bond_vlan_rx_register+0x24/0x70 [bonding]
[   52.992008]   [<c0598010>] register_vlan_dev+0xc0/0x280
[   52.992008]   [<c0599f3a>] vlan_newlink+0xaa/0xd0
[   52.992008]   [<c04ed4b4>] rtnl_newlink+0x404/0x490
[   52.992008]   [<c04ece35>] rtnetlink_rcv_msg+0x1e5/0x220
[   52.992008]   [<c050424e>] netlink_rcv_skb+0x8e/0xb0
[   52.992008]   [<c04ecbac>] rtnetlink_rcv+0x1c/0x30
[   52.992008]   [<c0503bfb>] netlink_unicast+0x24b/0x290
[   52.992008]   [<c0503e37>] netlink_sendmsg+0x1f7/0x310
[   52.992008]   [<c04cd41c>] sock_sendmsg+0xac/0xe0
[   52.992008]   [<c04ceb80>] sys_sendmsg+0x130/0x230
[   52.992008]   [<c04cf04e>] sys_socketcall+0xde/0x280
[   52.992008]   [<c0202d10>] sysenter_do_call+0x12/0x36
[   52.992008]
[   52.992008] other info that might help us debug this:
...
[ Full info at netdev: Wed, 27 Oct 2010 12:24:30 +0200
  Subject: [BUG net-2.6 vlan/bonding] lockdep splats ]

Use BH variant of write_lock(&bond->lock) (as elsewhere in bond_main)
to prevent this dependency.

Fixes commit f35188faa0fbabefac476536994f4b6f3677380f [v2.6.36]

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jay Vosburgh <fubar@us.ibm.com>
13 years agotunnels: Fix tunnels change rcu protection
Pavel Emelyanov [Wed, 27 Oct 2010 05:43:53 +0000 (05:43 +0000)]
tunnels: Fix tunnels change rcu protection

After making rcu protection for tunnels (ipip, gre, sit and ip6) a bug
was introduced into the SIOCCHGTUNNEL code.

The tunnel is first unlinked, then addresses change, then it is linked
back probably into another bucket. But while changing the parms, the
hash table is unlocked to readers and they can lookup the improper tunnel.

Respective commits are b7285b79 (ipip: get rid of ipip_lock), 1507850b
(gre: get rid of ipgre_lock), 3a43be3c (sit: get rid of ipip6_lock) and
94767632 (ip6tnl: get rid of ip6_tnl_lock).

The quick fix is to wait for quiescent state to pass after unlinking,
but if it is inappropriate I can invent something better, just let me
know.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agolocks: turn lock_flocks into a spinlock
Arnd Bergmann [Wed, 27 Oct 2010 19:39:58 +0000 (21:39 +0200)]
locks: turn lock_flocks into a spinlock

Nothing depends on lock_flocks using the BKL
any more, so we can do the switch over to
a private spinlock.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
13 years agofasync: re-organize fasync entry insertion to allow it under a spinlock
Linus Torvalds [Wed, 27 Oct 2010 16:38:12 +0000 (12:38 -0400)]
fasync: re-organize fasync entry insertion to allow it under a spinlock

You currently cannot use "fasync_helper()" in an atomic environment to
insert a new fasync entry, because it will need to allocate the new
"struct fasync_struct".

Yet fcntl_setlease() wants to call this under lock_flocks(), which is in
the process of being converted from the BKL to a spinlock.

In order to fix this, this abstracts out the actual fasync list
insertion and the fasync allocations into functions of their own, and
teaches fs/locks.c to pre-allocate the fasync_struct entry.  That way
the actual list insertion can happen while holding the required
spinlock.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bfields@redhat.com: rebase on top of my changes to Arnd's patch]
Tested-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
13 years agolocks/nfsd: allocate file lock outside of spinlock
Arnd Bergmann [Wed, 27 Oct 2010 13:46:08 +0000 (15:46 +0200)]
locks/nfsd: allocate file lock outside of spinlock

As suggested by Christoph Hellwig, this moves allocation
of new file locks out of generic_setlease into the
callers, nfs4_open_delegation and fcntl_setlease in order
to allow GFP_KERNEL allocations when lock_flocks has
become a spinlock.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: J. Bruce Fields <bfields@redhat.com>
13 years agolockd: fix nlmsvc_notify_blocked locking
J. Bruce Fields [Tue, 26 Oct 2010 22:25:30 +0000 (18:25 -0400)]
lockd: fix nlmsvc_notify_blocked locking

nlmsvc_notify_blocked walks the nlm_blocked list,
which requires nlm_blocked_lock.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
13 years agolockd: push lock_flocks down
Arnd Bergmann [Tue, 26 Oct 2010 20:55:40 +0000 (22:55 +0200)]
lockd: push lock_flocks down

lockd should use lock_flocks() instead of lock_kernel()
to lock against posix locks accessing the i_flock list.

This is a prerequisite to turning lock_flocks into a
spinlock.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: J. Bruce Fields <bfields@redhat.com>
13 years agocaif-u5500: Build config for CAIF shared mem driver
Amarnath Revanna [Wed, 27 Oct 2010 08:34:42 +0000 (08:34 +0000)]
caif-u5500: Build config for CAIF shared mem driver

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif-u5500: CAIF shared memory mailbox interface
Amarnath Revanna [Wed, 27 Oct 2010 08:34:41 +0000 (08:34 +0000)]
caif-u5500: CAIF shared memory mailbox interface

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif-u5500: CAIF shared memory transport protocol
sjur.brandeland@stericsson.com [Wed, 27 Oct 2010 08:34:40 +0000 (08:34 +0000)]
caif-u5500: CAIF shared memory transport protocol

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif-u5500: Adding shared memory include
Amarnath Revanna [Wed, 27 Oct 2010 08:34:39 +0000 (08:34 +0000)]
caif-u5500: Adding shared memory include

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/isdn: delete double assignment
Julia Lawall [Tue, 26 Oct 2010 02:20:56 +0000 (02:20 +0000)]
drivers/isdn: delete double assignment

Delete successive assignments to the same location.  In the first case, the
hscx array has two elements, so change the assignment to initialize the
second one.  In the second case, the two assignments are simply identical.
Furthermore, neither is necessary, because the effect of the assignment is
only visible in the next line, in the assignment in the if test.  The patch
inlines the right hand side value in the latter assignment and pulls that
assignment out of the if test.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/typhoon.c: delete double assignment
Julia Lawall [Tue, 26 Oct 2010 00:25:36 +0000 (00:25 +0000)]
drivers/net/typhoon.c: delete double assignment

Delete successive assignments to the same location.  The current definition
does not initialize the respRing structure, which has the same type as the
cmdRing structure, so initialize that one instead.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: David Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/sb1000.c: delete double assignment
Julia Lawall [Tue, 26 Oct 2010 00:25:34 +0000 (00:25 +0000)]
drivers/net/sb1000.c: delete double assignment

The other code around these duplicated assignments initializes the 0 1 2
and 3 elements of an array, so change the initialization of the
rx_session_id array to do the same.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: define valid vlan id range
Sony Chacko [Tue, 26 Oct 2010 17:53:09 +0000 (17:53 +0000)]
qlcnic: define valid vlan id range

4095 vlan id is reserved and should not be use.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: reduce rx ring size
Sony Chacko [Tue, 26 Oct 2010 17:53:08 +0000 (17:53 +0000)]
qlcnic: reduce rx ring size

If eswitch is enabled, rcv ring size can be reduce, as
physical port is partition-ed.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix mac learning
amit salecha [Tue, 26 Oct 2010 17:53:07 +0000 (17:53 +0000)]
qlcnic: fix mac learning

In failover bonding case, same mac address can be programmed on other slave function.
Fw will delete old entry (original func) associated with that mac address.
Need to reporgram mac address, if failover again happen to original function.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoehea: fix use after free
Eric Dumazet [Tue, 26 Oct 2010 19:21:07 +0000 (19:21 +0000)]
ehea: fix use after free

ehea_start_xmit() dereferences skb after its freeing in ehea_xmit3() to
get vlan tags.

Move the offending block before the potential ehea_xmit3() call.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoinetpeer: __rcu annotations
Eric Dumazet [Mon, 25 Oct 2010 23:55:38 +0000 (23:55 +0000)]
inetpeer: __rcu annotations

Adds __rcu annotations to inetpeer
(struct inet_peer)->avl_left
(struct inet_peer)->avl_right

This is a tedious cleanup, but removes one smp_wmb() from link_to_pool()
since we now use more self documenting rcu_assign_pointer().

Note the use of RCU_INIT_POINTER() instead of rcu_assign_pointer() in
all cases we dont need a memory barrier.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agofib_rules: __rcu annotates ctarget
Eric Dumazet [Tue, 26 Oct 2010 09:24:55 +0000 (09:24 +0000)]
fib_rules: __rcu annotates ctarget

Adds __rcu annotation to (struct fib_rule)->ctarget

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotunnels: add __rcu annotations
Eric Dumazet [Mon, 25 Oct 2010 21:01:26 +0000 (21:01 +0000)]
tunnels: add __rcu annotations

Add __rcu annotations to :
        (struct ip_tunnel)->prl
        (struct ip_tunnel_prl_entry)->next
        (struct xfrm_tunnel)->next
struct xfrm_tunnel *tunnel4_handlers
struct xfrm_tunnel *tunnel64_handlers

And use appropriate rcu primitives to reduce sparse warnings if
CONFIG_SPARSE_RCU_POINTER=y

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add __rcu annotations to protocol
Eric Dumazet [Mon, 25 Oct 2010 21:02:28 +0000 (21:02 +0000)]
net: add __rcu annotations to protocol

Add __rcu annotations to :
        struct net_protocol *inet_protos
        struct net_protocol *inet6_protos

And use appropriate casts to reduce sparse warnings if
CONFIG_SPARSE_RCU_POINTER=y

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: add __rcu annotations to routes.c
Eric Dumazet [Mon, 25 Oct 2010 21:02:07 +0000 (21:02 +0000)]
ipv4: add __rcu annotations to routes.c

Add __rcu annotations to :
        (struct dst_entry)->rt_next
        (struct rt_hash_bucket)->chain

And use appropriate rcu primitives to reduce sparse warnings if
CONFIG_SPARSE_RCU_POINTER=y

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlge: bugfix: Restoring the vlan setting.
Ron Mercer [Wed, 27 Oct 2010 04:58:12 +0000 (04:58 +0000)]
qlge: bugfix: Restoring the vlan setting.

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: Schedule/Destroy worker thread in probe()/remove() rather than open()/close()
Somnath Kotur [Mon, 25 Oct 2010 23:01:03 +0000 (23:01 +0000)]
be2net: Schedule/Destroy worker thread in probe()/remove() rather than open()/close()

When async mcc compls are rcvd on an i/f that is down (and so interrupts are disabled)
they just lie unprocessed in the compl queue.The compl queue can eventually get filled
up and cause the BE to lock up.The fix is to use be_worker to reap mcc compls when the
i/f is down.be_worker is now launched in be_probe() and canceled in be_remove().

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: fix refcnt problem related to POSTDAD state
Ursula Braun [Sun, 24 Oct 2010 23:06:43 +0000 (23:06 +0000)]
ipv6: fix refcnt problem related to POSTDAD state

After running this bonding setup script
    modprobe bonding miimon=100 mode=0 max_bonds=1
    ifconfig bond0 10.1.1.1/16
    ifenslave bond0 eth1
    ifenslave bond0 eth3
on s390 with qeth-driven slaves, modprobe -r fails with this message
    unregister_netdevice: waiting for bond0 to become free. Usage count = 1
due to twice detection of duplicate address.
Problem is caused by a missing decrease of ifp->refcnt in addrconf_dad_failure.
An extra call of in6_ifa_put(ifp) solves it.
Problem has been introduced with commit f2344a131bccdbfc5338e17fa71a807dee7944fa.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: NETIF_F_HW_CSUM does not imply FCoE CRC offload
Ben Hutchings [Fri, 22 Oct 2010 04:38:26 +0000 (04:38 +0000)]
net: NETIF_F_HW_CSUM does not imply FCoE CRC offload

NETIF_F_HW_CSUM indicates the ability to update an TCP/IP-style 16-bit
checksum with the checksum of an arbitrary part of the packet data,
whereas the FCoE CRC is something entirely different.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Cc: stable@kernel.org [2.6.32+]
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Fix some corner cases in dev_can_checksum()
Ben Hutchings [Fri, 22 Oct 2010 04:12:19 +0000 (04:12 +0000)]
net: Fix some corner cases in dev_can_checksum()

dev_can_checksum() incorrectly returns true in these cases:

1. The skb has both out-of-band and in-band VLAN tags and the device
   supports checksum offload for the encapsulated protocol but only with
   one layer of encapsulation.
2. The skb has a VLAN tag and the device supports generic checksumming
   but not in conjunction with VLAN encapsulation.

Rearrange the VLAN tag checks to avoid these.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agogianfar: Fix crashes on RX path (Was Re: [Bugme-new] [Bug 19692] New: linux-2.6.36...
Jarek Poplawski [Tue, 19 Oct 2010 00:06:36 +0000 (00:06 +0000)]
gianfar: Fix crashes on RX path (Was Re: [Bugme-new] [Bug 19692] New: linux-2.6.36-rc5 crash with gianfar ethernet at full line rate traffic)

The rx_recycle queue is global per device but can be accesed by many
napi handlers at the same time, so it needs full skb_queue primitives
(with locking). Otherwise, various crashes caused by broken skbs are
possible.

This patch resolves, at least partly, bugzilla bug 19692. (Because of
some doubts that there could be still something around which is hard
to reproduce my proposal is to leave this bug opened for a month.)

Fixes commit: 0fd56bb5be6455d0d42241e65aed057244665e5e ("gianfar: Add
support for skb recycling")

Reported-by: emin ak <eminak71@gmail.com>
Tested-by: emin ak <eminak71@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
CC: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMN10300: Save frame pointer in thread_info struct rather than global var
David Howells [Wed, 27 Oct 2010 16:29:01 +0000 (17:29 +0100)]
MN10300: Save frame pointer in thread_info struct rather than global var

Save the current exception frame pointer in the thread_info struct rather than
in a global variable as the latter makes SMP tricky, especially when preemption
is also enabled.

This also replaces __frame with current_frame() and rearranges header file
inclusions to make it all compile.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
13 years agoMN10300: Change "Matsushita" to "Panasonic".
Akira Takeuchi [Wed, 27 Oct 2010 16:29:00 +0000 (17:29 +0100)]
MN10300: Change "Matsushita" to "Panasonic".

Change externally visible "Matsushita" instances to "Panasonic" throughout the
MN10300 arch code.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Create a defconfig for the ASB2364 board
Akira Takeuchi [Wed, 27 Oct 2010 16:29:00 +0000 (17:29 +0100)]
MN10300: Create a defconfig for the ASB2364 board

Create a defconfig for the ASB2364 board.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Update the ASB2303 defconfig
Akira Takeuchi [Wed, 27 Oct 2010 16:28:59 +0000 (17:28 +0100)]
MN10300: Update the ASB2303 defconfig

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: ASB2364: Add support for SMSC911X and SMC911X
Akira Takeuchi [Wed, 27 Oct 2010 16:28:58 +0000 (17:28 +0100)]
MN10300: ASB2364: Add support for SMSC911X and SMC911X

Add support for SMSC911X and SMC911X for the ASB2364 unit.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: steve.glendinning@smsc.com
cc: netdev@vger.kernel.org

13 years agoMN10300: ASB2364: Handle the IRQ multiplexer in the FPGA
David Howells [Wed, 27 Oct 2010 16:28:58 +0000 (17:28 +0100)]
MN10300: ASB2364: Handle the IRQ multiplexer in the FPGA

Handle the IRQ multiplexer in the FPGA by implementing a cascade interrupt
driver for it.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Generic time support
Mark Salter [Wed, 27 Oct 2010 16:28:57 +0000 (17:28 +0100)]
MN10300: Generic time support

Implement generic time support for MN10300.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Specify an ELF HWCAP flag for MN10300 Atomic Operations Unit support
Mark Salter [Wed, 27 Oct 2010 16:28:56 +0000 (17:28 +0100)]
MN10300: Specify an ELF HWCAP flag for MN10300 Atomic Operations Unit support

Use an ELF HWCAP flag to indicate to the process that the CPU provides LL/SC
equivalent atomic operations unit support in addition to BSET/BCLR.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Map userspace atomic op regs as a vmalloc page
Mark Salter [Wed, 27 Oct 2010 16:28:56 +0000 (17:28 +0100)]
MN10300: Map userspace atomic op regs as a vmalloc page

The AM34 processor has an atomic operation that's the equivalent of LL/SC on
other architectures.  However, rather than being done through a pair of
instructions, it's driven by writing to a pair of memory-mapped CPU control
registers.

One set of these registers (AARU/ADRU/ASRU) is available for use by userspace,
but for userspace to access them a PTE must be set up to cover the region.
This is done by dedicating the first vmalloc region page to this purpose,
setting the permissions on its PTE such that userspace can access the page.

glibc is hardcoded to expect the registers to be there.

The way atomic ops are done through these registers is straightforward:

 (1) Write the address of the word you wish to access into AARU.  This causes
     the CPU to go and fetch that word and load it into ADRU.  The status bits
     are also cleared in ASRU.

 (2) The current data value is read from the ADRU register and modified.

 (3) To alter the data in RAM, the revised data is written back to the ADRU
     register, which causes the CPU to attempt to write it back.

 (4) The ASRU.RW flag (ASRU read watch), ASRU.LW flag (bus lock watch),
     ASRU.IW (interrupt watch) and the ASRU.BW (bus error watch) flags then
     must be checked to confirm that the operation wasn't aborted.  If any of
     the watches have been set to true, the operation was aborted.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: And Panasonic AM34 subarch and implement SMP
Akira Takeuchi [Wed, 27 Oct 2010 16:28:55 +0000 (17:28 +0100)]
MN10300: And Panasonic AM34 subarch and implement SMP

Implement the Panasonic MN10300 AM34 CPU subarch and implement SMP support for
MN10300.  Also implement support for the MN2WS0060 processor and the ASB2364
evaluation board which are AM34 based.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Delete idle_timestamp from irq_cpustat_t
Akira Takeuchi [Wed, 27 Oct 2010 16:28:54 +0000 (17:28 +0100)]
MN10300: Delete idle_timestamp from irq_cpustat_t

Delete idle_timestamp from irq_cpustat_t as it's an unread relic.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make various interrupt priority settings configurable
Akira Takeuchi [Wed, 27 Oct 2010 16:28:54 +0000 (17:28 +0100)]
MN10300: Make various interrupt priority settings configurable

Make the settings of interrupt priorities used by various services configurable
at run time.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Optimise do_csum()
Akira Takeuchi [Wed, 27 Oct 2010 16:28:53 +0000 (17:28 +0100)]
MN10300: Optimise do_csum()

Optimise do_csum() to gang up the loads so they're less likely to get
interruptions between.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Implement atomic ops using atomic ops unit
Mark Salter [Wed, 27 Oct 2010 16:28:52 +0000 (17:28 +0100)]
MN10300: Implement atomic ops using atomic ops unit

Implement atomic ops using the atomic ops unit available in the AM34 CPU.  This
allows the equivalent of the LL/SC instructions to be found on other CPUs.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make the FPU operate in non-lazy mode under SMP
Akira Takeuchi [Wed, 27 Oct 2010 16:28:52 +0000 (17:28 +0100)]
MN10300: Make the FPU operate in non-lazy mode under SMP

Make the FPU operate in non-lazy mode under SMP so that when the process that
is currently using the FPU migrates to a different CPU, we don't have to ping
its previous CPU to flush the FPU context.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: SMP TLB flushing
Akira Takeuchi [Wed, 27 Oct 2010 16:28:51 +0000 (17:28 +0100)]
MN10300: SMP TLB flushing

Implement global TLB flushing for MN10300.  This will be used by the AM34 which
is SMP capable.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control
Akira Takeuchi [Wed, 27 Oct 2010 16:28:50 +0000 (17:28 +0100)]
MN10300: Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control

Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control as the bits
are a more suitable layout.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make the use of PIDR to mark TLB entries controllable
Akira Takeuchi [Wed, 27 Oct 2010 16:28:49 +0000 (17:28 +0100)]
MN10300: Make the use of PIDR to mark TLB entries controllable

Make controllable the use of the PIDR register to mark TLB entries as belonging
to particular processes.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Rename __flush_tlb*() to local_flush_tlb*()
David Howells [Wed, 27 Oct 2010 16:28:49 +0000 (17:28 +0100)]
MN10300: Rename __flush_tlb*() to local_flush_tlb*()

Rename __flush_tlb*() to local_flush_tlb*() as it's more appropriate, and ready
to differentiate local from global TLB flushes when SMP is introduced.

Whilst we're at it, get rid of __flush_tlb_global() and make
local_flush_tlb_page() take an mm_struct pointer rather than VMA pointer.

Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: AM34 erratum requires MMUCTR read and write on exception entry
Akira Takeuchi [Wed, 27 Oct 2010 16:28:48 +0000 (17:28 +0100)]
MN10300: AM34 erratum requires MMUCTR read and write on exception entry

An AM34 erratum requires MMUCTR read and write on entry to certain exceptions,
prior to EPSW.NMID being cleared to allow NMIs to happen.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Make the boot wrapper able to use writeback caching
Akira Takeuchi [Wed, 27 Oct 2010 16:28:47 +0000 (17:28 +0100)]
MN10300: Make the boot wrapper able to use writeback caching

Make the boot wrapper able to use writeback caching, including flushing the
cache before jumping to the main kernel.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Cache: Implement SMP global cache flushing
Akira Takeuchi [Wed, 27 Oct 2010 16:28:47 +0000 (17:28 +0100)]
MN10300: Cache: Implement SMP global cache flushing

Implement SMP global cache flushing for MN10300.  This will be used by the AM34
which is SMP capable.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
13 years agoMN10300: Allow some cacheflushes to be avoided if cache snooping is available
David Howells [Wed, 27 Oct 2010 16:28:46 +0000 (17:28 +0100)]
MN10300: Allow some cacheflushes to be avoided if cache snooping is available

The AM34 core is able to do cache snooping, and so can skip some of the cache
flushing.

Signed-off-by: David Howells <dhowells@redhat.com>