]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoarm64: Call swiotlb_init() instead of swiotlb_init_with_default_size()
Catalin Marinas [Wed, 3 Oct 2012 13:35:18 +0000 (14:35 +0100)]
arm64: Call swiotlb_init() instead of swiotlb_init_with_default_size()

Following commit 74838b7 (swiotlb: add the late swiotlb initialization
function with iotlb memory) the swiotlb_init_with_default_size() is a
static function. This patch changes the arm64 code to call
swiotlb_init() instead and use the default size of 64MB. It is assumed
that AArch64 platforms have enough RAM to afford the pre-allocated
swiotlb memory. It also removes the #ifdef around this call since
CONFIG_SWIOTLB is always enabled.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Wed, 3 Oct 2012 14:33:17 +0000 (07:33 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull sparc fixes from David Miller:
 "Some quick fixes after today's merge-window pull"

 1) Add missing dependency on Sparc DES driver, oops.  From Dave Jones.

 2) Tell GCC that prom_printf() is printf-like and fix the few
    resultiing warnings.  From Akinobu Mita.

 3) Niagara-2 memcpy doesn't provide it's return value correctly in some
    circumstances.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc: fix format string argument for prom_printf()
  crypto: Build SPARC DES algorithms on SPARC only.
  sparc64: Fix return value of Niagara-2 memcpy.

11 years agommc: rtsx_pci_sdmmc: Add realtek pcie sdmmc host driver
Wei WANG [Tue, 11 Sep 2012 04:54:27 +0000 (04:54 +0000)]
mmc: rtsx_pci_sdmmc: Add realtek pcie sdmmc host driver

Realtek PCI-E SD/MMC card host driver is used to access SD/MMC card,
with the help of Realtek PCI-E card reader MFD driver.

Signed-off-by: Wei WANG <wei_wang@realsil.com.cn>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-spear: Add clk_{un}prepare() support
Viresh Kumar [Fri, 28 Sep 2012 10:28:23 +0000 (15:58 +0530)]
mmc: sdhci-spear: Add clk_{un}prepare() support

clk_{un}prepare is mandatory for platforms using common clock framework.
Since this driver is used by SPEAr platform, which supports common clock
framework, add clk_{un}prepare() support for it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-spear: add device tree bindings
Viresh Kumar [Fri, 28 Sep 2012 10:28:22 +0000 (15:58 +0530)]
mmc: sdhci-spear: add device tree bindings

This adds simple DT bindings for SDHCI SPEAr controller. It uses cd-gpios
from common mmc bindings.

This also fixes spear300-evb.dts with correct name for card detect binding.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume
Chander Kashyap [Fri, 21 Sep 2012 05:42:08 +0000 (05:42 +0000)]
mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume

Perform clock disable/enable in runtime suspend/resume.

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: core: Replace MMC_CAP2_BROKEN_VOLTAGE with test for fixed regulator
Chris Ball [Wed, 19 Sep 2012 14:27:04 +0000 (22:27 +0800)]
mmc: core: Replace MMC_CAP2_BROKEN_VOLTAGE with test for fixed regulator

Before this patch, we were using MMC_CAP2_BROKEN_VOLTAGE as a way to
avoid calling regulator_set_voltage() on a fixed regulator, but that's
just duplicating information that already exists -- we should test
whether the regulator is fixed directly, instead of via a capability.

This patch implements that test.  We can't reclaim the capability bit
just yet, since there are still boards in arch/arm/ that reference it;
those references can be removed now.

Reported-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-pxav3: Use sdhci_get_of_property for parsing DT quirks
Chris Ball [Mon, 17 Sep 2012 06:40:15 +0000 (14:40 +0800)]
mmc: sdhci-pxav3: Use sdhci_get_of_property for parsing DT quirks

Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dt: Support "broken-cd" property in sdhci-pltfm
Chris Ball [Sat, 15 Sep 2012 04:20:00 +0000 (12:20 +0800)]
mmc: dt: Support "broken-cd" property in sdhci-pltfm

Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-s3c: fix the wrong number of max bus clocks
Chris Ball [Wed, 19 Sep 2012 06:43:33 +0000 (14:43 +0800)]
mmc: sdhci-s3c: fix the wrong number of max bus clocks

We can use up to four bus-clocks; but on module remove, we didn't
disable the fourth bus clock.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sh-mmcif: avoid oops on spurious interrupts
Guennadi Liakhovetski [Tue, 18 Sep 2012 06:42:42 +0000 (06:42 +0000)]
mmc: sh-mmcif: avoid oops on spurious interrupts

On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
interrupts without any active request. To prevent the Oops, that results
in such cases, don't dereference the mmc request pointer until we make
sure, that we are indeed processing such a request.

Reported-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sh-mmcif: properly handle MMC_WRITE_MULTIPLE_BLOCK completion IRQ
Guennadi Liakhovetski [Tue, 18 Sep 2012 23:10:24 +0000 (23:10 +0000)]
mmc: sh-mmcif: properly handle MMC_WRITE_MULTIPLE_BLOCK completion IRQ

Upon completion of a MMC_WRITE_MULTIPLE_BLOCK command MMCIF issues an IRQ
with the DTRANE bit set and often with one or several of CMD12 bits set.
If those interrupts are not acknowledged, an additional interrupt can be
produced and will be delivered later, possibly, when the transaction has
already been completed. To prevent this from happening, CMD12 completion
interrupt sources have to be cleared too upon reception of an DTRANE IRQ.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-s3c: Fix crash on module insertion for second time
Chander Kashyap [Fri, 14 Sep 2012 09:08:50 +0000 (09:08 +0000)]
mmc: sdhci-s3c: Fix crash on module insertion for second time

If sdhci-s3c driver is built as module, it gives following error if inserted
again after removing. This was happening as pm_runtime_use_autosuspend() is
called in sdhci_s3c_probe() function but in sdhci_s3c_remove() its
complementary pm_runtime_dont_use_autosuspend() is not called.

BUG: spinlock bad magic on CPU#1, insmod/955
 lock: 0xee771368, .magic: 00000000, .owner: insmod/955, .owner_cpu: 1
