summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-03-27soc: samsung: asv: Wait until OPP gets released before adding new oneSylwester Nawrocki1-0/+10
There is currently no check whether an OPP is actually removed before attempting to add an replacement OPP. In situations when and OPP is referenced when we try to remove it and it is not already removed at the time of return from the dev_pm_opp_remove() call subsequent dev_pm_opp_add() invocation will fail. To avoid that add a polling loop with timeout as a barrier before adding new OPP. This patch should also prevent related cpufreq core issues as indicated by logs as follows. exynos_asv_update_cpu_opp cpu4 opp5, freq: 2000 missing exynos5433_asv_opp_get_voltage: arm,cortex-a57: [6] freq: 1900, voltage: 1262500 -> 1187500 cpu cpu4: _opp_add: duplicate OPPs detected. Existing: freq: 1900000000, volt: 1262500, enabled: 1. New: freq: 1900000000, volt: 1187500, enabled: 1 exynos_asv_update_cpu_opp: Failed to add OPP 1900000000 Hz/1187500 uV for cpu4 (-17) cpu cpu4: dev_pm_opp_set_rate: failed to find OPP for freq 1900000000 (-34) exynos5433_asv_opp_get_voltage: arm,cortex-a57: [9] freq: 1600, voltage: 1137500 -> 1062500 cpufreq: __target_index: Failed to change cpu frequency: -34 Change-Id: Ibf6a568cabbd5380952d97f93d27ac59f1db125b Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-19drm/exynos/mixer: fix MIXER shadow registry synchronisation codeAndrzej Hajda1-44/+66
MIXER on Exynos5 SoCs uses different synchronisation method than Exynos4 to update internal state (shadow registers). Apparently the driver implements it incorrectly. The rule should be as follows: - do not request updating registers until previous request was finished, ie. MXR_CFG_LAYER_UPDATE_COUNT must be 0. - before setting registers synchronisation on VSYNC should be turned off, ie. MXR_STATUS_SYNC_ENABLE should be reset, - after finishing MXR_STATUS_SYNC_ENABLE should be set again. The patch hopefully implements it correctly. Below sample kernel log from page fault caused by the bug: [ 25.670038] exynos-sysmmu 14650000.sysmmu: 14450000.mixer: PAGE FAULT occurred at 0x2247b800 [ 25.677888] ------------[ cut here ]------------ [ 25.682164] kernel BUG at ../drivers/iommu/exynos-iommu.c:450! [ 25.687971] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM [ 25.693778] Modules linked in: [ 25.696816] CPU: 5 PID: 1553 Comm: fb-release_test Not tainted 5.0.0-rc7-01157-g5f86b1566bdd #136 [ 25.705646] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [ 25.711710] PC is at exynos_sysmmu_irq+0x1c0/0x264 [ 25.716470] LR is at lock_is_held_type+0x44/0x64 v2: added missing MXR_CFG_LAYER_UPDATE bit setting in mixer_enable_sync Reported-by: Marian Mihailescu <mihailescu2m@gmail.com> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Change-Id: Idd49412e699350a7ea3a98ef7f925924e0ddf1ff
2019-03-19drm/exynos/mixer: fix synchronization check in interlaced modeAndrzej Hajda2-0/+11
In case of interlace mode video processor registers and mixer config register must be check to ensure internal state is in sync with shadow registers. This patch fixes page-faults in interlaced mode. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> [backport of mainline commit 2eced8e917b060587fc8ed46df41c364957a5050] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I8b09ed165101a7dcccd1d6e7338e0216a27f4481
2019-03-19ARM: dts: exynos: Increase minimal ACLK400_DISP1 frequency on Exynos542xMarek Szyprowski1-1/+1
ACLK400_DISP1 bus feeds some internal buses of the display subsystem, some of which are also related to TV/Mixer hardware modules. When that bus is set to 120MHz, Exynos Mixer is not able to properly handle two XRGB display planes at FullHD-60MHz. DMA underrun happens, which in turn might result in reading data out of the configured buffer, what causes IOMMU page fault and kernel panic. This change fixes the following IOMMU fault, observed, when 2 Mixer planes were enabled: exynos-sysmmu 14650000.sysmmu: 14450000.mixer: PAGE FAULT occurred at 0x20fe9000 ------------[ cut here ]------------ kernel BUG at ../drivers/iommu/exynos-iommu.c:450! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM Modules linked in: CPU: 5 PID: 0 Comm: swapper/5 Not tainted 5.0.0-00003-g1b03088168ea #149 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) PC is at exynos_sysmmu_irq+0x1c0/0x264 LR is at lock_is_held_type+0x44/0x64 ... Reported-by: Marian Mihailescu <mihailescu2m@gmail.com> Fixes: 5d99cc59a3c6 ("ARM: dts: exynos: Move Exynos5250 and Exynos5420 nodes under soc") Fixes: b04a62d3ade3 ("ARM: dts: exynos: Add bus nodes using VDD_INT for Exynos542x SoC") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I3d2f341f5e89d4631401f653d0ad9e36f26f45ad
2019-03-12ASoC: samsung: odroid: Change rfs value to 256Jaechul Lee1-2/+5
rfs is set 256 as a default value in I2S module. Due to clock rate setting rounding errors with rfs=512 playback is almost twice faster than original speed when the device is opened with 44.1k samplerate. pulseaudio that uses 44.1k sinks can't play the sound properly. Change-Id: I21d5553e36dcbf00802230cf1c60f5fb7df1056d Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
2019-03-08ASoS: samsung: odroid: Fix clock configuration for 44100 sample rateSylwester Nawrocki1-2/+2
After commit fbeec965b8d1c ("ASoC: samsung: odroid: Fix 32000 sample rate handling") due to clock rounding error CODEC master clock frequency is being set to 20070401 Hz instead of 22579000 Hz. This results in too fast actual sample rate for fs=44100, e.g. 2 kHz tone has really 3555 Hz frequency (2000 Hz * 20070401/22579000 * 2). Fix this by increasing correction passed to clk_set_rate() to take into account inaccuracy of EPLL frequency properly. Change-Id: I8d08bec8e70394421c115bde1d511b730885bbe2 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-04ARM: dts: exynos: Fix audio routing on exynos5422-odroidxu3Sylwester Nawrocki1-1/+2
Add missing audio routing entry for the capture stream, this change is required to fix audio recording on Odroid XU3. Change-Id: I8db68ab3e097a0f3cfd07224016e4704e57c6635 Fixes: 885b005d232c ("ARM: dts: exynos: Add support for secondary DAI to Odroid XU3") Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-04ASoC: samsung: i2s: Fix DAPM routes for capture streamSylwester Nawrocki1-1/+2
This patch sets missing stream_name of capture part of the DAI driver so we can define DAPM routing properly also for the capture stream. Fixes: 64aba9bca5bd ("ASoC: samsung: i2s: Add widgets and routes for DPCM support") Change-Id: I7ac244afcd74d92cf92da1d9d7d9606285ea0360 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-03-04ARM: dts: exynos: Add support for secondary DAI to Odroid XU4Sylwester Nawrocki1-1/+3
This patch extends DAPM routing and adds secondary CPU DAI entry to support the secondary audio PCM interface on Odroid XU4. Change-Id: Id20d2a064f5d29c4edf349e9a968864a48a11b46 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2019-03-04ARM: dts: exynos: Add support for secondary DAI to Odroid XU3Sylwester Nawrocki1-2/+4
This patch extends DAPM routing and adds secondary CPU DAI entry to support the secondary audio PCM interface on Odroid XU3. Change-Id: I2efb8eca9418554482194a2c54aa6b6ca674d5c2 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2019-03-04LOCAL: ASoC: temporary workaround for i2s/prepare_lock deadlockMarek Szyprowski1-10/+10
This reverts commit 00ffa8a3b1a60a89ab0ef5ae1d8e41269c30a3bd. Change-Id: I396b1250a748fdb8219abf6d0bf71c5fab119658 Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2019-03-04ASoC: dmaengine: Remove unused SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flagSylwester Nawrocki2-21/+4
There is now no users of this flag so remove it together with related code. The chan_name field of snd_dmaengine_dai_dma_data data structure is not removed as it is still in use by the PXA platform. Change-Id: Ia8bb6022ce7c5e85abb7c5410459130666785f45 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: odroid: Prevent uninitialized variable useSylwester Nawrocki1-2/+6
This addresses an issue pointed out by compiler warning: sound/soc/samsung/odroid.c: In function ‘odroid_audio_probe’: sound/soc/samsung/odroid.c:298:22: warning: ‘cpu_dai’ may be used uninitialized in this function [-Wmaybe-uninitialized] priv->clk_i2s_bus = of_clk_get_by_name(cpu_dai, "iis"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I39c6dd0a1aa5ec68bfc17c895988c21a1a34733e Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: odroid: Fix of_node refcount unbalanceSylwester Nawrocki1-7/+12
In odroid_audio_probe() some OF nodes are left without reference count decrease after use. Fix it by ensuring required of_node_calls() are done before exiting probe. Change-Id: Ifbcb6294331acc59028e675d8ab1143394508d66 Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Fix multiple "IIS multi" devices initializationSylwester Nawrocki2-18/+34
On some SoCs (e.g. Exynos5433) there are multiple "IIS multi audio interfaces" and the driver will try to register there multiple times same platform device for the secondary FIFO, which of course fails miserably. To fix this we derive the secondary platform device name from the primary device name. The secondary device name will now be <primary_dev_name>-sec instead of fixed "samsung-i2s-sec". The fixed platform_device_id table entry is removed as the secondary device name is now dynamic and device/driver matching is done through driver_override. Change-Id: I49ed3e20279af198cdce11c08cc11bd6536dddad Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Fix secondary platform device unregistrationSylwester Nawrocki1-9/+10
This fixes unregistration of the secondary platform device so all resources are properly released. Additionally the removal sequence is corrected so it is in reverse order comparing to probe sequence. The test against NULL priv->pdev_sec is removed as it is not necessary. Change-Id: If325e11b4109fbc61fbb2df3ac012f2c1e9f0cb5 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: odroid: Add missing DAPM routesSylwester Nawrocki1-1/+11
With old DTS there will be missing DAPM routes linking BE with CODECs. Add those routes in the card driver so sound works properly on Odroid XU3/4 also without DTS updates enabling the secondary PCM. Change-Id: I0a2a8e59859cdaf46da0563e30278dc9a8fe2376 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: odroid: Ensure proper sample rate on pri/sec PCMSylwester Nawrocki1-0/+56
Currently when playing sound with different sample rates actual sample rate will be determined by audio stream which starts first on either primary or secondary PCM. The audio root clock will be configured appropriately only for the first stream. As the hardware is limited to same sample rate on both interfaces we need to disallow streams with different sample rates. It is done by this patch by returning error in FE hw_params if there is already active stream running with different sample rate. Change-Id: I643d02d38acf20a7711ba5930e6bceceeaafc087 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Prevent potential NULL platform data dereferenceSylwester Nawrocki1-12/+15
When np is NULL i2s_pdata could also be NULL but i2s_pdata is now being dereferenced without proper check. Fix this and shorten the error message so we don't exceed 80 characters limit. Change-Id: I5d5b14ff953d4a2617500f50e81eb459d56a6e4f Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Convert to SPDX License IndentifierSylwester Nawrocki1-10/+6
Replace GPL v2.0 license statements with SPDX license identifier. Change-Id: Iaf0ae489d7d55dc949ba70e956afe3642cdfaeb4 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Comments clean upSylwester Nawrocki1-14/+15
Spelling error fixes, upper/lower case letter changes. Change-Id: Id1060cbb859c6da4480a0dd6f676a6614b64da8c Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Mark expected switch fall-throughGustavo A. R. Silva1-0/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Change-Id: I030b163708ab40f17cf500cff7a8f326b890b7f5 Addresses-Coverity-ID: 1381093 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Change indentation in SAMSUNG_I2S_FMTS definitionSylwester Nawrocki1-3/+2
Change indentation so this macro definition spans 2 rows and looks more consistent with surrounding code. Change-Id: I747acdce454a660c637d29ab34450081e02084d2 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Simplify pri_dai, sec_dai pointers usageSylwester Nawrocki1-4/+3
If the probe call is on the primary DAI we can use 'other' in place of i2s->sec_dai, if the probe call is on the secondary DAI we can use 'i2s' in place of other->sec_dai. While at it fix one whitespace issue. Change-Id: Idbe9190d87f628f4d8fab77dbdbe433c8cd7825d Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: Specify DMA channel names through custom DMA configSylwester Nawrocki4-11/+7
This is a part of conversion of Samsung platforms to use the custom DMA config for specifying DMA channel names, in addition to passing custom DMA device for the secondary CPU DAI's "PCM" component for some variants of the I2S controller. We also don't set the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME any more as setting it wouldn't allow to specify DMA channels through the custom DMA config. Change-Id: Ia7e4da88746788c6fd56e1781160328bdaa224b8 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Get rid of a static spinlockSylwester Nawrocki1-7/+9
This patch makes the spinlock serializing access to the primary/secondary PCM a per I2S controller lock, rather than a global one. There is no need to have a global lock across multiple I2S controllers in the SoC. Change-Id: I6b56296ce45e219ed5f37af85fd352ff51af617a Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: odroid: Add support for secondary CPU DAISylwester Nawrocki1-36/+95
This patch adds DPCM links in order to support the secondary I2S interface. For the secondary PCM interface to be actually available one more entry should be added to the sound-dai property in sound/cpu node in DT. The changes in driver are done in a way so we are backwards compatible with existing DTS/DTB, i.e. if the cpu sound-dai property contains only one entry only one PCM will be registered. Change-Id: I7bc789cf1d025b168fd3411f24f4015016025bb2 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Move quirks data to common driver data structureSylwester Nawrocki1-21/+12
The quirk flags are common for the primary and the secondary DAI so move respective field from struct i2s_dai to common driver data structure. Change-Id: I27506c48b3faa8c344535c6749b534c6c11901e7 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Move IP variant data to common driver data structureSylwester Nawrocki1-21/+21
The IP variant data is another thing common for both DAIs, move it to the driver's common data structure. Change-Id: Id83d14a38d6c5d0d4d25dfd0ca8332e88315d271 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Drop spinlock pointer from i2s_dai data structureSylwester Nawrocki1-27/+24
As we now have the 'priv' pointer in most of the places we can use priv->lock directly, dropping extra indirection in the SFR region spinlock access. Change-Id: Ic137ee120aa1871a9d2142eaee9f9292e2c0f25f Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Move SFR pointer to common driver data structureSylwester Nawrocki1-47/+59
The SFR region is common for both DAIs so move related data structure field from struct i2s_dai to the common driver data structure. Change-Id: I2080a75f0a49f431ee37fa4488ed13ae8fd26b12 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Move registers cache to common driver data structureSylwester Nawrocki1-9/+11
There is no need to keep the PM suspend/resume register cache separate for each DAI as those registers are common, move related i2s_dai data structure to the driver's common data structure. This will allow us to simplify the code a little eventually and to make it easier to follow. Change-Id: I91919c337611dc69983d2ee346e988f2e93d0695 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Move opclk data to common driver data structureSylwester Nawrocki1-37/+33
The clock for generating I2S signals is also common for both CPU DAIs so move it to the driver's common data structure. Change-Id: Ia8320f1e9ab0c02d113bb73002cd4ae98caec7e8 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Move core clk to the driver common data structureSylwester Nawrocki1-13/+14
The core clock is also common for both CPU DAIs so move it to the driver's private data structure. Change-Id: Ib6f2975bd34a8cfba20faaa9e51be88b6a41bc30 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Add widgets and routes for DPCM supportSylwester Nawrocki1-1/+26
This patch adds DAPM widgets required to model the internal mixer of the I2S controller merging audio streams from the primary and from the secondary PCM interface. Change-Id: I3cb7b1b17f0c6891f6edb638db97ca6a482cec4b Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Move clk supplier data to common driver data structureSylwester Nawrocki1-35/+33
Having the clocks provider data in struct samsung_i2s_priv, i.e. per the I2S controller instance, rather than per CPU DAI better models the hardware and simplifies the code a little. The clock provider is common for both DAIs. Change-Id: I76db45001d8303263405b2cc40526e4101f35d16 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Restore support for the secondary PCMSylwester Nawrocki1-4/+48
This patch introduces again registration of additional platform device as we still need it for registering the secondary dmaengine PCM component. This patch in most part is a revert of changes done in commit be2c92eb64023e ("ASoC: samsung: i2s: Remove virtual device for secondary DAI") Change-Id: Ib7a47c83511403b32e04c41edf8148d77481abb3 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Convert to single component with multiple DAIsSylwester Nawrocki1-77/+115
This patch includes minimal changes as a prerequisite for adding support for the Exynos secondary I2S interface as second DAI of the I2S component. Doing it that way allows to avoid problems as indicated in commmit 6b01e0365b1689 ("ASoC: samsung: i2s: disable secondary DAI until it gets fixed") The samsung_i2s_get_pri_dai() helper added in this patch is temporary and will be removed in one of subsequent patches. Change-Id: I5cb8ff7cb13a144bc6944752081b93a847080f94 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: dmaengine: Allow to specify custom DMA deviceSylwester Nawrocki7-8/+11
The additional function argument will allow to select proper DMA device for requesting DMA channel for the secondary CPU DAI. Change-Id: I3848594e393bcf55770020857ee5f2d0271b779b Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: dmaengine: Extend use of chan_names provided in custom DMA configSylwester Nawrocki1-2/+9
There are currently two ways to specify custom DMA channel names: - through the SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag and snd_dmaengine_dai_dma_data data structure, - through chan_names field of struct snd_dmaengine_pcm_config. In order to replace the DAI DMA data method with the custom DMA config one on non-DT platforms the dmaengine_pcm_new() function is extended to also consider channel names specified in the custom DMA config. If both config->chan_names and dma_data->chan_name are provided the former will be used. Change-Id: I6a325754971c7d4daf3141f3cfeede9280d9941c Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: dmaengine: Improve of_node test in dmaengine_pcm_request_chan_of()Sylwester Nawrocki1-1/+2
Currently when of_node of the "PCM" device is null dmaengine_pcm_request_chan_of() function will bail out, including cases when custom DMA device is intended to be used. To have the channels properly requested when custom DMA device is provided extend the of_node test to also consider dma_dev->of_node. Change-Id: Icac9da759fdefa367492f5d0ad0ff031a7b0bb62 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: i2s: Fix prescaler setting for the secondary DAISylwester Nawrocki1-1/+7
Make sure i2s->rclk_srcrate is properly initialized also during playback through the secondary DAI. Change-Id: Ic27fe0b834379a95485668137eee1e7d22d93952 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: samsung: Prevent clk_get_rate() calls in atomic contextSylwester Nawrocki1-5/+5
This patch moves clk_get_rate() call from trigger() to hw_params() callback to avoid calling sleeping clk API from atomic context and prevent deadlock as indicated below. Before this change clk_get_rate() was being called with same spinlock held as the one passed to the clk API when registering clocks exposed by the I2S driver. [ 82.109780] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908 [ 82.117009] in_atomic(): 1, irqs_disabled(): 128, pid: 1554, name: speaker-test [ 82.124235] 3 locks held by speaker-test/1554: [ 82.128653] #0: cc8c5328 (snd_pcm_link_rwlock){...-}, at: snd_pcm_stream_lock_irq+0x20/0x38 [ 82.137058] #1: ec9eda17 (&(&substream->self_group.lock)->rlock){..-.}, at: snd_pcm_ioctl+0x900/0x1268 [ 82.146417] #2: 6ac279bf (&(&pri_dai->spinlock)->rlock){..-.}, at: i2s_trigger+0x64/0x6d4 [ 82.154650] irq event stamp: 8144 [ 82.157949] hardirqs last enabled at (8143): [<c0a0f574>] _raw_read_unlock_irq+0x24/0x5c [ 82.166089] hardirqs last disabled at (8144): [<c0a0f6a8>] _raw_read_lock_irq+0x18/0x58 [ 82.174063] softirqs last enabled at (8004): [<c01024e4>] __do_softirq+0x3a4/0x66c [ 82.181688] softirqs last disabled at (7997): [<c012d730>] irq_exit+0x140/0x168 [ 82.188964] Preemption disabled at: [ 82.188967] [<00000000>] (null) [ 82.195728] CPU: 6 PID: 1554 Comm: speaker-test Not tainted 5.0.0-rc5-00192-ga6e6caca8f03 #191 [ 82.204302] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [ 82.210376] [<c0111a54>] (unwind_backtrace) from [<c010d8f4>] (show_stack+0x10/0x14) [ 82.218084] [<c010d8f4>] (show_stack) from [<c09ef004>] (dump_stack+0x90/0xc8) [ 82.225278] [<c09ef004>] (dump_stack) from [<c0152980>] (___might_sleep+0x22c/0x2c8) [ 82.232990] [<c0152980>] (___might_sleep) from [<c0a0a2e4>] (__mutex_lock+0x28/0xa3c) [ 82.240788] [<c0a0a2e4>] (__mutex_lock) from [<c0a0ad80>] (mutex_lock_nested+0x1c/0x24) [ 82.248763] [<c0a0ad80>] (mutex_lock_nested) from [<c04923dc>] (clk_prepare_lock+0x78/0xec) [ 82.257079] [<c04923dc>] (clk_prepare_lock) from [<c049538c>] (clk_core_get_rate+0xc/0x5c) [ 82.265309] [<c049538c>] (clk_core_get_rate) from [<c0766b18>] (i2s_trigger+0x490/0x6d4) [ 82.273369] [<c0766b18>] (i2s_trigger) from [<c074fec4>] (soc_pcm_trigger+0x100/0x140) [ 82.281254] [<c074fec4>] (soc_pcm_trigger) from [<c07378a0>] (snd_pcm_do_start+0x2c/0x30) [ 82.289400] [<c07378a0>] (snd_pcm_do_start) from [<c07376cc>] (snd_pcm_action_single+0x38/0x78) [ 82.298065] [<c07376cc>] (snd_pcm_action_single) from [<c073a450>] (snd_pcm_ioctl+0x910/0x1268) [ 82.306734] [<c073a450>] (snd_pcm_ioctl) from [<c0292344>] (do_vfs_ioctl+0x90/0x9ec) [ 82.314443] [<c0292344>] (do_vfs_ioctl) from [<c0292cd4>] (ksys_ioctl+0x34/0x60) [ 82.321808] [<c0292cd4>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x28) [ 82.329431] Exception stack(0xeb875fa8 to 0xeb875ff0) [ 82.334459] 5fa0: 00033c18 b6e31000 00000004 00004142 00033d80 00033d80 [ 82.342605] 5fc0: 00033c18 b6e31000 00008000 00000036 00008000 00000000 beea38a8 00008000 [ 82.350748] 5fe0: b6e3142c beea384c b6da9a30 b6c9212c [ 82.355789] [ 82.357245] ====================================================== [ 82.363397] WARNING: possible circular locking dependency detected [ 82.369551] 5.0.0-rc5-00192-ga6e6caca8f03 #191 Tainted: G W [ 82.376395] ------------------------------------------------------ [ 82.382548] speaker-test/1554 is trying to acquire lock: [ 82.387834] 6d2007f4 (prepare_lock){+.+.}, at: clk_prepare_lock+0x78/0xec [ 82.394593] [ 82.394593] but task is already holding lock: [ 82.400398] 6ac279bf (&(&pri_dai->spinlock)->rlock){..-.}, at: i2s_trigger+0x64/0x6d4 [ 82.408197] [ 82.408197] which lock already depends on the new lock. [ 82.416343] [ 82.416343] the existing dependency chain (in reverse order) is: [ 82.423795] [ 82.423795] -> #1 (&(&pri_dai->spinlock)->rlock){..-.}: [ 82.430472] clk_mux_set_parent+0x34/0xb8 [ 82.434975] clk_core_set_parent_nolock+0x1c4/0x52c [ 82.440347] clk_set_parent+0x38/0x6c [ 82.444509] of_clk_set_defaults+0xc8/0x308 [ 82.449186] of_clk_add_provider+0x84/0xd0 [ 82.453779] samsung_i2s_probe+0x408/0x5f8 [ 82.458376] platform_drv_probe+0x48/0x98 [ 82.462879] really_probe+0x224/0x3f4 [ 82.467037] driver_probe_device+0x70/0x1c4 [ 82.471716] bus_for_each_drv+0x44/0x8c [ 82.476049] __device_attach+0xa0/0x138 [ 82.480382] bus_probe_device+0x88/0x90 [ 82.484715] deferred_probe_work_func+0x6c/0xbc [ 82.489741] process_one_work+0x200/0x740 [ 82.494246] worker_thread+0x2c/0x4c8 [ 82.498408] kthread+0x128/0x164 [ 82.502131] ret_from_fork+0x14/0x20 [ 82.506204] (null) [ 82.508976] [ 82.508976] -> #0 (prepare_lock){+.+.}: [ 82.514264] __mutex_lock+0x60/0xa3c [ 82.518336] mutex_lock_nested+0x1c/0x24 [ 82.522756] clk_prepare_lock+0x78/0xec [ 82.527088] clk_core_get_rate+0xc/0x5c [ 82.531421] i2s_trigger+0x490/0x6d4 [ 82.535494] soc_pcm_trigger+0x100/0x140 [ 82.539913] snd_pcm_do_start+0x2c/0x30 [ 82.544246] snd_pcm_action_single+0x38/0x78 [ 82.549012] snd_pcm_ioctl+0x910/0x1268 [ 82.553345] do_vfs_ioctl+0x90/0x9ec [ 82.557417] ksys_ioctl+0x34/0x60 [ 82.561229] ret_fast_syscall+0x0/0x28 [ 82.565477] 0xbeea384c [ 82.568421] [ 82.568421] other info that might help us debug this: [ 82.568421] [ 82.576394] Possible unsafe locking scenario: [ 82.576394] [ 82.582285] CPU0 CPU1 [ 82.586792] ---- ---- [ 82.591297] lock(&(&pri_dai->spinlock)->rlock); [ 82.595977] lock(prepare_lock); [ 82.601782] lock(&(&pri_dai->spinlock)->rlock); [ 82.608975] lock(prepare_lock); [ 82.612268] [ 82.612268] *** DEADLOCK *** Fixes: 647d04f8e07a ("ASoC: samsung: i2s: Ensure the RCLK rate is properly determined") Change-Id: I1b8100d4e65a1d9964aa92d2ac56965a01359791 Reported-by: Krzysztof Kozłowski <krzk@kernel.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-04ASoC: Revert "LOCAL / temporary workaround for i2s/prepare_lock deadlock"Sylwester Nawrocki1-10/+10
This reverts commit a146d53312cc7151d7aa5d517b808d2d1fdfd6c1. Revert temporarily in order to apply patches from the mainline cleanly. Change-Id: I2cce77968974c36d8ccbe4b2df75b77113e6d5bf Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-02-28gpu/drm: Fix lock held when returning to user space.Tetsuo Handa2-4/+3
We need to call drm_modeset_acquire_fini() when drm_atomic_state_alloc() failed or call drm_modeset_acquire_init() after drm_atomic_state_alloc() succeeded. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reported-by: syzbot <syzbot+6ea337c427f5083ebdf2@syzkaller.appspotmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1547115571-21219-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp [hoegeun.kwon: this patch from the mainline 4089e272ac61 and it has been modified to be able to backport linux-v4.14.] Change-Id: Iaa0d6e104054abc11181c43bdb6283a8bd30eb19 Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
2019-02-27ARM: configs: tizen_odroid: Increase CMA size to 256 MBSylwester Nawrocki1-1/+1
This change is required for video decoding through gst-omx plugin. Change-Id: I1b13280bb94bb0314c7f5c7bd1d8a4f77d829a36 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2019-02-27base/firmware retry firmware load after rootfs mountChristoph Manszewski5-3/+47
Return -EPROBE_DEFER for request_firmware() until root filesystem is mounted. In case of request_firmware_nowait() create a list of deferred firmware load requests, and retry firmware load after root filesytem is mounted. This allows to have wifi drivers build into the kernel, but the firmware files shipped on the root filesystem. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Christoph Manszewski <c.manszewski@samsung.com> Change-Id: I40c0a2a98ca9b1a95fb743a848d2366250cae839
2019-02-27Revert "[LOCAL] base/firmware: return -EPROBE_DEFER until rootfs is available"Christoph Manszewski4-11/+2
This reverts commit 1733ede82e9e964a3d5234ef61979ca523e7ba5a. Signed-off-by: Christoph Manszewski <c.manszewski@samsung.com> Change-Id: I30441cbd9b4933cab7e1cb6e80d767e4fca65f41
2019-02-26ARM: dts: Disable UHS-I modes for SD card on Odroid XU3/XU4/HC1Marek Szyprowski1-4/+0
Ultra High Speed DDR50+ modes doesn't work stable on the tested Odroid XU3 and XU4 boards, so disable them until the proper solution is developed. This is equal to the revert of the following commits: "ARM: dts: exynos: Update maximum frequency for SD card to 200MHz on Odroid XU3/XU4/HC1" "ARM: dts: exynos: Add UHS-I bus speed support to Odroid XU3/XU4/HC1" This reverts commit 6d92b6cece561306a707e40a264b802b51d4264c. This reverts commit f3e8e10898d0efee73ad0108dec9f3a0947da752. Tested-by: Kamil Konieczny <k.konieczny@partner.samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I210c64cb5d34597132341caa6b98a01fa6a8397c
2019-02-19ARM64: defconfig: tm2: Sync with savedefconfigJunghoon Kim1-5603/+0
Sync the tizen_tm2_defconfig with savedefconfig. Currently, whenever rebasing the kernel tree, it requires to update the kernel version in the defconfig file. This patch helps to avoid the above step. Change-Id: I3fa02794b552411aa15363bcbd27f4e370d668f6 Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>