/* * wm8978.h -- codec driver for WM8978 * * Copyright 2009 Guennadi Liakhovetski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __WM8978_H__ #define __WM8978_H__ /* * Register values. */ #define WM8978_RESET 0x00 #define WM8978_POWER_MANAGEMENT_1 0x01 #define WM8978_POWER_MANAGEMENT_2 0x02 #define WM8978_POWER_MANAGEMENT_3 0x03 #define WM8978_AUDIO_INTERFACE 0x04 #define WM8978_COMPANDING_CONTROL 0x05 #define WM8978_CLOCKING 0x06 #define WM8978_ADDITIONAL_CONTROL 0x07 #define WM8978_GPIO_CONTROL 0x08 #define WM8978_JACK_DETECT_CONTROL_1 0x09 #define WM8978_DAC_CONTROL 0x0A #define WM8978_LEFT_DAC_DIGITAL_VOLUME 0x0B #define WM8978_RIGHT_DAC_DIGITAL_VOLUME 0x0C #define WM8978_JACK_DETECT_CONTROL_2 0x0D #define WM8978_ADC_CONTROL 0x0E #define WM8978_LEFT_ADC_DIGITAL_VOLUME 0x0F #define WM8978_RIGHT_ADC_DIGITAL_VOLUME 0x10 #define WM8978_EQ1 0x12 #define WM8978_EQ2 0x13 #define WM8978_EQ3 0x14 #define WM8978_EQ4 0x15 #define WM8978_EQ5 0x16 #define WM8978_DAC_LIMITER_1 0x18 #define WM8978_DAC_LIMITER_2 0x19 #define WM8978_NOTCH_FILTER_1 0x1b #define WM8978_NOTCH_FILTER_2 0x1c #define WM8978_NOTCH_FILTER_3 0x1d #define WM8978_NOTCH_FILTER_4 0x1e #define WM8978_ALC_CONTROL_1 0x20 #define WM8978_ALC_CONTROL_2 0x21 #define WM8978_ALC_CONTROL_3 0x22 #define WM8978_NOISE_GATE 0x23 #define WM8978_PLL_N 0x24 #define WM8978_PLL_K1 0x25 #define WM8978_PLL_K2 0x26 #define WM8978_PLL_K3 0x27 #define WM8978_3D_CONTROL 0x29 #define WM8978_BEEP_CONTROL 0x2b #define WM8978_INPUT_CONTROL 0x2c #define WM8978_LEFT_INP_PGA_CONTROL 0x2d #define WM8978_RIGHT_INP_PGA_CONTROL 0x2e #define WM8978_LEFT_ADC_BOOST_CONTROL 0x2f #define WM8978_RIGHT_ADC_BOOST_CONTROL 0x30 #define WM8978_OUTPUT_CONTROL 0x31 #define WM8978_LEFT_MIXER_CONTROL 0x32 #define WM8978_RIGHT_MIXER_CONTROL 0x33 #define WM8978_LOUT1_HP_CONTROL 0x34 #define WM8978_ROUT1_HP_CONTROL 0x35 #define WM8978_LOUT2_SPK_CONTROL 0x36 #define WM8978_ROUT2_SPK_CONTROL 0x37 #define WM8978_OUT3_MIXER_CONTROL 0x38 #define WM8978_OUT4_MIXER_CONTROL 0x39 #define WM8978_MAX_REGISTER 0x39 #define WM8978_CACHEREGNUM 58 /* Clock divider Id's */ enum wm8978_clk_id { WM8978_OPCLKRATE, WM8978_BCLKDIV, }; enum wm8978_sysclk_src { WM8978_MCLK = 0, WM8978_PLL, }; #endif /* __WM8978_H__ */ type='submit' value='search'/>
path: root/include/net/mpls.h
diff options
context:
space:
mode:
authorIago Abal <mail@iagoabal.eu>2017-01-11 14:00:21 +0100
committerVinod Koul <vinod.koul@intel.com>2017-01-25 15:35:11 +0530
commit91539eb1fda2d530d3b268eef542c5414e54bf1a (patch)
tree960f5ca6342ad20837aff18aad6e8ecd7da32fd6 /include/net/mpls.h
parent6610d0edf6dc7ee97e46ab3a538a565c79d26199 (diff)
dmaengine: pl330: fix double lock
The static bug finder EBA (http://www.iagoabal.eu/eba/) reported the following double-lock bug: Double lock: 1. spin_lock_irqsave(pch->lock, flags) at pl330_free_chan_resources:2236; 2. call to function `pl330_release_channel' immediately after; 3. call to function `dma_pl330_rqcb' in line 1753; 4. spin_lock_irqsave(pch->lock, flags) at dma_pl330_rqcb:1505. I have fixed it as suggested by Marek Szyprowski. First, I have replaced `pch->lock' with `pl330->lock' in functions `pl330_alloc_chan_resources' and `pl330_free_chan_resources'. This avoids the double-lock by acquiring a different lock than `dma_pl330_rqcb'. NOTE that, as a result, `pl330_free_chan_resources' executes `list_splice_tail_init' on `pch->work_list' under lock `pl330->lock', whereas in the rest of the code `pch->work_list' is protected by `pch->lock'. I don't know if this may cause race conditions. Similarly `pch->cyclic' is written by `pl330_alloc_chan_resources' under `pl330->lock' but read by `pl330_tx_submit' under `pch->lock'. Second, I have removed locking from `pl330_request_channel' and `pl330_release_channel' functions. Function `pl330_request_channel' is only called from `pl330_alloc_chan_resources', so the lock is already held. Function `pl330_release_channel' is called from `pl330_free_chan_resources', which already holds the lock, and from `pl330_del'. Function `pl330_del' is called in an error path of `pl330_probe' and at the end of `pl330_remove', but I assume that there cannot be concurrent accesses to the protected data at those points. Signed-off-by: Iago Abal <mail@iagoabal.eu> Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'include/net/mpls.h')