7 years agoasoc: tegra: Add PCM driver for TDM mode
Nitin Pai [Thu, 26 Apr 2012 13:34:54 +0000]
asoc: tegra: Add PCM driver for TDM mode

Modified existing pcm driver to take dma mode/ hw structure.
Exported the functions needed for other pcm mode driver.
Added new TDM mode hw param structure.
Added pass SINGLE/DOUBLE buffered dma mode params.

Bug 948478

Change-Id: I58309d52748f813b3303a8d6a052fbb6cc7ca87a
Signed-off-by: Nitin Pai <npai@nvidia.com>
Reviewed-on: http://git-master/r/99146
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoarm: tegra: change function declaration to static
Rahul Mittal [Thu, 26 Apr 2012 11:09:23 +0000]
arm: tegra: change function declaration to static

Change-Id: Ib16ea10bf1acc2c7171935429635502aee80f3f4
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-on: http://git-master/r/99072
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agopower: smb349: update correct charger status
Syed Rafiuddin [Wed, 25 Apr 2012 11:49:00 +0000]
power: smb349: update correct charger status

Update correct status to fuel-gauge driver
when charger cable is disconnected.

Bug 960318

Change-Id: I4c3ad2030ada7c06825e80a3eb4697b669fe7cb6
Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Reviewed-on: http://git-master/r/98719
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agomfd: max77663: Add FPWM and FSRADE clearing when initialization
Jinyoung Park [Wed, 25 Apr 2012 11:07:16 +0000]
mfd: max77663: Add FPWM and FSRADE clearing when initialization

If sd power rail is not configured to FORCED_PWM_MODE or
FSRADE_DISABLE, clear corresponding bits(FPWM and FSRADE)
when initialization.

Change-Id: I4e08329a430c6ccf7179b77cc7a283460ffaedd1
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/98715
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agopower: smb349: fix NULL pointer issue.
Syed Rafiuddin [Wed, 25 Apr 2012 10:13:26 +0000]
power: smb349: fix NULL pointer issue.

Configure i2c client structure in update charger structure
only when the charger driver is in use.

If charger driver is not used return -ENODEV

Change-Id: Ib1bc99145ee75bea819f69157920f9096e5d40ba
Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Reviewed-on: http://git-master/r/98712
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agopower: max17048: correcting vcell calcualtion
Syed Rafiuddin [Wed, 11 Apr 2012 10:15:46 +0000]
power: max17048: correcting vcell calcualtion

Vcell is calculated based on upper 12msb's of ADC result.

Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Reviewed-on: http://git-master/r/95830
(cherry picked from commit e550636d9b03207b9d4fecf078168175964d85fd)

Change-Id: Ic2834d8c8576b938e9d7d400c2beeb459ddeb5fc
Reviewed-on: http://git-master/r/98669
Reviewed-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Tested-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agovideo: tegra: host: t30: use max 2d clock
Donghan Ryu [Wed, 25 Apr 2012 06:43:09 +0000]
video: tegra: host: t30: use max 2d clock

setting max 2d clock can make noticeable performance difference
in 2d limited usecase such as buffer clearing

Change-Id: I40ef999e7eeebff45b657f00293608561cae831d
Signed-off-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-on: http://git-master/r/98644
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agomedia: video: tegra: sh532u focus driver
Erik Lilliebjerg [Fri, 4 May 2012 14:09:45 +0000]
media: video: tegra: sh532u focus driver

- Abort initialization if an I2C error to avoid excessive load on the I2C bus
since it is heavily used during initialization.
- Updated to the latest NVC framework.
- Added feature that allows for the key focus points to be set at runtime
and the relative positions recalculated.

Bug 929133
Bug 938934

Change-Id: Ida4ab885bf35057ae6df131e3ec3587a891a7dc9
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/93944
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>



Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoarm: tegra: sh532u focuser board support
Erik Lilliebjerg [Mon, 26 Mar 2012 15:45:01 +0000]
arm: tegra: sh532u focuser board support

Enabling the sh532u driver feature to not register itself
if it does not identify the sh532u device during probe.
This is for the case where the platform does not populate
the device.

Bug 929133

Change-Id: Ic5ac7fa0ae4c05e4978fe7aebc3fc630ef1c2fd3
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/92340
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agousb: host: tegra: configure hotplug in usb phy driver
ahcheng [Mon, 20 Feb 2012 12:01:16 +0000]
usb: host: tegra: configure hotplug in usb phy driver

Properly configure USB_PHY_CLK_VALID_INT_ENB.

Bug 926787

Change-Id: I9c70ce4e35e5c3b841c6240cbb4ce1c9b9f2a8ff
Signed-off-by: ahcheng <ahcheng@nvidia.com>
Reviewed-on: http://git-master/r/84800
(cherry picked from commit 2eba70e75f6baa9e76bea309927b9841dd32bb9e)
Reviewed-on: http://git-master/r/98798
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agonet: wireless: sd8797: Add Kconfig to marvel sd8797
Narayan Reddy [Fri, 4 May 2012 14:05:49 +0000]
net: wireless: sd8797: Add Kconfig to marvel sd8797

add Konfig to marvel 8797 and some tailing
space corrections.

Bug 954218

Change-Id: I2885f2a74dea14ffeeb5dad65e03e217c77c5013
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: http://git-master/r/98436
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>



Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoarm: tegra: kai: code cleanup
naveenk [Fri, 20 Apr 2012 10:31:34 +0000]
arm: tegra: kai: code cleanup

For kai we are not using embedded_sdio
this patch removes embedded_sdio_data

Bug 932086

Change-Id: Id787803094b6baa39c02bb65bead04d819d04b23
Reviewed-on: http://git-master/r/97884
Tested-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

7 years agonet: wireless: sd8797: Marvell sd8797 Wi-Fi driver
Mohan T [Thu, 26 Apr 2012 05:23:57 +0000]
net: wireless: sd8797: Marvell sd8797 Wi-Fi driver

Initial commit for Marvell sd8797 Wi-Fi driver
Package Ver: T3T-14.69.11.p111-M2614303_A0B0-MGPL

Bug 954218

Change-Id: I76fcadb5cda054d1e489c4cff77a3c461bdac742
Signed-off-by: Mohan T <mohant@nvidia.com>
Reviewed-on: http://git-master/r/97305
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

7 years agoarm: tegra: disable built_in support for sdio
naveenk [Thu, 12 Apr 2012 09:04:55 +0000]
arm: tegra: disable built_in support for sdio

disable built_in support for sdio devices on cardhu,ventana
whistler and kai

Bug 956238
Bug 932086

Change-Id: I090174f6119729d25736a7704c6a458eeeb230c5
Signed-off-by: naveen kumar arepalli <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/96079
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Bindal <nbindal@nvidia.com>
Tested-by: Nitin Bindal <nbindal@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

7 years agotegra: usb: phy: fix the struct name of hsic
Jubeom Kim [Mon, 5 Mar 2012 06:00:45 +0000]
tegra: usb: phy: fix the struct name of hsic

