Vijayakumar [Fri, 27 Jun 2014 09:20:31 +0000 (14:50 +0530)]
gpu:nvgpu:fix powergate disabling order
ELPG has to disabled before we write to clock gating registers
If ELPG is engaged during clock gating register write it will
cause error in ELPG engine
Allen Yu [Fri, 27 Jun 2014 15:44:30 +0000 (23:44 +0800)]
staging: ozwpan: fix potential race in oz_pd_destroy
If two routines A and B call oz_pd_destroy() in parallel, there could be
a race condition they are both able to get through to the point of increasing
pd_destroy_scheduled. For example, routine A reads pd_destroy_scheduled
and its value is zero, right after that routine B reads pd_destroy_scheduled
as well and its value is still zero. Then routine A and B will both be able
to go ahead to increase pd_destroy_scheduled and then schedule the oz_pd_free
workitem, causing the reduplicate oz_pd_free.
To fix that, using spinlock instead of atomic operation. Also do some cleanup
of the redundant code and fix a potential NULL pointer error in oz_pd_alloc().
Allen Yu [Sat, 28 Jun 2014 17:43:42 +0000 (01:43 +0800)]
staging: ozwpan: fix NULL pointer in stop_store
oz_pd_find() can return 0 if it fails to find any pd in g_pd_list
that matches the mac_addr. This could happen if oz_pd_stop() has been
called on the pd so that it's deleted from g_pd_list.
Change-Id: I6bedf242676d6cd316eae41dacd8a515dac296b8 Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/432534
GVS: Gerrit_Virtual_Submit Tested-by: Kevin Bruckert <kbruckert@nvidia.com> Reviewed-by: Mitch Luban <mluban@nvidia.com> Reviewed-by: Kevin Bruckert <kbruckert@nvidia.com>
bibhayr [Sat, 28 Jun 2014 02:25:11 +0000 (19:25 -0700)]
bcmdhd: check NULL pointer in cfg80211 callbacks
some of the callbacks does not have the NULL
pointer check for wl. So, add wl NULL check for
every function. If net device gets unregistered
and there is another call on wl, kernel crash
happens. This will avoid all the crashes.
Neil Gabriel [Thu, 26 Jun 2014 23:02:32 +0000 (18:02 -0500)]
gpu: nvgpu: Initialize ELPG ref-count early.
gk20a_pmu_disable_elpg can be called before the PMU driver has
received and processed the INIT message from the PMU. If change
ensures that the ELPG ref-count has been initialized to zero
before that can happen.
Deepak Nibade [Wed, 25 Jun 2014 13:27:23 +0000 (18:57 +0530)]
gpu: nvgpu: fix possible PMU isr race
Possible race description :
- while PMU is booting, it sends messages to kernel which we process
in gk20a_pmu_isr()
- but when messages are processed it is possible that we are on the way
to rail gate the GPU and we have already called pmu_destroy()
- this could lead to hangs if while processing messages, GR is
already off
To fix this, introduce another mutex isr_enable_lock and a flag to
turn on/off ISRs
- when we enable PMU, get the lock and set the flag
- in pmu_destroy(), get the lock and remove the flag
- in pmu_isr(), take the lock, check if flag is set or not. If flag
is not set return, otherwise proceed with the messages
Add Miracast modes 5 and 6 to handle interference mitigation on blake
To prevent blake disconnection on 2.4Ghz channels, set miracast mode 5
to disable interference mitigation and set miracast mode 6 to enable
auto interference mitigation.
tegra: hdmi: audio: sysfs node for max audio channel info
Provide max_pcm_channels from the EDID audio info
to HAL before the EDID audio info gets copied to
the HDA codec driver. This is done since HAL requires
prior channel information in order to open the pcm
device
Om Prakash Singh [Thu, 19 Jun 2014 15:25:41 +0000 (20:55 +0530)]
net: wireless: bcmdhd: fix rtnl_lock deadlock while AGO creation
problem:
during p2p interface add/remove stress, race condition is happening
for rtnl_lock between cfg80211_event_work and dhd driver. due to
which system's net stack is going in to deadlock state.
solution:
to register p2p interface make use of register_netdevice instead
of register_netdev which doesn't require rtnl_lock and remove
rtnl_unlock/lock that was added to make sure register_netdev doesn't
block on rtnl_lock.
Vinayak Pane [Wed, 18 Jun 2014 01:45:14 +0000 (18:45 -0700)]
staging: ozwpan: protect oz_pd_destroy
oz_pd_destroy() is called mulitple times when network
down notifier gets triggered. Destroy workqueue is scheduled
from tasklet and also from oz_binding_remov function.
Protecting it by strictly scheduling workqueue only once.
Vinayak Pane [Wed, 18 Jun 2014 20:10:50 +0000 (13:10 -0700)]
Revert "staging: ozwpan: remove scheduling while atomic"
This reverts commit 3e6733bb4f62148b38af8ccbe56dc0e62a052138.
An improvised fix for this is provided by Atmel with patch
"staging: ozwpan: kobject_uevent_env() from process context"
which is submitted separately.
Seema Khowala [Fri, 20 Jun 2014 18:36:30 +0000 (11:36 -0700)]
arm: tegra: pinmux : enable e_input of sdmmc clk
For all SDMMC controllers, E_INPUT of CLK pad should be
enabled since loopback CLK (Zi of CLK pad) is used to
latch RESP/DATA coming from external device.
If not enabled, you will see RESP/DATA time outs.
In case integration time for the sensor is not properly set,
User space may query the updated value of a sensor before an event
is generated from the sensor. Kernel driver should not send a stale or
invalid event in such cases, else it may impact performance and in some
cases, the user space application may behave in some undesirable way.
This change checks for such invalid events and makes sure such values
are not sent to user space.
Diwakar Tundlam [Thu, 29 May 2014 22:54:12 +0000 (15:54 -0700)]
arm: tegra: soctherm: split suspend and resume nb
Split soctherm suspend and resume notifier callbacks to allow
different priority settings so that soctherm-suspend is called after
dvfs-resume and soctherm-resume is called before dvfs-resume.
Rakesh Bodla [Thu, 19 Jun 2014 11:27:44 +0000 (16:57 +0530)]
power: extcon: fix charging icon during bootup
If device is booted with charger cable, in probe
y-cable extcon dev reports no cable is connected
and cable connection status is getting corrupted.
Fixing this by adding suitable condition.
bibhayr [Thu, 19 Jun 2014 02:35:54 +0000 (19:35 -0700)]
bcmdhd: update CONNECTED on WLC_E_SET_SSID event
update the status of the firmware to connected after
AP association when the WLC_E_SET_SSID event happens.
Currently it updates the status before WLC_E_SET_SSID.
Rakesh Bodla [Thu, 5 Jun 2014 06:31:12 +0000 (12:01 +0530)]
usb: free up composite gadget string ids on unbind
There are only 254 USB composite gadget string_ids available.
When switching gadget mode such as mtp and acm repeatedly,
they will be exhausted.
This bug has been brought up since android composite driver
introduced a way to switch gadget modes while the composite
driver is still holding its bind.
Fix this by reset next_string_id and clean up gstrings when
android gadgets are disabled. Also by removing the condition
comparing gadgets' string id to 0 because gadget string id
has to be re-assigned whenever the string count is reset.
The codes removed the condition check will work as the same
as before they have changed if the gadgets are used by other
composite drivers other than android since all of them call
bind only once and never unbind it hence no side effects considered.
Ported from https://android-review.googlesource.com/#/c/95366/
Deepak Nibade [Wed, 11 Jun 2014 13:52:51 +0000 (19:22 +0530)]
gpu: nvgpu: bail out from poweroff if channel suspend fails
During gk20a_pm_prepare_poweroff(), if call to gk20a_channel_suspend()
fails, we proceed to disable other components and then return error.
But when genpd sees the error, it will abort the suspend sequence and
keep the device state as active.
But since we have already disabled all the components, GPU lands in
invalid state.
Hence, if channel_suspend() fails then do not proceed but return
the error immediately
Deepak Nibade [Mon, 16 Jun 2014 10:25:43 +0000 (15:55 +0530)]
video: tegra: host: fix setclass order in gather submit
We submit gathers in submit_gathers() as below :
1) set class to class id sent from user space
2) call add_sync_waits() which sets class to HOST1X
and adds host waits
3) and then we proceed to insert gathers sent from user space
(which now see wrong class id set i.e. HOST1X)
This results in setting wrong class ids and causes
abnormal behaviour
To fix this, rewrite this sequnce as below :
1) call add_sync_waits() which sets class to HOST1X
and adds host waits
2) set class to class id sent from user space
3) and then we proceed to insert gathers sent from user space
(and now we have correct class id set for this gather)
Martin Chi [Fri, 28 Mar 2014 15:38:42 +0000 (23:38 +0800)]
usb: ehci: Tegra: change to noirq suspend/resume
Chnage ehci suspend/resume to noirq suspend/resume
to enable it get more chances to handle the remote
wake-up which may come after normal suspend/resume
Sang-Hun Lee [Tue, 17 Jun 2014 23:35:49 +0000 (16:35 -0700)]
tegra: ictlr: correct the base address of init
- The initilization of the mselect register was being done
against the hier_ictlr register base address, instead of
the mselect register base address. Correct the address
to the mselect register base
Laxman Dewangan [Thu, 19 Jun 2014 07:16:47 +0000 (12:46 +0530)]
ARM: tegra: convert non-battery DTS to battery dts for P1761-A04-E
Convert the non-battery DTS to battery DTS for the P1761-A04-E to fix the
proper OTA from mp1 to OTA1 release.
The battery dts have the dtsfilename as the non-battery dts which causes the
BC/FG broken after OTA1. The steps are:
- Create nonbattery dtss file and keep same as original non-battery dts.
- Change original non-battery dts to battry supported DTS.
ARM: tegra:provide battery soc range and input voltage limit
adding input voltage limit and soc range to configure
input voltage limit(VINDMP) based on battery SOC value.
add entry for monitor battery current through IIO for
p1761-A04,This enables current_now sysfs which helps
to find out how much current flowing from/to battery.
Laxman Dewangan [Wed, 18 Jun 2014 14:36:31 +0000 (20:06 +0530)]
Revert "extcon: palmas: make aca detection platform dependent"
This reverts commit aa55d35202b5895068bdf8eace842102bf134dab.
Revert the change becasue it breaks the VUS and ID detection. With this change
on some platforms, the VBUS and ID both are detected even only connnect the
VBUS cable. This causes misbehaving of the drivers.
Sang-Hun Lee [Thu, 12 Jun 2014 17:52:59 +0000 (13:52 -0400)]
gpu: nvgpu: gk20a: do not access invalid TLB
Problem description:
- gk20a_mm_tlb_invalidate guarantees callers that
TLB would be in a clean state
- gk20a_mm_tlb_invalidate checks whether the dirty
flag is set, then mark clean, then performs
reset operation
- If there are two parallel callers, one thread would be
performing the clean up operation, while the other thread
is returned to the caller
Fix description:
- Extends the duration of the TLB dirty flag mutex lock
Update fb_monspecs and ext_process_hotplug on every hdmi_disable
This is required since hdmi_disable can also be called when
transitioning from hdmi disconnected to disable, for
example, when hdmi gets disconnected during LP0
Terje Bergstrom [Mon, 12 May 2014 12:14:05 +0000 (15:14 +0300)]
gpu: nvgpu: Remove extraneous FB flush calls
gk20a_mm_fb_flush() invoked G_ELPG_FLUSH and FB_FLUSH. Remove the
invokation of G_ELPG_FLUSH. Replace calls to gk20a_mm_fb_flush() with
gk20a_mm_l2_flush() when appropriate.
"disabled" parameter is currently used by generic PM domains to control
attached cpuidle state. This patch moves disable parameter from idle state
back to state_usage which to avoid the race between sysfs control and
generic PM domains.
Ankita Garg [Tue, 10 Jun 2014 22:48:58 +0000 (15:48 -0700)]
drivers: hid: Support vendor specific usage for blake trackpad
Generic HID drivers do not work well Blake trackpad. So, fw
uses vendor specific usage for the trackpad. Change the usage
internally to register trackpad as a relative mouse.
Change-Id: If8fc6a5d634e4b300ef0de6a5913188fe1f1efb0 Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/422885 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Michael Frydrych <mfrydrych@nvidia.com> Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
power: extcon:convert extcon lock to spinlock from mutex
use spinlock instread of mutex to avoid kernel warning "sleeping
function called from invalid context" if CONFIG_DEBUG_ATOMIC_SLEEP
(sleep inside atomic section checking config) enabled and usb cable
plugged/unplugged.
Xin Xie [Wed, 4 Dec 2013 00:21:22 +0000 (16:21 -0800)]
arm: tegra: fix PTM dead locking on tight loop
If one core is executing a tight loop and generating huge number of PTM
packets on funnel, it will cause other core dead locking on the PTM
flushing during the WFI entrance.
This patch will replace the "cpu_relax()" with "smp_mb()", and it can
relax the CPU tight loop and allow other CPU's PTM packet being flushed
properly.
usb: gadget: keep udc alive on non-std charger det
The non-std charger could also be a self-powered
hub(which is not yet connected to any host).
If we stop controller here, tegra can't detect
the host through this self-powered hub.
power: bq2419x:adjust input voltage limit based on battery SOC
configure input voltage limit based on battery SOC,
get the battery soc from fuel gauge and adjust input voltage
as the battery soc rises when usb/NV charger cable connected.
Aly Hirani [Tue, 3 Jun 2014 21:33:21 +0000 (14:33 -0700)]
tn8: Make backlight nonlinear
As per the request, we would want to make the backlight nonlinear in
progression. Do this as a step in the kernel before applying SD.
The curve implemented is a simple piecewise linear function with
a slow rise from 0 to 166 and a linear function with a faster rise
from 166 to 255.
It fully brings back EMC clock client that allows for coupling CPU and
EMC frequencies. This is being done in order to always enforce the
static emc_to_cpu ratio as it can potentially improve UX by setting
higher EMC frequencies thereby reducing memory latency seen by code
on the CPU.
Sang-Hun Lee [Mon, 9 Jun 2014 22:45:38 +0000 (18:45 -0400)]
staging: iio: light: iqs253: cancel workqueue
- Any lingering workqueue must be cancelled
during the shutdown, to prevent them from running
during a shutdown
- In most cases, they are harmless, but they will
trigger a warning if the i2c bus is shutdown during the
shutdown as done on some platforms
Sang-Hun Lee [Mon, 9 Jun 2014 21:48:18 +0000 (17:48 -0400)]
staging: iio: light: add shutdown
- Depending on the platform, i2c bus may be shutdown
as we shutdown the systme
- In such a case, any lingering workqueue would slowdown
the system, as the access will be made to the i2c bus
which has been shutdown
- To mitigate the above, cancel all workqueue jobs as we shutdown
Robert Shih [Thu, 5 Jun 2014 05:25:09 +0000 (13:25 +0800)]
tn8: modem: reduce timeout wakelock to 1s
1. The kernel resume (from LP0 to the time when app tasks start unfreezing) is shorter than 200ms.
When app tasks start running, the RIL/framework/app will hold their wake lock to block suspending.
Furthermore, tegra_usb_modem_post_remote_wakeup() in tegra_usb_modem_power.c will hold
another timeout (1 second) wake lock, which should start later than the wake lock "tegra-ehci.1".
So, 1s timeout for wake lock "tegra-ehci.1" in kernel should be enough.
2. Per our experience, many system resume/suspend (with screen off) caused by remote wake-up is
able to finish in 1.5 seconds, or even shorter. So, 3 seconds timeout could cause more unnecessary power consumption.
Sang-Hun Lee [Tue, 3 Jun 2014 20:28:45 +0000 (13:28 -0700)]
gpu: nvgpu: flush write before unlocking
- gk20a_enable is reading the clock after unlocking the spinlock
to flush any previous write
- This could lead to a race if any write afterwards assume
the write has been completed already
- Read the clock before unlocking to ensure all previous writes
have been completed before letting any other thread use gk20a
Since we are using global country code Q2 and reg revision 87
in firmware. Which will support for ALL countries remove the
CMD_COUNTRY private command.