[<c00147e0>] (unwind_backtrace+0x0/0xf8) from [<c0136b40>] (do_raw_spin_unlock+0xa4/0xe4)
[<c0136b40>] (do_raw_spin_unlock+0xa4/0xe4) from [<c01be508>] (_raw_spin_unlock_irqrestore+0xc/0x38)
[<c01be508>] (_raw_spin_unlock_irqrestore+0xc/0x38) from [<c01a9334>] (sdhci_runtime_suspend_host+0x54/0x80)
[<c01a9334>] (sdhci_runtime_suspend_host+0x54/0x80) from [<bf0060a8>] (sdhci_s3c_runtime_suspend+0x14/0x38 [sdhci_s3c])
[<bf0060a8>] (sdhci_s3c_runtime_suspend+0x14/0x38 [sdhci_s3c]) from [<c016cb00>] (pm_generic_runtime_suspend+0x2c/0x40)
[<c016cb00>] (pm_generic_runtime_suspend+0x2c/0x40) from [<c0170090>] (__rpm_callback+0x70/0x98)
[<c0170090>] (__rpm_callback+0x70/0x98) from [<c01703f0>] (rpm_suspend+0xf0/0x534)
[<c01703f0>] (rpm_suspend+0xf0/0x534) from [<c0171670>] (__pm_runtime_suspend+0x5c/0x74)
[<c0171670>] (__pm_runtime_suspend+0x5c/0x74) from [<c016d018>] (pm_generic_runtime_idle+0x44/0x4c)
[<c016d018>] (pm_generic_runtime_idle+0x44/0x4c) from [<c0170090>] (__rpm_callback+0x70/0x98)
[<c0170090>] (__rpm_callback+0x70/0x98) from [<c0170984>] (rpm_idle+0xdc/0x18c)
[<c0170984>] (rpm_idle+0xdc/0x18c) from [<c0171608>] (pm_runtime_set_autosuspend_delay+0x30/0x3c)
[<c0171608>] (pm_runtime_set_autosuspend_delay+0x30/0x3c) from [<bf0069c4>] (sdhci_s3c_probe+0x35c/0x52c [sdhci_s3c])
[<bf0069c4>] (sdhci_s3c_probe+0x35c/0x52c [sdhci_s3c]) from [<c016a014>] (platform_drv_probe+0x18/0x1c)

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-s3c: Enable only required bus clock
Chander Kashyap [Fri, 14 Sep 2012 09:08:49 +0000 (09:08 +0000)]
mmc: sdhci-s3c: Enable only required bus clock

In case of multiple bus clock sources, all the clock sources were
getting enabled. As only one clock source is needed at the time hence
enable only the required bus clock.

This patch does as follows:
1. In sdhci_s3c_probe enable only required bus clock source.

2. Handle the disabling of old bus clock and enables the
best clock selected in sdhci_s3c_set_clock().

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: Revert "mmc: dw_mmc: Add check for IDMAC configuration"
Seungwon Jeon [Wed, 19 Sep 2012 05:58:31 +0000 (13:58 +0800)]
mmc: Revert "mmc: dw_mmc: Add check for IDMAC configuration"

This reverts commit 94c6cee91 (Add check for IDMAC configuration).
Synopsys says that only if internal dmac is not present, optional
external dma interface is present. When internal dmac is present,
'0' value in DMA_INTERFACE of HCON is reasonable. DMA_INTERFACE
indicates external dma interface. And idmac initialization is
prohibited now.

The commit should be reverted since: the check for IDMAC is not
reliable; falling back to PIO would provide awful performance; we
wouldn't expect to see instances of this block without DMA support.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: mxcmmc: fix bug that may block a data transfer forever
Javier Martin [Fri, 7 Sep 2012 10:43:37 +0000 (10:43 +0000)]
mmc: mxcmmc: fix bug that may block a data transfer forever

The problem can be easily reproduced using a script that loops
copying a file in an SD card to another place in the same SD card
and its related to read transfers. This only happens with DMA enabled.

This is related to the fact that, when reading, an MMC irq signals
the fact that all data from the SD card has been copied to the
internal buffers. However, it doesn't signal whether the DMA transfer
that is in charge of moving data from these internal buffers to RAM
has finished or not. Thus, calling dmaengine_terminate_all() in the
MMC irq routine can cancel an ongoing DMA transfer leaving some data
in the internal buffers that produces an accumulative effect which,
in the end, blocks a read data transfer forever.

The following patch watches DMA irq for reading and MMC irqs for
writing transfers. The 'dangerous' usage of dmaengine_terminate_all()
is removed and a timeout of 10 seconds is added so that the MMC won't
block forever anymore.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: Pass on the suspend failure to the PM core
Vaibhav Bedia [Thu, 13 Sep 2012 06:31:03 +0000 (06:31 +0000)]
mmc: omap_hsmmc: Pass on the suspend failure to the PM core

In some cases mmc_suspend_host() is not able to claim the
host and proceed with the suspend process. The core returns
-EBUSY to the host controller driver. Unfortunately, the
host controller driver does not pass on this information
to the PM core and hence the system suspend process continues.

