Commit graph

573192 commits

Author SHA1 Message Date
Stephen Boyd
ef3db659f4 tty: serial: msm: Support more bauds
The msm_find_best_baud() function is written with the assumption
that the port->uartclk rate is fixed to a particular rate at boot
time, but now this driver changes that clk rate at runtime when
the baud is changed.

The way the hardware works is that an input clk rate comes from
the clk controller into the uart hw block. That rate is typically
1843200 or 3686400 Hz. That rate can then be divided by an
internal divider in the hw block to achieve a particular baud on
the serial wire. msm_find_best_baud() is looking for that divider
value.

A few things are wrong with the way the code is written. First,
it assumes that the maximum baud that the uart can support if the
clk rate is fixed at boot is 460800, which would correspond to an
input clk rate of 230400 * 16 == 3686400 Hz.  Except some devices
have a boot rate of 1843200 Hz or max baud of 115200, so
achieving 230400 on those devices doesn't work at all because we
don't increase the clk rate unless max baud is 460800.

Second, we can't achieve bauds higher than 460800 that require
anything besides a divisor of 1, because we always call
msm_find_best_baud() with a fixed port->uartclk rate that will
eventually be changed after we calculate the divisor. So if we
need to get a baud of 500000, we'll just multiply that by 16 and
hope that the clk can give us 500000 * 16 == 8000000 Hz, which it
typically can't do. To really achieve 500000 baud, we need to get
an input clk rate of 24000000 Hz and then divide that by 3 inside
the uart hardware.

Finally, we return success for bauds even when we can't actually
achieve them. This means that when the user asks for 500000 baud,
we actually get 921600 right now, but the user doesn't know that.

Fix all of this by searching through the divisor and clk rate
space with a combination of clk_round_rate() and baud
calculations, keeping track of the best clk rate and divisor we
find if we can't get an exact match. Typically we can get an
exact match with a divisor of 1, but sometimes we need to keep
track and try more frequencies. On my msm8916 device, this
results in all standard bauds in baud_table being supported
except for 1800, 576000, 1152000, and 4000000.

CRs-Fixed: 1053499
Change-Id: Ic480a989bb65b1924f3bd6d38927d1fe54eaaeee
Fixes: 850b37a71b ("tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation")
Cc: "Ivan T. Ivanov" <iivanov.xz@gmail.com>
Cc: Matthew McClintock <mmcclint@codeaurora.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Cristian Prundeanu <cprundea@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 98952bf510d0c7cdfc284f098bbf4682dc47bc61
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-08-11 18:17:59 -07:00
Srinivas Kandagatla
5c7a838b43 tty: msm_serial: remove static clk rate setting in probe
The issue with setting up a fixed clock rate at probe is that it would
overwrite the console rate set by the bootloader for its console device.
This would result in serial out corruption or missing log when we system
is booted with earlycon. This is not a issue if we boot system without
earlycon.

This setup is at least not required with the mainline driver, this code
used to be required because the clk_enable() call would fail if
clk_set_rate() wasn't called first.

Originally the issue was noticed on DB410c which is based on APQ8016
chipset.

Without this patch the console log with earlycon would look like:
...
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=1
[    0.000000] NR_IRQS:64 nr_irqs:64 0
����+HH��0.699378] console [ttyMSM0] enabled
[    0.699378] console [ttyMSM0] enabled
[    0.702003] bootconsole [uart0] disabled
[    0.702003] bootconsole [uart0] disabled
...

with this patch I can see all the skipped lines on the console

CRs-Fixed: 1053499
Change-Id: I029ac3c7a20fdce9b5dfd0bbde8a049ff47dc4bd
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Tested-by: Pramod Gurav <gpramod@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 79c9473f115f99906b6ae443708b8ece480e2e88
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-08-11 18:16:59 -07:00
Peter Hurley
848487ca07 earlycon: Use common framework for earlycon declarations
Use a single common table of struct earlycon_id for both command line
and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a
unique earlycon declaration (the declaration is only guaranteed to be
unique within a compilation unit; separate compilation units must still
use unique earlycon names).

The semantics of OF_EARLYCON_DECLARE() is different; it declares an
earlycon which can matched either on the command line or by devicetree.
EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon
which is matched by command line only. Remove redundant instances of
EARLYCON_DECLARE().

This enables all earlycons to properly initialize struct console
with the appropriate name and index, which improves diagnostics and
enables direct earlycon-to-console handoff.

