safe/jmp/linux-2.6
14 years agomtd: nand: Add MPC5121 NAND Flash Controller driver
Anatolij Gustschin [Mon, 15 Feb 2010 17:35:05 +0000 (18:35 +0100)]
mtd: nand: Add MPC5121 NAND Flash Controller driver

Adds NAND Flash Controller driver for MPC5121 Revision 2.
All device features, except hardware ECC and power management,
are supported.

Signed-off-by: Piotr Ziecik <kosmo@semihalf.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nand_bcm: fix hot spin and code duplication
Roel Kluin [Fri, 22 Jan 2010 21:22:52 +0000 (22:22 +0100)]
mtd: nand_bcm: fix hot spin and code duplication

In the branch where pagesize equalled NAND_DATA_ACCESS_SIZE, NumToRead
wasn't decremented in the `while (numToRead > 11)' loop.
Also the first and last while loops were duplicated in both branches.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Leo Chen <leochen@broadcom.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: omap2 fix prefetch mode read issue
Vimal Singh [Thu, 7 Jan 2010 06:46:26 +0000 (12:16 +0530)]
mtd: omap2 fix prefetch mode read issue

There is a bug in nand prefetch read routine, which comes into effect
only if nand device is a 16-bit device (as we have in zoom boards).
This bug is effective only with below combination of conditions:
1. nand deivce, in use, is a 16 bit device
2. nand driver supports 'subpage' read
3. SW ECC is in use

This was not seen old  kernel (ex: .23), because when, in early days,
we tested this (nand prefetch read in LDP boards) there was no
'subpage read' support.
Later when we had subpage read in (.27) kernel, we had hw ecc enabled
always in our internal tree. So, we missed this bug.

This patch fixes the issue.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: omap2: correct 'info' pointer in 'omap_nand_remove'
Vimal Singh [Tue, 5 Jan 2010 10:31:08 +0000 (16:01 +0530)]
mtd: omap2: correct 'info' pointer in 'omap_nand_remove'

Removing OMAP NAND driver, when loaded as a module, gives error and
does not get success. This fixes this and makes driver loadable and
removable run time.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: omap2: fixing compilation warning
Vimal Singh [Tue, 5 Jan 2010 07:19:24 +0000 (12:49 +0530)]
mtd: omap2: fixing compilation warning

Fixing below warning in compilation:
drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref':
drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of
'omap_nand_dma_transfer' discards qualifiers from pointer target type

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: move more manufacturers to the common cfi.h header file
Guillaume LECERF [Tue, 15 Dec 2009 22:01:06 +0000 (23:01 +0100)]
mtd: move more manufacturers to the common cfi.h header file

Move MANUFACTURER_MACRONIX and MANUFACTURER_SST definitions to the
include/linux/mtd/cfi.h header file and rename them to CFI_MFR_MACRONIX and
CFI_MFR_SST.

All references in drivers/mtd/chips/cfi_cmdset_0002.c are updated to reflect
this.

Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: mxc_nand: add RESET command support
Eric Benard [Wed, 9 Dec 2009 11:12:43 +0000 (12:12 +0100)]
mtd: mxc_nand: add RESET command support

mxc_nand driver must support the RESET Command in order to support
Micron NAND which need a reset before any other command.

Signed-off-by: Eric Benard <eric@eukrea.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: inftl: misplaced parenthesis in find_boot_record
Roel Kluin [Mon, 15 Feb 2010 21:57:24 +0000 (22:57 +0100)]
mtd: inftl: misplaced parenthesis in find_boot_record

The parenthesis was misplaced, upon error a one was shown.

[dwmw2: Fix the code not to do the assignment within the if() statement]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: OneNAND: do not use DMA if oops in progress
Aaro Koskinen [Wed, 10 Feb 2010 17:03:19 +0000 (19:03 +0200)]
mtd: OneNAND: do not use DMA if oops in progress

Otherwise we may hang if we are called from panic() through mtdoops.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nand: add lock/unlock routines
Vimal Singh [Mon, 8 Feb 2010 10:20:49 +0000 (15:50 +0530)]
mtd: nand: add lock/unlock routines

Add nand lock / unlock routines. At least 'micron' parts
support this.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nand: create a helper verification function
Vimal Singh [Wed, 3 Feb 2010 08:42:24 +0000 (14:12 +0530)]
mtd: nand: create a helper verification function

... verification for 'nand_erase_nand'

These checks are expected to be used by 'nand_lock' and 'nand_unlock'
routines too. As all these three are block aligned operations.
So, creating a helper function for this makes sense.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoJFFS2: avoid using C++ keyword `new' in userspace-visible header
Andrew Morton [Tue, 2 Feb 2010 22:43:10 +0000 (14:43 -0800)]
JFFS2: avoid using C++ keyword `new' in userspace-visible header

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=14995