ret = mmc_suspend_host(host->mmc);
if (ret) {
host->suspended = 0;
if (host->pdata->resume) {
ret = host->pdata->resume(dev, host->slot_id);

The return status from mmc_suspend_host() is overwritten by return
status from host->pdata->resume. So the original return status is lost.

In these cases the MMC core gets to an unexpected state
during resume and multiple issues related to MMC crop up.
1. Host controller driver starts accessing the device registers
before the clocks are enabled which leads to a prefetch abort.
2. A file copy thread which was launched before suspend gets
stuck due to the host not being reclaimed during resume.

To avoid such problems pass on the -EBUSY status to the PM core
from the host controller driver. With this change, MMC core
suspend might still fail but it does not end up making the
system unusable. Suspend gets aborted and the user can try
suspending the system again.

Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Acked-by: Venkatraman S <svenkatr@ti.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: atmel-mci: AP700x PDC is not connected to MCI
Hein_Tibosch [Thu, 30 Aug 2012 16:34:27 +0000 (16:34 +0000)]
mmc: atmel-mci: AP700x PDC is not connected to MCI

Earlier, atmel-mci was adapted to make use of the peripheral DMA
controller (PDC), in case normal DMA wouldn't work.
( http://comments.gmane.org/gmane.linux.kernel.mmc/9403 )

This works OK on ARM platforms (AT91), but it broke the driver
for AVR32, the AP700x.  Although the MCI has PDC support, the
connection is not done for AVR chips.

This patch makes the use of PDC depend on !CONFIG_AVR32.

Signed-off-by: Hein Tibosch <hein_tibosch@yahoo.es>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: atmel-mci: DMA can be used with other controllers
Hein_Tibosch [Thu, 30 Aug 2012 16:34:38 +0000 (16:34 +0000)]
mmc: atmel-mci: DMA can be used with other controllers

After the latest changes to atmel-mci, it could not be used with
DMA on the AVR32 platform. This patch will allow to use DMA again
and it will avoid access to MCI register ATMCI_DMA.

Even if the IP version is lower than v3xx and doesn't have the DMA
configuration register, DMA transfers can be used with a different
controller than the Atmel AHB DMA one. For instance, some AVR chips
use the Synopsys DesignWare AHB DMA controller.

Signed-off-by: Hein Tibosch <hein_tibosch@yahoo.es>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: mmci: use clk_prepare_enable and clk_disable_unprepare
Julia Lawall [Sun, 26 Aug 2012 16:00:59 +0000 (16:00 +0000)]
mmc: mmci: use clk_prepare_enable and clk_disable_unprepare

clk_prepare_enable and clk_disable_unprepare combine clk_prepare and
clk_enable, and clk_disable and clk_unprepare.  They make the code more
concise, and ensure that clk_unprepare is called when clk_enable fails.

A simplified version of the semantic patch that introduces calls to these
functions is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e;
@@

- clk_prepare(e);
- clk_enable(e);
+ clk_prepare_enable(e);

@@
expression e;
@@

- clk_disable(e);
- clk_unprepare(e);
+ clk_disable_unprepare(e);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-s3c: Add device tree support
Thomas Abraham [Thu, 23 Aug 2012 17:10:09 +0000 (17:10 +0000)]
mmc: sdhci-s3c: Add device tree support

Add device tree based discovery support for Samsung's sdhci controller.

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: add support for exynos specific implementation of dw-mshc
Thomas Abraham [Mon, 17 Sep 2012 18:16:43 +0000 (18:16 +0000)]
mmc: dw_mmc: add support for exynos specific implementation of dw-mshc

Samsung Exynos SoC's extend the dw-mshc controller for additional clock
and bus control. Add support for these extensions and include provide
device tree based discovery suppory as well.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: add support for implementation specific callbacks
Thomas Abraham [Mon, 17 Sep 2012 18:16:42 +0000 (18:16 +0000)]
mmc: dw_mmc: add support for implementation specific callbacks

The core dw-mshc controller driver can let platform specific
implementations of the dw-mshc controller to control the hardware
as required by such implementations. This is acheived by invoking
implementation specific (optional) callbacks. Define the list of
callbacks supported the add invocation points for the same.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse
Thomas Abraham [Mon, 17 Sep 2012 18:16:41 +0000 (18:16 +0000)]
mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse

Platform implementations of dw-mshc controller may choose to extend the
features of the standard dw-mshc controller such as adding additional
clocking options or modifying the bus interface. Support for such
implementation specific extensions can be incorporated into dw_mmc-pltfm,
but including multiple such platform specific implementations would
convolute the existing dw_mmc-pltfm code.

Instead, it would be better to create implementation specific platform
drivers to support implementation specific features. Such platforms
drivers can reuse the existing infrastructure in dw_mmc-pltfm for
resource identification and controller registration and provide support
for implementation specific features. So, allow the infrastructure in
dw_mmc-pltfm to be reused by other implementation specific platform
drivers.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: add device tree support
Thomas Abraham [Mon, 17 Sep 2012 18:16:40 +0000 (18:16 +0000)]
mmc: dw_mmc: add device tree support

Add device tree based discovery support.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: add quirk to indicate missing write protect line
Thomas Abraham [Mon, 17 Sep 2012 18:16:39 +0000 (18:16 +0000)]
mmc: dw_mmc: add quirk to indicate missing write protect line

If the write protect pad of the controller is not connected to the write
protect pin of the slot, the driver should be notified of this condition
so that incorrect check for write protection by reading the WRTORT
register can avoided. The get_ro platform callback can be used for in
such cases, but with device tree support enabled, such platform callbacks
cannot be supported.

Add a new quirk for notifying the driver about the missing write protect
line so the driver can assume that the card write protection is disabled.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: lookup for optional biu and ciu clocks
Thomas Abraham [Mon, 17 Sep 2012 18:16:38 +0000 (18:16 +0000)]
mmc: dw_mmc: lookup for optional biu and ciu clocks

Some platforms allow for clock gating and control of bus interface unit
clock and card interface unit clock. Add support for clock lookup of
optional biu and ciu clocks for clock gating and clock speed
determination.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: allow probe to succeed even if one slot is initialized
Thomas Abraham [Mon, 17 Sep 2012 18:16:37 +0000 (18:16 +0000)]
mmc: dw_mmc: allow probe to succeed even if one slot is initialized

Instead of aborting the probe when a slot initialization fails, allow
initialization of as many slots as possible. If there is at least one
instance of a slot that is successfully initialized, allow the driver
probe to succeed.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: Use devm_* functions in dw_mmc platform driver
Thomas Abraham [Mon, 17 Sep 2012 18:16:36 +0000 (18:16 +0000)]
mmc: dw_mmc: Use devm_* functions in dw_mmc platform driver

Use devm_* managed functions for simpler error handling.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: convert copy of struct device in struct dw_mci to a reference
Thomas Abraham [Mon, 17 Sep 2012 18:16:35 +0000 (18:16 +0000)]
mmc: dw_mmc: convert copy of struct device in struct dw_mci to a reference

The 'struct dw_mci' maintains a copy of the pdev->dev instance instead of
maintaining a reference to that 'struct device' instance. Any resource
allocated using the device resource management kernel API with the instance
of 'struct device' in 'struct dw_mci' is then incorrect. Fix this by
converting the copy of 'struct device' in 'struct dw_mci' to a reference.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: support BKOPS feature for eMMC
Jaehoon Chung [Mon, 17 Sep 2012 08:42:02 +0000 (08:42 +0000)]
mmc: support BKOPS feature for eMMC

Enable eMMC background operations (BKOPS) feature.

If URGENT_BKOPS is set after a response, note that BKOPS are required.
Immediately run BKOPS if required.  Read/write operations should be
requested during BKOPS(LEVEL-1), then issue HPI to interrupt the
ongoing BKOPS and service the foreground operation.
(This patch only controls the LEVEL2/3.)

When repeating the writing 1GB data, at a certain time, performance is
decreased.  At that time, card triggers the Level-3 or Level-2.  After
running bkops, performance is recovered.

Future considerations:
 * Check BKOPS_LEVEL=1 and start BKOPS in a preventive manner.
 * Interrupt ongoing BKOPS before powering off the card.
 * How do we get BKOPS_STATUS value (periodically send ext_csd command)?
 * If using periodic bkops, also consider runtime_pm control.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Reviewed-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agoUBI: Wire-up fastmap
Richard Weinberger [Wed, 26 Sep 2012 15:51:50 +0000 (17:51 +0200)]
UBI: Wire-up fastmap

Make fastmap known to Kconfig, UBI Makefile and MAINTAINERS.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Add fastmap core
Richard Weinberger [Wed, 26 Sep 2012 15:51:49 +0000 (17:51 +0200)]
UBI: Add fastmap core

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Add fastmap support to the WL sub-system
Richard Weinberger [Wed, 26 Sep 2012 15:51:48 +0000 (17:51 +0200)]
UBI: Add fastmap support to the WL sub-system

To make fastmap possible the WL sub-system needs some
changes.
Mostly to support fastmaps pools.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Add fastmap stuff to attach.c
Richard Weinberger [Wed, 26 Sep 2012 15:51:47 +0000 (17:51 +0200)]
UBI: Add fastmap stuff to attach.c

- Export compare_lebs() as fastmap needs this function.
- Implement fastmap scan logic.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Wire-up ->fm_sem
Richard Weinberger [Wed, 26 Sep 2012 15:51:46 +0000 (17:51 +0200)]
UBI: Wire-up ->fm_sem

Fastmap uses ->fm_sem to stop EBA changes while writing
a new fastmap.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Add fastmap bits to build.c
Richard Weinberger [Wed, 26 Sep 2012 15:51:45 +0000 (17:51 +0200)]
UBI: Add fastmap bits to build.c

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Add self_check_eba()
Richard Weinberger [Wed, 26 Sep 2012 15:51:44 +0000 (17:51 +0200)]
UBI: Add self_check_eba()

self_check_eba() compares two ubi_attach_info objects.
Fastmap uses this function for self checks.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Export next_sqnum()
Richard Weinberger [Wed, 26 Sep 2012 15:51:43 +0000 (17:51 +0200)]
UBI: Export next_sqnum()

Fastmap needs next_sqnum(), rename it to ubi_next_sqnum()
and make it non-static.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Add fastmap stuff to ubi.h
Richard Weinberger [Wed, 26 Sep 2012 15:51:42 +0000 (17:51 +0200)]
UBI: Add fastmap stuff to ubi.h

This patch adds fastmap specific data structures to ubi.h.
It moves also struct ubi_work to ubi.h as it is now needed
for more than one c file.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoUBI: Add fastmap on-flash data structures
Richard Weinberger [Wed, 26 Sep 2012 15:51:41 +0000 (17:51 +0200)]
UBI: Add fastmap on-flash data structures

Add the on-flash data structures neeed by fastmap
to ubi-media.h

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
11 years agoMerge branch 'kbuild/rc-fixes' into kbuild/for-next
Michal Marek [Wed, 3 Oct 2012 09:01:15 +0000 (11:01 +0200)]
Merge branch 'kbuild/rc-fixes' into kbuild/for-next

11 years agoMODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
David Howells [Tue, 2 Oct 2012 13:36:16 +0000 (14:36 +0100)]
MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking

The current choice of lifetime for the autogenerated X.509 of 100 years,
putting the validTo date in 2112, causes problems on 32-bit systems where a
32-bit time_t wraps in 2106.  64-bit x86_64 systems seem to be unaffected.

This can result in something like:

Loading module verification certificates
X.509: Cert 6e03943da0f3b015ba6ed7f5e0cac4fe48680994 has expired
MODSIGN: Problem loading in-kernel X.509 certificate (-127)

Or:

X.509: Cert 6e03943da0f3b015ba6ed7f5e0cac4fe48680994 is not yet valid
MODSIGN: Problem loading in-kernel X.509 certificate (-129)

Instead of turning the dates into time_t values and comparing, turn the system
clock and the ASN.1 dates into tm structs and compare those piecemeal instead.

Reported-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agoMODSIGN: Make mrproper should remove generated files.
Rusty Russell [Tue, 2 Oct 2012 05:05:24 +0000 (14:35 +0930)]
MODSIGN: Make mrproper should remove generated files.

It doesn't, because the clean targets don't include kernel/Makefile, and
because two files were missing from the list.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agoMODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
David Howells [Fri, 28 Sep 2012 10:16:57 +0000 (11:16 +0100)]
MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs

Place an indication that the certificate should use utf8 strings into the
x509.genkey template generated by kernel/Makefile.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agoMODSIGN: Use the same digest for the autogen key sig as for the module sig
David Howells [Fri, 28 Sep 2012 10:16:57 +0000 (11:16 +0100)]
MODSIGN: Use the same digest for the autogen key sig as for the module sig

Use the same digest type for the autogenerated key signature as for the module
signature so that the hash algorithm is guaranteed to be present in the kernel.

Without this, the X.509 certificate loader may reject the X.509 certificate so
generated because it was self-signed and the signature will be checked against
itself - but this won't work if the digest algorithm must be loaded as a
module.

The symptom is that the key fails to load with the following message emitted
into the kernel log:

MODSIGN: Problem loading in-kernel X.509 certificate (-65)

the error in brackets being -ENOPKG.  What you should see is something like:

MODSIGN: Loaded cert 'Magarathea: Glacier signing key: 9588321144239a119d3406d4c4cf1fbae1836fa0'

Note that this doesn't apply to certificates that are not self-signed as we
don't check those currently as they require the parent CA certificate to be
available.

Reported-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agoCRIS: Remove VCS simulator specific code
Jesper Nilsson [Wed, 20 Jun 2012 15:17:10 +0000 (17:17 +0200)]
CRIS: Remove VCS simulator specific code

The VCS simulator was a tool used in the development of the chip
and is no longer used or necessary.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
11 years agocris/PCI: remove pcibios_assign_resources()
Bjorn Helgaas [Wed, 20 Jun 2012 12:12:02 +0000 (14:12 +0200)]
cris/PCI: remove pcibios_assign_resources()

There's no caller of pcibios_assign_resources() in the tree.  It is
exported, so an out-of-tree module *could* call it, but no other arch
exports pcibios_assign_resources(), so it would have to be a CRIS-specific
module.  I doubt such a caller exists.

CC: Mikael Starvik <starvik@axis.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
11 years agokbuild: Fix gcc -x syntax
Jean Delvare [Tue, 2 Oct 2012 14:42:36 +0000 (16:42 +0200)]
kbuild: Fix gcc -x syntax

The correct syntax for gcc -x is "gcc -x assembler", not
"gcc -xassembler". Even though the latter happens to work, the former
is what is documented in the manual page and thus what gcc wrappers
such as icecream do expect.

This isn't a cosmetic change. The missing space prevents icecream from
recognizing compilation tasks it can't handle, leading to silent kernel
miscompilations.

Besides me, credits go to Michael Matz and Dirk Mueller for
investigating the miscompilation issue and tracking it down to this
incorrect -x parameter syntax.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Cc: Bernhard Walle <bernhard@bwalle.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
11 years agoMerge branch 'slab/tracing' into slab/for-linus
Pekka Enberg [Wed, 3 Oct 2012 06:57:17 +0000 (09:57 +0300)]
Merge branch 'slab/tracing' into slab/for-linus

11 years agoMerge branch 'slab/common-for-cgroups' into slab/for-linus
Pekka Enberg [Wed, 3 Oct 2012 06:56:37 +0000 (09:56 +0300)]
Merge branch 'slab/common-for-cgroups' into slab/for-linus

Fix up a trivial conflict with NUMA_NO_NODE cleanups.

Conflicts:
mm/slob.c

Signed-off-by: Pekka Enberg <penberg@kernel.org>
11 years agoMerge branch 'slab/next' into slab/for-linus
Pekka Enberg [Wed, 3 Oct 2012 06:56:12 +0000 (09:56 +0300)]
Merge branch 'slab/next' into slab/for-linus

11 years agoslab: Fix build failure in __kmem_cache_create()
Tetsuo Handa [Sun, 30 Sep 2012 08:28:25 +0000 (17:28 +0900)]
slab: Fix build failure in __kmem_cache_create()

Fix build failure with CONFIG_DEBUG_SLAB=y && CONFIG_DEBUG_PAGEALLOC=y caused
by commit 8a13a4cc "mm/sl[aou]b: Shrink __kmem_cache_create() parameter lists".

mm/slab.c: In function '__kmem_cache_create':
mm/slab.c:2474: error: 'align' undeclared (first use in this function)
mm/slab.c:2474: error: (Each undeclared identifier is reported only once
mm/slab.c:2474: error: for each function it appears in.)
make[1]: *** [mm/slab.o] Error 1
make: *** [mm] Error 2

Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
11 years agoslub: init_kmem_cache_cpus() and put_cpu_partial() can be static
Fengguang Wu [Fri, 28 Sep 2012 08:34:05 +0000 (16:34 +0800)]
slub: init_kmem_cache_cpus() and put_cpu_partial() can be static

Acked-by: Glauber Costa <glommer@parallels.com>
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
11 years agoMerge tag 'stable/for-linus-3.7-x86-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 3 Oct 2012 05:09:10 +0000 (22:09 -0700)]
Merge tag 'stable/for-linus-3.7-x86-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull Xen update from Konrad Rzeszutek Wilk:
 "Features:
   - When hotplugging PCI devices in a PV guest we can allocate
     Xen-SWIOTLB later.
   - Cleanup Xen SWIOTLB.
   - Support pages out grants from HVM domains in the backends.
   - Support wild cards in xen-pciback.hide=(BDF) arguments.
   - Update grant status updates with upstream hypervisor.
   - Boot PV guests with more than 128GB.
   - Cleanup Xen MMU code/add comments.
   - Obtain XENVERS using a preferred method.
   - Lay out generic changes to support Xen ARM.
   - Allow privcmd ioctl for HVM (used to do only PV).
   - Do v2 of mmap_batch for privcmd ioctls.
   - If hypervisor saves the LED keyboard light - we will now instruct
     the kernel about its state.
  Fixes:
   - More fixes to Xen PCI backend for various calls/FLR/etc.
   - With more than 4GB in a 64-bit PV guest disable native SWIOTLB.
   - Fix up smatch warnings.
   - Fix up various return values in privmcmd and mm."

* tag 'stable/for-linus-3.7-x86-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: (48 commits)
  xen/pciback: Restore the PCI config space after an FLR.
  xen-pciback: properly clean up after calling pcistub_device_find()
  xen/vga: add the xen EFI video mode support
  xen/x86: retrieve keyboard shift status flags from hypervisor.
  xen/gndev: Xen backend support for paged out grant targets V4.
  xen-pciback: support wild cards in slot specifications
  xen/swiotlb: Fix compile warnings when using plain integer instead of NULL pointer.
  xen/swiotlb: Remove functions not needed anymore.
  xen/pcifront: Use Xen-SWIOTLB when initting if required.
  xen/swiotlb: For early initialization, return zero on success.
  xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used.
  xen/swiotlb: Move the error strings to its own function.
  xen/swiotlb: Move the nr_tbl determination in its own function.
  xen/arm: compile and run xenbus
  xen: resynchronise grant table status codes with upstream
  xen/privcmd: return -EFAULT on error
  xen/privcmd: Fix mmap batch ioctl error status copy back.
  xen/privcmd: add PRIVCMD_MMAPBATCH_V2 ioctl
  xen/mm: return more precise error from xen_remap_domain_range()
  xen/mmu: If the revector fails, don't attempt to revector anything else.
  ...

11 years agoMerge tag 'stable/for-linus-3.7-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 3 Oct 2012 05:08:14 +0000 (22:08 -0700)]
Merge tag 'stable/for-linus-3.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/mm

Pull frontswap update from Konrad Rzeszutek Wilk:
 "Features:
   - Support exlusive get if backend is capable.
  Bug-fixes:
   - Fix compile warnings
   - Add comments/cleanup doc
   - Fix wrong if condition"

* tag 'stable/for-linus-3.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/mm:
  frontswap: support exclusive gets if tmem backend is capable
  mm: frontswap: fix a wrong if condition in frontswap_shrink
  mm/frontswap: fix uninit'ed variable warning
  mm/frontswap: cleanup doc and comment error
  mm: frontswap: remove unneeded headers

11 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux...
Linus Torvalds [Wed, 3 Oct 2012 04:38:48 +0000 (21:38 -0700)]
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

Pull security subsystem updates from James Morris:
 "Highlights:

   - Integrity: add local fs integrity verification to detect offline
     attacks
   - Integrity: add digital signature verification
   - Simple stacking of Yama with other LSMs (per LSS discussions)
   - IBM vTPM support on ppc64
   - Add new driver for Infineon I2C TIS TPM
   - Smack: add rule revocation for subject labels"

Fixed conflicts with the user namespace support in kernel/auditsc.c and
security/integrity/ima/ima_policy.c.

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (39 commits)
  Documentation: Update git repository URL for Smack userland tools
  ima: change flags container data type
  Smack: setprocattr memory leak fix
  Smack: implement revoking all rules for a subject label
  Smack: remove task_wait() hook.
  ima: audit log hashes
  ima: generic IMA action flag handling
  ima: rename ima_must_appraise_or_measure
  audit: export audit_log_task_info
  tpm: fix tpm_acpi sparse warning on different address spaces
  samples/seccomp: fix 31 bit build on s390
  ima: digital signature verification support
  ima: add support for different security.ima data types
  ima: add ima_inode_setxattr/removexattr function and calls
  ima: add inode_post_setattr call
  ima: replace iint spinblock with rwlock/read_lock
  ima: allocating iint improvements
  ima: add appraise action keywords and default rules
  ima: integrity appraisal extension
  vfs: move ima_file_free before releasing the file
  ...

11 years agoIPoIB: Fix build with CONFIG_INFINIBAND_IPOIB_CM=n
Roland Dreier [Wed, 3 Oct 2012 04:23:43 +0000 (21:23 -0700)]
IPoIB: Fix build with CONFIG_INFINIBAND_IPOIB_CM=n

With the new netlink support in commit 862096a8bbf8 ("IB/ipoib: Add more
rtnl_link_ops callbacks") we need ipoib_set_mode() to be available even
if connected mode isn't built.  Move the function from ipoib_cm.c to
ipoib_main.c (and make a few CM-related macros available unconditonally).

This fixes the build error

    drivers/built-in.o: In function 'ipoib_changelink':
    ipoib_netlink.c:(.text+0x6a5fc9): undefined reference to 'ipoib_set_mode'
    ipoib_netlink.c:(.text+0x6a5fe3): undefined reference to 'ipoib_set_mode'

when CONFIG_INFINIBAND_IPOIB_CM isn't set.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Reported-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
11 years agoMerge tag 'upstream-3.7-rc1' of git://git.infradead.org/linux-ubi
Linus Torvalds [Wed, 3 Oct 2012 03:49:15 +0000 (20:49 -0700)]
Merge tag 'upstream-3.7-rc1' of git://git.infradead.org/linux-ubi

Pull UBI changes from Artem Bityutskiy:
 "The main change is the way we reserve eraseblocks for bad blocks
  handling.  We used to reserve 2% of the partition, but now we are more
  aggressive and we reserve 2% of the entire chip, which is what
  actually manufacturers specify in data sheets.  We introduced an
  option to users to override the default, though.

  There are a couple of fixes as well, and a number of cleanups."

* tag 'upstream-3.7-rc1' of git://git.infradead.org/linux-ubi: (24 commits)
  UBI: fix trivial typo 'it' => 'is'
  UBI: load after mtd device drivers
  UBI: print less
  UBI: use pr_ helper instead of printk
  UBI: comply with coding style
  UBI: erase free PEB with bitflip in EC header
  UBI: fix autoresize handling in R/O mode
  UBI: add max_beb_per1024 to attach ioctl
  UBI: allow specifying bad PEBs limit using module parameter
  UBI: check max_beb_per1024 value in ubi_attach_mtd_dev
  UBI: prepare for max_beb_per1024 module parameter addition
  UBI: introduce MTD_PARAM_MAX_COUNT
  UBI: separate bad_peb_limit in a function
  arm: sam9_l9260_defconfig: correct CONFIG_MTD_UBI_BEB_LIMIT
  UBI: use the whole MTD device size to get bad_peb_limit
  mtd: mtdparts: introduce mtd_get_device_size
  mtd: mark mtd_is_partition argument as constant
  arm: sam9_l9260_defconfig: remove non-existing config option
  UBI: kill CONFIG_MTD_UBI_BEB_RESERVE
  UBI: limit amount of reserved eraseblocks for bad PEB handling
  ...

11 years agoMerge tag 'upstream-3.7-rc1' of git://git.infradead.org/linux-ubifs
Linus Torvalds [Wed, 3 Oct 2012 03:47:48 +0000 (20:47 -0700)]
Merge tag 'upstream-3.7-rc1' of git://git.infradead.org/linux-ubifs

Pull ubifs changes from Artem Bityutskiy:
 "No big changes for 3.7 in UBIFS:
   - Error reporting and debug printing improvements
   - Power cut emulation fixes
   - Minor cleanups"

Fix trivial conflict in fs/ubifs/debug.c due to the user namespace
changes.

* tag 'upstream-3.7-rc1' of git://git.infradead.org/linux-ubifs:
  UBIFS: print less
  UBIFS: use pr_ helper instead of printk
  UBIFS: comply with coding style
  UBIFS: use __aligned() attribute
  UBIFS: remove __DATE__ and __TIME__
  UBIFS: fix power cut emulation for mtdram
  UBIFS: improve scanning debug output
  UBIFS: always print full error reports
  UBIFS: print PID in debug messages

11 years agoMerge tag 'for-linus-v3.7-rc1' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Wed, 3 Oct 2012 03:42:58 +0000 (20:42 -0700)]
Merge tag 'for-linus-v3.7-rc1' of git://oss.sgi.com/xfs/xfs

Pull xfs update from Ben Myers:
 "Several enhancements and cleanups:

   - make inode32 and inode64 remountable options
   - SEEK_HOLE/SEEK_DATA enhancements
   - cleanup struct declarations in xfs_mount.h"

* tag 'for-linus-v3.7-rc1' of git://oss.sgi.com/xfs/xfs:
  xfs: Make inode32 a remountable option
  xfs: add inode64->inode32 transition into xfs_set_inode32()
  xfs: Fix mp->m_maxagi update during inode64 remount
  xfs: reduce code duplication handling inode32/64 options
  xfs: make inode64 as the default allocation mode
  xfs: Fix m_agirotor reset during AG selection
  Make inode64 a remountable option
  xfs: stop the sync worker before xfs_unmountfs
  xfs: xfs_seek_hole() refinement with hole searching from page cache for unwritten extents
  xfs: xfs_seek_data() refinement with unwritten extents check up from page cache
  xfs: Introduce a helper routine to probe data or hole offset from page cache
  xfs: Remove type argument from xfs_seek_data()/xfs_seek_hole()
  xfs: fix race while discarding buffers [V4]
  xfs: check for possible overflow in xfs_ioc_trim
  xfs: unlock the AGI buffer when looping in xfs_dialloc
  xfs: kill struct declarations in xfs_mount.h
  xfs: fix uninitialised variable in xfs_rtbuf_get()

11 years agoMerge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux...
Dave Airlie [Wed, 3 Oct 2012 03:26:15 +0000 (13:26 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next

This is a major rework of the nouveau driver core, to reflect more closely
how the hw is used and to make it easier to implement newer features now
that the GPUs are more clearly understood than when nouveau started.

It also contains a few other bits:
thermal patches
nv41/44 pcie gart fixes
i2c unregistering fixes.

* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (191 commits)
  drm/nv98/crypt: fix fuc build with latest envyas
  drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering
  drm/nv41/vm: fix and enable use of "real" pciegart
  drm/nv44/vm: fix and enable use of "real" pciegart
  drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie
  drm/nouveau: store supported dma mask in vmmgr
  drm/nvc0/ibus: initial implementation of subdev
  drm/nouveau/therm: add support for fan-control modes
  drm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules
  drm/nouveau/therm: calculate the pwm divisor on nv50+
  drm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster
  drm/nouveau/therm: move thermal-related functions to the therm subdev
  drm/nouveau/bios: parse the pwm divisor from the perf table
  drm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices
  drm/nouveau/therm: rework thermal table parsing
  drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
  drm/nouveau: fix pm initialization order
  drm/nouveau/bios: check that fixed tvdac gpio data is valid before using it
  drm/nouveau: log channel debug/error messages from client object rather than drm client
  drm/nouveau: have drm debugging macros build on top of core macros
  ...

Conflicts:
drivers/gpu/drm/nouveau/nouveau_dp.c

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Wed, 3 Oct 2012 03:25:04 +0000 (20:25 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs update from Al Viro:

 - big one - consolidation of descriptor-related logics; almost all of
   that is moved to fs/file.c

   (BTW, I'm seriously tempted to rename the result to fd.c.  As it is,
   we have a situation when file_table.c is about handling of struct
   file and file.c is about handling of descriptor tables; the reasons
   are historical - file_table.c used to be about a static array of
   struct file we used to have way back).

   A lot of stray ends got cleaned up and converted to saner primitives,
   disgusting mess in android/binder.c is still disgusting, but at least
   doesn't poke so much in descriptor table guts anymore.  A bunch of
   relatively minor races got fixed in process, plus an ext4 struct file
   leak.

 - related thing - fget_light() partially unuglified; see fdget() in
   there (and yes, it generates the code as good as we used to have).

 - also related - bits of Cyrill's procfs stuff that got entangled into
   that work; _not_ all of it, just the initial move to fs/proc/fd.c and
   switch of fdinfo to seq_file.

 - Alex's fs/coredump.c spiltoff - the same story, had been easier to
   take that commit than mess with conflicts.  The rest is a separate
   pile, this was just a mechanical code movement.

 - a few misc patches all over the place.  Not all for this cycle,
   there'll be more (and quite a few currently sit in akpm's tree)."

Fix up trivial conflicts in the android binder driver, and some fairly
simple conflicts due to two different changes to the sock_alloc_file()
interface ("take descriptor handling from sock_alloc_file() to callers"
vs "net: Providing protocol type via system.sockprotoname xattr of
/proc/PID/fd entries" adding a dentry name to the socket)

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (72 commits)
  MAX_LFS_FILESIZE should be a loff_t
  compat: fs: Generic compat_sys_sendfile implementation
  fs: push rcu_barrier() from deactivate_locked_super() to filesystems
  btrfs: reada_extent doesn't need kref for refcount
  coredump: move core dump functionality into its own file
  coredump: prevent double-free on an error path in core dumper
  usb/gadget: fix misannotations
  fcntl: fix misannotations
  ceph: don't abuse d_delete() on failure exits
  hypfs: ->d_parent is never NULL or negative
  vfs: delete surplus inode NULL check
  switch simple cases of fget_light to fdget
  new helpers: fdget()/fdput()
  switch o2hb_region_dev_write() to fget_light()
  proc_map_files_readdir(): don't bother with grabbing files
  make get_file() return its argument
  vhost_set_vring(): turn pollstart/pollstop into bool
  switch prctl_set_mm_exe_file() to fget_light()
  switch xfs_find_handle() to fget_light()
  switch xfs_swapext() to fget_light()
  ...

11 years agosparc: fix format string argument for prom_printf()
Akinobu Mita [Sat, 29 Sep 2012 03:14:49 +0000 (03:14 +0000)]
sparc: fix format string argument for prom_printf()

prom_printf() takes printf style arguments.  Specifing GCC's format
attribute reveals that there are several wrong usages of prom_printf().

This fixes those wrong format strings and arguments, and also leaves
format attributes in order to detect similar mistakes at compile time.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodrm/nv98/crypt: fix fuc build with latest envyas
Ben Skeggs [Wed, 3 Oct 2012 00:52:58 +0000 (10:52 +1000)]
drm/nv98/crypt: fix fuc build with latest envyas

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/devinit: fixup various issues with subdev ctor/init ordering
Ben Skeggs [Tue, 2 Oct 2012 00:30:34 +0000 (10:30 +1000)]
drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering

Details of the problem, and solution, are in comments in the commit
proper.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv41/vm: fix and enable use of "real" pciegart
Ben Skeggs [Wed, 26 Sep 2012 22:56:24 +0000 (08:56 +1000)]
drm/nv41/vm: fix and enable use of "real" pciegart

Hopefully fixed the tlb flush timeout issue.  Was able to observe this
condition occur occasionally, and it appears the binary driver doesn't
wait on the old condition either..

Should give 39-bit DMA addressing on the relevant chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv44/vm: fix and enable use of "real" pciegart
Ben Skeggs [Wed, 26 Sep 2012 22:55:53 +0000 (08:55 +1000)]
drm/nv44/vm: fix and enable use of "real" pciegart

Something seems to be missing in regards to flushing specific ranges of
the TLB.  For the moment, flushing the entire thing seems to make it
work alright.

Should give 39-bit DMA addressing on the relevant chipsets.

v2: allocate contig 16KiB for dummy pages, reported by mwk on irc

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie
Ben Skeggs [Wed, 26 Sep 2012 05:01:39 +0000 (15:01 +1000)]
drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie

We don't need to pull the page address out of the page tables on nv4x
chips that have a real GART.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: store supported dma mask in vmmgr
Ben Skeggs [Wed, 26 Sep 2012 04:37:51 +0000 (14:37 +1000)]
drm/nouveau: store supported dma mask in vmmgr

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0/ibus: initial implementation of subdev
Ben Skeggs [Wed, 26 Sep 2012 03:05:01 +0000 (13:05 +1000)]
drm/nvc0/ibus: initial implementation of subdev

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/therm: add support for fan-control modes
Martin Peres [Tue, 4 Sep 2012 11:52:00 +0000 (13:52 +0200)]
drm/nouveau/therm: add support for fan-control modes

For now, only 2 control modes are available:
- NONE: The fan is never touched (default)
- MANUAL: The fan is set to the user-defined fan speed (pwm1)

This patch introduces a distinction between ptherm internal fan management
and external fan management. The latter is bound to respect the fan mode
while the first can still select the speed it wants unless the NONE mode
is selected. This is important for automatic fan management.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules
Martin Peres [Tue, 4 Sep 2012 11:39:40 +0000 (13:39 +0200)]
drm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules

This was reported by tizbac on IRC.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/therm: calculate the pwm divisor on nv50+
Martin Peres [Sun, 2 Sep 2012 02:01:43 +0000 (04:01 +0200)]
drm/nouveau/therm: calculate the pwm divisor on nv50+

v2: Martin Peres <martin.peres@labri.fr>
- fixed unintentional use of floating point

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster
Martin Peres [Sun, 2 Sep 2012 01:20:45 +0000 (03:20 +0200)]
drm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster

The previous driver waited for 250ms to accumulate data. This version times a
complete fan rotation and extrapolates to RPM.

The fan rotational speed should now be read in less than 250ms (worst case)
and usually in less 50ms.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/therm: move thermal-related functions to the therm subdev
Martin Peres [Sun, 2 Sep 2012 00:55:58 +0000 (02:55 +0200)]
drm/nouveau/therm: move thermal-related functions to the therm subdev

It looks scary because of the size, but I tried to keep the differences minimal.
Further patches will fix the actual "driver" code and add new features.

v2: change filenames, split to submodules

v3: add a missing include

v4: Ben Skeggs <bskeggs@redhat.com>
- fixed set_defaults() to allow min_duty < 30 (thermal table will
  override this if it's actually necessary)
- fixed set_defaults() to not provide pwm_freq so nv4x (which only has
  pwm_div) can actually work.  the boards using pwm_freq will have a
  thermal table entry to provide us the value.
- removed unused files

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/bios: parse the pwm divisor from the perf table
Martin Peres [Thu, 30 Aug 2012 00:31:59 +0000 (02:31 +0200)]
drm/nouveau/bios: parse the pwm divisor from the perf table

v2: perf_table now is more in line with the other functions

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices
Martin Peres [Sat, 18 Aug 2012 14:33:53 +0000 (16:33 +0200)]
drm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices

This commit also adds a static list of all known devices and their possible
i2c addresses.

v2: use the common table parsing technique as suggested by darktama

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/therm: rework thermal table parsing
Martin Peres [Thu, 16 Aug 2012 09:00:55 +0000 (11:00 +0200)]
drm/nouveau/therm: rework thermal table parsing

As an accident, it should also fix temperature reading on nv4x.

v2: introduce nvbios_therm_entry as advised by darktama

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
Martin Peres [Sat, 12 May 2012 13:28:51 +0000 (15:28 +0200)]
drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: fix pm initialization order
Dmitry Eremin-Solenikov [Tue, 25 Sep 2012 06:31:40 +0000 (10:31 +0400)]
drm/nouveau: fix pm initialization order

If nouveau_pm_perflvl_get() fails, pm->profiles list will be left
uninitialized, which causes oops during nouveau_pm_fini().

Move INIT_LIST_HEAD before call to nouveau_pm_perflvl_get().

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/bios: check that fixed tvdac gpio data is valid before using it
Ben Skeggs [Wed, 12 Sep 2012 05:55:01 +0000 (15:55 +1000)]
drm/nouveau/bios: check that fixed tvdac gpio data is valid before using it

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: log channel debug/error messages from client object rather than drm...
Ben Skeggs [Wed, 12 Sep 2012 03:40:47 +0000 (13:40 +1000)]
drm/nouveau: log channel debug/error messages from client object rather than drm client

This will make it more obvious which application caused particular messages.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: have drm debugging macros build on top of core macros
Ben Skeggs [Wed, 12 Sep 2012 03:38:13 +0000 (13:38 +1000)]
drm/nouveau: have drm debugging macros build on top of core macros

May kill the DRM version completely at some point, undecided..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/core: have client-id be a string, rather than an integer
Ben Skeggs [Wed, 12 Sep 2012 03:09:23 +0000 (13:09 +1000)]
drm/nouveau/core: have client-id be a string, rather than an integer

Can be somewhat more informative that way...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0/fifo: re-bash PBUS regs after vm-fault to BARs/PEEPHOLE
Ben Skeggs [Fri, 7 Sep 2012 00:26:38 +0000 (20:26 -0400)]
drm/nvc0/fifo: re-bash PBUS regs after vm-fault to BARs/PEEPHOLE

Seems to be required to "re-arm" the engines after a vm fault.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0/gr: implement initial trap handler
Ben Skeggs [Thu, 6 Sep 2012 05:03:47 +0000 (01:03 -0400)]
drm/nvc0/gr: implement initial trap handler

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0/gr: rebuild fuc with latest envyas
Ben Skeggs [Thu, 6 Sep 2012 03:09:22 +0000 (13:09 +1000)]
drm/nvc0/gr: rebuild fuc with latest envyas

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvc0/ltcg: read LTS count at startup
Ben Skeggs [Wed, 5 Sep 2012 02:19:26 +0000 (12:19 +1000)]
drm/nvc0/ltcg: read LTS count at startup

Not really sure how to confirm this 100%, but, the numbers match on all the
traces I have for NVCx (2 LTS), NVD9 (1LTS) and NVEx (4LTS).

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nve0/gr: enable use of our fuc by default
Ben Skeggs [Thu, 23 Aug 2012 05:52:28 +0000 (01:52 -0400)]
drm/nve0/gr: enable use of our fuc by default

Graphics acceleration is still disabled by default due to lingering issues
that need to be solved.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nve0/gr: remove 0x404160 bashing from hub fuc
Ben Skeggs [Thu, 23 Aug 2012 05:32:38 +0000 (01:32 -0400)]
drm/nve0/gr: remove 0x404160 bashing from hub fuc

Triggers PIBUS interrupts due to register not existing anymore, and as
a result HUB_SET_CHAN times out.

After this commit, our fuc loads and can accelerate at least fbcon, X,
glxgears and OA on NVE4.  NVE7 not tested as of yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nve0/gr: initial fuc implementation, based on fermi's code
Ben Skeggs [Thu, 23 Aug 2012 00:47:40 +0000 (20:47 -0400)]
drm/nve0/gr: initial fuc implementation, based on fermi's code

Currently identical except the available chipset register lists.  This will
*not* currently work and is disabled by default because of this.

May get merged again later, remains to be seen what further changes will be
required.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nve0/ibus: handle PIBUS interrupts to prevent storm
Ben Skeggs [Thu, 23 Aug 2012 03:55:42 +0000 (23:55 -0400)]
drm/nve0/ibus: handle PIBUS interrupts to prevent storm

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/sw: trap and clear PMC_INTR_0_SOFTWARE
Ben Skeggs [Thu, 23 Aug 2012 05:14:21 +0000 (01:14 -0400)]
drm/nouveau/sw: trap and clear PMC_INTR_0_SOFTWARE

Came in useful for debugging another issue earlier, so keep it around.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: quiet some static-related sparse noise
Marcin Slusarz [Sun, 19 Aug 2012 21:00:00 +0000 (23:00 +0200)]
drm/nouveau: quiet some static-related sparse noise

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: constify instances of nouveau_bitfield and nouveau_enum structs
Marcin Slusarz [Sun, 19 Aug 2012 20:59:59 +0000 (22:59 +0200)]
drm/nouveau: constify instances of nouveau_bitfield and nouveau_enum structs

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/fifo: use defines instead of hardcoded class ids
Ben Skeggs [Sun, 19 Aug 2012 06:03:00 +0000 (16:03 +1000)]
drm/nouveau/fifo: use defines instead of hardcoded class ids

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/dmaobj: reject unsupported parent types instead of half-succeeding
Ben Skeggs [Sun, 19 Aug 2012 05:58:38 +0000 (15:58 +1000)]
drm/nouveau/dmaobj: reject unsupported parent types instead of half-succeeding

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: add defines for internal class names
Ben Skeggs [Sun, 19 Aug 2012 05:53:15 +0000 (15:53 +1000)]
drm/nouveau: add defines for internal class names

Will probably flesh the documentation of the classes out a bit too at some
later point.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv50/fifo: add support for dma channel class
Ben Skeggs [Tue, 14 Aug 2012 05:33:20 +0000 (15:33 +1000)]
drm/nv50/fifo: add support for dma channel class

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>