CRs-Fixed: 1053499
Change-Id: I893ebd28a3e4e7afe8080bcc3e000970fe1fa36b
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 2eaa790989e03900298ad24f77f1086dbbc1aebd
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2016-08-11 18:12:37 -07:00
Linux Build Service Account
9d822a9489 Merge "ASoC: msm: set pointers to NULL after kfree" 2016-08-10 18:29:19 -07:00
Linux Build Service Account
9aa7f8acc0 Merge "soc: qcom: pil: Add flag to know if modem SSR happened." 2016-08-10 18:29:18 -07:00
Linux Build Service Account
ca29376ef1 Merge "mdss: display-port: add support to send HPD event to framework" 2016-08-10 18:29:17 -07:00
Linux Build Service Account
e2dc38ec3f Merge "msm: mdss: dsi: fix lcd mode selection gpio config when display is off" 2016-08-10 18:29:17 -07:00
Linux Build Service Account
c1a093b252 Merge "ASoC: msm: qdsp6v2: check param length for EAC3 format" 2016-08-10 18:29:16 -07:00
Linux Build Service Account
767b87a216 Merge "usb: gadget: gsi: Optimize TRB's buffer allocation functionality" 2016-08-10 18:29:15 -07:00
Linux Build Service Account
1f55fb65fe Merge "msm: vidc: Allow venus to power collapse in batch mode" 2016-08-10 18:29:14 -07:00
Linux Build Service Account
ab08f3f974 Merge "msm: vidc: Add support for color space information" 2016-08-10 12:42:12 -07:00
Linux Build Service Account
8908ad6fcf Merge "defconfig: Enable memory latency monitors and governor" 2016-08-10 12:42:11 -07:00
Linux Build Service Account
c5ce2f64ad Merge "usb: f_fs: Prevent gadget unbind if it is already unbound" 2016-08-10 12:42:08 -07:00
Linux Build Service Account
3f9d57223f Merge "msm: ipa: do not use skb clones for lan clients" 2016-08-10 12:42:08 -07:00
Linux Build Service Account
1bbfac0a1e Merge "msm: ipa3: update BCR Regsiter values for IPA v3.1 and v3.5" 2016-08-10 12:42:07 -07:00
Linux Build Service Account
97e5d2f34e Merge "msm: gsi: fix memory corruption from debugfs" 2016-08-10 12:42:04 -07:00
Linux Build Service Account
c487afd8b1 Merge "ARM: dts: msm: Enable the GPU QDSS STM for msmcobalt" 2016-08-10 12:42:03 -07:00
Linux Build Service Account
21c2cba833 Merge "soc: qcom: irq-helper: Add header file of irq-helper" 2016-08-10 12:42:02 -07:00
Linux Build Service Account
ccff42ba09 Merge "ARM: dts: msm: Update TLMM base address for msmfalcon" 2016-08-10 12:42:01 -07:00
Linux Build Service Account
6e251b6aad Merge "pinctrl: qcom: Update TLMM configuration for msmfalcon" 2016-08-10 12:42:00 -07:00
Linux Build Service Account
b73b15d097 Merge "pinctrl: qcom: Update SDC pins for msmfalcon" 2016-08-10 12:41:59 -07:00
Linux Build Service Account
002a1d1bdd Merge "ARM: dts: msm: increase VDD_GFX CPR ceiling voltages for msmcobalt" 2016-08-10 12:41:58 -07:00
Linux Build Service Account
7748d42b05 Merge "usb: phy: qusb: Fix typo with emulation related property name" 2016-08-10 12:41:57 -07:00
Linux Build Service Account
7d5deaefcd Merge "ASoC: msm: qdsp6v2: set correct loopback mode" 2016-08-10 12:41:56 -07:00
Linux Build Service Account
56a8de410b Merge "ARM: msmcortex_defconfig: Enable NCM function driver" 2016-08-10 12:41:56 -07:00
Linux Build Service Account
4be1196293 Merge "ASoC: wcd9335: Configure DMIC clock rate for ECPP path" 2016-08-10 12:41:55 -07:00
Linux Build Service Account
8947d1d8b4 Merge "drivers: mfd: wcd9xxx: Add support to configure dmic clock" 2016-08-10 12:41:54 -07:00
Linux Build Service Account
5d27e92127 Merge "defconfig: msmcortex: Enable G-Link SPI Transport driver" 2016-08-10 12:41:53 -07:00
Linux Build Service Account
b3fafcfbf3 Merge "ARM: dts: msm: Add G-Link SPI Transport device for msmcobalt" 2016-08-10 12:41:52 -07:00
Linux Build Service Account
21583fd29e Merge "soc: qcom: glink_spi_xprt: Add support for GLink SPI Transport" 2016-08-10 12:41:52 -07:00
Manikanta Sivapala
dcbbba5cb8 msm: vidc: Add support for color space information
When clients specify color space information, venus HW
should embed it in the bit stream. This helps to
regenerate original colors when decoded by decoder.
When decoder detects the color space VUI, Venus fills
the corresponding extradata

CRs-Fixed: 1026204
Change-Id: Ie9523558c23a8edc7a7ee058937658dd87ef5b16
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
Signed-off-by: Manikanta Sivapala <msivap@codeaurora.org>
2016-08-09 11:37:54 +05:30
Hemant Kumar
35fdb9cd7e usb: f_fs: Prevent gadget unbind if it is already unbound
Upon usb composition switch there is possibility of ep0 file
release happening after gadget driver bind. In case of composition
switch from adb to a non-adb composition gadget will never gets
bound again resulting into failure of usb device enumeration. Fix
this issue by checking FFS_FL_BOUND flag and avoid extra
gadget driver unbind if it is already done as part of composition
switch.