Reported-by: R. Diez <rdiezmail-kernelbugzilla@yahoo.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: maps: ceiva: do not return random numbers
Artem Bityutskiy [Tue, 9 Feb 2010 11:42:39 +0000 (13:42 +0200)]
mtd: maps: ceiva: do not return random numbers

When machine_is_ceiva() returns zero, 'clps_setup_flash()' returns a
value of an unitialized variable. Fix this.

Spotted by David Binderman.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtdchar: Register the full range of minor numbers
Ben Hutchings [Fri, 29 Jan 2010 21:00:04 +0000 (21:00 +0000)]
mtdchar: Register the full range of minor numbers

register_chrdev() registers minor numbers up to 255, but we can now
potentially have much larger numbers.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: Raise limit on block device minor numbers
Ben Hutchings [Fri, 29 Jan 2010 20:59:53 +0000 (20:59 +0000)]
mtd: Raise limit on block device minor numbers

add_mtd_blktrans_dev() imposes a maximum of 257 devices per block
translator.  This was presumably meant to prevent overflow back in the
days of 8-bit minor numbers.  Instead, check against MINORMASK and the
limits of the partition naming scheme.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: Replace static array of devices with an idr structure
Ben Hutchings [Fri, 29 Jan 2010 20:59:42 +0000 (20:59 +0000)]
mtd: Replace static array of devices with an idr structure

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoidr: export idr_get_next()
Ben Hutchings [Fri, 29 Jan 2010 20:59:17 +0000 (20:59 +0000)]
idr: export idr_get_next()

idr_get_next() was accidentally not exported when added.  It is about
to be used by mtdcore, which may be built as a module.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: mtdblock: Dynamically allocate cache info structures
Ben Hutchings [Fri, 29 Jan 2010 20:58:37 +0000 (20:58 +0000)]
mtd: mtdblock: Dynamically allocate cache info structures

Since we allocate struct mtd_blktrans_dev for each block device, we
can add our own structure members to the end.  Therefore embed
struct mtd_blktrans_dev in struct mtdblk_dev and remove the static
array of struct mtdblk_dev.  Also remove the redundant pointer to
struct mtd_info.

This is preparation for removing the static limit on the number of MTD
devices.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: Remove unnecessary comparisons with MAX_MTD_DEVICES
Ben Hutchings [Fri, 29 Jan 2010 20:58:23 +0000 (20:58 +0000)]
mtd: Remove unnecessary comparisons with MAX_MTD_DEVICES

MAX_MTD_DEVICES is about to be removed.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nandsim: Define CONFIG_NANDSIM_MAX_PARTS and use it instead of MAX_MTD_DEVICES
Ben Hutchings [Fri, 29 Jan 2010 20:58:08 +0000 (20:58 +0000)]
mtd: nandsim: Define CONFIG_NANDSIM_MAX_PARTS and use it instead of MAX_MTD_DEVICES

MAX_MTD_DEVICES is about to be removed.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: Use get_mtd_device_nm() to find named device in get_sb_mtd()
Ben Hutchings [Fri, 29 Jan 2010 20:57:18 +0000 (20:57 +0000)]
mtd: Use get_mtd_device_nm() to find named device in get_sb_mtd()

This removes the need to know the number of MTD devices.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: Introduce and use iteration macro for reading the MTD device table
Ben Hutchings [Fri, 29 Jan 2010 20:57:11 +0000 (20:57 +0000)]
mtd: Introduce and use iteration macro for reading the MTD device table

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: change positive error return into negative
Roel Kluin [Fri, 29 Jan 2010 09:35:04 +0000 (10:35 +0100)]
mtd: change positive error return into negative

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: maps: Blackfin async: rename local funcs to avoid common clashes
Mike Frysinger [Sun, 17 Jan 2010 15:52:46 +0000 (10:52 -0500)]
mtd: maps: Blackfin async: rename local funcs to avoid common clashes

There are new Blackfin MMR helper functions that use the same name as some
of the local functions in this driver, so have the driver use more specific
names to avoid the issue.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: fix different address space noise
H Hartley Sweeten [Fri, 15 Jan 2010 18:25:38 +0000 (11:25 -0700)]
mtd: fix different address space noise

In mtd_ioctl MEMGETREGIONINFO the region_user_info pointer ur
is cast in __kernel space. This produces a number of sparse warnings
like:

warning: cast removes address space of expression
warning: incorrect type in initializer (different address spaces)
   expected unsigned int const [noderef] <asn:1>*register __p
   got unsigned int *<noident>

Since argp is already a void __user * just use it dirrectly without
the cast and make ur a __user *.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: quiet sparse noise in cfi.h
H Hartley Sweeten [Fri, 15 Jan 2010 18:09:32 +0000 (11:09 -0700)]
mtd: quiet sparse noise in cfi.h

