mali: Clean up arch

The arch directory is supposed to be a symlink to the proper
architecture directory.  Add orion-m400 and symlink to it.

(orion-m400 and pegasus-m400 seem to have the same config.h
but keep em' separate anyway.)

Change-Id: I70045baad8bb1538269ea2afc2e017b349598a34
mali: Update platform code. by CM! added only some parts.
stand-hotplug:  Add enhanced tunables

Now has separate hotplugging rates for screen off/on.

Defaults to disallowing any additional cores when screen is
off.

Also allows hotplugging to be disabled until CPU frequency goes
over a certain thresholed - default 800 MHz.

WARNING:  Do not apply this to any kernel that will build for
devices with more than 2 cores.  Since the smdk4210 tree
only builds for dual-core devices this is fine, but
don't apply it to smdk4412 unless you want pain.

Change-Id: I4fba84ab351476f1f97732bc5a4cf3f180263f57
Signed-off-by: Andrew Dodd <atd7@cornell.edu>
mali: Fix for getting the subversion revision

Prevents compiler errors due to unescaped strings, ie:

    arm-eabi-gcc: error: directory: No such file or directory
    arm-eabi-gcc: error: directory": No such file or directory

Forward port from 3d59d993.

Change-Id: Ib4cdd0ae6f7bcc2641d1264197b15a58d1240a52
upstream patch-3.0.44-45
upstream patch-3.0.45-46 manual full merge!
we have /kernel/sched/core.c
not kernel/sched.c
wakelock: use single threaded workqueueus

Avoid the concurrency management that could delay execution if there's
lots of workqueue traffic (and allow the runqueue to run on any CPU).

Lots of workqueue traffic can be generated by setting
ondemand/sampling_rate to 10000.

Change-Id: I55b8a223f4a389b93d49eef0d809eb1efe1790ba

Signed-off-by: Andrea Arcangeli <andrea@cpushare.com>
ump: Fix for getting the subversion revision

Prevents compiler errors due to unescaped strings, ie:

     arm-eabi-gcc: error: directory: No such file or directory
     arm-eabi-gcc: error: directory": No such file or directory

Forward port from fcaa34e2.

Change-Id: I06b03801801f43fbe87d544ea5e5720f660a56af
Revert "Activated Dyn Sync Control and addapted to 3.2.y code."

This reverts commit d7d5d2182eabc74a6a2ce8b8e40c49def5adbcd4.

Screen turning ON for one sec after screen off.
and to sync files only on screen off, is not what we want.
nice idea, but i skip.
Revert "fs/dyn_sync_cntrl: dynamic sync control"

This reverts commit c6b33a87b9757052b0c87de60c6f375642f0344c.
wireless driver to 1.28.11.9 from Korean S3 BIG TNX to GM!
So far for me working OK.
WPA/PSK connect.
channel range 1-12 tested and OK, 12-13 not tested.
wifi tether OK!
reconnection OK.

tested on rootbox 2.8 JB-MALI 4.1.1
Removed WIFI code that prevent deepsleep when WIFI is ON.
PM / Runtime: Return special error code if runtime PM is disabled

Some callers of pm_runtime_get_sync() and other runtime PM helper
functions, scsi_autopm_get_host() and scsi_autopm_get_device() in
particular, need to distinguish error codes returned when runtime PM
is disabled (i.e. power.disable_depth is nonzero for the given
device) from error codes returned in other situations.  For this
reason, make the runtime PM helper functions return -EACCES when
power.disable_depth is nonzero and ensure that this error code
won't be returned by them in any other circumstances.  Modify
scsi_autopm_get_host() and scsi_autopm_get_device() to check the
error code returned by pm_runtime_get_sync() and ignore -EACCES.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
PM / Runtime: Replace "run-time" with "runtime" in documentation

The runtime PM documentation and kerneldoc comments sometimes spell
"runtime" with a dash (i.e. "run-time").  Replace all of those
instances with "runtime" to make the naming consistent.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
PM / Runtime: Prevent runtime_resume from racing with probe

This patch (as1475) adds device_lock() and device_unlock() calls to
the store methods for the power/control and power/autosuspend_delay_ms
sysfs attribute files.  We don't want badly timed writes to these
files to cause runtime_resume callbacks to occur while a driver is
being probed for a device.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
 PM / Runtime: Consistent utilization of deferred_resume

dev->power.deferred_resume is used as a bool typically, so change
one assignment to false from 0, like other places.

Signed-off-by: ShuoX Liu <shuox.liu@intel.com>
PM / OPP: Introduce function to free cpufreq table

cpufreq table allocated by opp_init_cpufreq_table is better
freed by OPP layer itself. This allows future modifications to
the table handling to be transparent to the users.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
PM / Domains: Fix pm_genpd_poweron()

The local variable ret is defined twice in pm_genpd_poweron(), which
causes this function to always return 0, even if the PM domain's
.power_on() callback fails, in which case an error code should be
returned.

Remove the wrong second definition of ret and additionally remove an
unnecessary definition of wait from pm_genpd_poweron().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
PM / Runtime: Allow _put_sync() from interrupts-disabled context

Currently the use of pm_runtime_put_sync() is not safe from
interrupts-disabled context because rpm_idle() will release the
spinlock and enable interrupts for the idle callbacks.  This enables
interrupts during a time where interrupts were expected to be
disabled, and can have strange side effects on drivers that expected
interrupts to be disabled.

This is not a bug since the documentation clearly states that only
_put_sync_suspend() is safe in IRQ-safe mode.

However, pm_runtime_put_sync() could be made safe when in IRQ-safe
mode by releasing the spinlock but not re-enabling interrupts, which
is what this patch aims to do.

Problem was found when using some buggy drivers that set
pm_runtime_irq_safe() and used _put_sync() in interrupts-disabled
context.

Reported-by: Colin Cross <ccross@google.com>
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
PM / Domains: Implement subdomain counters as atomic fields

Currently, pm_genpd_poweron() and pm_genpd_poweroff() need to take
the parent PM domain's lock in order to modify the parent's counter
of active subdomains in a nonracy way.  This causes the locking to be
considerably complex and in fact is not necessary, because the
subdomain counters may be implemented as atomic fields and they
won't have to be modified under a lock.

Replace the unsigned in sd_count field in struct generic_pm_domain
by an atomic_t one and modify the code in drivers/base/power/domain.c
to take this change into account.

This patch doesn't change the locking yet, that is going to be done
in a separate subsequent patch.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>