regulator: of: fix suspend-min/max-voltage parsing
Subsystems (8)
Sasha Levin
maintainerPATCH 22/81 ASoc: rockchip: i2s: Fix RPM imbalance
In reply to Sasha LevinFrom: Robin Murphy <[email protected]>
[ Upstream commit b1e620e7d32f5aad5353cc3cfc13ed99fea65d3a ]
If rockchip_pcm_platform_register() fails, e.g. upon deferring to wait for an absent DMA channel, we return without disabling RPM, which makes subsequent re-probe attempts scream with errors about the unbalanced enable. Don't do that.
--- sound/soc/rockchip/rockchip_i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/rockchip/rockchip_i2s.c +1 -1
@@ -674,7 +674,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) ret =rockchip_pcm_platform_register (&pdev->dev);if (ret) {dev_err (&pdev->dev,"Could not register PCM\n" ); -return ret; + goto err_suspend; }return 0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 23/81 arm64: dts: rockchip: fix Rockpro64 RK808 interrupt line
In reply to Sasha LevinFrom: Hugh Cole-Baker <[email protected]>
[ Upstream commit deea9f5fc32040fd6f6132f2260ba410fb5cf98c ]
Fix the pinctrl and interrupt specifier for RK808 to use GPIO3_B2. On the Rockpro64 schematic [1] page 16, it shows GPIO3_B2 used for the interrupt line PMIC_INT_L from the RK808, and there's a note which translates as:
"PMU termination GPIO1_C5 changed to this".
Tested by setting an RTC wakealarm and checking /proc/interrupts counters. Without this patch, neither the rockchip_gpio_irq counter for the RK808, nor the RTC alarm counter increment when the alarm time is reached. With this patch, both interrupt counters increment by 1 as expected.
[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf
--- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +3 -3
@@ -240,8 +240,8 @@ rk808: pmic@1b { compatible = "rockchip,rk808"; reg = <0x1b>; - interrupt-parent = <&gpio1>; - interrupts = <21 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <10 IRQ_TYPE_LEVEL_LOW>; #clock-cells = <1>; clock-output-names = "xin32k", "rk808-clkout2"; pinctrl-names = "default";
@@ -567,7 +567,7 @@ pmic { pmic_int_l: pmic-int-l { - rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; + rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>; }; vsel1_gpio: vsel1-gpio {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 25/81 arm64: dts: rockchip: fix RockPro64 vdd-log regulator settings
In reply to Sasha LevinFrom: Soeren Moch <[email protected]>
[ Upstream commit 0990c5e7573098117c69651821647c228483e31b ]
The RockPro64 schematic [1] page 18 states a min voltage of 0.8V and a max voltage of 1.4V for the VDD_LOG pwm regulator. However, there is an additional note that the pwm parameter needs to be modified. From the schematics a voltage range of 0.8V to 1.7V can be calculated. Additional voltage measurements on the board show that this fix indeed leads to the correct voltage, while without this fix the voltage was set too high.
[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf
--- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +1 -1
@@ -166,7 +166,7 @@ regulator-always-on; regulator-boot-on; regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1400000>; + regulator-max-microvolt = <1700000>; vin-supply = <&vcc5v0_sys>; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 26/81 arm64: dts: rockchip: fix RockPro64 sdhci settings
In reply to Sasha LevinFrom: Soeren Moch <[email protected]>
[ Upstream commit 2558b3b1b11a1b32b336be2dd0aabfa6d35ddcb5 ]
The RockPro64 schematics [1], [2] show that the rk3399 EMMC_STRB pin is connected to the RESET pin instead of the DATA_STROBE pin of the eMMC module. So the data strobe cannot be used for its intended purpose on this board, and so the HS400 eMMC mode is not functional. Limit the controller to HS200.
[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf
[2] http://files.pine64.org/doc/rock64/PINE64_eMMC_Module_20170719.pdf
--- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +1 -2
@@ -625,8 +625,7 @@ &sdhci { bus-width = <8>; - mmc-hs400-1_8v; - mmc-hs400-enhanced-strobe; + mmc-hs200-1_8v; non-removable; status = "okay"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 30/81 ARM: dts: am3874-iceboard: Fix 'i2c-mux-idle-disconnect' usage
In reply to Sasha LevinFrom: Andrey Smirnov <[email protected]>
[ Upstream commit 647c8977e111c0a62c93a489ebc4b045c833fdb4 ]
According to Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt, i2c-mux-idle-disconnect is a property of a parent node since it pertains to the mux/switch as a whole, so move it there and drop all of the concurrences in child nodes.
--- arch/arm/boot/dts/am3874-iceboard.dts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
arch/arm/boot/dts/am3874-iceboard.dts +1 -8
@@ -111,13 +111,13 @@ reg = <0x70>; #address-cells = <1>; #size-cells = <0>; + i2c-mux-idle-disconnect; i2c@0 { /* FMC A */ #address-cells = <1>; #size-cells = <0>; reg = <0>; - i2c-mux-idle-disconnect; }; i2c@1 {
@@ -125,7 +125,6 @@ #address-cells = <1>; #size-cells = <0>; reg = <1>; - i2c-mux-idle-disconnect; }; i2c@2 {
@@ -133,7 +132,6 @@ #address-cells = <1>; #size-cells = <0>; reg = <2>; - i2c-mux-idle-disconnect; }; i2c@3 {
@@ -141,7 +139,6 @@ #address-cells = <1>; #size-cells = <0>; reg = <3>; - i2c-mux-idle-disconnect; }; i2c@4 {
@@ -149,14 +146,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <4>; - i2c-mux-idle-disconnect; }; i2c@5 { #address-cells = <1>; #size-cells = <0>; reg = <5>; - i2c-mux-idle-disconnect; ina230@40 { compatible = "ti,ina230"; reg = <0x40>; shunt-resistor = <5000>; }; ina230@41 { compatible = "ti,ina230"; reg = <0x41>; shunt-resistor = <5000>; };
@@ -182,14 +177,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <6>; - i2c-mux-idle-disconnect; }; i2c@7 { #address-cells = <1>; #size-cells = <0>; reg = <7>; - i2c-mux-idle-disconnect; u41: pca9575@20 { compatible = "nxp,pca9575";
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 33/81 ARM: dts: Use level interrupt for omap4 & 5 wlcore
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 087a2b7ec973f6f30f6e7b72cb50b6f7734ffdd2 ]
Commit 572cf7d7b07d ("ARM: dts: Improve omap l4per idling with wlcore edge sensitive interrupt") changed wlcore interrupts to use edge interrupt based on what's specified in the wl1835mod.pdf data sheet.
However, there are still cases where we can have lost interrupts as described in omap_gpio_unidle(). And using a level interrupt instead of edge interrupt helps as we avoid the check for untriggered GPIO interrupts in omap_gpio_unidle().
And with commit e6818d29ea15 ("gpio: gpio-omap: configure edge detection for level IRQs for idle wakeup") GPIOs idle just fine with level interrupts.
Let's change omap4 and 5 wlcore users back to using level interrupt instead of edge interrupt. Let's not change the others as I've only seen this on omap4 and 5, probably because the other SoCs don't have l4per idle independent of the CPUs.
Depends-on: e6818d29ea15 ("gpio: gpio-omap: configure edge detection for level IRQs for idle wakeup")
--- arch/arm/boot/dts/omap4-droid4-xt894.dts | 2 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 2 +- arch/arm/boot/dts/omap4-sdp.dts | 2 +- arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi | 2 +- arch/arm/boot/dts/omap5-board-common.dtsi | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/omap4-droid4-xt894.dts +1 -1
@@ -369,7 +369,7 @@ compatible = "ti,wl1285", "ti,wl1283"; reg = <2>; /* gpio_100 with gpmc_wait2 pad as wakeirq */ - interrupts-extended = <&gpio4 4 IRQ_TYPE_EDGE_RISING>, + interrupts-extended = <&gpio4 4 IRQ_TYPE_LEVEL_HIGH>, <&omap4_pmx_core 0x4e>; interrupt-names = "irq", "wakeup"; ref-clock-frequency = <26000000>;
arch/arm/boot/dts/omap4-panda-common.dtsi +1 -1
@@ -474,7 +474,7 @@ compatible = "ti,wl1271"; reg = <2>; /* gpio_53 with gpmc_ncs3 pad as wakeup */ - interrupts-extended = <&gpio2 21 IRQ_TYPE_EDGE_RISING>, + interrupts-extended = <&gpio2 21 IRQ_TYPE_LEVEL_HIGH>, <&omap4_pmx_core 0x3a>; interrupt-names = "irq", "wakeup"; ref-clock-frequency = <38400000>;
arch/arm/boot/dts/omap4-sdp.dts +1 -1
@@ -512,7 +512,7 @@ compatible = "ti,wl1281"; reg = <2>; interrupt-parent = <&gpio1>; - interrupts = <21 IRQ_TYPE_EDGE_RISING>; /* gpio 53 */ + interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */ ref-clock-frequency = <26000000>; tcxo-clock-frequency = <26000000>; };
arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi +1 -1
@@ -69,7 +69,7 @@ compatible = "ti,wl1271"; reg = <2>; interrupt-parent = <&gpio2>; - interrupts = <9 IRQ_TYPE_EDGE_RISING>; /* gpio 41 */ + interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; /* gpio 41 */ ref-clock-frequency = <38400000>; }; };
arch/arm/boot/dts/omap5-board-common.dtsi +1 -1
@@ -362,7 +362,7 @@ pinctrl-names = "default"; pinctrl-0 = <&wlcore_irq_pin>; interrupt-parent = <&gpio1>; - interrupts = <14 IRQ_TYPE_EDGE_RISING>; /* gpio 14 */ + interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; /* gpio 14 */ ref-clock-frequency = <26000000>; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 41/81 arm64: dts: rockchip: fix RockPro64 sdmmc settings
In reply to Sasha LevinFrom: Soeren Moch <[email protected]>
[ Upstream commit 5234c14531152702a9f3e575cb552b7e9cea9f94 ]
According to the RockPro64 schematic [1] the rk3399 sdmmc controller is connected to a microSD (TF card) slot. Remove the cap-mmc-highspeed property of the sdmmc controller, since no mmc card can be connected here.
[1] http://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf
--- arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +0 -1
@@ -613,7 +613,6 @@ &sdmmc { bus-width = <4>; - cap-mmc-highspeed; cap-sd-highspeed; cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; disable-wp;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 42/81 arm64: dts: rockchip: Fix usb-c on Hugsun X99 TV Box
In reply to Sasha LevinFrom: Vivek Unune <[email protected]>
[ Upstream commit 389206e806d892d36de0df6e7b07721432957801 ]
Fix usb-c on X99 TV Box. Tested with armbian w/ kernel 5.3
--- arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts +2 -2
@@ -644,7 +644,7 @@ status = "okay"; u2phy0_host: host-port { - phy-supply = <&vcc5v0_host>; + phy-supply = <&vcc5v0_typec>; status = "okay"; };
@@ -712,7 +712,7 @@ &usbdrd_dwc3_0 { status = "okay"; - dr_mode = "otg"; + dr_mode = "host"; }; &usbdrd3_1 {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 55/81 drm/amdgpu: fix potential VM faults
In reply to Sasha LevinFrom: Christian König <[email protected]>
[ Upstream commit 3122051edc7c27cc08534be730f4c7c180919b8a ]
When we allocate new page tables under memory pressure we should not evict old ones.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
@@ -421,7 +421,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev, .interruptible = (bp->type != ttm_bo_type_kernel), .no_wait_gpu = false, .resv = bp->resv, - .flags = TTM_OPT_FLAG_ALLOW_RES_EVICT + .flags = bp->type != ttm_bo_type_kernel ? +TTM_OPT_FLAG_ALLOW_RES_EVICT :0 };struct amdgpu_bo *bo;unsigned long page_align, size = bp->size;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 56/81 drm/amdgpu: fix error handling in amdgpu_bo_list_create
In reply to Sasha LevinFrom: Christian König <[email protected]>
[ Upstream commit de51a5019ff32960218da8fd899fa3f361b031e9 ]
We need to drop normal and userptr BOs separately.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +6 -1
@@ -140,7 +140,12 @@ int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp,return 0 ; error_free: -while (i--) { +for (i =0 ; i < last_entry; ++i) { +struct amdgpu_bo *bo =ttm_to_amdgpu_bo (array[i].tv.bo); + +amdgpu_bo_unref (&bo); + } +for (i = first_userptr; i < num_entries; ++i) {struct amdgpu_bo *bo =ttm_to_amdgpu_bo (array[i].tv.bo);amdgpu_bo_unref (&bo);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 57/81 scsi: target: core: Do not overwrite CDB byte 1
In reply to Sasha LevinFrom: Bodo Stroesser <[email protected]>
[ Upstream commit 27e84243cb63601a10e366afe3e2d05bb03c1cb5 ]
passthrough_parse_cdb() - used by TCMU and PSCSI - attepts to reset the LUN field of SCSI-2 CDBs (bits 5,6,7 of byte 1). The current code is wrong as for newer commands not having the LUN field it overwrites relevant command bits (e.g. for SECURITY PROTOCOL IN / OUT). We think this code was unnecessary from the beginning or at least it is no longer useful. So we remove it entirely.
--- drivers/target/target_core_device.c | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/target/target_core_device.c +0 -21
@@ -1074,27 +1074,6 @@ passthrough_parse_cdb(struct se_cmd *cmd,struct se_device *dev = cmd->se_dev;unsigned int size; -/* -* Clear a lun set in the cdb if the initiator talking to use spoke -* and old standards version, as we can't assume the underlying device -* won't choke up on it. -*/ -switch (cdb[0 ]) { -case READ_10 :/* SBC - RDProtect */ -case READ_12 :/* SBC - RDProtect */ -case READ_16 :/* SBC - RDProtect */ -case SEND_DIAGNOSTIC :/* SPC - SELF-TEST Code */ -case VERIFY :/* SBC - VRProtect */ -case VERIFY_16 :/* SBC - VRProtect */ -case WRITE_VERIFY :/* SBC - VRProtect */ -case WRITE_VERIFY_12 :/* SBC - VRProtect */ -case MAINTENANCE_IN :/* SPC - Parameter Data Format for SA RTPG */ -break ; -default : - cdb[1 ] &=0x1f ;/* clear logical unit number */ -break ; - } -/* * For REPORT LUNS we always need to emulate the response, for everything * else, pass it up.
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 63/81 i2c: aspeed: fix master pending state handling
In reply to Sasha LevinFrom: Jae Hyun Yoo <[email protected]>
[ Upstream commit 1f0d9cbeec9bb0a1c2013342836f2c9754d6502b ]
In case of master pending state, it should not trigger a master command, otherwise data could be corrupted because this H/W shares the same data buffer for slave and master operations. It also means that H/W command queue handling is unreliable because of the buffer sharing issue. To fix this issue, it clears command queue if a master command is queued in pending state to use S/W solution instead of H/W command queue handling. Also, it refines restarting mechanism of the pending master command.
--- drivers/i2c/busses/i2c-aspeed.c | 54 +++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 20 deletions(-)
drivers/i2c/busses/i2c-aspeed.c +34 -20
@@ -108,6 +108,12 @@#define ASPEED_I2CD_S_TX_CMD BIT(2)#define ASPEED_I2CD_M_TX_CMD BIT(1)#define ASPEED_I2CD_M_START_CMD BIT(0) +#define ASPEED_I2CD_MASTER_CMDS_MASK \ + (ASPEED_I2CD_M_STOP_CMD | \ + ASPEED_I2CD_M_S_RX_CMD_LAST | \ + ASPEED_I2CD_M_RX_CMD | \ + ASPEED_I2CD_M_TX_CMD | \ + ASPEED_I2CD_M_START_CMD)/* 0x18 : I2CD Slave Device Address Register */ #define ASPEED_I2CD_DEV_ADDR_MASK GENMASK(6, 0)
@@ -336,18 +342,19 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus)struct i2c_msg *msg = &bus->msgs[bus->msgs_index];u8 slave_addr =i2c_8bit_addr_from_msg (msg); - bus->master_state =ASPEED_I2C_MASTER_START ; -#if IS_ENABLED (CONFIG_I2C_SLAVE )/* * If it's requested in the middle of a slave session, set the master * state to 'pending' then H/W will continue handling this master * command when the bus comes back to the idle state. */ -if (bus->slave_state !=ASPEED_I2C_SLAVE_INACTIVE ) +if (bus->slave_state !=ASPEED_I2C_SLAVE_INACTIVE ) { bus->master_state =ASPEED_I2C_MASTER_PENDING ; +return ; + }#endif /* CONFIG_I2C_SLAVE */ + bus->master_state =ASPEED_I2C_MASTER_START ; bus->buf_index =0 ;if (msg->flags &I2C_M_RD ) {
@@ -422,20 +429,6 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status) } } -#if IS_ENABLED (CONFIG_I2C_SLAVE ) -/* -* A pending master command will be started by H/W when the bus comes -* back to idle state after completing a slave operation so change the -* master state from 'pending' to 'start' at here if slave is inactive. -*/ -if (bus->master_state ==ASPEED_I2C_MASTER_PENDING ) { -if (bus->slave_state !=ASPEED_I2C_SLAVE_INACTIVE ) - goto out_no_complete; - - bus->master_state =ASPEED_I2C_MASTER_START ; - } -#endif /* CONFIG_I2C_SLAVE */ -/* Master is not currently active, irq was for someone else. */ if (bus->master_state ==ASPEED_I2C_MASTER_INACTIVE || bus->master_state ==ASPEED_I2C_MASTER_PENDING )
@@ -462,11 +455,15 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)#if IS_ENABLED (CONFIG_I2C_SLAVE )/* * If a peer master starts a xfer immediately after it queues a -* master command, change its state to 'pending' then H/W will -* continue the queued master xfer just after completing the -* slave mode session. +* master command, clear the queued master command and change +* its state to 'pending'. To simplify handling of pending +* cases, it uses S/W solution instead of H/W command queue +* handling. */ if (unlikely (irq_status &ASPEED_I2CD_INTR_SLAVE_MATCH )) { +writel (readl (bus->base +ASPEED_I2C_CMD_REG ) & + ~ASPEED_I2CD_MASTER_CMDS_MASK , + bus->base +ASPEED_I2C_CMD_REG ); bus->master_state =ASPEED_I2C_MASTER_PENDING ;dev_dbg (bus->dev,"master goes pending due to a slave start\n" );
@@ -629,6 +626,14 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) irq_handled |=aspeed_i2c_master_irq (bus, irq_remaining); } + +/* +* Start a pending master command at here if a slave operation is +* completed. +*/ +if (bus->master_state ==ASPEED_I2C_MASTER_PENDING && + bus->slave_state ==ASPEED_I2C_SLAVE_INACTIVE ) +aspeed_i2c_do_start (bus);#else irq_handled =aspeed_i2c_master_irq (bus, irq_remaining);#endif /* CONFIG_I2C_SLAVE */
@@ -691,6 +696,15 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap, ASPEED_I2CD_BUS_BUSY_STS))aspeed_i2c_recover_bus (bus ); +/* +* If timed out and the state is still pending, drop the pending +* master command. +*/ +spin_lock_irqsave (&bus->lock, flags); +if (bus->master_state ==ASPEED_I2C_MASTER_PENDING ) + bus->master_state =ASPEED_I2C_MASTER_INACTIVE ; +spin_unlock_irqrestore (&bus->lock, flags); +return -ETIMEDOUT ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 1/81 regulator: of: fix suspend-min/max-voltage parsing
From: Marco Felsch <[email protected]>
[ Upstream commit 131cb1210d4b58acb0695707dad2eb90dcb50a2a ]
Currently the regulator-suspend-min/max-microvolt must be within the root regulator node but the dt-bindings specifies it as subnode properties for the regulator-state-[mem/disk/standby] node. The only DT using this bindings currently is the at91-sama5d2_xplained.dts and this DT uses it correctly. I don't know if it isn't tested but it can't work without this fix.
--- drivers/regulator/of_regulator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/regulator/of_regulator.c +4 -4
@@ -231,12 +231,12 @@ static int of_get_regulation_constraints(struct device *dev, "regulator-off-in-suspend")) suspend_state->enabled =DISABLE_IN_SUSPEND ; -if (!of_property_read_u32 (np,"regulator-suspend-min-microvolt" , - &pval)) +if (!of_property_read_u32 (suspend_np, +"regulator-suspend-min-microvolt" , &pval)) suspend_state->min_uV = pval; -if (!of_property_read_u32 (np,"regulator-suspend-max-microvolt" , - &pval)) +if (!of_property_read_u32 (suspend_np, +"regulator-suspend-max-microvolt" , &pval)) suspend_state->max_uV = pval; if (!of_property_read_u32(suspend_np,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 2/81 ASoC: samsung: arndale: Add missing OF node dereferencing
From: Sylwester Nawrocki <[email protected]>
[ Upstream commit fb629fa2587d0c150792d87e3053664bfc8dc78c ]
Ensure there is no OF node references kept when the driver is removed/unbound.
--- sound/soc/samsung/arndale_rt5631.c | 34 ++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-)
sound/soc/samsung/arndale_rt5631.c +30 -4
@@ -5,6 +5,7 @@// Author: Claude <[email protected]> #include <linux/module.h> +#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/clk.h>
@@ -74,6 +75,17 @@ static struct snd_soc_card arndale_rt5631 = { .num_links = ARRAY_SIZE(arndale_rt5631_dai), }; +static void arndale_put_of_nodes (struct snd_soc_card *card) +{ +struct snd_soc_dai_link *dai_link; +int i; + +for_each_card_prelinks (card, i, dai_link) { +of_node_put (dai_link->cpus->of_node); +of_node_put (dai_link->codecs->of_node); + } +} +static int arndale_audio_probe (struct platform_device *pdev) {int n, ret;
@@ -103,18 +115,31 @@ static int arndale_audio_probe(struct platform_device *pdev)if (!arndale_rt5631_dai[0 ].codecs->of_node) {dev_err (&pdev->dev,"Property 'samsung,audio-codec' missing or invalid\n" ); -return -EINVAL ; + ret = -EINVAL ; + goto err_put_of_nodes; } } ret =devm_snd_soc_register_card (card->dev, card); +if (ret) { +dev_err (&pdev->dev,"snd_soc_register_card() failed: %d\n" , ret); + goto err_put_of_nodes; + } +return 0 ; -if (ret) -dev_err (&pdev->dev,"snd_soc_register_card() failed:%d\n" , ret); - +err_put_of_nodes: +arndale_put_of_nodes (card);return ret; } +static int arndale_audio_remove (struct platform_device *pdev) +{ +struct snd_soc_card *card =platform_get_drvdata (pdev); + +arndale_put_of_nodes (card); +return 0 ; +} +static const struct of_device_id samsung_arndale_rt5631_of_match[]__maybe_unused = { { .compatible ="samsung,arndale-rt5631" , }, { .compatible ="samsung,arndale-alc5631" , },
@@ -129,6 +154,7 @@ static struct platform_driver arndale_audio_driver = { .of_match_table = of_match_ptr(samsung_arndale_rt5631_of_match), }, .probe = arndale_audio_probe, + .remove = arndale_audio_remove, };module_platform_driver (arndale_audio_driver);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/81 ASoC: wm8994: Do not register inapplicable controls for WM1811
In reply to Sasha LevinFrom: Sylwester Nawrocki <[email protected]>
[ Upstream commit ca2347190adb5e4eece73a2b16e96e651c46246b ]
In case of WM1811 device there are currently being registered controls referring to registers not existing on that device.
It has been noticed when getting values of "AIF1ADC2 Volume", "AIF1DAC2 Volume" controls was failing during ALSA state restoring at boot time:
"amixer: Mixer hw:0 load error: Device or resource busy"
Reading some registers through I2C was failing with EBUSY error and indeed these registers were not available according to the datasheet.
To fix this controls not available on WM1811 are moved to a separate array and registered only for WM8994 and WM8958.
There are some further differences between WM8994 and WM1811, e.g. registers 603h, 604h, 605h, which are not covered in this patch.
--- sound/soc/codecs/wm8994.c | 43 +++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-)
sound/soc/codecs/wm8994.c +26 -17
@@ -533,13 +533,10 @@ static SOC_ENUM_SINGLE_DECL(dac_osr, static SOC_ENUM_SINGLE_DECL(adc_osr, WM8994_OVERSAMPLING, 1, osr_text); -static const struct snd_kcontrol_new wm8994_snd_controls[] = { +static const struct snd_kcontrol_new wm8994_common_snd_controls[] = {SOC_DOUBLE_R_TLV ("AIF1ADC1 Volume" ,WM8994_AIF1_ADC1_LEFT_VOLUME ,WM8994_AIF1_ADC1_RIGHT_VOLUME ,1 ,119 ,0 , digital_tlv), -SOC_DOUBLE_R_TLV ("AIF1ADC2 Volume" ,WM8994_AIF1_ADC2_LEFT_VOLUME , -WM8994_AIF1_ADC2_RIGHT_VOLUME , -1 ,119 ,0 , digital_tlv),SOC_DOUBLE_R_TLV ("AIF2ADC Volume" ,WM8994_AIF2_ADC_LEFT_VOLUME ,WM8994_AIF2_ADC_RIGHT_VOLUME ,1 ,119 ,0 , digital_tlv),
@@ -556,8 +553,6 @@ SOC_ENUM("AIF2DACR Source", aif2dacr_src),SOC_DOUBLE_R_TLV ("AIF1DAC1 Volume" ,WM8994_AIF1_DAC1_LEFT_VOLUME ,WM8994_AIF1_DAC1_RIGHT_VOLUME ,1 ,96 ,0 , digital_tlv), -SOC_DOUBLE_R_TLV ("AIF1DAC2 Volume" ,WM8994_AIF1_DAC2_LEFT_VOLUME , -WM8994_AIF1_DAC2_RIGHT_VOLUME ,1 ,96 ,0 , digital_tlv),SOC_DOUBLE_R_TLV ("AIF2DAC Volume" ,WM8994_AIF2_DAC_LEFT_VOLUME , WM8994_AIF2_DAC_RIGHT_VOLUME, 1, 96, 0, digital_tlv),
@@ -565,17 +560,12 @@ SOC_SINGLE_TLV("AIF1 Boost Volume", WM8994_AIF1_CONTROL_2, 10, 3, 0, aif_tlv),SOC_SINGLE_TLV ("AIF2 Boost Volume" ,WM8994_AIF2_CONTROL_2 ,10 ,3 ,0 , aif_tlv),SOC_SINGLE ("AIF1DAC1 EQ Switch" ,WM8994_AIF1_DAC1_EQ_GAINS_1 ,0 ,1 ,0 ), -SOC_SINGLE ("AIF1DAC2 EQ Switch" ,WM8994_AIF1_DAC2_EQ_GAINS_1 ,0 ,1 ,0 ),SOC_SINGLE ("AIF2 EQ Switch" ,WM8994_AIF2_EQ_GAINS_1 ,0 ,1 ,0 ),WM8994_DRC_SWITCH ("AIF1DAC1 DRC Switch" ,WM8994_AIF1_DRC1_1 ,2 ),WM8994_DRC_SWITCH ("AIF1ADC1L DRC Switch" ,WM8994_AIF1_DRC1_1 ,1 ),WM8994_DRC_SWITCH ("AIF1ADC1R DRC Switch" ,WM8994_AIF1_DRC1_1 ,0 ), -WM8994_DRC_SWITCH ("AIF1DAC2 DRC Switch" ,WM8994_AIF1_DRC2_1 ,2 ), -WM8994_DRC_SWITCH ("AIF1ADC2L DRC Switch" ,WM8994_AIF1_DRC2_1 ,1 ), -WM8994_DRC_SWITCH ("AIF1ADC2R DRC Switch" ,WM8994_AIF1_DRC2_1 ,0 ), -WM8994_DRC_SWITCH ("AIF2DAC DRC Switch" ,WM8994_AIF2_DRC_1 ,2 ),WM8994_DRC_SWITCH ("AIF2ADCL DRC Switch" ,WM8994_AIF2_DRC_1 ,1 ), WM8994_DRC_SWITCH("AIF2ADCR DRC Switch", WM8994_AIF2_DRC_1, 0),
@@ -594,9 +584,6 @@ SOC_SINGLE("Sidetone HPF Switch", WM8994_SIDETONE, 6, 1, 0),SOC_ENUM ("AIF1ADC1 HPF Mode" , aif1adc1_hpf),SOC_DOUBLE ("AIF1ADC1 HPF Switch" ,WM8994_AIF1_ADC1_FILTERS ,12 ,11 ,1 ,0 ), -SOC_ENUM ("AIF1ADC2 HPF Mode" , aif1adc2_hpf), -SOC_DOUBLE ("AIF1ADC2 HPF Switch" ,WM8994_AIF1_ADC2_FILTERS ,12 ,11 ,1 ,0 ), -SOC_ENUM ("AIF2ADC HPF Mode" , aif2adc_hpf), SOC_DOUBLE("AIF2ADC HPF Switch", WM8994_AIF2_ADC_FILTERS, 12, 11, 1, 0),
@@ -637,6 +624,24 @@ SOC_SINGLE("AIF2DAC 3D Stereo Switch", WM8994_AIF2_DAC_FILTERS_2, 8, 1, 0), }; +/* Controls not available on WM1811 */ +static const struct snd_kcontrol_new wm8994_snd_controls[] = { +SOC_DOUBLE_R_TLV ("AIF1ADC2 Volume" ,WM8994_AIF1_ADC2_LEFT_VOLUME , +WM8994_AIF1_ADC2_RIGHT_VOLUME , +1 ,119 ,0 , digital_tlv), +SOC_DOUBLE_R_TLV ("AIF1DAC2 Volume" ,WM8994_AIF1_DAC2_LEFT_VOLUME , +WM8994_AIF1_DAC2_RIGHT_VOLUME ,1 ,96 ,0 , digital_tlv), + +SOC_SINGLE ("AIF1DAC2 EQ Switch" ,WM8994_AIF1_DAC2_EQ_GAINS_1 ,0 ,1 ,0 ), + +WM8994_DRC_SWITCH ("AIF1DAC2 DRC Switch" ,WM8994_AIF1_DRC2_1 ,2 ), +WM8994_DRC_SWITCH ("AIF1ADC2L DRC Switch" ,WM8994_AIF1_DRC2_1 ,1 ), +WM8994_DRC_SWITCH ("AIF1ADC2R DRC Switch" ,WM8994_AIF1_DRC2_1 ,0 ), + +SOC_ENUM ("AIF1ADC2 HPF Mode" , aif1adc2_hpf), +SOC_DOUBLE ("AIF1ADC2 HPF Switch" ,WM8994_AIF1_ADC2_FILTERS ,12 ,11 ,1 ,0 ), +}; +static const struct snd_kcontrol_new wm8994_eq_controls[] = {SOC_SINGLE_TLV ("AIF1DAC1 EQ1 Volume" ,WM8994_AIF1_DAC1_EQ_GAINS_1 ,11 ,31 ,0 , eq_tlv),
@@ -4258,13 +4263,15 @@ static int wm8994_component_probe(struct snd_soc_component *component)wm8994_handle_pdata (wm8994);wm_hubs_add_analogue_controls (component); -snd_soc_add_component_controls (component, wm8994_snd_controls, -ARRAY_SIZE (wm8994_snd_controls)); +snd_soc_add_component_controls (component, wm8994_common_snd_controls, +ARRAY_SIZE (wm8994_common_snd_controls));snd_soc_dapm_new_controls (dapm, wm8994_dapm_widgets,ARRAY_SIZE (wm8994_dapm_widgets));switch (control->type) {case WM8994 : +snd_soc_add_component_controls (component, wm8994_snd_controls, +ARRAY_SIZE (wm8994_snd_controls));snd_soc_dapm_new_controls (dapm, wm8994_specific_dapm_widgets,ARRAY_SIZE (wm8994_specific_dapm_widgets));if (control->revision <4 ) {
@@ -4284,8 +4291,10 @@ static int wm8994_component_probe(struct snd_soc_component *component) }break ;case WM8958 : +snd_soc_add_component_controls (component, wm8994_snd_controls, +ARRAY_SIZE (wm8994_snd_controls));snd_soc_add_component_controls (component, wm8958_snd_controls, -ARRAY_SIZE (wm8958_snd_controls)); +ARRAY_SIZE (wm8958_snd_controls));snd_soc_dapm_new_controls (dapm, wm8958_dapm_widgets,ARRAY_SIZE (wm8958_dapm_widgets));if (control->revision <1 ) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/81 regulator: da9062: fix suspend_enable/disable preparation
In reply to Sasha LevinFrom: Marco Felsch <[email protected]>
[ Upstream commit a72865f057820ea9f57597915da4b651d65eb92f ]
Currently the suspend reg_field maps to the pmic voltage selection bits and is used during suspend_enabe/disable() and during get_mode(). This seems to be wrong for both use cases.
Use case one (suspend_enabe/disable):
Those callbacks are used to mark a regulator device as enabled/disabled during suspend. Marking the regulator enabled during suspend is done by the LDOx_CONF/BUCKx_CONF bit within the LDOx_CONT/BUCKx_CONT registers. Setting this bit tells the DA9062 PMIC state machine to keep the regulator on in POWERDOWN mode and switch to suspend voltage.
Use case two (get_mode):
The get_mode callback is used to retrieve the active mode state. Since the regulator-setting-A is used for the active state and regulator-setting-B for the suspend state there is no need to check which regulator setting is active.
--- drivers/regulator/da9062-regulator.c | 118 +++++++++++---------------- 1 file changed, 47 insertions(+), 71 deletions(-)
drivers/regulator/da9062-regulator.c +47 -71
@@ -136,7 +136,6 @@ static int da9062_buck_set_mode(struct regulator_dev *rdev, unsigned mode)static unsigned da9062_buck_get_mode (struct regulator_dev *rdev) {struct da9062_regulator *regl =rdev_get_drvdata (rdev); -struct regmap_field *field;unsigned int val, mode =0 ;int ret;
@@ -158,18 +157,7 @@ static unsigned da9062_buck_get_mode(struct regulator_dev *rdev)return REGULATOR_MODE_NORMAL ; } -/* Detect current regulator state */ - ret =regmap_field_read (regl->suspend, &val); -if (ret <0 ) -return 0 ; - -/* Read regulator mode from proper register, depending on state */ -if (val) - field = regl->suspend_sleep; -else - field = regl->sleep; - - ret =regmap_field_read (field, &val); + ret =regmap_field_read (regl->sleep, &val);if (ret <0 )return 0 ;
@@ -208,21 +196,9 @@ static int da9062_ldo_set_mode(struct regulator_dev *rdev, unsigned mode)static unsigned da9062_ldo_get_mode (struct regulator_dev *rdev) {struct da9062_regulator *regl =rdev_get_drvdata (rdev); -struct regmap_field *field;int ret, val; -/* Detect current regulator state */ - ret =regmap_field_read (regl->suspend, &val); -if (ret <0 ) -return 0 ; - -/* Read regulator mode from proper register, depending on state */ -if (val) - field = regl->suspend_sleep; -else - field = regl->sleep; - - ret =regmap_field_read (field, &val); + ret =regmap_field_read (regl->sleep, &val);if (ret <0 )return 0 ;
@@ -408,10 +384,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK1_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK1_MODE_MASK)) - 1), - .suspend = REG_FIELD(DA9062AA_DVC_1, - __builtin_ffs((int)DA9062AA_VBUCK1_SEL_MASK) - 1, + .suspend = REG_FIELD(DA9062AA_BUCK1_CONT, + __builtin_ffs((int)DA9062AA_BUCK1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - - __builtin_clz((DA9062AA_VBUCK1_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_BUCK1_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_BUCK2,
@@ -444,10 +420,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK3_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK3_MODE_MASK)) - 1), - .suspend = REG_FIELD(DA9062AA_DVC_1, - __builtin_ffs((int)DA9062AA_VBUCK3_SEL_MASK) - 1, + .suspend = REG_FIELD(DA9062AA_BUCK3_CONT, + __builtin_ffs((int)DA9062AA_BUCK3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - - __builtin_clz((DA9062AA_VBUCK3_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_BUCK3_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_BUCK3,
@@ -480,10 +456,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK4_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK4_MODE_MASK)) - 1), - .suspend = REG_FIELD(DA9062AA_DVC_1, - __builtin_ffs((int)DA9062AA_VBUCK4_SEL_MASK) - 1, + .suspend = REG_FIELD(DA9062AA_BUCK4_CONT, + __builtin_ffs((int)DA9062AA_BUCK4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - - __builtin_clz((DA9062AA_VBUCK4_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_BUCK4_CONF_MASK) - 1), }, { .desc.id = DA9061_ID_LDO1,
@@ -509,10 +485,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO1_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO1_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO1_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO1_CONT , +__builtin_ffs ((int )DA9062AA_LDO1_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO1_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO1_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO1_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
@@ -542,10 +518,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO2_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO2_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO2_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO2_CONT , +__builtin_ffs ((int )DA9062AA_LDO2_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO2_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO2_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO2_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
@@ -575,10 +551,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO3_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO3_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO3_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO3_CONT , +__builtin_ffs ((int )DA9062AA_LDO3_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO3_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO3_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO3_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
@@ -608,10 +584,10 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO4_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO4_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO4_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO4_CONT , +__builtin_ffs ((int )DA9062AA_LDO4_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO4_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO4_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO4_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
@@ -652,10 +628,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK1_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK1_MODE_MASK)) - 1), - .suspend = REG_FIELD(DA9062AA_DVC_1, - __builtin_ffs((int)DA9062AA_VBUCK1_SEL_MASK) - 1, + .suspend = REG_FIELD(DA9062AA_BUCK1_CONT, + __builtin_ffs((int)DA9062AA_BUCK1_CONF_MASK) - 1, sizeof(unsigned int) * 8 - - __builtin_clz((DA9062AA_VBUCK1_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_BUCK1_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK2,
@@ -688,10 +664,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK2_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK2_MODE_MASK)) - 1), - .suspend = REG_FIELD(DA9062AA_DVC_1, - __builtin_ffs((int)DA9062AA_VBUCK2_SEL_MASK) - 1, + .suspend = REG_FIELD(DA9062AA_BUCK2_CONT, + __builtin_ffs((int)DA9062AA_BUCK2_CONF_MASK) - 1, sizeof(unsigned int) * 8 - - __builtin_clz((DA9062AA_VBUCK2_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_BUCK2_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK3,
@@ -724,10 +700,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK3_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK3_MODE_MASK)) - 1), - .suspend = REG_FIELD(DA9062AA_DVC_1, - __builtin_ffs((int)DA9062AA_VBUCK3_SEL_MASK) - 1, + .suspend = REG_FIELD(DA9062AA_BUCK3_CONT, + __builtin_ffs((int)DA9062AA_BUCK3_CONF_MASK) - 1, sizeof(unsigned int) * 8 - - __builtin_clz((DA9062AA_VBUCK3_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_BUCK3_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_BUCK4,
@@ -760,10 +736,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = { __builtin_ffs((int)DA9062AA_BUCK4_MODE_MASK) - 1, sizeof(unsigned int) * 8 - __builtin_clz((DA9062AA_BUCK4_MODE_MASK)) - 1), - .suspend = REG_FIELD(DA9062AA_DVC_1, - __builtin_ffs((int)DA9062AA_VBUCK4_SEL_MASK) - 1, + .suspend = REG_FIELD(DA9062AA_BUCK4_CONT, + __builtin_ffs((int)DA9062AA_BUCK4_CONF_MASK) - 1, sizeof(unsigned int) * 8 - - __builtin_clz((DA9062AA_VBUCK4_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_BUCK4_CONF_MASK) - 1), }, { .desc.id = DA9062_ID_LDO1,
@@ -789,10 +765,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO1_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO1_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO1_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO1_CONT , +__builtin_ffs ((int )DA9062AA_LDO1_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO1_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO1_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO1_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
@@ -822,10 +798,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO2_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO2_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO2_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO2_CONT , +__builtin_ffs ((int )DA9062AA_LDO2_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO2_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO2_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO2_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
@@ -855,10 +831,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO3_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO3_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO3_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO3_CONT , +__builtin_ffs ((int )DA9062AA_LDO3_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO3_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO3_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO3_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
@@ -888,10 +864,10 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {sizeof (unsigned int ) *8 - __builtin_clz((DA9062AA_LDO4_SL_B_MASK)) - 1), .suspend_vsel_reg = DA9062AA_VLDO4_B, - .suspend =REG_FIELD (DA9062AA_DVC_1 , -__builtin_ffs ((int )DA9062AA_VLDO4_SEL_MASK ) -1 , + .suspend =REG_FIELD (DA9062AA_LDO4_CONT , +__builtin_ffs ((int )DA9062AA_LDO4_CONF_MASK ) -1 ,sizeof (unsigned int ) *8 - - __builtin_clz((DA9062AA_VLDO4_SEL_MASK)) - 1), + __builtin_clz(DA9062AA_LDO4_CONF_MASK) - 1), .oc_event = REG_FIELD(DA9062AA_STATUS_D, __builtin_ffs((int)DA9062AA_LDO4_ILIM_MASK) - 1, sizeof(unsigned int) * 8 -
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/81 arm64: dts: allwinner: a64: Drop PMU node
In reply to Sasha LevinFrom: Vasily Khoruzhick <[email protected]>
[ Upstream commit ed3e9406bcbc32f84dc4aa4cb4767852e5ab086c ]
Looks like PMU in A64 is broken, it generates no interrupts at all and as result 'perf top' shows no events.
Tested on Pine64-LTS.
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 --------- 1 file changed, 9 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +0 -9
@@ -142,15 +142,6 @@ clock-output-names = "ext-osc32k"; }; - pmu { - compatible = "arm,cortex-a53-pmu"; - interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>; - interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; - }; - psci { compatible = "arm,psci-0.2"; method = "smc";
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/81 arm64: dts: allwinner: a64: pine64-plus: Add PHY regulator delay
In reply to Sasha LevinFrom: Jernej Skrabec <[email protected]>
[ Upstream commit 2511366797fa6ab4a404b4b000ef7cd262aaafe8 ]
Depending on kernel and bootloader configuration, it's possible that Realtek ethernet PHY isn't powered on properly. According to the datasheet, it needs 30ms to power up and then some more time before it can be used.
Fix that by adding 100ms ramp delay to regulator responsible for powering PHY.
--- arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts +9 -0
@@ -63,3 +63,12 @@ reg = <1>; }; }; + +®_dc1sw { + /* + * Ethernet PHY needs 30ms to properly power up and some more + * to initialize. 100ms should be plenty of time to finish + * whole process. + */ + regulator-enable-ramp-delay = <100000>; +};
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/81 arm64: dts: allwinner: a64: sopine-baseboard: Add PHY regulator delay
In reply to Sasha LevinFrom: Jernej Skrabec <[email protected]>
[ Upstream commit ccdf3aaa27ded6db9a93eed3ca7468bb2353b8fe ]
It turns out that sopine-baseboard needs same fix as pine64-plus for ethernet PHY. Here too Realtek ethernet PHY chip needs additional power on delay to properly initialize. Datasheet mentions that chip needs 30 ms to be properly powered on and that it needs some more time to be initialized.
Fix that by adding 100ms ramp delay to regulator responsible for powering PHY.
Note that issue was found out and fix tested on pine64-lts, but it's basically the same as sopine-baseboard, only layout and connectors differ.
--- .../boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +6 -0
@@ -159,6 +159,12 @@ }; ®_dc1sw { + /* + * Ethernet PHY needs 30ms to properly power up and some more + * to initialize. 100ms should be plenty of time to finish + * whole process. + */ + regulator-enable-ramp-delay = <100000>; regulator-name = "vcc-phy"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 9/81 arm64: dts: Fix gpio to pinmux mapping
In reply to Sasha LevinFrom: Rayagonda Kokatanur <[email protected]>
[ Upstream commit 965f6603e3335a953f4f876792074cb36bf65f7f ]
There are total of 151 non-secure gpio (0-150) and four pins of pinmux (91, 92, 93 and 94) are not mapped to any gpio pin, hence update same in DT.
--- arch/arm64/boot/dts/broadcom/stingray/stingray-pinctrl.dtsi | 5 +++-- arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/broadcom/stingray/stingray-pinctrl.dtsi +3 -2
@@ -42,13 +42,14 @@ pinmux: pinmux@14029c { compatible = "pinctrl-single"; - reg = <0x0014029c 0x250>; + reg = <0x0014029c 0x26c>; #address-cells = <1>; #size-cells = <1>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0xf>; pinctrl-single,gpio-range = < - &range 0 154 MODE_GPIO + &range 0 91 MODE_GPIO + &range 95 60 MODE_GPIO >; range: gpio-range { #pinctrl-single,gpio-range-cells = <3>;
arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +1 -2
@@ -464,8 +464,7 @@ <&pinmux 108 16 27>, <&pinmux 135 77 6>, <&pinmux 141 67 4>, - <&pinmux 145 149 6>, - <&pinmux 151 91 4>; + <&pinmux 145 149 6>; }; i2c1: i2c@e0000 {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/81 regulator: ti-abb: Fix timeout in ti_abb_wait_txdone/ti_abb_clear_all_txdone
In reply to Sasha LevinFrom: Axel Lin <[email protected]>
[ Upstream commit f64db548799e0330897c3203680c2ee795ade518 ]
ti_abb_wait_txdone() may return -ETIMEDOUT when ti_abb_check_txdone() returns true in the latest iteration of the while loop because the timeout value is abb->settling_time + 1. Similarly, ti_abb_clear_all_txdone() may return -ETIMEDOUT when ti_abb_check_txdone() returns false in the latest iteration of the while loop. Fix it.
--- drivers/regulator/ti-abb-regulator.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
drivers/regulator/ti-abb-regulator.c +8 -18
@@ -173,19 +173,14 @@ static int ti_abb_wait_txdone(struct device *dev, struct ti_abb *abb)while (timeout++ <= abb->settling_time) { status =ti_abb_check_txdone (abb);if (status) -break ; +return 0 ;udelay (1 ); } -if (timeout > abb->settling_time) { -dev_warn_ratelimited (dev, -"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , - __func__, timeout,readl (abb->int_base)); -return -ETIMEDOUT ; - } - -return 0 ; +dev_warn_ratelimited (dev,"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , + __func__, timeout,readl (abb->int_base)); +return -ETIMEDOUT ; }/**
@@ -205,19 +200,14 @@ static int ti_abb_clear_all_txdone(struct device *dev, const struct ti_abb *abb) status =ti_abb_check_txdone (abb);if (!status) -break ; +return 0 ;udelay (1 ); } -if (timeout > abb->settling_time) { -dev_warn_ratelimited (dev, -"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , - __func__, timeout,readl (abb->int_base)); -return -ETIMEDOUT ; - } - -return 0 ; +dev_warn_ratelimited (dev,"%s:TRANXDONE timeout(%duS) int=0x%08x\n" , + __func__, timeout,readl (abb->int_base)); +return -ETIMEDOUT ; }/**
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/81 pinctrl: intel: Allocate IRQ chip dynamic
In reply to Sasha LevinFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 57ff2df1b952c7934d7b0e1d3a2ec403ec76edec ]
Keeping the IRQ chip definition static shares it with multiple instances of the GPIO chip in the system. This is bad and now we get this warning from GPIO library:
"detected irqchip that is shared with multiple gpiochips: please fix the driver."
Hence, move the IRQ chip definition from being driver static into the struct intel_pinctrl. So a unique IRQ chip is used for each GPIO chip instance.
Depends-on: 5ff56b015e85 ("pinctrl: intel: Disable GPIO pin interrupts in suspend")
--- drivers/pinctrl/intel/pinctrl-intel.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)
drivers/pinctrl/intel/pinctrl-intel.c +14 -13
@@ -96,6 +96,7 @@ struct intel_pinctrl_context {* @pctldesc: Pin controller description * @pctldev: Pointer to the pin controller device * @chip: GPIO chip in this pin controller +* @irqchip: IRQ chip in this pin controller * @soc: SoC/PCH specific pin configuration data * @communities: All communities in this pin controller * @ncommunities: Number of communities in this pin controller
@@ -108,6 +109,7 @@ struct intel_pinctrl {struct pinctrl_desc pctldesc;struct pinctrl_dev *pctldev;struct gpio_chip chip; +struct irq_chip irqchip;const struct intel_pinctrl_soc_data *soc;struct intel_community *communities;size_t ncommunities;
@@ -1081,16 +1083,6 @@ static irqreturn_t intel_gpio_irq(int irq, void *data)return ret; } -static struct irq_chip intel_gpio_irqchip = { - .name ="intel-gpio" , - .irq_ack = intel_gpio_irq_ack, - .irq_mask = intel_gpio_irq_mask, - .irq_unmask = intel_gpio_irq_unmask, - .irq_set_type = intel_gpio_irq_type, - .irq_set_wake = intel_gpio_irq_wake, - .flags =IRQCHIP_MASK_ON_SUSPEND , -}; -static int intel_gpio_add_pin_ranges (struct intel_pinctrl *pctrl,const struct intel_community *community) {
@@ -1140,12 +1132,22 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq) pctrl->chip = intel_gpio_chip; +/* Setup GPIO chip */ pctrl->chip.ngpio =intel_gpio_ngpio (pctrl); pctrl->chip.label =dev_name (pctrl->dev); pctrl->chip.parent = pctrl->dev; pctrl->chip.base =-1 ; pctrl->irq = irq; +/* Setup IRQ chip */ + pctrl->irqchip.name =dev_name (pctrl->dev); + pctrl->irqchip.irq_ack = intel_gpio_irq_ack; + pctrl->irqchip.irq_mask = intel_gpio_irq_mask; + pctrl->irqchip.irq_unmask = intel_gpio_irq_unmask; + pctrl->irqchip.irq_set_type = intel_gpio_irq_type; + pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake; + pctrl->irqchip.flags =IRQCHIP_MASK_ON_SUSPEND ; + ret =devm_gpiochip_add_data (pctrl->dev, &pctrl->chip, pctrl);if (ret) {dev_err (pctrl->dev,"failed to register gpiochip\n" );
@@ -1175,15 +1177,14 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)return ret; } - ret =gpiochip_irqchip_add (&pctrl->chip, &intel_gpio_irqchip,0 , + ret =gpiochip_irqchip_add (&pctrl->chip, &pctrl->irqchip,0 , handle_bad_irq,IRQ_TYPE_NONE );if (ret) {dev_err (pctrl->dev,"failed to add irqchip\n" );return ret; } -gpiochip_set_chained_irqchip (&pctrl->chip, &intel_gpio_irqchip, irq, -NULL ); +gpiochip_set_chained_irqchip (&pctrl->chip, &pctrl->irqchip, irq,NULL );return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 12/81 ASoC: SOF: loader: fix kernel oops on firmware boot failure
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 798614885a0e1b867ceb0197c30c2d82575c73b0 ]
When we fail to boot the firmware, we encounter a kernel oops in hda_dsp_get_registers(), which is called conditionally in hda_dsp_dump() when the sdev_>boot_complete flag is set.
Setting this flag _after_ dumping the data fixes the issue and does not change the programming flow.
--- sound/soc/sof/loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sof/loader.c +2 -2
@@ -370,10 +370,10 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev) msecs_to_jiffies(sdev->boot_timeout));if (ret ==0 ) {dev_err (sdev->dev,"error: firmware boot failure\n" ); -/* after this point FW_READY msg should be ignored */ - sdev->boot_complete = true;snd_sof_dsp_dbg_dump (sdev,SOF_DBG_REGS |SOF_DBG_MBOX |SOF_DBG_TEXT |SOF_DBG_PCI ); +/* after this point FW_READY msg should be ignored */ + sdev->boot_complete = true;return -EIO ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/81 ASoC: SOF: topology: fix parse fail issue for byte/bool tuple types
In reply to Sasha LevinFrom: Keyon Jie <[email protected]>
[ Upstream commit 2e305a074061121220a2828f97a57d315cf8efba ]
We are using sof_parse_word_tokens() to parse tokens with bool/byte/short/word tuple types, here add the missing check, to fix the parsing failure at byte/bool tuple types.
--- sound/soc/sof/topology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/sof/topology.c +3 -1
@@ -907,7 +907,9 @@ static void sof_parse_word_tokens(struct snd_soc_component *scomp,for (j =0 ; j < count; j++) {/* match token type */ if (!(tokens[j].type ==SND_SOC_TPLG_TUPLE_TYPE_WORD || - tokens[j].type ==SND_SOC_TPLG_TUPLE_TYPE_SHORT )) + tokens[j].type ==SND_SOC_TPLG_TUPLE_TYPE_SHORT || + tokens[j].type ==SND_SOC_TPLG_TUPLE_TYPE_BYTE || + tokens[j].type ==SND_SOC_TPLG_TUPLE_TYPE_BOOL ))continue ;/* match token id */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/81 ASoC: topology: Fix a signedness bug in soc_tplg_dapm_widget_create()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 752c938a5c14b8cbf0ed3ffbfa637fb166255c3f ]
The "template.id" variable is an enum and in this context GCC will treat it as an unsigned int so it can never be less than zero.
--- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-topology.c +1 -1
@@ -1588,7 +1588,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,/* map user to kernel widget ID */ template.id =get_widget_id (le32_to_cpu (w->id)); -if (template.id <0 ) +if ((int )template.id <0 )return template.id;/* strings are allocated here, but used and freed by the widget */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 14/81 ASoC: SOF: Intel: hda: fix warnings during FW load
In reply to Sasha LevinFrom: Kai Vehmanen <[email protected]>
[ Upstream commit 4ff5f6439fe69624e8f7d559915e9b54a6477684 ]
The "snd_pcm_substream" handle was not initialized properly in hda-loader.c for firmware load.
When the HDA DMAs were used to load the firmware, the interrupts related to firmware load also triggered calls to snd_sof_pcm_period_elapsed() on a non-existent ALSA PCM stream.
This caused runtime kernel warnings from
pcm_lib.c:snd_pcm_period_elapsed().
--- sound/soc/sof/intel/hda-loader.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/sof/intel/hda-loader.c +1 -0
@@ -44,6 +44,7 @@ static int cl_stream_prepare(struct snd_sof_dev *sdev, unsigned int format,return -ENODEV ; } hstream = &dsp_stream->hstream; + hstream->substream =NULL ;/* allocate DMA buffer */ ret =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV_SG , &pci->dev, size, dmab);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 15/81 ASoC: SOF: Intel: initialise and verify FW crash dump data.
In reply to Sasha LevinFrom: Liam Girdwood <[email protected]>
[ Upstream commit ff2be865633e6fa523cd2db3b73197d795dec991 ]
FW mailbox offset was not set before use and HDR size was not validated. Fix this.
--- sound/soc/sof/intel/bdw.c | 7 +++++++ sound/soc/sof/intel/byt.c | 6 ++++++ sound/soc/sof/intel/hda.c | 7 +++++++ 3 files changed, 20 insertions(+)
sound/soc/sof/intel/bdw.c +7 -0
@@ -37,6 +37,7 @@#define MBOX_SIZE 0x1000#define MBOX_DUMP_SIZE 0x30#define EXCEPT_OFFSET 0x800 +#define EXCEPT_MAX_HDR_SIZE 0x400/* DSP peripherals */ #define DMAC0_OFFSET 0xFE000
@@ -228,6 +229,11 @@ static void bdw_get_registers(struct snd_sof_dev *sdev,/* note: variable AR register array is not read */ /* then get panic info */ +if (xoops->arch_hdr.totalsize >EXCEPT_MAX_HDR_SIZE ) { +dev_err (sdev->dev,"invalid header size 0x%x. FW oops is bogus\n" , + xoops->arch_hdr.totalsize); +return ; + } offset += xoops->arch_hdr.totalsize;sof_mailbox_read (sdev, offset, panic_info,sizeof (*panic_info));
@@ -588,6 +594,7 @@ static int bdw_probe(struct snd_sof_dev *sdev)/* TODO: add offsets */ sdev->mmio_bar =BDW_DSP_BAR ; sdev->mailbox_bar =BDW_DSP_BAR ; + sdev->dsp_oops_offset =MBOX_OFFSET ;/* PCI base */ mmio = platform_get_resource(pdev, IORESOURCE_MEM,
sound/soc/sof/intel/byt.c +6 -0
@@ -28,6 +28,7 @@#define MBOX_OFFSET 0x144000#define MBOX_SIZE 0x1000#define EXCEPT_OFFSET 0x800 +#define EXCEPT_MAX_HDR_SIZE 0x400/* DSP peripherals */ #define DMAC0_OFFSET 0x098000
@@ -273,6 +274,11 @@ static void byt_get_registers(struct snd_sof_dev *sdev,/* note: variable AR register array is not read */ /* then get panic info */ +if (xoops->arch_hdr.totalsize >EXCEPT_MAX_HDR_SIZE ) { +dev_err (sdev->dev,"invalid header size 0x%x. FW oops is bogus\n" , + xoops->arch_hdr.totalsize); +return ; + } offset += xoops->arch_hdr.totalsize;sof_mailbox_read (sdev, offset, panic_info,sizeof (*panic_info));
sound/soc/sof/intel/hda.c +7 -0
@@ -37,6 +37,8 @@#define IS_CFL (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)#define IS_CNL (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9dc8) +#define EXCEPT_MAX_HDR_SIZE 0x400 +/* * Debug */
@@ -121,6 +123,11 @@ static void hda_dsp_get_registers(struct snd_sof_dev *sdev,/* note: variable AR register array is not read */ /* then get panic info */ +if (xoops->arch_hdr.totalsize >EXCEPT_MAX_HDR_SIZE ) { +dev_err (sdev->dev,"invalid header size 0x%x. FW oops is bogus\n" , + xoops->arch_hdr.totalsize); +return ; + } offset += xoops->arch_hdr.totalsize;sof_block_read (sdev, sdev->mmio_bar, offset, panic_info,sizeof (*panic_info));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 16/81 ASoC: SOF: Intel: hda: Disable DMI L1 entry during capture
In reply to Sasha LevinFrom: Ranjani Sridharan <[email protected]>
[ Upstream commit 43b2ab9009b13bfff47fcc1893de9244b39bdd54 ]
There is a known issue on some Intel platforms which causes pause/release to run into xrun's during capture usecases. The suggested workaround to address the issue is to disable the entry of lower power L1 state in the physical DMI link when there is a capture stream open.
--- sound/soc/sof/intel/Kconfig | 10 +++++++ sound/soc/sof/intel/hda-ctrl.c | 12 +++------ sound/soc/sof/intel/hda-stream.c | 45 +++++++++++++++++++++++++++----- sound/soc/sof/intel/hda.h | 5 +++- 4 files changed, 56 insertions(+), 16 deletions(-)
sound/soc/sof/intel/Kconfig +10 -0
@@ -241,6 +241,16 @@ config SND_SOC_SOF_HDA_AUDIO_CODEC Say Y if you want to enable HDAudio codecs with SOF. If unsure select "N". +config SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 + bool "SOF enable DMI Link L1" + help + This option enables DMI L1 for both playback and capture + and disables known workarounds for specific HDaudio platforms. + Only use to look into power optimizations on platforms not + affected by DMI L1 issues. This option is not recommended. + Say Y if you want to enable DMI Link L1 + If unsure, select "N". + endif ## SND_SOC_SOF_HDA_COMMON config SND_SOC_SOF_HDA_LINK_BASELINE
sound/soc/sof/intel/hda-ctrl.c +4 -8
@@ -139,20 +139,16 @@ void hda_dsp_ctrl_misc_clock_gating(struct snd_sof_dev *sdev, bool enable)*/ int hda_dsp_ctrl_clock_power_gating (struct snd_sof_dev *sdev,bool enable) { -#if IS_ENABLED (CONFIG_SND_SOC_SOF_HDA ) -struct hdac_bus *bus =sof_to_bus (sdev); -#endif u32 val;/* enable/disable audio dsp clock gating */ val = enable ?PCI_CGCTL_ADSPDCGE :0 ;snd_sof_pci_update_bits (sdev,PCI_CGCTL ,PCI_CGCTL_ADSPDCGE , val); -#if IS_ENABLED (CONFIG_SND_SOC_SOF_HDA ) -/* enable/disable L1 support */ - val = enable ?SOF_HDA_VS_EM2_L1SEN :0 ; -snd_hdac_chip_updatel (bus,VS_EM2 ,SOF_HDA_VS_EM2_L1SEN , val); -#endif +/* enable/disable DMI Link L1 support */ + val = enable ?HDA_VS_INTEL_EM2_L1SEN :0 ; +snd_sof_dsp_update_bits (sdev,HDA_DSP_HDA_BAR ,HDA_VS_INTEL_EM2 , +HDA_VS_INTEL_EM2_L1SEN , val);/* enable/disable audio dsp power gating */ val = enable ?0 :PCI_PGCTL_ADSPPGD ;
sound/soc/sof/intel/hda-stream.c +38 -7
67 lines not on this page · raw message
sound/soc/sof/intel/hda.h +4 -1
@@ -39,7 +39,6 @@#define SOF_HDA_WAKESTS 0x0E#define SOF_HDA_WAKESTS_INT_MASK ((1 << 8) - 1)#define SOF_HDA_RIRBSTS 0x5d -#define SOF_HDA_VS_EM2_L1SEN BIT(13)/* SOF_HDA_GCTL register bist */ #define SOF_HDA_GCTL_RESET BIT(0)
@@ -228,6 +227,10 @@#define HDA_DSP_REG_HIPCIE (HDA_DSP_IPC_BASE + 0x0C)#define HDA_DSP_REG_HIPCCTL (HDA_DSP_IPC_BASE + 0x10) +/* Intel Vendor Specific Registers */ +#define HDA_VS_INTEL_EM2 0x1030 +#define HDA_VS_INTEL_EM2_L1SEN BIT(13) +/* HIPCI */ #define HDA_DSP_REG_HIPCI_BUSY BIT(31)#define HDA_DSP_REG_HIPCI_MSG_MASK 0x7FFFFFFF
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/81 ASoC: rt5682: add NULL handler to set_jack function
In reply to Sasha LevinFrom: Jaska Uimonen <[email protected]>
[ Upstream commit a315e76fc544f09daf619530a7b2f85865e6b25e ]
Implement NULL handler in set_jack function to disable irq's.
--- sound/soc/codecs/rt5682.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
sound/soc/codecs/rt5682.c +10 -2
@@ -995,6 +995,16 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component, {struct rt5682_priv *rt5682 =snd_soc_component_get_drvdata (component); + rt5682->hs_jack = hs_jack; + +if (!hs_jack) { +regmap_update_bits (rt5682->regmap,RT5682_IRQ_CTRL_2 , +RT5682_JD1_EN_MASK ,RT5682_JD1_DIS ); +regmap_update_bits (rt5682->regmap,RT5682_RC_CLK_CTRL , +RT5682_POW_JDH |RT5682_POW_JDL ,0 ); +return 0 ; + } +switch (rt5682->pdata.jd_src) {case RT5682_JD1 : snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_2,
@@ -1032,8 +1042,6 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component,break ; } - rt5682->hs_jack = hs_jack; -return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 18/81 ASoC: intel: sof_rt5682: add remove function to disable jack
In reply to Sasha LevinFrom: Jaska Uimonen <[email protected]>
[ Upstream commit 6ba5041c23c1062d4e8287b2b76a1181538c6df1 ]
When removing sof module the rt5682 jack handler will oops if jack detection is not disabled. So add remove function, which disables the jack detection.
--- sound/soc/intel/boards/sof_rt5682.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
sound/soc/intel/boards/sof_rt5682.c +16 -0
@@ -618,8 +618,24 @@ static int sof_audio_probe(struct platform_device *pdev) &sof_audio_card_rt5682); } +static int sof_rt5682_remove (struct platform_device *pdev) +{ +struct snd_soc_card *card =platform_get_drvdata (pdev); +struct snd_soc_component *component =NULL ; + +for_each_card_components (card, component) { +if (!strcmp (component->name, rt5682_component[0 ].name)) { +snd_soc_component_set_jack (component,NULL ,NULL ); +break ; + } + } + +return 0 ; +} +static struct platform_driver sof_audio = { .probe = sof_audio_probe, + .remove = sof_rt5682_remove, .driver = { .name ="sof_rt5682" , .pm = &snd_soc_pm_ops,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 19/81 ASoC: intel: bytcr_rt5651: add null check to support_button_press
In reply to Sasha LevinFrom: Jaska Uimonen <[email protected]>
[ Upstream commit 2bdf194e2030fce4f2e91300817338353414ab3b ]
When removing sof module the support_button_press function will oops because hp_jack pointer is not checked for NULL. So add a check to fix this.
--- sound/soc/codecs/rt5651.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/codecs/rt5651.c +3 -0
@@ -1770,6 +1770,9 @@ static int rt5651_detect_headset(struct snd_soc_component *component)static bool rt5651_support_button_press (struct rt5651_priv *rt5651) { +if (!rt5651->hp_jack) +return false; +/* Button press support only works with internal jack-detection */ return (rt5651->hp_jack->status &SND_JACK_MICROPHONE ) && rt5651->gpiod_hp_det ==NULL ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 21/81 ASoC: wm_adsp: Don't generate kcontrols without READ flags
In reply to Sasha LevinFrom: Stuart Henderson <[email protected]>
[ Upstream commit 3ae7359c0e39f42a96284d6798fc669acff38140 ]
User space always expects to be able to read ALSA controls, so ensure no kcontrols are generated without an appropriate READ flag. In the case of a read of such a control zeros will be returned.
--- sound/soc/codecs/wm_adsp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/wm_adsp.c +1 -2
@@ -1259,8 +1259,7 @@ static unsigned int wmfw_convert_flags(unsigned int in, unsigned int len) }if (in) { -if (in &WMFW_CTL_FLAG_READABLE ) - out |= rd; + out |= rd;if (in &WMFW_CTL_FLAG_WRITEABLE ) out |= wr;if (in &WMFW_CTL_FLAG_VOLATILE )
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 24/81 ARM: dts: logicpd-torpedo-som: Remove twl_keypad
In reply to Sasha LevinFrom: Adam Ford <[email protected]>
[ Upstream commit 6b512b0ee091edcb8e46218894e4c917d919d3dc ]
The TWL4030 used on the Logit PD Torpedo SOM does not have the keypad pins routed. This patch disables the twl_keypad driver to remove some splat during boot:
twl4030_keypad 48070000.i2c:twl@48:keypad: missing or malformed property linux,keymap: -22 twl4030_keypad 48070000.i2c:twl@48:keypad: Failed to build keymaptwl4030_keypad: probe of 48070000.i2c:twl@48:keypad failed with error -22
--- arch/arm/boot/dts/logicpd-torpedo-som.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/logicpd-torpedo-som.dtsi +4 -0
@@ -192,3 +192,7 @@ &twl_gpio { ti,use-leds; }; + +&twl_keypad { + status = "disabled"; +};
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 27/81 pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 39b65fbb813089e366b376bd8acc300b6fd646dc ]
The pinctrl->functions[] array has pinctrl->num_functions elements and the pinctrl->groups[] array is the same way. These are set in ns2_pinmux_probe(). So the > comparisons should be >= so that we don't read one element beyond the end of the array.
--- drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/bcm/pinctrl-ns2-mux.c +2 -2
@@ -640,8 +640,8 @@ static int ns2_pinmux_enable(struct pinctrl_dev *pctrl_dev,const struct ns2_pin_function *func;const struct ns2_pin_group *grp; -if (grp_select > pinctrl->num_groups || - func_select > pinctrl->num_functions) +if (grp_select >= pinctrl->num_groups || + func_select >= pinctrl->num_functions)return -EINVAL ; func = &pinctrl->functions[func_select];
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 28/81 pinctrl: stmfx: fix null pointer on remove
In reply to Sasha LevinFrom: Amelie Delaunay <[email protected]>
[ Upstream commit 2fd215b8fdbe4d3a609adbe3a323696393cb1e53 ]
dev_get_platdata(&pdev->dev) returns a pointer on struct stmfx_pinctrl, not on struct stmfx (platform_set_drvdata(pdev, pctl); in probe). Pointer on struct stmfx is stored in driver data of pdev parent (in probe:
struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);).
--- drivers/pinctrl/pinctrl-stmfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-stmfx.c +1 -1
@@ -697,7 +697,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)static int stmfx_pinctrl_remove (struct platform_device *pdev) { -struct stmfx *stmfx =dev_get_platdata (&pdev->dev); +struct stmfx *stmfx =dev_get_drvdata (pdev->dev.parent); return stmfx_function_disable(stmfx, STMFX_FUNC_GPIO |
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 29/81 arm64: dts: zii-ultra: fix ARM regulator states
In reply to Sasha LevinFrom: Lucas Stach <[email protected]>
[ Upstream commit 21094ba5c1f4b15df096e8f6247a50b6ab57c869 ]
The GPIO controlled regulator for the ARM power supply is supplying the higher voltage when the GPIO is driven high. This is opposite to the similar regulator setup on the EVK board and is impacting stability of the board as the ARM domain has been supplied with a too low voltage when to faster OPPs are in use.
--- arch/arm64/boot/dts/freescale/imx8mq-zii-ultra.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mq-zii-ultra.dtsi +2 -2
@@ -101,8 +101,8 @@ regulator-min-microvolt = <900000>; regulator-max-microvolt = <1000000>; gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; - states = <1000000 0x0 - 900000 0x1>; + states = <1000000 0x1 + 900000 0x0>; regulator-always-on; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 32/81 ASoC: simple_card_utils.h: Fix potential multiple redefinition error
In reply to Sasha LevinFrom: Daniel Baluta <[email protected]>
[ Upstream commit af6219590b541418d3192e9bfa03989834ca0e78 ]
asoc_simple_debug_info and asoc_simple_debug_dai must be static otherwise we might a compilation error if the compiler decides not to inline the given function.
--- include/sound/simple_card_utils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/sound/simple_card_utils.h +4 -4
@@ -135,9 +135,9 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv, struct link_info *li);#ifdef DEBUG -inline void asoc_simple_debug_dai (struct asoc_simple_priv *priv, -char *name, -struct asoc_simple_dai *dai) +static inline void asoc_simple_debug_dai (struct asoc_simple_priv *priv, +char *name, +struct asoc_simple_dai *dai) {struct device *dev =simple_priv_to_dev (priv);
@@ -167,7 +167,7 @@ inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,dev_dbg (dev,"%s clk %luHz\n" , name,clk_get_rate (dai->clk)); } -inline void asoc_simple_debug_info (struct asoc_simple_priv *priv) +static inline void asoc_simple_debug_info (struct asoc_simple_priv *priv) {struct snd_soc_card *card =simple_priv_to_card (priv);struct device *dev =simple_priv_to_dev (priv);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 31/81 ASoC: msm8916-wcd-digital: add missing MIX2 path for RX1/2
In reply to Sasha LevinFrom: Srinivas Kandagatla <[email protected]>
[ Upstream commit bcab05880f9306e94531b0009c627421db110a74 ]
This patch adds missing MIX2 path on RX1/2 which take IIR1 and IIR2 as inputs.
Without this patch sound card fails to intialize with below warning:
ASoC: no sink widget found for RX1 MIX2 INP1
ASoC: Failed to add route IIR1 -> IIR1 -> RX1 MIX2 INP1
ASoC: no sink widget found for RX2 MIX2 INP1
ASoC: Failed to add route IIR1 -> IIR1 -> RX2 MIX2 INP1
ASoC: no sink widget found for RX1 MIX2 INP1
ASoC: Failed to add route IIR2 -> IIR2 -> RX1 MIX2 INP1
ASoC: no sink widget found for RX2 MIX2 INP1
ASoC: Failed to add route IIR2 -> IIR2 -> RX2 MIX2 INP1
--- sound/soc/codecs/msm8916-wcd-digital.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
sound/soc/codecs/msm8916-wcd-digital.c +22 -0
@@ -243,6 +243,10 @@ static const char *const rx_mix1_text[] = { "ZERO", "IIR1", "IIR2", "RX1", "RX2", "RX3" }; +static const char *const rx_mix2_text[] = { +"ZERO" ,"IIR1" ,"IIR2" +}; +static const char *const dec_mux_text[] = {"ZERO" ,"ADC1" ,"ADC2" ,"ADC3" ,"DMIC1" ,"DMIC2" };
@@ -270,6 +274,16 @@ static const struct soc_enum rx3_mix1_inp_enum[] = { SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B2_CTL, 0, 6, rx_mix1_text), }; +/* RX1 MIX2 */ +static const struct soc_enum rx_mix2_inp1_chain_enum = +SOC_ENUM_SINGLE (LPASS_CDC_CONN_RX1_B3_CTL , +0 ,3 , rx_mix2_text); + +/* RX2 MIX2 */ +static const struct soc_enum rx2_mix2_inp1_chain_enum = +SOC_ENUM_SINGLE (LPASS_CDC_CONN_RX2_B3_CTL , +0 ,3 , rx_mix2_text); +/* DEC */ static const struct soc_enum dec1_mux_enum =SOC_ENUM_SINGLE (LPASS_CDC_CONN_TX_B1_CTL ,0 ,6 , dec_mux_text);
@@ -309,6 +323,10 @@ static const struct snd_kcontrol_new rx3_mix1_inp2_mux = SOC_DAPM_ENUM( "RX3 MIX1 INP2 Mux", rx3_mix1_inp_enum[1]);static const struct snd_kcontrol_new rx3_mix1_inp3_mux =SOC_DAPM_ENUM ("RX3 MIX1 INP3 Mux" , rx3_mix1_inp_enum[2 ]); +static const struct snd_kcontrol_new rx1_mix2_inp1_mux =SOC_DAPM_ENUM ( +"RX1 MIX2 INP1 Mux" , rx_mix2_inp1_chain_enum); +static const struct snd_kcontrol_new rx2_mix2_inp1_mux =SOC_DAPM_ENUM ( +"RX2 MIX2 INP1 Mux" , rx2_mix2_inp1_chain_enum);/* Digital Gain control -38.4 dB to +38.4 dB in 0.3 dB steps */ static const DECLARE_TLV_DB_SCALE(digital_gain, -3840, 30, 0);
@@ -740,6 +758,10 @@ static const struct snd_soc_dapm_widget msm8916_wcd_digital_dapm_widgets[] = { &rx3_mix1_inp2_mux),SND_SOC_DAPM_MUX ("RX3 MIX1 INP3" ,SND_SOC_NOPM ,0 ,0 , &rx3_mix1_inp3_mux), +SND_SOC_DAPM_MUX ("RX1 MIX2 INP1" ,SND_SOC_NOPM ,0 ,0 , + &rx1_mix2_inp1_mux), +SND_SOC_DAPM_MUX ("RX2 MIX2 INP1" ,SND_SOC_NOPM ,0 ,0 , + &rx2_mix2_inp1_mux),SND_SOC_DAPM_MUX ("CIC1 MUX" ,SND_SOC_NOPM ,0 ,0 , &cic1_mux), SND_SOC_DAPM_MUX("CIC2 MUX", SND_SOC_NOPM, 0, 0, &cic2_mux),
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 34/81 ARM: mm: fix alignment handler faults under memory pressure
In reply to Sasha LevinFrom: Russell King <[email protected]>
[ Upstream commit 67e15fa5b487adb9b78a92789eeff2d6ec8f5cee ]
When the system has high memory pressure, the page containing the instruction may be paged out. Using probe_kernel_address() means that if the page is swapped out, the resulting page fault will not be handled because page faults are disabled by this function.
Use get_user() to read the instruction instead.
--- arch/arm/mm/alignment.c | 44 +++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-)
arch/arm/mm/alignment.c +36 -8
@@ -767,6 +767,36 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,return NULL ; } +static int alignment_get_arm (struct pt_regs *regs,u32 *ip,unsigned long *inst) +{ +u32 instr =0 ; +int fault; + +if (user_mode (regs)) + fault =get_user (instr, ip); +else + fault =probe_kernel_address (ip, instr); + + *inst =__mem_to_opcode_arm (instr); + +return fault; +} + +static int alignment_get_thumb (struct pt_regs *regs,u16 *ip,u16 *inst) +{ +u16 instr =0 ; +int fault; + +if (user_mode (regs)) + fault =get_user (instr, ip); +else + fault =probe_kernel_address (ip, instr); + + *inst =__mem_to_opcode_thumb16 (instr); + +return fault; +} +static int do_alignment (unsigned long addr,unsigned int fsr,struct pt_regs *regs) {
@@ -774,10 +804,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)unsigned long instr =0 , instrptr;int (*handler)(unsigned long addr,unsigned long instr,struct pt_regs *regs);unsigned int type; -unsigned int fault;u16 tinstr =0 ;int isize =4 ;int thumb2_32b =0 ; +int fault;if (interrupts_enabled (regs))local_irq_enable ();
@@ -786,15 +816,14 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)if (thumb_mode (regs)) {u16 *ptr = (u16 *)(instrptr & ~1 ); - fault =probe_kernel_address (ptr, tinstr); - tinstr =__mem_to_opcode_thumb16 (tinstr); + + fault =alignment_get_thumb (regs, ptr, &tinstr);if (!fault) {if (cpu_architecture () >= CPU_ARCH_ARMv7 &&IS_T32 (tinstr)) {/* Thumb-2 32-bit */ -u16 tinst2 =0 ; - fault =probe_kernel_address (ptr +1 , tinst2); - tinst2 =__mem_to_opcode_thumb16 (tinst2); +u16 tinst2; + fault =alignment_get_thumb (regs, ptr +1 , &tinst2); instr =__opcode_thumb32_compose (tinstr, tinst2); thumb2_32b =1 ; }else {
@@ -803,8 +832,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) } } }else { - fault =probe_kernel_address ((void *)instrptr, instr); - instr =__mem_to_opcode_arm (instr); + fault =alignment_get_arm (regs, (void *)instrptr, &instr); }if (fault) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 35/81 scsi: qla2xxx: fix a potential NULL pointer dereference
In reply to Sasha LevinFrom: Allen Pais <[email protected]>
[ Upstream commit 35a79a63517981a8aea395497c548776347deda8 ]
alloc_workqueue is not checked for errors and as a result a potential NULL dereference could occur.
--- drivers/scsi/qla2xxx/qla_os.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/qla2xxx/qla_os.c +4 -0
@@ -3233,6 +3233,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) req->req_q_in, req->req_q_out, rsp->rsp_q_in, rsp->rsp_q_out); ha->wq =alloc_workqueue ("qla2xxx_wq" ,0 ,0 ); +if (unlikely (!ha->wq)) { + ret = -ENOMEM ; + goto probe_failed; + }if (ha->isp_ops->initialize_adapter (base_vha)) { ql_log(ql_log_fatal, base_vha, 0x00d6,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 37/81 scsi: sni_53c710: fix compilation error
In reply to Sasha LevinFrom: Thomas Bogendoerfer <[email protected]>
[ Upstream commit 0ee6211408a8e939428f662833c7301394125b80 ]
Drop out memory dev_printk() with wrong device pointer argument.
[mkp: typo]
--- drivers/scsi/sni_53c710.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/sni_53c710.c +1 -3
@@ -66,10 +66,8 @@ static int snirm710_probe(struct platform_device *dev) base = res->start; hostdata =kzalloc (sizeof (*hostdata),GFP_KERNEL ); -if (!hostdata) { -dev_printk (KERN_ERR , dev,"Failed to allocate host data\n" ); +if (!hostdata)return -ENOMEM ; - } hostdata->dev = &dev->dev;dma_set_mask (&dev->dev,DMA_BIT_MASK (32 ));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 36/81 scsi: scsi_dh_alua: handle RTPG sense code correctly during state transitions
In reply to Sasha LevinFrom: Hannes Reinecke <[email protected]>
[ Upstream commit b6ce6fb121a655aefe41dccc077141c102145a37 ]
Some arrays are not capable of returning RTPG data during state transitioning, but rather return an 'LUN not accessible, asymmetric access state transition' sense code. In these cases we can set the state to 'transitioning' directly and don't need to evaluate the RTPG data (which we won't have anyway).
--- drivers/scsi/device_handler/scsi_dh_alua.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +16 -5
@@ -512,6 +512,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)unsigned int tpg_desc_tbl_off;unsigned char orig_transition_tmo;unsigned long flags; +bool transitioning_sense = false;if (!pg->expiry) {unsigned long transition_tmo =ALUA_FAILOVER_TIMEOUT *HZ ;
@@ -572,13 +573,19 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) goto retry; }/* -* Retry on ALUA state transition or if any -* UNIT ATTENTION occurred. +* If the array returns with 'ALUA state transition' +* sense code here it cannot return RTPG data during +* transition. So set the state to 'transitioning' directly. */ if (sense_hdr.sense_key ==NOT_READY && - sense_hdr.asc ==0x04 && sense_hdr.ascq ==0x0a ) - err =SCSI_DH_RETRY ; -else if (sense_hdr.sense_key ==UNIT_ATTENTION ) + sense_hdr.asc ==0x04 && sense_hdr.ascq ==0x0a ) { + transitioning_sense = true; + goto skip_rtpg; + } +/* +* Retry on any other UNIT ATTENTION occurred. +*/ +if (sense_hdr.sense_key ==UNIT_ATTENTION ) err =SCSI_DH_RETRY ;if (err ==SCSI_DH_RETRY && pg->expiry !=0 &&time_before (jiffies, pg->expiry)) {
@@ -666,7 +673,11 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) off =8 + (desc[7 ] *4 ); } + skip_rtpg:spin_lock_irqsave (&pg->lock, flags); +if (transitioning_sense) + pg->state =SCSI_ACCESS_STATE_TRANSITIONING ; + sdev_printk(KERN_INFO, sdev, "%s: port group %02x state %c %s supports %c%c%c%c%c%c%c\n", ALUA_DH_NAME, pg->group_id, print_alua_state(pg->state),
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 38/81 scsi: fix kconfig dependency warning related to 53C700_LE_ON_BE
In reply to Sasha LevinFrom: Thomas Bogendoerfer <[email protected]>
[ Upstream commit 8cbf0c173aa096dda526d1ccd66fc751c31da346 ]
When building a kernel with SCSI_SNI_53C710 enabled, Kconfig warns:
WARNING: unmet direct dependencies detected for 53C700_LE_ON_BE
Depends on [n]: SCSI_LOWLEVEL [=y] && SCSI [=y] && SCSI_LASI700 [=n] Selected by [y]:
- SCSI_SNI_53C710 [=y] && SCSI_LOWLEVEL [=y] && SNI_RM [=y] && SCSI [=y]
Add the missing depends SCSI_SNI_53C710 to 53C700_LE_ON_BE to fix it.
--- drivers/scsi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/Kconfig +1 -1
@@ -898,7 +898,7 @@ config SCSI_SNI_53C710 config 53C700_LE_ON_BE bool - depends on SCSI_LASI700 + depends on SCSI_LASI700 || SCSI_SNI_53C710 default y config SCSI_STEX
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 39/81 ARM: 8908/1: add __always_inline to functions called from __get_user_check()
In reply to Sasha LevinFrom: Masahiro Yamada <[email protected]>
[ Upstream commit 851140ab0d083c78e5723a8b1cbd258f567a7aff ]
KernelCI reports that bcm2835_defconfig is no longer booting since commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") (https://lkml.org/lkml/2019/9/26/825).
I also received a regression report from Nicolas Saenz Julienne
(https://lkml.org/lkml/2019/9/27/263).
This problem has cropped up on bcm2835_defconfig because it enables CONFIG_CC_OPTIMIZE_FOR_SIZE. The compiler tends to prefer not inlining functions with -Os. I was able to reproduce it with other boards and defconfig files by manually enabling CONFIG_CC_OPTIMIZE_FOR_SIZE.
The __get_user_check() specifically uses r0, r1, r2 registers. So, uaccess_save_and_enable() and uaccess_restore() must be inlined. Otherwise, those register assignments would be entirely dropped, according to my analysis of the disassembly.
Prior to commit 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING"), the 'inline' marker was always enough for inlining functions, except on x86.
Since that commit, all architectures can enable CONFIG_OPTIMIZE_INLINING. So, __always_inline is now the only guaranteed way of forcible inlining.
I added __always_inline to 4 functions in the call-graph from the __get_user_check() macro.
--- arch/arm/include/asm/domain.h | 8 ++++---- arch/arm/include/asm/uaccess.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/include/asm/domain.h +4 -4
@@ -82,7 +82,7 @@ #ifndef __ASSEMBLY__ #ifdef CONFIG_CPU_CP15_MMU -static inline unsigned int get_domain(void) +static __always_inline unsigned int get_domain(void) { unsigned int domain;
@@ -94,7 +94,7 @@ static inline unsigned int get_domain(void)return domain; } -static inline void set_domain (unsigned val) +static __always_inline void set_domain(unsigned int val) { asmvolatile ( "mcr p15, 0, %0, c3, c0 @ set domain"
@@ -102,12 +102,12 @@ static inline void set_domain(unsigned val)isb (); }#else -static inline unsigned int get_domain (void ) +static __always_inline unsigned int get_domain(void) {return 0 ; } -static inline void set_domain (unsigned val) +static __always_inline void set_domain(unsigned int val) { }#endif
arch/arm/include/asm/uaccess.h +2 -2
@@ -22,7 +22,7 @@* perform such accesses (eg, via list poison values) which could then * be exploited for priviledge escalation. */ -static inline unsigned int uaccess_save_and_enable (void ) +static __always_inline unsigned int uaccess_save_and_enable(void) {#ifdef CONFIG_CPU_SW_DOMAIN_PAN unsigned int old_domain =get_domain ();
@@ -37,7 +37,7 @@ static inline unsigned int uaccess_save_and_enable(void)#endif } -static inline void uaccess_restore (unsigned int flags) +static __always_inline void uaccess_restore(unsigned int flags) {#ifdef CONFIG_CPU_SW_DOMAIN_PAN /* Restore the user access mask */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 40/81 ARM: 8914/1: NOMMU: Fix exc_ret for XIP
In reply to Sasha LevinFrom: Vladimir Murzin <[email protected]>
[ Upstream commit 4c0742f65b4ee466546fd24b71b56516cacd4613 ]
It was reported that 72cd4064fcca "NOMMU: Toggle only bits in EXC_RETURN we are really care of" breaks NOMMU+XIP combination. It happens because saved EXC_RETURN gets overwritten when data section is relocated.
The fix is to propagate EXC_RETURN via register and let relocation code to commit that value into memory.
--- arch/arm/kernel/head-common.S | 5 +++-- arch/arm/kernel/head-nommu.S | 2 ++ arch/arm/mm/proc-v7m.S | 5 ++--- 3 files changed, 7 insertions(+), 5 deletions(-)
arch/arm/kernel/head-common.S +3 -2
@@ -68,7 +68,7 @@ ENDPROC(__vet_atags) * The following fragment of code is executed with the MMU on in MMU mode, * and uses absolute addresses; this is not position independent. * - * r0 = cp#15 control register + * r0 = cp#15 control register (exc_ret for M-class) * r1 = machine ID * r2 = atags/dtb pointer * r9 = processor ID
@@ -137,7 +137,8 @@ __mmap_switched_data: #ifdef CONFIG_CPU_CP15 .long cr_alignment @ r3 #else - .long 0 @ r3 +M_CLASS(.long exc_ret) @ r3 +AR_CLASS(.long 0) @ r3 #endif .size __mmap_switched_data, . - __mmap_switched_data
arch/arm/kernel/head-nommu.S +2 -0
@@ -201,6 +201,8 @@ M_CLASS(streq r3, [r12, #PMSAv8_MAIR1]) bic r0, r0, #V7M_SCB_CCR_IC #endif str r0, [r12, V7M_SCB_CCR] + /* Pass exc_ret to __mmap_switched */ + mov r0, r10 #endif /* CONFIG_CPU_CP15 elif CONFIG_CPU_V7M */ ret lr ENDPROC(__after_proc_init)
arch/arm/mm/proc-v7m.S +2 -3
@@ -136,9 +136,8 @@ __v7m_setup_cont: cpsie i svc #0 1: cpsid i - ldr r0, =exc_ret - orr lr, lr, #EXC_RET_THREADMODE_PROCESSSTACK - str lr, [r0] + /* Calculate exc_ret */ + orr r10, lr, #EXC_RET_THREADMODE_PROCESSSTACK ldmia sp, {r0-r3, r12} str r5, [r12, #11 * 4] @ restore the original SVC vector entry mov lr, r6 @ restore LR
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 43/81 arm64: dts: lx2160a: Correct CPU core idle state name
In reply to Sasha LevinFrom: Ran Wang <[email protected]>
[ Upstream commit 07159f67c77134dfdfdbdf3d8f657f5890de5b7f ]
lx2160a support PW15 but not PW20, correct name to avoid confusing.
--- .../arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-)
arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +18 -18
@@ -33,7 +33,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster0_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@1 {
@@ -49,7 +49,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster0_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@100 {
@@ -65,7 +65,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster1_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@101 {
@@ -81,7 +81,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster1_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@200 {
@@ -97,7 +97,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster2_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@201 {
@@ -113,7 +113,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster2_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@300 {
@@ -129,7 +129,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster3_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@301 {
@@ -145,7 +145,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster3_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@400 {
@@ -161,7 +161,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster4_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@401 {
@@ -177,7 +177,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster4_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@500 {
@@ -193,7 +193,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster5_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@501 {
@@ -209,7 +209,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster5_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@600 {
@@ -225,7 +225,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster6_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@601 {
@@ -241,7 +241,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster6_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@700 {
@@ -257,7 +257,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster7_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cpu@701 {
@@ -273,7 +273,7 @@ i-cache-line-size = <64>; i-cache-sets = <192>; next-level-cache = <&cluster7_l2>; - cpu-idle-states = <&cpu_pw20>; + cpu-idle-states = <&cpu_pw15>; }; cluster0_l2: l2-cache0 {
@@ -340,9 +340,9 @@ cache-level = <2>; }; - cpu_pw20: cpu-pw20 { + cpu_pw15: cpu-pw15 { compatible = "arm,idle-state"; - idle-state-name = "PW20"; + idle-state-name = "PW15"; arm,psci-suspend-param = <0x0>; entry-latency-us = <2000>; exit-latency-us = <2000>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 44/81 ARM: dts: imx6q-logicpd: Re-Enable SNVS power key
In reply to Sasha LevinFrom: Adam Ford <[email protected]>
[ Upstream commit 52f4d4043d1edc4e9e66ec79cae3e32cfe0e44d6 ]
A previous patch disabled the SNVS power key by default which breaks the ability for the imx6q-logicpd board to wake from sleep. This patch re-enables this feature for this board.
--- arch/arm/boot/dts/imx6-logicpd-som.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/imx6-logicpd-som.dtsi +4 -0
@@ -207,6 +207,10 @@ vin-supply = <&sw1c_reg>; }; +&snvs_poweroff { + status = "okay"; +}; + &iomuxc { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_hog>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 46/81 ARM: dts: imx7s: Correct GPT's ipg clock source
In reply to Sasha LevinFrom: Anson Huang <[email protected]>
[ Upstream commit 252b9e21bcf46b0d16f733f2e42b21fdc60addee ]
i.MX7S/D's GPT ipg clock should be from GPT clock root and controlled by CCM's GPT CCGR, using correct clock source for GPT ipg clock instead of IMX7D_CLK_DUMMY.
--- arch/arm/boot/dts/imx7s.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx7s.dtsi +4 -4
@@ -448,7 +448,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x302d0000 0x10000>; interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT1_ROOT_CLK>, <&clks IMX7D_GPT1_ROOT_CLK>; clock-names = "ipg", "per"; };
@@ -457,7 +457,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x302e0000 0x10000>; interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT2_ROOT_CLK>, <&clks IMX7D_GPT2_ROOT_CLK>; clock-names = "ipg", "per"; status = "disabled";
@@ -467,7 +467,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x302f0000 0x10000>; interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT3_ROOT_CLK>, <&clks IMX7D_GPT3_ROOT_CLK>; clock-names = "ipg", "per"; status = "disabled";
@@ -477,7 +477,7 @@ compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt"; reg = <0x30300000 0x10000>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clks IMX7D_CLK_DUMMY>, + clocks = <&clks IMX7D_GPT4_ROOT_CLK>, <&clks IMX7D_GPT4_ROOT_CLK>; clock-names = "ipg", "per"; status = "disabled";
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 45/81 ARM: dts: vf610-zii-scu4-aib: Specify 'i2c-mux-idle-disconnect'
In reply to Sasha LevinFrom: Andrey Smirnov <[email protected]>
[ Upstream commit 71936a6d18c33c63b4e9e0359fb987306cbe9fae ]
Specify 'i2c-mux-idle-disconnect' for both I2C switches present on the board, since both are connected to the same parent bus and all of their children have the same I2C address.
--- arch/arm/boot/dts/vf610-zii-scu4-aib.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/vf610-zii-scu4-aib.dts +2 -0
@@ -600,6 +600,7 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x70>; + i2c-mux-idle-disconnect; sff0_i2c: i2c@1 { #address-cells = <1>;
@@ -638,6 +639,7 @@ reg = <0x71>; #address-cells = <1>; #size-cells = <0>; + i2c-mux-idle-disconnect; sff5_i2c: i2c@1 { #address-cells = <1>;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 47/81 arm64: dts: imx8mq: Use correct clock for usdhc's ipg clk
In reply to Sasha LevinFrom: Anson Huang <[email protected]>
[ Upstream commit b0759297f2c8dda455ff78a1d1ac95e261300ae3 ]
On i.MX8MQ, usdhc's ipg clock is from IMX8MQ_CLK_IPG_ROOT, assign it explicitly instead of using IMX8MQ_CLK_DUMMY.
--- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx8mq.dtsi +2 -2
@@ -782,7 +782,7 @@ "fsl,imx7d-usdhc"; reg = <0x30b40000 0x10000>; interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clk IMX8MQ_CLK_DUMMY>, + clocks = <&clk IMX8MQ_CLK_IPG_ROOT>, <&clk IMX8MQ_CLK_NAND_USDHC_BUS>, <&clk IMX8MQ_CLK_USDHC1_ROOT>; clock-names = "ipg", "ahb", "per";
@@ -799,7 +799,7 @@ "fsl,imx7d-usdhc"; reg = <0x30b50000 0x10000>; interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clk IMX8MQ_CLK_DUMMY>, + clocks = <&clk IMX8MQ_CLK_IPG_ROOT>, <&clk IMX8MQ_CLK_NAND_USDHC_BUS>, <&clk IMX8MQ_CLK_USDHC2_ROOT>; clock-names = "ipg", "ahb", "per";
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 48/81 arm64: dts: imx8mm: Use correct clock for usdhc's ipg clk
In reply to Sasha LevinFrom: Anson Huang <[email protected]>
[ Upstream commit a6a40d5688f2264afd40574ee1c92e5f824b34ba ]
On i.MX8MM, usdhc's ipg clock is from IMX8MM_CLK_IPG_ROOT, assign it explicitly instead of using IMX8MM_CLK_DUMMY.
--- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm.dtsi +3 -3
@@ -650,7 +650,7 @@ compatible = "fsl,imx8mm-usdhc", "fsl,imx7d-usdhc"; reg = <0x30b40000 0x10000>; interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clk IMX8MM_CLK_DUMMY>, + clocks = <&clk IMX8MM_CLK_IPG_ROOT>, <&clk IMX8MM_CLK_NAND_USDHC_BUS>, <&clk IMX8MM_CLK_USDHC1_ROOT>; clock-names = "ipg", "ahb", "per";
@@ -666,7 +666,7 @@ compatible = "fsl,imx8mm-usdhc", "fsl,imx7d-usdhc"; reg = <0x30b50000 0x10000>; interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clk IMX8MM_CLK_DUMMY>, + clocks = <&clk IMX8MM_CLK_IPG_ROOT>, <&clk IMX8MM_CLK_NAND_USDHC_BUS>, <&clk IMX8MM_CLK_USDHC2_ROOT>; clock-names = "ipg", "ahb", "per";
@@ -680,7 +680,7 @@ compatible = "fsl,imx8mm-usdhc", "fsl,imx7d-usdhc"; reg = <0x30b60000 0x10000>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clk IMX8MM_CLK_DUMMY>, + clocks = <&clk IMX8MM_CLK_IPG_ROOT>, <&clk IMX8MM_CLK_NAND_USDHC_BUS>, <&clk IMX8MM_CLK_USDHC3_ROOT>; clock-names = "ipg", "ahb", "per";
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 49/81 perf tools: Fix resource leak of closedir() on the error paths
In reply to Sasha LevinFrom: Yunfeng Ye <[email protected]>
[ Upstream commit 6080728ff8e9c9116e52e6f840152356ac2fea56 ]
Both build_mem_topology() and rm_rf_depth_pat() have resource leaks of closedir() on the error paths.
Fix this by calling closedir() before function returns.
--- tools/perf/util/header.c | 4 +++- tools/perf/util/util.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
tools/perf/util/header.c +3 -1
@@ -1282,8 +1282,10 @@ static int build_mem_topology(struct memory_node *nodes, u64 size, u64 *cntp)continue ;if (WARN_ONCE (cnt >= size, -"failed to write MEM_TOPOLOGY, way too many nodes\n" )) +"failed to write MEM_TOPOLOGY, way too many nodes\n" )) { +closedir (dir);return -1 ; + } ret =memory_node__read (&nodes[cnt++], idx); }
tools/perf/util/util.c +4 -2
@@ -176,8 +176,10 @@ static int rm_rf_depth_pat(const char *path, int depth, const char **pat)if (!strcmp (d->d_name,"." ) || !strcmp (d->d_name,".." ))continue ; -if (!match_pat (d->d_name, pat)) -return -2 ; +if (!match_pat (d->d_name, pat)) { + ret =-2 ; +break ; + }scnprintf (namebuf,sizeof (namebuf),"%s/%s" , path, d->d_name);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 50/81 perf c2c: Fix memory leak in build_cl_output()
In reply to Sasha LevinFrom: Yunfeng Ye <[email protected]>
[ Upstream commit ae199c580da1754a2b051321eeb76d6dacd8707b ]
There is a memory leak problem in the failure paths of build_cl_output(), so fix it.
--- tools/perf/builtin-c2c.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
tools/perf/builtin-c2c.c +9 -5
@@ -2627,6 +2627,7 @@ static int build_cl_output(char *cl_sort, bool no_source)bool add_sym = false;bool add_dso = false;bool add_src = false; +int ret =0 ;if (!buf)return -ENOMEM ;
@@ -2645,7 +2646,8 @@ static int build_cl_output(char *cl_sort, bool no_source) add_dso = true; }else if (strcmp (tok,"offset" )) {pr_err ("unrecognized sort token: %s\n" , tok); -return -EINVAL ; + ret = -EINVAL ; + goto err; } }
@@ -2668,13 +2670,15 @@ static int build_cl_output(char *cl_sort, bool no_source) add_sym ? "symbol," : "", add_dso ? "dso," : "", add_src ? "cl_srcline," : "", - "node") < 0) -return -ENOMEM ; + "node") < 0) { + ret = -ENOMEM ; + goto err; + } c2c.show_src = add_src; - +err:free (buf); -return 0 ; +return ret; }static int setup_coalesce (const char *coalesce,bool no_source)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 52/81 8250-men-mcb: fix error checking when get_num_ports returns -ENODEV
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit f50b6805dbb993152025ec04dea094c40cc93a0c ]
The current checking for failure on the number of ports fails when -ENODEV is returned from the call to get_num_ports. Fix this by making num_ports and loop counter i signed rather than unsigned ints. Also add check for num_ports being less than zero to check for -ve error returns.
Addresses-Coverity: ("Unsigned compared against 0")
--- drivers/tty/serial/8250/8250_men_mcb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/serial/8250/8250_men_mcb.c +4 -4
@@ -72,8 +72,8 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev, {struct serial_8250_men_mcb_data *data;struct resource *mem; -unsigned int num_ports; -unsigned int i; +int num_ports; +int i;void __iomem *membase; mem =mcb_get_resource (mdev,IORESOURCE_MEM );
@@ -88,7 +88,7 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev,dev_dbg (&mdev->dev,"found a 16z%03u with %u ports\n" , mdev->id, num_ports); -if (num_ports ==0 || num_ports >4 ) { +if (num_ports <=0 || num_ports >4 ) {dev_err (&mdev->dev,"unexpected number of ports: %u\n" , num_ports);return -ENODEV ;
@@ -133,7 +133,7 @@ static int serial_8250_men_mcb_probe(struct mcb_device *mdev,static void serial_8250_men_mcb_remove (struct mcb_device *mdev) { -unsigned int num_ports, i; +int num_ports, i;struct serial_8250_men_mcb_data *data =mcb_get_drvdata (mdev);if (!data)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 53/81 perf kmem: Fix memory leak in compact_gfp_flags()
In reply to Sasha LevinFrom: Yunfeng Ye <[email protected]>
[ Upstream commit 1abecfcaa7bba21c9985e0136fa49836164dd8fd ]
The memory @orig_flags is allocated by strdup(), it is freed on the normal path, but leak to free on the error path.
Fix this by adding free(orig_flags) on the error path.
--- tools/perf/builtin-kmem.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/builtin-kmem.c +1 -0
@@ -688,6 +688,7 @@ static char *compact_gfp_flags(char *gfp_flags) new =realloc (new_flags, len +strlen (cpt) +2 );if (new ==NULL ) {free (new_flags); +free (orig_flags);return NULL ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 58/81 scsi: hpsa: add missing hunks in reset-patch
In reply to Sasha LevinFrom: Don Brace <[email protected]>
[ Upstream commit 134993456c28c2ae14bd953236eb0742fe23d577 ]
Correct returning from reset before outstanding commands are completed for the device.
--- drivers/scsi/hpsa.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/hpsa.c +4 -0
@@ -5478,6 +5478,8 @@ static int hpsa_ciss_submit(struct ctlr_info *h,return SCSI_MLQUEUE_HOST_BUSY ; } + c->device = dev; +enqueue_cmd_and_start_io (h, c);/* the cmd'll come back via intr handler in complete_scsi_command() */ return 0 ;
@@ -5549,6 +5551,7 @@ static int hpsa_ioaccel_submit(struct ctlr_info *h,hpsa_cmd_init (h, c->cmdindex, c); c->cmd_type =CMD_SCSI ; c->scsi_cmd = cmd; + c->device = dev; rc =hpsa_scsi_ioaccel_raid_map (h, c);if (rc <0 )/* scsi_dma_map failed. */ rc =SCSI_MLQUEUE_HOST_BUSY ;
@@ -5556,6 +5559,7 @@ static int hpsa_ioaccel_submit(struct ctlr_info *h,hpsa_cmd_init (h, c->cmdindex, c); c->cmd_type =CMD_SCSI ; c->scsi_cmd = cmd; + c->device = dev; rc =hpsa_scsi_ioaccel_direct_map (h, c);if (rc <0 )/* scsi_dma_map failed. */ rc =SCSI_MLQUEUE_HOST_BUSY ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 59/81 ASoC: Intel: sof-rt5682: add a check for devm_clk_get
In reply to Sasha LevinFrom: Chuhong Yuan <[email protected]>
[ Upstream commit e5f0d490fb718254a884453e47fcd48493cd67ea ]
sof_audio_probe misses a check for devm_clk_get and may cause problems. Add a check for it to fix the bug.
--- sound/soc/intel/boards/sof_rt5682.c | 9 +++++++++ 1 file changed, 9 insertions(+)
sound/soc/intel/boards/sof_rt5682.c +9 -0
@@ -573,6 +573,15 @@ static int sof_audio_probe(struct platform_device *pdev)/* need to get main clock from pmc */ if (sof_rt5682_quirk &SOF_RT5682_MCLK_BYTCHT_EN ) { ctx->mclk =devm_clk_get (&pdev->dev,"pmc_plt_clk_3" ); +if (IS_ERR (ctx->mclk)) { + ret =PTR_ERR (ctx->mclk); + +dev_err (&pdev->dev, +"Failed to get MCLK from pmc_plt_clk_3: %d\n" , + ret); +return ret; + } + ret =clk_prepare_enable (ctx->mclk);if (ret <0 ) { dev_err(&pdev->dev,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 54/81 ARM: davinci: dm365: Fix McBSP dma_slave_map entry
In reply to Sasha LevinFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit 564b6bb9d42d31fc80c006658cf38940a9b99616 ]
dm365 have only single McBSP, so the device name is without .0
--- arch/arm/mach-davinci/dm365.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/dm365.c +2 -2
@@ -462,8 +462,8 @@ static s8 dm365_queue_priority_mapping[][2] = { };static const struct dma_slave_map dm365_edma_map[] = { - {"davinci-mcbsp.0" ,"tx" ,EDMA_FILTER_PARAM (0 ,2 ) }, - {"davinci-mcbsp.0" ,"rx" ,EDMA_FILTER_PARAM (0 ,3 ) }, + {"davinci-mcbsp" ,"tx" ,EDMA_FILTER_PARAM (0 ,2 ) }, + {"davinci-mcbsp" ,"rx" ,EDMA_FILTER_PARAM (0 ,3 ) }, {"davinci_voicecodec" ,"tx" ,EDMA_FILTER_PARAM (0 ,2 ) }, {"davinci_voicecodec" ,"rx" ,EDMA_FILTER_PARAM (0 ,3 ) }, {"spi_davinci.2" ,"tx" ,EDMA_FILTER_PARAM (0 ,10 ) },
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 60/81 ASoC: SOF: control: return true when kcontrol values change
In reply to Sasha LevinFrom: Dragos Tarcatu <[email protected]>
[ Upstream commit 95a32c98055f664f9b3f34c41e153d4dcedd0eff ]
All the kcontrol put() functions are currently returning 0 when successful. This does not go well with alsamixer as it does not seem to get notified on SND_CTL_EVENT_MASK_VALUE callbacks when values change for (some of) the sof kcontrols. This patch fixes that by returning true for volume, switch and enum type kcontrols when values do change in put().
--- sound/soc/sof/control.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
sound/soc/sof/control.c +18 -8
@@ -60,13 +60,16 @@ int snd_sof_volume_put(struct snd_kcontrol *kcontrol,struct snd_sof_dev *sdev = scontrol->sdev;struct sof_ipc_ctrl_data *cdata = scontrol->control_data;unsigned int i, channels = scontrol->num_channels; +bool change = false; +u32 value;/* update each channel */ for (i =0 ; i < channels; i++) { - cdata->chanv[i].value = -mixer_to_ipc (ucontrol->value.integer.value[i], + value =mixer_to_ipc (ucontrol->value.integer.value[i], scontrol->volume_table, sm->max +1 ); + change = change || (value != cdata->chanv[i].value); cdata->chanv[i].channel = i; + cdata->chanv[i].value = value; }/* notify DSP of mixer updates */
@@ -76,8 +79,7 @@ int snd_sof_volume_put(struct snd_kcontrol *kcontrol,SOF_CTRL_TYPE_VALUE_CHAN_GET ,SOF_CTRL_CMD_VOLUME , true); - -return 0 ; +return change; } int snd_sof_switch_get(struct snd_kcontrol *kcontrol,
@@ -105,11 +107,15 @@ int snd_sof_switch_put(struct snd_kcontrol *kcontrol,struct snd_sof_dev *sdev = scontrol->sdev;struct sof_ipc_ctrl_data *cdata = scontrol->control_data;unsigned int i, channels = scontrol->num_channels; +bool change = false; +u32 value;/* update each channel */ for (i =0 ; i < channels; i++) { - cdata->chanv[i].value = ucontrol->value.integer.value[i]; + value = ucontrol->value.integer.value[i]; + change = change || (value != cdata->chanv[i].value); cdata->chanv[i].channel = i; + cdata->chanv[i].value = value; }/* notify DSP of mixer updates */
@@ -120,7 +126,7 @@ int snd_sof_switch_put(struct snd_kcontrol *kcontrol,SOF_CTRL_CMD_SWITCH , true); -return 0 ; +return change; } int snd_sof_enum_get(struct snd_kcontrol *kcontrol,
@@ -148,11 +154,15 @@ int snd_sof_enum_put(struct snd_kcontrol *kcontrol,struct snd_sof_dev *sdev = scontrol->sdev;struct sof_ipc_ctrl_data *cdata = scontrol->control_data;unsigned int i, channels = scontrol->num_channels; +bool change = false; +u32 value;/* update each channel */ for (i =0 ; i < channels; i++) { - cdata->chanv[i].value = ucontrol->value.enumerated.item[i]; + value = ucontrol->value.enumerated.item[i]; + change = change || (value != cdata->chanv[i].value); cdata->chanv[i].channel = i; + cdata->chanv[i].value = value; }/* notify DSP of enum updates */
@@ -163,7 +173,7 @@ int snd_sof_enum_put(struct snd_kcontrol *kcontrol,SOF_CTRL_CMD_ENUM , true); -return 0 ; +return change; } int snd_sof_bytes_get(struct snd_kcontrol *kcontrol,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 62/81 ARM: dts: bcm2837-rpi-cm3: Avoid leds-gpio probing issue
In reply to Sasha LevinFrom: Stefan Wahren <[email protected]>
[ Upstream commit 626c45d223e22090511acbfb481e0ece1de1356d ]
bcm2835-rpi.dtsi defines the behavior of the ACT LED, which is available on all Raspberry Pi boards. But there is no driver for this particual GPIO on CM3 in mainline yet, so this node was left incomplete without the actual GPIO definition. Since commit 025bf37725f1 ("gpio: Fix return value mismatch of function gpiod_get_from_of_node()") this causing probe issues of the leds-gpio driver for users of the CM3 dtsi file.
leds-gpio: probe of leds failed with error -2
Until we have the necessary GPIO driver hide the ACT node for CM3 to avoid this.
--- arch/arm/boot/dts/bcm2837-rpi-cm3.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm2837-rpi-cm3.dtsi +8 -0
@@ -8,6 +8,14 @@ reg = <0 0x40000000>; }; + leds { + /* + * Since there is no upstream GPIO driver yet, + * remove the incomplete node. + */ + /delete-node/ act; + }; + reg_3v3: fixed-regulator { compatible = "regulator-fixed"; regulator-name = "3V3";
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 61/81 tracing: Fix "gfp_t" format for synthetic events
In reply to Sasha LevinFrom: Zhengjun Xing <[email protected]>
[ Upstream commit 9fa8c9c647be624e91b09ecffa7cd97ee0600b40 ]
In the format of synthetic events, the "gfp_t" is shown as "signed:1", but in fact the "gfp_t" is "unsigned", should be shown as "signed:0".
The issue can be reproduced by the following commands:
echo 'memlatency u64 lat; unsigned int order; gfp_t gfp_flags; int migratetype' > /sys/kernel/debug/tracing/synthetic_events cat /sys/kernel/debug/tracing/events/synthetic/memlatency/format
name: memlatency
ID: 2233
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;
field:u64 lat; offset:8; size:8; signed:0;
field:unsigned int order; offset:16; size:4; signed:0;
field:gfp_t gfp_flags; offset:24; size:4; signed:1;
field:int migratetype; offset:32; size:4; signed:1;print fmt: "lat=%llu, order=%u, gfp_flags=%x, migratetype=%d", REC->lat, REC->order, REC->gfp_flags, REC->migratetype
--- kernel/trace/trace_events_hist.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/trace/trace_events_hist.c +2 -0
@@ -674,6 +674,8 @@ static bool synth_field_signed(char *type) {if (str_has_prefix (type,"u" ))return false; +if (strcmp (type,"gfp_t" ) ==0 ) +return false;return true; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 51/81 USB: legousbtower: fix a signedness bug in tower_probe()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit fd47a417e75e2506eb3672ae569b1c87e3774155 ]
The problem is that sizeof() is unsigned long so negative error codes are type promoted to high positive values and the condition becomes false.
--- drivers/usb/misc/legousbtower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/legousbtower.c +1 -1
@@ -878,7 +878,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device get_version_reply,sizeof (*get_version_reply), 1000); -if (result <sizeof (*get_version_reply)) { +if (result !=sizeof (*get_version_reply)) {if (result >=0 ) result = -EIO ;dev_err (idev,"get version request failed: %d\n" , result);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 20/81 regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized
In reply to Sasha LevinFrom: Yizhuo <[email protected]>
[ Upstream commit 1252b283141f03c3dffd139292c862cae10e174d ]
In function pfuze100_regulator_probe(), variable "val" could be initialized if regmap_read() fails. However, "val" is used to decide the control flow later in the if statement, which is potentially unsafe.
--- drivers/regulator/pfuze100-regulator.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/regulator/pfuze100-regulator.c +7 -1
@@ -788,7 +788,13 @@ static int pfuze100_regulator_probe(struct i2c_client *client,/* SW2~SW4 high bit check and modify the voltage value table */ if (i >= sw_check_start && i <= sw_check_end) { -regmap_read (pfuze_chip->regmap, desc->vsel_reg, &val); + ret =regmap_read (pfuze_chip->regmap, + desc->vsel_reg, &val); +if (ret) { +dev_err (&client->dev,"Fails to read from the register.\n" ); +return ret; + } +if (val & sw_hi) {if (pfuze_chip->chip_id ==PFUZE3000 || pfuze_chip->chip_id ==PFUZE3001 ) {
Signature · 1 line
2.20.1