Change-Id: I54a46230ee743ac9c740048cdb38328947d52c3c
Signed-off-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-on: http://git-master/r/96133
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agosecurity: tf_driver: update with latest TL drop
Chris Johnson [Fri, 4 May 2012 13:49:05 +0000]
security: tf_driver: update with latest TL drop

Tegra 2 version: TF_TEGRA2_AA01.07.34078
Tegra 3 version: TF_TEGRA3_AB01.06.34049

Bug 950169

Signed-off-by: Chris Johnson <cwj@nvidia.com>
Reviewed-on: http://git-master/r/89927
(cherry picked from commit 28fc4a5b80a0f6db3e6dc50efd8c0412e2ae11bf)

Change-Id: I41413b4f00d243e3bb56d44fb32eea29d0291401
Reviewed-on: http://git-master/r/90445
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Chris Johnson <cwj@nvidia.com>
Tested-by: Chris Johnson <cwj@nvidia.com>
Reviewed-by: Karan Jhavar <kjhavar@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>



Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agomedia: video: tegra: ar0832: adjust frame rate
Jihoon Bang [Tue, 14 Feb 2012 02:00:13 +0000]
media: video: tegra: ar0832: adjust frame rate

Change line_length for 1080p mode in order to change
frame rate from 31.30 to 29.50 fps.
The reason that new fps is not 30 is because flicker
detection requires fps not to be multiples of 60/50Hz.

This change helps save power and lower the chance of frame

Bug 928296

Change-Id: I4fda13d9334c725754b3f5eab034309a1dfef3dc
Signed-off-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-on: http://git-master/r/83636
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoarm: tegra: baseband: Discard modem remote wakeup in L3 transition
Steve Lin [Tue, 3 Apr 2012 23:50:21 +0000]
arm: tegra: baseband: Discard modem remote wakeup in L3 transition

There is race between USB autopm and system PM. The device's upstream
port may not be ready if USB autopm is triggered by modem remote wakeup
GPIO during the L3 to L0 or L0/L2 to L3 transition.

Bug 955162

Reviewed-on: http://git-master/r/91369
(cherry picked from commit b668f74e93a4ae33b380744a8ac28c098456b459)

Change-Id: I1a9c2dadb530144aa8741370247272b6962fe777
Signed-off-by: Steve Lin <stlin@nvidia.com>
Reviewed-on: http://git-master/r/96593
Reviewed-by: Automatic_Commit_Validation_User

7 years agoALSA: HDA: set max_channel only based on LPCM capability
Sumit Bhattacharya [Thu, 5 Apr 2012 12:31:40 +0000]
ALSA: HDA: set max_channel only based on LPCM capability

Set maximum supported channels of HDA driver based on the LPCM channel
capability of the HDMI device. This is needed because user space
decides number of PCM channels to be sent to kernel based on this

Bug 960940

Change-Id: I59ae3b7d47dcf26f697bfb0877ca24556f0ab1fa
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/94831
Reviewed-on: http://git-master/r/98783
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>

7 years agoasoc: tegra: ALC5640 machine:Add support to detect HP in LP0
Manoj Gangwal [Wed, 25 Apr 2012 12:52:01 +0000]
asoc: tegra: ALC5640 machine:Add support to detect HP in LP0

Add Support to detect the HP insertion or removal during
LP0 state.

Bug 969405

Change-Id: Ibedf1769338e16877240ea9cc82fa7469eb7ff9e
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/98745
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agoARM: tegra: clock: Move SCLK shared users initialization
Alex Frid [Fri, 4 May 2012 13:45:23 +0000]
ARM: tegra: clock: Move SCLK shared users initialization

Moved SCLK shared users initialization from silicon only section
of init table to common silicon/emulation section - there is no
reason to limit this settings to silicon only.

Change-Id: Ib1aa1bd3f98008b6584222e6c49f0825d635b8bd
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/98104
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>



Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoASoC: Tegra: Make dma_req count easily configurable
Sumit Bhattacharya [Fri, 20 Apr 2012 11:56:35 +0000]
ASoC: Tegra: Make dma_req count easily configurable

Instead of always using 2 dma_req count pass max dma_req_count
through a macro. Ensure dma_req_count does not cross

Bug 968814

Change-Id: Iddfbd77017992ccb8c90441213e191133dadb347
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/97915
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>

7 years agoASoC: Tegra: Pass snd_soc_card handle in tegra_asoc_utils_init
Sumit Bhattacharya [Fri, 4 May 2012 13:31:21 +0000]
ASoC: Tegra: Pass snd_soc_card handle in tegra_asoc_utils_init

Change prototype of tegra_asoc_utils_init to pass snd_soc_card handle.
It is needed to move common tegra machine driver codes to
tegra_asoc_utils interface.

Bug 968814

Change-Id: I98490ffdda51cf7d0b89adadb23c31892183bc0e
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/97914
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>



Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agousb: otg: tegra: change logic for enable clock
Andy Carman [Wed, 7 Mar 2012 05:25:18 +0000]
usb: otg: tegra: change logic for enable clock

When there is PMU interrupt we need to enable controller
clock. For this currently, work is being schedule, removing
this as clock can be enabled directly without scheduling
any work.

bug 925958
bug 941899

Signed-off-by: Andy Carman <acarman@nvidia.com>
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/88777
(cherry picked from commit fc31c04b7124f30970e862dd1b21a97d18dca38e)

Change-Id: I8f6e7325771219488440226ddde97a32da228608
Reviewed-on: http://git-master/r/97882
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

7 years agommc: tegra: enable MMC_PM_IGNORE_PM_NOTIFY
naveenk [Thu, 12 Apr 2012 08:22:32 +0000]
mmc: tegra: enable MMC_PM_IGNORE_PM_NOTIFY

enable MMC_PM_IGNORE_PM_NOTIFY for all sd instances

Bug 956238
Bug 932086

Change-Id: I4d455e480eabace403719f1813d97abfa4d01924
Signed-off-by: naveen kumar arepalli <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/96071
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Rakesh Kumar <krakesh@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

7 years agoARM: tegra: fuse: Remove overriding chipid and rev
Juha Tukkinen [Fri, 4 May 2012 13:25:14 +0000]
ARM: tegra: fuse: Remove overriding chipid and rev

Remove overriding chipid and revision from command line as this is
not used anywhere.

Change-Id: I41789534c51c14b5194ba84be4b312b99b25c281
Signed-off-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-on: http://git-master/r/95871
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>



Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agovideo: tegra: host: Reset 3D after power on
Terje Bergstrom [Mon, 5 Mar 2012 07:02:30 +0000]
video: tegra: host: Reset 3D after power on

Sometimes 3D unit comes up with incorrect scissor configuration.
Earlier patch added the scissor registers to the context save list,
but that did not solve the problem. Remove the extra registers, and
reset 3D after powering it up.

Bug 939307

Change-Id: Id795f2d99ec3c6b907da2785b1816ce753af7a3f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/87654
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Graziano Misuraca <gmisuraca@nvidia.com>
Tested-by: Graziano Misuraca <gmisuraca@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>