In the inline function cfi_build_cmd_addr, the cast of cmd_ofs to an
uint8_t produces a sparse warning of the type:

warning: cast truncates bits from constant value (2aa becomes aa)

Quiet the warning by masking cmd_ofs with 0xff and remove the cast.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: ixp4xx: fix reading from half-word boundary
Jon Ringle [Wed, 13 Jan 2010 14:36:10 +0000 (09:36 -0500)]
mtd: ixp4xx: fix reading from half-word boundary

Fix handling of reads that don't start on a half-word boundary.

Signed-off-by: Jon Ringle <jon@ringle.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: mxc-nand: don't disable clock in mxcnd-suspend
Uwe Kleine-König [Mon, 11 Jan 2010 16:53:16 +0000 (17:53 +0100)]
mtd: mxc-nand: don't disable clock in mxcnd-suspend

The clock must already be off after mtd->suspend.  Disabling it again
results in an negative overflow of the clock usage count.  This didn't
hurt as mxcnd_resume undid it after wake up.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: mxc-nand: no need to check for validity of platform driver data
Uwe Kleine-König [Mon, 11 Jan 2010 14:05:35 +0000 (15:05 +0100)]
mtd: mxc-nand: no need to check for validity of platform driver data

The probe function calls platform_set_drvdata with a valid pointer when
the probe is successful.  As mxcnd_suspend and mxcnd_resume are only
called on bound devices, platform_get_drvdata always returns non-NULL.

This fix isn't critical as the pointer is always valid so it doesn't
matter if the compiler generated code for it or not.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: cfi: remove unneeded NULL checks
Jiri Slaby [Sun, 10 Jan 2010 09:01:19 +0000 (10:01 +0100)]
mtd: cfi: remove unneeded NULL checks

In cfi_intelext_setup and cfi_amdstd_setup, mtd is never NULL.
Remove unnecessary checks.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nand: make Open Firmware device id constant
Márton Németh [Sat, 9 Jan 2010 14:10:46 +0000 (15:10 +0100)]
mtd: nand: make Open Firmware device id constant

The match_table field of the struct of_device_id is constant in <linux/of_platform.h>
so it is worth to make xps2_of_match also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nand: make USB device id constant
Márton Németh [Sat, 9 Jan 2010 14:10:40 +0000 (15:10 +0100)]
mtd: nand: make USB device id constant

The id_table field of the struct usb_device_id is constant in <linux/usb.h>
so it is worth to make alauda_table also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nand: make PCI device id constant
Márton Németh [Sat, 9 Jan 2010 14:10:34 +0000 (15:10 +0100)]
mtd: nand: make PCI device id constant

The id_table field of the struct pci_driver is constant in <linux/pci.h>
so it is worth to make cafe_nand_tbl also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nandsim: fix spelling
Andrey Yurovsky [Thu, 17 Dec 2009 20:31:20 +0000 (12:31 -0800)]
mtd: nandsim: fix spelling

s/nanodeconds/nanoseconds

Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: orion_nand: Fix build failure caused by typo
Peter Huewe [Thu, 7 Jan 2010 01:51:13 +0000 (02:51 +0100)]
mtd: orion_nand: Fix build failure caused by typo

Commit e99030609e27abff7e1a868cb56384c678b09984 ("mtd: orion_nand.c: add
error handling and use resource_size()") introduced a build error -- it
assigns something to a undeclared variable 'err', whereas the rest of
the code uses 'ret' for this task.

This patch fixes this typo and thus removes the build failure.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
14 years agomtd: Remove now-defunct ts7250 nand driver
H Hartley Sweeten [Tue, 5 Jan 2010 21:59:58 +0000 (14:59 -0700)]
mtd: Remove now-defunct ts7250 nand driver

The ts72xx platform has been updated to use the generic platform nand
driver (plat_nand.c).  This removes the now-defunct ts7250.c nand driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Matthieu Crapet <mcrapet@gmail.com>
Cc: Jesse Off <joff@embeddedARM.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: Update ep93xx/ts72xx to use generic platform nand driver
H Hartley Sweeten [Tue, 5 Jan 2010 21:59:56 +0000 (14:59 -0700)]
mtd: Update ep93xx/ts72xx to use generic platform nand driver

Update the ts72xx platform's nand driver support.

This changes the ts72xx platform from using a custom nand driver
(ts7250.c) to the generic platform nand driver (plat_nand.c).

Tested on TS-7250 with 32MiB NAND.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Matthieu Crapet <mcrapet@gmail.com>
Cc: Jesse Off <joff@embeddedARM.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoMTD DocBook: fix ioremap return type
H Hartley Sweeten [Sat, 2 Jan 2010 04:35:54 +0000 (20:35 -0800)]
MTD DocBook: fix ioremap return type

ioremap() returns a void __iomem * not an unsigned long.  Update the
Documentation file to reflect this.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: physmap_of: Correct the size argument to kzalloc
Julia Lawall [Tue, 29 Dec 2009 19:15:23 +0000 (20:15 +0100)]
mtd: physmap_of: Correct the size argument to kzalloc

mtd_list has type struct mtd_info **, not struct mtd_info *, so the
elements of the array should have pointer type, not structure type.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@disable sizeof_type_expr@
type T;
T **x;
@@

  x =
  <+...sizeof(
- T
+ *x
  )...+>
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nand: rename w90p910_nand.c to nuc900_nand.c
David Woodhouse [Fri, 1 Jan 2010 12:16:47 +0000 (12:16 +0000)]
mtd: nand: rename w90p910_nand.c to nuc900_nand.c

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoARM: NUC900: rename mtd nand driver name
Wan ZongShun [Fri, 1 Jan 2010 10:03:47 +0000 (18:03 +0800)]
ARM: NUC900: rename mtd nand driver name

Due to I have renamed the platform_device.name,so this patch changes
this nand driver platform_driver name.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: drivers/mtd/nand/sh_flctl.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:59:27 +0000 (16:59 -0500)]
mtd: drivers/mtd/nand/sh_flctl.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: tmio_nand.c: use dev_get_platdata() and resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 22:11:44 +0000 (17:11 -0500)]
mtd: tmio_nand.c: use dev_get_platdata() and resource_size()

