28 Jun, 2016
19 commits
-
pm_runtime_irq_safe increases the parents runtime usage
counter effectively keeping the OMAP SoC from idling.Signed-off-by: Sebastian Reichel
Acked-by: Tony Lindgren
Tested-by: Pavel Machek -
Instead of immediately sending the SSI module to
sleep, wait some time in case of new incoming or
outgoing traffic.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
msg->complete() should always be called from process context once
irq_safe runtime pm flag is no longer set for omap-ssi.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
ensure, that clocks remain enabled, when a transfer is started.
Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
There is no need to wait for hardware to really reach idle states,
so just release runtime PM asynchronously.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
runtime_pm_*_sync can block when irq_safe flag is removed
from omap-ssi driver, so it may not be called while a
spinlock is held.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
These functions may be called from atomic context,
so avoid synchronous runtime pm calls.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
Move pio interrupt handler from tasklet into thread to
allow runtime_pm_get_sync calls without irq_safe being
set.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
We may not call pm_runtime_get_sync() from tasklet, since
it can block once pm_runtime_irq_safe is removed for omap-ssi.Since irq can should only be created for a running device,
we assume, that the device is already running and use non-
synchronous API instead.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
There is no need to disable the device synchronously, so
don't do it.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
ssi_start_tx and ssi_stop_tx may be called from atomic context. Once
pm_runtime_irq_safe() is removed for omap-ssi, this will fail, due
to blocking pm_runtime_*_sync() calls.This fixes ssi_stop_tx by using non-sync API and ssi_start_tx by
using a worker thread.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
port events should be sent from process context after
irq_safe runtime pm flag is removed in omap-ssi.Signed-off-By: Sebastian Reichel
Tested-by: Pavel Machek -
This simplifies the code and avoids holding a spin_lock when
runtime pm calls are made. Once the irq_safe flag is removed
for omap_ssi's runtime pm, pm_runtime_get/put_sync can sleep,
which is a no-go while holding a spin_lock.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
Convert cawake interrupt handler from tasklet to
threaded interrupt handler in preparation of
blocking runtime_pm calls.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
ssip_xmit should be called from process context,
since it calls hsi_async_write.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
To avoid setting irq_safe runtime pm flag in omap-ssi, multiple calls
will be moved to process context. This also affects ssi-protocol, so
use the safer spin_lock_bh instead of a simple spin_lock.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
This avoids calling ssi_waketest(), while a spinlock is
being hold, since ssi_waketest may sleep once irq_safe
runtime pm is disabled.Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek -
module reset and power management rule setup
is already done by hwmod. Remove this cruft,
which predates hwmod.Signed-off-by: Sebastian Reichel
Acked-by: Tony Lindgren
Tested-by: Pavel Machek -
Signed-off-by: Sebastian Reichel
Tested-by: Pavel Machek
15 Jun, 2016
1 commit
-
If the HSI core is built as a module hsi_boardinfo may still
be built-in as its Kconfig type is bool, which can cause build
issues. Fix this by building this code into the HSI core when
enabled.Reported-by: kbuild test robot
Signed-off-by: Andrew F. Davis
Signed-off-by: Sebastian Reichel
10 Jun, 2016
1 commit
-
Release &hi->lock before calling `cs_hsi_control_read_error' to avoid deadlock.
The bug was found using EBA (https://github.com/models-team/eba), which reported
the following:Double lock
first at drivers/hsi/clients/cmt_speech.c:443
second at drivers/hsi/clients/cmt_speech.c:447
In cs_hsi_read_on_control_complete defined at drivers/hsi/clients/cmt_speech.c:438:
(!) drivers/hsi/clients/cmt_speech.c:443: spin_lock(& hi->lock);
(?) drivers/hsi/clients/cmt_speech.c:445: msg->status == 4 -> true
(!) drivers/hsi/clients/cmt_speech.c:447: cs_hsi_control_read_error(hi, msg);
(!) drivers/hsi/clients/cmt_speech.c:407: __cs_hsi_error_pre(hi, msg, "control read",
& hi->control_state);
(!) drivers/hsi/clients/cmt_speech.c:382: spin_lock(& hi->lock);Signed-off-by: Iago Abal
Signed-off-by: Sebastian Reichel
30 May, 2016
2 commits
-
Use kmemdup when some other buffer is immediately copied into allocated
region. It replaces call to allocation followed by memcpy, by a single
call to kmemdup.Signed-off-by: Muhammad Falak R Wani
Signed-off-by: Sebastian Reichel -
Replace explicit computation of vma page count by a call to
vma_pages()Signed-off-by: Muhammad Falak R Wani
Signed-off-by: Sebastian Reichel
10 May, 2016
3 commits
-
After the clk change support, the ssi omap ssi core driver
now calls into the port driver to change fclk. This function
was previously inside of an #ifdef, because it was only used
when CONFIG_PM is enabled. Now it also gets used without
power management support:drivers/hsi/built-in.o: In function `ssi_clk_event':
omap_ssi_port.c:(.text+0x1bf8): undefined reference to `omap_ssi_port_update_fclk'This moves the function outside of the CONFIG_PM guard.
Signed-off-by: Arnd Bergmann
Fixes: 4bcf7414528a ("HSI: omap-ssi: add clk change support")
Signed-off-by: Sebastian Reichel -
The driver now uses some pinctrl functions, but fails
to build if PINCTRL is disabled because the respective
header files are only included indirectly:drivers/hsi/controllers/omap_ssi_core.c: In function 'ssi_clk_event':
drivers/hsi/controllers/omap_ssi_core.c:317:4: error: implicit declaration of function 'pinctrl_pm_select_idle_state' [-Werror=implicit-function-declaration]
drivers/hsi/controllers/omap_ssi_core.c:339:4: error: implicit declaration of function 'pinctrl_pm_select_default_state' [-Werror=implicit-function-declaration]
drivers/hsi/controllers/omap_ssi_port.c: In function 'ssi_flush':
drivers/hsi/controllers/omap_ssi_port.c:520:2: error: implicit declaration of function 'pinctrl_pm_select_idle_state' [-Werror=implicit-function-declaration]This includes the headers from the files that call the functions,
which works even if pinctrl is turned off.Signed-off-by: Arnd Bergmann
Fixes: 4bcf7414528a ("HSI: omap-ssi: add clk change support")
Signed-off-by: Sebastian Reichel -
Enabling the omap ssi driver without COMMON_CLK results in a build failure:
drivers/hsi/controllers/omap_ssi_core.c: In function 'ssi_clk_event':
drivers/hsi/controllers/omap_ssi_core.c:304:7: error: 'PRE_RATE_CHANGE' undeclared (first use in this function)This adds a Kconfig dependency to avoid the invalid configuration.
Signed-off-by: Arnd Bergmann
Fixes: 4bcf7414528a ("HSI: omap-ssi: add clk change support")
Signed-off-by: Sebastian Reichel
03 May, 2016
6 commits
-
This adds support for frequency changes of the SSI
functional clock, which may occur due to DVFS.Acked-by: Pavel Machek
Signed-off-By: Sebastian Reichel -
Merge omap_ssi and omap_ssi_port into one module. This
fixes problems with module cycle dependencies introduced
by future patches.Acked-by: Pavel Machek
Signed-off-by: Sebastian Reichel -
This avoids removal of the HSI port device when
only the platform port device should be removed
and clears the POPULATED bit in the DT node, so
that a new platform device is created when the
driver is probed again.Acked-by: Pavel Machek
Signed-off-by: Sebastian Reichel -
device can be unbind/rebind, so probe should
stay available.Acked-by: Pavel Machek
Signed-off-by: Sebastian Reichel -
Removal of ssi controller debugfs directory must
happen after the clients have been removed from
it.Acked-by: Pavel Machek
Signed-off-by: Sebastian Reichel -
Simplify driver by switching to new gpio descriptor based API.
Acked-by: Pavel Machek
Signed-off-by: Sebastian Reichel
29 Jan, 2016
2 commits
-
When using the ssi-protocol driver with the Nokia N950, the
following error is thrown during modem powered up sequence.[13852.274993] port0: SSI error: 0x01
[13852.279205] ssi-protocol ssi-protocol: RX error detected
[13852.284820] ssi-protocol ssi-protocol: Main state: 1
[13852.290069] ssi-protocol ssi-protocol: Recv state: 0
[13852.295288] ssi-protocol ssi-protocol: Send state: 0
[13852.300537] ssi-protocol ssi-protocol: CMT Offline
[13852.305603] ssi-protocol ssi-protocol: Wake test 1
[13852.310638] ssi-protocol ssi-protocol: Data RX id: 0
[13852.315887] ssi-protocol ssi-protocol: Data TX id: 0
[13856.001464] ssi-protocol ssi-protocol: Watchdog trigerred
[13856.007293] ssi-protocol ssi-protocol: Main state: 1
[13856.012542] ssi-protocol ssi-protocol: Recv state: 0
[13856.017761] ssi-protocol ssi-protocol: Send state: 0
[13856.023010] ssi-protocol ssi-protocol: CMT Offline
[13856.028045] ssi-protocol ssi-protocol: Wake test 0
[13856.033111] ssi-protocol ssi-protocol: Data RX id: 0
[13856.038330] ssi-protocol ssi-protocol: Data TX id: 0This patch fixes the issue by using the handshake setup from
the Nokia N950 kernel. The new handshake sequence also works
with the N900, so there is no need to differentiate between
both modems.Tested-by: Aaro Koskinen
Signed-off-by: Sebastian Reichel -
The Nokia N950 and Nokia N9 also have a SSI connected
modem, which use the same protocols as the Nokia N900,
but with increased link speed (96000 kbps instead of
55000 kbps) and with less GPIOs.Since it's unclear, if the N950 and the N9 use exactly
the same modem, each of them gets their own compatible
string.Acked-by: Rob Herring
Tested-by: Aaro Koskinen
Signed-off-by: Sebastian Reichel
07 Jan, 2016
2 commits
-
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
Signed-off-by: Andrzej Hajda
Signed-off-by: Sebastian Reichel -
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
Signed-off-by: Andrzej Hajda
Signed-off-by: Sebastian Reichel
30 Oct, 2015
1 commit
-
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because this value is alreadytaken care by devm_ioremap_resource()Signed-off-by: Sanjeev Sharma
Signed-off-by: Sebastian Reichel
19 Oct, 2015
1 commit
-
Since kzalloc can be failed in memory pressure,
its return value should be checked and handled.Signed-off-by: Insu Yun
Signed-off-by: Sebastian Reichel
14 Oct, 2015
2 commits
-
The error handling path is broken as cawake_gpio was defined as
unsigned integer causing the following warnings on boards that don't
use SSI port and so don't have cawake_gpio defined. e.g. beagleboard C4.[ 30.094635] WARNING: CPU: 0 PID: 322 at drivers/gpio/gpiolib.c:86 gpio_to_desc+0xa4/0xb8()
[ 30.103363] invalid GPIO -2
[ 30.106292] Modules linked in: omap_ssi_port(+) cpufreq_dt cfbfillrect cfbimgblt leds_gpio cfbcopyarea thermal_sys led_class hwmon gpio_keys encoder_tfp410 connector_analog_tv connector_dvi omap_hdq snd phy_i
[ 30.145477] CPU: 0 PID: 322 Comm: modprobe Not tainted 4.3.0-rc4-00030-gca978c0-dirty #335
[ 30.154174] Hardware name: Generic OMAP3-GP (Flattened Device Tree)
[ 30.160827] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[ 30.168975] [] (show_stack) from [] (dump_stack+0x80/0x9c)
[ 30.176635] [] (dump_stack) from [] (warn_slowpath_common+0x7c/0xb8)
[ 30.185180] [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40)
[ 30.194366] [] (warn_slowpath_fmt) from [] (gpio_to_desc+0xa4/0xb8)
[ 30.202819] [] (gpio_to_desc) from [] (gpio_request_one+0x14/0x11c)
[ 30.211273] [] (gpio_request_one) from [] (devm_gpio_request_one+0x3c/0x78)
[ 30.220458] [] (devm_gpio_request_one) from [] (ssi_port_probe+0x118/0x504 [omap_ssi_port])
[ 30.231170] [] (ssi_port_probe [omap_ssi_port]) from [] (platform_drv_probe+0x48/0xa4)
[ 30.241424] [] (platform_drv_probe) from [] (driver_probe_device+0x1dc/0x2a0)
[ 30.250793] [] (driver_probe_device) from [] (__driver_attach+0x94/0x98)
[ 30.259643] [] (__driver_attach) from [] (bus_for_each_dev+0x54/0x88)
[ 30.268249] [] (bus_for_each_dev) from [] (bus_add_driver+0xe8/0x1f8)
[ 30.276916] [] (bus_add_driver) from [] (driver_register+0x78/0xf4)
[ 30.285369] [] (driver_register) from [] (__platform_driver_probe+0x34/0xd8)
[ 30.294647] [] (__platform_driver_probe) from [] (do_one_initcall+0x80/0x1d8)
[ 30.303985] [] (do_one_initcall) from [] (do_init_module+0x5c/0x1cc)
[ 30.312561] [] (do_init_module) from [] (load_module+0x18c8/0x1f0c)
[ 30.320983] [] (load_module) from [] (SyS_init_module+0xdc/0x150)
[ 30.329223] [] (SyS_init_module) from [] (ret_fast_syscall+0x0/0x1c)Fixes: b209e047bc743 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Roger Quadros
Signed-off-by: Sebastian Reichel -
When device_register() fails, kfree() is called in hsi_client_release(),
hence there is no need to call kfree in err3 again.Fixes: a2aa24734d9db ("HSI: Add common DT binding for HSI client devices")
Signed-off-by: Geliang Tang
Signed-off-by: Sebastian Reichel