7 years agoarm: tegra: pinmux: treat reg base = 0 valid
Mayuresh Kulkarni [Thu, 3 May 2012 13:49:19 +0000]
arm: tegra: pinmux: treat reg base = 0 valid

- master SoC pinmux table subtracts the reg base (for mux, tri-state &
pull-up/down). this is because, its platform data/device tree binding
adds APB base with the reg base
- however, pinmux driver has checks which results in treating reg base of
0 as invalid. thus, during boot-up pinmux/tristate/pull-up/down
registers are not set correctly as per the setting in board file
- as a result, settings are good for base regs != 0 & hence some things work
while others not
- this is revert of commit 8791f084fb6ebbd8ba2ca1c8c09cfaba1fde88c6
as the master SoC pin-mux table format is changed

bug 974063

Change-Id: Ib254022e3693ffbbafcd475eaeaddc663f6c27df
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/100344
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoarm: tegra: usb_phy: add delay after enabling avdd_usb
Johnny Qiu [Tue, 24 Apr 2012 10:16:29 +0000]
arm: tegra: usb_phy: add delay after enabling avdd_usb

Bug 973928

USB1_VBUS is power gated by avdd_usb on Kai. If there's no delay
after enabling avdd_usb, fsl_udc_core will get incorrect status on
VBUS detection.

Change-Id: I6184a34dcf34c374a5186f91f7f4da308dccfa74
Signed-off-by: Johnny Qiu <joqiu@nvidia.com>
Reviewed-on: http://git-master/r/98414
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: tegra: flowctrl: fix write_cpu_{csr|halt}
Dan Willemsen [Thu, 3 May 2012 05:34:07 +0000]
ARM: tegra: flowctrl: fix write_cpu_{csr|halt}

The two write functions access the opposite arrays.

Change-Id: I18238763909ab8bd940cb011496318a7d9788eb6
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/100239
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Peter De Schrijver <pdeschrijver@nvidia.com>

7 years agoHACK: PM: Port early suspend functionality
Prashant Gaikwad [Mon, 30 Apr 2012 07:23:07 +0000]
HACK: PM: Port early suspend functionality

Bug 959487

Change-Id: I899a4780ca3cd537caca819a9d850377302fd74e
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/99587
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

7 years agoARM: tegra30: defconfig: disable SND_HDA_PLATFORM_NVIDIA_TEGRA
Varun Wadekar [Thu, 3 May 2012 05:08:32 +0000]
ARM: tegra30: defconfig: disable SND_HDA_PLATFORM_NVIDIA_TEGRA

Bug 973940

Change-Id: I0420f8ea4cdda7fa22c7e606b3f5347552450632
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/100236
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>

7 years agoARM: tegra20: defconfig: fix CONFIG_BCMDHD_FW_PATH and CONFIG_BCMDHD_NVRAM_PATH
Varun Wadekar [Tue, 24 Apr 2012 12:55:19 +0000]

Now they point to bcm4330/fw_bcmdhd.bin and nvram_4330.txt respectively

Bug 974673

Change-Id: I49b04c4f9ee400fe86f5b8091191661b301e47c2
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/98457

7 years agoLinux 3.4-rc5
Linus Torvalds [Sun, 29 Apr 2012 22:19:10 +0000]
Linux 3.4-rc5

7 years agoPM / Freezer / Docs: Update documentation about freezing of tasks
Marcos Paulo de Souza [Sun, 29 Apr 2012 20:29:30 +0000]
PM / Freezer / Docs: Update documentation about freezing of tasks