Remove unnecessary casts and use dev_get_platdata() to retrieve the
struct mfd_cell data from the platform.

Use resource_size() for the ioremap()'s.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: drivers/mtd/nand/s3c2410.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:56:22 +0000 (16:56 -0500)]
mtd: drivers/mtd/nand/s3c2410.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: orion_nand.c: add error handling and use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:48:34 +0000 (16:48 -0500)]
mtd: orion_nand.c: add error handling and use resource_size()

Use platform_get_resource() to fetch the memory resource and
add error handling for when it is missing. Use resource_size()
for the ioremap().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: nomadik_nand.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:36:37 +0000 (16:36 -0500)]
mtd: nomadik_nand.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: drivers/mtd/nand/gpio.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:30:46 +0000 (16:30 -0500)]
mtd: drivers/mtd/nand/gpio.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: fls_upm.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:22:49 +0000 (16:22 -0500)]
mtd: fls_upm.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: fsl_elbc_nand.c: user resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:19:44 +0000 (16:19 -0500)]
mtd: fsl_elbc_nand.c: user resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: davinci_nand.c: use resource_size()
H Hartley Sweeten [Mon, 14 Dec 2009 21:13:13 +0000 (16:13 -0500)]
mtd: davinci_nand.c: use resource_size()

The ioremap'ed sizes are off by 1; use resource_size() for correct value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: au1550nd.c: remove unnecessary casts
H Hartley Sweeten [Mon, 14 Dec 2009 21:08:37 +0000 (16:08 -0500)]
mtd: au1550nd.c: remove unnecessary casts

Remove unnecessary casts for p_nand, it is already a void __iomem *.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agomtd: au1550nd.c: use kzalloc()
H Hartley Sweeten [Mon, 14 Dec 2009 21:04:07 +0000 (16:04 -0500)]
mtd: au1550nd.c: use kzalloc()

Use kzalloc() instead of kmalloc()/memset().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agokmsg_dump: Dump on crash_kexec as well
KOSAKI Motohiro [Tue, 22 Dec 2009 03:15:43 +0000 (03:15 +0000)]
kmsg_dump: Dump on crash_kexec as well

crash_kexec gets called before kmsg_dump(KMSG_DUMP_OOPS) if
panic_on_oops is set, so the kernel log buffer is not stored
for this case.

This patch adds a KMSG_DUMP_KEXEC dump type which gets called
when crash_kexec() is invoked. To avoid getting double dumps,
the old KMSG_DUMP_PANIC is moved below crash_kexec(). The
mtdoops driver is modified to handle KMSG_DUMP_KEXEC in the
same way as a panic.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
14 years agoMerge git://git.infradead.org/mtd-2.6
Linus Torvalds [Wed, 16 Dec 2009 18:23:43 +0000 (10:23 -0800)]
Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6: (90 commits)
  jffs2: Fix long-standing bug with symlink garbage collection.
  mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()
  mtd: cfi_cmdset_0002, fix lock imbalance
  Revert "mtd: move mxcnd_remove to .exit.text"
  mtd: m25p80: add support for Macronix MX25L4005A
  kmsg_dump: fix build for CONFIG_PRINTK=n
  mtd: nandsim: add support for 4KiB pages
  mtd: mtdoops: refactor as a kmsg_dumper
  mtd: mtdoops: make record size configurable
  mtd: mtdoops: limit the maximum mtd partition size
  mtd: mtdoops: keep track of used/unused pages in an array
  mtd: mtdoops: several minor cleanups
  core: Add kernel message dumper to call on oopses and panics
  mtd: add ARM pismo support
  mtd: pxa3xx_nand: Fix PIO data transfer
  mtd: nand: fix multi-chip suspend problem
  mtd: add support for switching old SST chips into QRY mode
  mtd: fix M29W800D dev_id and uaddr
  mtd: don't use PF_MEMALLOC
  mtd: Add bad block table overrides to Davinci NAND driver
  ...

