6.3.2-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 105/694 ALSA: hda/realtek: support HP Pavilion Aero 13-be0xxx Mute LED
In reply to Greg Kroah-HartmanFrom: Caleb Harper <[email protected]>
commit e7477cb97607b373d175a759c8c0270a640ab3f2 upstream.
This patch adds support for the mute LED on the HP Pavilion Aero Laptop 13-be0xxx. The current behavior is that the LED does not turn on at any time and does not indicate to the user whether the sound is muted.
The solution is to add a PCI quirk to properly recognize and support the LED on this device.
This change has been tested on the device in question using modified versions of kernels 6.0.7-6.2.12 on Arch Linux.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9428,6 +9428,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x103c ,0x8898 ,"HP EliteBook 845 G8 Notebook PC" ,ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST ),SND_PCI_QUIRK (0x103c ,0x88d0 ,"HP Pavilion 15-eh1xxx (mainboard 88D0)" ,ALC287_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x8902 ,"HP OMEN 16" ,ALC285_FIXUP_HP_MUTE_LED ), +SND_PCI_QUIRK (0x103c ,0x8919 ,"HP Pavilion Aero Laptop 13-be0xxx" ,ALC287_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x896d ,"HP ZBook Firefly 16 G9" ,ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x896e ,"HP EliteBook x360 830 G9" ,ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ), SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
Greg Kroah-Hartman
maintainerPATCH 106/694 ALSA: hda/realtek: Fix mute and micmute LEDs for an HP laptop
In reply to Greg Kroah-HartmanFrom: Kai-Heng Feng <[email protected]>
commit 56fc217f0db4fc78e02a1b8450df06389474a5e5 upstream.
There's another laptop that needs the fixup to enable mute and micmute LEDs. So do it accordingly.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9479,6 +9479,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x103c ,0x8b8d ,"HP" ,ALC236_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x8b8f ,"HP" ,ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x8b92 ,"HP" ,ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED ), +SND_PCI_QUIRK (0x103c ,0x8b96 ,"HP" ,ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF ),SND_PCI_QUIRK (0x103c ,0x8bf0 ,"HP" ,ALC236_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x1043 ,0x103e ,"ASUS X540SA" ,ALC256_FIXUP_ASUS_MIC ), SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
Greg Kroah-Hartman
maintainerPATCH 107/694 ASoC: codecs: wcd938x: fix accessing regmap on unattached devices
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
commit 84822215acd15bd86a7759a835271e63bba83a7b upstream.
The WCD938x comes with three devices on two Linux drivers:
1. RX Soundwire device (wcd938x-sdw.c driver),
2. TX Soundwire device, which is used to access devices via regmap (also wcd938x-sdw.c driver),
3. platform device (wcd938x.c driver) - glue and component master, actually having most of the code using TX Soundwire device regmap.
When RX and TX Soundwire devices probe, the component master (platform device) bind tries to write micbias configuration via TX Soundwire regmap. This might happen before TX Soundwire enumerates, so the regmap access fails. On Qualcomm SM8550 board with WCD9385:
qcom-soundwire 6d30000.soundwire-controller: Qualcomm Soundwire controller v2.0.0 Registered wcd938x_codec audio-codec: bound sdw:0:0217:010d:00:4 (ops wcd938x_sdw_component_ops) wcd938x_codec audio-codec: bound sdw:0:0217:010d:00:3 (ops wcd938x_sdw_component_ops) qcom-soundwire 6ad0000.soundwire-controller: swrm_wait_for_wr_fifo_avail err write overflow
Fix the issue by:
1. Moving the regmap creation from platform device to TX Soundwire device. The regmap settings are moved as-is with one difference:
making the wcd938x_regmap_config const.
2. Using regmap in cache only mode till the actual TX Soundwire device enumerates and then sync the regmap cache.
Message-Id: <[email protected]>
--- sound/soc/codecs/wcd938x-sdw.c | 1037 ++++++++++++++++++++++++++++++++++++++++- sound/soc/codecs/wcd938x.c | 1003 --------------------------------------- sound/soc/codecs/wcd938x.h | 1 3 files changed, 1030 insertions(+), 1011 deletions(-)
sound/soc/codecs/wcd938x-sdw.c +1025 -12
@@ -161,6 +161,14 @@ EXPORT_SYMBOL_GPL(wcd938x_sdw_set_sdw_ststatic int wcd9380_update_status (struct sdw_slave *slave,enum sdw_slave_status status) { +struct wcd938x_sdw_priv *wcd =dev_get_drvdata (&slave->dev); + +if (wcd->regmap && (status ==SDW_SLAVE_ATTACHED )) { +/* Write out any cached changes that happened between probe and attach */ +regcache_cache_only (wcd->regmap, false); +return regcache_sync (wcd->regmap); + } +return 0 ; }
@@ -177,20 +185,1014 @@ static int wcd9380_interrupt_callback(st {struct wcd938x_sdw_priv *wcd =dev_get_drvdata (&slave->dev);struct irq_domain *slave_irq = wcd->slave_irq; -struct regmap *regmap =dev_get_regmap (&slave->dev,NULL );u32 sts1, sts2, sts3;do {handle_nested_irq (irq_find_mapping (slave_irq,0 )); -regmap_read (regmap,WCD938X_DIGITAL_INTR_STATUS_0 , &sts1); -regmap_read (regmap,WCD938X_DIGITAL_INTR_STATUS_1 , &sts2); -regmap_read (regmap,WCD938X_DIGITAL_INTR_STATUS_2 , &sts3); +regmap_read (wcd->regmap,WCD938X_DIGITAL_INTR_STATUS_0 , &sts1); +regmap_read (wcd->regmap,WCD938X_DIGITAL_INTR_STATUS_1 , &sts2); +regmap_read (wcd->regmap,WCD938X_DIGITAL_INTR_STATUS_2 , &sts3); }while (sts1 || sts2 || sts3);return IRQ_HANDLED ; } +static const struct reg_default wcd938x_defaults[] = { + {WCD938X_ANA_PAGE_REGISTER ,0x00 }, + {WCD938X_ANA_BIAS ,0x00 }, + {WCD938X_ANA_RX_SUPPLIES ,0x00 }, + {WCD938X_ANA_HPH ,0x0C }, + {WCD938X_ANA_EAR ,0x00 }, + {WCD938X_ANA_EAR_COMPANDER_CTL ,0x02 }, + {WCD938X_ANA_TX_CH1 ,0x20 }, + {WCD938X_ANA_TX_CH2 ,0x00 }, + {WCD938X_ANA_TX_CH3 ,0x20 }, + {WCD938X_ANA_TX_CH4 ,0x00 }, + {WCD938X_ANA_MICB1_MICB2_DSP_EN_LOGIC ,0x00 }, + {WCD938X_ANA_MICB3_DSP_EN_LOGIC ,0x00 }, + {WCD938X_ANA_MBHC_MECH ,0x39 }, + {WCD938X_ANA_MBHC_ELECT ,0x08 }, + {WCD938X_ANA_MBHC_ZDET ,0x00 }, + {WCD938X_ANA_MBHC_RESULT_1 ,0x00 }, + {WCD938X_ANA_MBHC_RESULT_2 ,0x00 }, + {WCD938X_ANA_MBHC_RESULT_3 ,0x00 }, + {WCD938X_ANA_MBHC_BTN0 ,0x00 }, + {WCD938X_ANA_MBHC_BTN1 ,0x10 }, + {WCD938X_ANA_MBHC_BTN2 ,0x20 }, + {WCD938X_ANA_MBHC_BTN3 ,0x30 }, + {WCD938X_ANA_MBHC_BTN4 ,0x40 }, + {WCD938X_ANA_MBHC_BTN5 ,0x50 }, + {WCD938X_ANA_MBHC_BTN6 ,0x60 }, + {WCD938X_ANA_MBHC_BTN7 ,0x70 }, + {WCD938X_ANA_MICB1 ,0x10 }, + {WCD938X_ANA_MICB2 ,0x10 }, + {WCD938X_ANA_MICB2_RAMP ,0x00 }, + {WCD938X_ANA_MICB3 ,0x10 }, + {WCD938X_ANA_MICB4 ,0x10 }, + {WCD938X_BIAS_CTL ,0x2A }, + {WCD938X_BIAS_VBG_FINE_ADJ ,0x55 }, + {WCD938X_LDOL_VDDCX_ADJUST ,0x01 }, + {WCD938X_LDOL_DISABLE_LDOL ,0x00 }, + {WCD938X_MBHC_CTL_CLK ,0x00 }, + {WCD938X_MBHC_CTL_ANA ,0x00 }, + {WCD938X_MBHC_CTL_SPARE_1 ,0x00 }, + {WCD938X_MBHC_CTL_SPARE_2 ,0x00 }, + {WCD938X_MBHC_CTL_BCS ,0x00 }, + {WCD938X_MBHC_MOISTURE_DET_FSM_STATUS ,0x00 }, + {WCD938X_MBHC_TEST_CTL ,0x00 }, + {WCD938X_LDOH_MODE ,0x2B }, + {WCD938X_LDOH_BIAS ,0x68 }, + {WCD938X_LDOH_STB_LOADS ,0x00 }, + {WCD938X_LDOH_SLOWRAMP ,0x50 }, + {WCD938X_MICB1_TEST_CTL_1 ,0x1A }, + {WCD938X_MICB1_TEST_CTL_2 ,0x00 }, + {WCD938X_MICB1_TEST_CTL_3 ,0xA4 }, + {WCD938X_MICB2_TEST_CTL_1 ,0x1A }, + {WCD938X_MICB2_TEST_CTL_2 ,0x00 }, + {WCD938X_MICB2_TEST_CTL_3 ,0x24 }, + {WCD938X_MICB3_TEST_CTL_1 ,0x1A }, + {WCD938X_MICB3_TEST_CTL_2 ,0x00 }, + {WCD938X_MICB3_TEST_CTL_3 ,0xA4 }, + {WCD938X_MICB4_TEST_CTL_1 ,0x1A }, + {WCD938X_MICB4_TEST_CTL_2 ,0x00 }, + {WCD938X_MICB4_TEST_CTL_3 ,0xA4 }, + {WCD938X_TX_COM_ADC_VCM ,0x39 }, + {WCD938X_TX_COM_BIAS_ATEST ,0xE0 }, + {WCD938X_TX_COM_SPARE1 ,0x00 }, + {WCD938X_TX_COM_SPARE2 ,0x00 }, + {WCD938X_TX_COM_TXFE_DIV_CTL ,0x22 }, + {WCD938X_TX_COM_TXFE_DIV_START ,0x00 }, + {WCD938X_TX_COM_SPARE3 ,0x00 }, + {WCD938X_TX_COM_SPARE4 ,0x00 }, + {WCD938X_TX_1_2_TEST_EN ,0xCC }, + {WCD938X_TX_1_2_ADC_IB ,0xE9 }, + {WCD938X_TX_1_2_ATEST_REFCTL ,0x0A }, + {WCD938X_TX_1_2_TEST_CTL ,0x38 }, + {WCD938X_TX_1_2_TEST_BLK_EN1 ,0xFF }, + {WCD938X_TX_1_2_TXFE1_CLKDIV ,0x00 }, + {WCD938X_TX_1_2_SAR2_ERR ,0x00 }, + {WCD938X_TX_1_2_SAR1_ERR ,0x00 }, + {WCD938X_TX_3_4_TEST_EN ,0xCC }, + {WCD938X_TX_3_4_ADC_IB ,0xE9 }, + {WCD938X_TX_3_4_ATEST_REFCTL ,0x0A }, + {WCD938X_TX_3_4_TEST_CTL ,0x38 }, + {WCD938X_TX_3_4_TEST_BLK_EN3 ,0xFF }, + {WCD938X_TX_3_4_TXFE3_CLKDIV ,0x00 }, + {WCD938X_TX_3_4_SAR4_ERR ,0x00 }, + {WCD938X_TX_3_4_SAR3_ERR ,0x00 }, + {WCD938X_TX_3_4_TEST_BLK_EN2 ,0xFB }, + {WCD938X_TX_3_4_TXFE2_CLKDIV ,0x00 }, + {WCD938X_TX_3_4_SPARE1 ,0x00 }, + {WCD938X_TX_3_4_TEST_BLK_EN4 ,0xFB }, + {WCD938X_TX_3_4_TXFE4_CLKDIV ,0x00 }, + {WCD938X_TX_3_4_SPARE2 ,0x00 }, + {WCD938X_CLASSH_MODE_1 ,0x40 }, + {WCD938X_CLASSH_MODE_2 ,0x3A }, + {WCD938X_CLASSH_MODE_3 ,0x00 }, + {WCD938X_CLASSH_CTRL_VCL_1 ,0x70 }, + {WCD938X_CLASSH_CTRL_VCL_2 ,0x82 }, + {WCD938X_CLASSH_CTRL_CCL_1 ,0x31 }, + {WCD938X_CLASSH_CTRL_CCL_2 ,0x80 }, + {WCD938X_CLASSH_CTRL_CCL_3 ,0x80 }, + {WCD938X_CLASSH_CTRL_CCL_4 ,0x51 }, + {WCD938X_CLASSH_CTRL_CCL_5 ,0x00 }, + {WCD938X_CLASSH_BUCK_TMUX_A_D ,0x00 }, + {WCD938X_CLASSH_BUCK_SW_DRV_CNTL ,0x77 }, + {WCD938X_CLASSH_SPARE ,0x00 }, + {WCD938X_FLYBACK_EN ,0x4E }, + {WCD938X_FLYBACK_VNEG_CTRL_1 ,0x0B }, + {WCD938X_FLYBACK_VNEG_CTRL_2 ,0x45 }, + {WCD938X_FLYBACK_VNEG_CTRL_3 ,0x74 }, + {WCD938X_FLYBACK_VNEG_CTRL_4 ,0x7F }, + {WCD938X_FLYBACK_VNEG_CTRL_5 ,0x83 }, + {WCD938X_FLYBACK_VNEG_CTRL_6 ,0x98 }, + {WCD938X_FLYBACK_VNEG_CTRL_7 ,0xA9 }, + {WCD938X_FLYBACK_VNEG_CTRL_8 ,0x68 }, + {WCD938X_FLYBACK_VNEG_CTRL_9 ,0x64 }, + {WCD938X_FLYBACK_VNEGDAC_CTRL_1 ,0xED }, + {WCD938X_FLYBACK_VNEGDAC_CTRL_2 ,0xF0 }, + {WCD938X_FLYBACK_VNEGDAC_CTRL_3 ,0xA6 }, + {WCD938X_FLYBACK_CTRL_1 ,0x65 }, + {WCD938X_FLYBACK_TEST_CTL ,0x00 }, + {WCD938X_RX_AUX_SW_CTL ,0x00 }, + {WCD938X_RX_PA_AUX_IN_CONN ,0x01 }, + {WCD938X_RX_TIMER_DIV ,0x32 }, + {WCD938X_RX_OCP_CTL ,0x1F }, + {WCD938X_RX_OCP_COUNT ,0x77 }, + {WCD938X_RX_BIAS_EAR_DAC ,0xA0 }, + {WCD938X_RX_BIAS_EAR_AMP ,0xAA }, + {WCD938X_RX_BIAS_HPH_LDO ,0xA9 }, + {WCD938X_RX_BIAS_HPH_PA ,0xAA }, + {WCD938X_RX_BIAS_HPH_RDACBUFF_CNP2 ,0x8A }, + {WCD938X_RX_BIAS_HPH_RDAC_LDO ,0x88 }, + {WCD938X_RX_BIAS_HPH_CNP1 ,0x82 }, + {WCD938X_RX_BIAS_HPH_LOWPOWER ,0x82 }, + {WCD938X_RX_BIAS_AUX_DAC ,0xA0 }, + {WCD938X_RX_BIAS_AUX_AMP ,0xAA }, + {WCD938X_RX_BIAS_VNEGDAC_BLEEDER ,0x50 }, + {WCD938X_RX_BIAS_MISC ,0x00 }, + {WCD938X_RX_BIAS_BUCK_RST ,0x08 }, + {WCD938X_RX_BIAS_BUCK_VREF_ERRAMP ,0x44 }, + {WCD938X_RX_BIAS_FLYB_ERRAMP ,0x40 }, + {WCD938X_RX_BIAS_FLYB_BUFF ,0xAA }, + {WCD938X_RX_BIAS_FLYB_MID_RST ,0x14 }, + {WCD938X_HPH_L_STATUS ,0x04 }, + {WCD938X_HPH_R_STATUS ,0x04 }, + {WCD938X_HPH_CNP_EN ,0x80 }, + {WCD938X_HPH_CNP_WG_CTL ,0x9A }, + {WCD938X_HPH_CNP_WG_TIME ,0x14 }, + {WCD938X_HPH_OCP_CTL ,0x28 }, + {WCD938X_HPH_AUTO_CHOP ,0x16 }, + {WCD938X_HPH_CHOP_CTL ,0x83 }, + {WCD938X_HPH_PA_CTL1 ,0x46 }, + {WCD938X_HPH_PA_CTL2 ,0x50 }, + {WCD938X_HPH_L_EN ,0x80 }, + {WCD938X_HPH_L_TEST ,0xE0 }, + {WCD938X_HPH_L_ATEST ,0x50 }, + {WCD938X_HPH_R_EN ,0x80 }, + {WCD938X_HPH_R_TEST ,0xE0 }, + {WCD938X_HPH_R_ATEST ,0x54 }, + {WCD938X_HPH_RDAC_CLK_CTL1 ,0x99 }, + {WCD938X_HPH_RDAC_CLK_CTL2 ,0x9B }, + {WCD938X_HPH_RDAC_LDO_CTL ,0x33 }, + {WCD938X_HPH_RDAC_CHOP_CLK_LP_CTL ,0x00 }, + {WCD938X_HPH_REFBUFF_UHQA_CTL ,0x68 }, + {WCD938X_HPH_REFBUFF_LP_CTL ,0x0E }, + {WCD938X_HPH_L_DAC_CTL ,0x20 }, + {WCD938X_HPH_R_DAC_CTL ,0x20 }, + {WCD938X_HPH_SURGE_HPHLR_SURGE_COMP_SEL ,0x55 }, + {WCD938X_HPH_SURGE_HPHLR_SURGE_EN ,0x19 }, + {WCD938X_HPH_SURGE_HPHLR_SURGE_MISC1 ,0xA0 }, + {WCD938X_HPH_SURGE_HPHLR_SURGE_STATUS ,0x00 }, + {WCD938X_EAR_EAR_EN_REG ,0x22 }, + {WCD938X_EAR_EAR_PA_CON ,0x44 }, + {WCD938X_EAR_EAR_SP_CON ,0xDB }, + {WCD938X_EAR_EAR_DAC_CON ,0x80 }, + {WCD938X_EAR_EAR_CNP_FSM_CON ,0xB2 }, + {WCD938X_EAR_TEST_CTL ,0x00 }, + {WCD938X_EAR_STATUS_REG_1 ,0x00 }, + {WCD938X_EAR_STATUS_REG_2 ,0x08 }, + {WCD938X_ANA_NEW_PAGE_REGISTER ,0x00 }, + {WCD938X_HPH_NEW_ANA_HPH2 ,0x00 }, + {WCD938X_HPH_NEW_ANA_HPH3 ,0x00 }, + {WCD938X_SLEEP_CTL ,0x16 }, + {WCD938X_SLEEP_WATCHDOG_CTL ,0x00 }, + {WCD938X_MBHC_NEW_ELECT_REM_CLAMP_CTL ,0x00 }, + {WCD938X_MBHC_NEW_CTL_1 ,0x02 }, + {WCD938X_MBHC_NEW_CTL_2 ,0x05 }, + {WCD938X_MBHC_NEW_PLUG_DETECT_CTL ,0xE9 }, + {WCD938X_MBHC_NEW_ZDET_ANA_CTL ,0x0F }, + {WCD938X_MBHC_NEW_ZDET_RAMP_CTL ,0x00 }, + {WCD938X_MBHC_NEW_FSM_STATUS ,0x00 }, + {WCD938X_MBHC_NEW_ADC_RESULT ,0x00 }, + {WCD938X_TX_NEW_AMIC_MUX_CFG ,0x00 }, + {WCD938X_AUX_AUXPA ,0x00 }, + {WCD938X_LDORXTX_MODE ,0x0C }, + {WCD938X_LDORXTX_CONFIG ,0x10 }, + {WCD938X_DIE_CRACK_DIE_CRK_DET_EN ,0x00 }, + {WCD938X_DIE_CRACK_DIE_CRK_DET_OUT ,0x00 }, + {WCD938X_HPH_NEW_INT_RDAC_GAIN_CTL ,0x40 }, + {WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_L ,0x81 }, + {WCD938X_HPH_NEW_INT_RDAC_VREF_CTL ,0x10 }, + {WCD938X_HPH_NEW_INT_RDAC_OVERRIDE_CTL ,0x00 }, + {WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_R ,0x81 }, + {WCD938X_HPH_NEW_INT_PA_MISC1 ,0x22 }, + {WCD938X_HPH_NEW_INT_PA_MISC2 ,0x00 }, + {WCD938X_HPH_NEW_INT_PA_RDAC_MISC ,0x00 }, + {WCD938X_HPH_NEW_INT_HPH_TIMER1 ,0xFE }, + {WCD938X_HPH_NEW_INT_HPH_TIMER2 ,0x02 }, + {WCD938X_HPH_NEW_INT_HPH_TIMER3 ,0x4E }, + {WCD938X_HPH_NEW_INT_HPH_TIMER4 ,0x54 }, + {WCD938X_HPH_NEW_INT_PA_RDAC_MISC2 ,0x00 }, + {WCD938X_HPH_NEW_INT_PA_RDAC_MISC3 ,0x00 }, + {WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_L_NEW ,0x90 }, + {WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_R_NEW ,0x90 }, + {WCD938X_RX_NEW_INT_HPH_RDAC_BIAS_LOHIFI ,0x62 }, + {WCD938X_RX_NEW_INT_HPH_RDAC_BIAS_ULP ,0x01 }, + {WCD938X_RX_NEW_INT_HPH_RDAC_LDO_LP ,0x11 }, + {WCD938X_MBHC_NEW_INT_MOISTURE_DET_DC_CTRL ,0x57 }, + {WCD938X_MBHC_NEW_INT_MOISTURE_DET_POLLING_CTRL ,0x01 }, + {WCD938X_MBHC_NEW_INT_MECH_DET_CURRENT ,0x00 }, + {WCD938X_MBHC_NEW_INT_SPARE_2 ,0x00 }, + {WCD938X_EAR_INT_NEW_EAR_CHOPPER_CON ,0xA8 }, + {WCD938X_EAR_INT_NEW_CNP_VCM_CON1 ,0x42 }, + {WCD938X_EAR_INT_NEW_CNP_VCM_CON2 ,0x22 }, + {WCD938X_EAR_INT_NEW_EAR_DYNAMIC_BIAS ,0x00 }, + {WCD938X_AUX_INT_EN_REG ,0x00 }, + {WCD938X_AUX_INT_PA_CTRL ,0x06 }, + {WCD938X_AUX_INT_SP_CTRL ,0xD2 }, + {WCD938X_AUX_INT_DAC_CTRL ,0x80 }, + {WCD938X_AUX_INT_CLK_CTRL ,0x50 }, + {WCD938X_AUX_INT_TEST_CTRL ,0x00 }, + {WCD938X_AUX_INT_STATUS_REG ,0x00 }, + {WCD938X_AUX_INT_MISC ,0x00 }, + {WCD938X_LDORXTX_INT_BIAS ,0x6E }, + {WCD938X_LDORXTX_INT_STB_LOADS_DTEST ,0x50 }, + {WCD938X_LDORXTX_INT_TEST0 ,0x1C }, + {WCD938X_LDORXTX_INT_STARTUP_TIMER ,0xFF }, + {WCD938X_LDORXTX_INT_TEST1 ,0x1F }, + {WCD938X_LDORXTX_INT_STATUS ,0x00 }, + {WCD938X_SLEEP_INT_WATCHDOG_CTL_1 ,0x0A }, + {WCD938X_SLEEP_INT_WATCHDOG_CTL_2 ,0x0A }, + {WCD938X_DIE_CRACK_INT_DIE_CRK_DET_INT1 ,0x02 }, + {WCD938X_DIE_CRACK_INT_DIE_CRK_DET_INT2 ,0x60 }, + {WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_L2 ,0xFF }, + {WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_L1 ,0x7F }, + {WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_L0 ,0x3F }, + {WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_ULP1P2M ,0x1F }, + {WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_ULP0P6M ,0x0F }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG1_L2L1 ,0xD7 }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG1_L0 ,0xC8 }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG1_ULP ,0xC6 }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2MAIN_L2L1 ,0xD5 }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2MAIN_L0 ,0xCA }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2MAIN_ULP ,0x05 }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2CASC_L2L1L0 ,0xA5 }, + {WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2CASC_ULP ,0x13 }, + {WCD938X_TX_COM_NEW_INT_TXADC_SCBIAS_L2L1 ,0x88 }, + {WCD938X_TX_COM_NEW_INT_TXADC_SCBIAS_L0ULP ,0x42 }, + {WCD938X_TX_COM_NEW_INT_TXADC_INT_L2 ,0xFF }, + {WCD938X_TX_COM_NEW_INT_TXADC_INT_L1 ,0x64 }, + {WCD938X_TX_COM_NEW_INT_TXADC_INT_L0 ,0x64 }, + {WCD938X_TX_COM_NEW_INT_TXADC_INT_ULP ,0x77 }, + {WCD938X_DIGITAL_PAGE_REGISTER ,0x00 }, + {WCD938X_DIGITAL_CHIP_ID0 ,0x00 }, + {WCD938X_DIGITAL_CHIP_ID1 ,0x00 }, + {WCD938X_DIGITAL_CHIP_ID2 ,0x0D }, + {WCD938X_DIGITAL_CHIP_ID3 ,0x01 }, + {WCD938X_DIGITAL_SWR_TX_CLK_RATE ,0x00 }, + {WCD938X_DIGITAL_CDC_RST_CTL ,0x03 }, + {WCD938X_DIGITAL_TOP_CLK_CFG ,0x00 }, + {WCD938X_DIGITAL_CDC_ANA_CLK_CTL ,0x00 }, + {WCD938X_DIGITAL_CDC_DIG_CLK_CTL ,0xF0 }, + {WCD938X_DIGITAL_SWR_RST_EN ,0x00 }, + {WCD938X_DIGITAL_CDC_PATH_MODE ,0x55 }, + {WCD938X_DIGITAL_CDC_RX_RST ,0x00 }, + {WCD938X_DIGITAL_CDC_RX0_CTL ,0xFC }, + {WCD938X_DIGITAL_CDC_RX1_CTL ,0xFC }, + {WCD938X_DIGITAL_CDC_RX2_CTL ,0xFC }, + {WCD938X_DIGITAL_CDC_TX_ANA_MODE_0_1 ,0x00 }, + {WCD938X_DIGITAL_CDC_TX_ANA_MODE_2_3 ,0x00 }, + {WCD938X_DIGITAL_CDC_COMP_CTL_0 ,0x00 }, + {WCD938X_DIGITAL_CDC_ANA_TX_CLK_CTL ,0x1E }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A1_0 ,0x00 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A1_1 ,0x01 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A2_0 ,0x63 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A2_1 ,0x04 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A3_0 ,0xAC }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A3_1 ,0x04 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A4_0 ,0x1A }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A4_1 ,0x03 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A5_0 ,0xBC }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A5_1 ,0x02 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A6_0 ,0xC7 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_A7_0 ,0xF8 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_C_0 ,0x47 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_C_1 ,0x43 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_C_2 ,0xB1 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_C_3 ,0x17 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_R1 ,0x4D }, + {WCD938X_DIGITAL_CDC_HPH_DSM_R2 ,0x29 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_R3 ,0x34 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_R4 ,0x59 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_R5 ,0x66 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_R6 ,0x87 }, + {WCD938X_DIGITAL_CDC_HPH_DSM_R7 ,0x64 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A1_0 ,0x00 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A1_1 ,0x01 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A2_0 ,0x96 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A2_1 ,0x09 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A3_0 ,0xAB }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A3_1 ,0x05 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A4_0 ,0x1C }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A4_1 ,0x02 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A5_0 ,0x17 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A5_1 ,0x02 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A6_0 ,0xAA }, + {WCD938X_DIGITAL_CDC_AUX_DSM_A7_0 ,0xE3 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_C_0 ,0x69 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_C_1 ,0x54 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_C_2 ,0x02 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_C_3 ,0x15 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_R1 ,0xA4 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_R2 ,0xB5 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_R3 ,0x86 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_R4 ,0x85 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_R5 ,0xAA }, + {WCD938X_DIGITAL_CDC_AUX_DSM_R6 ,0xE2 }, + {WCD938X_DIGITAL_CDC_AUX_DSM_R7 ,0x62 }, + {WCD938X_DIGITAL_CDC_HPH_GAIN_RX_0 ,0x55 }, + {WCD938X_DIGITAL_CDC_HPH_GAIN_RX_1 ,0xA9 }, + {WCD938X_DIGITAL_CDC_HPH_GAIN_DSD_0 ,0x3D }, + {WCD938X_DIGITAL_CDC_HPH_GAIN_DSD_1 ,0x2E }, + {WCD938X_DIGITAL_CDC_HPH_GAIN_DSD_2 ,0x01 }, + {WCD938X_DIGITAL_CDC_AUX_GAIN_DSD_0 ,0x00 }, + {WCD938X_DIGITAL_CDC_AUX_GAIN_DSD_1 ,0xFC }, + {WCD938X_DIGITAL_CDC_AUX_GAIN_DSD_2 ,0x01 }, + {WCD938X_DIGITAL_CDC_HPH_GAIN_CTL ,0x00 }, + {WCD938X_DIGITAL_CDC_AUX_GAIN_CTL ,0x00 }, + {WCD938X_DIGITAL_CDC_EAR_PATH_CTL ,0x00 }, + {WCD938X_DIGITAL_CDC_SWR_CLH ,0x00 }, + {WCD938X_DIGITAL_SWR_CLH_BYP ,0x00 }, + {WCD938X_DIGITAL_CDC_TX0_CTL ,0x68 }, + {WCD938X_DIGITAL_CDC_TX1_CTL ,0x68 }, + {WCD938X_DIGITAL_CDC_TX2_CTL ,0x68 }, + {WCD938X_DIGITAL_CDC_TX_RST ,0x00 }, + {WCD938X_DIGITAL_CDC_REQ_CTL ,0x01 }, + {WCD938X_DIGITAL_CDC_RST ,0x00 }, + {WCD938X_DIGITAL_CDC_AMIC_CTL ,0x0F }, + {WCD938X_DIGITAL_CDC_DMIC_CTL ,0x04 }, + {WCD938X_DIGITAL_CDC_DMIC1_CTL ,0x01 }, + {WCD938X_DIGITAL_CDC_DMIC2_CTL ,0x01 }, + {WCD938X_DIGITAL_CDC_DMIC3_CTL ,0x01 }, + {WCD938X_DIGITAL_CDC_DMIC4_CTL ,0x01 }, + {WCD938X_DIGITAL_EFUSE_PRG_CTL ,0x00 }, + {WCD938X_DIGITAL_EFUSE_CTL ,0x2B }, + {WCD938X_DIGITAL_CDC_DMIC_RATE_1_2 ,0x11 }, + {WCD938X_DIGITAL_CDC_DMIC_RATE_3_4 ,0x11 }, + {WCD938X_DIGITAL_PDM_WD_CTL0 ,0x00 }, + {WCD938X_DIGITAL_PDM_WD_CTL1 ,0x00 }, + {WCD938X_DIGITAL_PDM_WD_CTL2 ,0x00 }, + {WCD938X_DIGITAL_INTR_MODE ,0x00 }, + {WCD938X_DIGITAL_INTR_MASK_0 ,0xFF }, + {WCD938X_DIGITAL_INTR_MASK_1 ,0xFF }, + {WCD938X_DIGITAL_INTR_MASK_2 ,0x3F }, + {WCD938X_DIGITAL_INTR_STATUS_0 ,0x00 }, + {WCD938X_DIGITAL_INTR_STATUS_1 ,0x00 }, + {WCD938X_DIGITAL_INTR_STATUS_2 ,0x00 }, + {WCD938X_DIGITAL_INTR_CLEAR_0 ,0x00 }, + {WCD938X_DIGITAL_INTR_CLEAR_1 ,0x00 }, + {WCD938X_DIGITAL_INTR_CLEAR_2 ,0x00 }, + {WCD938X_DIGITAL_INTR_LEVEL_0 ,0x00 }, + {WCD938X_DIGITAL_INTR_LEVEL_1 ,0x00 }, + {WCD938X_DIGITAL_INTR_LEVEL_2 ,0x00 }, + {WCD938X_DIGITAL_INTR_SET_0 ,0x00 }, + {WCD938X_DIGITAL_INTR_SET_1 ,0x00 }, + {WCD938X_DIGITAL_INTR_SET_2 ,0x00 }, + {WCD938X_DIGITAL_INTR_TEST_0 ,0x00 }, + {WCD938X_DIGITAL_INTR_TEST_1 ,0x00 }, + {WCD938X_DIGITAL_INTR_TEST_2 ,0x00 }, + {WCD938X_DIGITAL_TX_MODE_DBG_EN ,0x00 }, + {WCD938X_DIGITAL_TX_MODE_DBG_0_1 ,0x00 }, + {WCD938X_DIGITAL_TX_MODE_DBG_2_3 ,0x00 }, + {WCD938X_DIGITAL_LB_IN_SEL_CTL ,0x00 }, + {WCD938X_DIGITAL_LOOP_BACK_MODE ,0x00 }, + {WCD938X_DIGITAL_SWR_DAC_TEST ,0x00 }, + {WCD938X_DIGITAL_SWR_HM_TEST_RX_0 ,0x40 }, + {WCD938X_DIGITAL_SWR_HM_TEST_TX_0 ,0x40 }, + {WCD938X_DIGITAL_SWR_HM_TEST_RX_1 ,0x00 }, + {WCD938X_DIGITAL_SWR_HM_TEST_TX_1 ,0x00 }, + {WCD938X_DIGITAL_SWR_HM_TEST_TX_2 ,0x00 }, + {WCD938X_DIGITAL_SWR_HM_TEST_0 ,0x00 }, + {WCD938X_DIGITAL_SWR_HM_TEST_1 ,0x00 }, + {WCD938X_DIGITAL_PAD_CTL_SWR_0 ,0x8F }, + {WCD938X_DIGITAL_PAD_CTL_SWR_1 ,0x06 }, + {WCD938X_DIGITAL_I2C_CTL ,0x00 }, + {WCD938X_DIGITAL_CDC_TX_TANGGU_SW_MODE ,0x00 }, + {WCD938X_DIGITAL_EFUSE_TEST_CTL_0 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_TEST_CTL_1 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_T_DATA_0 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_T_DATA_1 ,0x00 }, + {WCD938X_DIGITAL_PAD_CTL_PDM_RX0 ,0xF1 }, + {WCD938X_DIGITAL_PAD_CTL_PDM_RX1 ,0xF1 }, + {WCD938X_DIGITAL_PAD_CTL_PDM_TX0 ,0xF1 }, + {WCD938X_DIGITAL_PAD_CTL_PDM_TX1 ,0xF1 }, + {WCD938X_DIGITAL_PAD_CTL_PDM_TX2 ,0xF1 }, + {WCD938X_DIGITAL_PAD_INP_DIS_0 ,0x00 }, + {WCD938X_DIGITAL_PAD_INP_DIS_1 ,0x00 }, + {WCD938X_DIGITAL_DRIVE_STRENGTH_0 ,0x00 }, + {WCD938X_DIGITAL_DRIVE_STRENGTH_1 ,0x00 }, + {WCD938X_DIGITAL_DRIVE_STRENGTH_2 ,0x00 }, + {WCD938X_DIGITAL_RX_DATA_EDGE_CTL ,0x1F }, + {WCD938X_DIGITAL_TX_DATA_EDGE_CTL ,0x80 }, + {WCD938X_DIGITAL_GPIO_MODE ,0x00 }, + {WCD938X_DIGITAL_PIN_CTL_OE ,0x00 }, + {WCD938X_DIGITAL_PIN_CTL_DATA_0 ,0x00 }, + {WCD938X_DIGITAL_PIN_CTL_DATA_1 ,0x00 }, + {WCD938X_DIGITAL_PIN_STATUS_0 ,0x00 }, + {WCD938X_DIGITAL_PIN_STATUS_1 ,0x00 }, + {WCD938X_DIGITAL_DIG_DEBUG_CTL ,0x00 }, + {WCD938X_DIGITAL_DIG_DEBUG_EN ,0x00 }, + {WCD938X_DIGITAL_ANA_CSR_DBG_ADD ,0x00 }, + {WCD938X_DIGITAL_ANA_CSR_DBG_CTL ,0x48 }, + {WCD938X_DIGITAL_SSP_DBG ,0x00 }, + {WCD938X_DIGITAL_MODE_STATUS_0 ,0x00 }, + {WCD938X_DIGITAL_MODE_STATUS_1 ,0x00 }, + {WCD938X_DIGITAL_SPARE_0 ,0x00 }, + {WCD938X_DIGITAL_SPARE_1 ,0x00 }, + {WCD938X_DIGITAL_SPARE_2 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_0 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_1 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_2 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_3 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_4 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_5 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_6 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_7 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_8 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_9 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_10 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_11 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_12 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_13 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_14 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_15 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_16 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_17 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_18 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_19 ,0xFF }, + {WCD938X_DIGITAL_EFUSE_REG_20 ,0x0E }, + {WCD938X_DIGITAL_EFUSE_REG_21 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_22 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_23 ,0xF8 }, + {WCD938X_DIGITAL_EFUSE_REG_24 ,0x16 }, + {WCD938X_DIGITAL_EFUSE_REG_25 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_26 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_27 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_28 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_29 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_30 ,0x00 }, + {WCD938X_DIGITAL_EFUSE_REG_31 ,0x00 }, + {WCD938X_DIGITAL_TX_REQ_FB_CTL_0 ,0x88 }, + {WCD938X_DIGITAL_TX_REQ_FB_CTL_1 ,0x88 }, + {WCD938X_DIGITAL_TX_REQ_FB_CTL_2 ,0x88 }, + {WCD938X_DIGITAL_TX_REQ_FB_CTL_3 ,0x88 }, + {WCD938X_DIGITAL_TX_REQ_FB_CTL_4 ,0x88 }, + {WCD938X_DIGITAL_DEM_BYPASS_DATA0 ,0x55 }, + {WCD938X_DIGITAL_DEM_BYPASS_DATA1 ,0x55 }, + {WCD938X_DIGITAL_DEM_BYPASS_DATA2 ,0x55 }, + {WCD938X_DIGITAL_DEM_BYPASS_DATA3 ,0x01 }, +}; + +static bool wcd938x_rdwr_register (struct device *dev,unsigned int reg) +{ +switch (reg) { +case WCD938X_ANA_PAGE_REGISTER : +case WCD938X_ANA_BIAS : +case WCD938X_ANA_RX_SUPPLIES : +case WCD938X_ANA_HPH : +case WCD938X_ANA_EAR : +case WCD938X_ANA_EAR_COMPANDER_CTL : +case WCD938X_ANA_TX_CH1 : +case WCD938X_ANA_TX_CH2 : +case WCD938X_ANA_TX_CH3 : +case WCD938X_ANA_TX_CH4 : +case WCD938X_ANA_MICB1_MICB2_DSP_EN_LOGIC : +case WCD938X_ANA_MICB3_DSP_EN_LOGIC : +case WCD938X_ANA_MBHC_MECH : +case WCD938X_ANA_MBHC_ELECT : +case WCD938X_ANA_MBHC_ZDET : +case WCD938X_ANA_MBHC_BTN0 : +case WCD938X_ANA_MBHC_BTN1 : +case WCD938X_ANA_MBHC_BTN2 : +case WCD938X_ANA_MBHC_BTN3 : +case WCD938X_ANA_MBHC_BTN4 : +case WCD938X_ANA_MBHC_BTN5 : +case WCD938X_ANA_MBHC_BTN6 : +case WCD938X_ANA_MBHC_BTN7 : +case WCD938X_ANA_MICB1 : +case WCD938X_ANA_MICB2 : +case WCD938X_ANA_MICB2_RAMP : +case WCD938X_ANA_MICB3 : +case WCD938X_ANA_MICB4 : +case WCD938X_BIAS_CTL : +case WCD938X_BIAS_VBG_FINE_ADJ : +case WCD938X_LDOL_VDDCX_ADJUST : +case WCD938X_LDOL_DISABLE_LDOL : +case WCD938X_MBHC_CTL_CLK : +case WCD938X_MBHC_CTL_ANA : +case WCD938X_MBHC_CTL_SPARE_1 : +case WCD938X_MBHC_CTL_SPARE_2 : +case WCD938X_MBHC_CTL_BCS : +case WCD938X_MBHC_TEST_CTL : +case WCD938X_LDOH_MODE : +case WCD938X_LDOH_BIAS : +case WCD938X_LDOH_STB_LOADS : +case WCD938X_LDOH_SLOWRAMP : +case WCD938X_MICB1_TEST_CTL_1 : +case WCD938X_MICB1_TEST_CTL_2 : +case WCD938X_MICB1_TEST_CTL_3 : +case WCD938X_MICB2_TEST_CTL_1 : +case WCD938X_MICB2_TEST_CTL_2 : +case WCD938X_MICB2_TEST_CTL_3 : +case WCD938X_MICB3_TEST_CTL_1 : +case WCD938X_MICB3_TEST_CTL_2 : +case WCD938X_MICB3_TEST_CTL_3 : +case WCD938X_MICB4_TEST_CTL_1 : +case WCD938X_MICB4_TEST_CTL_2 : +case WCD938X_MICB4_TEST_CTL_3 : +case WCD938X_TX_COM_ADC_VCM : +case WCD938X_TX_COM_BIAS_ATEST : +case WCD938X_TX_COM_SPARE1 : +case WCD938X_TX_COM_SPARE2 : +case WCD938X_TX_COM_TXFE_DIV_CTL : +case WCD938X_TX_COM_TXFE_DIV_START : +case WCD938X_TX_COM_SPARE3 : +case WCD938X_TX_COM_SPARE4 : +case WCD938X_TX_1_2_TEST_EN : +case WCD938X_TX_1_2_ADC_IB : +case WCD938X_TX_1_2_ATEST_REFCTL : +case WCD938X_TX_1_2_TEST_CTL : +case WCD938X_TX_1_2_TEST_BLK_EN1 : +case WCD938X_TX_1_2_TXFE1_CLKDIV : +case WCD938X_TX_3_4_TEST_EN : +case WCD938X_TX_3_4_ADC_IB : +case WCD938X_TX_3_4_ATEST_REFCTL : +case WCD938X_TX_3_4_TEST_CTL : +case WCD938X_TX_3_4_TEST_BLK_EN3 : +case WCD938X_TX_3_4_TXFE3_CLKDIV : +case WCD938X_TX_3_4_TEST_BLK_EN2 : +case WCD938X_TX_3_4_TXFE2_CLKDIV : +case WCD938X_TX_3_4_SPARE1 : +case WCD938X_TX_3_4_TEST_BLK_EN4 : +case WCD938X_TX_3_4_TXFE4_CLKDIV : +case WCD938X_TX_3_4_SPARE2 : +case WCD938X_CLASSH_MODE_1 : +case WCD938X_CLASSH_MODE_2 : +case WCD938X_CLASSH_MODE_3 : +case WCD938X_CLASSH_CTRL_VCL_1 : +case WCD938X_CLASSH_CTRL_VCL_2 : +case WCD938X_CLASSH_CTRL_CCL_1 : +case WCD938X_CLASSH_CTRL_CCL_2 : +case WCD938X_CLASSH_CTRL_CCL_3 : +case WCD938X_CLASSH_CTRL_CCL_4 : +case WCD938X_CLASSH_CTRL_CCL_5 : +case WCD938X_CLASSH_BUCK_TMUX_A_D : +case WCD938X_CLASSH_BUCK_SW_DRV_CNTL : +case WCD938X_CLASSH_SPARE : +case WCD938X_FLYBACK_EN : +case WCD938X_FLYBACK_VNEG_CTRL_1 : +case WCD938X_FLYBACK_VNEG_CTRL_2 : +case WCD938X_FLYBACK_VNEG_CTRL_3 : +case WCD938X_FLYBACK_VNEG_CTRL_4 : +case WCD938X_FLYBACK_VNEG_CTRL_5 : +case WCD938X_FLYBACK_VNEG_CTRL_6 : +case WCD938X_FLYBACK_VNEG_CTRL_7 : +case WCD938X_FLYBACK_VNEG_CTRL_8 : +case WCD938X_FLYBACK_VNEG_CTRL_9 : +case WCD938X_FLYBACK_VNEGDAC_CTRL_1 : +case WCD938X_FLYBACK_VNEGDAC_CTRL_2 : +case WCD938X_FLYBACK_VNEGDAC_CTRL_3 : +case WCD938X_FLYBACK_CTRL_1 : +case WCD938X_FLYBACK_TEST_CTL : +case WCD938X_RX_AUX_SW_CTL : +case WCD938X_RX_PA_AUX_IN_CONN : +case WCD938X_RX_TIMER_DIV : +case WCD938X_RX_OCP_CTL : +case WCD938X_RX_OCP_COUNT : +case WCD938X_RX_BIAS_EAR_DAC : +case WCD938X_RX_BIAS_EAR_AMP : +case WCD938X_RX_BIAS_HPH_LDO : +case WCD938X_RX_BIAS_HPH_PA : +case WCD938X_RX_BIAS_HPH_RDACBUFF_CNP2 : +case WCD938X_RX_BIAS_HPH_RDAC_LDO : +case WCD938X_RX_BIAS_HPH_CNP1 : +case WCD938X_RX_BIAS_HPH_LOWPOWER : +case WCD938X_RX_BIAS_AUX_DAC : +case WCD938X_RX_BIAS_AUX_AMP : +case WCD938X_RX_BIAS_VNEGDAC_BLEEDER : +case WCD938X_RX_BIAS_MISC : +case WCD938X_RX_BIAS_BUCK_RST : +case WCD938X_RX_BIAS_BUCK_VREF_ERRAMP : +case WCD938X_RX_BIAS_FLYB_ERRAMP : +case WCD938X_RX_BIAS_FLYB_BUFF : +case WCD938X_RX_BIAS_FLYB_MID_RST : +case WCD938X_HPH_CNP_EN : +case WCD938X_HPH_CNP_WG_CTL : +case WCD938X_HPH_CNP_WG_TIME : +case WCD938X_HPH_OCP_CTL : +case WCD938X_HPH_AUTO_CHOP : +case WCD938X_HPH_CHOP_CTL : +case WCD938X_HPH_PA_CTL1 : +case WCD938X_HPH_PA_CTL2 : +case WCD938X_HPH_L_EN : +case WCD938X_HPH_L_TEST : +case WCD938X_HPH_L_ATEST : +case WCD938X_HPH_R_EN : +case WCD938X_HPH_R_TEST : +case WCD938X_HPH_R_ATEST : +case WCD938X_HPH_RDAC_CLK_CTL1 : +case WCD938X_HPH_RDAC_CLK_CTL2 : +case WCD938X_HPH_RDAC_LDO_CTL : +case WCD938X_HPH_RDAC_CHOP_CLK_LP_CTL : +case WCD938X_HPH_REFBUFF_UHQA_CTL : +case WCD938X_HPH_REFBUFF_LP_CTL : +case WCD938X_HPH_L_DAC_CTL : +case WCD938X_HPH_R_DAC_CTL : +case WCD938X_HPH_SURGE_HPHLR_SURGE_COMP_SEL : +case WCD938X_HPH_SURGE_HPHLR_SURGE_EN : +case WCD938X_HPH_SURGE_HPHLR_SURGE_MISC1 : +case WCD938X_EAR_EAR_EN_REG : +case WCD938X_EAR_EAR_PA_CON : +case WCD938X_EAR_EAR_SP_CON : +case WCD938X_EAR_EAR_DAC_CON : +case WCD938X_EAR_EAR_CNP_FSM_CON : +case WCD938X_EAR_TEST_CTL : +case WCD938X_ANA_NEW_PAGE_REGISTER : +case WCD938X_HPH_NEW_ANA_HPH2 : +case WCD938X_HPH_NEW_ANA_HPH3 : +case WCD938X_SLEEP_CTL : +case WCD938X_SLEEP_WATCHDOG_CTL : +case WCD938X_MBHC_NEW_ELECT_REM_CLAMP_CTL : +case WCD938X_MBHC_NEW_CTL_1 : +case WCD938X_MBHC_NEW_CTL_2 : +case WCD938X_MBHC_NEW_PLUG_DETECT_CTL : +case WCD938X_MBHC_NEW_ZDET_ANA_CTL : +case WCD938X_MBHC_NEW_ZDET_RAMP_CTL : +case WCD938X_TX_NEW_AMIC_MUX_CFG : +case WCD938X_AUX_AUXPA : +case WCD938X_LDORXTX_MODE : +case WCD938X_LDORXTX_CONFIG : +case WCD938X_DIE_CRACK_DIE_CRK_DET_EN : +case WCD938X_HPH_NEW_INT_RDAC_GAIN_CTL : +case WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_L : +case WCD938X_HPH_NEW_INT_RDAC_VREF_CTL : +case WCD938X_HPH_NEW_INT_RDAC_OVERRIDE_CTL : +case WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_R : +case WCD938X_HPH_NEW_INT_PA_MISC1 : +case WCD938X_HPH_NEW_INT_PA_MISC2 : +case WCD938X_HPH_NEW_INT_PA_RDAC_MISC : +case WCD938X_HPH_NEW_INT_HPH_TIMER1 : +case WCD938X_HPH_NEW_INT_HPH_TIMER2 : +case WCD938X_HPH_NEW_INT_HPH_TIMER3 : +case WCD938X_HPH_NEW_INT_HPH_TIMER4 : +case WCD938X_HPH_NEW_INT_PA_RDAC_MISC2 : +case WCD938X_HPH_NEW_INT_PA_RDAC_MISC3 : +case WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_L_NEW : +case WCD938X_HPH_NEW_INT_RDAC_HD2_CTL_R_NEW : +case WCD938X_RX_NEW_INT_HPH_RDAC_BIAS_LOHIFI : +case WCD938X_RX_NEW_INT_HPH_RDAC_BIAS_ULP : +case WCD938X_RX_NEW_INT_HPH_RDAC_LDO_LP : +case WCD938X_MBHC_NEW_INT_MOISTURE_DET_DC_CTRL : +case WCD938X_MBHC_NEW_INT_MOISTURE_DET_POLLING_CTRL : +case WCD938X_MBHC_NEW_INT_MECH_DET_CURRENT : +case WCD938X_MBHC_NEW_INT_SPARE_2 : +case WCD938X_EAR_INT_NEW_EAR_CHOPPER_CON : +case WCD938X_EAR_INT_NEW_CNP_VCM_CON1 : +case WCD938X_EAR_INT_NEW_CNP_VCM_CON2 : +case WCD938X_EAR_INT_NEW_EAR_DYNAMIC_BIAS : +case WCD938X_AUX_INT_EN_REG : +case WCD938X_AUX_INT_PA_CTRL : +case WCD938X_AUX_INT_SP_CTRL : +case WCD938X_AUX_INT_DAC_CTRL : +case WCD938X_AUX_INT_CLK_CTRL : +case WCD938X_AUX_INT_TEST_CTRL : +case WCD938X_AUX_INT_MISC : +case WCD938X_LDORXTX_INT_BIAS : +case WCD938X_LDORXTX_INT_STB_LOADS_DTEST : +case WCD938X_LDORXTX_INT_TEST0 : +case WCD938X_LDORXTX_INT_STARTUP_TIMER : +case WCD938X_LDORXTX_INT_TEST1 : +case WCD938X_SLEEP_INT_WATCHDOG_CTL_1 : +case WCD938X_SLEEP_INT_WATCHDOG_CTL_2 : +case WCD938X_DIE_CRACK_INT_DIE_CRK_DET_INT1 : +case WCD938X_DIE_CRACK_INT_DIE_CRK_DET_INT2 : +case WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_L2 : +case WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_L1 : +case WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_L0 : +case WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_ULP1P2M : +case WCD938X_TX_COM_NEW_INT_TXFE_DIVSTOP_ULP0P6M : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG1_L2L1 : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG1_L0 : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG1_ULP : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2MAIN_L2L1 : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2MAIN_L0 : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2MAIN_ULP : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2CASC_L2L1L0 : +case WCD938X_TX_COM_NEW_INT_TXFE_ICTRL_STG2CASC_ULP : +case WCD938X_TX_COM_NEW_INT_TXADC_SCBIAS_L2L1 : +case WCD938X_TX_COM_NEW_INT_TXADC_SCBIAS_L0ULP : +case WCD938X_TX_COM_NEW_INT_TXADC_INT_L2 : +case WCD938X_TX_COM_NEW_INT_TXADC_INT_L1 : +case WCD938X_TX_COM_NEW_INT_TXADC_INT_L0 : +case WCD938X_TX_COM_NEW_INT_TXADC_INT_ULP : +case WCD938X_DIGITAL_PAGE_REGISTER : +case WCD938X_DIGITAL_SWR_TX_CLK_RATE : +case WCD938X_DIGITAL_CDC_RST_CTL : +case WCD938X_DIGITAL_TOP_CLK_CFG : +case WCD938X_DIGITAL_CDC_ANA_CLK_CTL : +case WCD938X_DIGITAL_CDC_DIG_CLK_CTL : +case WCD938X_DIGITAL_SWR_RST_EN : +case WCD938X_DIGITAL_CDC_PATH_MODE : +case WCD938X_DIGITAL_CDC_RX_RST : +case WCD938X_DIGITAL_CDC_RX0_CTL : +case WCD938X_DIGITAL_CDC_RX1_CTL : +case WCD938X_DIGITAL_CDC_RX2_CTL : +case WCD938X_DIGITAL_CDC_TX_ANA_MODE_0_1 : +case WCD938X_DIGITAL_CDC_TX_ANA_MODE_2_3 : +case WCD938X_DIGITAL_CDC_COMP_CTL_0 : +case WCD938X_DIGITAL_CDC_ANA_TX_CLK_CTL : +case WCD938X_DIGITAL_CDC_HPH_DSM_A1_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A1_1 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A2_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A2_1 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A3_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A3_1 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A4_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A4_1 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A5_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A5_1 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A6_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_A7_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_C_0 : +case WCD938X_DIGITAL_CDC_HPH_DSM_C_1 : +case WCD938X_DIGITAL_CDC_HPH_DSM_C_2 : +case WCD938X_DIGITAL_CDC_HPH_DSM_C_3 : +case WCD938X_DIGITAL_CDC_HPH_DSM_R1 : +case WCD938X_DIGITAL_CDC_HPH_DSM_R2 : +case WCD938X_DIGITAL_CDC_HPH_DSM_R3 : +case WCD938X_DIGITAL_CDC_HPH_DSM_R4 : +case WCD938X_DIGITAL_CDC_HPH_DSM_R5 : +case WCD938X_DIGITAL_CDC_HPH_DSM_R6 : +case WCD938X_DIGITAL_CDC_HPH_DSM_R7 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A1_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A1_1 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A2_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A2_1 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A3_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A3_1 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A4_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A4_1 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A5_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A5_1 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A6_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_A7_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_C_0 : +case WCD938X_DIGITAL_CDC_AUX_DSM_C_1 : +case WCD938X_DIGITAL_CDC_AUX_DSM_C_2 : +case WCD938X_DIGITAL_CDC_AUX_DSM_C_3 : +case WCD938X_DIGITAL_CDC_AUX_DSM_R1 : +case WCD938X_DIGITAL_CDC_AUX_DSM_R2 : +case WCD938X_DIGITAL_CDC_AUX_DSM_R3 : +case WCD938X_DIGITAL_CDC_AUX_DSM_R4 : +case WCD938X_DIGITAL_CDC_AUX_DSM_R5 : +case WCD938X_DIGITAL_CDC_AUX_DSM_R6 : +case WCD938X_DIGITAL_CDC_AUX_DSM_R7 : +case WCD938X_DIGITAL_CDC_HPH_GAIN_RX_0 : +case WCD938X_DIGITAL_CDC_HPH_GAIN_RX_1 : +case WCD938X_DIGITAL_CDC_HPH_GAIN_DSD_0 : +case WCD938X_DIGITAL_CDC_HPH_GAIN_DSD_1 : +case WCD938X_DIGITAL_CDC_HPH_GAIN_DSD_2 : +case WCD938X_DIGITAL_CDC_AUX_GAIN_DSD_0 : +case WCD938X_DIGITAL_CDC_AUX_GAIN_DSD_1 : +case WCD938X_DIGITAL_CDC_AUX_GAIN_DSD_2 : +case WCD938X_DIGITAL_CDC_HPH_GAIN_CTL : +case WCD938X_DIGITAL_CDC_AUX_GAIN_CTL : +case WCD938X_DIGITAL_CDC_EAR_PATH_CTL : +case WCD938X_DIGITAL_CDC_SWR_CLH : +case WCD938X_DIGITAL_SWR_CLH_BYP : +case WCD938X_DIGITAL_CDC_TX0_CTL : +case WCD938X_DIGITAL_CDC_TX1_CTL : +case WCD938X_DIGITAL_CDC_TX2_CTL : +case WCD938X_DIGITAL_CDC_TX_RST : +case WCD938X_DIGITAL_CDC_REQ_CTL : +case WCD938X_DIGITAL_CDC_RST : +case WCD938X_DIGITAL_CDC_AMIC_CTL : +case WCD938X_DIGITAL_CDC_DMIC_CTL : +case WCD938X_DIGITAL_CDC_DMIC1_CTL : +case WCD938X_DIGITAL_CDC_DMIC2_CTL : +case WCD938X_DIGITAL_CDC_DMIC3_CTL : +case WCD938X_DIGITAL_CDC_DMIC4_CTL : +case WCD938X_DIGITAL_EFUSE_PRG_CTL : +case WCD938X_DIGITAL_EFUSE_CTL : +case WCD938X_DIGITAL_CDC_DMIC_RATE_1_2 : +case WCD938X_DIGITAL_CDC_DMIC_RATE_3_4 : +case WCD938X_DIGITAL_PDM_WD_CTL0 : +case WCD938X_DIGITAL_PDM_WD_CTL1 : +case WCD938X_DIGITAL_PDM_WD_CTL2 : +case WCD938X_DIGITAL_INTR_MODE : +case WCD938X_DIGITAL_INTR_MASK_0 : +case WCD938X_DIGITAL_INTR_MASK_1 : +case WCD938X_DIGITAL_INTR_MASK_2 : +case WCD938X_DIGITAL_INTR_CLEAR_0 : +case WCD938X_DIGITAL_INTR_CLEAR_1 : +case WCD938X_DIGITAL_INTR_CLEAR_2 : +case WCD938X_DIGITAL_INTR_LEVEL_0 : +case WCD938X_DIGITAL_INTR_LEVEL_1 : +case WCD938X_DIGITAL_INTR_LEVEL_2 : +case WCD938X_DIGITAL_INTR_SET_0 : +case WCD938X_DIGITAL_INTR_SET_1 : +case WCD938X_DIGITAL_INTR_SET_2 : +case WCD938X_DIGITAL_INTR_TEST_0 : +case WCD938X_DIGITAL_INTR_TEST_1 : +case WCD938X_DIGITAL_INTR_TEST_2 : +case WCD938X_DIGITAL_TX_MODE_DBG_EN : +case WCD938X_DIGITAL_TX_MODE_DBG_0_1 : +case WCD938X_DIGITAL_TX_MODE_DBG_2_3 : +case WCD938X_DIGITAL_LB_IN_SEL_CTL : +case WCD938X_DIGITAL_LOOP_BACK_MODE : +case WCD938X_DIGITAL_SWR_DAC_TEST : +case WCD938X_DIGITAL_SWR_HM_TEST_RX_0 : +case WCD938X_DIGITAL_SWR_HM_TEST_TX_0 : +case WCD938X_DIGITAL_SWR_HM_TEST_RX_1 : +case WCD938X_DIGITAL_SWR_HM_TEST_TX_1 : +case WCD938X_DIGITAL_SWR_HM_TEST_TX_2 : +case WCD938X_DIGITAL_PAD_CTL_SWR_0 : +case WCD938X_DIGITAL_PAD_CTL_SWR_1 : +case WCD938X_DIGITAL_I2C_CTL : +case WCD938X_DIGITAL_CDC_TX_TANGGU_SW_MODE : +case WCD938X_DIGITAL_EFUSE_TEST_CTL_0 : +case WCD938X_DIGITAL_EFUSE_TEST_CTL_1 : +case WCD938X_DIGITAL_PAD_CTL_PDM_RX0 : +case WCD938X_DIGITAL_PAD_CTL_PDM_RX1 : +case WCD938X_DIGITAL_PAD_CTL_PDM_TX0 : +case WCD938X_DIGITAL_PAD_CTL_PDM_TX1 : +case WCD938X_DIGITAL_PAD_CTL_PDM_TX2 : +case WCD938X_DIGITAL_PAD_INP_DIS_0 : +case WCD938X_DIGITAL_PAD_INP_DIS_1 : +case WCD938X_DIGITAL_DRIVE_STRENGTH_0 : +case WCD938X_DIGITAL_DRIVE_STRENGTH_1 : +case WCD938X_DIGITAL_DRIVE_STRENGTH_2 : +case WCD938X_DIGITAL_RX_DATA_EDGE_CTL : +case WCD938X_DIGITAL_TX_DATA_EDGE_CTL : +case WCD938X_DIGITAL_GPIO_MODE : +case WCD938X_DIGITAL_PIN_CTL_OE : +case WCD938X_DIGITAL_PIN_CTL_DATA_0 : +case WCD938X_DIGITAL_PIN_CTL_DATA_1 : +case WCD938X_DIGITAL_DIG_DEBUG_CTL : +case WCD938X_DIGITAL_DIG_DEBUG_EN : +case WCD938X_DIGITAL_ANA_CSR_DBG_ADD : +case WCD938X_DIGITAL_ANA_CSR_DBG_CTL : +case WCD938X_DIGITAL_SSP_DBG : +case WCD938X_DIGITAL_SPARE_0 : +case WCD938X_DIGITAL_SPARE_1 : +case WCD938X_DIGITAL_SPARE_2 : +case WCD938X_DIGITAL_TX_REQ_FB_CTL_0 : +case WCD938X_DIGITAL_TX_REQ_FB_CTL_1 : +case WCD938X_DIGITAL_TX_REQ_FB_CTL_2 : +case WCD938X_DIGITAL_TX_REQ_FB_CTL_3 : +case WCD938X_DIGITAL_TX_REQ_FB_CTL_4 : +case WCD938X_DIGITAL_DEM_BYPASS_DATA0 : +case WCD938X_DIGITAL_DEM_BYPASS_DATA1 : +case WCD938X_DIGITAL_DEM_BYPASS_DATA2 : +case WCD938X_DIGITAL_DEM_BYPASS_DATA3 : +return true; + } + +return false; +} + +static bool wcd938x_readonly_register (struct device *dev,unsigned int reg) +{ +switch (reg) { +case WCD938X_ANA_MBHC_RESULT_1 : +case WCD938X_ANA_MBHC_RESULT_2 : +case WCD938X_ANA_MBHC_RESULT_3 : +case WCD938X_MBHC_MOISTURE_DET_FSM_STATUS : +case WCD938X_TX_1_2_SAR2_ERR : +case WCD938X_TX_1_2_SAR1_ERR : +case WCD938X_TX_3_4_SAR4_ERR : +case WCD938X_TX_3_4_SAR3_ERR : +case WCD938X_HPH_L_STATUS : +case WCD938X_HPH_R_STATUS : +case WCD938X_HPH_SURGE_HPHLR_SURGE_STATUS : +case WCD938X_EAR_STATUS_REG_1 : +case WCD938X_EAR_STATUS_REG_2 : +case WCD938X_MBHC_NEW_FSM_STATUS : +case WCD938X_MBHC_NEW_ADC_RESULT : +case WCD938X_DIE_CRACK_DIE_CRK_DET_OUT : +case WCD938X_AUX_INT_STATUS_REG : +case WCD938X_LDORXTX_INT_STATUS : +case WCD938X_DIGITAL_CHIP_ID0 : +case WCD938X_DIGITAL_CHIP_ID1 : +case WCD938X_DIGITAL_CHIP_ID2 : +case WCD938X_DIGITAL_CHIP_ID3 : +case WCD938X_DIGITAL_INTR_STATUS_0 : +case WCD938X_DIGITAL_INTR_STATUS_1 : +case WCD938X_DIGITAL_INTR_STATUS_2 : +case WCD938X_DIGITAL_INTR_CLEAR_0 : +case WCD938X_DIGITAL_INTR_CLEAR_1 : +case WCD938X_DIGITAL_INTR_CLEAR_2 : +case WCD938X_DIGITAL_SWR_HM_TEST_0 : +case WCD938X_DIGITAL_SWR_HM_TEST_1 : +case WCD938X_DIGITAL_EFUSE_T_DATA_0 : +case WCD938X_DIGITAL_EFUSE_T_DATA_1 : +case WCD938X_DIGITAL_PIN_STATUS_0 : +case WCD938X_DIGITAL_PIN_STATUS_1 : +case WCD938X_DIGITAL_MODE_STATUS_0 : +case WCD938X_DIGITAL_MODE_STATUS_1 : +case WCD938X_DIGITAL_EFUSE_REG_0 : +case WCD938X_DIGITAL_EFUSE_REG_1 : +case WCD938X_DIGITAL_EFUSE_REG_2 : +case WCD938X_DIGITAL_EFUSE_REG_3 : +case WCD938X_DIGITAL_EFUSE_REG_4 : +case WCD938X_DIGITAL_EFUSE_REG_5 : +case WCD938X_DIGITAL_EFUSE_REG_6 : +case WCD938X_DIGITAL_EFUSE_REG_7 : +case WCD938X_DIGITAL_EFUSE_REG_8 : +case WCD938X_DIGITAL_EFUSE_REG_9 : +case WCD938X_DIGITAL_EFUSE_REG_10 : +case WCD938X_DIGITAL_EFUSE_REG_11 : +case WCD938X_DIGITAL_EFUSE_REG_12 : +case WCD938X_DIGITAL_EFUSE_REG_13 : +case WCD938X_DIGITAL_EFUSE_REG_14 : +case WCD938X_DIGITAL_EFUSE_REG_15 : +case WCD938X_DIGITAL_EFUSE_REG_16 : +case WCD938X_DIGITAL_EFUSE_REG_17 : +case WCD938X_DIGITAL_EFUSE_REG_18 : +case WCD938X_DIGITAL_EFUSE_REG_19 : +case WCD938X_DIGITAL_EFUSE_REG_20 : +case WCD938X_DIGITAL_EFUSE_REG_21 : +case WCD938X_DIGITAL_EFUSE_REG_22 : +case WCD938X_DIGITAL_EFUSE_REG_23 : +case WCD938X_DIGITAL_EFUSE_REG_24 : +case WCD938X_DIGITAL_EFUSE_REG_25 : +case WCD938X_DIGITAL_EFUSE_REG_26 : +case WCD938X_DIGITAL_EFUSE_REG_27 : +case WCD938X_DIGITAL_EFUSE_REG_28 : +case WCD938X_DIGITAL_EFUSE_REG_29 : +case WCD938X_DIGITAL_EFUSE_REG_30 : +case WCD938X_DIGITAL_EFUSE_REG_31 : +return true; + } +return false; +} + +static bool wcd938x_readable_register (struct device *dev,unsigned int reg) +{ +bool ret; + + ret =wcd938x_readonly_register (dev, reg); +if (!ret) +return wcd938x_rdwr_register (dev, reg); + +return ret; +} + +static bool wcd938x_writeable_register (struct device *dev,unsigned int reg) +{ +return wcd938x_rdwr_register (dev, reg); +} + +static bool wcd938x_volatile_register (struct device *dev,unsigned int reg) +{ +if (reg <=WCD938X_BASE_ADDRESS ) +return false; + +if (reg ==WCD938X_DIGITAL_SWR_TX_CLK_RATE ) +return true; + +if (wcd938x_readonly_register (dev, reg)) +return true; + +return false; +} + +static const struct regmap_config wcd938x_regmap_config = { + .name ="wcd938x_csr" , + .reg_bits =32 , + .val_bits =8 , + .cache_type =REGCACHE_RBTREE , + .reg_defaults = wcd938x_defaults, + .num_reg_defaults =ARRAY_SIZE (wcd938x_defaults), + .max_register =WCD938X_MAX_REGISTER , + .readable_reg = wcd938x_readable_register, + .writeable_reg = wcd938x_writeable_register, + .volatile_reg = wcd938x_volatile_register, + .can_multi_write = true, +}; +static const struct sdw_slave_ops wcd9380_slave_ops = { .update_status = wcd9380_update_status, .interrupt_callback = wcd9380_interrupt_callback,
@@ -261,6 +1263,16 @@ static int wcd9380_probe(struct sdw_slav wcd->ch_info = &wcd938x_sdw_rx_ch_info[0 ]; } +if (wcd->is_tx) { + wcd->regmap =devm_regmap_init_sdw (pdev, &wcd938x_regmap_config); +if (IS_ERR (wcd->regmap)) +return dev_err_probe (dev,PTR_ERR (wcd->regmap), +"Regmap init failed\n" ); + +/* Start in cache-only until device is enumerated */ +regcache_cache_only (wcd->regmap, true); + }; +pm_runtime_set_autosuspend_delay (dev,3000 );pm_runtime_use_autosuspend (dev);pm_runtime_mark_last_busy (dev);
@@ -278,22 +1290,23 @@ MODULE_DEVICE_TABLE(sdw, wcd9380_slave_istatic int __maybe_unused wcd938x_sdw_runtime_suspend (struct device *dev) { -struct regmap *regmap =dev_get_regmap (dev,NULL ); +struct wcd938x_sdw_priv *wcd =dev_get_drvdata (dev); -if (regmap) { -regcache_cache_only (regmap, true); -regcache_mark_dirty (regmap); +if (wcd->regmap) { +regcache_cache_only (wcd->regmap, true); +regcache_mark_dirty (wcd->regmap); } +return 0 ; }static int __maybe_unused wcd938x_sdw_runtime_resume (struct device *dev) { -struct regmap *regmap =dev_get_regmap (dev,NULL ); +struct wcd938x_sdw_priv *wcd =dev_get_drvdata (dev); -if (regmap) { -regcache_cache_only (regmap, false); -regcache_sync (regmap); +if (wcd->regmap) { +regcache_cache_only (wcd->regmap, false); +regcache_sync (wcd->regmap); }pm_runtime_mark_last_busy (dev);
sound/soc/codecs/wcd938x.c +4 -999
1,015 lines not on this page · raw message
sound/soc/codecs/wcd938x.h +1 -0
@@ -663,6 +663,7 @@ struct wcd938x_sdw_priv {bool is_tx;struct wcd938x_priv *wcd938x;struct irq_domain *slave_irq; +struct regmap *regmap; };#if IS_ENABLED (CONFIG_SND_SOC_WCD938X_SDW )
Greg Kroah-Hartman
maintainerPATCH 108/694 nilfs2: do not write dirty data after degenerating to read-only
In reply to Greg Kroah-HartmanFrom: Ryusuke Konishi <[email protected]>
commit 28a65b49eb53e172d23567005465019658bfdb4d upstream.
According to syzbot's report, mark_buffer_dirty() called from nilfs_segctor_do_construct() outputs a warning with some patterns after nilfs2 detects metadata corruption and degrades to read-only mode.
After such read-only degeneration, page cache data may be cleared through nilfs_clear_dirty_page() which may also clear the uptodate flag for their buffer heads. However, even after the degeneration, log writes are still performed by unmount processing etc., which causes mark_buffer_dirty() to be called for buffer heads without the "uptodate" flag and causes the warning.
Since any writes should not be done to a read-only file system in the first place, this fixes the warning in mark_buffer_dirty() by letting nilfs_segctor_do_construct() abort early if in read-only mode.
This also changes the retry check of nilfs_segctor_write_out() to avoid unnecessary log write retries if it detects -EROFS that nilfs_segctor_do_construct() returned.
--- fs/nilfs2/segment.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/nilfs2/segment.c +4 -1
@@ -2041,6 +2041,9 @@ static int nilfs_segctor_do_construct(ststruct the_nilfs *nilfs = sci->sc_super->s_fs_info;int err; +if (sb_rdonly (sci->sc_super)) +return -EROFS ; +nilfs_sc_cstage_set (sci,NILFS_ST_INIT ); sci->sc_cno = nilfs->ns_cno;
@@ -2724,7 +2727,7 @@ static void nilfs_segctor_write_out(struflush_work (&sci->sc_iput_work); - }while (ret && retrycount-- >0 ); + }while (ret && ret != -EROFS && retrycount-- >0 ); }/**
Greg Kroah-Hartman
maintainerPATCH 109/694 nilfs2: fix infinite loop in nilfs_mdt_get_block()
In reply to Greg Kroah-HartmanFrom: Ryusuke Konishi <[email protected]>
commit a6a491c048882e7e424d407d32cba0b52d9ef2bf upstream.
If the disk image that nilfs2 mounts is corrupted and a virtual block address obtained by block lookup for a metadata file is invalid, nilfs_bmap_lookup_at_level() may return the same internal return code as -ENOENT, meaning the block does not exist in the metadata file.
This duplication of return codes confuses nilfs_mdt_get_block(), causing it to read and create a metadata block indefinitely.
In particular, if this happens to the inode metadata file, ifile, semaphore i_rwsem can be left held, causing task hangs in lock_mount.
Fix this issue by making nilfs_bmap_lookup_at_level() treat virtual block address translation failures with -ENOENT as metadata corruption instead of returning the error code.
--- fs/nilfs2/bmap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
fs/nilfs2/bmap.c +12 -4
@@ -67,20 +67,28 @@ int nilfs_bmap_lookup_at_level(struct nidown_read (&bmap->b_sem); ret = bmap->b_ops->bop_lookup (bmap, key, level, ptrp); -if (ret <0 ) { - ret =nilfs_bmap_convert_error (bmap, __func__, ret); +if (ret <0 ) goto out; - } +if (NILFS_BMAP_USE_VBN (bmap)) { ret =nilfs_dat_translate (nilfs_bmap_get_dat (bmap), *ptrp, &blocknr);if (!ret) *ptrp = blocknr; +else if (ret == -ENOENT ) { +/* +* If there was no valid entry in DAT for the block +* address obtained by b_ops->bop_lookup, then pass +* internal code -EINVAL to nilfs_bmap_convert_error +* to treat it as metadata corruption. +*/ + ret = -EINVAL ; + } } out:up_read (&bmap->b_sem); -return ret; +return nilfs_bmap_convert_error (bmap, __func__, ret); } int nilfs_bmap_lookup_contig(struct nilfs_bmap *bmap, __u64 key, __u64 *ptrp,
Greg Kroah-Hartman
maintainerPATCH 110/694 mm: do not reclaim private data from pinned page
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit d824ec2a154677f63c56cc71ffe4578274f6e32e upstream.
If the page is pinned, there's no point in trying to reclaim it. Furthermore if the page is from the page cache we don't want to reclaim fs-private data from the page because the pinning process may be writing to the page at any time and reclaiming fs private info on a dirty page can upset the filesystem (see link below).
--- mm/vmscan.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
mm/vmscan.c +10 -0
@@ -1911,6 +1911,16 @@ retry: } } +/* +* Folio is unmapped now so it cannot be newly pinned anymore. +* No point in trying to reclaim folio if it is pinned. +* Furthermore we don't want to reclaim underlying fs metadata +* if the folio is pinned and thus potentially modified by the +* pinning process as that may upset the filesystem. +*/ +if (folio_maybe_dma_pinned (folio)) + goto activate_locked; + mapping =folio_mapping (folio);if (folio_test_dirty (folio)) {/*
Greg Kroah-Hartman
maintainerPATCH 111/694 drbd: correctly submit flush bio on barrier
In reply to Greg Kroah-HartmanFrom: Christoph Böhmwalder <[email protected]>
commit 3899d94e3831ee07ea6821c032dc297aec80586a upstream.
When we receive a flush command (or "barrier" in DRBD), we currently use a REQ_OP_FLUSH with the REQ_PREFLUSH flag set.
The correct way to submit a flush bio is by using a REQ_OP_WRITE without any data, and set the REQ_PREFLUSH flag.
Since commit b4a6bb3a67aa ("block: add a sanity check for non-write flush/fua bios"), this triggers a warning in the block layer, but this has been broken for quite some time before that.
So use the correct set of flags to actually make the flush happen.
--- drivers/block/drbd/drbd_receiver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/drbd/drbd_receiver.c +1 -1
@@ -1283,7 +1283,7 @@ static void one_flush_endio(struct bio *static void submit_one_flush (struct drbd_device *device,struct issue_flush_context *ctx) {struct bio *bio =bio_alloc (device->ldev->backing_bdev,0 , -REQ_OP_FLUSH |REQ_PREFLUSH ,GFP_NOIO ); +REQ_OP_WRITE |REQ_PREFLUSH ,GFP_NOIO );struct one_flush_context *octx =kmalloc (sizeof (*octx),GFP_NOIO );if (!octx) {
Greg Kroah-Hartman
maintainerPATCH 112/694 md/raid10: fix null-ptr-deref in raid10_sync_request
In reply to Greg Kroah-HartmanFrom: Li Nan <[email protected]>
commit a405c6f0229526160aa3f177f65e20c86fce84c5 upstream.
init_resync() inits mempool and sets conf->have_replacemnt at the beginning of sync, close_sync() frees the mempool when sync is completed.
After [1] recovery might be skipped and init_resync() is called but close_sync() is not. null-ptr-deref occurs with r10bio->dev[i].repl_bio.
The following is one way to reproduce the issue.
1) create a array, wait for resync to complete, mddev->recovery_cp is set to MaxSector.
2) recovery is woken and it is skipped. conf->have_replacement is set to 0 in init_resync(). close_sync() not called.
3) some io errors and rdev A is set to WantReplacement.
4) a new device is added and set to A's replacement.
5) recovery is woken, A have replacement, but conf->have_replacemnt is
0. r10bio->dev[i].repl_bio will not be alloced and null-ptr-deref occurs.
Fix it by not calling init_resync() if recovery skipped.
[1] commit 7e83ccbecd60 ("md/raid10: Allow skipping recovery when clean arrays are assembled")
--- drivers/md/raid10.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/md/raid10.c +4 -4
@@ -3289,10 +3289,6 @@ static sector_t raid10_sync_request(strusector_t chunk_mask = conf->geo.chunk_mask;int page_idx =0 ; -if (!mempool_initialized (&conf->r10buf_pool)) -if (init_resync (conf)) -return 0 ; -/* * Allow skipping a full rebuild for incremental assembly * of a clean array, like RAID1 does.
@@ -3308,6 +3304,10 @@ static sector_t raid10_sync_request(strureturn mddev->dev_sectors - sector_nr; } +if (!mempool_initialized (&conf->r10buf_pool)) +if (init_resync (conf)) +return 0 ; + skipped: max_sector = mddev->dev_sectors; if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
Greg Kroah-Hartman
maintainerPATCH 113/694 md/raid5: Improve performance for sequential IO
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit fc05e06e6098ca2c28f7a10da0e00aeea20fa59e upstream.
Commit 7e55c60acfbb ("md/raid5: Pivot raid5_make_request()") changed the order in which requests for underlying disks are created. Since for large sequential IO adding of requests frequently races with md_raid5 thread submitting bios to underlying disks, this results in a change in IO pattern because intermediate states of new order of request creation result in more smaller discontiguous requests. For RAID5 on top of three rotational disks our performance testing revealed this results in regression in write throughput:
iozone -a -s 131072000 -y 4 -q 8 -i 0 -i 1 -R
before 7e55c60acfbb:
KB reclen write rewrite read reread
131072000 4 493670 525964 524575 513384
131072000 8 540467 532880 512028 513703after 7e55c60acfbb:
KB reclen write rewrite read reread
131072000 4 421785 456184 531278 509248
131072000 8 459283 456354 528449 543834To reduce the amount of discontiguous requests we can start generating requests with the stripe with the lowest chunk offset as that has the best chance of being adjacent to IO queued previously. This improves the performance to:
KB reclen write rewrite read reread
131072000 4 497682 506317 518043 514559
131072000 8 514048 501886 506453 504319restoring big part of the regression.
--- drivers/md/raid5.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-)
drivers/md/raid5.c +44 -1
@@ -6079,6 +6079,38 @@ out_release:return ret; } +/* +* If the bio covers multiple data disks, find sector within the bio that has +* the lowest chunk offset in the first chunk. +*/ +static sector_t raid5_bio_lowest_chunk_sector (struct r5conf *conf, +struct bio *bi) +{ +int sectors_per_chunk = conf->chunk_sectors; +int raid_disks = conf->raid_disks; +int dd_idx; +struct stripe_head sh; +unsigned int chunk_offset; +sector_t r_sector = bi->bi_iter.bi_sector & ~((sector_t )RAID5_STRIPE_SECTORS (conf)-1 ); +sector_t sector; + +/* We pass in fake stripe_head to get back parity disk numbers */ + sector =raid5_compute_sector (conf, r_sector,0 , &dd_idx, &sh); + chunk_offset =sector_div (sector, sectors_per_chunk); +if (sectors_per_chunk - chunk_offset >=bio_sectors (bi)) +return r_sector; +/* +* Bio crosses to the next data disk. Check whether it's in the same +* chunk. +*/ + dd_idx++; +while (dd_idx == sh.pd_idx || dd_idx == sh.qd_idx) + dd_idx++; +if (dd_idx >= raid_disks) +return r_sector; +return r_sector + sectors_per_chunk - chunk_offset; +} +static bool raid5_make_request (struct mddev *mddev,struct bio * bi) {DEFINE_WAIT_FUNC (wait, woken_wake_function);
@@ -6150,6 +6182,17 @@ static bool raid5_make_request(struct md }md_account_bio (mddev, &bi); +/* +* Lets start with the stripe with the lowest chunk offset in the first +* chunk. That has the best chances of creating IOs adjacent to +* previous IOs in case of sequential IO and thus creates the most +* sequential IO pattern. We don't bother with the optimization when +* reshaping as the performance benefit is not worth the complexity. +*/ +if (likely (conf->reshape_progress == MaxSector)) + logical_sector =raid5_bio_lowest_chunk_sector (conf, bi); + s = (logical_sector - ctx.first_sector) >>RAID5_STRIPE_SHIFT (conf); +add_wait_queue (&conf->wait_for_overlap, &wait);while (1 ) { res = make_stripe_request(mddev, conf, &ctx, logical_sector,
@@ -6178,7 +6221,7 @@ static bool raid5_make_request(struct mdcontinue ; } - s =find_first_bit (ctx.sectors_to_do, stripe_cnt); + s =find_next_bit_wrap (ctx.sectors_to_do, stripe_cnt, s);if (s == stripe_cnt)break ;
Greg Kroah-Hartman
maintainerPATCH 114/694 kasan: hw_tags: avoid invalid virt_to_page()
In reply to Greg Kroah-HartmanFrom: Mark Rutland <[email protected]>
commit 29083fd84da576bfb3563d044f98d38e6b338f00 upstream.
When booting with 'kasan.vmalloc=off', a kernel configured with support for KASAN_HW_TAGS will explode at boot time due to bogus use of virt_to_page() on a vmalloc adddress. With CONFIG_DEBUG_VIRTUAL selected this will be reported explicitly, and with or without CONFIG_DEBUG_VIRTUAL the kernel will dereference a bogus address:
| ------------[ cut here ]------------ | virt_to_phys used for non-linear address: (____ptrval____) (0xffff800008000000) | WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x78/0x80 | Modules linked in: | CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.3.0-rc3-00073-g83865133300d-dirty #4 | Hardware name: linux,dummy-virt (DT) | pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : __virt_to_phys+0x78/0x80 | lr : __virt_to_phys+0x78/0x80 | sp : ffffcd076afd3c80 | x29: ffffcd076afd3c80 x28: 0068000000000f07 x27: ffff800008000000 | x26: fffffbfff0000000 x25: fffffbffff000000 x24: ff00000000000000 | x23: ffffcd076ad3c000 x22: fffffc0000000000 x21: ffff800008000000 | x20: ffff800008004000 x19: ffff800008000000 x18: ffff800008004000 | x17: 666678302820295f x16: ffffffffffffffff x15: 0000000000000004 | x14: ffffcd076b009e88 x13: 0000000000000fff x12: 0000000000000003 | x11: 00000000ffffefff x10: c0000000ffffefff x9 : 0000000000000000 | x8 : 0000000000000000 x7 : 205d303030303030 x6 : 302e30202020205b | x5 : ffffcd076b41d63f x4 : ffffcd076afd3827 x3 : 0000000000000000 | x2 : 0000000000000000 x1 : ffffcd076afd3a30 x0 : 000000000000004f | Call trace: | __virt_to_phys+0x78/0x80 | __kasan_unpoison_vmalloc+0xd4/0x478 | __vmalloc_node_range+0x77c/0x7b8 | __vmalloc_node+0x54/0x64 | init_IRQ+0x94/0xc8 | start_kernel+0x194/0x420 | __primary_switched+0xbc/0xc4 | ---[ end trace 0000000000000000 ]--- | Unable to handle kernel paging request at virtual address 03fffacbe27b8000 | Mem abort info: | ESR = 0x0000000096000004 | EC = 0x25: DABT (current EL), IL = 32 bits | SET = 0, FnV = 0 | EA = 0, S1PTW = 0 | FSC = 0x04: level 0 translation fault | Data abort info: | ISV = 0, ISS = 0x00000004 | CM = 0, WnR = 0 | swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000041bc5000 | [03fffacbe27b8000] pgd=0000000000000000, p4d=0000000000000000 | Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP | Modules linked in: | CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 6.3.0-rc3-00073-g83865133300d-dirty #4 | Hardware name: linux,dummy-virt (DT) | pstate: 200000c5 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : __kasan_unpoison_vmalloc+0xe4/0x478 | lr : __kasan_unpoison_vmalloc+0xd4/0x478 | sp : ffffcd076afd3ca0 | x29: ffffcd076afd3ca0 x28: 0068000000000f07 x27: ffff800008000000 | x26: 0000000000000000 x25: 03fffacbe27b8000 x24: ff00000000000000 | x23: ffffcd076ad3c000 x22: fffffc0000000000 x21: ffff800008000000 | x20: ffff800008004000 x19: ffff800008000000 x18: ffff800008004000 | x17: 666678302820295f x16: ffffffffffffffff x15: 0000000000000004 | x14: ffffcd076b009e88 x13: 0000000000000fff x12: 0000000000000001 | x11: 0000800008000000 x10: ffff800008000000 x9 : ffffb2f8dee00000 | x8 : 000ffffb2f8dee00 x7 : 205d303030303030 x6 : 302e30202020205b | x5 : ffffcd076b41d63f x4 : ffffcd076afd3827 x3 : 0000000000000000 | x2 : 0000000000000000 x1 : ffffcd076afd3a30 x0 : ffffb2f8dee00000 | Call trace: | __kasan_unpoison_vmalloc+0xe4/0x478 | __vmalloc_node_range+0x77c/0x7b8 | __vmalloc_node+0x54/0x64 | init_IRQ+0x94/0xc8 | start_kernel+0x194/0x420 | __primary_switched+0xbc/0xc4 | Code: d34cfc08 aa1f03fa 8b081b39 d503201f (f9400328) | ---[ end trace 0000000000000000 ]--- | Kernel panic - not syncing: Attempted to kill the idle task!
This is because init_vmalloc_pages() erroneously calls virt_to_page() on a vmalloc address, while virt_to_page() is only valid for addresses in the linear/direct map. Since init_vmalloc_pages() expects virtual addresses in the vmalloc range, it must use vmalloc_to_page() rather than virt_to_page().
We call init_vmalloc_pages() from __kasan_unpoison_vmalloc(), where we check !is_vmalloc_or_module_addr(), suggesting that we might encounter a non-vmalloc address. Luckily, this never happens. By design, we only call __kasan_unpoison_vmalloc() on pointers in the vmalloc area, and I have verified that we don't violate that expectation. Given that, is_vmalloc_or_module_addr() must always be true for any legitimate argument to __kasan_unpoison_vmalloc().
Correct init_vmalloc_pages() to use vmalloc_to_page(), and remove the redundant and misleading use of is_vmalloc_or_module_addr() in __kasan_unpoison_vmalloc().
--- mm/kasan/hw_tags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/kasan/hw_tags.c +2 -2
@@ -285,7 +285,7 @@ static void init_vmalloc_pages(const voiconst void *addr;for (addr = start; addr < start + size; addr +=PAGE_SIZE ) { -struct page *page =virt_to_page (addr); +struct page *page =vmalloc_to_page (addr);clear_highpage_kasan_tagged (page); }
@@ -297,7 +297,7 @@ void *__kasan_unpoison_vmalloc(const voiu8 tag;unsigned long redzone_start, redzone_size; -if (!kasan_vmalloc_enabled () || !is_vmalloc_or_module_addr (start)) { +if (!kasan_vmalloc_enabled ()) {if (flags &KASAN_VMALLOC_INIT )init_vmalloc_pages (start, size);return (void *)start;
Greg Kroah-Hartman
maintainerPATCH 115/694 mtd: core: provide unique name for nvmem device, take two
In reply to Greg Kroah-HartmanFrom: Michael Walle <[email protected]>
commit 1cd9ceaa5282ff10ea20a7fbadde5a476a1cc99e upstream.
Commit c048b60d39e1 ("mtd: core: provide unique name for nvmem device") tries to give the nvmem device a unique name, but fails badly if the mtd device doesn't have a "struct device" associated with it, i.e. if CONFIG_MTD_PARTITIONED_MASTER is not set. This will result in the name "(null)-user-otp", which is not unique. It seems the best we can do is to use the compatible name together with a unique identifier added by the nvmem subsystem by using NVMEM_DEVID_AUTO.
--- drivers/mtd/mtdcore.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mtd/mtdcore.c +2 -3
@@ -888,8 +888,8 @@ static struct nvmem_device *mtd_otp_nvme/* OTP nvmem will be registered on the physical device */ config.dev = mtd->dev.parent; - config.name =kasprintf (GFP_KERNEL ,"%s-%s" ,dev_name (&mtd->dev), compatible); - config.id =NVMEM_DEVID_NONE ; + config.name = compatible; + config.id =NVMEM_DEVID_AUTO ; config.owner =THIS_MODULE ; config.type =NVMEM_TYPE_OTP ; config.root_only = true;
@@ -905,7 +905,6 @@ static struct nvmem_device *mtd_otp_nvme nvmem =NULL ;of_node_put (np); -kfree (config.name);return nvmem; }
Greg Kroah-Hartman
maintainerPATCH 116/694 mtd: core: fix nvmem error reporting
In reply to Greg Kroah-HartmanFrom: Michael Walle <[email protected]>
commit 8bd1d24e6ca3c599dd455b0e1b22f77bab8290eb upstream.
The master MTD will only have an associated device if CONFIG_MTD_PARTITIONED_MASTER is set, thus we cannot use dev_err() on mtd->dev. Instead use the parent device which is the physical flash memory.
--- drivers/mtd/mtdcore.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mtd/mtdcore.c +3 -2
@@ -939,6 +939,7 @@ static int mtd_nvmem_fact_otp_reg_read(vstatic int mtd_otp_nvmem_add (struct mtd_info *mtd) { +struct device *dev = mtd->dev.parent;struct nvmem_device *nvmem;ssize_t size;int err;
@@ -952,7 +953,7 @@ static int mtd_otp_nvmem_add(struct mtd_ nvmem =mtd_otp_nvmem_register (mtd,"user-otp" , size, mtd_nvmem_user_otp_reg_read);if (IS_ERR (nvmem)) { -dev_err (&mtd->dev,"Failed to register OTP NVMEM device\n" ); +dev_err (dev,"Failed to register OTP NVMEM device\n" );return PTR_ERR (nvmem); } mtd->otp_user_nvmem = nvmem;
@@ -970,7 +971,7 @@ static int mtd_otp_nvmem_add(struct mtd_ nvmem =mtd_otp_nvmem_register (mtd,"factory-otp" , size, mtd_nvmem_fact_otp_reg_read);if (IS_ERR (nvmem)) { -dev_err (&mtd->dev,"Failed to register OTP NVMEM device\n" ); +dev_err (dev,"Failed to register OTP NVMEM device\n" ); err =PTR_ERR (nvmem); goto err; }
Greg Kroah-Hartman
maintainerPATCH 117/694 mtd: core: fix error path for nvmem provider
In reply to Greg Kroah-HartmanFrom: Michael Walle <[email protected]>
commit e0489f6e221f5ddee6cb3bd51b992b790c5fa4b9 upstream.
If mtd_otp_nvmem_add() fails, the partitions won't be removed because there is simply no call to del_mtd_partitions(). Unfortunately, add_mtd_partitions() will print all partitions to the kernel console. If mtd_otp_nvmem_add() returns -EPROBE_DEFER this would print the partitions multiple times to the kernel console. Instead move mtd_otp_nvmem_add() to the beginning of the function.
--- drivers/mtd/mtdcore.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/mtd/mtdcore.c +10 -3
@@ -1023,10 +1023,14 @@ int mtd_device_parse_register(struct mtdmtd_set_dev_defaults (mtd); + ret =mtd_otp_nvmem_add (mtd); +if (ret) + goto out; +if (IS_ENABLED (CONFIG_MTD_PARTITIONED_MASTER )) { ret =add_mtd_device (mtd);if (ret) -return ret; + goto out; }/* Prefer parsed partitions over driver-provided fallback */
@@ -1061,9 +1065,12 @@ int mtd_device_parse_register(struct mtdregister_reboot_notifier (&mtd->reboot_notifier); } - ret =mtd_otp_nvmem_add (mtd); - out: +if (ret) { +nvmem_unregister (mtd->otp_user_nvmem); +nvmem_unregister (mtd->otp_factory_nvmem); + } +if (ret &&device_is_registered (&mtd->dev))del_mtd_device (mtd);
Greg Kroah-Hartman
maintainerPATCH 118/694 mtd: spi-nor: core: Update flashs current address mode when changing address mode
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit 37513c56139b79dd43c1774513c28f8ab2b05224 upstream.
The bug was obswerved while reading code. There are not many users of addr_mode_nbytes. Anyway, we should update the flash's current address mode when changing the address mode, fix it. We don't care for now about the set_4byte_addr_mode(nor, false) from spi_nor_restore(), as it is used at driver remove and shutdown.
--- drivers/mtd/spi-nor/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/core.c +3 -1
@@ -2732,6 +2732,7 @@ static int spi_nor_quad_enable(struct spstatic int spi_nor_init (struct spi_nor *nor) { +struct spi_nor_flash_parameter *params = nor->params;int err; err =spi_nor_octal_dtr_enable (nor, true);
@@ -2773,9 +2774,10 @@ static int spi_nor_init(struct spi_nor **/ WARN_ONCE (nor->flags &SNOR_F_BROKEN_RESET ,"enabling reset hack; may not recover from unexpected reboots\n" ); - err = nor->params->set_4byte_addr_mode (nor, true); + err = params->set_4byte_addr_mode (nor, true);if (err && err != -ENOTSUPP )return err; + params->addr_mode_nbytes =4 ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 119/694 drivers: remoteproc: xilinx: Fix carveout names
In reply to Greg Kroah-HartmanFrom: Tanmay Shah <[email protected]>
commit 81c18e08a609706c5c2887f267135fa0dece4119 upstream.
If the unit address is appended to node name of memory-region, then adding rproc carveouts fails as node name and unit-address both are passed as carveout name (i.e. vdev0vring0@xxxxxxxx). However, only node name is expected by remoteproc framework. This patch moves memory-region node parsing from driver probe to prepare and only passes node-name and not unit-address
--- drivers/remoteproc/xlnx_r5_remoteproc.c | 90 +++++++------------------------- 1 file changed, 20 insertions(+), 70 deletions(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +20 -70
@@ -61,8 +61,6 @@ static const struct mem_bank_data zynqmp* @np: device node of RPU instance * @tcm_bank_count: number TCM banks accessible to this RPU * @tcm_banks: array of each TCM bank data -* @rmem_count: Number of reserved mem regions -* @rmem: reserved memory region nodes from device tree * @rproc: rproc handle * @pm_domain_id: RPU CPU power domain id */
@@ -71,8 +69,6 @@ struct zynqmp_r5_core {struct device_node *np;int tcm_bank_count;struct mem_bank_data **tcm_banks; -int rmem_count; -struct reserved_mem **rmem;struct rproc *rproc;u32 pm_domain_id; };
@@ -239,21 +235,29 @@ static int add_mem_regions_carveout(stru {struct rproc_mem_entry *rproc_mem;struct zynqmp_r5_core *r5_core; +struct of_phandle_iterator it;struct reserved_mem *rmem; -int i, num_mem_regions; +int i =0 ; r5_core = (struct zynqmp_r5_core *)rproc->priv; - num_mem_regions = r5_core->rmem_count; -for (i =0 ; i < num_mem_regions; i++) { - rmem = r5_core->rmem[i]; +/* Register associated reserved memory regions */ +of_phandle_iterator_init (&it, r5_core->np,"memory-region" ,NULL ,0 ); -if (!strncmp (rmem->name,"vdev0buffer" ,strlen ("vdev0buffer" ))) { +while (of_phandle_iterator_next (&it) ==0 ) { + rmem =of_reserved_mem_lookup (it.node); +if (!rmem) { +of_node_put (it.node); +dev_err (&rproc->dev,"unable to acquire memory-region\n" ); +return -EINVAL ; + } + +if (!strcmp (it.node->name,"vdev0buffer" )) {/* Init reserved memory for vdev buffer */ rproc_mem =rproc_of_resm_mem_entry_init (&rproc->dev, i, rmem->size, rmem->base, - rmem->name); + it.node->name); }else {/* Register associated reserved memory regions */ rproc_mem = rproc_mem_entry_init(&rproc->dev, NULL,
@@ -261,16 +265,19 @@ static int add_mem_regions_carveout(stru rmem->size, rmem->base, zynqmp_r5_mem_region_map, zynqmp_r5_mem_region_unmap, - rmem->name); + it.node->name); } -if (!rproc_mem) +if (!rproc_mem) { +of_node_put (it.node);return -ENOMEM ; + }rproc_add_carveout (rproc, rproc_mem);dev_dbg (&rproc->dev,"reserved mem carveout %s addr=%llx, size=0x%llx" , - rmem->name, rmem->base, rmem->size); + it.node->name, rmem->base, rmem->size); + i++; }return 0 ;
@@ -726,59 +733,6 @@ static int zynqmp_r5_get_tcm_node(structreturn 0 ; } -/** -* zynqmp_r5_get_mem_region_node() -* parse memory-region property and get reserved mem regions -* -* @r5_core: pointer to zynqmp_r5_core type object -* -* Return: 0 for success and error code for failure. -*/ -static int zynqmp_r5_get_mem_region_node (struct zynqmp_r5_core *r5_core) -{ -struct device_node *np, *rmem_np; -struct reserved_mem **rmem; -int res_mem_count, i; -struct device *dev; - - dev = r5_core->dev; - np = r5_core->np; - - res_mem_count =of_property_count_elems_of_size (np,"memory-region" , -sizeof (phandle)); -if (res_mem_count <=0 ) { -dev_warn (dev,"failed to get memory-region property %d\n" , - res_mem_count); -return 0 ; - } - - rmem =devm_kcalloc (dev, res_mem_count, -sizeof (struct reserved_mem *),GFP_KERNEL ); -if (!rmem) -return -ENOMEM ; - -for (i =0 ; i < res_mem_count; i++) { - rmem_np =of_parse_phandle (np,"memory-region" , i); -if (!rmem_np) - goto release_rmem; - - rmem[i] =of_reserved_mem_lookup (rmem_np); -if (!rmem[i]) { -of_node_put (rmem_np); - goto release_rmem; - } - -of_node_put (rmem_np); - } - - r5_core->rmem_count = res_mem_count; - r5_core->rmem = rmem; -return 0 ; - -release_rmem: -return -EINVAL ; -} -/* * zynqmp_r5_core_init() * Create and initialize zynqmp_r5_core type object
@@ -806,10 +760,6 @@ static int zynqmp_r5_core_init(struct zyfor (i =0 ; i < cluster->core_count; i++) { r5_core = cluster->r5_cores[i]; - ret =zynqmp_r5_get_mem_region_node (r5_core); -if (ret) -dev_warn (dev,"memory-region prop failed %d\n" , ret); -/* Initialize r5 cores with power-domains parsed from dts */ ret =of_property_read_u32_index (r5_core->np,"power-domains" ,1 , &r5_core->pm_domain_id);
Greg Kroah-Hartman
maintainerPATCH 120/694 mailbox: zynqmp: Fix IPI isr handling
In reply to Greg Kroah-HartmanFrom: Tanmay Shah <[email protected]>
commit 74ad37a30ffee3643bc34f9ca7225b20a66abaaf upstream.
Multiple IPI channels are mapped to same interrupt handler. Current isr implementation handles only one channel per isr. Fix this behavior by checking isr status bit of all child mailbox nodes.
--- drivers/mailbox/zynqmp-ipi-mailbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mailbox/zynqmp-ipi-mailbox.c +3 -3
@@ -152,7 +152,7 @@ static irqreturn_t zynqmp_ipi_interrupt(struct zynqmp_ipi_message *msg;u64 arg0, arg3;struct arm_smccc_res res; -int ret, i; +int ret, i, status =IRQ_NONE ; (void )irq; arg0 =SMC_IPI_MAILBOX_STATUS_ENQUIRY ;
@@ -170,11 +170,11 @@ static irqreturn_t zynqmp_ipi_interrupt(memcpy_fromio (msg->data, mchan->req_buf, msg->len);mbox_chan_received_data (chan, (void *)msg); -return IRQ_HANDLED ; + status =IRQ_HANDLED ; } } } -return IRQ_NONE ; +return status; }/**
Greg Kroah-Hartman
maintainerPATCH 121/694 kcsan: Avoid READ_ONCE() in read_instrumented_memory()
In reply to Greg Kroah-HartmanFrom: Marco Elver <[email protected]>
commit 8dec88070d964bfeb4198f34cb5956d89dd1f557 upstream.
Haibo Li reported:
| Unable to handle kernel paging request at virtual address | ffffff802a0d8d7171 | Mem abort info:o: | ESR = 0x9600002121 | EC = 0x25: DABT (current EL), IL = 32 bitsts | SET = 0, FnV = 0 0 | EA = 0, S1PTW = 0 0 | FSC = 0x21: alignment fault | Data abort info:o: | ISV = 0, ISS = 0x0000002121 | CM = 0, WnR = 0 0 | swapper pgtable: 4k pages, 39-bit VAs, pgdp=000000002835200000 | [ffffff802a0d8d71] pgd=180000005fbf9003, p4d=180000005fbf9003, | pud=180000005fbf9003, pmd=180000005fbe8003, pte=006800002a0d8707 | Internal error: Oops: 96000021 [#1] PREEMPT SMP | Modules linked in: | CPU: 2 PID: 45 Comm: kworker/u8:2 Not tainted | 5.15.78-android13-8-g63561175bbda-dirty #1 | ... | pc : kcsan_setup_watchpoint+0x26c/0x6bc | lr : kcsan_setup_watchpoint+0x88/0x6bc | sp : ffffffc00ab4b7f0 | x29: ffffffc00ab4b800 x28: ffffff80294fe588 x27: 0000000000000001 | x26: 0000000000000019 x25: 0000000000000001 x24: ffffff80294fdb80 | x23: 0000000000000000 x22: ffffffc00a70fb68 x21: ffffff802a0d8d71 | x20: 0000000000000002 x19: 0000000000000000 x18: ffffffc00a9bd060 | x17: 0000000000000001 x16: 0000000000000000 x15: ffffffc00a59f000 | x14: 0000000000000001 x13: 0000000000000000 x12: ffffffc00a70faa0 | x11: 00000000aaaaaaab x10: 0000000000000054 x9 : ffffffc00839adf8 | x8 : ffffffc009b4cf00 x7 : 0000000000000000 x6 : 0000000000000007 | x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffffffc00a70fb70 | x2 : 0005ff802a0d8d71 x1 : 0000000000000000 x0 : 0000000000000000 | Call trace: | kcsan_setup_watchpoint+0x26c/0x6bc | __tsan_read2+0x1f0/0x234 | inflate_fast+0x498/0x750 | zlib_inflate+0x1304/0x2384 | __gunzip+0x3a0/0x45c | gunzip+0x20/0x30 | unpack_to_rootfs+0x2a8/0x3fc | do_populate_rootfs+0xe8/0x11c | async_run_entry_fn+0x58/0x1bc | process_one_work+0x3ec/0x738 | worker_thread+0x4c4/0x838 | kthread+0x20c/0x258 | ret_from_fork+0x10/0x20 | Code: b8bfc2a8 2a0803f7 14000007 d503249f (78bfc2a8) ) | ---[ end trace 613a943cb0a572b6 ]-----
The reason for this is that on certain arm64 configuration since e35123d83ee3 ("arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y"), READ_ONCE() may be promoted to a full atomic acquire instruction which cannot be used on unaligned addresses.
Fix it by avoiding READ_ONCE() in read_instrumented_memory(), and simply forcing the compiler to do the required access by casting to the appropriate volatile type. In terms of generated code this currently only affects architectures that do not use the default READ_ONCE() implementation.
The only downside is that we are not guaranteed atomicity of the access itself, although on most architectures a plain load up to machine word size should still be atomic (a fact the default READ_ONCE() still relies on itself).
--- kernel/kcsan/core.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
kernel/kcsan/core.c +13 -4
@@ -337,11 +337,20 @@ static void delay_access(int type)*/ static __always_inline u64 read_instrumented_memory(const volatile void *ptr, size_t size) { +/* +* In the below we don't necessarily need the read of the location to +* be atomic, and we don't use READ_ONCE(), since all we need for race +* detection is to observe 2 different values. +* +* Furthermore, on certain architectures (such as arm64), READ_ONCE() +* may turn into more complex instructions than a plain load that cannot +* do unaligned accesses. +*/ switch (size) { -case 1 :return READ_ONCE (*(const u8 *)ptr); -case 2 :return READ_ONCE (*(const u16 *)ptr); -case 4 :return READ_ONCE (*(const u32 *)ptr); -case 8 :return READ_ONCE (*(const u64 *)ptr); +case 1 :return *(const volatile u8 *)ptr; +case 2 :return *(const volatile u16 *)ptr; +case 4 :return *(const volatile u32 *)ptr; +case 8 :return *(const volatile u64 *)ptr;default :return 0 ;/* Ignore; we do not diff the values. */ } }
Greg Kroah-Hartman
maintainerPATCH 122/694 mailbox: zynqmp: Fix counts of child nodes
In reply to Greg Kroah-HartmanFrom: Tanmay Shah <[email protected]>
commit f72f805e72882c361e2a612c64a6e549f3da7152 upstream.
If child mailbox node status is disabled it causes crash in interrupt handler. Fix this by assigning only available child node during driver probe.
--- drivers/mailbox/zynqmp-ipi-mailbox.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/mailbox/zynqmp-ipi-mailbox.c +6 -1
@@ -634,7 +634,12 @@ static int zynqmp_ipi_probe(struct platfstruct zynqmp_ipi_mbox *mbox;int num_mboxes, ret = -EINVAL ; - num_mboxes =of_get_child_count (np); + num_mboxes =of_get_available_child_count (np); +if (num_mboxes ==0 ) { +dev_err (dev,"mailbox nodes not available\n" ); +return -EINVAL ; + } + pdata =devm_kzalloc (dev,struct_size (pdata, ipi_mboxes, num_mboxes),GFP_KERNEL );if (!pdata)
Greg Kroah-Hartman
maintainerPATCH 123/694 mailbox: zynqmp: Fix typo in IPI documentation
In reply to Greg Kroah-HartmanFrom: Tanmay Shah <[email protected]>
commit 79963fbfc233759bd8a43462f120d15a1bd4f4fa upstream.
Xilinx IPI message buffers allows 32-byte data transfer. Fix documentation that says 12 bytes
--- include/linux/mailbox/zynqmp-ipi-message.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mailbox/zynqmp-ipi-message.h +1 -1
@@ -9,7 +9,7 @@* @data: message payload * * This is the structure for data used in mbox_send_message -* the maximum length of data buffer is fixed to 12 bytes. +* the maximum length of data buffer is fixed to 32 bytes. * Client is supposed to be aware of this. */ struct zynqmp_ipi_message {
Greg Kroah-Hartman
maintainerPATCH 124/694 nfp: fix incorrect pointer deference when offloading IPsec with bonding
In reply to Greg Kroah-HartmanFrom: Huanhuan Wang <[email protected]>
commit 63cfd210034c772fad047afa13dd5a4664b0a72e upstream.
There are two pointers in struct xfrm_dev_offload, *dev, *real_dev. The *dev points whether bonding interface or real interface, if bonding IPsec offload is used, it points bonding interface; if not, it points real interface. And *real_dev always points real interface. So nfp should always use real_dev instead of dev.
Prior to this change the system becomes unresponsive when offloading IPsec for a device which is a lower device to a bonding device.
--- drivers/net/ethernet/netronome/nfp/crypto/ipsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/netronome/nfp/crypto/ipsec.c +2 -2
@@ -269,7 +269,7 @@ static void set_sha2_512hmac(struct nfp_static int nfp_net_xfrm_add_state (struct xfrm_state *x,struct netlink_ext_ack *extack) { -struct net_device *netdev = x->xso.dev; +struct net_device *netdev = x->xso.real_dev;struct nfp_ipsec_cfg_mssg msg = {};int i, key_len, trunc_len, err =0 ;struct nfp_ipsec_cfg_add_sa *cfg;
@@ -513,7 +513,7 @@ static void nfp_net_xfrm_del_state(struc .cmd = NFP_IPSEC_CFG_MSSG_INV_SA, .sa_idx = x->xso.offload_handle - 1, }; -struct net_device *netdev = x->xso.dev; +struct net_device *netdev = x->xso.real_dev;struct nfp_net *nn;int err;
Greg Kroah-Hartman
maintainerPATCH 125/694 wifi: rtl8xxxu: RTL8192EU always needs full init
In reply to Greg Kroah-HartmanFrom: Bitterblue Smith <[email protected]>
commit d46e04ccd40457a0119b76e11ab64a2ad403e138 upstream.
Always run the entire init sequence (rtl8xxxu_init_device()) for RTL8192EU. It's what the vendor driver does too.
This fixes a bug where the device is unable to connect after rebooting:
wlp3s0f3u2: send auth to ... (try 1/3)
wlp3s0f3u2: send auth to ... (try 2/3)
wlp3s0f3u2: send auth to ... (try 3/3)
wlp3s0f3u2: authentication with ... timed out
Rebooting leaves the device powered on (partially? at least the firmware is still running), but not really in a working state.
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c +1 -0
@@ -1817,6 +1817,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops = .rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24), .has_s0s1 = 0, .gen2_thermal_meter = 1, + .needs_full_init = 1, .adda_1t_init = 0x0fc01616, .adda_1t_path_on = 0x0fc01616, .adda_2t_path_on_a = 0x0fc01616,
Greg Kroah-Hartman
maintainerPATCH 126/694 wifi: rtw88: rtw8821c: Fix rfe_option field width
In reply to Greg Kroah-HartmanFrom: Sascha Hauer <[email protected]>
commit 14705f969d98187a1cc2682e0c9bd2e230b8098f upstream.
On my RTW8821CU chipset rfe_option reads as 0x22. Looking at the vendor driver suggests that the field width of rfe_option is 5 bit, so rfe_option should be masked with 0x1f.
Without this the rfe_option comparisons with 2 further down the driver evaluate as false when they should really evaluate as true. The effect is that 2G channels do not work.
rfe_option is also used as an array index into rtw8821c_rfe_defs[]. rtw8821c_rfe_defs[34] (0x22) was added as part of adding USB support, likely because rfe_option reads as 0x22. As this now becomes 0x2, rtw8821c_rfe_defs[34] is no longer used and can be removed.
Note that this might not be the whole truth. In the vendor driver there are indeed places where the unmasked rfe_option value is used. However, the driver has several places where rfe_option is tested with the pattern if (rfe_option == 2 || rfe_option == 0x22) or if (rfe_option == 4 || rfe_option == 0x24), so that rfe_option BIT(5) has no influence on the code path taken. We therefore mask BIT(5) out from rfe_option entirely until this assumption is proved wrong by some chip variant we do not know yet.
--- drivers/net/wireless/realtek/rtw88/rtw8821c.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/rtw8821c.c +1 -2
@@ -47,7 +47,7 @@ static int rtw8821c_read_efuse(struct rt map = (struct rtw8821c_efuse *)log_map; - efuse->rfe_option = map->rfe_option; + efuse->rfe_option = map->rfe_option &0x1f ; efuse->rf_board_option = map->rf_board_option; efuse->crystal_cap = map->xtal_k; efuse->pa_type_2g = map->pa_type;
@@ -1537,7 +1537,6 @@ static const struct rtw_rfe_def rtw8821c [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), [6] = RTW_DEF_RFE(8821c, 0, 0), - [34] = RTW_DEF_RFE(8821c, 0, 0), };static struct rtw_hw_reg rtw8821c_dig[] = {
Greg Kroah-Hartman
maintainerPATCH 127/694 wifi: rtw89: fix potential race condition between napi_init and napi_enable
In reply to Greg Kroah-HartmanFrom: Ping-Ke Shih <[email protected]>
commit 47515664ecfbde11425dff121f298ae4499425c9 upstream.
A race condition can happen if netdev is registered, but NAPI isn't initialized yet, and meanwhile user space starts the netdev that will enable NAPI. Then, it hits BUG_ON():
kernel BUG at net/core/dev.c:6423!
invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
CPU: 0 PID: 417 Comm: iwd Not tainted 6.2.7-slab-dirty #3 eb0f5a8a9d91 Hardware name: LENOVO 21DL/LNVNB161216, BIOS JPCN20WW(V1.06) 09/20/2022 RIP: 0010:napi_enable+0x3f/0x50 Code: 48 89 c2 48 83 e2 f6 f6 81 89 08 00 00 02 74 0d 48 83 ... RSP: 0018:ffffada1414f3548 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffffa01425802080 RCX: 0000000000000000 RDX: 00000000000002ff RSI: ffffada14e50c614 RDI: ffffa01425808dc0 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000100 R12: ffffa01425808f58 R13: 0000000000000000 R14: ffffa01423498940 R15: 0000000000000001 FS: 00007f5577c0a740(0000) GS:ffffa0169fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f5577a19972 CR3: 0000000125a7a000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: <TASK> rtw89_pci_ops_start+0x1c/0x70 [rtw89_pci 6cbc75429515c181cbc386478d5cfb32ffc5a0f8] rtw89_core_start+0xbe/0x160 [rtw89_core fe07ecb874820b6d778370d4acb6ef8a37847f22] rtw89_ops_start+0x26/0x40 [rtw89_core fe07ecb874820b6d778370d4acb6ef8a37847f22] drv_start+0x42/0x100 [mac80211 c07fa22af8c3cf3f7d7ab3884ca990784d72e2d2] ieee80211_do_open+0x311/0x7d0 [mac80211 c07fa22af8c3cf3f7d7ab3884ca990784d72e2d2] ieee80211_open+0x6a/0x90 [mac80211 c07fa22af8c3cf3f7d7ab3884ca990784d72e2d2] __dev_open+0xe0/0x180 __dev_change_flags+0x1da/0x250 dev_change_flags+0x26/0x70 do_setlink+0x37c/0x12c0 ? ep_poll_callback+0x246/0x290 ? __nla_validate_parse+0x61/0xd00 ? __wake_up_common_lock+0x8f/0xd0
To fix this, follow Jonas' suggestion to switch the order of these functions and move register netdev to be the last step of PCI probe. Also, correct the error handling of rtw89_core_register_hw().
--- drivers/net/wireless/realtek/rtw89/core.c | 10 +++++++--- drivers/net/wireless/realtek/rtw89/pci.c | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-)
drivers/net/wireless/realtek/rtw89/core.c +7 -3
@@ -3401,18 +3401,22 @@ static int rtw89_core_register_hw(struct ret =ieee80211_register_hw (hw);if (ret) {rtw89_err (rtwdev,"failed to register hw\n" ); - goto err; + goto err_free_supported_band; } ret =rtw89_regd_init (rtwdev, rtw89_regd_notifier);if (ret) {rtw89_err (rtwdev,"failed to init regd\n" ); - goto err; + goto err_unregister_hw; }return 0 ; -err: +err_unregister_hw: +ieee80211_unregister_hw (hw); +err_free_supported_band: +rtw89_core_clr_supported_band (rtwdev); +return ret; }
drivers/net/wireless/realtek/rtw89/pci.c +10 -9
@@ -3874,25 +3874,26 @@ int rtw89_pci_probe(struct pci_dev *pdevrtw89_pci_link_cfg (rtwdev);rtw89_pci_l1ss_cfg (rtwdev); - ret =rtw89_core_register (rtwdev); -if (ret) { -rtw89_err (rtwdev,"failed to register core\n" ); - goto err_clear_resource; - } -rtw89_core_napi_init (rtwdev); ret =rtw89_pci_request_irq (rtwdev, pdev);if (ret) {rtw89_err (rtwdev,"failed to request pci irq\n" ); - goto err_unregister; + goto err_deinit_napi; + } + + ret =rtw89_core_register (rtwdev); +if (ret) { +rtw89_err (rtwdev,"failed to register core\n" ); + goto err_free_irq; }return 0 ; -err_unregister: +err_free_irq: +rtw89_pci_free_irq (rtwdev, pdev); +err_deinit_napi:rtw89_core_napi_deinit (rtwdev); -rtw89_core_unregister (rtwdev); err_clear_resource:rtw89_pci_clear_resource (rtwdev, pdev); err_declaim_pci:
Greg Kroah-Hartman
maintainerPATCH 128/694 clk: microchip: fix potential UAF in auxdev release callback
In reply to Greg Kroah-HartmanFrom: Conor Dooley <[email protected]>
commit 7455b7007b9e93bcc2bc9c1c6c73a228e3152069 upstream.
Similar to commit 1c11289b34ab ("peci: cpu: Fix use-after-free in adev_release()"), the auxiliary device is not torn down in the correct order. If auxiliary_device_add() fails, the release callback will be called twice, resulting in a UAF. Due to timing, the auxdev code in this driver "took inspiration" from the aforementioned commit, and thus its bugs too!
Moving auxiliary_device_uninit() to the unregister callback instead avoids the issue.
--- drivers/clk/microchip/clk-mpfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/microchip/clk-mpfs.c +1 -2
@@ -374,14 +374,13 @@ static void mpfs_reset_unregister_adev(vstruct auxiliary_device *adev = _adev;auxiliary_device_delete (adev); +auxiliary_device_uninit (adev); }static void mpfs_reset_adev_release (struct device *dev) {struct auxiliary_device *adev =to_auxiliary_dev (dev); -auxiliary_device_uninit (adev); -kfree (adev); }
Greg Kroah-Hartman
maintainerPATCH 129/694 clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent
In reply to Greg Kroah-HartmanFrom: Quentin Schulz <[email protected]>
commit 933bf364e152cd60902cf9585c2ba310d593e69f upstream.
clk_cifout is derived from clk_cifout_src through an integer divider limited to 32. clk_cifout_src is a child of either cpll, gpll or npll without any possibility of a divider of any sort. The default clock parent is cpll.
Let's allow clk_cifout to ask its parent clk_cifout_src to reparent in order to find the real closest possible rate for clk_cifout and not one derived from cpll only.
--- drivers/clk/rockchip/clk-rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3399.c +1 -1
@@ -1263,7 +1263,7 @@ static struct rockchip_clk_branch rk3399 RK3399_CLKSEL_CON(56), 6, 2, MFLAGS, RK3399_CLKGATE_CON(10), 7, GFLAGS), -COMPOSITE_NOGATE (SCLK_CIF_OUT ,"clk_cifout" , mux_clk_cif_p,0 , +COMPOSITE_NOGATE (SCLK_CIF_OUT ,"clk_cifout" , mux_clk_cif_p,CLK_SET_RATE_PARENT , RK3399_CLKSEL_CON(56), 5, 1, MFLAGS, 0, 5, DFLAGS),/* gic */
Greg Kroah-Hartman
maintainerPATCH 130/694 kunit: fix bug in the order of lines in debugfs logs
In reply to Greg Kroah-HartmanFrom: Rae Moar <[email protected]>
[ Upstream commit f9a301c3317daa921375da0aec82462ddf019928 ]
Fix bug in debugfs logs that causes an incorrect order of lines in the debugfs log.
Currently, the test counts lines that show the number of tests passed, failed, and skipped, as well as any suite diagnostic lines, appear prior to the individual results, which is a bug.
Ensure the order of printing for the debugfs log is correct. Additionally, add a KTAP header to so the debugfs logs can be valid KTAP.
This is an example of a log prior to these fixes:
KTAP version 1
# Subtest: kunit_status
1..2
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
ok 1 kunit_status
Note the two lines with stats are out of order. This is the same debugfs log after the fixes (in combination with the third patch to remove the extra line):
KTAP version 1
1..1
KTAP version 1
# Subtest: kunit_status
1..2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 1 kunit_status
--- lib/kunit/debugfs.c | 14 ++++++++++++-- lib/kunit/test.c | 21 ++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-)
lib/kunit/debugfs.c +12 -2
@@ -55,14 +55,24 @@ static int debugfs_print_results(struct seq_file *seq, void *v)enum kunit_status success =kunit_suite_has_succeeded (suite);struct kunit_case *test_case; -if (!suite || !suite->log) +if (!suite)return 0 ; -seq_printf (seq,"%s" , suite->log); +/* Print KTAP header so the debugfs log can be parsed as valid KTAP. */ +seq_puts (seq,"KTAP version 1\n" ); +seq_puts (seq,"1..1\n" ); + +/* Print suite header because it is not stored in the test logs. */ +seq_puts (seq,KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); +seq_printf (seq,KUNIT_SUBTEST_INDENT "# Subtest: %s\n" , suite->name); +seq_printf (seq,KUNIT_SUBTEST_INDENT "1..%zd\n" ,kunit_suite_num_test_cases (suite));kunit_suite_for_each_test_case (suite, test_case)debugfs_print_result (seq, suite, test_case); +if (suite->log) +seq_printf (seq,"%s" , suite->log); +seq_printf (seq,"%s %d %s\n" ,kunit_status_to_ok_not_ok (success),1 , suite->name);return 0 ;
lib/kunit/test.c +14 -7
@@ -147,10 +147,18 @@ EXPORT_SYMBOL_GPL(kunit_suite_num_test_cases);static void kunit_print_suite_start (struct kunit_suite *suite) { -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "# Subtest: %s" , +/* +* We do not log the test suite header as doing so would +* mean debugfs display would consist of the test suite +* header prior to individual test results. +* Hence directly printk the suite status, and we will +* separately seq_printf() the suite header for the debugfs +* representation. +*/ +pr_info (KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); +pr_info (KUNIT_SUBTEST_INDENT "# Subtest: %s\n" , suite->name); -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "1..%zd" , +pr_info (KUNIT_SUBTEST_INDENT "1..%zd\n" ,kunit_suite_num_test_cases (suite)); }
@@ -167,10 +175,9 @@ static void kunit_print_ok_not_ok(void *test_or_suite,/* * We do not log the test suite results as doing so would -* mean debugfs display would consist of the test suite -* description and status prior to individual test results. -* Hence directly printk the suite status, and we will -* separately seq_printf() the suite status for the debugfs +* mean debugfs display would consist of an incorrect test +* number. Hence directly printk the suite result, and we will +* separately seq_printf() the suite results for the debugfs * representation. */ if (suite)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 131/694 rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check
In reply to Greg Kroah-HartmanFrom: Zqiang <[email protected]>
[ Upstream commit db7b464df9d820186e98a65aa6a10f0d51fbf8ce ]
This commit adds checks for the TICK_DEP_MASK_RCU_EXP bit, thus enabling RCU expedited grace periods to actually force-enable scheduling-clock interrupts on holdout CPUs.
--- include/trace/events/timer.h | 3 ++- kernel/time/tick-sched.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-)
include/trace/events/timer.h +2 -1
@@ -371,7 +371,8 @@ TRACE_EVENT(itimer_expire, tick_dep_name(PERF_EVENTS) \ tick_dep_name(SCHED) \ tick_dep_name(CLOCK_UNSTABLE) \ - tick_dep_name_end(RCU) + tick_dep_name(RCU) \ + tick_dep_name_end(RCU_EXP) #undef tick_dep_name#undef tick_dep_mask_name
kernel/time/tick-sched.c +5 -0
@@ -281,6 +281,11 @@ static bool check_tick_dependency(atomic_t *dep)return true; } +if (val &TICK_DEP_MASK_RCU_EXP ) { +trace_tick_stop (0 ,TICK_DEP_MASK_RCU_EXP ); +return true; + } +return false; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 132/694 selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit 22a8be280383812235131dda18a8212a59fadd2d ]
malloc_and_init_memory() in fill_buf isn't checking if memalign() successfully allocated memory or not before accessing the memory.
Check the return value of memalign() and return NULL if allocating aligned memory fails.
--- tools/testing/selftests/resctrl/fill_buf.c | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/resctrl/fill_buf.c +2 -0
@@ -68,6 +68,8 @@ static void *malloc_and_init_memory(size_t s)size_t s64;void *p =memalign (PAGE_SIZE , s); +if (!p) +return NULL ; p64 = (uint64_t *)p; s64 = s /sizeof (uint64_t );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 133/694 selftests/resctrl: Move ->setup() call outside of test specific branches
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit c90b3b588e369c20087699316259fa5ebbb16f2d ]
resctrl_val() function is called only by MBM, MBA, and CMT tests which means the else branch is never used.
Both test branches call param->setup().
Remove the unused else branch and place the ->setup() call outside of the test specific branches reducing code duplication.
Stable-dep-of: fa10366cc6f4 ("selftests/resctrl: Allow ->setup() to return errors")
--- tools/testing/selftests/resctrl/resctrl_val.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
tools/testing/selftests/resctrl/resctrl_val.c +6 -13
@@ -734,29 +734,22 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)/* Test runs until the callback setup() tells the test to stop. */ while (1 ) { + ret = param->setup (1 , param); +if (ret) { + ret =0 ; +break ; + } +if (!strncmp (resctrl_val,MBM_STR ,sizeof (MBM_STR )) || !strncmp (resctrl_val,MBA_STR ,sizeof (MBA_STR ))) { - ret = param->setup (1 , param); -if (ret) { - ret =0 ; -break ; - } - ret =measure_vals (param, &bw_resc_start);if (ret)break ; }else if (!strncmp (resctrl_val,CMT_STR ,sizeof (CMT_STR ))) { - ret = param->setup (1 , param); -if (ret) { - ret =0 ; -break ; - }sleep (1 ); ret =measure_cache_vals (param, bm_pid);if (ret)break ; - }else { -break ; } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 134/694 selftests/resctrl: Allow ->setup() to return errors
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit fa10366cc6f4cc862871f8938426d85c2481f084 ]
resctrl_val() assumes ->setup() always returns either 0 to continue tests or < 0 in case of the normal termination of tests after x runs. The latter overlaps with normal error returns.
Define END_OF_TESTS (=1) to differentiate the normal termination of tests and return errors as negative values. Alter callers of ->setup() to handle errors properly.
--- tools/testing/selftests/resctrl/cache.c | 4 +++- tools/testing/selftests/resctrl/cat_test.c | 2 +- tools/testing/selftests/resctrl/cmt_test.c | 2 +- tools/testing/selftests/resctrl/mba_test.c | 2 +- tools/testing/selftests/resctrl/mbm_test.c | 2 +- tools/testing/selftests/resctrl/resctrl.h | 2 ++ tools/testing/selftests/resctrl/resctrl_val.c | 4 +++- 7 files changed, 12 insertions(+), 6 deletions(-)
tools/testing/selftests/resctrl/cache.c +3 -1
@@ -244,10 +244,12 @@ int cat_val(struct resctrl_val_param *param)while (1 ) {if (!strncmp (resctrl_val,CAT_STR ,sizeof (CAT_STR ))) { ret = param->setup (1 , param); -if (ret) { +if (ret ==END_OF_TESTS ) { ret =0 ;break ; } +if (ret <0 ) +break ; ret =reset_enable_llc_perf (bm_pid, param->cpu_no);if (ret)break ;
tools/testing/selftests/resctrl/cat_test.c +1 -1
@@ -40,7 +40,7 @@ static int cat_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ;if (p->num_of_runs ==0 ) {sprintf (schemata,"%lx" , p->mask);
tools/testing/selftests/resctrl/cmt_test.c +1 -1
@@ -32,7 +32,7 @@ static int cmt_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ; p->num_of_runs++;
tools/testing/selftests/resctrl/mba_test.c +1 -1
@@ -41,7 +41,7 @@ static int mba_setup(int num, ...)return 0 ;if (allocation <ALLOCATION_MIN || allocation >ALLOCATION_MAX ) -return -1 ; +return END_OF_TESTS ;sprintf (allocation_str,"%d" , allocation);
tools/testing/selftests/resctrl/mbm_test.c +1 -1
@@ -95,7 +95,7 @@ static int mbm_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (num_of_runs++ >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ;va_start (param, num); p = va_arg(param, struct resctrl_val_param *);
tools/testing/selftests/resctrl/resctrl.h +2 -0
@@ -37,6 +37,8 @@#define ARCH_INTEL 1#define ARCH_AMD 2 +#define END_OF_TESTS 1 +#define PARENT_EXIT (err_msg) \ do { \ perror(err_msg); \
tools/testing/selftests/resctrl/resctrl_val.c +3 -1
@@ -735,10 +735,12 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)/* Test runs until the callback setup() tells the test to stop. */ while (1 ) { ret = param->setup (1 , param); -if (ret) { +if (ret ==END_OF_TESTS ) { ret =0 ;break ; } +if (ret <0 ) +break ;if (!strncmp (resctrl_val,MBM_STR ,sizeof (MBM_STR )) || !strncmp (resctrl_val,MBA_STR ,sizeof (MBA_STR ))) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 135/694 selftests/resctrl: Check for return value after write_schemata()
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit 0d45c83b95da414e98ad333e723141a94f6e2c64 ]
MBA test case writes schemata but it does not check if the write is successful or not.
Add the error check and return error properly.
--- tools/testing/selftests/resctrl/mba_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/testing/selftests/resctrl/mba_test.c +6 -1
@@ -28,6 +28,7 @@ static int mba_setup(int num, ...)struct resctrl_val_param *p;char allocation_str[64 ];va_list param; +int ret;va_start (param, num); p = va_arg(param, struct resctrl_val_param *);
@@ -45,7 +46,11 @@ static int mba_setup(int num, ...)sprintf (allocation_str,"%d" , allocation); -write_schemata (p->ctrlgrp, allocation_str, p->cpu_no, p->resctrl_val); + ret =write_schemata (p->ctrlgrp, allocation_str, p->cpu_no, + p->resctrl_val); +if (ret <0 ) +return ret; + allocation -=ALLOCATION_STEP ;return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 136/694 ARM: 9292/1: vfp: Pass thread_info pointer to vfp_support_entry
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit dae904d96ad6a5fa79bd9d99a3decf93685d398b ]
Instead of dereferencing thread_info in do_vfp, pass the thread_info pointer to vfp_support_entry via R1. That way, we only use a single caller save register, which makes it easier to convert do_vfp to C code in a subsequent patch.
Note that, unlike the CPU number, which can change due to preemption, passing the thread_info pointer can safely be done with preemption enabled.
Stable-dep-of: c76c6c4ecbec ("ARM: 9294/2: vfp: Fix broken softirq handling with instrumentation enabled")
--- arch/arm/vfp/entry.S | 5 +---- arch/arm/vfp/vfphw.S | 10 +++++++--- 2 files changed, 8 insertions(+), 7 deletions(-)
arch/arm/vfp/entry.S +1 -4
@@ -22,15 +22,12 @@ @ IRQs enabled. @ ENTRY(do_vfp) - local_bh_disable r10, r4 + mov r1, r10 ldr r4, .LCvfp - ldr r11, [r10, #TI_CPU] @ CPU number - add r10, r10, #TI_VFPSTATE @ r10 = workspace ldr pc, [r4] @ call VFP entry point ENDPROC(do_vfp) ENTRY(vfp_null_entry) - local_bh_enable_ti r10, r4 ret lr ENDPROC(vfp_null_entry)
arch/arm/vfp/vfphw.S +7 -3
@@ -6,9 +6,9 @@ * Written by Deep Blue Solutions Limited. * * This code is called from the kernel's undefined instruction trap. + * r1 holds the thread_info pointer * r9 holds the return address for successful handling. * lr holds the return address for unrecognised instructions. - * r10 points at the start of the private FP workspace in the thread structure * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h) */ #include <linux/init.h>
@@ -69,13 +69,17 @@ @ VFP hardware support entry point. @ @ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb) +@ r1 = thread_info pointer @ r2 = PC value to resume execution after successful emulation @ r9 = normal "successful" return address -@ r10 = vfp_state union -@ r11 = CPU number @ lr = unrecognised instruction return address @ IRQs enabled. ENTRY(vfp_support_entry) + local_bh_disable r1, r4 + + ldr r11, [r1, #TI_CPU] @ CPU number + add r10, r1, #TI_VFPSTATE @ r10 = workspace + DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10 .fpu vfpv2
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 137/694 ARM: 9293/1: vfp: Pass successful return address via register R3
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit 3a2bdad0b46649cc73fb3b3f9e2b91ef97a7fa63 ]
In preparation for reimplementing the do_vfp()->vfp_support_entry() handover in C code, switch to using R3 to pass the 'success' return address, rather than R9, as it cannot be used for parameter passing.
Stable-dep-of: c76c6c4ecbec ("ARM: 9294/2: vfp: Fix broken softirq handling with instrumentation enabled")
--- arch/arm/vfp/entry.S | 1 + arch/arm/vfp/vfphw.S | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-)
arch/arm/vfp/entry.S +1 -0
@@ -23,6 +23,7 @@ @ ENTRY(do_vfp) mov r1, r10 + mov r3, r9 ldr r4, .LCvfp ldr pc, [r4] @ call VFP entry point ENDPROC(do_vfp)
arch/arm/vfp/vfphw.S +7 -7
@@ -7,7 +7,7 @@ * * This code is called from the kernel's undefined instruction trap. * r1 holds the thread_info pointer - * r9 holds the return address for successful handling. + * r3 holds the return address for successful handling. * lr holds the return address for unrecognised instructions. * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h) */
@@ -71,7 +71,7 @@ @ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb) @ r1 = thread_info pointer @ r2 = PC value to resume execution after successful emulation -@ r9 = normal "successful" return address +@ r3 = normal "successful" return address @ lr = unrecognised instruction return address @ IRQs enabled. ENTRY(vfp_support_entry)
@@ -89,9 +89,9 @@ ENTRY(vfp_support_entry) bne look_for_VFP_exceptions @ VFP is already enabled DBGSTR1 "enable %x", r10 - ldr r3, vfp_current_hw_state_address + ldr r9, vfp_current_hw_state_address orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set - ldr r4, [r3, r11, lsl #2] @ vfp_current_hw_state pointer + ldr r4, [r9, r11, lsl #2] @ vfp_current_hw_state pointer bic r5, r1, #FPEXC_EX @ make sure exceptions are disabled cmp r4, r10 @ this thread owns the hw context? #ifndef CONFIG_SMP
@@ -150,7 +150,7 @@ vfp_reload_hw: #endif DBGSTR1 "load state %p", r10 - str r10, [r3, r11, lsl #2] @ update the vfp_current_hw_state pointer + str r10, [r9, r11, lsl #2] @ update the vfp_current_hw_state pointer @ Load the saved state back into the VFP VFPFLDMIA r10, r5 @ reload the working registers while @ FPEXC is in a safe state
@@ -180,7 +180,7 @@ vfp_hw_state_valid: @ always subtract 4 from the following @ instruction address. local_bh_enable_ti r10, r4 - ret r9 @ we think we have handled things + ret r3 @ we think we have handled things look_for_VFP_exceptions:
@@ -210,7 +210,7 @@ skip: process_exception: DBGSTR "bounce" mov r2, sp @ nothing stacked - regdump is at TOS - mov lr, r9 @ setup for a return to the user code. + mov lr, r3 @ setup for a return to the user code. @ Now call the C code to package up the bounce to the support code @ r0 holds the trigger instruction
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 138/694 selinux: fix Makefile dependencies of flask.h
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
[ Upstream commit bcab1adeaad4b39a1e04cb98979a367d08253f03 ]
Make the flask.h target depend on the genheaders binary instead of classmap.h to ensure that it is rebuilt if any of the dependencies of genheaders are changed.
Notably this fixes flask.h not being rebuilt wheninitial_sid_to_string.h is modified.
--- security/selinux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/selinux/Makefile +2 -2
@@ -23,8 +23,8 @@ ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include $(addprefix $(obj)/,$(selinux-y)): $(obj)/flask.h quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h - cmd_flask = scripts/selinux/genheaders/genheaders $(obj)/flask.h $(obj)/av_permissions.h + cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h targets += flask.h av_permissions.h -$(obj)/flask.h: $(src)/include/classmap.h FORCE +$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE $(call if_changed,flask)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 139/694 selinux: ensure av_permissions.h is built when needed
In reply to Greg Kroah-HartmanFrom: Paul Moore <[email protected]>
[ Upstream commit 4ce1f694eb5d8ca607fed8542d32a33b4f1217a5 ]
The Makefile rule responsible for building flask.h and av_permissions.h only lists flask.h as a target which means that av_permissions.h is only generated when flask.h needs to be generated. This patch fixes this by adding av_permissions.h as a target to the rule.
--- security/selinux/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/Makefile +1 -1
@@ -26,5 +26,5 @@ quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h targets += flask.h av_permissions.h -$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE +$(obj)/flask.h $(obj)/av_permissions.h &: scripts/selinux/genheaders/genheaders FORCE $(call if_changed,flask)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 140/694 tpm, tpm_tis: Do not skip reset of original interrupt vector
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit ed9be0e6c892a783800d77a41ca4c7255c6af8c5 ]
If in tpm_tis_probe_irq_single() an error occurs after the original interrupt vector has been read, restore the interrupts before the error is returned.
Since the caller does not check the error value, return -1 in any case that the TPM_CHIP_FLAG_IRQ flag is not set. Since the return value of function tpm_tis_gen_interrupt() is not longer used, make it a void function.
--- drivers/char/tpm/tpm_tis_core.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-)
drivers/char/tpm/tpm_tis_core.c +11 -18
@@ -732,7 +732,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)return IRQ_HANDLED ; } -static int tpm_tis_gen_interrupt (struct tpm_chip *chip) +static void tpm_tis_gen_interrupt (struct tpm_chip *chip) {const char *desc ="attempting to generate an interrupt" ;u32 cap2;
@@ -741,7 +741,7 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip) ret =request_locality (chip,0 );if (ret <0 ) -return ret; +return ;if (chip->flags &TPM_CHIP_FLAG_TPM2 ) ret =tpm2_get_tpm_pt (chip,0x100 , &cap2, desc);
@@ -749,8 +749,6 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip) ret =tpm1_getcap (chip,TPM_CAP_PROP_TIS_TIMEOUT , &cap, desc,0 );release_locality (chip,0 ); - -return ret; }/* Register the IRQ and issue a command that will cause an interrupt. If an
@@ -780,42 +778,37 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, rc =tpm_tis_write8 (priv,TPM_INT_VECTOR (priv->locality), irq);if (rc <0 ) -return rc; + goto restore_irqs; rc =tpm_tis_read32 (priv,TPM_INT_STATUS (priv->locality), &int_status);if (rc <0 ) -return rc; + goto restore_irqs;/* Clear all existing */ rc =tpm_tis_write32 (priv,TPM_INT_STATUS (priv->locality), int_status);if (rc <0 ) -return rc; - + goto restore_irqs;/* Turn on */ rc =tpm_tis_write32 (priv,TPM_INT_ENABLE (priv->locality), intmask |TPM_GLOBAL_INT_ENABLE );if (rc <0 ) -return rc; + goto restore_irqs; priv->irq_tested = false;/* Generate an interrupt by having the core call through to * tpm_tis_send */ - rc =tpm_tis_gen_interrupt (chip); -if (rc <0 ) -return rc; +tpm_tis_gen_interrupt (chip); +restore_irqs:/* tpm_tis_send will either confirm the interrupt is working or it * will call disable_irq which undoes all of the above. */ if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) { - rc =tpm_tis_write8 (priv, original_int_vec, -TPM_INT_VECTOR (priv->locality)); -if (rc <0 ) -return rc; - -return 1 ; +tpm_tis_write8 (priv, original_int_vec, +TPM_INT_VECTOR (priv->locality)); +return -1 ; }return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 141/694 tpm, tpm_tis: Claim locality before writing TPM_INT_ENABLE register
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 282657a8bd7fddcf511b834f43705001668b33a7 ]
In disable_interrupts() the TPM_GLOBAL_INT_ENABLE bit is unset in the TPM_INT_ENABLE register to shut the interrupts off. However modifying the register is only possible with a held locality. So claim the locality before disable_interrupts() is called.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/char/tpm/tpm_tis_core.c +4 -0
@@ -1094,7 +1094,11 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,dev_err (&chip->dev,FW_BUG "TPM interrupt not working, polling instead\n" ); + rc =request_locality (chip,0 ); +if (rc <0 ) + goto out_err;disable_interrupts (chip); +release_locality (chip,0 ); } }else {tpm_tis_probe_irq (chip, intmask);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 142/694 tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 6d789ad726950e612a7f31044260337237c5b490 ]
Both functions tpm_tis_probe_irq_single() and tpm_tis_probe_irq() may setup the interrupts and then return with an error. This case is indicated by a missing TPM_CHIP_FLAG_IRQ flag in chip->flags.
Currently the interrupt setup is only undone if tpm_tis_probe_irq_single() fails. Undo the setup also if tpm_tis_probe_irq() fails.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/char/tpm/tpm_tis_core.c +11 -11
@@ -1087,21 +1087,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, goto out_err; } -if (irq) { +if (irq)tpm_tis_probe_irq_single (chip, intmask,IRQF_SHARED , irq); -if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) { -dev_err (&chip->dev,FW_BUG +else +tpm_tis_probe_irq (chip, intmask); + +if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) { +dev_err (&chip->dev,FW_BUG "TPM interrupt not working, polling instead\n" ); - rc =request_locality (chip,0 ); -if (rc <0 ) - goto out_err; -disable_interrupts (chip); -release_locality (chip,0 ); - } - }else { -tpm_tis_probe_irq (chip, intmask); + rc =request_locality (chip,0 ); +if (rc <0 ) + goto out_err; +disable_interrupts (chip); +release_locality (chip,0 ); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 143/694 tpm, tpm_tis: Claim locality before writing interrupt registers
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 15d7aa4e46eba87242a320f39773aa16faddadee ]
In tpm_tis_probe_single_irq() interrupt registers TPM_INT_VECTOR, TPM_INT_STATUS and TPM_INT_ENABLE are modified to setup the interrupts. Currently these modifications are done without holding a locality thus they have no effect. Fix this by claiming the (default) locality before the registers are written.
Since now tpm_tis_gen_interrupt() is called with the locality already claimed remove locality request and release from this function.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/char/tpm/tpm_tis_core.c +11 -9
@@ -739,16 +739,10 @@ static void tpm_tis_gen_interrupt(struct tpm_chip *chip)cap_t cap;int ret; - ret =request_locality (chip,0 ); -if (ret <0 ) -return ; -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) ret =tpm2_get_tpm_pt (chip,0x100 , &cap2, desc);else ret =tpm1_getcap (chip,TPM_CAP_PROP_TIS_TIMEOUT , &cap, desc,0 ); - -release_locality (chip,0 ); }/* Register the IRQ and issue a command that will cause an interrupt. If an
@@ -771,10 +765,16 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, } priv->irq = irq; + rc =request_locality (chip,0 ); +if (rc <0 ) +return rc; + rc =tpm_tis_read8 (priv,TPM_INT_VECTOR (priv->locality), &original_int_vec); -if (rc <0 ) +if (rc <0 ) { +release_locality (chip, priv->locality);return rc; + } rc =tpm_tis_write8 (priv,TPM_INT_VECTOR (priv->locality), irq);if (rc <0 )
@@ -808,10 +808,12 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) {tpm_tis_write8 (priv, original_int_vec,TPM_INT_VECTOR (priv->locality)); -return -1 ; + rc =-1 ; } -return 0 ; +release_locality (chip, priv->locality); + +return rc; }/* Try to find the IRQ the TPM is using. This is for legacy x86 systems that
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 144/694 tpm, tpm: Implement usage counter for locality
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 7a2f55d0be296c4e81fd782f3d6c43ed4ec7e265 ]
Implement a usage counter for the (default) locality used by the TPM TIS driver:
Request the locality from the TPM if it has not been claimed yet, otherwise only increment the counter. Also release the locality if the counter is 0 otherwise only decrement the counter. Since in case of SPI the register accesses are locked by means of the SPI bus mutex use a sleepable lock (i.e. also a mutex) to ensure thread-safety of the counter which may be accessed by both a userspace thread and the interrupt handler.
By doing this refactor the names of the amended functions to use a more appropriate prefix.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 63 +++++++++++++++++++++++---------- drivers/char/tpm/tpm_tis_core.h | 2 ++ 2 files changed, 47 insertions(+), 18 deletions(-)
drivers/char/tpm/tpm_tis_core.c +45 -18
@@ -136,16 +136,27 @@ static bool check_locality(struct tpm_chip *chip, int l)return false; } -static int release_locality (struct tpm_chip *chip,int l) +static int __tpm_tis_relinquish_locality (struct tpm_tis_data *priv,int l) +{ +tpm_tis_write8 (priv,TPM_ACCESS (l),TPM_ACCESS_ACTIVE_LOCALITY ); + +return 0 ; +} + +static int tpm_tis_relinquish_locality (struct tpm_chip *chip,int l) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev); -tpm_tis_write8 (priv,TPM_ACCESS (l),TPM_ACCESS_ACTIVE_LOCALITY ); +mutex_lock (&priv->locality_count_mutex); + priv->locality_count--; +if (priv->locality_count ==0 ) +__tpm_tis_relinquish_locality (priv, l); +mutex_unlock (&priv->locality_count_mutex);return 0 ; } -static int request_locality (struct tpm_chip *chip,int l) +static int __tpm_tis_request_locality (struct tpm_chip *chip,int l) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev);unsigned long stop, timeout;
@@ -186,6 +197,20 @@ static int request_locality(struct tpm_chip *chip, int l)return -1 ; } +static int tpm_tis_request_locality (struct tpm_chip *chip,int l) +{ +struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev); +int ret =0 ; + +mutex_lock (&priv->locality_count_mutex); +if (priv->locality_count ==0 ) + ret =__tpm_tis_request_locality (chip, l); +if (!ret) + priv->locality_count++; +mutex_unlock (&priv->locality_count_mutex); +return ret; +} +static u8 tpm_tis_status (struct tpm_chip *chip) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev);
@@ -652,7 +677,7 @@ static int probe_itpm(struct tpm_chip *chip)if (vendor !=TPM_VID_INTEL )return 0 ; -if (request_locality (chip,0 ) !=0 ) +if (tpm_tis_request_locality (chip,0 ) !=0 )return -EBUSY ; rc =tpm_tis_send_data (chip, cmd_getticks, len);
@@ -673,7 +698,7 @@ static int probe_itpm(struct tpm_chip *chip) out:tpm_tis_ready (chip); -release_locality (chip, priv->locality); +tpm_tis_relinquish_locality (chip, priv->locality);return rc; }
@@ -765,14 +790,14 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, } priv->irq = irq; - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 )return rc; rc =tpm_tis_read8 (priv,TPM_INT_VECTOR (priv->locality), &original_int_vec);if (rc <0 ) { -release_locality (chip, priv->locality); +tpm_tis_relinquish_locality (chip, priv->locality);return rc; }
@@ -811,7 +836,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, rc =-1 ; } -release_locality (chip, priv->locality); +tpm_tis_relinquish_locality (chip, priv->locality);return rc; }
@@ -927,8 +952,8 @@ static const struct tpm_class_ops tpm_tis = { .req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID, .req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID, .req_canceled = tpm_tis_req_canceled, - .request_locality = request_locality, - .relinquish_locality = release_locality, + .request_locality = tpm_tis_request_locality, + .relinquish_locality = tpm_tis_relinquish_locality, .clk_enable = tpm_tis_clkrun_enable, };
@@ -962,6 +987,8 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, priv->timeout_min =TPM_TIMEOUT_USECS_MIN ; priv->timeout_max =TPM_TIMEOUT_USECS_MAX ; priv->phy_ops = phy_ops; + priv->locality_count =0 ; +mutex_init (&priv->locality_count_mutex);dev_set_drvdata (&chip->dev, priv);
@@ -1008,14 +1035,14 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,TPM_INTF_DATA_AVAIL_INT |TPM_INTF_STS_VALID_INT ; intmask &= ~TPM_GLOBAL_INT_ENABLE ; - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 ) { rc = -ENODEV ; goto out_err; }tpm_tis_write32 (priv,TPM_INT_ENABLE (priv->locality), intmask); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 ); rc =tpm_chip_start (chip);if (rc)
@@ -1075,13 +1102,13 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,* proper timeouts for the driver. */ - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 ) goto out_err; rc =tpm_get_timeouts (chip); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 );if (rc) {dev_err (dev,"Could not get TPM timeouts and durations\n" );
@@ -1099,11 +1126,11 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,dev_err (&chip->dev,FW_BUG "TPM interrupt not working, polling instead\n" ); - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 ) goto out_err;disable_interrupts (chip); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 ); } }
@@ -1176,13 +1203,13 @@ int tpm_tis_resume(struct device *dev)* an error code but for unknown reason it isn't handled. */ if (!(chip->flags &TPM_CHIP_FLAG_TPM2 )) { - ret =request_locality (chip,0 ); + ret =tpm_tis_request_locality (chip,0 );if (ret <0 )return ret;tpm1_do_selftest (chip); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 ); }return 0 ;
drivers/char/tpm/tpm_tis_core.h +2 -0
@@ -91,6 +91,8 @@ enum tpm_tis_flags {struct tpm_tis_data {u16 manufacturer_id; +struct mutex locality_count_mutex; +unsigned int locality_count;int locality;int irq;bool irq_tested;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 145/694 tpm, tpm_tis: Claim locality when interrupts are reenabled on resume
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 955df4f87760b3bb2af253d3fbb12fb712b3ffa6 ]
In tpm_tis_resume() make sure that the locality has been claimed when tpm_tis_reenable_interrupts() is called. Otherwise the writings to the register might not have any effect.
--- drivers/char/tpm/tpm_tis_core.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/char/tpm/tpm_tis_core.c +9 -10
@@ -1191,28 +1191,27 @@ int tpm_tis_resume(struct device *dev)struct tpm_chip *chip =dev_get_drvdata (dev);int ret; + ret =tpm_tis_request_locality (chip,0 ); +if (ret <0 ) +return ret; +if (chip->flags &TPM_CHIP_FLAG_IRQ )tpm_tis_reenable_interrupts (chip); ret =tpm_pm_resume (dev);if (ret) -return ret; + goto out;/* * TPM 1.2 requires self-test on resume. This function actually returns * an error code but for unknown reason it isn't handled. */ -if (!(chip->flags &TPM_CHIP_FLAG_TPM2 )) { - ret =tpm_tis_request_locality (chip,0 ); -if (ret <0 ) -return ret; - +if (!(chip->flags &TPM_CHIP_FLAG_TPM2 ))tpm1_do_selftest (chip); +out: +tpm_tis_relinquish_locality (chip,0 ); -tpm_tis_relinquish_locality (chip,0 ); - } - - return 0; + return ret; }EXPORT_SYMBOL_GPL (tpm_tis_resume);#endif
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 146/694 selftests/clone3: fix number of tests in ksft_set_plan
In reply to Greg Kroah-HartmanFrom: Tobias Klauser <[email protected]>
[ Upstream commit d95debbdc528d50042807754d6085c15abc21768 ]
Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME") added an additional test, so the number passed to ksft_set_plan needs to be bumped accordingly.
Also use ksft_finished() to print results and exit. This will catch future mismatches between ksft_set_plan() and the number of tests being run.
--- tools/testing/selftests/clone3/clone3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/clone3/clone3.c +2 -2
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])uid_t uid =getuid ();ksft_print_header (); -ksft_set_plan (17 ); +ksft_set_plan (18 );test_clone3_supported ();/* Just a simple clone3() should return 0.*/
@@ -198,5 +198,5 @@ int main(int argc, char *argv[])/* Do a clone3() in a new time namespace */ test_clone3 (CLONE_NEWTIME ,0 ,0 ,CLONE3_ARGS_NO_TEST ); -return !ksft_get_fail_cnt () ?ksft_exit_pass () :ksft_exit_fail (); +ksft_finished (); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 147/694 erofs: stop parsing non-compact HEAD index if clusterofs is invalid
In reply to Greg Kroah-HartmanFrom: Gao Xiang <[email protected]>
[ Upstream commit cc4efd3dd2ac9f89143e5d881609747ecff04164 ]
Syzbot generated a crafted image [1] with a non-compact HEAD index of clusterofs 33024 while valid numbers should be 0 ~ lclustersize-1, which causes the following unexpected behavior as below:
BUG: unable to handle page fault for address: fffff52101a3fff9 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 23ffed067 P4D 23ffed067 PUD 0 Oops: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 4398 Comm: kworker/u5:1 Not tainted 6.3.0-rc6-syzkaller-g09a9639e56c0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Workqueue: erofs_worker z_erofs_decompressqueue_work RIP: 0010:z_erofs_decompress_queue+0xb7e/0x2b40 ... Call Trace: <TASK> z_erofs_decompressqueue_work+0x99/0xe0 process_one_work+0x8f6/0x1170 worker_thread+0xa63/0x1210 kthread+0x270/0x300 ret_from_fork+0x1f/0x30
Note that normal images or images using compact indexes are not impacted. Let's fix this now.
[1] https://lore.kernel.org/r/[email protected]
--- fs/erofs/zmap.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/erofs/zmap.c +4 -0
@@ -86,6 +86,10 @@ static int legacy_load_cluster_from_disk(struct z_erofs_maprecorder *m,if (advise &Z_EROFS_VLE_DI_PARTIAL_REF ) m->partialref = true; m->clusterofs =le16_to_cpu (di->di_clusterofs); +if (m->clusterofs >=1 << vi->z_logical_clusterbits) { +DBG_BUGON (1 ); +return -EFSCORRUPTED ; + } m->pblk =le32_to_cpu (di->di_u.blkaddr);break ;default :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 148/694 erofs: initialize packed inode after root inode is assigned
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit cb9bce79514392a9a216ff67148e05e2d72c28bd ]
As commit 8f7acdae2cd4 ("staging: erofs: kill all failure handling in fill_super()"), move the initialization of packed inode after root inode is assigned, so that the iput() in .put_super() is adequate as the failure handling.
Otherwise, iput() is also needed in .kill_sb(), in case of the mounting fails halfway.
--- fs/erofs/internal.h | 1 + fs/erofs/super.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-)
fs/erofs/internal.h +1 -0
@@ -156,6 +156,7 @@ struct erofs_sb_info {/* what we really care is nid, rather than ino.. */ erofs_nid_t root_nid; +erofs_nid_t packed_nid;/* used for statfs, f_files - f_favail */ u64 inos;
fs/erofs/super.c +11 -11
@@ -380,17 +380,7 @@ static int erofs_read_superblock(struct super_block *sb)#endif sbi->islotbits =ilog2 (sizeof (struct erofs_inode_compact )); sbi->root_nid =le16_to_cpu (dsb->root_nid); -#ifdef CONFIG_EROFS_FS_ZIP - sbi->packed_inode =NULL ; -if (erofs_sb_has_fragments (sbi) && dsb->packed_nid) { - sbi->packed_inode = -erofs_iget (sb,le64_to_cpu (dsb->packed_nid)); -if (IS_ERR (sbi->packed_inode)) { - ret =PTR_ERR (sbi->packed_inode); - goto out; - } - } -#endif + sbi->packed_nid =le64_to_cpu (dsb->packed_nid); sbi->inos =le64_to_cpu (dsb->inos); sbi->build_time =le64_to_cpu (dsb->build_time);
@@ -799,6 +789,16 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)erofs_shrinker_register (sb);/* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */ +#ifdef CONFIG_EROFS_FS_ZIP +if (erofs_sb_has_fragments (sbi) && sbi->packed_nid) { + sbi->packed_inode =erofs_iget (sb, sbi->packed_nid); +if (IS_ERR (sbi->packed_inode)) { + err =PTR_ERR (sbi->packed_inode); + sbi->packed_inode =NULL ; +return err; + } + } +#endif err =erofs_init_managed_cache (sb);if (err)return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 149/694 erofs: fix potential overflow calculating xattr_isize
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit 1b3567a1969b26f709d82a874498c0754ea841c3 ]
Given on-disk i_xattr_icount is 16 bits and xattr_isize is calculated from i_xattr_icount multiplying 4, xattr_isize has a theoretical maximum of 256K (64K * 4).
Thus declare xattr_isize as unsigned int to avoid the potential overflow.
--- fs/erofs/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/internal.h +1 -1
@@ -307,7 +307,7 @@ struct erofs_inode {unsigned char datalayout;unsigned char inode_isize; -unsigned short xattr_isize; +unsigned int xattr_isize;unsigned int xattr_shared_count;unsigned int *xattr_shared_xattrs;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 150/694 accel/ivpu: PM: remove broken ivpu_dbg() statements
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 17ab1ea679be48d905559d968a7622f5f212de6e ]
When CONFIG_PM is disabled, the driver fails to build:
drivers/accel/ivpu/ivpu_pm.c: In function 'ivpu_rpm_get':drivers/accel/ivpu/ivpu_pm.c:240:84: error: 'struct dev_pm_info' has no member named 'usage_count'
240 | ivpu_dbg(vdev, RPM, "rpm_get count %d\n", atomic_read(&vdev->drm.dev->power.usage_count));
| ^include/linux/dynamic_debug.h:223:29: note: in definition of macro '__dynamic_func_call_cls'
223 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:249:9: note: in expansion of macro '_dynamic_func_call_cls'
249 | _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:272:9: note: in expansion of macro '_dynamic_func_call'
272 | _dynamic_func_call(fmt, __dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:155:9: note: in expansion of macro 'dynamic_dev_dbg'
155 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
drivers/accel/ivpu/ivpu_drv.h:65:17: note: in expansion of macro 'dev_dbg'
65 | dev_dbg((vdev)->drm.dev, "[%s] " fmt, #type, ##args); \
| ^~~~~~~
drivers/accel/ivpu/ivpu_pm.c:240:9: note: in expansion of macro 'ivpu_dbg'
240 | ivpu_dbg(vdev, RPM, "rpm_get count %d\n", atomic_read(&vdev->drm.dev->power.usage_count));
| ^~~~~~~~It would be possible to rework these statements to only conditionally print the reference counter, or to make the driver depend on CONFIG_PM, but my impression is that these are not actually needed at all if the driver generally works, or they could be put back when required. Just remove all four of these to make the driver build in all configurations.
--- drivers/accel/ivpu/ivpu_pm.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/accel/ivpu/ivpu_pm.c +0 -10
@@ -239,8 +239,6 @@ int ivpu_rpm_get(struct ivpu_device *vdev) {int ret; -ivpu_dbg (vdev,RPM ,"rpm_get count %d\n" ,atomic_read (&vdev->drm.dev->power.usage_count)); - ret =pm_runtime_resume_and_get (vdev->drm.dev);if (!drm_WARN_ON (&vdev->drm, ret <0 )) vdev->pm->suspend_reschedule_counter =PM_RESCHEDULE_LIMIT ;
@@ -250,8 +248,6 @@ int ivpu_rpm_get(struct ivpu_device *vdev)void ivpu_rpm_put (struct ivpu_device *vdev) { -ivpu_dbg (vdev,RPM ,"rpm_put count %d\n" ,atomic_read (&vdev->drm.dev->power.usage_count)); -pm_runtime_mark_last_busy (vdev->drm.dev);pm_runtime_put_autosuspend (vdev->drm.dev); }
@@ -321,16 +317,10 @@ void ivpu_pm_enable(struct ivpu_device *vdev)pm_runtime_allow (dev);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); - -ivpu_dbg (vdev,RPM ,"Enable RPM count %d\n" ,atomic_read (&dev->power.usage_count)); }void ivpu_pm_disable (struct ivpu_device *vdev) { -struct device *dev = vdev->drm.dev; - -ivpu_dbg (vdev,RPM ,"Disable RPM count %d\n" ,atomic_read (&dev->power.usage_count)); -pm_runtime_get_noresume (vdev->drm.dev);pm_runtime_forbid (vdev->drm.dev); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 151/694 drm/rockchip: Drop unbalanced obj unref
In reply to Greg Kroah-HartmanFrom: Rob Clark <[email protected]>
[ Upstream commit 8ee3b0e85f6ccd9e6c527bc50eaba774c3bb18d0 ]
In the error path, rockchip_drm_gem_object_mmap() is dropping an obj reference that it doesn't own.
--- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0 -3
@@ -261,9 +261,6 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,else ret =rockchip_drm_gem_object_mmap_dma (obj, vma); -if (ret) -drm_gem_vm_close (vma); -return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 152/694 drm/i915/dg2: Drop one PCI ID
In reply to Greg Kroah-HartmanFrom: Matt Roper <[email protected]>
[ Upstream commit 3a38be31ec82920a871963c086393bc0ba26a655 ]
The bspec was recently updated to remove PCI ID 0x5698; this ID is actually reserved for future use and should not be treated as DG2-G11.
Bspec: 44477
--- include/drm/i915_pciids.h | 1 - 1 file changed, 1 deletion(-)
include/drm/i915_pciids.h +0 -1
@@ -706,7 +706,6 @@INTEL_VGA_DEVICE (0x5693 , info), \INTEL_VGA_DEVICE (0x5694 , info), \INTEL_VGA_DEVICE (0x5695 , info), \ -INTEL_VGA_DEVICE (0x5698 , info), \INTEL_VGA_DEVICE (0x56A5 , info), \INTEL_VGA_DEVICE (0x56A6 , info), \ INTEL_VGA_DEVICE(0x56B0, info), \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 153/694 drm/vgem: add missing mutex_destroy
In reply to Greg Kroah-HartmanFrom: Maíra Canal <[email protected]>
[ Upstream commit 7c18189b14b33c1fbf76480b1bd217877c086e67 ]
vgem_fence_open() instantiates a mutex for a particular fence instance, but never destroys it by calling mutex_destroy() in vgem_fence_close().
So, add the missing mutex_destroy() to guarantee proper resource destruction.
--- drivers/gpu/drm/vgem/vgem_fence.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/vgem/vgem_fence.c +1 -0
@@ -249,4 +249,5 @@ void vgem_fence_close(struct vgem_file *vfile) {idr_for_each (&vfile->fence_idr, __vgem_fence_idr_fini, vfile);idr_destroy (&vfile->fence_idr); +mutex_destroy (&vfile->fence_mutex); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 154/694 drm/probe-helper: Cancel previous job before starting new one
In reply to Greg Kroah-HartmanFrom: Dom Cobley <[email protected]>
[ Upstream commit a8e47884f1906cd7440fafa056adc8817568e73e ]
Currently we schedule a call to output_poll_execute from drm_kms_helper_poll_enable for 10s in future. Later we try to replace that in drm_helper_probe_single_connector_modes with a 0s schedule with delayed_event set.
But as there is already a job in the queue this fails, and the immediate job we wanted with delayed_event set doesn't occur until 10s later.
And that call acts as if connector state has changed, reprobing modes. This has a side effect of waking up a display that has been blanked.
Make sure we cancel the old job before submitting the immediate one.
--- drivers/gpu/drm/drm_probe_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +3 -2
@@ -590,8 +590,9 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,*/ dev->mode_config.delayed_event = true;if (dev->mode_config.poll_enabled) -schedule_delayed_work (&dev->mode_config.output_poll_work, -0 ); +mod_delayed_work (system_wq, + &dev->mode_config.output_poll_work, +0 ); }/* Re-enable polling in case the global poll config changed. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 155/694 arm64: dts: amlogic: meson-g12b-radxa-zero2: fix pwm clock names
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit db217e84d0a3f4183ea5b6d5929e55b73128fcb2 ]
Fixes the following bindings check error:
- pwm@2000: clock-names: 'oneOf' conditional failed, one must be fixed:
['clkin4'] is too short
'clkin4' is not one of ['clkin0', 'clkin1']
'clkin0' was expected
- pwm@7000: clock-names: 'oneOf' conditional failed, one must be fixed:
['clkin3'] is too short
'clkin3' is not one of ['clkin0', 'clkin1']
'clkin0' was expected
- pwm@19000: clock-names: 'oneOf' conditional failed, one must be fixed:
['clkin2'] is too short
'clkin2' is not one of ['clkin0', 'clkin1']
'clkin0' was expected
--- arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/amlogic/meson-g12b-radxa-zero2.dts +3 -3
@@ -360,7 +360,7 @@ pinctrl-0 = <&pwm_e_pins>; pinctrl-names = "default"; clocks = <&xtal>; - clock-names = "clkin2"; + clock-names = "clkin0"; status = "okay"; };
@@ -368,7 +368,7 @@ pinctrl-0 = <&pwm_ao_a_pins>; pinctrl-names = "default"; clocks = <&xtal>; - clock-names = "clkin3"; + clock-names = "clkin0"; status = "okay"; };
@@ -376,7 +376,7 @@ pinctrl-0 = <&pwm_ao_d_e_pins>; pinctrl-names = "default"; clocks = <&xtal>; - clock-names = "clkin4"; + clock-names = "clkin1"; status = "okay"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 156/694 drm/amdgpu: register a vga_switcheroo client for MacBooks with apple-gmux
In reply to Greg Kroah-HartmanFrom: Orlando Chamberlain <[email protected]>
[ Upstream commit d37a3929ca0363ed1dce02b2772cd5bc547ca66d ]
Commit 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and vga_switcheroo") made amdgpu only register a vga_switcheroo client for GPU's with PX, however AMD GPUs in dual gpu Apple Macbooks do need to register, but don't have PX. Instead of AMD's PX, they use apple-gmux.
Use apple_gmux_detect() to identify these gpus, and pci_is_thunderbolt_attached() to ensure eGPUs connected to Dual GPU Macbooks don't register with vga_switcheroo.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +16 -5
@@ -35,6 +35,7 @@#include <linux/devcoredump.h> #include <generated/utsrelease.h> #include <linux/pci-p2pdma.h> +#include <linux/apple-gmux.h> #include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h>
@@ -3945,12 +3946,15 @@ int amdgpu_device_init(struct amdgpu_device *adev,if ((adev->pdev->class >>8 ) ==PCI_CLASS_DISPLAY_VGA )vga_client_register (adev->pdev, amdgpu_device_vga_set_decode); -if (amdgpu_device_supports_px (ddev)) { - px = true; + px =amdgpu_device_supports_px (ddev); + +if (px || (!pci_is_thunderbolt_attached (adev->pdev) && +apple_gmux_detect (NULL ,NULL )))vga_switcheroo_register_client (adev->pdev, &amdgpu_switcheroo_ops, px); + +if (px)vga_switcheroo_init_domain_pm_ops (adev->dev, &adev->vga_pm_domain); - }if (adev->gmc.xgmi.pending_reset) queue_delayed_work(system_wq, &mgpu_info.delayed_reset_work,
@@ -4054,6 +4058,7 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)void amdgpu_device_fini_sw (struct amdgpu_device *adev) {int idx; +bool px;amdgpu_fence_driver_sw_fini (adev);amdgpu_device_ip_fini (adev);
@@ -4072,10 +4077,16 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)kfree (adev->bios); adev->bios =NULL ; -if (amdgpu_device_supports_px (adev_to_drm (adev))) { + + px =amdgpu_device_supports_px (adev_to_drm (adev)); + +if (px || (!pci_is_thunderbolt_attached (adev->pdev) && +apple_gmux_detect (NULL ,NULL )))vga_switcheroo_unregister_client (adev->pdev); + +if (px)vga_switcheroo_fini_domain_pm_ops (adev->dev); - } +if ((adev->pdev->class >>8 ) ==PCI_CLASS_DISPLAY_VGA )vga_client_unregister (adev->pdev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 157/694 tools/x86/kcpuid: Fix avx512bw and avx512lvl fields in Fn00000007
In reply to Greg Kroah-HartmanFrom: Terry Bowman <[email protected]>
[ Upstream commit 4e347bdf44c1fd4296a7b9657a2c0e1bd900fa50 ]
Leaf Fn00000007 contains avx512bw at bit 26 and avx512vl at bit 28. This is incorrect per the SDM. Correct avx512bw to be bit 30 and avx512lvl to be bit 31.
--- tools/arch/x86/kcpuid/cpuid.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/arch/x86/kcpuid/cpuid.csv +2 -2
@@ -184,8 +184,8 @@ 7, 0, EBX, 27, avx512er, AVX512 Exponent Reciproca instr 7, 0, EBX, 28, avx512cd, AVX512 Conflict Detection instr 7, 0, EBX, 29, sha, Intel Secure Hash Algorithm Extensions instr - 7, 0, EBX, 26, avx512bw, AVX512 Byte & Word instr - 7, 0, EBX, 28, avx512vl, AVX512 Vector Length Extentions (VL) + 7, 0, EBX, 30, avx512bw, AVX512 Byte & Word instr + 7, 0, EBX, 31, avx512vl, AVX512 Vector Length Extentions (VL) 7, 0, ECX, 0, prefetchwt1, X 7, 0, ECX, 1, avx512vbmi, AVX512 Vector Byte Manipulation Instructions 7, 0, ECX, 2, umip, User-mode Instruction Prevention
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 158/694 soc: ti: k3-ringacc: Add try_module_get() to k3_dmaring_request_dual_ring()
In reply to Greg Kroah-HartmanFrom: Nicolas Frayer <[email protected]>
[ Upstream commit 5f1732a8683c1da8faaa90d6ffc3bd6d33013a58 ]
When the k3 ring accelerator driver has been modified to add module build support, try_module_get() and module_put() have been added to update the module refcnt. One code path has not been updated and it has introduced an issue where the refcnt is decremented by module_put() in k3_ringacc_ring_free() without being incremented previously. Adding try_module_get() to k3_dmaring_request_dual_ring() ensures the refcnt is kept up to date.
--- drivers/soc/ti/k3-ringacc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/soc/ti/k3-ringacc.c +7 -0
@@ -406,6 +406,11 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,mutex_lock (&ringacc->req_lock); +if (!try_module_get (ringacc->dev->driver->owner)) { + ret = -EINVAL ; + goto err_module_get; + } +if (test_bit (fwd_id, ringacc->rings_inuse)) { ret = -EBUSY ; goto error;
@@ -421,6 +426,8 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,return 0 ; error: +module_put (ringacc->dev->driver->owner); +err_module_get:mutex_unlock (&ringacc->req_lock);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 159/694 soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 8f3c307b580a4a6425896007325bddefc36e8d91 ]
wkup_m3_ipc_get() takes refcount, which should be freed by wkup_m3_ipc_put(). Add missing refcount release in the error paths.
--- drivers/soc/ti/pm33xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/soc/ti/pm33xx.c +3 -2
@@ -527,7 +527,7 @@ static int am33xx_pm_probe(struct platform_device *pdev) ret =am33xx_pm_alloc_sram ();if (ret) -return ret; + goto err_wkup_m3_ipc_put; ret =am33xx_pm_rtc_setup ();if (ret)
@@ -572,13 +572,14 @@ static int am33xx_pm_probe(struct platform_device *pdev)pm_runtime_put_sync (dev); err_pm_runtime_disable:pm_runtime_disable (dev); -wkup_m3_ipc_put (m3_ipc); err_unsetup_rtc:iounmap (rtc_base_virt);clk_put (rtc_fck); err_free_sram:am33xx_pm_free_sram (); pm33xx_dev =NULL ; +err_wkup_m3_ipc_put: +wkup_m3_ipc_put (m3_ipc);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 160/694 arm64: dts: renesas: r8a77990: Remove bogus voltages from OPP table
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit fb76b0fae3ca880363214e1dcd6513ab8bd529e7 ]
According to the R-Car Series, 3rd Generation Hardware User’s Manual Rev. 2.30, the System CPU cores on R-Car E3 do not have their own power supply, but use the common internal power supply (typical 1.03V).
Hence remove the "opp-microvolt" properties from the Operating Performance Points table. They are optional, and unused, when none of the CPU nodes is tied to a regulator using the "cpu-supply" property.
--- arch/arm64/boot/dts/renesas/r8a77990.dtsi | 3 --- 1 file changed, 3 deletions(-)
arch/arm64/boot/dts/renesas/r8a77990.dtsi +0 -3
@@ -49,17 +49,14 @@ opp-shared; opp-800000000 { opp-hz = /bits/ 64 <800000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1200000000 { opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; opp-suspend; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 161/694 arm64: dts: renesas: r8a774c0: Remove bogus voltages from OPP table
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 554edc3e9239bb81e61be9f0f5dbbeb528a69e72 ]
According to the RZ/G Series, 2nd Generation Hardware User’s Manual Rev. 1.11, the System CPU cores on RZ/G2E do not have their own power supply, but use the common internal power supply (typical 1.03V).
Hence remove the "opp-microvolt" properties from the Operating Performance Points table. They are optional, and unused, when none of the CPU nodes is tied to a regulator using the "cpu-supply" property.
--- arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 3 --- 1 file changed, 3 deletions(-)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +0 -3
@@ -49,17 +49,14 @@ opp-shared; opp-800000000 { opp-hz = /bits/ 64 <800000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1200000000 { opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; opp-suspend; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 162/694 arm64: dts: renesas: r9a07g044: Update IRQ numbers for SSI channels
In reply to Greg Kroah-HartmanFrom: Lad Prabhakar <[email protected]>
[ Upstream commit 5da750ddd96454757a3b467e968e3fb70bb12bc8 ]
Quoted 1 line
From R01UH0914EJ0120 Rev.1.20 HW manual the interrupt numbers for SSI
channels have been updated,
SPI 329 - SSIF0 is now marked as reserved
SPI 333 - SSIF1 is now marked as reserved
SPI 335 - SSIF2 is now marked as reserved
SPI 336 - SSIF2 is now marked as reserved
SPI 341 - SSIF3 is now marked as reserved
This patch drops the above IRQs from SoC DTSI.
--- arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g044.dtsi +7 -12
@@ -175,9 +175,8 @@ reg = <0 0x10049c00 0 0x400>; interrupts = <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 327 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 329 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G044_SSI0_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI0_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -196,9 +195,8 @@ reg = <0 0x1004a000 0 0x400>; interrupts = <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 331 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 333 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G044_SSI1_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI1_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -216,10 +214,8 @@ "renesas,rz-ssi"; reg = <0 0x1004a400 0 0x400>; interrupts = <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 335 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 336 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 337 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + interrupt-names = "int_req", "dma_rt"; clocks = <&cpg CPG_MOD R9A07G044_SSI2_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI2_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -238,9 +234,8 @@ reg = <0 0x1004a800 0 0x400>; interrupts = <GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 339 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 341 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G044_SSI3_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI3_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 163/694 arm64: dts: renesas: r9a07g054: Update IRQ numbers for SSI channels
In reply to Greg Kroah-HartmanFrom: Lad Prabhakar <[email protected]>
[ Upstream commit c2b0dc0e83ef4a74cbe381fd0c84cea16cf067f0 ]
Quoted 1 line
From R01UH0936EJ0120 Rev.1.20 HW manual the interrupt numbers for SSI
channels have been updated,
SPI 329 - SSIF0 is now marked as reserved
SPI 333 - SSIF1 is now marked as reserved
SPI 335 - SSIF2 is now marked as reserved
SPI 336 - SSIF2 is now marked as reserved
SPI 341 - SSIF3 is now marked as reserved
This patch drops the above IRQs from SoC DTSI.
--- arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g054.dtsi +7 -12
@@ -175,9 +175,8 @@ reg = <0 0x10049c00 0 0x400>; interrupts = <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 327 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 329 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G054_SSI0_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI0_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -196,9 +195,8 @@ reg = <0 0x1004a000 0 0x400>; interrupts = <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 331 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 333 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G054_SSI1_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI1_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -216,10 +214,8 @@ "renesas,rz-ssi"; reg = <0 0x1004a400 0 0x400>; interrupts = <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 335 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 336 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 337 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + interrupt-names = "int_req", "dma_rt"; clocks = <&cpg CPG_MOD R9A07G054_SSI2_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI2_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -238,9 +234,8 @@ reg = <0 0x1004a800 0 0x400>; interrupts = <GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 339 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 341 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G054_SSI3_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI3_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 164/694 arm64: dts: renesas: r9a07g043: Update IRQ numbers for SSI channels
In reply to Greg Kroah-HartmanFrom: Lad Prabhakar <[email protected]>
[ Upstream commit 2a5c9891392dca47f6865a2add1986876e40849c ]
Quoted 1 line
From R01UH0968EJ0100 Rev.1.00 HW manual the interrupt numbers for SSI
channels have been updated,
SPI 329 - SSIF0 is now marked as reserved
SPI 333 - SSIF1 is now marked as reserved
SPI 335 - SSIF2 is now marked as reserved
SPI 336 - SSIF2 is now marked as reserved
SPI 341 - SSIF3 is now marked as reserved
This patch drops the above IRQs from SoC DTSI.
--- arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g043.dtsi +7 -12
@@ -80,9 +80,8 @@ reg = <0 0x10049c00 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(326) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(327) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(328) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(329) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <SOC_PERIPHERAL_IRQ(328) IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G043_SSI0_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI0_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -101,9 +100,8 @@ reg = <0 0x1004a000 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(330) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(331) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(332) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(333) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <SOC_PERIPHERAL_IRQ(332) IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G043_SSI1_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI1_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -121,10 +119,8 @@ "renesas,rz-ssi"; reg = <0 0x1004a400 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(334) IRQ_TYPE_LEVEL_HIGH>, - <SOC_PERIPHERAL_IRQ(335) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(336) IRQ_TYPE_EDGE_RISING>, <SOC_PERIPHERAL_IRQ(337) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + interrupt-names = "int_req", "dma_rt"; clocks = <&cpg CPG_MOD R9A07G043_SSI2_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI2_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -143,9 +139,8 @@ reg = <0 0x1004a800 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(338) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(339) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(340) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(341) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <SOC_PERIPHERAL_IRQ(340) IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G043_SSI3_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI3_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 165/694 drm/mediatek: dp: Only trigger DRM HPD events if bridge is attached
In reply to Greg Kroah-HartmanFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 36b617f7e4ae663fcadd202ea061ca695ca75539 ]
The MediaTek DisplayPort interface bridge driver starts its interrupts as soon as its probed. However when the interrupts trigger the bridge might not have been attached to a DRM device. As drm_helper_hpd_irq_event() does not check whether the passed in drm_device is valid or not, a NULL pointer passed in results in a kernel NULL pointer dereference in it.
Check whether the bridge is attached and only trigger an HPD event if it is.
--- drivers/gpu/drm/mediatek/mtk_dp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_dp.c +2 -1
@@ -1823,7 +1823,8 @@ static irqreturn_t mtk_dp_hpd_event_thread(int hpd, void *dev)spin_unlock_irqrestore (&mtk_dp->irq_thread_lock, flags);if (status &MTK_DP_THREAD_CABLE_STATE_CHG ) { -drm_helper_hpd_irq_event (mtk_dp->bridge.dev); +if (mtk_dp->bridge.dev) +drm_helper_hpd_irq_event (mtk_dp->bridge.dev);if (!mtk_dp->train_info.cable_plugged_in) {mtk_dp_disable_sdp_aui (mtk_dp);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 166/694 drm/msm/disp/dpu: check for crtc enable rather than crtc active to release shared resources
In reply to Greg Kroah-HartmanFrom: Vinod Polimera <[email protected]>
[ Upstream commit b6975693846b562c4d3e0e60cc884affc5bdac00 ]
According to KMS documentation, The driver must not release any shared resources if active is set to false but enable still true.
Patchwork: https://patchwork.freedesktop.org/patch/524726/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +1 -1
@@ -652,7 +652,7 @@ static int dpu_encoder_virt_atomic_check(if (drm_atomic_crtc_needs_modeset (crtc_state)) {dpu_rm_release (global_state, drm_enc); -if (!crtc_state->active_changed || crtc_state->active) +if (!crtc_state->active_changed || crtc_state->enable) ret =dpu_rm_reserve (&dpu_kms->rm, global_state, drm_enc, crtc_state, topology); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 167/694 EDAC/skx: Fix overflows on the DRAM row address mapping arrays
In reply to Greg Kroah-HartmanFrom: Qiuxu Zhuo <[email protected]>
[ Upstream commit 71b1e3ba3fed5a34c5fac6d3a15c2634b04c1eb7 ]
The current DRAM row address mapping arrays skx_{open,close}_row[] only support ranks with sizes up to 16G. Decoding a rank address to a DRAM row address for a 32G rank by using either one of the above arrays by the skx_edac driver, will result in an overflow on the array.
For a 32G rank, the most significant DRAM row address bit (the bit17) is mapped from the bit34 of the rank address. Add this new mapping item to both arrays to fix the overflow issue.
--- drivers/edac/skx_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/skx_base.c +2 -2
@@ -510,7 +510,7 @@ static bool skx_rir_decode(struct decoded_addr *res) }static u8 skx_close_row[] = { -15 ,16 ,17 ,18 ,20 ,21 ,22 ,28 ,10 ,11 ,12 ,13 ,29 ,30 ,31 ,32 ,33 +15 ,16 ,17 ,18 ,20 ,21 ,22 ,28 ,10 ,11 ,12 ,13 ,29 ,30 ,31 ,32 ,33 ,34 };static u8 skx_close_column[] = {
@@ -518,7 +518,7 @@ static u8 skx_close_column[] = { };static u8 skx_open_row[] = { -14 ,15 ,16 ,20 ,28 ,21 ,22 ,23 ,24 ,25 ,26 ,27 ,29 ,30 ,31 ,32 ,33 +14 ,15 ,16 ,20 ,28 ,21 ,22 ,23 ,24 ,25 ,26 ,27 ,29 ,30 ,31 ,32 ,33 ,34 };static u8 skx_open_column[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 168/694 ARM: dts: qcom-apq8064: Fix opp table child name
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit b9745c275246a7e43c34d1b3be5ff9a9f3cf9305 ]
The opp-320000000 name is rather misleading with the opp-hz value of 450 MHz. Fix it!
--- arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-apq8064.dtsi +1 -1
@@ -1260,7 +1260,7 @@ gpu_opp_table: opp-table { compatible = "operating-points-v2"; - opp-320000000 { + opp-450000000 { opp-hz = /bits/ 64 <450000000>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 169/694 arm64: dts: imx8mp: Drop simple-bus from fsl,imx8mp-media-blk-ctrl
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 5a51e1f2b083423f75145c512ee284862ab33854 ]
This block should not be compatible with simple-bus and misuse it that way. Instead, the driver should scan its subnodes and bind drivers to them.
--- arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 -1
@@ -1151,7 +1151,7 @@ media_blk_ctrl: blk-ctrl@32ec0000 { compatible = "fsl,imx8mp-media-blk-ctrl", - "simple-bus", "syscon"; + "syscon"; reg = <0x32ec0000 0x10000>; #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.39.2
Re: [PATCH 6.3 169/694] arm64: dts: imx8mp: Drop simple-bus from fsl,imx8mp-media-blk-ctrl
Hello Greg,
can you please revert this patch, without the corresponding driver patch
[1] it breaks probing of the device, as no one populates the sub-nodes.
[1] 9cb6d1b39a8f ("soc: imx: imx8m-blk-ctrl: Scan subnodes and bind drivers to them")
Marc
Quoted 36 lines · Greg Kroah-Hartman
From: Marek Vasut <[email protected]>
[ Upstream commit
5a51e1f2b083423f75145c512ee284862ab33854]This block should not be compatible with simple-bus and misuse it that way. Instead, the driver should scan its subnodes and bind drivers to them.
Reviewed-by Alexander Stein <[email protected]>Reviewed-by Liu Ying <[email protected]>Tested-by Alexander Stein <[email protected]>Fixes 94e6197dadc9 ("arm64: dts: imx8mp: Add LCDIF2 & LDB nodes")Signed-off-by Marek Vasut <[email protected]>Signed-off-by Shawn Guo <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/boot/dts/freescale/imx8mp.dtsi +1
-1@@ -1151,7 +1151,7 @@ media_blk_ctrl: blk-ctrl@32ec0000 { compatible = "fsl,imx8mp-media-blk-ctrl", - "simple-bus", "syscon"; + "syscon"; reg = <0x32ec0000 0x10000>; #address-cells = <1>; #size-cells = <1>;Signature · 1 line
2.39.2
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Greg Kroah-Hartman
maintainerRe: [PATCH 6.3 169/694] arm64: dts: imx8mp: Drop simple-bus from fsl,imx8mp-media-blk-ctrl
Quoted 6 lines · Marc Kleine-Budde
Hello Greg,
can you please revert this patch, without the corresponding driver patch
[1] it breaks probing of the device, as no one populates the sub-nodes.[1]
9cb6d1b39a8f("soc: imx: imx8m-blk-ctrl: Scan subnodes and bind drivers to them")
Sorry for the delay, now reverted.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 170/694 regulator: core: Shorten off-on-delay-us for always-on/boot-on by time since booted
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 691c1fcda5351ed98a44610b7dccc0e3ee920020 ]
This is very close to a straight revert of commit 218320fec294 ("regulator: core: Fix off-on-delay-us for always-on/boot-on regulators"). We've identified that patch as causing a boot speed regression on sc7180-trogdor boards. While boot speed certainly isn't more important than making sure that power sequencing is correct, looking closely at the original change it doesn't seem to have been fully justified. It mentions "cycling issues" without describing exactly what the issues were. That means it's possible that the cycling issues were really a problem that should be fixed in a different way.
Let's take a careful look at how we should handle regulators that have an off-on-delay and that are boot-on or always-on. Linux currently doesn't have any way to identify whether a GPIO regulator was already on when the kernel booted. That means that when the kernel boots we probe a regulator, see that it wants boot-on / always-on we, and then turn the regulator on. We could be in one of two cases when we do this:
a) The regulator might have been left on by the bootloader and we're ensuring that it stays on.
b) The regulator might have been left off by the bootloader and we're just now turning it on.
For case a) we definitely don't need any sort of delay. For case b) we _might_ need some delay in case the bootloader turned the regulator off _right_ before booting the kernel. To get the proper delay for case b) then we can just assume a last_off of 0, which is what it gets initialized to by default.
As per above, we can't tell whether we're in case a) or case b) so we'll assume the longer delay (case b). This basically puts the code to how it was before commit 218320fec294 ("regulator: core: Fix off-on-delay-us for always-on/boot-on regulators"). However, we add one important change: we make sure that the delay is actually honored if last_off is 0. Though the original "cycling issues" cited were vague, I'm hopeful that this important extra change will be enough to fix the issues that the initial commit mentioned.
With this fix, I've confined that on a sc7180-trogdor board the delay at boot goes down from 500 ms to ~250 ms. That's not as good as the 0 ms that we had prior to commit 218320fec294 ("regulator: core: Fix off-on-delay-us for always-on/boot-on regulators"), but it's probably safer because we don't know if the bootloader turned the regulator off right before booting.
One note is that it's possible that we could be in a state that's not
a) or b) if there are other issues in the kernel. The only one I can think of is related to pinctrl. If the pinctrl driver being used on a board isn't careful about avoiding glitches when setting up a pin then it's possible that setting up a pin could cause the regulator to "turn off" briefly immediately before the regulator probes. If this is indeed causing problems then the pinctrl driver should be fixed, perhaps in a similar way to what was done in commit d21f4b7ffc22 ("pinctrl: qcom: Avoid glitching lines when we first mux to output")
--- drivers/regulator/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/regulator/core.c +3 -4
@@ -1583,9 +1583,6 @@ static int set_machine_constraints(struct regulator_dev *rdev) rdev->constraints->always_on = true; } -if (rdev->desc->off_on_delay) - rdev->last_off =ktime_get_boottime (); -/* If the constraints say the regulator should be on at this point * and we have control then make sure it is enabled. */
@@ -1619,6 +1616,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)if (rdev->constraints->always_on) rdev->use_count++; + }else if (rdev->desc->off_on_delay) { + rdev->last_off =ktime_get (); }print_constraints (rdev);
@@ -2668,7 +2667,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)trace_regulator_enable (rdev_get_name (rdev)); -if (rdev->desc->off_on_delay && rdev->last_off) { +if (rdev->desc->off_on_delay) {/* if needed, keep a distance of off_on_delay from last time * this regulator was disabled. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 171/694 arm64: dts: ti: k3-am62-main: Fix GPIO numbers in DT
In reply to Greg Kroah-HartmanFrom: Nitin Yadav <[email protected]>
[ Upstream commit 28c8f2189d80c8b37068c367e9864b5aa530f208 ]
Fix number of gpio pins in main_gpio0 & main_gpio1 DT nodes according to AM62x SK datasheet. The Link of datasheet is in the following line:
https://www.ti.com/lit/ds/symlink/am625.pdf?ts=1673852494660
Section: 6.3.10 GPIO (Page No. 63-67)
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +2 -2
@@ -461,7 +461,7 @@ <193>, <194>, <195>; interrupt-controller; #interrupt-cells = <2>; - ti,ngpio = <87>; + ti,ngpio = <92>; ti,davinci-gpio-unbanked = <0>; power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 77 0>;
@@ -478,7 +478,7 @@ <183>, <184>, <185>; interrupt-controller; #interrupt-cells = <2>; - ti,ngpio = <88>; + ti,ngpio = <52>; ti,davinci-gpio-unbanked = <0>; power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 78 0>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 172/694 arm64: dts: ti: k3-am62a7-sk: Fix DDR size to full 4GB
In reply to Greg Kroah-HartmanFrom: Devarsh Thakkar <[email protected]>
[ Upstream commit a1bc0d6084dba8a31831c65318a8a8e46f00906f ]
All revisions of AM62A7-SK board have 4GB LPDDR4 Micron MT53E2G32D4DE-046 AUT:B memory. Commit 38c4a08c820c ("arm64: dts: ti:
Add support for AM62A7-SK") enabled just 2GB due to a schematics error in early revision of the board. Fix it by enabling full 4GB available on the platform.
Design docs: https://www.ti.com/lit/zip/sprr459
--- arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +3 -2
@@ -27,8 +27,9 @@ memory@80000000 { device_type = "memory"; - /* 2G RAM */ - reg = <0x00000000 0x80000000 0x00000000 0x80000000>; + /* 4G RAM */ + reg = <0x00000000 0x80000000 0x00000000 0x80000000>, + <0x00000008 0x80000000 0x00000000 0x80000000>; }; reserved-memory {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 173/694 arm64: dts: ti: k3-j721e-main: Remove ti,strobe-sel property
In reply to Greg Kroah-HartmanFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 4f4b30a777d3e61603119297965343a37be36435 ]
According to latest errata of J721e [1], (i2024) 'MMCSD: Peripherals Do Not Support HS400' which applies to MMCSD0 subsystem. Speed modes supported has been already updated but missed dropping 'ti,strobe-sel' property which is only required by HS400 speed mode.
Thus, drop 'ti,strobe-sel' property from kernel dtsi for J721e SoC.
[1] https://www.ti.com/lit/er/sprz455/sprz455.pdf
--- arch/arm64/boot/dts/ti/k3-j721e-main.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j721e-main.dtsi +0 -1
@@ -1180,7 +1180,6 @@ ti,itap-del-sel-mmc-hs = <0xa>; ti,itap-del-sel-ddr52 = <0x3>; ti,trm-icp = <0x8>; - ti,strobe-sel = <0x77>; dma-coherent; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 174/694 arm64: dts: ti: k3-j784s4-*: Add ti,sci-dev-id for NAVSS nodes
In reply to Greg Kroah-HartmanFrom: Jayesh Choudhary <[email protected]>
[ Upstream commit 436b288687176bf4d2c1cd25b86173e5a1649a60 ]
TISCI device ID for main_navss and mcu_navss nodes are missing in the device tree. Add them.
--- arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 1 + arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 1 + 2 files changed, 2 insertions(+)
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +1 -0
@@ -398,6 +398,7 @@ #address-cells = <2>; #size-cells = <2>; ranges = <0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>; + ti,sci-dev-id = <280>; dma-coherent; dma-ranges;
arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi +1 -0
@@ -209,6 +209,7 @@ #address-cells = <2>; #size-cells = <2>; ranges = <0x00 0x28380000 0x00 0x28380000 0x00 0x03880000>; + ti,sci-dev-id = <323>; dma-coherent; dma-ranges;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 175/694 arm64: dts: broadcom: bcmbca: bcm4908: fix NAND interrupt name
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 5cca02449490e767289bda38db1577e2c375c084 ]
This fixes:arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: interrupt-names:0: 'nand_ctlrdy' was expected
From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yamlarch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: Unevaluated properties are not allowed ('interrupt-names' was unexpected)
From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
--- arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +1 -1
@@ -538,7 +538,7 @@ reg = <0x1800 0x600>, <0x2000 0x10>; reg-names = "nand", "nand-int-base"; interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "nand"; + interrupt-names = "nand_ctlrdy"; status = "okay"; nandcs: nand@0 {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 176/694 arm64: dts: broadcom: bcmbca: bcm4908: fix LED nodenames
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 23be9f68f933adee8163b8efc9c6bff71410cc7c ]
This fixes:arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dtb: leds@800: 'led-lan@19', 'led-power@11', 'led-wan-red@12', 'led-wan-white@15', 'led-wps@14' do not match any of the regexes: '^led@[a-f0-9]+$', 'pinctrl-[0-9]+'
From schema: Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
--- .../dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts +5 -5
@@ -120,7 +120,7 @@ }; &leds { - led-power@11 { + led@11 { reg = <0x11>; function = LED_FUNCTION_POWER; color = <LED_COLOR_ID_WHITE>;
@@ -130,7 +130,7 @@ pinctrl-0 = <&pins_led_17_a>; }; - led-wan-red@12 { + led@12 { reg = <0x12>; function = LED_FUNCTION_WAN; color = <LED_COLOR_ID_RED>;
@@ -139,7 +139,7 @@ pinctrl-0 = <&pins_led_18_a>; }; - led-wps@14 { + led@14 { reg = <0x14>; function = LED_FUNCTION_WPS; color = <LED_COLOR_ID_WHITE>;
@@ -148,7 +148,7 @@ pinctrl-0 = <&pins_led_20_a>; }; - led-wan-white@15 { + led@15 { reg = <0x15>; function = LED_FUNCTION_WAN; color = <LED_COLOR_ID_WHITE>;
@@ -157,7 +157,7 @@ pinctrl-0 = <&pins_led_21_a>; }; - led-lan@19 { + led@19 { reg = <0x19>; function = LED_FUNCTION_LAN; color = <LED_COLOR_ID_WHITE>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 177/694 arm64: dts: broadcom: bcmbca: bcm4908: fix procmon nodename
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
[ Upstream commit f16a8294dd7a02c7ad042cd2e3acc5ea06698dc1 ]
This fixes:arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: syscon@280000: $nodename:0: 'syscon@280000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$'
From schema: schemas/simple-bus.yaml
--- arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +1 -1
@@ -254,7 +254,7 @@ }; }; - procmon: syscon@280000 { + procmon: bus@280000 { compatible = "simple-bus"; reg = <0x280000 0x1000>; ranges;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 178/694 arm64: dts: qcom: sm8550: Fix PCIe PHYs and controllers nodes
In reply to Greg Kroah-HartmanFrom: Abel Vesa <[email protected]>
[ Upstream commit 32734bbd1802efbd60ea4f0c3c1d5500bd0b20fe ]
First, move the pinctrl related propeties out from SoC dtsi and into the board dts and add blank lines before status properties in the PHY nodes to be consistent with the rest of the nodes. Then drop the pipe clock from the controller nodes. Rename the aggre0 and aggre1 clocks to more generic noc_aggr, and then the cnoc_pcie_sf_axi to cnoc_sf_axi. Add the cpu-pcie interconnects to both controller nodes. Rename the pcie1 second reset to link_down and drop the unnecessary enable-gpios. Switch the aux clock to GCC_PCIE_1_PHY_AUX_CLK for the pcie1 PHY and drop the aux_phy from clock-names. Also rename the nocsr reset to phy_nocsr. With this changes we are now in line with the SC8280XP bindings.
--- arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 10 +++++ arch/arm64/boot/dts/qcom/sm8550.dtsi | 52 +++++++++---------------- 2 files changed, 28 insertions(+), 34 deletions(-)
arch/arm64/boot/dts/qcom/sm8550-mtp.dts +10 -0
@@ -414,18 +414,27 @@ &pcie0 { wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>; perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_default_state>; + status = "okay"; }; &pcie0_phy { vdda-phy-supply = <&vreg_l1e_0p88>; vdda-pll-supply = <&vreg_l3e_1p2>; + status = "okay"; }; &pcie1 { wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>; perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_default_state>; + status = "okay"; };
@@ -433,6 +442,7 @@ vdda-phy-supply = <&vreg_l3c_0p91>; vdda-pll-supply = <&vreg_l3e_1p2>; vdda-qref-supply = <&vreg_l1e_0p88>; + status = "okay"; };
arch/arm64/boot/dts/qcom/sm8550.dtsi +18 -34
122 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 179/694 arm64: dts: qcom: msm8998: Fix stm-stimulus-base reg name
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit b5d08f08377218b1d2ab4026e427a7788b271c8e ]
The name stm-data-base comes from ancient (msm-3.10 or older) downstream kernels. Upstream uses stm-stimulus-base instead. Fix it.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +1 -1
@@ -1524,7 +1524,7 @@ compatible = "arm,coresight-stm", "arm,primecell"; reg = <0x06002000 0x1000>, <0x16280000 0x180000>; - reg-names = "stm-base", "stm-data-base"; + reg-names = "stm-base", "stm-stimulus-base"; status = "disabled"; clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 180/694 soc: canaan: Make K210_SYSCTL depend on CLK_K210
In reply to Greg Kroah-HartmanFrom: Jesse Taube <[email protected]>
[ Upstream commit 49f965b6fbca63904d7397ce96066fa992f401a3 ]
CLK_K210 is no longer a dependency of SOC_CANAAN,
but K210_SYSCTL depends on CLK_K210. This patch makes K210_SYSCTL depend on CLK_K210. Also fix whitespace errors.
--- drivers/soc/canaan/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/soc/canaan/Kconfig +3 -2
@@ -3,8 +3,9 @@ config SOC_K210_SYSCTL bool "Canaan Kendryte K210 SoC system controller" depends on RISCV && SOC_CANAAN && OF + depends on COMMON_CLK_K210 default SOC_CANAAN - select PM - select MFD_SYSCON + select PM + select MFD_SYSCON help Canaan Kendryte K210 SoC system controller driver.
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 181/694 arm64: dts: qcom: qdu1000: drop incorrect serial properties
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 9b8bfc443349c0c220438c6ac8839774210c9ba2 ]
The serial node does not use/allow address/size cells:
qdu1000-idp.dtb: geniqup@9c0000: serial@99c000: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
--- arch/arm64/boot/dts/qcom/qdu1000.dtsi | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/boot/dts/qcom/qdu1000.dtsi +0 -4
@@ -412,8 +412,6 @@ pinctrl-0 = <&qup_uart0_default>; pinctrl-names = "default"; interrupts = <GIC_SPI 601 IRQ_TYPE_LEVEL_HIGH>; - #address-cells = <1>; - #size-cells = <0>; status = "disabled"; };
@@ -581,8 +579,6 @@ pinctrl-0 = <&qup_uart7_tx>, <&qup_uart7_rx>; pinctrl-names = "default"; interrupts = <GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>; - #address-cells = <1>; - #size-cells = <0>; status = "disabled"; }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 182/694 arm64: dts: qcom: sc7280: fix EUD port properties
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit a369c74243ca4ad60b9de0ac5c2207fb4c4117b8 ]
Nodes with unit addresses must have also 'reg' property:
sc7280-herobrine-crd.dtb: eud@88e0000: ports:port@0: 'reg' is a required property
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/qcom/sc7280.dtsi +9 -0
@@ -3595,12 +3595,17 @@ <0 0x088e2000 0 0x1000>; interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>; ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; eud_ep: endpoint { remote-endpoint = <&usb2_role_switch>; }; }; port@1 { + reg = <1>; eud_con: endpoint { remote-endpoint = <&con_eud>; };
@@ -3611,7 +3616,11 @@ eud_typec: connector { compatible = "usb-c-connector"; ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; con_eud: endpoint { remote-endpoint = <&eud_con>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 183/694 arm64: dts: qcom: sdm845: correct dynamic power coefficients
In reply to Greg Kroah-HartmanFrom: Vincent Guittot <[email protected]>
[ Upstream commit 44750f153699b6e4f851a399287e5c8df208d696 ]
While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores where never selected as the most energy efficient CPU whatever the utilization level of waking task.
energy model framework uses its cost field to estimate the energy with the formula:
nrg = cost of the selected OPP * utilization / CPU's max capacity
which ends up selecting the CPU with lowest cost / max capacity ration as long as the utilization fits in the OPP's capacity.
If we compare the cost of a little OPP with similar capacity of a big OPP like :
OPP(kHz) OPP capacity cost max capacity cost/max capacity LITTLE 1766400 407 351114 407 863 big 1056000 408 520267 1024 508
This can be interpreted as the LITTLE core consumes 70% more than big core for the same compute capacity.
According to [1], LITTLE consumes 10% less than big core for Coremark benchmark at those OPPs. If we consider that everything else stays unchanged, the dynamic-power-coefficient of LITTLE core should be only 53% of the current value: 290 * 53% = 154
Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
[1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +4 -4
@@ -94,7 +94,7 @@ reg = <0x0 0x0>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -120,7 +120,7 @@ reg = <0x0 0x100>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -142,7 +142,7 @@ reg = <0x0 0x200>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -164,7 +164,7 @@ reg = <0x0 0x300>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 184/694 arm64: dts: qcom: sdm845: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 67aa109eee654c76dcc100554e637fa64d5aa099 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +3 -3
@@ -2292,8 +2292,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0xd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0xd00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -2397,7 +2397,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 185/694 arm64: dts: qcom: msm8998: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit c30a27dcfe4545edbda1578b3a63ed6147519cdd ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI address (0x1b200000) specified in the ranges property for I/O region.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +1 -1
@@ -922,7 +922,7 @@ phy-names = "pciephy"; status = "disabled"; - ranges = <0x01000000 0x0 0x1b200000 0x1b200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x1b200000 0x0 0x100000>, <0x02000000 0x0 0x1b300000 0x1b300000 0x0 0xd00000>; #interrupt-cells = <1>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 186/694 arm64: dts: qcom: sc7280: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 1d4743d6312582978966d38908b69085621b7693 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI address (0x40200000) specified in the ranges property for I/O region.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +1 -1
@@ -2077,7 +2077,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 187/694 arm64: dts: qcom: sm8550: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 565c633940312b4eea7785a0a58e1944258c47e9 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +4 -4
@@ -1653,8 +1653,8 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; bus-range = <0x00 0xff>; dma-coherent;
@@ -1745,8 +1745,8 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0 0x40200000 0x0 0x100000>, - <0x02000000 0x0 0x40300000 0 0x40300000 0x0 0x1fd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, + <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; bus-range = <0x00 0xff>; dma-coherent;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 188/694 arm64: dts: qcom: ipq8074: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit e49eafefe5ab325e38dd074f2005076ffc271e54 ]
For 64KiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x10000. Hence, fix the bogus PCI addresses (0x10200000, 0x20200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses and align them in a single line.
--- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/ipq8074.dtsi +4 -8
@@ -780,10 +780,8 @@ phys = <&pcie_phy1>; phy-names = "pciephy"; - ranges = <0x81000000 0 0x10200000 0x10200000 - 0 0x10000>, /* downstream I/O */ - <0x82000000 0 0x10220000 0x10220000 - 0 0xfde0000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x10200000 0x0 0x10000>, /* I/O */ + <0x82000000 0x0 0x10220000 0x10220000 0x0 0xfde0000>; /* MEM */ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -844,10 +842,8 @@ phys = <&pcie_phy0>; phy-names = "pciephy"; - ranges = <0x81000000 0 0x20200000 0x20200000 - 0 0x10000>, /* downstream I/O */ - <0x82000000 0 0x20220000 0x20220000 - 0 0xfde0000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x20200000 0x0 0x10000>, /* I/O */ + <0x82000000 0x0 0x20220000 0x20220000 0x0 0xfde0000>; /* MEM */ interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 189/694 arm64: dts: qcom: ipq6018: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 75a6e1fdb351189f55097741e8460ca3f9b2883f ]
For 64KiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x10000. Hence, fix the bogus PCI address (0x20200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +2 -2
@@ -738,8 +738,8 @@ phys = <&pcie_phy0>; phy-names = "pciephy"; - ranges = <0x81000000 0 0x20200000 0 0x20200000 0 0x10000>, - <0x82000000 0 0x20220000 0 0x20220000 0 0xfde0000>; + ranges = <0x81000000 0x0 0x00000000 0x0 0x20200000 0x0 0x10000>, + <0x82000000 0x0 0x20220000 0x0 0x20220000 0x0 0xfde0000>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 190/694 arm64: dts: qcom: msm8996: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit cf0ac10feb17661987d0018eb9475dc03e2a2253 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x0c200000, 0x0d200000, 0x0e200000) specified in the ranges property for I/O region.
While at it, let's also align the entries.
--- arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/qcom/msm8996.dtsi +6 -6
@@ -1851,8 +1851,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x0c200000 0x0c200000 0x0 0x100000>, - <0x02000000 0x0 0x0c300000 0x0c300000 0x0 0xd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0c200000 0x0 0x100000>, + <0x02000000 0x0 0x0c300000 0x0c300000 0x0 0xd00000>; device_type = "pci";
@@ -1905,8 +1905,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x0d200000 0x0d200000 0x0 0x100000>, - <0x02000000 0x0 0x0d300000 0x0d300000 0x0 0xd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0d200000 0x0 0x100000>, + <0x02000000 0x0 0x0d300000 0x0d300000 0x0 0xd00000>; device_type = "pci";
@@ -1956,8 +1956,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x0e200000 0x0e200000 0x0 0x100000>, - <0x02000000 0x0 0x0e300000 0x0e300000 0x0 0x1d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0e200000 0x0 0x100000>, + <0x02000000 0x0 0x0e300000 0x0e300000 0x0 0x1d00000>; device_type = "pci";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 191/694 arm64: dts: qcom: sm8250: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit e115a4495db687898b8d91d4f16c2cf55bbf167c ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000, 0x64200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8250.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8250.dtsi +4 -4
@@ -1834,8 +1834,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
@@ -1943,7 +1943,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
@@ -2051,7 +2051,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x64200000 0x0 0x64200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x64200000 0x0 0x100000>, <0x02000000 0x0 0x64300000 0x0 0x64300000 0x0 0x3d00000>; interrupts = <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 192/694 arm64: dts: qcom: sc8280xp: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 89fe81c01715f81c3a7d371e9e5f7d7ae5bc557c ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x30200000, 0x32200000, 0x34200000, 0x38200000, 0x3c200000) specified in the ranges property for I/O region.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +5 -5
@@ -1657,7 +1657,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x30200000 0x0 0x30200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x30200000 0x0 0x100000>, <0x02000000 0x0 0x30300000 0x0 0x30300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -1756,7 +1756,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x32200000 0x0 0x32200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x32200000 0x0 0x100000>, <0x02000000 0x0 0x32300000 0x0 0x32300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -1853,7 +1853,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x34200000 0x0 0x34200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x34200000 0x0 0x100000>, <0x02000000 0x0 0x34300000 0x0 0x34300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -1953,7 +1953,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x38200000 0x0 0x38200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x38200000 0x0 0x100000>, <0x02000000 0x0 0x38300000 0x0 0x38300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -2050,7 +2050,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x3c200000 0x0 0x3c200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x3c200000 0x0 0x100000>, <0x02000000 0x0 0x3c300000 0x0 0x3c300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 193/694 arm64: dts: qcom: sm8150: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 422b110b9b0af0afd4a4b19e8fc3ceab9e71d842 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +3 -3
@@ -1799,8 +1799,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1895,7 +1895,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 194/694 arm64: dts: qcom: sm8450: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit f57903c8f4c77938eb71fc67e4652264a9fa14f9 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +4 -4
@@ -1746,8 +1746,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; /* * MSIs for BDF (1:0.0) only works with Device ID 0x5980.
@@ -1862,8 +1862,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0 0x40200000 0x0 0x100000>, - <0x02000000 0x0 0x40300000 0 0x40300000 0x0 0x1fd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, + <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; /* * MSIs for BDF (1:0.0) only works with Device ID 0x5a00.
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 195/694 arm64: dts: qcom: sm8350: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit cf4e716e9a38b32a922a88ac3c5b701137a663dd ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8350.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +4 -4
@@ -1487,8 +1487,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
@@ -1581,8 +1581,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0 0x40200000 0x0 0x100000>, - <0x02000000 0x0 0x40300000 0 0x40300000 0x0 0x1fd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, + <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 196/694 ARM: dts: qcom: ipq4019: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 2540279e9a9e74fc880d1e4c83754ecfcbe290a0 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI address (0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm/boot/dts/qcom-ipq4019.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/qcom-ipq4019.dtsi +2 -2
@@ -426,8 +426,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x40200000 0x40200000 0 0x00100000>, - <0x82000000 0 0x40300000 0x40300000 0 0x00d00000>; + ranges = <0x81000000 0x0 0x00000000 0x40200000 0x0 0x00100000>, + <0x82000000 0x0 0x40300000 0x40300000 0x0 0x00d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 197/694 ARM: dts: qcom: ipq8064: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 0b16b34e491629016109e56747ad64588074194b ]
For 64KiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x10000. Hence, fix the bogus PCI addresses (0x0fe00000, 0x31e00000, 0x35e00000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm/boot/dts/qcom-ipq8064.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/qcom-ipq8064.dtsi +6 -6
@@ -1081,8 +1081,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x0fe00000 0x0 0x00010000 /* I/O */ + 0x82000000 0x0 0x08000000 0x08000000 0x0 0x07e00000>; /* MEM */ interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1132,8 +1132,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x31e00000 0x0 0x00010000 /* I/O */ + 0x82000000 0x0 0x2e000000 0x2e000000 0x0 0x03e00000>; /* MEM */ interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1183,8 +1183,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0x32000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x35e00000 0x0 0x00010000 /* I/O */ + 0x82000000 0x0 0x32000000 0x32000000 0x0 0x03e00000>; /* MEM */ interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 198/694 arm64: dts: qcom: msm8976: Add and provide xo clk to rpmcc
In reply to Greg Kroah-HartmanFrom: Adam Skladowski <[email protected]>
[ Upstream commit 4a2c9b9e1215c557c17a48e3fabe9b1674c1d608 ]
In order for consumers of RPMCC XO clock to probe successfully their parent needs to be feed with reference clock to obtain proper rate, add fixed xo-board clock and supply it to rpmcc to make consumers happy. Frequency setting is left per board basis just like on other recent trees.
--- arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi | 4 ++++ arch/arm64/boot/dts/qcom/msm8976.dtsi | 9 +++++++++ 2 files changed, 13 insertions(+)
arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi +4 -0
@@ -280,3 +280,7 @@ vdda3p3-supply = <&pm8950_l13>; status = "okay"; }; + +&xo_board { + clock-frequency = <19200000>; +};
arch/arm64/boot/dts/qcom/msm8976.dtsi +9 -0
@@ -20,6 +20,13 @@ chosen { }; + clocks { + xo_board: xo-board { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + }; + cpus { #address-cells = <1>; #size-cells = <0>;
@@ -351,6 +358,8 @@ rpmcc: clock-controller { compatible = "qcom,rpmcc-msm8976", "qcom,rpmcc"; + clocks = <&xo_board>; + clock-names = "xo"; #clock-cells = <1>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 199/694 ARM: dts: qcom: sdx55: Fix the unit address of PCIe EP node
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 3b76b736cd9933ff88764ffec01cbd859c1475e7 ]
Unit address of PCIe EP node should be 0x1c00000 as it has to match the first address specified in the reg property.
This also requires sorting the node in the ascending order.
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +39 -39
@@ -304,6 +304,45 @@ status = "disabled"; }; + pcie_ep: pcie-ep@1c00000 { + compatible = "qcom,sdx55-pcie-ep"; + reg = <0x01c00000 0x3000>, + <0x40000000 0xf1d>, + <0x40000f20 0xc8>, + <0x40001000 0x1000>, + <0x40200000 0x100000>, + <0x01c03000 0x3000>; + reg-names = "parf", "dbi", "elbi", "atu", "addr_space", + "mmio"; + + qcom,perst-regs = <&tcsr 0xb258 0xb270>; + + clocks = <&gcc GCC_PCIE_AUX_CLK>, + <&gcc GCC_PCIE_CFG_AHB_CLK>, + <&gcc GCC_PCIE_MSTR_AXI_CLK>, + <&gcc GCC_PCIE_SLV_AXI_CLK>, + <&gcc GCC_PCIE_SLV_Q2A_AXI_CLK>, + <&gcc GCC_PCIE_SLEEP_CLK>, + <&gcc GCC_PCIE_0_CLKREF_CLK>; + clock-names = "aux", "cfg", "bus_master", "bus_slave", + "slave_q2a", "sleep", "ref"; + + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "global", "doorbell"; + reset-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>; + resets = <&gcc GCC_PCIE_BCR>; + reset-names = "core"; + power-domains = <&gcc PCIE_GDSC>; + phys = <&pcie0_lane>; + phy-names = "pciephy"; + max-link-speed = <3>; + num-lanes = <2>; + + status = "disabled"; + }; + pcie0_phy: phy@1c07000 { compatible = "qcom,sdx55-qmp-pcie-phy"; reg = <0x01c07000 0x1c4>;
@@ -401,45 +440,6 @@ status = "disabled"; }; - pcie_ep: pcie-ep@40000000 { - compatible = "qcom,sdx55-pcie-ep"; - reg = <0x01c00000 0x3000>, - <0x40000000 0xf1d>, - <0x40000f20 0xc8>, - <0x40001000 0x1000>, - <0x40200000 0x100000>, - <0x01c03000 0x3000>; - reg-names = "parf", "dbi", "elbi", "atu", "addr_space", - "mmio"; - - qcom,perst-regs = <&tcsr 0xb258 0xb270>; - - clocks = <&gcc GCC_PCIE_AUX_CLK>, - <&gcc GCC_PCIE_CFG_AHB_CLK>, - <&gcc GCC_PCIE_MSTR_AXI_CLK>, - <&gcc GCC_PCIE_SLV_AXI_CLK>, - <&gcc GCC_PCIE_SLV_Q2A_AXI_CLK>, - <&gcc GCC_PCIE_SLEEP_CLK>, - <&gcc GCC_PCIE_0_CLKREF_CLK>; - clock-names = "aux", "cfg", "bus_master", "bus_slave", - "slave_q2a", "sleep", "ref"; - - interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "global", "doorbell"; - reset-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; - wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>; - resets = <&gcc GCC_PCIE_BCR>; - reset-names = "core"; - power-domains = <&gcc PCIE_GDSC>; - phys = <&pcie0_lane>; - phy-names = "pciephy"; - max-link-speed = <3>; - num-lanes = <2>; - - status = "disabled"; - }; - remoteproc_mpss: remoteproc@4080000 { compatible = "qcom,sdx55-mpss-pas"; reg = <0x04080000 0x4040>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 200/694 arm64: dts: qcom: sm8550: fix qup_spi0_cs node
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit 7629c7a525d163f2a3a08e260a69ff25163ab357 ]
The node is incomplete and doesn't need a subnode, add the missing properties and move everything to the root of qup-spi0-cs-state node.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +4 -4
@@ -2792,10 +2792,10 @@ }; qup_spi0_cs: qup-spi0-cs-state { - cs-pins { - pins = "gpio31"; - function = "qup1_se0"; - }; + pins = "gpio31"; + function = "qup1_se0"; + drive-strength = <6>; + bias-disable; }; qup_spi0_data_clk: qup-spi0-data-clk-state {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 201/694 arm64: dts: qcom: sm8550: misc style fixes
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit f03908b23f84ecd49f12facf4acf34c3ad24f27a ]
Miscellaneous DT fixes to remove spurious blank line and enhance readability.
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +7 -5
@@ -412,7 +412,6 @@ no-map; }; - hyp_tags_reserved_mem: hyp-tags-reserved-region@811d0000 { reg = <0 0x811d0000 0 0x30000>; no-map;
@@ -2195,7 +2194,8 @@ assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE0_CLK_SRC>, <&dispcc DISP_CC_MDSS_PCLK0_CLK_SRC>; - assigned-clock-parents = <&mdss_dsi0_phy 0>, <&mdss_dsi0_phy 1>; + assigned-clock-parents = <&mdss_dsi0_phy 0>, + <&mdss_dsi0_phy 1>; operating-points-v2 = <&mdss_dsi_opp_table>;
@@ -2287,8 +2287,10 @@ power-domains = <&rpmhpd SM8550_MMCX>; - assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE1_CLK_SRC>, <&dispcc DISP_CC_MDSS_PCLK1_CLK_SRC>; - assigned-clock-parents = <&mdss_dsi1_phy 0>, <&mdss_dsi1_phy 1>; + assigned-clocks = <&dispcc DISP_CC_MDSS_BYTE1_CLK_SRC>, + <&dispcc DISP_CC_MDSS_PCLK1_CLK_SRC>; + assigned-clock-parents = <&mdss_dsi1_phy 0>, + <&mdss_dsi1_phy 1>; operating-points-v2 = <&mdss_dsi_opp_table>;
@@ -3156,7 +3158,7 @@ intc: interrupt-controller@17100000 { compatible = "arm,gic-v3"; - reg = <0 0x17100000 0 0x10000>, /* GICD */ + reg = <0 0x17100000 0 0x10000>, /* GICD */ <0 0x17180000 0 0x200000>; /* GICR * 8 */ ranges; #interrupt-cells = <3>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 202/694 arm64: dts: qcom: msm8916: Fix tsens_mode unit address
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit 608465f798bb3eaf6773a49b893902860858e294 ]
The reg address of the tsens_mode nvmem cell is correct but the unit address does not match (0xec vs 0xef). Fix it. No functional change.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +1 -1
@@ -503,7 +503,7 @@ bits = <1 7>; }; - tsens_mode: mode@ec { + tsens_mode: mode@ef { reg = <0xef 0x1>; bits = <5 3>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 203/694 arm64: dts: qcom: sc8280xp: fix external display power domain
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit cf386126aef92256245adc8be686f2df4b837013 ]
Fix the external display controller nodes which erroneously described the controllers as belonging to CX rather than MMCX.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +2 -2
@@ -3253,7 +3253,7 @@ #sound-dai-cells = <0>; operating-points-v2 = <&mdss0_dp0_opp_table>; - power-domains = <&rpmhpd SC8280XP_CX>; + power-domains = <&rpmhpd SC8280XP_MMCX>; status = "disabled";
@@ -3331,7 +3331,7 @@ #sound-dai-cells = <0>; operating-points-v2 = <&mdss0_dp1_opp_table>; - power-domains = <&rpmhpd SC8280XP_CX>; + power-domains = <&rpmhpd SC8280XP_MMCX>; status = "disabled";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 204/694 media: v4l: subdev: Make link validation safer
In reply to Greg Kroah-HartmanFrom: Sakari Ailus <[email protected]>
[ Upstream commit 55f1ecb1199000932cf82e357841cc7498ac904f ]
Link validation currently accesses invalid pointers if the link passed to it is not between two sub-devices. This is of course a driver bug.
Ignore the error but print a warning message, as this is how it used to work previously.
--- drivers/media/v4l2-core/v4l2-subdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/media/v4l2-core/v4l2-subdev.c +10 -0
@@ -1236,6 +1236,16 @@ int v4l2_subdev_link_validate(struct media_link *link)struct v4l2_subdev_state *source_state, *sink_state;int ret; +if (!is_media_entity_v4l2_subdev (link->sink->entity) || + !is_media_entity_v4l2_subdev (link->source->entity)) { +pr_warn_once ("%s of link '%s':%u->'%s':%u is not a V4L2 sub-device, driver bug!\n" , + !is_media_entity_v4l2_subdev (link->sink->entity) ? +"sink" :"source" , + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index); +return 0 ; + } + sink_sd =media_entity_to_v4l2_subdev (link->sink->entity); source_sd =media_entity_to_v4l2_subdev (link->source->entity);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 205/694 x86/MCE/AMD: Use an u64 for bank_map
In reply to Greg Kroah-HartmanFrom: Muralidhara M K <[email protected]>
[ Upstream commit 4c1cdec319b9aadb65737c3eb1f5cb74bd6aa156 ]
Thee maximum number of MCA banks is 64 (MAX_NR_BANKS), see
a0bc32b3cacf ("x86/mce: Increase maximum number of banks to 64").
However, the bank_map which contains a bitfield of which banks to initialize is of type unsigned int and that overflows when those bit numbers are >= 32, leading to UBSAN complaining correctly:
UBSAN: shift-out-of-bounds in arch/x86/kernel/cpu/mce/amd.c:1365:38 shift exponent 32 is too large for 32-bit type 'int'
Change the bank_map to a u64 and use the proper BIT_ULL() macro when modifying bits in there.
[ bp: Rewrite commit message. ]
--- arch/x86/kernel/cpu/mce/amd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/mce/amd.c +7 -7
@@ -235,10 +235,10 @@ static DEFINE_PER_CPU(struct threshold_bank **, threshold_banks);* A list of the banks enabled on each logical CPU. Controls which respective * descriptors to initialize later in mce_threshold_create_device(). */ -static DEFINE_PER_CPU(unsigned int, bank_map); +static DEFINE_PER_CPU(u64, bank_map);/* Map of banks that have more than MCA_MISC0 available. */ -static DEFINE_PER_CPU(u32, smca_misc_banks_map); +static DEFINE_PER_CPU(u64, smca_misc_banks_map);static void amd_threshold_interrupt (void );static void amd_deferred_error_interrupt (void );
@@ -267,7 +267,7 @@ static void smca_set_misc_banks_map(unsigned int bank, unsigned int cpu)return ;if (low &MASK_BLKPTR_LO ) -per_cpu (smca_misc_banks_map, cpu) |=BIT (bank); +per_cpu (smca_misc_banks_map, cpu) |=BIT_ULL (bank); }
@@ -530,7 +530,7 @@ static u32 smca_get_block_address(unsigned int bank, unsigned int block,if (!block)return MSR_AMD64_SMCA_MCx_MISC (bank); -if (!(per_cpu (smca_misc_banks_map, cpu) &BIT (bank))) +if (!(per_cpu (smca_misc_banks_map, cpu) &BIT_ULL (bank)))return 0 ;return MSR_AMD64_SMCA_MCx_MISCy (bank, block -1 );
@@ -574,7 +574,7 @@ prepare_threshold_block(unsigned int bank, unsigned int block, u32 addr,int new;if (!block) -per_cpu (bank_map, cpu) |= (1 << bank); +per_cpu (bank_map, cpu) |=BIT_ULL (bank);memset (&b,0 ,sizeof (b)); b.cpu = cpu;
@@ -878,7 +878,7 @@ static void amd_threshold_interrupt(void)return ;for (bank =0 ; bank <this_cpu_read (mce_num_banks); ++bank) { -if (!(per_cpu (bank_map, cpu) & (1 << bank))) +if (!(per_cpu (bank_map, cpu) &BIT_ULL (bank)))continue ; first_block = bp[bank]->blocks;
@@ -1356,7 +1356,7 @@ int mce_threshold_create_device(unsigned int cpu)return -ENOMEM ;for (bank =0 ; bank < numbanks; ++bank) { -if (!(this_cpu_read (bank_map) & (1 << bank))) +if (!(this_cpu_read (bank_map) &BIT_ULL (bank)))continue ; err =threshold_create_bank (bp, cpu, bank);if (err) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 206/694 media: bdisp: Add missing check for create_workqueue
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit 2371adeab717d8fe32144a84f3491a03c5838cfb ]
Add the check for the return value of the create_workqueue in order to avoid NULL pointer dereference.
--- drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c +2 -0
@@ -1309,6 +1309,8 @@ static int bdisp_probe(struct platform_device *pdev)init_waitqueue_head (&bdisp->irq_queue);INIT_DELAYED_WORK (&bdisp->timeout_work, bdisp_irq_timeout); bdisp->work_queue =create_workqueue (BDISP_NAME ); +if (!bdisp->work_queue) +return -ENOMEM ;spin_lock_init (&bdisp->slock);mutex_init (&bdisp->lock);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 207/694 media: platform: mtk-mdp3: Add missing check and free for ida_alloc
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit d00f592250782538cda87745607695b0fe27dcd4 ]
Add the check for the return value of the ida_alloc in order to avoid NULL pointer dereference.
Moreover, free allocated "ctx->id" if mdp_m2m_open fails later in order to avoid memory leak.
--- drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c +7 -1
@@ -566,7 +566,11 @@ static int mdp_m2m_open(struct file *file) goto err_free_ctx; } - ctx->id =ida_alloc (&mdp->mdp_ida,GFP_KERNEL ); + ret =ida_alloc (&mdp->mdp_ida,GFP_KERNEL ); +if (ret <0 ) + goto err_unlock_mutex; + ctx->id = ret; + ctx->mdp_dev = mdp;v4l2_fh_init (&ctx->fh, vdev);
@@ -617,6 +621,8 @@ static int mdp_m2m_open(struct file *file)v4l2_fh_del (&ctx->fh); err_exit_fh:v4l2_fh_exit (&ctx->fh); +ida_free (&mdp->mdp_ida, ctx->id); +err_unlock_mutex:mutex_unlock (&mdp->m2m_lock); err_free_ctx:kfree (ctx);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 208/694 media: amphion: decoder implement display delay enable
In reply to Greg Kroah-HartmanFrom: Ming Qian <[email protected]>
[ Upstream commit ffa331d9bf9407655fc4c4d57dcc92ed2868e326 ]
amphion vpu support a low latency mode,
when V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE is enabled, decoder can display frame immediately after it's decoded. Only h264 is support yet.
--- drivers/media/platform/amphion/vdec.c | 32 +++++++++++++++++++++ drivers/media/platform/amphion/vpu_codec.h | 3 +- drivers/media/platform/amphion/vpu_malone.c | 4 ++- 3 files changed, 37 insertions(+), 2 deletions(-)
drivers/media/platform/amphion/vdec.c +32 -0
@@ -168,7 +168,31 @@ static const struct vpu_format vdec_formats[] = { {0, 0, 0, 0}, }; +static int vdec_op_s_ctrl (struct v4l2_ctrl *ctrl) +{ +struct vpu_inst *inst =ctrl_to_inst (ctrl); +struct vdec_t *vdec = inst->priv; +int ret =0 ; + +vpu_inst_lock (inst); +switch (ctrl->id) { +case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE : + vdec->params.display_delay_enable = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY : + vdec->params.display_delay = ctrl->val; +break ; +default : + ret = -EINVAL ; +break ; + } +vpu_inst_unlock (inst); + +return ret; +} +static const struct v4l2_ctrl_ops vdec_ctrl_ops = { + .s_ctrl = vdec_op_s_ctrl, .g_volatile_ctrl = vpu_helper_g_volatile_ctrl, };
@@ -181,6 +205,14 @@ static int vdec_ctrl_init(struct vpu_inst *inst)if (ret)return ret; +v4l2_ctrl_new_std (&inst->ctrl_handler, &vdec_ctrl_ops, +V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY , +0 ,0 ,1 ,0 ); + +v4l2_ctrl_new_std (&inst->ctrl_handler, &vdec_ctrl_ops, +V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE , +0 ,1 ,1 ,0 ); + ctrl =v4l2_ctrl_new_std (&inst->ctrl_handler, &vdec_ctrl_ops,V4L2_CID_MIN_BUFFERS_FOR_CAPTURE ,1 ,32 ,1 ,2 );if (ctrl)
drivers/media/platform/amphion/vpu_codec.h +2 -1
@@ -55,7 +55,8 @@ struct vpu_encode_params {struct vpu_decode_params {u32 codec_format;u32 output_format; -u32 b_dis_reorder; +u32 display_delay_enable; +u32 display_delay;u32 b_non_frame;u32 frame_count;u32 end_flag;
drivers/media/platform/amphion/vpu_malone.c +3 -1
@@ -641,7 +641,9 @@ static int vpu_malone_set_params(struct vpu_shared_addr *shared, hc->jpg[instance].jpg_mjpeg_interlaced =0 ; } - hc->codec_param[instance].disp_imm = params->b_dis_reorder ?1 :0 ; + hc->codec_param[instance].disp_imm = params->display_delay_enable ?1 :0 ; +if (malone_format !=MALONE_FMT_AVC ) + hc->codec_param[instance].disp_imm =0 ; hc->codec_param[instance].dbglog_enable =0 ; iface->dbglog_desc.level =0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 209/694 media: av7110: prevent underflow in write_ts_to_decoder()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit eed9496a0501357aa326ddd6b71408189ed872eb ]
The buf[4] value comes from the user via ts_play(). It is a value in the u8 range. The final length we pass to av7110_ipack_instant_repack() is "len - (buf[4] + 1) - 4" so add a check to ensure that the length is not negative. It's not clear that passing a negative len value does anything bad necessarily, but it's not best practice.
With the new bounds checking the "if (!len)" condition is no longer possible or required so remove that.
--- drivers/staging/media/av7110/av7110_av.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/av7110/av7110_av.c +2 -2
@@ -823,10 +823,10 @@ static int write_ts_to_decoder(struct av7110 *av7110, int type, const u8 *buf, sav7110_ipack_flush (ipack);if (buf[3 ] &ADAPT_FIELD ) { +if (buf[4 ] > len -1 -4 ) +return 0 ; len -= buf[4 ] +1 ; buf += buf[4 ] +1 ; -if (!len) -return 0 ; }av7110_ipack_instant_repack (buf +4 , len -4 , ipack);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 210/694 firmware: qcom_scm: Clear download bit during reboot
In reply to Greg Kroah-HartmanFrom: Mukesh Ojha <[email protected]>
[ Upstream commit 781d32d1c9709fd25655c4e3e3e15370ae4ae4db ]
During normal restart of a system download bit should be cleared irrespective of whether download mode is set or not.
--- drivers/firmware/qcom_scm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/qcom_scm.c +1 -2
@@ -1506,8 +1506,7 @@ static int qcom_scm_probe(struct platform_device *pdev)static void qcom_scm_shutdown (struct platform_device *pdev) {/* Clean shutdown, disable download mode to allow normal restart */ -if (download_mode) -qcom_scm_set_download_mode (false); +qcom_scm_set_download_mode (false); }static const struct of_device_id qcom_scm_dt_match[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 211/694 drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535
In reply to Greg Kroah-HartmanFrom: Adam Ford <[email protected]>
[ Upstream commit ee0285e13455fdbce5de315bdbe91b5f198a2a06 ]
When dynamically switching lanes was removed, the intent of the code was to check to make sure that higher speed items used 4 lanes, but it had the unintended consequence of removing the slower speeds for 4-lane users.
This attempts to remedy this by doing a check to see that the max frequency doesn't exceed the chip limit, and a second check to make sure that the max bit-rate doesn't exceed the number of lanes * max bit rate / lane.
--- drivers/gpu/drm/bridge/adv7511/adv7533.c | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/gpu/drm/bridge/adv7511/adv7533.c +11 -14
@@ -103,22 +103,19 @@ void adv7533_dsi_power_off(struct adv7511 *adv)enum drm_mode_status adv7533_mode_valid (struct adv7511 *adv,const struct drm_display_mode *mode) { -int lanes; +unsigned long max_lane_freq;struct mipi_dsi_device *dsi = adv->dsi; +u8 bpp =mipi_dsi_pixel_format_to_bpp (dsi->format); -if (mode->clock >80000 ) - lanes =4 ; -else - lanes =3 ; - -/* -* TODO: add support for dynamic switching of lanes -* by using the bridge pre_enable() op . Till then filter -* out the modes which shall need different number of lanes -* than what was configured in the device tree. -*/ -if (lanes != dsi->lanes) -return MODE_BAD ; +/* Check max clock for either 7533 or 7535 */ +if (mode->clock > (adv->type ==ADV7533 ?80000 :148500 )) +return MODE_CLOCK_HIGH ; + +/* Check max clock for each lane */ + max_lane_freq = (adv->type ==ADV7533 ?800000 :891000 ); + +if (mode->clock * bpp > max_lane_freq * adv->num_dsi_lanes) +return MODE_CLOCK_HIGH ;return MODE_OK ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 212/694 media: max9286: Free control handler
In reply to Greg Kroah-HartmanFrom: Laurent Pinchart <[email protected]>
[ Upstream commit bfce6a12e5ba1edde95126aa06778027f16115d4 ]
The control handler is leaked in some probe-time error paths, as well as in the remove path. Fix it.
--- drivers/media/i2c/max9286.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/i2c/max9286.c +1 -0
@@ -1122,6 +1122,7 @@ static int max9286_v4l2_register(struct max9286_priv *priv)static void max9286_v4l2_unregister (struct max9286_priv *priv) {fwnode_handle_put (priv->sd.fwnode); +v4l2_ctrl_handler_free (&priv->ctrls);v4l2_async_unregister_subdev (&priv->sd);max9286_v4l2_notifier_unregister (priv); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 213/694 accel: Link to compute accelerator subsystem intro
In reply to Greg Kroah-HartmanFrom: Bagas Sanjaya <[email protected]>
[ Upstream commit 6d179f84f274a87da51f24ac3e9427221bbaed51 ]
Commit 2c204f3d53218d ("accel: add dedicated minor for accelerator devices") adds link to accelerator nodes section of DRM internals doc (Documentation/gpu/drm-internals.rst), but the target doesn't exist. Instead, there is only an introduction doc for computer accelerator subsytem.
Link to that doc until there is documentation of accelerator internals.
--- include/drm/drm_file.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/drm/drm_file.h +2 -1
@@ -408,7 +408,8 @@ static inline bool drm_is_render_client(const struct drm_file *file_priv)* Returns true if this is an open file of the compute acceleration node, i.e. * &drm_file.minor of @file_priv is a accel minor. * -* See also the :ref:`section on accel nodes <drm_accel_node>`. +* See also :doc:`Introduction to compute accelerators subsystem +* </accel/introduction>`. */ static inline bool drm_is_accel_client (const struct drm_file *file_priv) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 214/694 arm64: dts: ti: k3-am625: Correct L2 cache size to 512KB
In reply to Greg Kroah-HartmanFrom: Vignesh Raghavendra <[email protected]>
[ Upstream commit 6974371cab1c488a53960945cb139b20ebb5f16b ]
Per AM62x SoC datasheet[0] L2 cache is 512KB.
[0] https://www.ti.com/lit/gpn/am625 Page 1.
--- arch/arm64/boot/dts/ti/k3-am625.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am625.dtsi +1 -1
@@ -148,7 +148,7 @@ compatible = "cache"; cache-unified; cache-level = <2>; - cache-size = <0x40000>; + cache-size = <0x80000>; cache-line-size = <64>; cache-sets = <512>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 215/694 arm64: dts: ti: k3-am62a7: Correct L2 cache size to 512KB
In reply to Greg Kroah-HartmanFrom: Vignesh Raghavendra <[email protected]>
[ Upstream commit 438b8dc949bf45979c32553e96086ff1c6e2504e ]
Per AM62Ax SoC datasheet[0] L2 cache is 512KB.
[0] https://www.ti.com/lit/gpn/am62a7 Page 1.
--- arch/arm64/boot/dts/ti/k3-am62a7.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62a7.dtsi +1 -1
@@ -97,7 +97,7 @@ compatible = "cache"; cache-unified; cache-level = <2>; - cache-size = <0x40000>; + cache-size = <0x80000>; cache-line-size = <64>; cache-sets = <512>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 216/694 ACPI: utils: Fix acpi_evaluate_dsm_typed() redefinition error
In reply to Greg Kroah-HartmanFrom: Kiran K <[email protected]>
[ Upstream commit 2c5a06e5505a716387a4d86f1f39de506836435a ]
acpi_evaluate_dsm_typed() needs to be gaurded with CONFIG_ACPI to avoid a redefintion error when the stub is also enabled.
In file included from ../drivers/bluetooth/btintel.c:13:../include/acpi/acpi_bus.h:57:1: error: redefinition of 'acpi_evaluate_dsm_typed'
57 | acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid,..
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ../drivers/bluetooth/btintel.c:12:../include/linux/acpi.h:967:34: note: previous definition of 'acpi_evaluate_dsm_typed' with type 'union acpi_object *(void *, const guid_t *, u64, u64, union acpi_object *, acpi_object_type)' {aka 'union acpi_object *(void *, const guid_t *, long long unsigned int, long long unsigned int, union acpi_object *, unsigned int)'}
967 | static inline union acpi_object
*acpi_evaluate_dsm_typed(acpi_handle handle,
--- include/acpi/acpi_bus.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/acpi/acpi_bus.h +2 -1
@@ -52,7 +52,7 @@ bool acpi_dock_match(acpi_handle handle);bool acpi_check_dsm (acpi_handle handle,const guid_t *guid,u64 rev,u64 funcs);union acpi_object *acpi_evaluate_dsm (acpi_handle handle,const guid_t *guid,u64 rev,u64 func,union acpi_object *argv4); - +#ifdef CONFIG_ACPI static inline union acpi_object * acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, u64 func, union acpi_object *argv4,
@@ -68,6 +68,7 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev,return obj; } +#endif #define ACPI_INIT_DSM_ARGV4 (cnt, eles) \ { \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 217/694 drm/msm/adreno: drop bogus pm_runtime_set_active()
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit db7662d076c973072d788bd0e8130e04430307a1 ]
The runtime PM status can only be updated while runtime PM is disabled.
Drop the bogus pm_runtime_set_active() call that was made after enabling runtime PM and which (incidentally but correctly) left the runtime PM status set to 'suspended'.
Patchwork: https://patchwork.freedesktop.org/patch/524972/
--- drivers/gpu/drm/msm/adreno/adreno_device.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/msm/adreno/adreno_device.c +0 -3
@@ -438,9 +438,6 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)*/ pm_runtime_enable (&pdev->dev); -/* Make sure pm runtime is active and reset any previous errors */ -pm_runtime_set_active (&pdev->dev); - ret =pm_runtime_get_sync (&pdev->dev);if (ret <0 ) {pm_runtime_put_sync (&pdev->dev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 218/694 drm: msm: adreno: Disable preemption on Adreno 510
In reply to Greg Kroah-HartmanFrom: Adam Skladowski <[email protected]>
[ Upstream commit 010c8bbad2cb8c33c47963e29f051f1e917e45a5 ]
Downstream driver appears to not support preemption on A510 target, trying to use one make device slow and fill log with rings related errors. Set num_rings to 1 to disable preemption.
Patchwork: https://patchwork.freedesktop.org/patch/526898/
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +7 -1
@@ -1743,6 +1743,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)struct a5xx_gpu *a5xx_gpu =NULL ;struct adreno_gpu *adreno_gpu;struct msm_gpu *gpu; +unsigned int nr_rings;int ret;if (!pdev) {
@@ -1763,7 +1764,12 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)check_speed_bin (&pdev->dev); - ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs,4 ); + nr_rings =4 ; + +if (adreno_is_a510 (adreno_gpu)) + nr_rings =1 ; + + ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs, nr_rings);if (ret) {a5xx_destroy (&(a5xx_gpu->base.base));return ERR_PTR (ret);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 219/694 virt/coco/sev-guest: Double-buffer messages
In reply to Greg Kroah-HartmanFrom: Dionna Glaze <[email protected]>
[ Upstream commit 965006103a14703cc42043bbf9b5e0cdf7a468ad ]
The encryption algorithms read and write directly to shared unencrypted memory, which may leak information as well as permit the host to tamper with the message integrity. Instead, copy whole messages in or out as needed before doing any computation on them.
--- drivers/virt/coco/sev-guest/sev-guest.c | 27 +++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-)
drivers/virt/coco/sev-guest/sev-guest.c +23 -4
@@ -46,7 +46,15 @@ struct snp_guest_dev {void *certs_data;struct snp_guest_crypto *crypto; +/* request and response are in unencrypted memory */ struct snp_guest_msg *request, *response; + +/* +* Avoid information leakage by double-buffering shared messages +* in fields that are in regular encrypted memory. +*/ +struct snp_guest_msg secret_request, secret_response; +struct snp_secrets_page_layout *layout;struct snp_req_data input;u32 *os_area_msg_seqno;
@@ -266,14 +274,17 @@ static int dec_payload(struct snp_guest_dev *snp_dev, struct snp_guest_msg *msg,static int verify_and_dec_payload (struct snp_guest_dev *snp_dev,void *payload,u32 sz) {struct snp_guest_crypto *crypto = snp_dev->crypto; -struct snp_guest_msg *resp = snp_dev->response; -struct snp_guest_msg *req = snp_dev->request; +struct snp_guest_msg *resp = &snp_dev->secret_response; +struct snp_guest_msg *req = &snp_dev->secret_request;struct snp_guest_msg_hdr *req_hdr = &req->hdr;struct snp_guest_msg_hdr *resp_hdr = &resp->hdr;dev_dbg (snp_dev->dev,"response [seqno %lld type %d version %d sz %d]\n" , resp_hdr->msg_seqno, resp_hdr->msg_type, resp_hdr->msg_version, resp_hdr->msg_sz); +/* Copy response from shared memory to encrypted memory. */ +memcpy (resp, snp_dev->response,sizeof (*resp)); +/* Verify that the sequence counter is incremented by 1 */ if (unlikely (resp_hdr->msg_seqno != (req_hdr->msg_seqno +1 )))return -EBADMSG ;
@@ -297,7 +308,7 @@ static int verify_and_dec_payload(struct snp_guest_dev *snp_dev, void *payload,static int enc_payload (struct snp_guest_dev *snp_dev,u64 seqno,int version,u8 type,void *payload,size_t sz) { -struct snp_guest_msg *req = snp_dev->request; +struct snp_guest_msg *req = &snp_dev->secret_request;struct snp_guest_msg_hdr *hdr = &req->hdr;memset (req,0 ,sizeof (*req));
@@ -417,13 +428,21 @@ static int handle_guest_request(struct snp_guest_dev *snp_dev, u64 exit_code, inif (!seqno)return -EIO ; +/* Clear shared memory's response for the host to populate. */ memset (snp_dev->response,0 ,sizeof (struct snp_guest_msg )); -/* Encrypt the userspace provided payload */ +/* Encrypt the userspace provided payload in snp_dev->secret_request. */ rc =enc_payload (snp_dev, seqno, msg_ver, type, req_buf, req_sz);if (rc)return rc; +/* +* Write the fully encrypted request to the shared unencrypted +* request page. +*/ +memcpy (snp_dev->request, &snp_dev->secret_request, +sizeof (snp_dev->secret_request)); + rc =__handle_guest_request (snp_dev, exit_code, fw_err);if (rc) {if (rc == -EIO && *fw_err ==SNP_GUEST_REQ_INVALID_LEN )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 220/694 arm64: dts: qcom: sm8250-xiaomi-elish: fix USB maximum speed property
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 613f14a3a9d7e12a832ff822f85a33ad0ebee952 ]
Fix typo in USB DWC3 node maximum speed property.
--- arch/arm64/boot/dts/qcom/sm8250-xiaomi-elish.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8250-xiaomi-elish.dts +1 -1
@@ -595,7 +595,7 @@ &usb_1_dwc3 { dr_mode = "peripheral"; - maximum-spped = "high-speed"; + maximum-speed = "high-speed"; /* Remove USB3 phy */ phys = <&usb_1_hsphy>; phy-names = "usb2-phy";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 221/694 arm64: dts: qcom: sm8350-microsoft-surface: fix USB dual-role mode property
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 0beda02e530f8fc571877939645cb20ade113027 ]
The "dr_mode" is a property of USB DWC3 node, not the Qualcomm wrapper
one:
sm8350-microsoft-surface-duo2.dtb: usb@a6f8800: 'dr_mode' does not match any of the regexes: '^usb@[0-9a-f]+$', 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/sm8350-microsoft-surface-duo2.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/qcom/sm8350-microsoft-surface-duo2.dts +3 -0
@@ -341,6 +341,9 @@ &usb_1 { status = "okay"; +}; + +&usb_1_dwc3 { dr_mode = "peripheral"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 222/694 drm/amd/display/dc/dce60/Makefile: Fix previous attempt to silence known override-init warnings
In reply to Greg Kroah-HartmanFrom: Lee Jones <[email protected]>
[ Upstream commit 4082b9f5ead4966797dddcfef0905d59e5a83873 ]
Fixes the following W=1 kernel build warning(s):
drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:157:21: note: in expansion of macro ‘mmCRTC1_DCFE_MEM_LIGHT_SLEEP_CNTL’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.h:170:9: note: in expansion of macro ‘SRI’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:183:17: note: in expansion of macro ‘XFM_COMMON_REG_LIST_DCE60’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:188:17: note: in expansion of macro ‘transform_regs’ drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_d.h:722:43: warning: initialized field overwritten [-Woverride-init] drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:157:21: note: in expansion of macro ‘mmCRTC2_DCFE_MEM_LIGHT_SLEEP_CNTL’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.h:170:9: note: in expansion of macro ‘SRI’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:183:17: note: in expansion of macro ‘XFM_COMMON_REG_LIST_DCE60’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:189:17: note: in expansion of macro ‘transform_regs’ drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_d.h:722:43: note: (near initialization for ‘xfm_regs[2].DCFE_MEM_LIGHT_SLEEP_CN
[100 lines snipped for brevity]
--- drivers/gpu/drm/amd/display/dc/dce60/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce60/Makefile +1 -1
@@ -23,7 +23,7 @@ # Makefile for the 'controller' sub-component of DAL. # It provides the control and status of HW CRTC block. -CFLAGS_AMDDALPATH)/dc/dce60/dce60_resource.o = $(call cc-disable-warning, override-init) +CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = $(call cc-disable-warning, override-init) DCE60 = dce60_timing_generator.o dce60_hw_sequencer.o \ dce60_resource.o
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 223/694 ACPI: processor: Fix evaluating _PDC method when running as Xen dom0
In reply to Greg Kroah-HartmanFrom: Roger Pau Monne <[email protected]>
[ Upstream commit 073828e954459b883f23e53999d31e4c55ab9654 ]
In ACPI systems, the OS can direct power management, as opposed to the firmware. This OS-directed Power Management is called OSPM. Part of telling the firmware that the OS going to direct power management is making ACPI "_PDC" (Processor Driver Capabilities) calls. These _PDC methods must be evaluated for every processor object. If these _PDC calls are not completed for every processor it can lead to inconsistency and later failures in things like the CPU frequency driver.
In a Xen system, the dom0 kernel is responsible for system-wide power management. The dom0 kernel is in charge of OSPM. However, the number of CPUs available to dom0 can be different than the number of CPUs physically present on the system.
This leads to a problem: the dom0 kernel needs to evaluate _PDC for all the processors, but it can't always see them.
In dom0 kernels, ignore the existing ACPI method for determining if a processor is physically present because it might not be accurate. Instead, ask the hypervisor for this information.
Fix this by introducing a custom function to use when running as Xen dom0 in order to check whether a processor object matches a CPU that's online. Such checking is done using the existing information fetched by the Xen pCPU subsystem, extending it to also store the ACPI ID.
This ensures that _PDC method gets evaluated for all physically online CPUs, regardless of the number of CPUs made available to dom0.
--- drivers/acpi/processor_pdc.c | 11 +++++++++++ drivers/xen/pcpu.c | 20 ++++++++++++++++++++ include/xen/xen.h | 11 +++++++++++ 3 files changed, 42 insertions(+)
drivers/acpi/processor_pdc.c +11 -0
@@ -14,6 +14,8 @@#include <linux/acpi.h> #include <acpi/processor.h> +#include <xen/xen.h> +#include "internal.h" static bool __init processor_physically_present (acpi_handle handle)
@@ -47,6 +49,15 @@ static bool __init processor_physically_present(acpi_handle handle)return false; } +if (xen_initial_domain ()) +/* +* When running as a Xen dom0 the number of processors Linux +* sees can be different from the real number of processors on +* the system, and we still need to execute _PDC for all of +* them. +*/ +return xen_processor_present (acpi_id); + type = (acpi_type ==ACPI_TYPE_DEVICE ) ?1 :0 ; cpuid =acpi_get_cpuid (handle, type, acpi_id);
drivers/xen/pcpu.c +20 -0
@@ -58,6 +58,7 @@ struct pcpu {struct list_head list;struct device dev;uint32_t cpu_id; +uint32_t acpi_id;uint32_t flags; };
@@ -249,6 +250,7 @@ static struct pcpu *create_and_register_pcpu(struct xenpf_pcpuinfo *info)INIT_LIST_HEAD (&pcpu->list); pcpu->cpu_id = info->xen_cpuid; + pcpu->acpi_id = info->acpi_id; pcpu->flags = info->flags;/* Need hold on xen_pcpu_lock before pcpu list manipulations */
@@ -381,3 +383,21 @@ static int __init xen_pcpu_init(void)return ret; }arch_initcall (xen_pcpu_init); + +#ifdef CONFIG_ACPI +bool __init xen_processor_present (uint32_t acpi_id) +{ +const struct pcpu *pcpu; +bool online = false; + +mutex_lock (&xen_pcpu_lock); +list_for_each_entry (pcpu, &xen_pcpus, list) +if (pcpu->acpi_id == acpi_id) { + online = pcpu->flags &XEN_PCPU_FLAGS_ONLINE ; +break ; + } +mutex_unlock (&xen_pcpu_lock); + +return online; +} +#endif
include/xen/xen.h +11 -0
@@ -71,4 +71,15 @@ static inline void xen_free_unpopulated_pages(unsigned int nr_pages, }#endif +#if defined(CONFIG_XEN_DOM0 ) && defined(CONFIG_ACPI ) && defined(CONFIG_X86 ) +bool __init xen_processor_present (uint32_t acpi_id); +#else +#include <linux/bug.h> +static inline bool xen_processor_present (uint32_t acpi_id) +{ +BUG (); +return false; +} +#endif +#endif /* _XEN_XEN_H */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 224/694 mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data
In reply to Greg Kroah-HartmanFrom: Georgii Kruglov <[email protected]>
[ Upstream commit 0dd8316037a2a6d85b2be208bef9991de7b42170 ]
If spec_reg is equal to 'SDHCI_PRESENT_STATE', esdhc_readl_fixup() fixes up register value and returns it immediately. As a result, the further block
(spec_reg == SDHCI_PRESENT_STATE)
&&(esdhc->quirk_ignore_data_inhibit == true),
is never executed.
The patch merges the second block into the first one.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/mmc/host/sdhci-of-esdhc.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-)
drivers/mmc/host/sdhci-of-esdhc.c +11 -13
@@ -133,6 +133,7 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,return ret; } } +/* * The DAT[3:0] line signal levels and the CMD line signal level are * not compatible with standard SDHC register. The line signal levels
@@ -144,6 +145,16 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host, ret = value &0x000fffff ; ret |= (value >>4 ) &SDHCI_DATA_LVL_MASK ; ret |= (value <<1 ) &SDHCI_CMD_LVL ; + +/* +* Some controllers have unreliable Data Line Active +* bit for commands with busy signal. This affects +* Command Inhibit (data) bit. Just ignore it since +* MMC core driver has already polled card status +* with CMD13 after any command with busy siganl. +*/ +if (esdhc->quirk_ignore_data_inhibit) + ret &= ~SDHCI_DATA_INHIBIT ;return ret; }
@@ -158,19 +169,6 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,return ret; } -/* -* Some controllers have unreliable Data Line Active -* bit for commands with busy signal. This affects -* Command Inhibit (data) bit. Just ignore it since -* MMC core driver has already polled card status -* with CMD13 after any command with busy siganl. -*/ -if ((spec_reg ==SDHCI_PRESENT_STATE ) && - (esdhc->quirk_ignore_data_inhibit == true)) { - ret = value & ~SDHCI_DATA_INHIBIT ; -return ret; - } - ret = value;return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 225/694 arm64: dts: qcom: sm8450: fix pcie1 gpios properties name
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit e57430d2483506f046e39bf8c61159dde88aede2 ]
Add the final "s" to the pgio properties and fix the invalid "enable" name to the correct "wake", checked against the HDK8450 schematics.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +2 -2
@@ -1917,8 +1917,8 @@ phys = <&pcie1_lane>; phy-names = "pciephy"; - perst-gpio = <&tlmm 97 GPIO_ACTIVE_LOW>; - enable-gpio = <&tlmm 99 GPIO_ACTIVE_HIGH>; + perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pcie1_default_state>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 226/694 drm: rcar-du: Fix a NULL vs IS_ERR() bug
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 40f43730f43699ce8557e4fe59622d4f4b69f44a ]
The drmm_encoder_alloc() function returns error pointers. It never returns NULL. Fix the check accordingly.
--- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_encoder.c +2 -2
@@ -109,8 +109,8 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, renc = drmm_encoder_alloc(&rcdu->ddev, struct rcar_du_encoder, base, &rcar_du_encoder_funcs,DRM_MODE_ENCODER_NONE ,NULL ); -if (!renc) -return -ENOMEM ; +if (IS_ERR (renc)) +return PTR_ERR (renc); renc->output = output;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 227/694 ARM: dts: gta04: fix excess dma channel usage
In reply to Greg Kroah-HartmanFrom: H. Nikolaus Schaller <[email protected]>
[ Upstream commit a622310f7f0185da02e42cdb06475f533efaae60 ]
OMAP processors support 32 channels but there is no check or inspect this except booting a device and looking at dmesg reports of not available channels.
Recently some more subsystems with DMA (aes1+2) were added filling the list of dma channels beyond the limit of 32 (even if other parameters indicate 96 or 128 channels). This leads to random subsystem failures i(e.g. mcbsp for audio) after boot or boot messages that DMA can not be initialized.
Another symptom is that
/sys/kernel/debug/dmaengine/summary
has 32 entries and does not show all required channels.
Fix by disabling unused (on the GTA04 hardware) mcspi1...4. Each SPI channel allocates 4 DMA channels rapidly filling the available ones.
Disabling unused SPI modules on the OMAP3 SoC may also save some energy (has not been checked).
Message-Id: <[email protected]>
--- arch/arm/boot/dts/omap3-gta04.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm/boot/dts/omap3-gta04.dtsi +16 -0
@@ -612,6 +612,22 @@ clock-frequency = <100000>; }; +&mcspi1 { + status = "disabled"; +}; + +&mcspi2 { + status = "disabled"; +}; + +&mcspi3 { + status = "disabled"; +}; + +&mcspi4 { + status = "disabled"; +}; + &usb_otg_hs { interface-type = <0>; usb-phy = <&usb2_phy>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 228/694 firmware: arm_scmi: Fix xfers allocation on Rx channel
In reply to Greg Kroah-HartmanFrom: Cristian Marussi <[email protected]>
[ Upstream commit b2ccba9e8cdc6fb3985cc227844e7c6af309ffb1 ]
Two distinct pools of xfer descriptors are allocated at initialization
time: one (Tx) used to provide xfers to track commands and their replies (or delayed replies) and another (Rx) to pick xfers from to be used for processing notifications.
Such pools, though, are allocated globally to be used by the whole SCMI instance, they are not allocated per-channel and as such the allocation of notifications xfers cannot be simply skipped if no Rx channel was found for the base protocol common channel, because there could be defined more optional per-protocol dedicated channels that instead support Rx channels.
Change the conditional check to skip allocation for the notification pool only if no Rx channel has been detected on any per-channel protocol at all.
--- drivers/firmware/arm_scmi/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/arm_scmi/driver.c +1 -1
@@ -2289,7 +2289,7 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo)return ret; ret =__scmi_xfer_info_init (sinfo, &sinfo->tx_minfo); -if (!ret &&idr_find (&sinfo->rx_idr,SCMI_PROTOCOL_BASE )) +if (!ret && !idr_is_empty (&sinfo->rx_idr)) ret =__scmi_xfer_info_init (sinfo, &sinfo->rx_minfo);return ret;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 229/694 perf/arm-cmn: Move overlapping wp_combine field
In reply to Greg Kroah-HartmanFrom: Ilkka Koskinen <[email protected]>
[ Upstream commit f87e9114b5e590c2c6658ca21d7b714ca240bdd0 ]
As eventid field was expanded to support new mesh versions, it started to overlap with wp_combine field. Move wp_combine to fix the issue.
--- drivers/perf/arm-cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm-cmn.c +1 -1
@@ -166,7 +166,7 @@#define CMN_EVENT_BYNODEID (event) FIELD_GET(CMN_CONFIG_BYNODEID, (event)->attr.config)#define CMN_EVENT_NODEID (event) FIELD_GET(CMN_CONFIG_NODEID, (event)->attr.config) -#define CMN_CONFIG_WP_COMBINE GENMASK_ULL(27, 24) +#define CMN_CONFIG_WP_COMBINE GENMASK_ULL(30, 27)#define CMN_CONFIG_WP_DEV_SEL GENMASK_ULL(50, 48)#define CMN_CONFIG_WP_CHN_SEL GENMASK_ULL(55, 51)/* Note that we don't yet support the tertiary match group on newer IPs */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 230/694 perf/amlogic: Fix config1/config2 parsing issue
In reply to Greg Kroah-HartmanFrom: Jiucheng Xu <[email protected]>
[ Upstream commit c61e5720f23273269cc67ffb2908cf9831c8ca9d ]
The 3th argument of for_each_set_bit is incorrect, fix them.
--- drivers/perf/amlogic/meson_ddr_pmu_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/perf/amlogic/meson_ddr_pmu_core.c +6 -2
@@ -156,10 +156,14 @@ static int meson_ddr_perf_event_add(struct perf_event *event, int flags)u64 config2 = event->attr.config2;int i; -for_each_set_bit (i, (const unsigned long *)&config1,sizeof (config1)) +for_each_set_bit (i, + (const unsigned long *)&config1, +BITS_PER_TYPE (config1))meson_ddr_set_axi_filter (event, i); -for_each_set_bit (i, (const unsigned long *)&config2,sizeof (config2)) +for_each_set_bit (i, + (const unsigned long *)&config2, +BITS_PER_TYPE (config2))meson_ddr_set_axi_filter (event, i +64 );if (flags &PERF_EF_START )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 231/694 ARM: dts: stm32: fix spi1 pin assignment on stm32mp15
In reply to Greg Kroah-HartmanFrom: Alexandre Torgue <[email protected]>
[ Upstream commit 1b9f0ec81af0012aae30aa3b4c711ad71d42e246 ]
Bank A and B IOs can't be handled by the pin controller 'Z'. This patch assign spi1 pin definition to the correct controller.
--- arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-)
arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +15 -15
@@ -1880,6 +1880,21 @@ }; }; + spi1_pins_b: spi1-1 { + pins1 { + pinmux = <STM32_PINMUX('A', 5, AF5)>, /* SPI1_SCK */ + <STM32_PINMUX('B', 5, AF5)>; /* SPI1_MOSI */ + bias-disable; + drive-push-pull; + slew-rate = <1>; + }; + + pins2 { + pinmux = <STM32_PINMUX('A', 6, AF5)>; /* SPI1_MISO */ + bias-disable; + }; + }; + spi2_pins_a: spi2-0 { pins1 { pinmux = <STM32_PINMUX('B', 10, AF5)>, /* SPI2_SCK */
@@ -2448,19 +2463,4 @@ bias-disable; }; }; - - spi1_pins_b: spi1-1 { - pins1 { - pinmux = <STM32_PINMUX('A', 5, AF5)>, /* SPI1_SCK */ - <STM32_PINMUX('B', 5, AF5)>; /* SPI1_MOSI */ - bias-disable; - drive-push-pull; - slew-rate = <1>; - }; - - pins2 { - pinmux = <STM32_PINMUX('A', 6, AF5)>; /* SPI1_MISO */ - bias-disable; - }; - }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 232/694 arm64: dts: apple: t8103: Disable unused PCIe ports
In reply to Greg Kroah-HartmanFrom: Janne Grunau <[email protected]>
[ Upstream commit a0189fdfb73dac856b8fa9b9f9581e5099c9391f ]
The PCIe ports are unused (without devices) so disable them instead of removing them.
--- arch/arm64/boot/dts/apple/t8103-j274.dts | 10 ++++++++++ arch/arm64/boot/dts/apple/t8103-j293.dts | 15 --------------- arch/arm64/boot/dts/apple/t8103-j313.dts | 15 --------------- arch/arm64/boot/dts/apple/t8103-j456.dts | 10 ++++++++++ arch/arm64/boot/dts/apple/t8103-j457.dts | 11 +++-------- arch/arm64/boot/dts/apple/t8103.dtsi | 4 ++++ 6 files changed, 27 insertions(+), 38 deletions(-)
arch/arm64/boot/dts/apple/t8103-j274.dts +10 -0
@@ -37,10 +37,12 @@ &port01 { bus-range = <2 2>; + status = "okay"; }; &port02 { bus-range = <3 3>; + status = "okay"; ethernet0: ethernet@0,0 { reg = <0x30000 0x0 0x0 0x0 0x0>; /* To be filled by the loader */
@@ -48,6 +50,14 @@ }; }; +&pcie0_dart_1 { + status = "okay"; +}; + +&pcie0_dart_2 { + status = "okay"; +}; + &i2c2 { status = "okay"; };
arch/arm64/boot/dts/apple/t8103-j293.dts +0 -15
@@ -25,21 +25,6 @@ brcm,board-type = "apple,honshu"; }; -/* - * Remove unused PCIe ports and disable the associated DARTs. - */ - -&pcie0_dart_1 { - status = "disabled"; -}; - -&pcie0_dart_2 { - status = "disabled"; -}; - -/delete-node/ &port01; -/delete-node/ &port02; - &i2c2 { status = "okay"; };
arch/arm64/boot/dts/apple/t8103-j313.dts +0 -15
@@ -24,18 +24,3 @@ &wifi0 { brcm,board-type = "apple,shikoku"; }; - -/* - * Remove unused PCIe ports and disable the associated DARTs. - */ - -&pcie0_dart_1 { - status = "disabled"; -}; - -&pcie0_dart_2 { - status = "disabled"; -}; - -/delete-node/ &port01; -/delete-node/ &port02;
arch/arm64/boot/dts/apple/t8103-j456.dts +10 -0
@@ -55,13 +55,23 @@ &port01 { bus-range = <2 2>; + status = "okay"; }; &port02 { bus-range = <3 3>; + status = "okay"; ethernet0: ethernet@0,0 { reg = <0x30000 0x0 0x0 0x0 0x0>; /* To be filled by the loader */ local-mac-address = [00 10 18 00 00 00]; }; }; + +&pcie0_dart_1 { + status = "okay"; +}; + +&pcie0_dart_2 { + status = "okay"; +};
arch/arm64/boot/dts/apple/t8103-j457.dts +3 -8
@@ -37,6 +37,7 @@ &port02 { bus-range = <3 3>; + status = "okay"; ethernet0: ethernet@0,0 { reg = <0x30000 0x0 0x0 0x0 0x0>; /* To be filled by the loader */
@@ -44,12 +45,6 @@ }; }; -/* - * Remove unused PCIe port and disable the associated DART. - */ - -&pcie0_dart_1 { - status = "disabled"; +&pcie0_dart_2 { + status = "okay"; }; - -/delete-node/ &port01;
arch/arm64/boot/dts/apple/t8103.dtsi +4 -0
@@ -724,6 +724,7 @@ interrupt-parent = <&aic>; interrupts = <AIC_IRQ 699 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&ps_apcie_gp>; + status = "disabled"; }; pcie0_dart_2: iommu@683008000 {
@@ -733,6 +734,7 @@ interrupt-parent = <&aic>; interrupts = <AIC_IRQ 702 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&ps_apcie_gp>; + status = "disabled"; }; pcie0: pcie@690000000 {
@@ -807,6 +809,7 @@ <0 0 0 2 &port01 0 0 0 1>, <0 0 0 3 &port01 0 0 0 2>, <0 0 0 4 &port01 0 0 0 3>; + status = "disabled"; }; port02: pci@2,0 {
@@ -826,6 +829,7 @@ <0 0 0 2 &port02 0 0 0 1>, <0 0 0 3 &port02 0 0 0 2>, <0 0 0 4 &port02 0 0 0 3>; + status = "disabled"; }; }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 233/694 cpufreq: mediatek: fix passing zero to PTR_ERR
In reply to Greg Kroah-HartmanFrom: Jia-Wei Chang <[email protected]>
[ Upstream commit d51c63230994f167126d9d8381011b4cb2b0ad22 ]
In order to prevent passing zero to 'PTR_ERR' in mtk_cpu_dvfs_info_init(), we fix the return value of of_get_cci() using error pointer by explicitly casting error number.
--- drivers/cpufreq/mediatek-cpufreq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +5 -5
@@ -373,13 +373,13 @@ static struct device *of_get_cci(struct device *cpu_dev)struct platform_device *pdev; np =of_parse_phandle (cpu_dev->of_node,"mediatek,cci" ,0 ); -if (IS_ERR_OR_NULL (np)) -return NULL ; +if (!np) +return ERR_PTR (-ENODEV ); pdev =of_find_device_by_node (np);of_node_put (np); -if (IS_ERR_OR_NULL (pdev)) -return NULL ; +if (!pdev) +return ERR_PTR (-ENODEV );return &pdev->dev; }
@@ -401,7 +401,7 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) info->ccifreq_bound = false;if (info->soc_data->ccifreq_supported) { info->cci_dev =of_get_cci (info->cpu_dev); -if (IS_ERR_OR_NULL (info->cci_dev)) { +if (IS_ERR (info->cci_dev)) { ret =PTR_ERR (info->cci_dev);dev_err (cpu_dev,"cpu%d: failed to get cci device\n" , cpu);return -ENODEV ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 234/694 cpufreq: mediatek: fix KP caused by handler usage after regulator_put/clk_put
In reply to Greg Kroah-HartmanFrom: Jia-Wei Chang <[email protected]>
[ Upstream commit d51e106240bc755cbe59634b70d567c192b045b2 ]
Any kind of failure in mtk_cpu_dvfs_info_init() will lead to calling regulator_put() or clk_put() and the KP will occur since the regulator/clk handlers are used after released in mtk_cpu_dvfs_info_release().
To prevent the usage after regulator_put()/clk_put(), the regulator/clk handlers are addressed in a way of "Free the Last Thing Style".
--- drivers/cpufreq/mediatek-cpufreq.c | 62 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 32 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +30 -32
@@ -420,7 +420,7 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) ret =PTR_ERR (info->inter_clk);dev_err_probe (cpu_dev, ret,"cpu%d: failed to get intermediate clk\n" , cpu); - goto out_free_resources; + goto out_free_mux_clock; } info->proc_reg =regulator_get_optional (cpu_dev,"proc" );
@@ -428,13 +428,13 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) ret =PTR_ERR (info->proc_reg);dev_err_probe (cpu_dev, ret,"cpu%d: failed to get proc regulator\n" , cpu); - goto out_free_resources; + goto out_free_inter_clock; } ret =regulator_enable (info->proc_reg);if (ret) {dev_warn (cpu_dev,"cpu%d: failed to enable vproc\n" , cpu); - goto out_free_resources; + goto out_free_proc_reg; }/* Both presence and absence of sram regulator are valid cases. */
@@ -442,14 +442,14 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)if (IS_ERR (info->sram_reg)) { ret =PTR_ERR (info->sram_reg);if (ret == -EPROBE_DEFER ) - goto out_free_resources; + goto out_disable_proc_reg; info->sram_reg =NULL ; }else { ret =regulator_enable (info->sram_reg);if (ret) {dev_warn (cpu_dev,"cpu%d: failed to enable vsram\n" , cpu); - goto out_free_resources; + goto out_free_sram_reg; } }
@@ -458,13 +458,13 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)if (ret) {dev_err (cpu_dev,"cpu%d: failed to get OPP-sharing information\n" , cpu); - goto out_free_resources; + goto out_disable_sram_reg; } ret =dev_pm_opp_of_cpumask_add_table (&info->cpus);if (ret) {dev_warn (cpu_dev,"cpu%d: no OPP table\n" , cpu); - goto out_free_resources; + goto out_disable_sram_reg; } ret =clk_prepare_enable (info->cpu_clk);
@@ -533,43 +533,41 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) out_free_opp_table:dev_pm_opp_of_cpumask_remove_table (&info->cpus); -out_free_resources: -if (regulator_is_enabled (info->proc_reg)) -regulator_disable (info->proc_reg); -if (info->sram_reg &®ulator_is_enabled (info->sram_reg)) +out_disable_sram_reg: +if (info->sram_reg)regulator_disable (info->sram_reg); -if (!IS_ERR (info->proc_reg)) -regulator_put (info->proc_reg); -if (!IS_ERR (info->sram_reg)) +out_free_sram_reg: +if (info->sram_reg)regulator_put (info->sram_reg); -if (!IS_ERR (info->cpu_clk)) -clk_put (info->cpu_clk); -if (!IS_ERR (info->inter_clk)) -clk_put (info->inter_clk); + +out_disable_proc_reg: +regulator_disable (info->proc_reg); + +out_free_proc_reg: +regulator_put (info->proc_reg); + +out_free_inter_clock: +clk_put (info->inter_clk); + +out_free_mux_clock: +clk_put (info->cpu_clk);return ret; }static void mtk_cpu_dvfs_info_release (struct mtk_cpu_dvfs_info *info) { -if (!IS_ERR (info->proc_reg)) { -regulator_disable (info->proc_reg); -regulator_put (info->proc_reg); - } -if (!IS_ERR (info->sram_reg)) { +regulator_disable (info->proc_reg); +regulator_put (info->proc_reg); +if (info->sram_reg) {regulator_disable (info->sram_reg);regulator_put (info->sram_reg); } -if (!IS_ERR (info->cpu_clk)) { -clk_disable_unprepare (info->cpu_clk); -clk_put (info->cpu_clk); - } -if (!IS_ERR (info->inter_clk)) { -clk_disable_unprepare (info->inter_clk); -clk_put (info->inter_clk); - } - +clk_disable_unprepare (info->cpu_clk); +clk_put (info->cpu_clk); +clk_disable_unprepare (info->inter_clk); +clk_put (info->inter_clk);dev_pm_opp_of_cpumask_remove_table (&info->cpus);dev_pm_opp_unregister_notifier (info->cpu_dev, &info->opp_nb); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 235/694 cpufreq: mediatek: raise proc/sram max voltage for MT8516
In reply to Greg Kroah-HartmanFrom: Jia-Wei Chang <[email protected]>
[ Upstream commit d3296bb4cafd4bad4a5cf2eeab9d19cc94f9e30e ]
Since the upper boundary of proc/sram voltage of MT8516 is 1300 mV, which is greater than the value of MT2701 1150 mV, we fix it by adding the corresponding platform data and specify proc/sram_max_volt to support MT8516.
--- drivers/cpufreq/mediatek-cpufreq.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +11 -2
@@ -711,20 +711,29 @@ static const struct mtk_cpufreq_platform_data mt8186_platform_data = { .ccifreq_supported = true, }; +static const struct mtk_cpufreq_platform_data mt8516_platform_data = { + .min_volt_shift =100000 , + .max_volt_shift =200000 , + .proc_max_volt =1310000 , + .sram_min_volt =0 , + .sram_max_volt =1310000 , + .ccifreq_supported = false, +}; +/* List of machines supported by this driver */ static const struct of_device_id mtk_cpufreq_machines[]__initconst = { { .compatible ="mediatek,mt2701" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt2712" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt7622" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt7623" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt8167" , .data = &mt2701_platform_data }, + { .compatible ="mediatek,mt8167" , .data = &mt8516_platform_data }, { .compatible ="mediatek,mt817x" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8173" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8176" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8183" , .data = &mt8183_platform_data }, { .compatible ="mediatek,mt8186" , .data = &mt8186_platform_data }, { .compatible ="mediatek,mt8365" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt8516" , .data = &mt2701_platform_data }, + { .compatible ="mediatek,mt8516" , .data = &mt8516_platform_data }, { } };MODULE_DEVICE_TABLE (of, mtk_cpufreq_machines);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 236/694 cpufreq: mediatek: Raise proc and sram max voltage for MT7622/7623
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 0883426fd07e39355362e3f2eb9aee1a154dcaf6 ]
During the addition of SRAM voltage tracking for CCI scaling, this driver got some voltage limits set for the vtrack algorithm: these were moved to platform data first, then enforced in a later commit 6a17b3876bc8 ("cpufreq: mediatek: Refine mtk_cpufreq_voltage_tracking()") using these as max values for the regulator_set_voltage() calls.
In this case, the vsram/vproc constraints for MT7622 and MT7623 were supposed to be the same as MT2701 (and a number of other SoCs), but that turned out to be a mistake because the aforementioned two SoCs' maximum voltage for both VPROC and VPROC_SRAM is 1.36V.
Fix that by adding new platform data for MT7622/7623 declaring the right {proc,sram}_max_volt parameter.
--- drivers/cpufreq/mediatek-cpufreq.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +11 -2
@@ -693,6 +693,15 @@ static const struct mtk_cpufreq_platform_data mt2701_platform_data = { .ccifreq_supported = false, }; +static const struct mtk_cpufreq_platform_data mt7622_platform_data = { + .min_volt_shift =100000 , + .max_volt_shift =200000 , + .proc_max_volt =1360000 , + .sram_min_volt =0 , + .sram_max_volt =1360000 , + .ccifreq_supported = false, +}; +static const struct mtk_cpufreq_platform_data mt8183_platform_data = { .min_volt_shift =100000 , .max_volt_shift =200000 ,
@@ -724,8 +733,8 @@ static const struct mtk_cpufreq_platform_data mt8516_platform_data = {static const struct of_device_id mtk_cpufreq_machines[]__initconst = { { .compatible ="mediatek,mt2701" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt2712" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt7622" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt7623" , .data = &mt2701_platform_data }, + { .compatible ="mediatek,mt7622" , .data = &mt7622_platform_data }, + { .compatible ="mediatek,mt7623" , .data = &mt7622_platform_data }, { .compatible ="mediatek,mt8167" , .data = &mt8516_platform_data }, { .compatible ="mediatek,mt817x" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8173" , .data = &mt2701_platform_data },
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 237/694 cpufreq: qcom-cpufreq-hw: Revert adding cpufreq qos
In reply to Greg Kroah-HartmanFrom: Bjorn Andersson <[email protected]>
[ Upstream commit e2b47e585931a988c856fd4ba31e1296f749aee3 ]
The OSM/EPSS hardware controls the frequency of each CPU cluster based on requests from the OS and various throttling events in the system. While throttling is in effect the related dcvs interrupt will be kept high. The purpose of the code handling this interrupt is to continuously report the thermal pressure based on the throttled frequency.
The reasoning for adding QoS control to this mechanism is not entirely clear, but the introduction of commit 'c4c0efb06f17 ("cpufreq:
qcom-cpufreq-hw: Add cpufreq qos for LMh")' causes the scaling_max_frequncy to be set to the throttled frequency. On the next iteration of polling, the throttled frequency is above or equal to the newly requested frequency, so the polling is stopped.
With cpufreq limiting the max frequency, the hardware no longer report a throttling state and no further updates to thermal pressure or qos state are made.
The result of this is that scaling_max_frequency can only go down, and the system becomes slower and slower every time a thermal throttling event is reported by the hardware.
Even if the logic could be improved, there is no reason for software to limit the max freqency in response to the hardware limiting the max frequency. At best software will follow the reported hardware state, but typically it will cause slower backoff of the throttling.
This reverts commit c4c0efb06f17fa4a37ad99e7752b18a5405c76dc.
--- drivers/cpufreq/qcom-cpufreq-hw.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/cpufreq/qcom-cpufreq-hw.c +0 -14
@@ -14,7 +14,6 @@#include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/pm_opp.h> -#include <linux/pm_qos.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/units.h>
@@ -57,8 +56,6 @@ struct qcom_cpufreq_data {struct clk_hw cpu_clk;bool per_core_dcvs; - -struct freq_qos_request throttle_freq_req; }; static struct {
@@ -348,8 +345,6 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data) throttled_freq = freq_hz /HZ_PER_KHZ ; -freq_qos_update_request (&data->throttle_freq_req, throttled_freq); -/* Update thermal pressure (the boost frequencies are accepted) */ arch_update_thermal_pressure (policy->related_cpus, throttled_freq);
@@ -442,14 +437,6 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)if (data->throttle_irq <0 )return data->throttle_irq; - ret =freq_qos_add_request (&policy->constraints, - &data->throttle_freq_req,FREQ_QOS_MAX , -FREQ_QOS_MAX_DEFAULT_VALUE ); -if (ret <0 ) { -dev_err (&pdev->dev,"Failed to add freq constraint (%d)\n" , ret); -return ret; - } - data->cancel_throttle = false; data->policy = policy;
@@ -516,7 +503,6 @@ static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data)if (data->throttle_irq <=0 )return ; -freq_qos_remove_request (&data->throttle_freq_req);free_irq (data->throttle_irq, data); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 238/694 arm64: dts: mediatek: mt8192-asurada: Fix voltage constraint for Vgpu
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit ff4c868ba8df9dcd144ab4943a50adca1cf33ba2 ]
The MT8192 SoC specifies a maximum voltage for the GPU's digital supply of 0.88V and the GPU OPPs are declaring a maximum voltage of 0.80V.
In order to keep the GPU voltage in the safe range, change the maximum voltage for mt6315@7's vbuck1 to 0.80V as sending, for any mistake, 1.193V would be catastrophic.
--- arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +1 -1
@@ -1400,7 +1400,7 @@ regulator-compatible = "vbuck1"; regulator-name = "Vgpu"; regulator-min-microvolt = <606250>; - regulator-max-microvolt = <1193750>; + regulator-max-microvolt = <800000>; regulator-enable-ramp-delay = <256>; regulator-allowed-modes = <0 1 2>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 239/694 arm64: dts: ti: k3-am625-sk: Add ti,vbus-divider property to usbss1
In reply to Greg Kroah-HartmanFrom: Dhruva Gole <[email protected]>
[ Upstream commit 4b71618cb772f20dfeeba826e9d1713a04f9687f ]
The property "ti,vbus-divider" is needed for both usbss0 and usbss1 as both USB0 and USB1 have the same external voltage divider circuit.
--- arch/arm64/boot/dts/ti/k3-am625-sk.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/k3-am625-sk.dts +1 -0
@@ -480,6 +480,7 @@ &usbss1 { status = "okay"; + ti,vbus-divider; }; &usb0 {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 240/694 ACPI: VIOT: Initialize the correct IOMMU fwspec
In reply to Greg Kroah-HartmanFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit 47d26684185d09e083669bbbd0c465ab3493a51f ]
When setting up DMA for a PCI device, we need to initialize its iommu_fwspec with all possible alias RIDs (such as PCI bridges). To do this we use pci_for_each_dma_alias() which calls viot_pci_dev_iommu_init(). This function incorrectly initializes the fwspec of the bridge instead of the device being configured. Fix it by passing the original device as context to pci_for_each_dma_alias().
--- drivers/acpi/viot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/viot.c +3 -2
@@ -328,6 +328,7 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data) {u32 epid;struct viot_endpoint *ep; +struct device *aliased_dev = data;u32 domain_nr =pci_domain_nr (pdev->bus);list_for_each_entry (ep, &viot_pci_ranges, list) {
@@ -338,7 +339,7 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data) epid = ((domain_nr - ep->segment_start) <<16 ) + dev_id - ep->bdf_start + ep->endpoint_id; -return viot_dev_iommu_init (&pdev->dev, ep->viommu, +return viot_dev_iommu_init (aliased_dev, ep->viommu, epid); } }
@@ -372,7 +373,7 @@ int viot_iommu_configure(struct device *dev) {if (dev_is_pci (dev))return pci_for_each_dma_alias (to_pci_dev (dev), - viot_pci_dev_iommu_init,NULL ); + viot_pci_dev_iommu_init, dev);else if (dev_is_platform (dev))return viot_mmio_dev_iommu_init (to_platform_device (dev));return -ENODEV ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 241/694 drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe()
In reply to Greg Kroah-HartmanFrom: Harshit Mogalapalli <[email protected]>
[ Upstream commit c5647cae2704e58d1c4e5fedbf63f11bca6376c9 ]
Smatch reports:drivers/gpu/drm/lima/lima_drv.c:396 lima_pdev_probe() warn:
missing unwind goto?
Store return value in err and goto 'err_out0' which has lima_sched_slab_fini() before returning.
--- drivers/gpu/drm/lima/lima_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/lima/lima_drv.c +4 -2
@@ -392,8 +392,10 @@ static int lima_pdev_probe(struct platform_device *pdev)/* Allocate and initialize the DRM device. */ ddev =drm_dev_alloc (&lima_drm_driver, &pdev->dev); -if (IS_ERR (ddev)) -return PTR_ERR (ddev); +if (IS_ERR (ddev)) { + err =PTR_ERR (ddev); + goto err_out0; + } ddev->dev_private = ldev; ldev->ddev = ddev;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 242/694 drm/mediatek: dp: Change the aux retries times when receiving AUX_DEFER
In reply to Greg Kroah-HartmanFrom: Xinlei Lee <[email protected]>
[ Upstream commit 9243d70e05c5989f84f840612965f96b524da925 ]
DP 1.4a Section 2.8.7.1.5.6.1:
A DP Source device shall retry at least seven times upon receiving AUX_DEFER before giving up the AUX transaction.
The drm_dp_i2c_do_msg() function in the drm_dp_helper.c file will judge the status of the msg->reply parameter passed to aux_transfer for different processing.
--- drivers/gpu/drm/mediatek/mtk_dp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/mediatek/mtk_dp.c +5 -7
@@ -806,10 +806,9 @@ static int mtk_dp_aux_wait_for_completion(struct mtk_dp *mtk_dp, bool is_read) }static int mtk_dp_aux_do_transfer (struct mtk_dp *mtk_dp,bool is_read,u8 cmd, -u32 addr,u8 *buf,size_t length) +u32 addr,u8 *buf,size_t length,u8 *reply_cmd) {int ret; -u32 reply_cmd;if (is_read && (length >DP_AUX_MAX_PAYLOAD_BYTES || (cmd ==DP_AUX_NATIVE_READ && !length)))
@@ -841,10 +840,10 @@ static int mtk_dp_aux_do_transfer(struct mtk_dp *mtk_dp, bool is_read, u8 cmd,/* Wait for feedback from sink device. */ ret =mtk_dp_aux_wait_for_completion (mtk_dp, is_read); - reply_cmd =mtk_dp_read (mtk_dp,MTK_DP_AUX_P0_3624 ) & -AUX_RX_REPLY_COMMAND_AUX_TX_P0_MASK ; + *reply_cmd =mtk_dp_read (mtk_dp,MTK_DP_AUX_P0_3624 ) & +AUX_RX_REPLY_COMMAND_AUX_TX_P0_MASK ; -if (ret || reply_cmd) { +if (ret) {u32 phy_status =mtk_dp_read (mtk_dp,MTK_DP_AUX_P0_3628 ) &AUX_RX_PHY_STATE_AUX_TX_P0_MASK ;if (phy_status !=AUX_RX_PHY_STATE_AUX_TX_P0_RX_IDLE ) {
@@ -2071,7 +2070,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, ret =mtk_dp_aux_do_transfer (mtk_dp, is_read, request, msg->address + accessed_bytes, msg->buffer + accessed_bytes, - to_access); + to_access, &msg->reply);if (ret) { drm_info(mtk_dp->drm_dev,
@@ -2081,7 +2080,6 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, accessed_bytes += to_access; }while (accessed_bytes < msg->size); - msg->reply =DP_AUX_NATIVE_REPLY_ACK |DP_AUX_I2C_REPLY_ACK ;return msg->size; err: msg->reply =DP_AUX_NATIVE_REPLY_NACK |DP_AUX_I2C_REPLY_NACK ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 243/694 mailbox: mpfs: switch to txdone_poll
In reply to Greg Kroah-HartmanFrom: Conor Dooley <[email protected]>
[ Upstream commit b5984a9844fc45cd301a28fb56f3de95f7e20f3c ]
The system controller on PolarFire SoC has no interrupt to signify that the TX has been completed. The interrupt instead signals that a service requested by the mailbox client has succeeded. If a service fails, there will be no interrupt delivered.
Switch to polling the busy register to determine whether transmission has completed.
--- drivers/mailbox/mailbox-mpfs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/mailbox/mailbox-mpfs.c +10 -2
@@ -79,6 +79,13 @@ static bool mpfs_mbox_busy(struct mpfs_mbox *mbox)return status &SCB_STATUS_BUSY_MASK ; } +static bool mpfs_mbox_last_tx_done (struct mbox_chan *chan) +{ +struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; + +return !mpfs_mbox_busy (mbox); +} +static int mpfs_mbox_send_data (struct mbox_chan *chan,void *data) {struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
@@ -182,7 +189,6 @@ static irqreturn_t mpfs_mbox_inbox_isr(int irq, void *data)mpfs_mbox_rx_data (chan); -mbox_chan_txdone (chan,0 );return IRQ_HANDLED ; }
@@ -212,6 +218,7 @@ static const struct mbox_chan_ops mpfs_mbox_ops = { .send_data = mpfs_mbox_send_data, .startup = mpfs_mbox_startup, .shutdown = mpfs_mbox_shutdown, + .last_tx_done = mpfs_mbox_last_tx_done, };static int mpfs_mbox_probe (struct platform_device *pdev)
@@ -247,7 +254,8 @@ static int mpfs_mbox_probe(struct platform_device *pdev) mbox->controller.num_chans =1 ; mbox->controller.chans = mbox->chans; mbox->controller.ops = &mpfs_mbox_ops; - mbox->controller.txdone_irq = true; + mbox->controller.txdone_poll = true; + mbox->controller.txpoll_period =10u ; ret =devm_mbox_controller_register (&pdev->dev, &mbox->controller);if (ret) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 244/694 soc: bcm: brcmstb: biuctrl: fix of_iomap leak
In reply to Greg Kroah-HartmanFrom: Zhaoyang Li <[email protected]>
[ Upstream commit c3fbced9af885a6f217fd95509a613d6590916ce ]
Smatch reports:
drivers/soc/bcm/brcmstb/biuctrl.c:291 setup_hifcpubiuctrl_regs() warn:
'cpubiuctrl_base' from of_iomap() not released on lines: 291.
This is because in setup_hifcpubiuctrl_regs(),cpubiuctrl_base is not released when handle error, which may cause a leak. To fix this, iounmap is added when handle error.
--- drivers/soc/bcm/brcmstb/biuctrl.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/soc/bcm/brcmstb/biuctrl.c +4 -0
@@ -288,6 +288,10 @@ static int __init setup_hifcpubiuctrl_regs(struct device_node *np)if (BRCM_ID (family_id) ==0x7260 &&BRCM_REV (family_id) ==0 ) cpubiuctrl_regs = b53_cpubiuctrl_no_wb_regs; out: +if (ret && cpubiuctrl_base) { +iounmap (cpubiuctrl_base); + cpubiuctrl_base =NULL ; + }return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 245/694 soc: renesas: renesas-soc: Release chipid from ioremap()
In reply to Greg Kroah-HartmanFrom: Li Yang <[email protected]>
[ Upstream commit fc187a46a8e682f0f1167b230792b88de01ceaa0 ]
Smatch reports:
drivers/soc/renesas/renesas-soc.c:536 renesas_soc_init() warn:
'chipid' from ioremap() not released on lines: 475.
If soc_dev_atrr allocation is failed, function renesas_soc_init() will return without releasing 'chipid' from ioremap().
Fix this by adding function iounmap().
--- drivers/soc/renesas/renesas-soc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/soc/renesas/renesas-soc.c +4 -1
@@ -471,8 +471,11 @@ static int __init renesas_soc_init(void) } soc_dev_attr =kzalloc (sizeof (*soc_dev_attr),GFP_KERNEL ); -if (!soc_dev_attr) +if (!soc_dev_attr) { +if (chipid) +iounmap (chipid);return -ENOMEM ; + } np =of_find_node_by_path ("/" );of_property_read_string (np,"model" , &soc_dev_attr->machine);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 246/694 gpu: host1x: Fix potential double free if IOMMU is disabled
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 8466ff24a37a9a18fb935e90dda64f049131ae28 ]
If context device has no IOMMU, the 'cdl->devs' is freed in error path, but host1x_memory_context_list_init() doesn't return an error code, so the module can be loaded successfully, when it's unloading, the host1x_memory_context_list_free() is called in host1x_remove(), it will cause double free. Set the 'cdl->devs' to NULL after freeing it to avoid double free.
--- drivers/gpu/host1x/context.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/host1x/context.c +1 -0
@@ -83,6 +83,7 @@ int host1x_memory_context_list_init(struct host1x *host1x)device_del (&cdl->devs[i].dev);kfree (cdl->devs); + cdl->devs =NULL ; cdl->len =0 ;return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 247/694 gpu: host1x: Fix memory leak of device names
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 55879dad0f3ae8468444b42f785ad79eac05fe5b ]
The device names allocated by dev_set_name() need be freed before module unloading, but they can not be freed because the kobject's refcount which was set in device_initialize() has not be decreased to 0.
As comment of device_add() says, if it fails, use only put_device() drop the refcount, then the name will be freed in kobejct_cleanup().
device_del() and put_device() can be replaced with device_unregister(), so call it to unregister the added successfully devices, and just call put_device() to the not added device.
Add a release() function to device to avoid null release() function WARNING in device_release(), it's empty, because the context devices are freed together in host1x_memory_context_list_free().
--- drivers/gpu/host1x/context.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/gpu/host1x/context.c +15 -8
@@ -13,6 +13,11 @@#include "context.h" #include "dev.h" +static void host1x_memory_context_release (struct device *dev) +{ +/* context device is freed in host1x_memory_context_list_free() */ +} +int host1x_memory_context_list_init (struct host1x *host1x) {struct host1x_memory_context_list *cdl = &host1x->context_list;
@@ -51,36 +56,38 @@ int host1x_memory_context_list_init(struct host1x *host1x)dev_set_name (&ctx->dev,"host1x-ctx.%d" , i); ctx->dev.bus = &host1x_context_device_bus_type; ctx->dev.parent = host1x->dev; + ctx->dev.release = host1x_memory_context_release;dma_set_max_seg_size (&ctx->dev,UINT_MAX ); err =device_add (&ctx->dev);if (err) {dev_err (host1x->dev,"could not add context device %d: %d\n" , i, err); - goto del_devices; +put_device (&ctx->dev); + goto unreg_devices; } err =of_dma_configure_id (&ctx->dev, node, true, &i);if (err) {dev_err (host1x->dev,"IOMMU configuration failed for context device %d: %d\n" , i, err); -device_del (&ctx->dev); - goto del_devices; +device_unregister (&ctx->dev); + goto unreg_devices; }if (!tegra_dev_iommu_get_stream_id (&ctx->dev, &ctx->stream_id) || !device_iommu_mapped (&ctx->dev)) {dev_err (host1x->dev,"Context device %d has no IOMMU!\n" , i); -device_del (&ctx->dev); - goto del_devices; +device_unregister (&ctx->dev); + goto unreg_devices; } }return 0 ; -del_devices: +unreg_devices:while (i--) -device_del (&cdl->devs[i].dev); +device_unregister (&cdl->devs[i].dev);kfree (cdl->devs); cdl->devs =NULL ;
@@ -94,7 +101,7 @@ void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl)unsigned int i;for (i =0 ; i < cdl->len; i++) -device_del (&cdl->devs[i].dev); +device_unregister (&cdl->devs[i].dev);kfree (cdl->devs); cdl->len =0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 248/694 arm64: dts: qcom: sc7280-herobrine-villager: correct trackpad supply
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit de88b1759b35086d5e63736fb604ea2d06486b1a ]
The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other Herobrine boards which use elan,ekth3000 with valid VCC:
sc7280-herobrine-villager-r1-lte.dtb: trackpad@2c: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi +1 -1
@@ -33,7 +33,7 @@ ap_tp_i2c: &i2c0 { interrupts = <7 IRQ_TYPE_EDGE_FALLING>; hid-descr-addr = <0x20>; - vcc-supply = <&pp3300_z1>; + vdd-supply = <&pp3300_z1>; wakeup-source; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 249/694 arm64: dts: qcom: sc7180-trogdor-lazor: correct trackpad supply
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 52e2996f253d82520011340d40dbc1c76ea79208 ]
The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other boards which use elan,ekth3000 with valid VCC:
sc7180-trogdor-lazor-limozeen-nots-r4.dtb: trackpad@2c: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
--- .../boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts +1 -1
@@ -26,7 +26,7 @@ interrupt-parent = <&tlmm>; interrupts = <58 IRQ_TYPE_EDGE_FALLING>; - vcc-supply = <&pp3300_fp_tp>; + vdd-supply = <&pp3300_fp_tp>; hid-descr-addr = <0x20>; wakeup-source;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 250/694 arm64: dts: qcom: sc7180-trogdor-pazquel: correct trackpad supply
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 24f39eec6a70768e7c2eb2f3d8158f45050ff75a ]
The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other boards which use elan,ekth3000 with valid VCC:
sc7180-trogdor-pazquel360-lte.dtb: trackpad@15: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi +1 -1
@@ -39,7 +39,7 @@ interrupt-parent = <&tlmm>; interrupts = <0 IRQ_TYPE_EDGE_FALLING>; - vcc-supply = <&pp3300_fp_tp>; + vdd-supply = <&pp3300_fp_tp>; post-power-on-delay-ms = <100>; hid-descr-addr = <0x0001>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 251/694 arm64: dts: qcom: msm8998-oneplus-cheeseburger: revert "fix backlight pin function"
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 97b4fdc6b82d6d5cfb92a9b164540278720fb700 ]
This reverts commit 46546f28825cf3a5ef6873b9cf947cd85c8a7258 because it mistakenly took PMIC pinctrl/GPIO as TLMM. The TLMM pinctrl uses "gpio" function, but PMIC uses "normal", so original code was correct:
msm8998-oneplus-cheeseburger.dtb: pmic@2: gpio@c000:button-backlight-state: 'oneOf' conditional failed, one must be fixed:
'gpio' is not one of ['normal', 'paired', 'func1', 'func2', 'dtest1', 'dtest2', 'dtest3', 'dtest4', 'func3', 'func4']
--- arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts +1 -1
@@ -34,7 +34,7 @@ &pmi8998_gpios { button_backlight_default: button-backlight-state { pins = "gpio5"; - function = "gpio"; + function = "normal"; bias-pull-down; qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>; };
Signature · 1 line
2.39.2