The file Documentation/power/freezing-of-tasks.txt was still referencing
the TIF_FREEZE flag, that was removed by the commit
d88e4cb67197d007fb778d62fe17360e970d5bfa(freezer: remove now unused

This patch removes all the references of TIF_FREEZE that were left

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

7 years agoPM / Hibernate: fix the number of pages used for hibernate/thaw buffering
Bojan Smojver [Tue, 24 Apr 2012 21:53:28 +0000]
PM / Hibernate: fix the number of pages used for hibernate/thaw buffering

Hibernation regression fix, since 3.2.

Calculate the number of required free pages based on non-high memory
pages only, because that is where the buffers will come from.

Commit 081a9d043c983f161b78fdc4671324d1342b86bc introduced a new buffer
page allocation logic during hibernation, in order to improve the
performance. The amount of pages allocated was calculated based on total
amount of pages available, although only non-high memory pages are
usable for this purpose. This caused hibernation code to attempt to over
allocate pages on platforms that have high memory, which led to hangs.

Signed-off-by: Bojan Smojver <bojan@rexursive.com>
Signed-off-by: Rafael J. Wysocki <rjw@suse.de>

7 years agoautofs: make the autofsv5 packet file descriptor use a packetized pipe
Linus Torvalds [Sun, 29 Apr 2012 20:30:08 +0000]
autofs: make the autofsv5 packet file descriptor use a packetized pipe

The autofs packet size has had a very unfortunate size problem on x86:
because the alignment of 'u64' differs in 32-bit and 64-bit modes, and
because the packet data was not 8-byte aligned, the size of the autofsv5
packet structure differed between 32-bit and 64-bit modes despite
looking otherwise identical (300 vs 304 bytes respectively).

We first fixed that up by making the 64-bit compat mode know about this
problem in commit a32744d4abae ("autofs: work around unhappy compat
problem on x86-64"), and that made a 32-bit 'systemd' work happily on a
64-bit kernel because everything then worked the same way as on a 32-bit

But it turned out that 'automount' had actually known and worked around
this problem in user space, so fixing the kernel to do the proper 32-bit
compatibility handling actually *broke* 32-bit automount on a 64-bit
kernel, because it knew that the packet sizes were wrong and expected
those incorrect sizes.

As a result, we ended up reverting that compatibility mode fix, and
thus breaking systemd again, in commit fcbf94b9dedd.

With both automount and systemd doing a single read() system call, and
verifying that they get *exactly* the size they expect but using
different sizes, it seemed that fixing one of them inevitably seemed to
break the other.  At one point, a patch I seriously considered applying
from Michael Tokarev did a "strcmp()" to see if it was automount that
was doing the operation.  Ugly, ugly.

However, a prettier solution exists now thanks to the packetized pipe
mode.  By marking the communication pipe as being packetized (by simply
setting the O_DIRECT flag), we can always just write the bigger packet
size, and if user-space does a smaller read, it will just get that
partial end result and the extra alignment padding will simply be thrown

This makes both automount and systemd happy, since they now get the size
they asked for, and the kernel side of autofs simply no longer needs to
care - it could pad out the packet arbitrarily.

Of course, if there is some *other* user of autofs (please, please,
please tell me it ain't so - and we haven't heard of any) that tries to
read the packets with multiple writes, that other user will now be
broken - the whole point of the packetized mode is that one system call
gets exactly one packet, and you cannot read a packet in pieces.

Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Ian Kent <raven@themaw.net>
Cc: Thomas Meyer <thomas@m3y3r.de>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agopipes: add a "packetized pipe" mode for writing
Linus Torvalds [Sun, 29 Apr 2012 20:12:42 +0000]
pipes: add a "packetized pipe" mode for writing

The actual internal pipe implementation is already really about
individual packets (called "pipe buffers"), and this simply exposes that
as a special packetized mode.

When we are in the packetized mode (marked by O_DIRECT as suggested by
Alan Cox), a write() on a pipe will not merge the new data with previous
writes, so each write will get a pipe buffer of its own.  The pipe
buffer is then marked with the PIPE_BUF_FLAG_PACKET flag, which in turn
will tell the reader side to break the read at that boundary (and throw
away any partial packet contents that do not fit in the read buffer).

End result: as long as you do writes less than PIPE_BUF in size (so that
the pipe doesn't have to split them up), you can now treat the pipe as a
packet interface, where each read() system call will read one packet at
a time.  You can just use a sufficiently big read buffer (PIPE_BUF is
sufficient, since bigger than that doesn't guarantee atomicity anyway),
and the return value of the read() will naturally give you the size of
the packet.

NOTE! We do not support zero-sized packets, and zero-sized reads and
writes to a pipe continue to be no-ops.  Also note that big packets will
currently be split at write time, but that the size at which that
happens is not really specified (except that it's bigger than PIPE_BUF).
Currently that limit is the system page size, but we might want to
explicitly support bigger packets some day.

The main user for this is going to be the autofs packet interface,
allowing us to stop having to care so deeply about exact packet sizes
(which have had bugs with 32/64-bit compatibility modes).  But user
space can create packetized pipes with "pipe2(fd, O_DIRECT)", which will
fail with an EINVAL on kernels that do not support this interface.

Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Ian Kent <raven@themaw.net>
Cc: Thomas Meyer <thomas@m3y3r.de>
Cc: stable@kernel.org # needed for systemd/autofs interaction fix
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agostaging: ozwpan: Fix bug where kfree is called twice.
Rupesh Gujare [Wed, 25 Apr 2012 22:54:58 +0000]
staging: ozwpan: Fix bug where kfree is called twice.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agostaging: octeon-ethernet: fix build errors by including interrupt.h
Imre Kaloz [Thu, 19 Apr 2012 10:27:27 +0000]
staging: octeon-ethernet: fix build errors by including interrupt.h

This patch fixes the following build failures:

drivers/staging/octeon/ethernet.c: In function 'cvm_oct_cleanup_module':
drivers/staging/octeon/ethernet.c:799:2: error: implicit declaration of function 'free_irq'
drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_no_more_work':
drivers/staging/octeon/ethernet-rx.c:119:3: error: implicit declaration of function 'enable_irq'
drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_do_interrupt':
drivers/staging/octeon/ethernet-rx.c:136:2: error: implicit declaration of function 'disable_irq_nosync'
drivers/staging/octeon/ethernet-rx.c: In function 'cvm_oct_rx_initialize':
drivers/staging/octeon/ethernet-rx.c:532:2: error: implicit declaration of function 'request_irq'
drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_tx_initialize':
drivers/staging/octeon/ethernet-tx.c:712:2: error: implicit declaration of function 'request_irq'
drivers/staging/octeon/ethernet-tx.c: In function 'cvm_oct_tx_shutdown':
drivers/staging/octeon/ethernet-tx.c:723:2: error: implicit declaration of function 'free_irq'

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agostaging: zcache: fix Kconfig crypto dependency
Seth Jennings [Tue, 24 Apr 2012 01:33:50 +0000]
staging: zcache: fix Kconfig crypto dependency

ZCACHE is a boolean in the Kconfig.  When selected, it
should require that CRYPTO be builtin (=y).

Currently, ZCACHE=y and CRYPTO=m is a valid configuration
when it should not be.

This patch changes the zcache Kconfig to enforce this

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agostaging: tidspbridge: remove usage of OMAP2_L4_IO_ADDRESS
Omar Ramirez Luna [Sat, 21 Apr 2012 01:22:41 +0000]
staging: tidspbridge: remove usage of OMAP2_L4_IO_ADDRESS

Instead now use ioremap. This is needed for 3.4 since this change
emerged in mainline during one of the previous rc cycles.

These solves the following compilation breaks:

    In function ‘bridge_brd_start’:
    error: implicit declaration of function ‘OMAP2_L4_IO_ADDRESS’

drivers/staging/tidspbridge/core/wdt.c: In function ‘dsp_wdt_init’:
    error: implicit declaration of function ‘OMAP2_L4_IO_ADDRESS’

For control registers a new function needs to be defined so we
can get rid of a layer violation, but that approach must be queued
for the next merge window.

As seen in:
platform: omap4430-sdp build: uImage
config: randconfig version: 3.4.0-rc3
start time: Apr 20 2012 01:07

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agousb: gadget: udc-core: fix incompatibility with dummy-hcd
Alan Stern [Thu, 26 Apr 2012 15:31:57 +0000]
usb: gadget: udc-core: fix incompatibility with dummy-hcd

This patch (as1548) fixes a recently-introduced incompatibility
between the UDC core and the dummy-hcd driver.  Commit
8ae8090c82eb407267001f75b3d256b3bd4ae691 (usb: gadget: udc-core: fix
asymmetric calls in remove_driver) moved the usb_gadget_udc_stop()
call in usb_gadget_remove_driver() below the usb_gadget_disconnect()

As a result, usb_gadget_disconnect() gets called at a time when the
gadget driver believes it has been unbound but dummy-hcd believes
it has not.  A nasty error ensues when dummy-hcd calls the gadget
driver's disconnect method a second time.

To fix the problem, this patch moves the gadget driver's unbind
notification after the usb_gadget_disconnect() call.  Now nothing
happens between the two unbind notifications, so nothing goes wrong.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

7 years agousb: gadget: udc-core: fix wrong call order
Felipe Balbi [Fri, 27 Apr 2012 08:02:15 +0000]
usb: gadget: udc-core: fix wrong call order

commit 6d258a4 (usb: gadget: udc-core: stop UDC on device-initiated
disconnect) introduced another case of asymmetric calls when issuing
a device-initiated disconnect. Fix it.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Felipe Balbi <balbi@ti.com>

7 years agousb: gadget: dummy: do not call pullup() on udc_stop()
Felipe Balbi [Wed, 18 Apr 2012 10:59:30 +0000]
usb: gadget: dummy: do not call pullup() on udc_stop()

pullup() is already called properly by udc-core.c and
there's no need to call it from udc_stop(), in fact that
will cause issues.

Cc: stable@vger.kernel.org
Reviewed-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>

7 years agousb: musb: davinci.c: add missing unregister
Julia Lawall [Mon, 16 Apr 2012 15:03:10 +0000]
usb: musb: davinci.c: add missing unregister

usb_nop_xceiv_unregister is needed on failure of usb_get_transceiver, as
done in other error-handling code in the same function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>

7 years agousb: musb: drop __deprecated flag
Felipe Balbi [Wed, 18 Apr 2012 10:49:20 +0000]
usb: musb: drop __deprecated flag

Looks like we cannot live without that double_buffer_not_ok
flag due to many HW bugs this MUSB core has.

So, let's drop the __deprecated flag to avoid annoying
compile warnings.

Signed-off-by: Felipe Balbi <balbi@ti.com>

7 years agoUSB: gadget: storage gadgets send wrong error code for unknown commands
Alan Stern [Wed, 11 Apr 2012 20:09:10 +0000]
USB: gadget: storage gadgets send wrong error code for unknown commands

This patch (as1539) fixes a minor bug in the mass-storage gadget
drivers.  When an unknown command is received, the error code sent
back is "Invalid Field in CDB" rather than "Invalid Command".  This is
because the bitmask of CDB bytes allowed to be nonzero is incorrect.

When handling an unknown command, we don't care which command bytes
are nonzero.  All the bits in the mask should be set, not just eight
of them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <Michal Nazarewicz <mina86@mina86.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>

7 years agousb: otg: gpio_vbus: Add otg transceiver events and notifiers
Heiko Stübner [Wed, 29 Feb 2012 22:03:11 +0000]
usb: otg: gpio_vbus: Add otg transceiver events and notifiers

Commit 9ad63986c606 (pda_power: Add support for using otg transceiver events)
converted the pda-power driver to use otg events to determine the status
of the power supply.

As gpio-vbus didn't use otg events until now, this change breaks setups
of pda-power with a gpio-vbus transceiver.

This patch adds the necessary otg events and notifiers to gpio-vbus.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Dima Zavin <dima@android.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

7 years agoUSB: cdc-wdm: fix race leading leading to memory corruption
Oliver Neukum [Thu, 26 Apr 2012 19:59:10 +0000]
USB: cdc-wdm: fix race leading leading to memory corruption

This patch fixes a race whereby a pointer to a buffer
would be overwritten while the buffer was in use leading
to a double free and a memory leak. This causes crashes.
This bug was introduced in 2.6.34

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agoUSB: EHCI: fix crash during suspend on ASUS computers
Alan Stern [Tue, 24 Apr 2012 18:07:22 +0000]
USB: EHCI: fix crash during suspend on ASUS computers

This patch (as1545) fixes a problem affecting several ASUS computers:
The machine crashes or corrupts memory when going into suspend if the
ehci-hcd driver is bound to any controllers.  Users have been forced
to unbind or unload ehci-hcd before putting their systems to sleep.

After extensive testing, it was determined that the machines don't
like going into suspend when any EHCI controllers are in the PCI D3
power state.  Presumably this is a firmware bug, but there's nothing
we can do about it except to avoid putting the controllers in D3
during system sleep.

The patch adds a new flag to indicate whether the problem is present,
and avoids changing the controller's power state if the flag is set.
Runtime suspend is unaffected; this matters only for system suspend.
However as a side effect, the controller will not respond to remote
wakeup requests while the system is asleep.  Hence USB wakeup is not
functional -- but of course, this is already true in the current state
of affairs.

This fixes Bugzilla #42728.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Tested-by: Andrey Rahmatullin <wrar@wrar.name>
Tested-by: Oleksij Rempel (fishor) <bug-track@fisher-privat.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agousb gadget: uvc: uvc_request_data::length field must be signed
Laurent Pinchart [Tue, 24 Apr 2012 09:29:42 +0000]
usb gadget: uvc: uvc_request_data::length field must be signed

The field is used to pass the UVC request data length, but can also be
used to signal an error when setting it to a negative value. Switch from
unsigned int to __s32.

Reported-by: Fernandez Gonzalo <gfernandez@copreci.es>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

7 years agoBtrfs: reduce lock contention during extent insertion
Chris Mason [Fri, 27 Apr 2012 18:31:29 +0000]
Btrfs: reduce lock contention during extent insertion

We're spending huge amounts of time on lock contention during
end_io processing because we unconditionally assume we are overwriting
an existing extent in the file for each IO.

This checks to see if we are outside i_size, and if so, it uses a
less expensive readonly search of the btree to look for existing

Signed-off-by: Chris Mason <chris.mason@oracle.com>

7 years agoBtrfs: avoid deadlocks from GFP_KERNEL allocations during btrfs_real_readdir
Chris Mason [Fri, 27 Apr 2012 18:23:22 +0000]
Btrfs: avoid deadlocks from GFP_KERNEL allocations during btrfs_real_readdir

Btrfs has an optimization where it will preallocate dentries during
readdir to fill in enough information to open the inode without an extra

But, we're calling d_alloc, which is doing GFP_KERNEL allocations, and
that leads to deadlocks because our readdir code has tree locks held.

For now, disable this optimization.  We'll fix the gfp mask in the next
merge window.

Signed-off-by: Chris Mason <chris.mason@oracle.com>

7 years agoBtrfs: Fix space checking during fs resize
Daniel J Blueman [Fri, 27 Apr 2012 16:41:46 +0000]
Btrfs: Fix space checking during fs resize

Fix out-of-space checking, addressing a warning and potential resource
leak when resizing the filesystem down while allocating blocks.

Signed-off-by: Daniel J Blueman <daniel@quora.org>
Reviewed-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

7 years agoBtrfs: fix block_rsv and space_info lock ordering
Stefan Behrens [Fri, 27 Apr 2012 16:41:46 +0000]
Btrfs: fix block_rsv and space_info lock ordering

may_commit_transaction() calls
and update_global_block_rsv() calls

Lockdep complains about this at run time.
Everywhere except in update_global_block_rsv(), the space_info lock is
the outer lock, therefore the locking order in update_global_block_rsv()
is changed.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

7 years agoBtrfs: Prevent root_list corruption
Daniel J Blueman [Fri, 27 Apr 2012 16:41:46 +0000]
Btrfs: Prevent root_list corruption

I was seeing root_list corruption on unmount during fs resize in 3.4-rc4; add
correct locking to address this.

Signed-off-by: Daniel J Blueman <daniel@quora.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

7 years agoBtrfs: fix repair code for RAID10
Jan Schmidt [Fri, 27 Apr 2012 16:41:45 +0000]
Btrfs: fix repair code for RAID10

btrfs_map_block sets mirror_num, so that the repair code knows eventually
which device gave us the read error. For RAID10, mirror_num must be 1 or 2.
Before this fix mirror_num was incorrectly related to our stripe index.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

7 years agoBtrfs: do not start delalloc inodes during sync
Josef Bacik [Tue, 24 Apr 2012 00:35:03 +0000]
Btrfs: do not start delalloc inodes during sync

btrfs_start_delalloc_inodes will just walk the list of delalloc inodes and
start writing them out, but it doesn't splice the list or anything so as
long as somebody is doing work on the box you could end up in this section
_forever_.  So just remove it, it's not needed anyway since sync will start
writeback on all inodes anyway, all we need to do is wait for ordered
extents and then we can commit the transaction.  In my horrible torture test
sync goes from taking 4 minutes to about 1.5 minutes.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

7 years agoBtrfs: fix that check_int_data mount option was ignored
Stefan Behrens [Fri, 30 Mar 2012 11:58:32 +0000]
Btrfs: fix that check_int_data mount option was ignored

The bitfield member mount_opt was too small by one bit to hold the mount
option that enabled to include data extents in the integrity checker.
Since the same issue happened when the BTRFS_MOUNT_PANIC_ON_FATAL_ERROR
option was added (git rebase silently merges so that the increase of the
size of the bitfield member is lost), the bit limit was removed entirely.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>

7 years agoBtrfs: don't count CRC or header errors twice while scrubbing
Stefan Behrens [Fri, 30 Mar 2012 11:58:31 +0000]
Btrfs: don't count CRC or header errors twice while scrubbing

Each CRC or header error was counted twice, this is now fixed.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>

7 years agoBtrfs: fix btrfs_ioctl_dev_info() crash on missing device
Stefan Behrens [Mon, 19 Mar 2012 15:17:22 +0000]
Btrfs: fix btrfs_ioctl_dev_info() crash on missing device

When a filesystem is mounted with the degraded option, it is
possible that some of the devices are not there.
btrfs_ioctl_dev_info() crashs in this case because the device
name is a NULL pointer. This ioctl was only used for scrub.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>

7 years agobtrfs: don't return EINTR
Arne Jansen [Wed, 18 Apr 2012 08:27:16 +0000]
btrfs: don't return EINTR

It is basically a good thing if we are interruptible when waiting for
free space, but the generality in which it is implemented currently
leads to system calls being interruptible that are not documented this
way. For example git can't handle interrupted unlink(), leading to
corrupt repos under space pressure.
Instead we raise the bar to only be interruptible by SIGKILL.
Thanks to David Sterba for suggesting this.

Signed-off-by: Arne Jansen <sensille@gmx.net>

7 years agoBtrfs: double unlock bug in error handling
Dan Carpenter [Wed, 18 Apr 2012 06:59:03 +0000]
Btrfs: double unlock bug in error handling

The caller expects this function to return with the lock held and
releases it immediately on error.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

7 years agoBtrfs: always store the mirror we read the eb from
Josef Bacik [Mon, 16 Apr 2012 13:42:26 +0000]
Btrfs: always store the mirror we read the eb from

A user reported a panic where we were trying to fix a bad mirror but the
mirror number we were giving was 0, which is invalid.  This is because we
don't do the transid verification until after the read, so as far as the
read code is concerned the read was a success.  So instead store the mirror
we read from so that if there is some failure post read we know which mirror
to try next and which mirror needs to be fixed if we find a good copy of the
block.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>

7 years agofs/btrfs/volumes.c: add missing free_fs_devices
Julia Lawall [Sat, 14 Apr 2012 09:24:33 +0000]
fs/btrfs/volumes.c: add missing free_fs_devices

Free fs_devices as done in the error-handling code just below.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

7 years agobtrfs: fix early abort in 'remount'
Sergei Trofimovich [Mon, 16 Apr 2012 03:44:37 +0000]
btrfs: fix early abort in 'remount'

Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Josef Bacik <josef@redhat.com>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

7 years agoBtrfs: fix max chunk size check in chunk allocator
Ilya Dryomov [Fri, 13 Apr 2012 14:05:08 +0000]
Btrfs: fix max chunk size check in chunk allocator

Fix a bug, where in case we need to adjust stripe_size so that the
length of the resulting chunk is less than or equal to max_chunk_size,
DUP chunks turn out to be only half as big as they could be.

Cc: Arne Jansen <sensille@gmx.net>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

7 years agoBtrfs: add missing read locks in backref.c
Jan Schmidt [Fri, 13 Apr 2012 10:28:08 +0000]
Btrfs: add missing read locks in backref.c

iref_to_path and iterate_irefs both increment the eb's refcount to use it
after releasing the path. Both depend on consistent data remaining in the
extent buffer and need a read lock to protect it.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>

7 years agoBtrfs: don't call free_extent_buffer twice in iterate_irefs
Jan Schmidt [Fri, 13 Apr 2012 10:28:00 +0000]
Btrfs: don't call free_extent_buffer twice in iterate_irefs

Avoid calling free_extent_buffer more than once when the iterator function
returns non-zero. The only code that uses this is scrub repair for corrupted
nodatasum blocks.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>

7 years agoBtrfs: Make free_ipath() deal gracefully with NULL pointers
Jesper Juhl [Thu, 12 Apr 2012 20:47:52 +0000]
Btrfs: Make free_ipath() deal gracefully with NULL pointers

Make free_ipath() behave like most other freeing functions in the
kernel and gracefully do nothing when passed a NULL pointer.

Besides this making the bahaviour consistent with functions such as
kfree(), vfree(), btrfs_free_path() etc etc, it also fixes a real NULL
deref issue in fs/btrfs/ioctl.c::btrfs_ioctl_ino_to_path(). In that
function we have this code:

        ipath = init_ipath(size, root, path);
        if (IS_ERR(ipath)) {
                ret = PTR_ERR(ipath);
                ipath = NULL;
                goto out;

If we ever take the true branch of that 'if' statement we'll end up
passing a NULL pointer to free_ipath() which will subsequently
dereference it and we'll go "Boom" :-(
This patch will avoid that.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>

7 years agoBtrfs: avoid possible use-after-free in clear_extent_bit()
Li Zefan [Mon, 12 Mar 2012 08:39:48 +0000]
Btrfs: avoid possible use-after-free in clear_extent_bit()

    next_node = rb_next(&state->rb_node);
    clear_state_bit(state);  <-- this may free next_node
    if (next_node) {
        state = rb_entry(next_node);

clear_state_bit() calls merge_state() which may free the next node
of the passing extent_state, so clear_extent_bit() may end up
referencing freed memory.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

7 years agoBtrfs: retrurn void from clear_state_bit
Li Zefan [Mon, 12 Mar 2012 08:39:28 +0000]
Btrfs: retrurn void from clear_state_bit

Currently it returns a set of bits that were cleared, but this return
value is not used at all.

Moreover it doesn't seem to be useful, because we may clear the bits
of a few extent_states, but only the cleared bits of last one is

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

7 years agobtrfs: add missing unlocks to transaction abort paths
David Sterba [Mon, 2 Apr 2012 16:31:37 +0000]
btrfs: add missing unlocks to transaction abort paths

Added in commit 49b25e0540904be0bf558b84475c69d72e4de66e
("btrfs: enhance transaction abort infrastructure")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>

7 years agoBtrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE
Liu Bo [Tue, 3 Apr 2012 01:56:53 +0000]
Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE

Our code is not ready to cope with a sectorsize that's not equal to PAGE_SIZE.
It will lead to hanging-on while writing something.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>

7 years agobtrfs: don't add both copies of DUP to reada extent tree
Arne Jansen [Sat, 25 Feb 2012 08:09:47 +0000]
btrfs: don't add both copies of DUP to reada extent tree

Normally when there are 2 copies of a block, we add both to the
reada extent tree and prefetch only the one that is easier to reach.
This way we can better utilize multiple devices.
In case of DUP this makes no sense as both copies reside on the
same device.

Signed-off-by: Arne Jansen <sensille@gmx.net>

7 years agobtrfs: fix race in reada
Arne Jansen [Sat, 25 Feb 2012 08:09:30 +0000]
btrfs: fix race in reada

When inserting into the radix tree returns EEXIST, get the existing
entry without giving up the spinlock in between.
There was a race for both the zones trees and the extent tree.

Signed-off-by: Arne Jansen <sensille@gmx.net>

7 years agoBtrfs: avoid setting ->d_op twice
Li Zefan [Tue, 21 Feb 2012 09:04:28 +0000]
Btrfs: avoid setting ->d_op twice

Follow those instructions, and you'll trigger a warning in the
beginning of d_set_d_op():

  # mkfs.btrfs /dev/loop3
  # mount /dev/loop3 /mnt
  # btrfs sub create /mnt/sub
  # btrfs sub snap /mnt /mnt/snap
  # touch /mnt/snap/sub
  touch: cannot touch `tmp': Permission denied

__d_alloc() set d_op to sb->s_d_op (btrfs_dentry_operations), and
then simple_lookup() reset it to simple_dentry_operations, which
triggered the warning.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

7 years agoARM: SAMSUNG: add missing MMC_CAP2_BROKEN_VOLTAGE capability
Marek Szyprowski [Wed, 25 Apr 2012 00:28:12 +0000]
ARM: SAMSUNG: add missing MMC_CAP2_BROKEN_VOLTAGE capability

Commit 6e8201f57c935 "mmc: core: add the capability for broken voltage"
introduced a new quirk to indicate that MMC core should ignore voltage
change errors reported by the regulators core. This is required to get
SDHCI working on UniversalC210, NURI and GONI boards again after commit
ceb6143b2df81c ("mmc: sdhci: fix vmmc handling").

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

7 years agoARM: EXYNOS: Fix compilation error when CONFIG_OF is not defined
Tushar Behera [Tue, 24 Apr 2012 20:25:01 +0000]
ARM: EXYNOS: Fix compilation error when CONFIG_OF is not defined

Fixed following compile time error.
arch/arm/mach-exynos/common.c: In function 'exynos5_init_irq':
arch/arm/mach-exynos/common.c:539:2: error: implicit declaration of function 'of_irq_init'
arch/arm/mach-exynos/common.c:539:14: error: 'exynos4_dt_irq_match' undeclared (first use in this function)
arch/arm/mach-exynos/common.c:539:14: note: each undeclared identifier is reported only once for each function it appears in

Cc: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

7 years agoARM: EXYNOS: Fix resource on dev-dwmci.c
Kukjin Kim [Sat, 21 Apr 2012 15:31:38 +0000]
ARM: EXYNOS: Fix resource on dev-dwmci.c

Should be EXYNOS4_IRQ_DWMCI instead of IRQ_DWMCI,

Reported-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

7 years agoARM: S3C24XX: Fix build warning for S3C2410_PM
Kukjin Kim [Sat, 21 Apr 2012 14:55:33 +0000]
ARM: S3C24XX: Fix build warning for S3C2410_PM

warning: (CPU_S3C2440 && CPU_S3C2442) selects S3C2410_PM which has unmet direct dependencies (ARCH_S3C24XX && CPU_S3C2410)
warning: (CPU_S3C2440 && CPU_S3C2442) selects S3C2410_PM which has unmet direct dependencies (ARCH_S3C24XX && CPU_S3C2410)

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

7 years agoARM: mini2440_defconfig: Fix build error
Arnd Bergmann [Sat, 21 Apr 2012 13:57:29 +0000]
ARM: mini2440_defconfig: Fix build error

This is needed to fix mini2440_defconfig after the platform
files have been moved around.

arm-none-linux-gnueabi-ld: no machine record defined
arm-none-linux-gnueabi-ld: no machine record defined
arm-none-linux-gnueabi-ld: no machine record defined
make: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

7 years agoARM: EXYNOS: Fix incorrect initialization of GIC
Thomas Abraham [Sat, 21 Apr 2012 00:26:23 +0000]
ARM: EXYNOS: Fix incorrect initialization of GIC

Use the of_irq_init() call to setup the gic which also properly
registers the gic device node pointer with gic irq domain,
without which all interrupt specifier translations for gic fail.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

7 years agoARM: EXYNOS: use 'exynos4-sdhci' as device name for sdhci controllers
Thomas Abraham [Sat, 14 Apr 2012 15:04:46 +0000]
ARM: EXYNOS: use 'exynos4-sdhci' as device name for sdhci controllers

With the addition of platform specific driver data in the sdhci driver
for EXYNOS4 and EXYNOS5, the device name of sdhci controllers on EXYNOS4
and EXYNOS5 are changed accordingly.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
[kgene.kim@samsung.com: re-worked on top of v3.4-rc2]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

7 years agoARM: PXA2xx: MFP: fix potential direction bug
Igor Grinberg [Thu, 12 Apr 2012 12:43:29 +0000]
ARM: PXA2xx: MFP: fix potential direction bug

Pins configured as input and have MFP_LPM_DRIVE_* flag set, can have a
wrong output value for some period of time (spike) during the suspend
This can happen because the direction of the pins (GPDR) is set by
software and the output level is set by hardware (PGSR) at a later

Fix the above potential bug by setting the output levels first.
Also save the actual levels of the pins before the suspend and restore
them after the resume, but before the direction settings take place, so
the same bug as described above will not happen in the resume sequence.

Reported-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>

7 years agoARM: PXA2xx: MFP: fix bug with MFP_LPM_KEEP_OUTPUT
Igor Grinberg [Thu, 12 Apr 2012 12:43:28 +0000]
ARM: PXA2xx: MFP: fix bug with MFP_LPM_KEEP_OUTPUT

Pins that have MFP_LPM_KEEP_OUTPUT set and are configured for output
must retain the output state in low power mode.
Currently, the pin direction configuration is overrided with values
in gpdr_lpm[] array and do not obey the MFP_LPM_KEEP_OUTPUT setting.

Fix the above bug and add some documentation to clarify the
MFP_LPM_KEEP_OUTPUT setting purpose.

Reported-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>

7 years agoarm/sa1100: fix sa1100-rtc memory resource
Dmitry Artamonow [Sat, 14 Apr 2012 06:26:19 +0000]
arm/sa1100: fix sa1100-rtc memory resource

DEFINE_RES_MEM() takes the size of resource as a second argument,
not the end address. Passing end address leads to following error
in runtime during device registration:
sa1100-rtc: failed to claim resource 0

Fix it.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>

7 years agoARM: pxa: fix gpio wakeup setting
Robert Jarzmik [Sun, 22 Apr 2012 11:37:24 +0000]
ARM: pxa: fix gpio wakeup setting

In 3.3, gpio wakeup setting was broken. The call
enable_irq_wake() didn't set up the PXA gpio registers
(PWER, ...) anymore.

Fix it at least for pxa27x. The driver doesn't seem to be
used in pxa25x (weird ...), and the fix doesn't extend to
pxa3xx and pxa95x (which don't have a gpio_set_wake()

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>

7 years agoARM: u300: bump all IRQ numbers by one
Linus Walleij [Wed, 18 Apr 2012 13:29:58 +0000]
ARM: u300: bump all IRQ numbers by one

Since the VIC was converted to use generic IRQ domains IRQ 0
is silently ignored. This IRQ is used on the U300 so we're
missing it now. Bump all IRQ numbers by one since they are
now decoupled from the hardware IRQ numbers.

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

7 years agoARM: ux300: Fix unimplementable regulation constraints
Mark Brown [Sat, 31 Mar 2012 16:44:53 +0000]
ARM: ux300: Fix unimplementable regulation constraints

It doesn't make sense to grant permission to change the status of a
regulator that is also set as always on and similarly it doesn't make
sense to allow a driver to change the voltage of a regulator which can
only be set to a single voltage.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

7 years agoARM: msm: Fix gic irqdomain support
David Brown [Mon, 23 Apr 2012 22:34:20 +0000]
ARM: msm: Fix gic irqdomain support

As of

    commit 75294957be1dee7d22dd7d90bd31334ba410e836
    Author: Grant Likely <grant.likely@secretlab.ca>
    Date:   Tue Feb 14 14:06:57 2012 -0700

        irq_domain: Remove 'new' irq_domain in favour of the ppc one

the ARM gic controller uses proper irq domains.  Fix the MSM gic
initialization and DT so that it works again.

Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>

7 years agodrm/i915: Set the Stencil Cache eviction policy to non-LRA mode.
Kenneth Graunke [Fri, 27 Apr 2012 19:44:41 +0000]
drm/i915: Set the Stencil Cache eviction policy to non-LRA mode.

Clearing bit 5 of CACHE_MODE_0 is necessary to prevent GPU hangs in
OpenGL programs such as Google MapsGL, Google Earth, and gzdoom when
using separate stencil buffers.  Without it, the GPU tries to use the
LRA eviction policy, which isn't supported.  This was supposed to be off
by default, but seems to be on for many machines.

This cannot be done in gen6_init_clock_gating with most of the other
workaround bits; the render ring needs to exist.  Otherwise, the
register write gets dropped on the floor (one printk will show it
changed, but a second printk immediately following shows the value
reverts to the old one).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47535
Cc: stable@vger.kernel.org
Cc: Rob Castle <futuredub@gmail.com>
Cc: Eric Appleman <erappleman@gmail.com>
Cc: aaron667@gmx.net
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>

7 years agodrm/radeon/kms: need to set up ss on DP bridges as well
Alex Deucher [Fri, 27 Apr 2012 21:18:59 +0000]
drm/radeon/kms: need to set up ss on DP bridges as well

Makes Nutmeg DP to VGA bridges work for me.


Noticed by Jerome Glisse (after weeks of debugging).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>

7 years agoRevert "autofs: work around unhappy compat problem on x86-64"
Linus Torvalds [Sat, 28 Apr 2012 15:29:56 +0000]
Revert "autofs: work around unhappy compat problem on x86-64"

This reverts commit a32744d4abae24572eff7269bc17895c41bd0085.

While that commit was technically the right thing to do, and made the
x86-64 compat mode work identically to native 32-bit mode (and thus
fixing the problem with a 32-bit systemd install on a 64-bit kernel), it
turns out that the automount binaries had workarounds for this compat

Now, the workarounds are disgusting: doing an "uname()" to find out the
architecture of the kernel, and then comparing it for the 64-bit cases
and fixing up the size of the read() in automount for those.  And they
were confused: it's not actually a generic 64-bit issue at all, it's
very much tied to just x86-64, which has different alignment for an
'u64' in 64-bit mode than in 32-bit mode.

But the end result is that fixing the compat layer actually breaks the
case of a 32-bit automount on a x86-64 kernel.

There are various approaches to fix this (including just doing a
"strcmp()" on current->comm and comparing it to "automount"), but I
think that I will do the one that teaches pipes about a special "packet
mode", which will allow user space to not have to care too deeply about
the padding at the end of the autofs packet.

That change will make the compat workaround unnecessary, so let's revert
it first, and get automount working again in compat mode.  The
packetized pipes will then fix autofs for systemd.

Reported-and-requested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Ian Kent <raven@themaw.net>
Cc: stable@kernel.org # for 3.3
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

7 years agoUse correct conversion specifiers in cifs_show_options
Sachin Prabhu [Tue, 24 Apr 2012 14:28:30 +0000]
Use correct conversion specifiers in cifs_show_options

cifs_show_options uses the wrong conversion specifier for uid, gid,
rsize & wsize. Correct this to %u to match it to the variable type
'unsigned integer'.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>

7 years agoCIFS: Show backupuid/gid in /proc/mounts
Sachin Prabhu [Tue, 24 Apr 2012 14:28:14 +0000]
CIFS: Show backupuid/gid in /proc/mounts

Show  backupuid/backupgid in /proc/mounts for cifs shares mounted with
the backupuid/backupgid feature.

Also consolidate the two separate checks for
pvolume_info->backupuid_specified into a single if condition in

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>

7 years agocifs: fix offset handling in cifs_iovec_write
Jeff Layton [Fri, 13 Apr 2012 21:16:59 +0000]
cifs: fix offset handling in cifs_iovec_write

In the recent update of the cifs_iovec_write code to use async writes,
the handling of the file position was broken. That patch added a local
"offset" variable to handle the offset, and then only updated the
original "*poffset" before exiting.

Unfortunately, it copied off the original offset from the beginning,
instead of doing so after generic_write_checks had been called. Fix
this by moving the initialization of "offset" after that in the

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>

7 years agoxen: correctly check for pending events when restoring irq flags
David Vrabel [Thu, 26 Apr 2012 18:44:06 +0000]
xen: correctly check for pending events when restoring irq flags

In xen_restore_fl_direct(), xen_force_evtchn_callback() was being
called even if no events were pending.  This resulted in (depending on
workload) about a 100 times as many xen_version hypercalls as

Fix this by correcting the sense of the conditional jump.

This seems to give a significant performance benefit for some

There is some subtle tricksy "..since the check here is trying to
check both pending and masked in a single cmpw, but I think this is
correct. It will call check_events now only when the combined
mask+pending word is 0x0001 (aka unmasked, pending)." (Ian)

CC: stable@kernel.org
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

7 years agoxen/acpi: Workaround broken BIOSes exporting non-existing C-states.
Konrad Rzeszutek Wilk [Thu, 26 Apr 2012 18:22:33 +0000]
xen/acpi: Workaround broken BIOSes exporting non-existing C-states.

We did a similar check for the P-states but did not do it for
the C-states. What we want to do is ignore cases where the DSDT
has definition for sixteen CPUs, but the machine only has eight
CPUs and we get:
xen-acpi-processor: (CX): Hypervisor error (-22) for ACPI CPU14

Reported-by: Tobias Geiger <tobias.geiger@vido.info>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>