Many messsages are missing the new message type parameter, which
causes warning messages and a lack of the line number from the
offending line in the patch.
Change-Id: I69f2283c3dc27edd66fd2676c8be45664699dba6
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
Rather than delegating the task of printing the rates of handed-off
clocks to each of the handoff functions, print them in clock.c. To
cut down on log noise, downgrade them from pr_info to pr_debug.
Also, remove handoff prints for rateless clock in clock-local2.c,
since these are of limited value anyway.
Change-Id: Iaf4d6b0c738e2f84b01b8a37e6eb1e4c093e2687
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
It is necessary to ensure that a clock's parents are handed off
before the clock itself. Otherwise, the clk_prepare_enable()
call on the child may fail if the parent's rate has not yet
been set.
CRs-Fixed: 362534
Change-Id: I7687708f3c85aab64bfc6284d2cf1ca0ad5cc520
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
The gpio_vreg_request_gpio() function inside of the
msm-gpio-regulator driver can return successfully even if
gpio_request() has failed. This can lead to a kernel crash via
null pointer dereference when later gpio and regulator functions
are called. Modify gpio_vreg_request_gpio() so that it returns
an error immediately if gpio_request() fails.
Change-Id: I59364eb9efda6c2149b807db9a00e782d8ae6bb8
Signed-off-by: David Collins <collinsd@codeaurora.org>
In msm8930 V1.2, there are few HW fixes added for A305 GPU,
communicate new chipid to userspace driver to remove SW workarounds.
Change-Id: I51f272a39cb2cc60541607af9fa9be70cc838cb3
Signed-off-by: Sudhakara Rao Tentu <srtentu@codeaurora.org>
Get the current pagetable being used by the GPU by reading the
pagetable register during iommu pagefault and use that base
address to get the pid of the process corresponding to the
pagetable. Earlier we were using the pagetable address that the
IOMMU driver thinks is presently set for the GPU which may not
always be the case because we change the pagetable used by the
GPU without informing the IOMMU driver.
Change-Id: I7cf788f5d0f9454deb139ed3ad75bb4e750f4772
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
The previous handoff implementation had two limitations:
1) Handed-off clocks are left in the prepared state forever since
only the enable count is handed-off during clk_enable().
2) The clock will turn off when the first driver that uses it
calls clk_disable(). This is a problem if two drivers share
a clock and both depend on it being enabled they have
initialized and asserted their own votes for it.
Resolve both of these with a new handoff implementation that
leaves all clocks that were handed off (ex. handoff functions
returned HANDOFF_ENABLED_CLK) both prepared and enabled until
lateinit. As a consequence, handed-off clocks cannot be disabled
until then.
To avoid causing problems for the GFX2D cores, CLKFLAG_SKIP_HANDOFF
is introduced to prevent handoff of GFX2D clocks. This is required
because the footswitch-8x60 driver requires these clocks be off at
some points during boot while it asserts asynchronous resets to
the cores. If handoff was allowed to hold these clocks on, these
resets would fail.
Change-Id: I1ca7af6bed58e595cdad77923ea0614f456617ab
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
To enable the bus driver to scale buses via the RPM
and/or via the clock driver, do the following:
1. Add RPM clocks for the System NOC, Peripheral NOC,
Config NOC, BIMC, OCMEMGX.
2. Add a locally controlled clock to control the OCMEM
NOC, since the applications processor now controls it.
3. Remove the MMSSNOC AHB clock source, since the RPM
now controls it.
4. Finally, add voter clocks for the bus driver to allow
control of the above clocks.
Change-Id: Ie5bd2456f30bc9f01ebefa97a86c5195ec8e3039
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Starting with the MSM Copper, the RPM driver has a new
communication method with the RPM that uses SMD as its
transport layer. Add support for the new RPM APIs.
Change-Id: I63413984db8ecd262abcfa4065f9852dce646a7f
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
The RPM communication driver is changing its underlying
transport layer for upcoming chipsets. To support
the current transport layer and future ones, abstract
out the calls to the RPM APIs into helper functions.
Change-Id: I7bd2706dd7bb69812b3baac12eca7893aca749ab
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
To allow common code across targets that use
the legacy RPM APIs and the new RPM SMD APIs, stub
out RPM and RPM resources APIs when CONFIG_MSM_RPM
or CONFIG_MSM_RPM_SMD is undefined.
Change-Id: I6ce8b23b4535c5f2e65912bdb65483ed355f40ad
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
The clock driver depends on rpm, rpm-smd and regulators
and needs to initialize after those drivers. Place the
clock init call at the right position in msm_copper_add_drivers.
Change-Id: Idf8c810d787140c451d9704767b805328c89c94c
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Similar to what's done for other clock types, hand-off the rates of RPM
clocks at boot and ensure that they remain enabled until lateinit. This
prevents the clocks from turning off before drivers that depend on them
have had a chance to assert their own votes as they initialize.
Because querying an RPM clock's status will return 0 unless the clock's
rate has previously been set, when handing off, assume these clocks are
enabled (unless the RPM call fails) so that child clocks of these RPM
clocks can still be handed off.
Change-Id: Id15201706f7a474e73f266e56fb39c01974d4653
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Bringing the defconfigs up to date with the Kconfig files prevents
defunct options from appearing to be on or from unrelated changes
showing up in future defconfig patches.
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
Change-Id: Icd42aa5a6cb2754e9ddcf6114dfd626d4a8580c8
Drivers can now create alarms that will use an hrtimer while the
system is running and the rtc to wake up from suspend.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This patch ads core.c, the file which implements the ioctls and
registers the devices
Change-Id: I30a1d8b561ecd15b6a862d6948368394edd49665
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
ASoC core will scan for path, get the list of widgets
when playback and capture is started.When a mixer
command is issued it needs to scan only the path
to find if back end or front end dai needs to be shutdown.
Change ehances asoc core path finding functionality
to provide support for different usecases.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Change the wigdet power up and power down sequnce
in the ASOC as per msm platform requirements.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
When hardware params are set for the session alsa
core will query for the RX/TX channels for the
current back end dai.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Change adds debugfs support which gives information
on params, state of active pcm instances.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Hostless PCM nodes will not exchange data with
the userspace clients.Control paths will
be setup by userspace clients.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
The Dynamic PCM core allows digital audio data to be dynamically
routed between different ALSA PCMs and DAI links on SoC CPUs with
on chip DSP devices. e.g. audio data could be played on pcm:0,0 and
routed to any (or all) SoC DAI links.
Dynamic PCM introduces the concept of Front End (FE) PCMs and Back
End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that
they can dynamically route digital audio data to any supported BE
PCM. A BE PCM has no ALSA device, but represents a DAI link and it's
substream and audio HW parameters.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Change creates a PCM stream for ASOC backend which will only be used
internally by kernel drivers.It provides existing ASoC components
drivers with a substream and access to any private data.
- During bootup, create a file system storing the
information about usb device state and name, and
broadcast the message to userspace whenever the
device is plugged or unplugged.
- Register the device at USB sound card initialization
for creating file system and toggle the state in that
filesystem when USB is plugged/unplugged. This will
also send a message to user space informing it about
state change.
Change-Id: Icd78273bb765a26bbc70725afebe8955de8f7315
Signed-off-by: Harmandeep Singh <hsingh@codeaurora.org>
Use SPECIAL format for AMR. Add mixer control to
input mode and rate.
Change-Id: I8746d86ce323744995575a22b6128b39daaa3d13
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
[sboyd: Drop soc/msm parts]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This reverts the if/else part of
4466903481. We don't know why it
was done though and this should probably be dropped after testing.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Current implementation decides the card type exclusively. Even though
eMMC device can support both HS200 and DDR mode, card type will be
set only for HS200. If the host doesn't support HS200 but has DDR
capability, then DDR mode can't be selected.
Change-Id: Ifb5bb7fb0b7f4472734e10ec39d47e3f12e32cf8
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
For completing any block request, MMC block driver is calling:
spin_lock_irq(queue)
__blk_end_request()
spin_unlock_irq(queue)
But if we analyze the sources of latency in kernel using ftrace,
__blk_end_request() function at times may take up to 6.5ms with
spinlock held and irq disabled.
__blk_end_request() calls couple of functions and ftrace output shows
that blk_update_bidi_request() function is almost taking 6ms.
There are 2 function to end the current request: ___blk_end_request()
and blk_end_request(). Both these functions do same thing except that
blk_end_request() function doesn't take up the spinlock while calling
the blk_update_bidi_request().
This patch replaces all __blk_end_request() calls with
blk_end_request() and __blk_end_request_all() calls with
blk_end_request_all().
Testing done: 20 process concurrent read/write on sd card and eMMC.
Ran this test for almost a day on multicore system and no errors observed.
This change is not meant for improving MMC throughput; it's basically about
becoming fair to other threads/interrupts in the system. By holding
spin lock and interrupts disabled for longer duration, we won't allow
other threads/interrupts to run at all.
Actually slight performance degradation at file system level can be
expected as we are not holding the spin lock during
blk_update_bidi_request() which means our mmcqd thread may get preempted
for other high priority thread or any interrupt in the system.
These are performance numbers (100MB file write) with eMMC running in DDR
mode:
Without this patch:
Name of the Test Value Unit
LMDD Read Test 53.79 MBPS
LMDD Write Test 18.86 MBPS
IOZONE Read Test 51.65 MBPS
IOZONE Write Test 24.36 MBPS
With this patch:
Name of the Test Value Unit
LMDD Read Test 52.94 MBPS
LMDD Write Test 16.70 MBPS
IOZONE Read Test 52.08 MBPS
IOZONE Write Test 23.29 MBPS
Read numbers are fine. Write numbers are bit down (especially LMDD write),
may be because write requests normally have large transfer size and
which means there are chances that while mmcq is executing
blk_update_bidi_request(), it may get interrupted by interrupts or other
high priority thread.
CRs-Fixed: 343776
Change-Id: I37aab86a217177d328d6893983d5507a5149c253
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This bug was introduced in the 'MMC-4.5 Power OFF Notify Rework' fix.
Prior to the aforementioned patch, during resume mmc_init_card was being
invoked. The aforesaid patch invokes mmc_card_awake, prior to which
mmc_power_up has already set the clock frequency to 400Khz. Since the card
init is not done again, this frequency stays as is and results in data
time-out errors.
Two new functions
* mmc_save_ios
* mmc_restore_ios
were added.
The mmc_save_ios is invoked during mmc_suspend process and it saves the
current ios values, while mmc_restore_ios is invoked during mmc_resume process
and restores the previous ios values before sending the awake command. This
ensures that the clock, timing, bus-width etc are set properly before any
request is sent to the driver.
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
This is a rework of the existing POWER OFF NOTIFY patch. The current problem
with the patch comes from the ambiguity on the usage of POWER OFF NOTIFY
together with SLEEP and misunderstanding on the usage of MMC_POWER_OFF
power_mode from mmc_set_ios in different host controller drivers.
This new patch works around this problem by adding a new host CAP,
MMC_CAP2_POWER_OFF_VCCQ_DURING_SUSPEND, which when set sends a
POWER OFF NOTIFY from mmc_suspend instead of SLEEP. It is expected that host
controller drivers will set this CAP, if they switch off both Vcc and Vccq
from MMC_POWER_OFF condition within mmc_set_ios. However, note that there
is no harm in sending MMC_POWER_NOTIFY even if Vccq is not switched off.
This patch also sends POWER OFF NOTIFY from power management routines (e.g.
mmc_power_save_host, mmc_pm_notify/PM_SUSPEND_PREPARE, mmc_stop_host), which
does reinitialization of the eMMC on the return path of the power management
routines (e.g. mmc_power_restore_host, mmc_pm_notify/PM_POST_RESTORE,
mmc_start_host).
This patch sets POWER_OFF_NOTIFICATION to POWER_OFF_SHORT if it is sent from
the suspend sequence. If it is sent from shutdown sequence then it is set to
POWER_OFF_LONG.
Earlier implementation of PowerOff Notify as a core function is replaced as
a device's bus operation.
Signed-off-by: Saugata Das <saugata.das@linaro.org>
Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
changes in v5:
modified the the handling of return value in mmc_poweroff_notify.
changes in v4:
As suggested in review,
- Moved mmc_can_poweroff_notify to core.c
- Moved mmc_claim_host, mmc_release_host outside mmc_poweroff_notify
- Added check for wrong initialization for poweroff_notify_type
- mmc_poweroff_notify is modified to take as 2nd parameter
changes in v3:
This version addresses the review comments given by Subhash and Ulf
changes in v2:
This version addresses the changes suggested by Ulf
[smuckle@codeaurora.org: resolve minor merge conflicts]
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
If PM_SLEEP is not enabled, mmc.c will give warnning since mmc_bus_suspend/
mmc_bus_resume functions are defined but not used. This patch can fix this
warnning.
Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Ensure clocks are always enabled before any interaction with the
host controller driver. This makes sure that there is no race
between host execution and the core layer turning off clocks
in different context with clock gating framework.
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Per Forlin <per.forlin@stericsson.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
[sboyd: Keep non-upstreamed bits for sdio.c]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
The write packing statistics are used for the packed commands unit tests
in order to determine test success or failure
Change-Id: I1b330033e59a775c64fb915038d58615aff0dbdd
Signed-off-by: Maya Erez <merez@codeaurora.org>
The write packing control will ensure that read requests latency is
not increased due to long write packed commands.
The trigger for enabling the write packing is managing to pack several
write requests. The number of potential packed requests that will trigger
the packing can be configured via sysfs by writing the required value to:
/sys/block/<block_dev_name>/num_wr_reqs_to_start_packing.
The trigger for disabling the write packing is fetching a read request.
Change-Id: I982170fa6dca9150ea4310bb546b838b7fd30e9b
Signed-off-by: Maya Erez <merez@codeaurora.org>
Define max timeout, when BKOPS started for urgent BKOPS level (2,3).
Otherwise it will be default host controller timeout
Change-Id: I53c17ea3c575cbde0c2198e3071f21e98bcebe13
Signed-off-by: Maya Erez <merez@codeaurora.org>
This patch supports packed write command of eMMC4.5 device.
Several writes can be grouped in packed command and all data
of the individual commands can be sent in a single transfer
on the bus.
Change-Id: I391c3e5f73b785a8b7d25eb8256051020cfb0631
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Maya Erez <merez@codeaurora.org>