Change-Id: I1638001ff4a94f08224b188aa42425f3d732fa2b
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-08-08 17:20:43 -07:00
Surendar karka
66d2eacee9 ASoC: msm: qdsp6v2: check param length for EAC3 format
Initialize param length with user space argument and
check the condition for maximum length in
SND_AUDIOCODEC_EAC3 format.

CRs-Fixed: 1032820
Change-Id: I710c1f743d7502e93989e8cc487078366570e723
Signed-off-by: Surendar karka <sukark@codeaurora.org>
2016-08-08 13:24:11 -07:00
Rohit Gupta
a635954e8c defconfig: Enable memory latency monitors and governor
Enable memory latency monitor and governors to vote for higher DDR
frequency on detecting latency bound workloads.

Change-Id: I4a3f415263b94d4eab16de05bbb9843b7bb04113
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-08-08 12:01:02 -07:00
Rohit Gupta
10824a8806 PM / devfreq: memlat: Remove kfree() on probe fails
Memory allocated with devm_kzalloc() is automatically freed if
the probe function fails and returns an error code. So there
is no need to free cpu_grp explicitly for the failure cases
that might come up after it is allocated. Additionally calls to
devm_kzalloc() must be accompanied by devm_kfree() if memory
deallocation is necessary.
For these reasons remove the kfree(cpu_grp) from the probe
function.

Change-Id: Ic4838fd58d40d283ac301facc64b06813eb3bd7d
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2016-08-08 12:00:33 -07:00
Skylar Chang
840f4d7c3c msm: gsi: fix memory corruption from debugfs
Fix to GSI reset stats logic to clear the correct stats per channel

Change-Id: I94ae8c769ec2868a291e75a2f47c85bd8a449937
CRs-Fixed: 1046484
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-08-08 10:37:54 -07:00
Skylar Chang
e91a2cce99 msm: ipa: do not use skb clones for lan clients
IPA driver uses 8k buffers for RX packets as those are aggregated.
If these packets deaggregated in IPA driver, cloned and provided
to clients, later calls to skb_copy() results in creating an 8k skb
which may lead to high memory utilization.
This change avoid the use of skb clones and allocates new skbs
for LAN clients and copy the packet content to it.

CRs-Fixed: 1050670
Change-Id: Iba47db8936b49309360791c1c6b482dcfcffd4d7
Acked by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-08-08 10:36:41 -07:00
Hemant Kumar
9b68fb8b48 usb: gadget: configfs: Synchronizing bind/unbind using mutex lock
Synchronization is required because bind/unbind can happen in two
different contexts. For example, function unbind due to
unregister_gadget_item can race with bind which is initiated from
sysfs.

Change-Id: Iec93a9d4cb2a10b833cbba0d5256b64161147de2
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-08-08 09:35:15 -07:00
Hemant Kumar
dfe8b29ad1 usb: gadget: f_fs: Unlock mutex before unregistering gadget
Release the lock before unregistering gadget item.
Unregistered gadget item will result in unbind call back
to the driver which may use the same lock and resulting
in deadlock condition.

Change-Id: I2f8fba73a831d3bb711fe9310c5758221359819e
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-08-08 09:33:47 -07:00
Linux Build Service Account
e94b446eac Merge "arm64: Select reset controller framework for MSM" 2016-08-07 23:22:55 -07:00
Linux Build Service Account
addf120260 Merge "NFC: IRQ gpio usage modification in nfc_read" 2016-08-07 23:22:54 -07:00
Linux Build Service Account
5e5b6faf80 Merge "ARM: dts: msm: Fix QOS settings for Venus on msmcobalt" 2016-08-07 23:22:53 -07:00
Linux Build Service Account
98ea28a192 Merge "msm: vidc: Fix decoder output buffer size issue" 2016-08-07 23:22:53 -07:00
Linux Build Service Account
3c5fb09425 Merge "msm: ipa: Neutrino IPA offload support" 2016-08-07 23:22:52 -07:00
Linux Build Service Account
fc7ae091a6 Merge "ARM: dts: msm: enabling dynamic FPS for nt35597 video panel" 2016-08-07 23:22:51 -07:00
Linux Build Service Account
7190232636 Merge "msm: kgsl: Allow 0 as a valid ion file descriptor" 2016-08-07 23:22:47 -07:00
Linux Build Service Account
0131aa1988 Merge "msm: kgsl: Make VBIF register dump more generic" 2016-08-07 23:22:44 -07:00
Linux Build Service Account
a181961095 Merge "msm: crypto: Fix integer over flow check in qcedev driver" 2016-08-07 23:22:44 -07:00
Linux Build Service Account
2ef02c02c4 Merge "qcom: ssr: Fix possible overflow when copying firmware name" 2016-08-07 23:22:43 -07:00
Linux Build Service Account
a010a65c23 Merge "msm: vidc: Add Override QP extradata support" 2016-08-07 23:22:42 -07:00