Fixed up conflicts (mostly trivial) in
drivers/mtd/devices/m25p80.c
drivers/mtd/maps/pcmciamtd.c
drivers/mtd/nand/pxa3xx_nand.c
kernel/printk.c

14 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
Linus Torvalds [Wed, 16 Dec 2009 18:12:07 +0000 (10:12 -0800)]
Merge branch 'next' of git://git./linux/kernel/git/kyle/parisc-2.6

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
  parisc: Fixup last users of irq_chip->typename
  parisc: convert /proc/pdc/{lcd,led} to seq_file
  parisc: Convert BUG() to use unreachable()
  parisc: Replace old style lock init in smp.c
  parisc: use sort() instead of home-made implementation (v2)
  parisc: add CALLER_ADDR{0-6} macros
  parisc: remove unused IRQSTAT_SIRQ_PEND and IRQSTAT_SZ defines
  parisc: remove duplicated #include

14 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Wed, 16 Dec 2009 18:11:38 +0000 (10:11 -0800)]
Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
  implement early_io{re,un}map for ia64
  Revert "Intel IOMMU: Avoid memory allocation failures in dma map api calls"
  intel-iommu: ignore page table validation in pass through mode
  intel-iommu: Fix oops with intel_iommu=igfx_off
  intel-iommu: Check for an RMRR which ends before it starts.
  intel-iommu: Apply BIOS sanity checks for interrupt remapping too.
  intel-iommu: Detect DMAR in hyperspace at probe time.
  dmar: Fix build failure without NUMA, warn on bogus RHSA tables and don't abort
  iommu: Allocate dma-remapping structures using numa locality info
  intr_remap: Allocate intr-remapping table using numa locality info
  dmar: Allocate queued invalidation structure using numa locality info
  dmar: support for parsing Remapping Hardware Static Affinity structure

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Linus Torvalds [Wed, 16 Dec 2009 18:09:43 +0000 (10:09 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/bp/bp

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  edac, mce, amd: silence GART TLB errors
  edac, mce: correct corenum reporting

14 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Wed, 16 Dec 2009 18:09:16 +0000 (10:09 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (116 commits)
  V4L/DVB (13698): pms: replace asm/uaccess.h to linux/uaccess.h
  V4L/DVB (13690): radio/si470x: #include <sched.h>
  V4L/DVB (13688): au8522: modify the attributes of local filter coefficients
  V4L/DVB (13687): cx231xx: use NULL when pointer is needed
  V4L/DVB: Davinci VPFE Capture: remove unused #include <linux/version.h>
  V4L/DVB (13685): Correct code taking the size of a pointer
  V4L/DVB (13684): Fix some cut-and-paste noise in dib0090.h
  V4L/DVB (13683): sanio-ms: clean up init, exit and id_table
  V4L/DVB (13682): dib8000: make some constant static
  V4L/DVB: lgs8gxx: Use shifts rather than multiply/divide when possible
  V4L/DVB (13680b): DocBook/media: create links for included sources
  V4L/DVB (13680a): DocBook/media: copy images after building HTML
  V4L/DVB (13678): Add support for yet another DvbWorld, TeVii and Prof USB devices
  V4L/DVB (13676): configurable IRQ mode on NetUP Dual DVB-S2 CI; IRQ from CAM processing (CI interface works faster)
  V4L/DVB (13674): stv090x: Add DiSEqC envelope mode
  V4L/DVB (13673): lnbp21: Implement 22 kHz tone control
  V4L/DVB (13671): sh_mobile_ceu_camera: Remove frame size page alignment
  V4L/DVB (13670): soc-camera: Add mt9t112 camera driver
  V4L/DVB (13669): tw9910: Add sync polarity support
  V4L/DVB (13668): tw9910: remove cropping
  ...

14 years agoMerge branch 'akpm'
Linus Torvalds [Wed, 16 Dec 2009 18:06:39 +0000 (10:06 -0800)]
Merge branch 'akpm'

* akpm: (173 commits)
  genalloc: use bitmap_find_next_zero_area
  ia64: use bitmap_find_next_zero_area
  sparc: use bitmap_find_next_zero_area
  mlx4: use bitmap_find_next_zero_area
  isp1362-hcd: use bitmap_find_next_zero_area
  iommu-helper: use bitmap library
  bitmap: introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area
  qnx4: use hweight8
  qnx4fs: remove remains of the (defunct) write support
  resource: constify arg to resource_size() and resource_type()
  gru: send cross partition interrupts using the gru
  gru: function to generate chipset IPI values
  gru: update driver version number
  gru: improve GRU TLB dropin statistics
  gru: fix GRU interrupt race at deallocate
  gru: add hugepage support
  gru: fix bug in allocation of kernel contexts
  gru: update GRU structures to match latest hardware spec
  gru: check for correct GRU chiplet assignment
  gru: remove stray local_irq_enable
  ...

14 years agoedac, mce, amd: silence GART TLB errors
Borislav Petkov [Tue, 15 Dec 2009 15:03:53 +0000 (16:03 +0100)]
edac, mce, amd: silence GART TLB errors

Although reporting of benign GART TLB errors is disabled in
__mcheck_cpu_apply_quirks, those are still being logged, and, as a
result, trip up amd64_edac. Pull up reporting check so that machines
with loaded edac module bail out early and don't spit fragments into
dmesg.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
14 years agogenalloc: use bitmap_find_next_zero_area
Akinobu Mita [Wed, 16 Dec 2009 00:48:31 +0000 (16:48 -0800)]
genalloc: use bitmap_find_next_zero_area

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoia64: use bitmap_find_next_zero_area
Akinobu Mita [Wed, 16 Dec 2009 00:48:30 +0000 (16:48 -0800)]
ia64: use bitmap_find_next_zero_area

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agosparc: use bitmap_find_next_zero_area
Akinobu Mita [Wed, 16 Dec 2009 00:48:30 +0000 (16:48 -0800)]
sparc: use bitmap_find_next_zero_area

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomlx4: use bitmap_find_next_zero_area
Akinobu Mita [Wed, 16 Dec 2009 00:48:29 +0000 (16:48 -0800)]
mlx4: use bitmap_find_next_zero_area

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Roland Dreier <rolandd@cisco.com>
Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoisp1362-hcd: use bitmap_find_next_zero_area
Akinobu Mita [Wed, 16 Dec 2009 00:48:28 +0000 (16:48 -0800)]
isp1362-hcd: use bitmap_find_next_zero_area

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoiommu-helper: use bitmap library
Akinobu Mita [Wed, 16 Dec 2009 00:48:28 +0000 (16:48 -0800)]
iommu-helper: use bitmap library

Use bitmap library and kill some unused iommu helper functions.

1. s/iommu_area_free/bitmap_clear/

2. s/iommu_area_reserve/bitmap_set/

3. Use bitmap_find_next_zero_area instead of find_next_zero_area

  This cannot be simple substitution because find_next_zero_area
  doesn't check the last bit of the limit in bitmap

4. Remove iommu_area_free, iommu_area_reserve, and find_next_zero_area

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agobitmap: introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area
Akinobu Mita [Wed, 16 Dec 2009 00:48:25 +0000 (16:48 -0800)]
bitmap: introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area

This introduces new bitmap functions:

bitmap_set: Set specified bit area
bitmap_clear: Clear specified bit area
bitmap_find_next_zero_area: Find free bit area

These are mostly stolen from iommu helper. The differences are:

- Use find_next_bit instead of doing test_bit for each bit

- Rewrite bitmap_set and bitmap_clear

  Instead of setting or clearing for each bit.

- Check the last bit of the limit

  iommu-helper doesn't want to find such area

- The return value if there is no zero area

  find_next_zero_area in iommu helper: returns -1
  bitmap_find_next_zero_area: return >= bitmap size

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoqnx4: use hweight8
Akinobu Mita [Wed, 16 Dec 2009 00:48:24 +0000 (16:48 -0800)]
qnx4: use hweight8

Use hweight8 instead of counting for each bit

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Anders Larsen <al@alarsen.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoqnx4fs: remove remains of the (defunct) write support
Anders Larsen [Wed, 16 Dec 2009 00:48:23 +0000 (16:48 -0800)]
qnx4fs: remove remains of the (defunct) write support

commit 945ffe54bbd56ceed62de3b908800fd7c6ffb284 ("qnx4: remove write support") removed the (defunct)
write support but missed a chunk of related, dead code.

Signed-off-by: Anders Larsen <al@alarsen.net>
Cc: Jiri Kosina <jkosina@suse.cz>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoresource: constify arg to resource_size() and resource_type()
Jean Delvare [Wed, 16 Dec 2009 00:48:21 +0000 (16:48 -0800)]
resource: constify arg to resource_size() and resource_type()

resource_size() doesn't change the resource it operates on, so the res
parameter can be marked const.  Same for resource_type().

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: send cross partition interrupts using the gru
Jack Steiner [Wed, 16 Dec 2009 00:48:21 +0000 (16:48 -0800)]
gru: send cross partition interrupts using the gru

GRU Message queue instructions are used to deliver messages to other SSIs
within the numalink domain.  In most cases, a single GRU mesq instruction
will deliver both the message AND an interrupt to notify the other SSI
that a messsage is present.  In some cases, however, the interrupt must be
sent explicitly.

To improve resilency, the GRU driver should send these explicit interrupts
using the GRU to write the remote chipset register.  Current code sends
the interrupt using a cpu instruction to write the chipset register.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: function to generate chipset IPI values
Jack Steiner [Wed, 16 Dec 2009 00:48:20 +0000 (16:48 -0800)]
gru: function to generate chipset IPI values

Create a function to generate the value that is written to the UV hub MMR
to cause an IPI interrupt to be sent.  The function will be used in the
GRU message queue error recovery code that sends IPIs to nodes in remote
partitions.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: update driver version number
Jack Steiner [Wed, 16 Dec 2009 00:48:19 +0000 (16:48 -0800)]
gru: update driver version number

Update the version number of the GRU driver.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: improve GRU TLB dropin statistics
Jack Steiner [Wed, 16 Dec 2009 00:48:18 +0000 (16:48 -0800)]
gru: improve GRU TLB dropin statistics

Update the TLB dropin statistics kept for each GRU context.  Count TLB
dropins separate from the misses - some misses do not result in a TLB
dropin.  Some of the diagnostics need both counts.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: fix GRU interrupt race at deallocate
Jack Steiner [Wed, 16 Dec 2009 00:48:18 +0000 (16:48 -0800)]
gru: fix GRU interrupt race at deallocate

Fix a race where an interrupt could be received for a GRU context that has
been deallocated.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: add hugepage support
Jack Steiner [Wed, 16 Dec 2009 00:48:17 +0000 (16:48 -0800)]
gru: add hugepage support

Add support for hugepages. Easier than I originally thought.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: fix bug in allocation of kernel contexts
Jack Steiner [Wed, 16 Dec 2009 00:48:17 +0000 (16:48 -0800)]
gru: fix bug in allocation of kernel contexts

Fix a bug in the assignment of GRU contexts used for kernel functions.  If
a sleep occurs on the wait for a semaphore, the thread could switch cpus
and allocate resources on the wrong blade.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: update GRU structures to match latest hardware spec
Jack Steiner [Wed, 16 Dec 2009 00:48:16 +0000 (16:48 -0800)]
gru: update GRU structures to match latest hardware spec

Add a few new definitions for chipset MMR field names.  This matches rev
0.7 of the hardware spec.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: check for correct GRU chiplet assignment
Jack Steiner [Wed, 16 Dec 2009 00:48:15 +0000 (16:48 -0800)]
gru: check for correct GRU chiplet assignment

Simplify the code that checks for correct assignment of GRU contexts to
users.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: remove stray local_irq_enable
Jack Steiner [Wed, 16 Dec 2009 00:48:15 +0000 (16:48 -0800)]
gru: remove stray local_irq_enable

Remove a stray local_irq_enable() in the GRU TLB dropin code.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: add symbolic names for GRU error code
Jack Steiner [Wed, 16 Dec 2009 00:48:14 +0000 (16:48 -0800)]
gru: add symbolic names for GRU error code

Use symbol names instead of numbers for error return values for the vtop
functions.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: fix bug in exception handling
Jack Steiner [Wed, 16 Dec 2009 00:48:14 +0000 (16:48 -0800)]
gru: fix bug in exception handling

Fix a GRU driver bug converting a CBR address to the context that contains
the CBR.  The conversion is rarely done so performance does not matter.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: preload tlb for bcopy instructions
Jack Steiner [Wed, 16 Dec 2009 00:48:13 +0000 (16:48 -0800)]
gru: preload tlb for bcopy instructions

Add anticipatory TLB dropins for GRU TLB misses that occur on BCOPY
instructions that copy large amounts of data.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: expicitly set instruction status to active
Jack Steiner [Wed, 16 Dec 2009 00:48:12 +0000 (16:48 -0800)]
gru: expicitly set instruction status to active

Explicitly set GRU instructions to "ACTIVE".  This eliminates the need for
barriers that would have been necessary to prevent reading the instruction
"status" field before the GRU had actually started the instruction.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: add additional GRU statistics
Jack Steiner [Wed, 16 Dec 2009 00:48:12 +0000 (16:48 -0800)]
gru: add additional GRU statistics

Add additional GRU statistics & debug messages.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: update irq infrastructure
Jack Steiner [Wed, 16 Dec 2009 00:48:11 +0000 (16:48 -0800)]
gru: update irq infrastructure

Update the GRU irq allocate/free functions to use the latest upstream
infrastructure.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: fix prefetch and speculation bugs
Jack Steiner [Wed, 16 Dec 2009 00:48:11 +0000 (16:48 -0800)]
gru: fix prefetch and speculation bugs

Fix several bugs related to prefetch, ordering & speculation:

- GRU cch_allocate() instruction causes cacheable memory
  to be created. Add a barriers to prevent speculation
  from prefetching data before it exists.
- Add memory barriers before cache-flush instructions to ensure
  that previously stored data is included in the line flushed to memory.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: check for valid vma
Jack Steiner [Wed, 16 Dec 2009 00:48:10 +0000 (16:48 -0800)]
gru: check for valid vma

Fix bug caused by failure to allocate a GRU gts structure.  The old code
failed to handle the case where the vma was invalid.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: add test for gru_copy_gpa
Jack Steiner [Wed, 16 Dec 2009 00:48:09 +0000 (16:48 -0800)]
gru: add test for gru_copy_gpa

Improve existing driver self-tests.  Add a new debugging test to the SGI
GRU driver for verifying the global GRU copy function.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: add debug option for cache flushing
Jack Steiner [Wed, 16 Dec 2009 00:48:09 +0000 (16:48 -0800)]
gru: add debug option for cache flushing

Add a debug option to the SGI GRU driver for flushing GRU cache lines from
memory.  In theory this is not needed but it is useful for debugging.
This has no use by end users.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: handle failures to mmu_notifier_register
Jack Steiner [Wed, 16 Dec 2009 00:48:08 +0000 (16:48 -0800)]
gru: handle failures to mmu_notifier_register

Under some conditions, mmu_notifier_register() will fail to register a
mmu_notifier.  Fix the GRU driver to correctly handle these failures.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: support 64-bit GRU addresses
Jack Steiner [Wed, 16 Dec 2009 00:48:07 +0000 (16:48 -0800)]
gru: support 64-bit GRU addresses

Increase the maximum address supported by the SGI GRU driver to a full 64
bits.  Note that GRU addresses are not always the same as socket virtual
addresses.  Sockets may not necessarily support the full 64 bits.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: improve messages for malfunctioning GRUs
Jack Steiner [Wed, 16 Dec 2009 00:48:07 +0000 (16:48 -0800)]
gru: improve messages for malfunctioning GRUs

Improve error messages for malfunctioning GRUs.  Identify the type of
instruction that is failing.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: fix bug in module unload
Jack Steiner [Wed, 16 Dec 2009 00:48:06 +0000 (16:48 -0800)]
gru: fix bug in module unload

Fix bug in module unload.  Previous code was not correctly deleting the
files in /proc.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: allow users to specify gru chiplet 3
Jack Steiner [Wed, 16 Dec 2009 00:48:06 +0000 (16:48 -0800)]
gru: allow users to specify gru chiplet 3

This patch builds on the infrastructure introduced in the patches that
allow user specification of GRU blades & chiplets for context allocation.

This patch simplifies the algorithms for migrating GRU contexts between
blades.

No new functionality is introduced.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: allow users to specify gru chiplet 2
Jack Steiner [Wed, 16 Dec 2009 00:48:05 +0000 (16:48 -0800)]
gru: allow users to specify gru chiplet 2

Add support to the GRU driver to allow users to specify the blade &
chiplet for allocation of GRU contexts.  Add new statistics for context
loading/unloading/retargeting.  Also deleted a few GRU stats that were no
longer being unused.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: allow users to specify gru chiplet 1
Jack Steiner [Wed, 16 Dec 2009 00:48:04 +0000 (16:48 -0800)]
gru: allow users to specify gru chiplet 1

Add table & user request infrastructure that is needed to allow users to
specify the blade and chiplet for allocation of GRU contexts.  Use of this
information is in a subsequent patch.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: handle blades without memory
Jack Steiner [Wed, 16 Dec 2009 00:48:03 +0000 (16:48 -0800)]
gru: handle blades without memory

Do not use alloc_pages_exact_node() to allocate GRU tables.  If a blade
has no local memory, nid will be -1.  Use alloc_pages_node() instead.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: fix istatus race in GRU tlb dropin
Jack Steiner [Wed, 16 Dec 2009 00:48:03 +0000 (16:48 -0800)]
gru: fix istatus race in GRU tlb dropin

TLB dropins require updates to the CBR instruction istatus field.  This is
needed to resolve race conditions in the chip.

The code currently uses the user address of the CBR.  This works but opens
up additional endcases related to stealing of contexts and accessing the
CBR from tasks that do not have access to the user address space.  (Some
of this non-user task access is debug code that is not currently being
pushed to the community).

User CBRs are also directly accessible using the kernel mapping of the
CBR.  Change the TLB dropin code to use the the kernel mapping of the CBR.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogru: add comments raised in previous code reviews
Jack Steiner [Wed, 16 Dec 2009 00:48:02 +0000 (16:48 -0800)]
gru: add comments raised in previous code reviews

Add comments from previous code reviews.  The comments help explain some
of the more esoteric aspects of the driver.

Move a free() to the other side of an unlock.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>