4.19.226-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 163/239 ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5
In reply to Greg Kroah-HartmanFrom: Kirill A. Shutemov <[email protected]>
[ Upstream commit 1d4e0b3abb168b2ee1eca99c527cffa1b80b6161 ]
ACPICA commit 3dd7e1f3996456ef81bfe14cba29860e8d42949e
According to ACPI 6.4, Section 16.2, the CPU cache flushing is required on entering to S1, S2, and S3, but the ACPICA code flushes the CPU cache regardless of the sleep state.
Blind cache flush on entering S5 causes problems for TDX.
Flushing happens with WBINVD that is not supported in the TDX environment.
TDX only supports S5 and adjusting ACPICA code to conform to the spec more strictly fixes the issue.
--- drivers/acpi/acpica/hwesleep.c | 4 +++- drivers/acpi/acpica/hwsleep.c | 4 +++- drivers/acpi/acpica/hwxfsleep.c | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/acpi/acpica/hwesleep.c +3 -1
@@ -104,7 +104,9 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)/* Flush caches, as per ACPI specification */ -ACPI_FLUSH_CPU_CACHE (); +if (sleep_state <ACPI_STATE_S4 ) { +ACPI_FLUSH_CPU_CACHE (); + } status =acpi_os_enter_sleep (sleep_state, sleep_control,0 );if (status ==AE_CTRL_TERMINATE ) {
drivers/acpi/acpica/hwsleep.c +3 -1
@@ -110,7 +110,9 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)/* Flush caches, as per ACPI specification */ -ACPI_FLUSH_CPU_CACHE (); +if (sleep_state <ACPI_STATE_S4 ) { +ACPI_FLUSH_CPU_CACHE (); + } status =acpi_os_enter_sleep (sleep_state, pm1a_control, pm1b_control);if (status ==AE_CTRL_TERMINATE ) {
drivers/acpi/acpica/hwxfsleep.c +0 -2
@@ -189,8 +189,6 @@ acpi_status acpi_enter_sleep_state_s4bios(void)return_ACPI_STATUS (status); } -ACPI_FLUSH_CPU_CACHE (); - status =acpi_hw_write_port (acpi_gbl_FADT.smi_command, (u32 )acpi_gbl_FADT.s4_bios_request,8 );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 164/239 drm/amdgpu: fixup bad vram size on gmc v8
In reply to Greg Kroah-HartmanFrom: Zongmin Zhou <[email protected]>
[ Upstream commit 11544d77e3974924c5a9c8a8320b996a3e9b2f8b ]
Some boards(like RX550) seem to have garbage in the upper 16 bits of the vram size register. Check for this and clamp the size properly. Fixes
boards reporting bogus amounts of vram.
after add this patch,the maximum GPU VRAM size is 64GB, otherwise only 64GB vram size will be used.
--- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +10 -3
@@ -520,10 +520,10 @@ static void gmc_v8_0_mc_program(struct amdgpu_device *adev)static int gmc_v8_0_mc_init (struct amdgpu_device *adev) {int r; +u32 tmp; adev->gmc.vram_width =amdgpu_atombios_get_vram_width (adev);if (!adev->gmc.vram_width) { -u32 tmp;int chansize, numchan;/* Get VRAM informations */
@@ -567,8 +567,15 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev) adev->gmc.vram_width = numchan * chansize; }/* size in MB on si */ - adev->gmc.mc_vram_size =RREG32 (mmCONFIG_MEMSIZE) *1024ULL *1024ULL ; - adev->gmc.real_vram_size =RREG32 (mmCONFIG_MEMSIZE) *1024ULL *1024ULL ; + tmp =RREG32 (mmCONFIG_MEMSIZE); +/* some boards may have garbage in the upper 16 bits */ +if (tmp &0xffff0000 ) { +DRM_INFO ("Probable bad vram size: 0x%08x\n" , tmp); +if (tmp &0xffff ) + tmp &=0xffff ; + } + adev->gmc.mc_vram_size = tmp *1024ULL *1024ULL ; + adev->gmc.real_vram_size = adev->gmc.mc_vram_size;if (!(adev->flags &AMD_IS_APU )) { r =amdgpu_device_resize_fb_bar (adev);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 165/239 ACPI: battery: Add the ThinkPad "Not Charging" quirk
In reply to Greg Kroah-HartmanFrom: Thomas Weißschuh <[email protected]>
[ Upstream commit e96c1197aca628f7d2480a1cc3214912b40b3414 ]
The EC/ACPI firmware on Lenovo ThinkPads used to report a status of "Unknown" when the battery is between the charge start and charge stop thresholds. On Windows, it reports "Not Charging" so the quirk has been added to also report correctly.
Now the "status" attribute returns "Not Charging" when the battery on ThinkPads is not physicaly charging.
--- drivers/acpi/battery.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/acpi/battery.c +22 -0
@@ -78,6 +78,7 @@ static int battery_bix_broken_package;static int battery_notification_delay_ms;static int battery_ac_is_broken;static int battery_check_pmic =1 ; +static int battery_quirk_notcharging;static unsigned int cache_time =1000 ;module_param (cache_time, uint,0644 );MODULE_PARM_DESC (cache_time,"cache time in milliseconds" );
@@ -246,6 +247,8 @@ static int acpi_battery_get_property(struct power_supply *psy, val->intval =POWER_SUPPLY_STATUS_CHARGING ; else if (acpi_battery_is_charged(battery)) val->intval = POWER_SUPPLY_STATUS_FULL; + else if (battery_quirk_notcharging) + val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; else val->intval = POWER_SUPPLY_STATUS_UNKNOWN; break;
@@ -1350,6 +1353,12 @@ battery_do_not_check_pmic_quirk(const struct dmi_system_id *d)return 0 ; } +static int __init battery_quirk_not_charging (const struct dmi_system_id *d) +{ + battery_quirk_notcharging =1 ; +return 0 ; +} +static const struct dmi_system_id bat_dmi_table[]__initconst = { {/* NEC LZ750/LS */
@@ -1394,6 +1403,19 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = { DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"), }, }, + { + /* + * On Lenovo ThinkPads the BIOS specification defines + * a state when the bits for charging and discharging + * are both set to 0. That state is "Not Charging". + */ + .callback = battery_quirk_not_charging, + .ident = "Lenovo ThinkPad", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"), + }, + }, {}, };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 166/239 btrfs: remove BUG_ON() in find_parent_nodes()
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
[ Upstream commit fcba0120edf88328524a4878d1d6f4ad39f2ec81 ]
We search for an extent entry with .offset = -1, which shouldn't be a thing, but corruption happens. Add an ASSERT() for the developers, return -EUCLEAN for mortals.
--- fs/btrfs/backref.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/btrfs/backref.c +6 -1
@@ -1160,7 +1160,12 @@ again: ret =btrfs_search_slot (trans, fs_info->extent_root, &key, path,0 ,0 );if (ret <0 ) goto out; -BUG_ON (ret ==0 ); +if (ret ==0 ) { +/* This shouldn't happen, indicates a bug or fs corruption. */ +ASSERT (ret !=0 ); + ret = -EUCLEAN ; + goto out; + }#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS if (trans && likely(trans->type != __TRANS_DUMMY) &&
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 167/239 btrfs: remove BUG_ON(!eie) in find_parent_nodes
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
[ Upstream commit 9f05c09d6baef789726346397438cca4ec43c3ee ]
If we're looking for leafs that point to a data extent we want to record the extent items that point at our bytenr. At this point we have the reference and we know for a fact that this leaf should have a reference to our bytenr. However if there's some sort of corruption we may not find any references to our leaf, and thus could end up with eie == NULL. Replace this BUG_ON() with an ASSERT() and then return -EUCLEAN for the mortals.
--- fs/btrfs/backref.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
fs/btrfs/backref.c +11 -3
@@ -1313,10 +1313,18 @@ again: goto out;if (!ret && extent_item_pos) {/* -* we've recorded that parent, so we must extend -* its inode list here +* We've recorded that parent, so we must extend +* its inode list here. +* +* However if there was corruption we may not +* have found an eie, return an error in this +* case. */ -BUG_ON (!eie); +ASSERT (eie); +if (!eie) { + ret = -EUCLEAN ; + goto out; + }while (eie->next) eie = eie->next; eie->next = ref->inode_list;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 168/239 net: mdio: Demote probed message to debug print
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit 7590fc6f80ac2cbf23e6b42b668bbeded070850b ]
On systems with large numbers of MDIO bus/muxes the message indicating that a given MDIO bus has been successfully probed is repeated for as many buses we have, which can eat up substantial boot time for no reason, demote to a debug print.
--- drivers/net/phy/mdio_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/mdio_bus.c +1 -1
@@ -426,7 +426,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)mdiobus_setup_mdiodev_from_board_info (bus, mdiobus_create_device); bus->state =MDIOBUS_REGISTERED ; -pr_info ("%s: probed\n" , bus->name); +dev_dbg (&bus->dev,"probed\n" );return 0 ; error:
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 169/239 mac80211: allow non-standard VHT MCS-10/11
In reply to Greg Kroah-HartmanFrom: Ping-Ke Shih <[email protected]>
[ Upstream commit 04be6d337d37400ad5b3d5f27ca87645ee5a18a3 ]
Some AP can possibly try non-standard VHT rate and mac80211 warns and drops packets, and leads low TCP throughput.
Rate marked as a VHT rate but data is invalid: MCS: 10, NSS: 2
WARNING: CPU: 1 PID: 7817 at net/mac80211/rx.c:4856 ieee80211_rx_list+0x223/0x2f0 [mac8021
Since commit c27aa56a72b8 ("cfg80211: add VHT rate entries for MCS-10 and MCS-11") has added, mac80211 adds this support as well.
After this patch, throughput is good and iw can get the bitrate:
rx bitrate: 975.1 MBit/s VHT-MCS 10 80MHz short GI VHT-NSS 2
or
rx bitrate: 1083.3 MBit/s VHT-MCS 11 80MHz short GI VHT-NSS 2
--- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/rx.c +1 -1
@@ -4620,7 +4620,7 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta, goto drop;break ;case RX_ENC_VHT : - if (WARN_ONCE(status->rate_idx > 9 || + if (WARN_ONCE(status->rate_idx > 11 || !status->nss || status->nss > 8, "Rate marked as a VHT rate but data is invalid: MCS: %d, NSS: %d\n",
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 170/239 dm btree: add a defensive bounds check to insert_at()
In reply to Greg Kroah-HartmanFrom: Joe Thornber <[email protected]>
[ Upstream commit 85bca3c05b6cca31625437eedf2060e846c4bbad ]
Corrupt metadata could trigger an out of bounds write.
--- drivers/md/persistent-data/dm-btree.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/md/persistent-data/dm-btree.c +5 -3
@@ -83,14 +83,16 @@ void inc_children(struct dm_transaction_manager *tm, struct btree_node *n, }static int insert_at (size_t value_size,struct btree_node *node,unsigned index, -uint64_t key,void *value) -__dm_written_to_disk (value) +uint64_t key,void *value) +__dm_written_to_disk (value) {uint32_t nr_entries =le32_to_cpu (node->header.nr_entries); +uint32_t max_entries =le32_to_cpu (node->header.max_entries);__le64 key_le =cpu_to_le64 (key);if (index > nr_entries || - index >=le32_to_cpu (node->header.max_entries)) { + index >= max_entries || + nr_entries >= max_entries) {DMERR ("too many entries in btree node for insert" );__dm_unbless_for_disk (value);return -ENOMEM ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 171/239 dm space map common: add bounds check to sm_ll_lookup_bitmap()
In reply to Greg Kroah-HartmanFrom: Joe Thornber <[email protected]>
[ Upstream commit cba23ac158db7f3cd48a923d6861bee2eb7a2978 ]
Corrupted metadata could warrant returning error from sm_ll_lookup_bitmap().
--- drivers/md/persistent-data/dm-space-map-common.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/md/persistent-data/dm-space-map-common.c +5 -0
@@ -279,6 +279,11 @@ int sm_ll_lookup_bitmap(struct ll_disk *ll, dm_block_t b, uint32_t *result)struct disk_index_entry ie_disk;struct dm_block *blk; +if (b >= ll->nr_blocks) { +DMERR_LIMIT ("metadata block out of bounds" ); +return -EINVAL ; + } + b =do_div (index, ll->entries_per_block); r = ll->load_ie (ll, index, &ie_disk);if (r <0 )
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 172/239 net: phy: marvell: configure RGMII delays for 88E1118
In reply to Greg Kroah-HartmanFrom: Russell King (Oracle) <[email protected]>
[ Upstream commit f22725c95ececb703c3f741e8f946d23705630b7 ]
Corentin Labbe reports that the SSI 1328 does not work when allowing the PHY to operate at gigabit speeds, but does work with the generic PHY driver.
This appears to be because m88e1118_config_init() writes a fixed value to the MSCR register, claiming that this is to enable 1G speeds. However, this always sets bits 4 and 5, enabling RGMII transmit and receive delays. The suspicion is that the original board this was added for required the delays to make 1G speeds work.
Add the necessary configuration for RGMII delays for the 88E1118 to bring this into line with the requirements for RGMII support, and thus make the SSI 1328 work.
Corentin Labbe has tested this on gemini-ssi1328 and gemini-ns2502.
--- drivers/net/phy/marvell.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/phy/marvell.c +6 -0
@@ -930,6 +930,12 @@ static int m88e1118_config_init(struct phy_device *phydev)if (err <0 )return err; +if (phy_interface_is_rgmii (phydev)) { + err =m88e1121_config_aneg_rgmii_delays (phydev); +if (err <0 ) +return err; + } +/* Adjust LED Control */ if (phydev->dev_flags &MARVELL_PHY_M1118_DNS323_LEDS ) err =phy_write (phydev,0x10 ,0x1100 );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 173/239 net: gemini: allow any RGMII interface mode
In reply to Greg Kroah-HartmanFrom: Russell King (Oracle) <[email protected]>
[ Upstream commit 4e4f325a0a55907b14f579e6b1a38c53755e3de2 ]
The four RGMII interface modes take care of the required RGMII delay configuration at the PHY and should not be limited by the network MAC driver. Sadly, gemini was only permitting RGMII mode with no delays, which would require the required delay to be inserted via PCB tracking or by the MAC.
However, there are designs that require the PHY to add the delay, which is impossible without Gemini permitting the other three PHY interface modes. Fix the driver to allow these.
--- drivers/net/ethernet/cortina/gemini.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/cortina/gemini.c +6 -3
@@ -304,21 +304,21 @@ static void gmac_speed_set(struct net_device *netdev)switch (phydev->speed) {case 1000 : status.bits.speed =GMAC_SPEED_1000 ; -if (phydev->interface ==PHY_INTERFACE_MODE_RGMII ) +if (phy_interface_mode_is_rgmii (phydev->interface)) status.bits.mii_rmii =GMAC_PHY_RGMII_1000 ;netdev_dbg (netdev,"connect %s to RGMII @ 1Gbit\n" ,phydev_name (phydev));break ;case 100 : status.bits.speed =GMAC_SPEED_100 ; -if (phydev->interface ==PHY_INTERFACE_MODE_RGMII ) +if (phy_interface_mode_is_rgmii (phydev->interface)) status.bits.mii_rmii =GMAC_PHY_RGMII_100_10 ;netdev_dbg (netdev,"connect %s to RGMII @ 100 Mbit\n" ,phydev_name (phydev));break ;case 10 : status.bits.speed =GMAC_SPEED_10 ; -if (phydev->interface ==PHY_INTERFACE_MODE_RGMII ) +if (phy_interface_mode_is_rgmii (phydev->interface)) status.bits.mii_rmii =GMAC_PHY_RGMII_100_10 ;netdev_dbg (netdev,"connect %s to RGMII @ 10 Mbit\n" ,phydev_name (phydev));
@@ -389,6 +389,9 @@ static int gmac_setup_phy(struct net_device *netdev) status.bits.mii_rmii =GMAC_PHY_GMII ;break ;case PHY_INTERFACE_MODE_RGMII : +case PHY_INTERFACE_MODE_RGMII_ID : +case PHY_INTERFACE_MODE_RGMII_TXID : +case PHY_INTERFACE_MODE_RGMII_RXID :netdev_dbg (netdev,"RGMII: set GMAC0 and GMAC1 to MII/RGMII mode\n" ); status.bits.mii_rmii =GMAC_PHY_RGMII_100_10 ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 174/239 regulator: qcom_smd: Align probe function with rpmh-regulator
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 14e2976fbabdacb01335d7f91eeebbc89c67ddb1 ]
The RPMh regulator driver is much newer and gets more attention, which in consequence makes it do a few things better. Update qcom_smd-regulator's probe function to mimic what rpmh-regulator does to address a couple of issues:
- Probe defer now works correctly, before it used to, well, kinda just die.. This fixes reliable probing on (at least) PM8994, because Linux apparently cannot deal with supply map dependencies yet..
- Regulator data is now matched more sanely: regulator data is matched against each individual regulator node name and throwing an -EINVAL if data is missing, instead of just assuming everything is fine and iterating over all subsequent array members.
- status = "disabled" will now work for disabling individual regulators in DT. Previously it didn't seem to do much if anything at all.
--- drivers/regulator/qcom_smd-regulator.c | 100 +++++++++++++++++-------- 1 file changed, 70 insertions(+), 30 deletions(-)
drivers/regulator/qcom_smd-regulator.c +70 -30
@@ -17,6 +17,7 @@#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/regulator/driver.h> +#include <linux/regulator/of_regulator.h> #include <linux/soc/qcom/smd-rpm.h> struct qcom_rpm_reg {
@@ -673,52 +674,91 @@ static const struct of_device_id rpm_of_match[] = { };MODULE_DEVICE_TABLE (of, rpm_of_match); -static int rpm_reg_probe (struct platform_device *pdev) +/** +* rpm_regulator_init_vreg() - initialize all attributes of a qcom_smd-regulator +* @vreg: Pointer to the individual qcom_smd-regulator resource +* @dev: Pointer to the top level qcom_smd-regulator PMIC device +* @node: Pointer to the individual qcom_smd-regulator resource +* device node +* @rpm: Pointer to the rpm bus node +* @pmic_rpm_data: Pointer to a null-terminated array of qcom_smd-regulator +* resources defined for the top level PMIC device +* +* Return: 0 on success, errno on failure +*/ +static int rpm_regulator_init_vreg (struct qcom_rpm_reg *vreg,struct device *dev, +struct device_node *node,struct qcom_smd_rpm *rpm, +const struct rpm_regulator_data *pmic_rpm_data) { -const struct rpm_regulator_data *reg; -const struct of_device_id *match; -struct regulator_config config = { }; +struct regulator_config config = {}; +const struct rpm_regulator_data *rpm_data;struct regulator_dev *rdev; +int ret; + +for (rpm_data = pmic_rpm_data; rpm_data->name; rpm_data++) +if (of_node_name_eq (node, rpm_data->name)) +break ; + +if (!rpm_data->name) { +dev_err (dev,"Unknown regulator %pOFn\n" , node); +return -EINVAL ; + } + + vreg->dev = dev; + vreg->rpm = rpm; + vreg->type = rpm_data->type; + vreg->id = rpm_data->id; + +memcpy (&vreg->desc, rpm_data->desc,sizeof (vreg->desc)); + vreg->desc.name = rpm_data->name; + vreg->desc.supply_name = rpm_data->supply; + vreg->desc.owner =THIS_MODULE ; + vreg->desc.type =REGULATOR_VOLTAGE ; + vreg->desc.of_match = rpm_data->name; + + config.dev = dev; + config.of_node = node; + config.driver_data = vreg; + + rdev =devm_regulator_register (dev, &vreg->desc, &config); +if (IS_ERR (rdev)) { + ret =PTR_ERR (rdev); +dev_err (dev,"%pOFn: devm_regulator_register() failed, ret=%d\n" , node, ret); +return ret; + } + +return 0 ; +} + +static int rpm_reg_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +const struct rpm_regulator_data *vreg_data; +struct device_node *node;struct qcom_rpm_reg *vreg;struct qcom_smd_rpm *rpm; +int ret; rpm =dev_get_drvdata (pdev->dev.parent);if (!rpm) { -dev_err (&pdev->dev,"unable to retrieve handle to rpm\n" ); +dev_err (&pdev->dev,"Unable to retrieve handle to rpm\n" );return -ENODEV ; } - match =of_match_device (rpm_of_match, &pdev->dev); -if (!match) { -dev_err (&pdev->dev,"failed to match device\n" ); + vreg_data =of_device_get_match_data (dev); +if (!vreg_data)return -ENODEV ; - } -for (reg = match->data; reg->name; reg++) { +for_each_available_child_of_node (dev->of_node, node) { vreg =devm_kzalloc (&pdev->dev,sizeof (*vreg),GFP_KERNEL );if (!vreg)return -ENOMEM ; - vreg->dev = &pdev->dev; - vreg->type = reg->type; - vreg->id = reg->id; - vreg->rpm = rpm; - -memcpy (&vreg->desc, reg->desc,sizeof (vreg->desc)); - - vreg->desc.id =-1 ; - vreg->desc.owner =THIS_MODULE ; - vreg->desc.type =REGULATOR_VOLTAGE ; - vreg->desc.name = reg->name; - vreg->desc.supply_name = reg->supply; - vreg->desc.of_match = reg->name; - - config.dev = &pdev->dev; - config.driver_data = vreg; - rdev =devm_regulator_register (&pdev->dev, &vreg->desc, &config); -if (IS_ERR (rdev)) { -dev_err (&pdev->dev,"failed to register %s\n" , reg->name); -return PTR_ERR (rdev); + ret =rpm_regulator_init_vreg (vreg, dev, node, rpm, vreg_data); + +if (ret <0 ) { +of_node_put (node); +return ret; } }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 175/239 serial: pl010: Drop CR register reset on set_termios
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
[ Upstream commit 08a0c6dff91c965e39905cf200d22db989203ccb ]
pl010_set_termios() briefly resets the CR register to zero.
Where does this register write come from?
The PL010 driver's IRQ handler ambauart_int() originally modified the CR register without holding the port spinlock. ambauart_set_termios() also modified that register. To prevent concurrent read-modify-writes by the IRQ handler and to prevent transmission while changing baudrate, ambauart_set_termios() had to disable interrupts. That is achieved by writing zero to the CR register.
However in 2004 the PL010 driver was amended to acquire the port spinlock in the IRQ handler, obviating the need to disable interrupts in ->set_termios():
https://git.kernel.org/history/history/c/157c0342e591
That rendered the CR register write obsolete. Drop it.
--- drivers/tty/serial/amba-pl010.c | 3 --- 1 file changed, 3 deletions(-)
drivers/tty/serial/amba-pl010.c +0 -3
@@ -452,14 +452,11 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,if ((termios->c_cflag &CREAD ) ==0 ) uap->port.ignore_status_mask |=UART_DUMMY_RSR_RX ; -/* first, disable everything */ old_cr =readb (uap->port.membase +UART010_CR ) & ~UART010_CR_MSIE ;if (UART_ENABLE_MS (port, termios->c_cflag)) old_cr |=UART010_CR_MSIE ; -writel (0 , uap->port.membase +UART010_CR ); -/* Set baud rate */ quot -=1 ;writel ((quot &0xf00 ) >>8 , uap->port.membase +UART010_LCRM );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 176/239 serial: core: Keep mctrl register state and cached copy in sync
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
[ Upstream commit 93a770b7e16772530196674ffc79bb13fa927dc6 ]
struct uart_port contains a cached copy of the Modem Control signals. It is used to skip register writes in uart_update_mctrl() if the new signal state equals the old signal state. It also avoids a register read to obtain the current state of output signals.
When a uart_port is registered, uart_configure_port() changes signal state but neglects to keep the cached copy in sync. That may cause a subsequent register write to be incorrectly skipped. Fix it before it trips somebody up.
This behavior has been present ever since the serial core was introduced in 2002:
https://git.kernel.org/history/history/c/33c0d1b0c3eb
So far it was never an issue because the cached copy is initialized to 0 by kzalloc() and when uart_configure_port() is executed, at most DTR has been set by uart_set_options() or sunsu_console_setup(). Therefore, a stable designation seems unnecessary.
--- drivers/tty/serial/serial_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/serial_core.c +2 -1
@@ -2347,7 +2347,8 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,* We probably don't need a spinlock around this, but */ spin_lock_irqsave (&port->lock, flags); - port->ops->set_mctrl (port, port->mctrl &TIOCM_DTR ); + port->mctrl &=TIOCM_DTR ; + port->ops->set_mctrl (port, port->mctrl);spin_unlock_irqrestore (&port->lock, flags);/*
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 177/239 parisc: Avoid calling faulthandler_disabled() twice
In reply to Greg Kroah-HartmanFrom: John David Anglin <[email protected]>
[ Upstream commit 9e9d4b460f23bab61672eae397417d03917d116c ]
In handle_interruption(), we call faulthandler_disabled() to check whether the fault handler is not disabled. If the fault handler is disabled, we immediately call do_page_fault(). It then calls faulthandler_disabled(). If disabled, do_page_fault() attempts to fixup the exception by jumping to no_context:
no_context:
if (!user_mode(regs) && fixup_exception(regs)) {
return;
}
parisc_terminate("Bad Address (null pointer deref?)", regs, code, address);Apart from the error messages, the two blocks of code perform the same function.
We can avoid two calls to faulthandler_disabled() by a simple revision to the code in handle_interruption().
Note: I didn't try to fix the formatting of this code block.
--- arch/parisc/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/traps.c +1 -1
@@ -750,7 +750,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)* unless pagefault_disable() was called before. */ -if (fault_space ==0 && !faulthandler_disabled ()) +if (faulthandler_disabled () || fault_space ==0 ) {/* Clean up and return if in exception table. */ if (fixup_exception (regs))
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 178/239 powerpc/6xx: add missing of_node_put
In reply to Greg Kroah-HartmanFrom: Julia Lawall <[email protected]>
[ Upstream commit f6e82647ff71d427d4148964b71f239fba9d7937 ]
for_each_compatible_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
expression e;
local idexpression n;
@@
@@
local idexpression n;
expression e;
@@
for_each_compatible_node(n,...) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? break;
)
...
}
... when != n
// </smpl>
--- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +1 -0
@@ -220,6 +220,7 @@ void hlwd_pic_probe(void)irq_set_chained_handler (cascade_virq, hlwd_pic_irq_cascade); hlwd_irq_host = host; +of_node_put (np);break ; } }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 179/239 powerpc/powernv: add missing of_node_put
In reply to Greg Kroah-HartmanFrom: Julia Lawall <[email protected]>
[ Upstream commit 7d405a939ca960162eb30c1475759cb2fdf38f8c ]
for_each_compatible_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
local idexpression n;
expression e;
@@
for_each_compatible_node(n,...) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? break;
)
...
}
... when != n
// </smpl>
--- arch/powerpc/platforms/powernv/opal-lpc.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powernv/opal-lpc.c +1 -0
@@ -400,6 +400,7 @@ void __init opal_lpc_init(void)if (!of_get_property (np,"primary" ,NULL ))continue ; opal_lpc_chip_id =of_get_ibm_chip_id (np); +of_node_put (np);break ; }if (opal_lpc_chip_id <0 )
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 180/239 powerpc/cell: add missing of_node_put
In reply to Greg Kroah-HartmanFrom: Julia Lawall <[email protected]>
[ Upstream commit a841fd009e51c8c0a8f07c942e9ab6bb48da8858 ]
for_each_node_by_name performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
expression e,e1;
local idexpression n;
@@
for_each_node_by_name(n, e1) {
... when != of_node_put(n)
when != e = n
(
return n;
|
+ of_node_put(n);
? return ...;
)
...
}
// </smpl>
--- arch/powerpc/platforms/cell/iommu.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/iommu.c +1 -0
@@ -1088,6 +1088,7 @@ static int __init cell_iommu_fixed_mapping_init(void)if (hbase < dbase || (hend > (dbase + dsize))) {pr_debug ("iommu: hash window doesn't fit in" "real DMA window\n" ); +of_node_put (np);return -1 ; } }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 181/239 powerpc/btext: add missing of_node_put
In reply to Greg Kroah-HartmanFrom: Julia Lawall <[email protected]>
[ Upstream commit a1d2b210ffa52d60acabbf7b6af3ef7e1e69cda0 ]
for_each_node_by_type performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
local idexpression n;
expression e;
@@
for_each_node_by_type(n,...) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? break;
)
...
}
... when != n
// </smpl>
--- arch/powerpc/kernel/btext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/kernel/btext.c +3 -1
@@ -258,8 +258,10 @@ int __init btext_find_display(int allow_nonstdout) rc =btext_initialize (np);printk ("result: %d\n" , rc); } -if (rc ==0 ) +if (rc ==0 ) { +of_node_put (np);break ; + } }return rc; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 182/239 powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
In reply to Greg Kroah-HartmanFrom: Nicholas Piggin <[email protected]>
[ Upstream commit 5dad4ba68a2483fc80d70b9dc90bbe16e1f27263 ]
It is possible for all CPUs to miss the pending cpumask becoming clear, and then nobody resetting it, which will cause the lockup detector to stop working. It will eventually expire, but watchdog_smp_panic will avoid doing anything if the pending mask is clear and it will never be reset.
Order the cpumask clear vs the subsequent test to close this race.
Add an extra check for an empty pending mask when the watchdog fires and finds its bit still clear, to try to catch any other possible races or bugs here and keep the watchdog working. The extra test in arch_touch_nmi_watchdog is required to prevent the new warning from firing off.
--- arch/powerpc/kernel/watchdog.c | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)
arch/powerpc/kernel/watchdog.c +40 -1
@@ -132,6 +132,10 @@ static void set_cpumask_stuck(const struct cpumask *cpumask, u64 tb) {cpumask_or (&wd_smp_cpus_stuck, &wd_smp_cpus_stuck, cpumask);cpumask_andnot (&wd_smp_cpus_pending, &wd_smp_cpus_pending, cpumask); +/* +* See wd_smp_clear_cpu_pending() +*/ +smp_mb ();if (cpumask_empty (&wd_smp_cpus_pending)) { wd_smp_last_reset_tb = tb; cpumask_andnot(&wd_smp_cpus_pending,
@@ -217,13 +221,44 @@ static void wd_smp_clear_cpu_pending(int cpu, u64 tb)cpumask_clear_cpu (cpu, &wd_smp_cpus_stuck);wd_smp_unlock (&flags); + }else { +/* +* The last CPU to clear pending should have reset the +* watchdog so we generally should not find it empty +* here if our CPU was clear. However it could happen +* due to a rare race with another CPU taking the +* last CPU out of the mask concurrently. +* +* We can't add a warning for it. But just in case +* there is a problem with the watchdog that is causing +* the mask to not be reset, try to kick it along here. +*/ +if (unlikely (cpumask_empty (&wd_smp_cpus_pending))) + goto none_pending; }return ; } +cpumask_clear_cpu (cpu, &wd_smp_cpus_pending); + +/* +* Order the store to clear pending with the load(s) to check all +* words in the pending mask to check they are all empty. This orders +* with the same barrier on another CPU. This prevents two CPUs +* clearing the last 2 pending bits, but neither seeing the other's +* store when checking if the mask is empty, and missing an empty +* mask, which ends with a false positive. +*/ +smp_mb ();if (cpumask_empty (&wd_smp_cpus_pending)) {unsigned long flags; +none_pending: +/* +* Double check under lock because more than one CPU could see +* a clear mask with the lockless check after clearing their +* pending bits. +*/ wd_smp_lock (&flags);if (cpumask_empty (&wd_smp_cpus_pending)) { wd_smp_last_reset_tb = tb;
@@ -314,8 +349,12 @@ void arch_touch_nmi_watchdog(void) {unsigned long ticks = tb_ticks_per_usec * wd_timer_period_ms *1000 ;int cpu =smp_processor_id (); -u64 tb =get_tb (); +u64 tb; +if (!cpumask_test_cpu (cpu, &watchdog_cpumask)) +return ; + + tb =get_tb ();if (tb -per_cpu (wd_timer_tb, cpu) >= ticks) {per_cpu (wd_timer_tb, cpu) = tb;wd_smp_clear_cpu_pending (cpu, tb);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 183/239 i2c: i801: Dont silently correct invalid transfer size
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit effa453168a7eeb8a562ff4edc1dbf9067360a61 ]
If an invalid block size is provided, reject it instead of silently changing it to a supported value. Especially critical I see the case of a write transfer with block length 0. In this case we have no guarantee that the byte we would write is valid. When silently reducing a read to 32 bytes then we don't return an error and the caller may falsely assume that we returned the full requested data.
If this change should break any (broken) caller, then I think we should fix the caller.
--- drivers/i2c/busses/i2c-i801.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/i2c/busses/i2c-i801.c +5 -10
@@ -774,6 +774,11 @@ static int i801_block_transaction(struct i801_priv *priv,int result =0 ;unsigned char hostc; +if (read_write ==I2C_SMBUS_READ && command ==I2C_SMBUS_BLOCK_DATA ) + data->block[0 ] =I2C_SMBUS_BLOCK_MAX ; +else if (data->block[0 ] <1 || data->block[0 ] >I2C_SMBUS_BLOCK_MAX ) +return -EPROTO ; +if (command ==I2C_SMBUS_I2C_BLOCK_DATA ) {if (read_write ==I2C_SMBUS_WRITE ) {/* set I2C_EN bit in configuration register */
@@ -787,16 +792,6 @@ static int i801_block_transaction(struct i801_priv *priv, } } -if (read_write ==I2C_SMBUS_WRITE - || command ==I2C_SMBUS_I2C_BLOCK_DATA ) { -if (data->block[0 ] <1 ) - data->block[0 ] =1 ; -if (data->block[0 ] >I2C_SMBUS_BLOCK_MAX ) - data->block[0 ] =I2C_SMBUS_BLOCK_MAX ; - }else { - data->block[0 ] =32 ;/* max for SMBus block reads */ - } -/* Experience has shown that the block buffer can only be used for SMBus (not I2C) block transactions, even though the datasheet doesn't mention this limitation. */
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 184/239 powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING
In reply to Greg Kroah-HartmanFrom: Michael Ellerman <[email protected]>
[ Upstream commit a4ac0d249a5db80e79d573db9e4ad29354b643a8 ]
setup_profiling_timer() is only needed when CONFIG_PROFILING is enabled.
Fixes the following W=1 warning when CONFIG_PROFILING=n:
linux/arch/powerpc/kernel/smp.c:1638:5: error: no previous prototype for ‘setup_profiling_timer’
--- arch/powerpc/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kernel/smp.c +2 -0
@@ -1070,10 +1070,12 @@ void start_secondary(void *unused)BUG (); } +#ifdef CONFIG_PROFILING int setup_profiling_timer (unsigned int multiplier) {return 0 ; } +#endif #ifdef CONFIG_SCHED_SMT /* cpumask of CPUs with asymetric SMT dependancy */
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 185/239 i2c: mpc: Correct I2C reset procedure
In reply to Greg Kroah-HartmanFrom: Joakim Tjernlund <[email protected]>
[ Upstream commit ebe82cf92cd4825c3029434cabfcd2f1780e64be ]
Current I2C reset procedure is broken in two ways:
1) It only generate 1 START instead of 9 STARTs and STOP.
2) It leaves the bus Busy so every I2C xfer after the first fixup calls the reset routine again, for every xfer there after.
This fixes both errors.
--- drivers/i2c/busses/i2c-mpc.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-mpc.c +15 -8
@@ -105,23 +105,30 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)/* Sometimes 9th clock pulse isn't generated, and slave doesn't release * the bus, because it wants to send ACK. * Following sequence of enabling/disabling and sending start/stop generates -* the 9 pulses, so it's all OK. +* the 9 pulses, each with a START then ending with STOP, so it's all OK. */ static void mpc_i2c_fixup (struct mpc_i2c *i2c) {int k; -u32 delay_val =1000000 / i2c->real_clk +1 ; - -if (delay_val <2 ) - delay_val =2 ; +unsigned long flags;for (k =9 ; k; k--) {writeccr (i2c,0 ); -writeccr (i2c,CCR_MSTA |CCR_MTX |CCR_MEN ); +writeb (0 , i2c->base +MPC_I2C_SR );/* clear any status bits */ +writeccr (i2c,CCR_MEN |CCR_MSTA );/* START */ +readb (i2c->base +MPC_I2C_DR );/* init xfer */ +udelay (15 );/* let it hit the bus */ +local_irq_save (flags);/* should not be delayed further */ +writeccr (i2c,CCR_MEN |CCR_MSTA |CCR_RSTA );/* delay SDA */ readb (i2c->base +MPC_I2C_DR ); -writeccr (i2c,CCR_MEN ); -udelay (delay_val <<1 ); +if (k !=1 ) +udelay (5 ); +local_irq_restore (flags); } +writeccr (i2c,CCR_MEN );/* Initiate STOP */ +readb (i2c->base +MPC_I2C_DR ); +udelay (15 );/* Let STOP propagate */ +writeccr (i2c,0 ); }static int i2c_wait (struct mpc_i2c *i2c,unsigned timeout,int writing)
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 186/239 w1: Misuse of get_user()/put_user() reported by sparse
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit 33dc3e3e99e626ce51f462d883b05856c6c30b1d ]
sparse warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char [noderef]__user*_pu_addr@@ got char *buf @@
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: expected char [noderef] __user *_pu_addr
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: got char *buf
Quoted 1 line
Quoted 1 line
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const [noderef]__user*_gu_addr@@ got char const *buf @@
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: expected char const [noderef] __user *_gu_addr
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: got char const *buf
The buffer buf is a failsafe buffer in kernel space, it's not user memory hence doesn't deserve the use of get_user() or put_user().
Access 'buf' content directly.
--- drivers/w1/slaves/w1_ds28e04.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-)
drivers/w1/slaves/w1_ds28e04.c +6 -20
@@ -34,7 +34,7 @@ static int w1_strong_pullup = 1;module_param_named (strong_pullup, w1_strong_pullup, int,0 );/* enable/disable CRC checking on DS28E04-100 memory accesses */ -static char w1_enable_crccheck =1 ; +static bool w1_enable_crccheck = true;#define W1_EEPROM_SIZE 512#define W1_PAGE_COUNT 16
@@ -341,32 +341,18 @@ static BIN_ATTR_RW(pio, 1);static ssize_t crccheck_show (struct device *dev,struct device_attribute *attr,char *buf) { -if (put_user (w1_enable_crccheck +0x30 , buf)) -return -EFAULT ; - -return sizeof (w1_enable_crccheck); +return sysfs_emit (buf,"%d\n" , w1_enable_crccheck); }static ssize_t crccheck_store (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) { -char val; - -if (count !=1 || !buf) -return -EINVAL ; +int err =kstrtobool (buf, &w1_enable_crccheck); -if (get_user (val, buf)) -return -EFAULT ; +if (err) +return err; -/* convert to decimal */ - val = val -0x30 ; -if (val !=0 && val !=1 ) -return -EINVAL ; - -/* set the new value */ - w1_enable_crccheck = val; - -return sizeof (w1_enable_crccheck); +return count; }static DEVICE_ATTR_RW (crccheck);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 187/239 ALSA: seq: Set upper limit of processed events
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit 6fadb494a638d8b8a55864ecc6ac58194f03f327 ]
Currently ALSA sequencer core tries to process the queued events as much as possible when they become dispatchable. If applications try to queue too massive events to be processed at the very same timing, the sequencer core would still try to process such all events, either in the interrupt context or via some notifier; in either away, it might be a cause of RCU stall or such problems.
As a potential workaround for those problems, this patch adds the upper limit of the amount of events to be processed. The remaining events are processed in the next batch, so they won't be lost.
For the time being, it's limited up to 1000 events per queue, which should be high enough for any normal usages.
--- sound/core/seq/seq_queue.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
sound/core/seq/seq_queue.c +12 -2
@@ -247,12 +247,15 @@ struct snd_seq_queue *snd_seq_queue_find_name(char *name)/* -------------------------------------------------------- */ +#define MAX_CELL_PROCESSES_IN_QUEUE 1000 +void snd_seq_check_queue (struct snd_seq_queue *q,int atomic,int hop) {unsigned long flags;struct snd_seq_event_cell *cell;snd_seq_tick_time_t cur_tick;snd_seq_real_time_t cur_time; +int processed =0 ;if (q ==NULL )return ;
@@ -275,6 +278,8 @@ void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop)if (!cell)break ;snd_seq_dispatch_event (cell, atomic, hop); +if (++processed >=MAX_CELL_PROCESSES_IN_QUEUE ) + goto out;/* the rest processed at the next batch */ }/* Process time queue... */
@@ -284,14 +289,19 @@ void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop)if (!cell)break ;snd_seq_dispatch_event (cell, atomic, hop); +if (++processed >=MAX_CELL_PROCESSES_IN_QUEUE ) + goto out;/* the rest processed at the next batch */ } + out:/* free lock */ spin_lock_irqsave (&q->check_lock, flags);if (q->check_again) { q->check_again =0 ; -spin_unlock_irqrestore (&q->check_lock, flags); - goto __again; +if (processed <MAX_CELL_PROCESSES_IN_QUEUE ) { +spin_unlock_irqrestore (&q->check_lock, flags); + goto __again; + } } q->check_blocked =0 ;spin_unlock_irqrestore (&q->check_lock, flags);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 188/239 powerpc: handle kdump appropriately with crash_kexec_post_notifiers option
In reply to Greg Kroah-HartmanFrom: Hari Bathini <[email protected]>
[ Upstream commit 219572d2fc4135b5ce65c735d881787d48b10e71 ]
Kdump can be triggered after panic_notifers since commit f06e5153f4ae2 ("kernel/panic.c: add "crash_kexec_post_notifiers" option for kdump after panic_notifers") introduced crash_kexec_post_notifiers option. But using this option would mean smp_send_stop(), that marks all other CPUs as offline, gets called before kdump is triggered. As a result, kdump routines fail to save other CPUs' registers. To fix this, kdump friendly crash_smp_send_stop() function was introduced with kernel commit 0ee59413c967 ("x86/panic: replace smp_send_stop() with kdump friendly version in panic path"). Override this kdump friendly weak function to handle crash_kexec_post_notifiers option appropriately on powerpc.
--- arch/powerpc/kernel/smp.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/powerpc/kernel/smp.c +30 -0
@@ -564,6 +564,36 @@ void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)) }#endif +#ifdef CONFIG_NMI_IPI +static void crash_stop_this_cpu(struct pt_regs *regs) +#else +static void crash_stop_this_cpu(void *dummy) +#endif +{ + /* + * Just busy wait here and avoid marking CPU as offline to ensure + * register data is captured appropriately. + */ + while (1) + cpu_relax(); +} + +void crash_smp_send_stop(void) +{ + static bool stopped = false; + + if (stopped) + return; + + stopped = true; + +#ifdef CONFIG_NMI_IPI + smp_send_nmi_ipi(NMI_IPI_ALL_OTHERS, crash_stop_this_cpu, 1000000); +#else + smp_call_function(crash_stop_this_cpu, NULL, 0); +#endif /* CONFIG_NMI_IPI */ +} + #ifdef CONFIG_NMI_IPI static void nmi_stop_this_cpu(struct pt_regs *regs) {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 189/239 MIPS: OCTEON: add put_device() after of_find_device_by_node()
In reply to Greg Kroah-HartmanFrom: Ye Guojin <[email protected]>
[ Upstream commit 858779df1c0787d3fec827fb705708df9ebdb15b ]
This was found by coccicheck:./arch/mips/cavium-octeon/octeon-platform.c, 332, 1-7, ERROR missing put_device; call of_find_device_by_node on line 324, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-platform.c, 395, 1-7, ERROR missing put_device; call of_find_device_by_node on line 387, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 512, 3-9, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 543, 1-7, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function.
--- arch/mips/cavium-octeon/octeon-platform.c | 2 ++ arch/mips/cavium-octeon/octeon-usb.c | 1 + 2 files changed, 3 insertions(+)
arch/mips/cavium-octeon/octeon-platform.c +2 -0
@@ -328,6 +328,7 @@ static int __init octeon_ehci_device_init(void) pd->dev.platform_data = &octeon_ehci_pdata;octeon_ehci_hw_start (&pd->dev); +put_device (&pd->dev);return ret; }
@@ -391,6 +392,7 @@ static int __init octeon_ohci_device_init(void) pd->dev.platform_data = &octeon_ohci_pdata;octeon_ohci_hw_start (&pd->dev); +put_device (&pd->dev);return ret; }
arch/mips/cavium-octeon/octeon-usb.c +1 -0
@@ -543,6 +543,7 @@ static int __init dwc3_octeon_device_init(void)devm_iounmap (&pdev->dev, base);devm_release_mem_region (&pdev->dev, res->start,resource_size (res)); +put_device (&pdev->dev); } }while (node !=NULL );
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 190/239 i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters
In reply to Greg Kroah-HartmanFrom: Lakshmi Sowjanya D <[email protected]>
[ Upstream commit d52097010078c1844348dc0e467305e5f90fd317 ]
The data type of hcnt and lcnt in the struct dw_i2c_dev is of type u16. It's better to have same data type in struct dw_scl_sda_cfg as well.
--- drivers/i2c/busses/i2c-designware-pcidrv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-designware-pcidrv.c +4 -4
@@ -36,10 +36,10 @@ enum dw_pci_ctl_id_t { };struct dw_scl_sda_cfg { -u32 ss_hcnt; -u32 fs_hcnt; -u32 ss_lcnt; -u32 fs_lcnt; +u16 ss_hcnt; +u16 fs_hcnt; +u16 ss_lcnt; +u16 fs_lcnt;u32 sda_hold; };
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 191/239 MIPS: Octeon: Fix build errors using clang
In reply to Greg Kroah-HartmanFrom: Tianjia Zhang <[email protected]>
[ Upstream commit 95339b70677dc6f9a2d669c4716058e71b8dc1c7 ]
A large number of the following errors is reported when compiling with clang:
cvmx-bootinfo.h:326:3: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE'
case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
~~~^~~~
cvmx-bootinfo.h:326:3: note: use array indexing to silence this warning
cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE'
case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
^Follow the prompts to use the address operator '&' to fix this error.
--- arch/mips/include/asm/octeon/cvmx-bootinfo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/octeon/cvmx-bootinfo.h +2 -2
@@ -315,7 +315,7 @@ enum cvmx_chip_types_enum {/* Functions to return string based on type */ #define ENUM_BRD_TYPE_CASE (x) \ - case x: return(#x + 16);/* Skip CVMX_BOARD_TYPE_ */ + case x: return (&#x[16]);/* Skip CVMX_BOARD_TYPE_ */ static inline const char *cvmx_board_type_to_string (enum cvmx_board_types_enum type) {
@@ -404,7 +404,7 @@ static inline const char *cvmx_board_type_to_string(enum }#define ENUM_CHIP_TYPE_CASE (x) \ - case x: return(#x + 15);/* Skip CVMX_CHIP_TYPE */ + case x: return (&#x[15]);/* Skip CVMX_CHIP_TYPE */ static inline const char *cvmx_chip_type_to_string (enum cvmx_chip_types_enum type) {
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 192/239 scsi: sr: Dont use GFP_DMA
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit d94d94969a4ba07a43d62429c60372320519c391 ]
The allocated buffers are used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed.
--- drivers/scsi/sr.c | 2 +- drivers/scsi/sr_vendor.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/sr.c +1 -1
@@ -885,7 +885,7 @@ static void get_capabilities(struct scsi_cd *cd)/* allocate transfer buffer */ - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer) {sr_printk (KERN_ERR , cd,"out of memory.\n" );return ;
drivers/scsi/sr_vendor.c +2 -2
@@ -113,7 +113,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)if (cd->vendor ==VENDOR_TOSHIBA ) density = (blocklength >2048 ) ?0x81 :0x83 ; - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer)return -ENOMEM ;
@@ -161,7 +161,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)if (cd->cdi.mask &CDC_MULTI_SESSION )return 0 ; - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer)return -ENOMEM ;
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 193/239 ASoC: mediatek: mt8173: fix device_node leak
In reply to Greg Kroah-HartmanFrom: Tzung-Bi Shih <[email protected]>
[ Upstream commit 493433785df0075afc0c106ab65f10a605d0b35d ]
Fixes the device_node leak.
--- sound/soc/mediatek/mt8173/mt8173-max98090.c | 3 +++ sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 2 ++ sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 2 ++ sound/soc/mediatek/mt8173/mt8173-rt5650.c | 2 ++ 4 files changed, 9 insertions(+)
sound/soc/mediatek/mt8173/mt8173-max98090.c +3 -0
@@ -169,6 +169,9 @@ static int mt8173_max98090_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (codec_node); +of_node_put (platform_node);return ret; }
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c +2 -0
@@ -217,6 +217,8 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (platform_node);return ret; }
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c +2 -0
@@ -274,6 +274,8 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (platform_node);return ret; }
sound/soc/mediatek/mt8173/mt8173-rt5650.c +2 -0
@@ -301,6 +301,8 @@ static int mt8173_rt5650_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (platform_node);return ret; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 194/239 power: bq25890: Enable continuous conversion for ADC at charging
In reply to Greg Kroah-HartmanFrom: Yauhen Kharuzhy <[email protected]>
[ Upstream commit 80211be1b9dec04cc2805d3d81e2091ecac289a1 ]
Instead of one shot run of ADC at beginning of charging, run continuous conversion to ensure that all charging-related values are monitored properly (input voltage, input current, themperature etc.).
--- drivers/power/supply/bq25890_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/bq25890_charger.c +2 -2
@@ -521,12 +521,12 @@ static void bq25890_handle_state_change(struct bq25890_device *bq,if (!new_state->online) {/* power removed */ /* disable ADC */ - ret =bq25890_field_write (bq,F_CONV_START ,0 ); + ret =bq25890_field_write (bq,F_CONV_RATE ,0 );if (ret <0 ) goto error; }else if (!old_state.online) {/* power inserted */ /* enable ADC, to have control of charge current/voltage */ - ret =bq25890_field_write (bq,F_CONV_START ,1 ); + ret =bq25890_field_write (bq,F_CONV_RATE ,1 );if (ret <0 ) goto error; }
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerPATCH 195/239 rpmsg: core: Clean up resources on announce_create failure.
In reply to Greg Kroah-HartmanFrom: Arnaud Pouliquen <[email protected]>
commit 8066c615cb69b7da8a94f59379847b037b3a5e46 upstream.
During the rpmsg_dev_probe, if rpdev->ops->announce_create returns an error, the rpmsg device and default endpoint should be freed before exiting the function.
--- drivers/rpmsg/rpmsg_core.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/rpmsg/rpmsg_core.c +16 -4
@@ -473,13 +473,25 @@ static int rpmsg_dev_probe(struct device err = rpdrv->probe (rpdev);if (err) {dev_err (dev,"%s: failed: %d\n" , __func__, err); -if (ept) -rpmsg_destroy_ept (ept); - goto out; + goto destroy_ept; } -if (ept && rpdev->ops->announce_create) +if (ept && rpdev->ops->announce_create) { err = rpdev->ops->announce_create (rpdev); +if (err) { +dev_err (dev,"failed to announce creation\n" ); + goto remove_rpdev; + } + } + +return 0 ; + +remove_rpdev: +if (rpdrv->remove) + rpdrv->remove (rpdev); +destroy_ept: +if (ept) +rpmsg_destroy_ept (ept); out:return err; }
Greg Kroah-Hartman
maintainerPATCH 196/239 ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers
In reply to Greg Kroah-HartmanFrom: Petr Cvachoucek <[email protected]>
commit 3fea4d9d160186617ff40490ae01f4f4f36b28ff upstream.
it seems freeing the write buffers in the error path of the ubifs_remount_rw() is wrong. It leads later to a kernel oops like this:
[10016.431274] UBIFS (ubi0:0): start fixing up free space [10090.810042] UBIFS (ubi0:0): free space fixup complete [10090.814623] UBIFS error (ubi0:0 pid 512): ubifs_remount_fs: cannot spawn "ubifs_bgt0_0", error -4 [10101.915108] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 517 [10105.275498] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 [10105.284352] Mem abort info: [10105.287160] ESR = 0x96000006 [10105.290252] EC = 0x25: DABT (current EL), IL = 32 bits [10105.295592] SET = 0, FnV = 0 [10105.298652] EA = 0, S1PTW = 0 [10105.301848] Data abort info: [10105.304723] ISV = 0, ISS = 0x00000006 [10105.308573] CM = 0, WnR = 0 [10105.311564] user pgtable: 4k pages, 48-bit VAs, pgdp=00000000f03d1000 [10105.318034] [0000000000000030] pgd=00000000f6cee003, pud=00000000f4884003, pmd=0000000000000000 [10105.326783] Internal error: Oops: 96000006 [#1] PREEMPT SMP [10105.332355] Modules linked in: ath10k_pci ath10k_core ath mac80211 libarc4 cfg80211 nvme nvme_core cryptodev(O) [10105.342468] CPU: 3 PID: 518 Comm: touch Tainted: G O 5.4.3 #1 [10105.349517] Hardware name: HYPEX CPU (DT) [10105.353525] pstate: 40000005 (nZcv daif -PAN -UAO) [10105.358324] pc : atomic64_try_cmpxchg_acquire.constprop.22+0x8/0x34 [10105.364596] lr : mutex_lock+0x1c/0x34 [10105.368253] sp : ffff000075633aa0 [10105.371563] x29: ffff000075633aa0 x28: 0000000000000001 [10105.376874] x27: ffff000076fa80c8 x26: 0000000000000004 [10105.382185] x25: 0000000000000030 x24: 0000000000000000 [10105.387495] x23: 0000000000000000 x22: 0000000000000038 [10105.392807] x21: 000000000000000c x20: ffff000076fa80c8 [10105.398119] x19: ffff000076fa8000 x18: 0000000000000000 [10105.403429] x17: 0000000000000000 x16: 0000000000000000 [10105.408741] x15: 0000000000000000 x14: fefefefefefefeff [10105.414052] x13: 0000000000000000 x12: 0000000000000fe0 [10105.419364] x11: 0000000000000fe0 x10: ffff000076709020 [10105.424675] x9 : 0000000000000000 x8 : 00000000000000a0 [10105.429986] x7 : ffff000076fa80f4 x6 : 0000000000000030 [10105.435297] x5 : 0000000000000000 x4 : 0000000000000000 [10105.440609] x3 : 0000000000000000 x2 : ffff00006f276040 [10105.445920] x1 : ffff000075633ab8 x0 : 0000000000000030 [10105.451232] Call trace: [10105.453676] atomic64_try_cmpxchg_acquire.constprop.22+0x8/0x34 [10105.459600] ubifs_garbage_collect+0xb4/0x334 [10105.463956] ubifs_budget_space+0x398/0x458 [10105.468139] ubifs_create+0x50/0x180 [10105.471712] path_openat+0x6a0/0x9b0 [10105.475284] do_filp_open+0x34/0x7c [10105.478771] do_sys_open+0x78/0xe4 [10105.482170] __arm64_sys_openat+0x1c/0x24 [10105.486180] el0_svc_handler+0x84/0xc8 [10105.489928] el0_svc+0x8/0xc [10105.492808] Code: 52800013 17fffffb d2800003 f9800011 (c85ffc05) [10105.498903] ---[ end trace 46b721d93267a586 ]---
To reproduce the problem:
1. Filesystem initially mounted read-only, free space fixup flag set.
2. mount -o remount,rw <mountpoint>
3. it takes some time (free space fixup running)
... try to terminate running mount by CTRL-C
... does not respond, only after free space fixup is complete ... then "ubifs_remount_fs: cannot spawn "ubifs_bgt0_0", error -4"
4. mount -o remount,rw <mountpoint>
... now finished instantly (fixup already done).
5. Create file or just unmount the filesystem and we get the oops.
--- fs/ubifs/super.c | 1 - 1 file changed, 1 deletion(-)
fs/ubifs/super.c +0 -1
@@ -1730,7 +1730,6 @@ out:kthread_stop (c->bgt); c->bgt =NULL ; } -free_wbufs (c);kfree (c->write_reserve_buf); c->write_reserve_buf =NULL ;vfree (c->ileb_buf);
Greg Kroah-Hartman
maintainerPATCH 197/239 serial: Fix incorrect rs485 polarity on uart open
In reply to Greg Kroah-HartmanFrom: Lukas Wunner <[email protected]>
commit d3b3404df318504ec084213ab1065b73f49b0f1d upstream.
Commit a6845e1e1b78 ("serial: core: Consider rs485 settings to drive RTS") sought to deassert RTS when opening an rs485-enabled uart port. That way, the transceiver does not occupy the bus until it transmits data.
Unfortunately, the commit mixed up the logic and *asserted* RTS instead of *deasserting* it:
The commit amended uart_port_dtr_rts(), which raises DTR and RTS when opening an rs232 port. "Raising" actually means lowering the signal that's coming out of the uart, because an rs232 transceiver not only changes a signal's voltage level, it also *inverts* the signal. See the simplified schematic in the MAX232 datasheet for an example:
https://www.ti.com/lit/ds/symlink/max232.pdf
So, to raise RTS on an rs232 port, TIOCM_RTS is *set* in port->mctrl and that results in the signal being driven low.
In contrast to rs232, the signal level for rs485 Transmit Enable is the identity, not the inversion: If the transceiver expects a "high" RTS signal for Transmit Enable, the signal coming out of the uart must also be high, so TIOCM_RTS must be *cleared* in port->mctrl.
The commit did the exact opposite, but it's easy to see why given the confusing semantics of rs232 and rs485. Fix it.
--- drivers/tty/serial/serial_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/serial_core.c +2 -2
@@ -159,7 +159,7 @@ static void uart_port_dtr_rts(struct uarint RTS_after_send = !!(uport->rs485.flags &SER_RS485_RTS_AFTER_SEND );if (raise) { -if (rs485_on && !RTS_after_send) { +if (rs485_on && RTS_after_send) {uart_set_mctrl (uport,TIOCM_DTR );uart_clear_mctrl (uport,TIOCM_RTS ); }else {
@@ -168,7 +168,7 @@ static void uart_port_dtr_rts(struct uar }else {unsigned int clear =TIOCM_DTR ; - clear |= (!rs485_on || !RTS_after_send) ?TIOCM_RTS :0 ; + clear |= (!rs485_on || RTS_after_send) ?TIOCM_RTS :0 ;uart_clear_mctrl (uport, clear); } }
Greg Kroah-Hartman
maintainerPATCH 198/239 cputime, cpuacct: Include guest time in user time in cpuacct.stat
In reply to Greg Kroah-HartmanFrom: Andrey Ryabinin <[email protected]>
commit 9731698ecb9c851f353ce2496292ff9fcea39dff upstream.
cpuacct.stat in no-root cgroups shows user time without guest time included int it. This doesn't match with user time shown in root cpuacct.stat and /proc/<pid>/stat. This also affects cgroup2's cpu.stat in the same way.
Make account_guest_time() to add user time to cgroup's cpustat to fix this.
--- kernel/sched/cputime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/cputime.c +2 -2
@@ -146,10 +146,10 @@ void account_guest_time(struct task_stru/* Add guest time to cpustat. */ if (task_nice (p) >0 ) { - cpustat[CPUTIME_NICE ] += cputime; +task_group_account_field (p,CPUTIME_NICE , cputime); cpustat[CPUTIME_GUEST_NICE ] += cputime; }else { - cpustat[CPUTIME_USER ] += cputime; +task_group_account_field (p,CPUTIME_USER , cputime); cpustat[CPUTIME_GUEST ] += cputime; } }
Greg Kroah-Hartman
maintainerPATCH 199/239 iwlwifi: mvm: Increase the scan timeout guard to 30 seconds
In reply to Greg Kroah-HartmanFrom: Ilan Peer <[email protected]>
commit ced50f1133af12f7521bb777fcf4046ca908fb77 upstream.
With the introduction of 6GHz channels the scan guard timeout should be adjusted to account for the following extreme case:
- All 6GHz channels are scanned passively: 58 channels.
- The scan is fragmented with the following parameters: 3 fragments, 95 TUs suspend time, 44 TUs maximal out of channel time.
The above would result with scan time of more than 24 seconds. Thus, set the timeout to 30 seconds.
--- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +1 -1
@@ -1555,7 +1555,7 @@ static int iwl_mvm_check_running_scans(sreturn -EIO ; } -#define SCAN_TIMEOUT 20000 +#define SCAN_TIMEOUT 30000void iwl_mvm_scan_timeout_wk (struct work_struct *work) {
Greg Kroah-Hartman
maintainerPATCH 200/239 s390/mm: fix 2KB pgtable release race
In reply to Greg Kroah-HartmanFrom: Alexander Gordeev <[email protected]>
commit c2c224932fd0ee6854d6ebfc8d059c2bcad86606 upstream.
There is a race on concurrent 2KB-pgtables release paths when both upper and lower halves of the containing parent page are freed, one via page_table_free_rcu() + __tlb_remove_table(), and the other via page_table_free(). The race might lead to a corruption as result of remove of list item in page_table_free() concurrently with __free_page() in __tlb_remove_table().
Let's assume first the lower and next the upper 2KB-pgtables are freed from a page. Since both halves of the page are allocated the tracking byte (bits 24-31 of the page _refcount) has value of 0x03 initially:
CPU0 CPU1
---- ----
page_table_free_rcu() // lower half
{
// _refcount[31..24] == 0x03
...
atomic_xor_bits(&page->_refcount,
0x11U << (0 + 24));
// _refcount[31..24] <= 0x12
...
table = table | (1U << 0);
tlb_remove_table(tlb, table);
}
...
__tlb_remove_table()
{
// _refcount[31..24] == 0x12
mask = _table & 3;
// mask <= 0x01
...
page_table_free() // upper half
{
// _refcount[31..24] == 0x12
...
atomic_xor_bits(
&page->_refcount,
1U << (1 + 24));
// _refcount[31..24] <= 0x10
// mask <= 0x10
...
atomic_xor_bits(&page->_refcount,
mask << (4 + 24));
// _refcount[31..24] <= 0x00
// mask <= 0x00
...
if (mask != 0) // == false
break;
fallthrough;
...
if (mask & 3) // == false
...
else
__free_page(page); list_del(&page->lru);
^^^^^^^^^^^^^^^^^^ RACE! ^^^^^^^^^^^^^^^^^^^^^
} ...
}The problem is page_table_free() releases the page as result of lower nibble unset and __tlb_remove_table() observing zero too early. With this update page_table_free() will use the similar logic as page_table_free_rcu() + __tlb_remove_table(), and mark the fragment as pending for removal in the upper nibble until after the list_del().
In other words, the parent page is considered as unreferenced and safe to release only when the lower nibble is cleared already and unsetting a bit in upper nibble results in that nibble turned zero.
--- arch/s390/mm/pgalloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/s390/mm/pgalloc.c +3 -1
@@ -256,13 +256,15 @@ void page_table_free(struct mm_struct *m/* Free 2K page table fragment of a 4K page */ bit = (__pa (table) & ~PAGE_MASK )/(PTRS_PER_PTE *sizeof (pte_t));spin_lock_bh (&mm->context.lock); - mask =atomic_xor_bits (&page->_refcount,1U << (bit +24 )); + mask =atomic_xor_bits (&page->_refcount,0x11U << (bit +24 )); mask >>=24 ;if (mask &3 )list_add (&page->lru, &mm->context.pgtable_list);else list_del (&page->lru);spin_unlock_bh (&mm->context.lock); + mask =atomic_xor_bits (&page->_refcount,0x10U << (bit +24 )); + mask >>=24 ;if (mask !=0 )return ; }else {
Greg Kroah-Hartman
maintainerPATCH 201/239 drm/etnaviv: limit submit sizes
In reply to Greg Kroah-HartmanFrom: Lucas Stach <[email protected]>
commit 6dfa2fab8ddd46faa771a102672176bee7a065de upstream.
Currently we allow rediculous amounts of kernel memory being allocated via the etnaviv GEM_SUBMIT ioctl, which is a pretty easy DoS vector. Put some reasonable limits in to fix this.
The commandstream size is limited to 64KB, which was already a soft limit on older kernels after which the kernel only took submits on a best effort base, so there is no userspace that tries to submit commandstreams larger than this. Even if the whole commandstream is a single incrementing address load, the size limit also limits the number of potential relocs and referenced buffers to slightly under 64K, so use the same limit for those arguments. The performance monitoring infrastructure currently supports less than 50 performance counter signals, so limiting them to 128 on a single submit seems like a reasonably future-proof number for now. This number can be bumped if needed without breaking the interface.
--- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +6 -0
@@ -444,6 +444,12 @@ int etnaviv_ioctl_gem_submit(struct drm_return -EINVAL ; } +if (args->stream_size >SZ_64K || args->nr_relocs >SZ_64K || + args->nr_bos >SZ_64K || args->nr_pmrs >128 ) { +DRM_ERROR ("submit arguments out of size limits\n" ); +return -EINVAL ; + } +/* * Copy the command submission and bo array to kernel space in * one go, and do this outside of any locks.
Greg Kroah-Hartman
maintainerPATCH 202/239 ext4: make sure to reset inode lockdep class when quota enabling fails
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 4013d47a5307fdb5c13370b5392498b00fedd274 upstream.
When we succeed in enabling some quota type but fail to enable another one with quota feature, we correctly disable all enabled quota types. However we forget to reset i_data_sem lockdep class. When the inode gets freed and reused, it will inherit this lockdep class (i_data_sem is initialized only when a slab is created) and thus eventually lockdep barfs about possible deadlocks.
--- fs/ext4/super.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
fs/ext4/super.c +12 -1
@@ -5883,8 +5883,19 @@ static int ext4_enable_quotas(struct sup"Failed to enable quota tracking " "(type=%d, err=%d). Please run " "e2fsck to fix.", type, err); -for (type--; type >=0 ; type--) +for (type--; type >=0 ; type--) { +struct inode *inode; + + inode =sb_dqopt (sb)->files[type]; +if (inode) + inode =igrab (inode);dquot_quota_off (sb, type); +if (inode) { +lockdep_set_quota_inode (inode, +I_DATA_SEM_NORMAL ); +iput (inode); + } + }return err; }
Greg Kroah-Hartman
maintainerPATCH 203/239 ext4: make sure quota gets properly shutdown on error
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 15fc69bbbbbc8c72e5f6cc4e1be0f51283c5448e upstream.
When we hit an error when enabling quotas and setting inode flags, we do not properly shutdown quota subsystem despite returning error from Q_QUOTAON quotactl. This can lead to some odd situations like kernel using quota file while it is still writeable for userspace. Make sure we properly cleanup the quota subsystem in case of error.
--- fs/ext4/super.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/ext4/super.c +6 -4
@@ -5797,10 +5797,7 @@ static int ext4_quota_on(struct super_bllockdep_set_quota_inode (path->dentry->d_inode,I_DATA_SEM_QUOTA ); err =dquot_quota_on (sb, type, format_id, path); -if (err) { -lockdep_set_quota_inode (path->dentry->d_inode, -I_DATA_SEM_NORMAL ); - }else { +if (!err) {struct inode *inode =d_inode (path->dentry);handle_t *handle;
@@ -5820,7 +5817,12 @@ static int ext4_quota_on(struct super_blext4_journal_stop (handle); unlock_inode:inode_unlock (inode); +if (err) +dquot_quota_off (sb, type); } +if (err) +lockdep_set_quota_inode (path->dentry->d_inode, +I_DATA_SEM_NORMAL );return err; }
Greg Kroah-Hartman
maintainerPATCH 204/239 ext4: set csum seed in tmp inode while migrating to extents
In reply to Greg Kroah-HartmanFrom: Luís Henriques <[email protected]>
commit e81c9302a6c3c008f5c30beb73b38adb0170ff2d upstream.
When migrating to extents, the temporary inode will have it's own checksum seed. This means that, when swapping the inodes data, the inode checksums will be incorrect.
This can be fixed by recalculating the extents checksums again. Or simply by copying the seed into the temporary inode.
--- fs/ext4/migrate.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
fs/ext4/migrate.c +11 -1
@@ -477,6 +477,17 @@ int ext4_ext_migrate(struct inode *inodeext4_journal_stop (handle); goto out_unlock; } +/* +* Use the correct seed for checksum (i.e. the seed from 'inode'). This +* is so that the metadata blocks will have the correct checksum after +* the migration. +* +* Note however that, if a crash occurs during the migration process, +* the recovery process is broken because the tmp_inode checksums will +* be wrong and the orphans cleanup will fail. +*/ + ei =EXT4_I (inode); +EXT4_I (tmp_inode)->i_csum_seed = ei->i_csum_seed;i_size_write (tmp_inode,i_size_read (inode));/* * Set the i_nlink to zero so it will be deleted later
@@ -520,7 +531,6 @@ int ext4_ext_migrate(struct inode *inode goto out_tmp_inode; } - ei =EXT4_I (inode); i_data = ei->i_data;memset (&lb,0 ,sizeof (lb));
Greg Kroah-Hartman
maintainerPATCH 205/239 ext4: Fix BUG_ON in ext4_bread when write quota data
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
commit 380a0091cab482489e9b19e07f2a166ad2b76d5c upstream.
We got issue as follows when run syzkaller:
[ 167.936972] EXT4-fs error (device loop0): __ext4_remount:6314: comm rep: Abort forced by user [ 167.938306] EXT4-fs (loop0): Remounting filesystem read-only [ 167.981637] Assertion failure in ext4_getblk() at fs/ext4/inode.c:847: '(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) || handle != NULL || create == 0' [ 167.983601] ------------[ cut here ]------------ [ 167.984245] kernel BUG at fs/ext4/inode.c:847! [ 167.984882] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI [ 167.985624] CPU: 7 PID: 2290 Comm: rep Tainted: G B 5.16.0-rc5-next-20211217+ #123 [ 167.986823] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc31 04/01/2014 [ 167.988590] RIP: 0010:ext4_getblk+0x17e/0x504 [ 167.989189] Code: c6 01 74 28 49 c7 c0 a0 a3 5c 9b b9 4f 03 00 00 48 c7 c2 80 9c 5c 9b 48 c7 c6 40 b6 5c 9b 48 c7 c7 20 a4 5c 9b e8 77 e3 fd ff <0f> 0b 8b 04 244 [ 167.991679] RSP: 0018:ffff8881736f7398 EFLAGS: 00010282 [ 167.992385] RAX: 0000000000000094 RBX: 1ffff1102e6dee75 RCX: 0000000000000000 [ 167.993337] RDX: 0000000000000001 RSI: ffffffff9b6e29e0 RDI: ffffed102e6dee66 [ 167.994292] RBP: ffff88816a076210 R08: 0000000000000094 R09: ffffed107363fa09 [ 167.995252] R10: ffff88839b1fd047 R11: ffffed107363fa08 R12: ffff88816a0761e8 [ 167.996205] R13: 0000000000000000 R14: 0000000000000021 R15: 0000000000000001 [ 167.997158] FS: 00007f6a1428c740(0000) GS:ffff88839b000000(0000) knlGS:0000000000000000 [ 167.998238] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 167.999025] CR2: 00007f6a140716c8 CR3: 0000000133216000 CR4: 00000000000006e0 [ 167.999987] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 168.000944] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 168.001899] Call Trace: [ 168.002235] <TASK> [ 168.007167] ext4_bread+0xd/0x53 [ 168.007612] ext4_quota_write+0x20c/0x5c0 [ 168.010457] write_blk+0x100/0x220 [ 168.010944] remove_free_dqentry+0x1c6/0x440 [ 168.011525] free_dqentry.isra.0+0x565/0x830 [ 168.012133] remove_tree+0x318/0x6d0 [ 168.014744] remove_tree+0x1eb/0x6d0 [ 168.017346] remove_tree+0x1eb/0x6d0 [ 168.019969] remove_tree+0x1eb/0x6d0 [ 168.022128] qtree_release_dquot+0x291/0x340 [ 168.023297] v2_release_dquot+0xce/0x120 [ 168.023847] dquot_release+0x197/0x3e0 [ 168.024358] ext4_release_dquot+0x22a/0x2d0 [ 168.024932] dqput.part.0+0x1c9/0x900 [ 168.025430] __dquot_drop+0x120/0x190 [ 168.025942] ext4_clear_inode+0x86/0x220 [ 168.026472] ext4_evict_inode+0x9e8/0xa22 [ 168.028200] evict+0x29e/0x4f0 [ 168.028625] dispose_list+0x102/0x1f0 [ 168.029148] evict_inodes+0x2c1/0x3e0 [ 168.030188] generic_shutdown_super+0xa4/0x3b0 [ 168.030817] kill_block_super+0x95/0xd0 [ 168.031360] deactivate_locked_super+0x85/0xd0 [ 168.031977] cleanup_mnt+0x2bc/0x480 [ 168.033062] task_work_run+0xd1/0x170 [ 168.033565] do_exit+0xa4f/0x2b50 [ 168.037155] do_group_exit+0xef/0x2d0 [ 168.037666] __x64_sys_exit_group+0x3a/0x50 [ 168.038237] do_syscall_64+0x3b/0x90 [ 168.038751] entry_SYSCALL_64_after_hwframe+0x44/0xae
In order to reproduce this problem, the following conditions need to be met:
1. Ext4 filesystem with no journal;
2. Filesystem image with incorrect quota data;
3. Abort filesystem forced by user;
4. umount filesystem;
As in ext4_quota_write:
...
if (EXT4_SB(sb)->s_journal && !handle) {
ext4_msg(sb, KERN_WARNING, "Quota write (off=%llu, len=%llu)"
" cancelled because transaction is not started",
(unsigned long long)off, (unsigned long long)len);
return -EIO;
}...
We only check handle if NULL when filesystem has journal. There is need check handle if NULL even when filesystem has no journal.
--- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
@@ -5999,7 +5999,7 @@ static ssize_t ext4_quota_write(struct sstruct buffer_head *bh;handle_t *handle =journal_current_handle (); -if (EXT4_SB (sb)->s_journal && !handle) { +if (!handle) {ext4_msg (sb,KERN_WARNING ,"Quota write (off=%llu, len=%llu)" " cancelled because transaction is not started" , (unsigned long long )off, (unsigned long long )len);
Greg Kroah-Hartman
maintainerPATCH 206/239 ext4: dont use the orphan list when migrating an inode
In reply to Greg Kroah-HartmanFrom: Theodore Ts'o <[email protected]>
commit 6eeaf88fd586f05aaf1d48cb3a139d2a5c6eb055 upstream.
We probably want to remove the indirect block to extents migration feature after a deprecation window, but until then, let's fix a potential data loss problem caused by the fact that we put the tmp_inode on the orphan list. In the unlikely case where we crash and do a journal recovery, the data blocks belonging to the inode being migrated are also represented in the tmp_inode on the orphan list --- and so its data blocks will get marked unallocated, and available for reuse.
Instead, stop putting the tmp_inode on the oprhan list. So in the case where we crash while migrating the inode, we'll leak an inode, which is not a disaster. It will be easily fixed the next time we run fsck, and it's better than potentially having blocks getting claimed by two different files, and losing data as a result.
--- fs/ext4/migrate.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
fs/ext4/migrate.c +4 -15
@@ -455,12 +455,12 @@ int ext4_ext_migrate(struct inode *inodepercpu_down_write (&sbi->s_writepages_rwsem);/* -* Worst case we can touch the allocation bitmaps, a bgd -* block, and a block to link in the orphan list. We do need -* need to worry about credits for modifying the quota inode. +* Worst case we can touch the allocation bitmaps and a block +* group descriptor block. We do need need to worry about +* credits for modifying the quota inode. */ handle =ext4_journal_start (inode,EXT4_HT_MIGRATE , -4 +EXT4_MAXQUOTAS_TRANS_BLOCKS (inode->i_sb)); +3 +EXT4_MAXQUOTAS_TRANS_BLOCKS (inode->i_sb));if (IS_ERR (handle)) { retval =PTR_ERR (handle);
@@ -481,10 +481,6 @@ int ext4_ext_migrate(struct inode *inode* Use the correct seed for checksum (i.e. the seed from 'inode'). This * is so that the metadata blocks will have the correct checksum after * the migration. -* -* Note however that, if a crash occurs during the migration process, -* the recovery process is broken because the tmp_inode checksums will -* be wrong and the orphans cleanup will fail. */ ei =EXT4_I (inode);EXT4_I (tmp_inode)->i_csum_seed = ei->i_csum_seed;
@@ -496,7 +492,6 @@ int ext4_ext_migrate(struct inode *inodeclear_nlink (tmp_inode);ext4_ext_tree_init (handle, tmp_inode); -ext4_orphan_add (handle, tmp_inode);ext4_journal_stop (handle);/*
@@ -521,12 +516,6 @@ int ext4_ext_migrate(struct inode *inode handle =ext4_journal_start (inode,EXT4_HT_MIGRATE ,1 );if (IS_ERR (handle)) { -/* -* It is impossible to update on-disk structures without -* a handle, so just rollback in-core changes and live other -* work to orphan_list_cleanup() -*/ -ext4_orphan_del (NULL , tmp_inode); retval =PTR_ERR (handle); goto out_tmp_inode; }
Greg Kroah-Hartman
maintainerPATCH 207/239 crypto: stm32/crc32 - Fix kernel BUG triggered in probe()
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
commit 29009604ad4e3ef784fd9b9fef6f23610ddf633d upstream.
The include/linux/crypto.h struct crypto_alg field cra_driver_name description states "Unique name of the transformation provider. " ... " this contains the name of the chip or provider and the name of the transformation algorithm."
In case of the stm32-crc driver, field cra_driver_name is identical for all registered transformation providers and set to the name of the driver itself, which is incorrect. This patch fixes it by assigning a unique cra_driver_name to each registered transformation provider.
The kernel crash is triggered when the driver calls crypto_register_shashes() which calls crypto_register_shash(), which calls crypto_register_alg(), which calls __crypto_register_alg(), which returns -EEXIST, which is propagated back through this call chain. Upon -EEXIST from crypto_register_shash(), the crypto_register_shashes() starts unregistering the providers back, and calls crypto_unregister_shash(), which calls crypto_unregister_alg(), and this is where the BUG() triggers due to incorrect cra_refcnt.
--- drivers/crypto/stm32/stm32_crc32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/stm32/stm32_crc32.c +2 -2
@@ -230,7 +230,7 @@ static struct shash_alg algs[] = { .digestsize = CHKSUM_DIGEST_SIZE, .base = { .cra_name = "crc32", - .cra_driver_name = DRIVER_NAME, + .cra_driver_name = "stm32-crc32-crc32", .cra_priority = 200, .cra_flags = CRYPTO_ALG_OPTIONAL_KEY, .cra_blocksize = CHKSUM_BLOCK_SIZE,
@@ -252,7 +252,7 @@ static struct shash_alg algs[] = { .digestsize = CHKSUM_DIGEST_SIZE, .base = { .cra_name = "crc32c", - .cra_driver_name = DRIVER_NAME, + .cra_driver_name = "stm32-crc32-crc32c", .cra_priority = 200, .cra_flags = CRYPTO_ALG_OPTIONAL_KEY, .cra_blocksize = CHKSUM_BLOCK_SIZE,
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 208/239 ASoC: dpcm: prevent snd_soc_dpcm use after free
In reply to Greg Kroah-HartmanFrom: KaiChieh Chuang <[email protected]>
commit a9764869779081e8bf24da07ac040e8f3efcf13a upstream.
The dpcm get from fe_clients/be_clients
may be free before use
Add a spin lock at snd_soc_card level,
to protect the dpcm instance.
The lock may be used in atomic context, so use spin lock.
Use irq spin lock version,
since the lock may be used in interrupts.
possible race condition between
void dpcm_be_disconnect(
... list_del(&dpcm->list_be); list_del(&dpcm->list_fe); kfree(dpcm); ...
and
for_each_dpcm_fe() for_each_dpcm_be*()
race condition example
Thread 1:
snd_soc_dapm_mixer_update_power()
-> soc_dpcm_runtime_update()
-> dpcm_be_disconnect()
-> kfree(dpcm);
Thread 2:
dpcm_fe_dai_trigger()
-> dpcm_be_dai_trigger()
-> snd_soc_dpcm_can_be_free_stop()
-> if (dpcm->fe == fe)Excpetion Scenario:
two FE link to same BE FE1 -> BE FE2 -> Thread 1: switch of mixer between FE2 -> BE Thread 2: pcm_stop FE1
Exception:
Unable to handle kernel paging request at virtual address dead0000000000e0
pc=<> [<ffffff8960e2cd10>] dpcm_be_dai_trigger+0x29c/0x47c
sound/soc/soc-pcm.c:3226 if (dpcm->fe == fe)
lr=<> [<ffffff8960e2f694>] dpcm_fe_dai_do_trigger+0x94/0x26c
Backtrace: [<ffffff89602dba80>] notify_die+0x68/0xb8 [<ffffff896028c7dc>] die+0x118/0x2a8 [<ffffff89602a2f84>] __do_kernel_fault+0x13c/0x14c [<ffffff89602a27f4>] do_translation_fault+0x64/0xa0 [<ffffff8960280cf8>] do_mem_abort+0x4c/0xd0 [<ffffff8960282ad0>] el1_da+0x24/0x40 [<ffffff8960e2cd10>] dpcm_be_dai_trigger+0x29c/0x47c [<ffffff8960e2f694>] dpcm_fe_dai_do_trigger+0x94/0x26c [<ffffff8960e2edec>] dpcm_fe_dai_trigger+0x3c/0x44 [<ffffff8960de5588>] snd_pcm_do_stop+0x50/0x5c [<ffffff8960dded24>] snd_pcm_action+0xb4/0x13c [<ffffff8960ddfdb4>] snd_pcm_drop+0xa0/0x128 [<ffffff8960de69bc>] snd_pcm_common_ioctl+0x9d8/0x30f0 [<ffffff8960de1cac>] snd_pcm_ioctl_compat+0x29c/0x2f14 [<ffffff89604c9d60>] compat_SyS_ioctl+0x128/0x244 [<ffffff8960283740>] el0_svc_naked+0x34/0x38
[<ffffffffffffffff>] 0xffffffffffffffff
--- include/sound/soc.h | 2 ++ sound/soc/soc-core.c | 1 + sound/soc/soc-pcm.c | 40 +++++++++++++++++++++++++++++++++------- 3 files changed, 36 insertions(+), 7 deletions(-)
include/sound/soc.h +2 -0
@@ -1113,6 +1113,8 @@ struct snd_soc_card {u32 pop_time;void *drvdata; + +spinlock_t dpcm_lock; };/* SoC machine DAI configuration, glues a codec and cpu DAI together */
sound/soc/soc-core.c +1 -0
@@ -2752,6 +2752,7 @@ int snd_soc_register_card(struct snd_soc card->instantiated =0 ;mutex_init (&card->mutex);mutex_init (&card->dapm_mutex); +spin_lock_init (&card->dpcm_lock); ret =snd_soc_instantiate_card (card);if (ret !=0 )
sound/soc/soc-pcm.c +33 -7
@@ -1221,6 +1221,7 @@ static int dpcm_be_connect(struct snd_so struct snd_soc_pcm_runtime *be, int stream) {struct snd_soc_dpcm *dpcm; +unsigned long flags;/* only add new dpcms */ list_for_each_entry (dpcm, &fe->dpcm[stream].be_clients, list_be) {
@@ -1236,8 +1237,10 @@ static int dpcm_be_connect(struct snd_so dpcm->fe = fe; be->dpcm[stream].runtime = fe->dpcm[stream].runtime; dpcm->state =SND_SOC_DPCM_LINK_STATE_NEW ; +spin_lock_irqsave (&fe->card->dpcm_lock, flags);list_add (&dpcm->list_be, &fe->dpcm[stream].be_clients);list_add (&dpcm->list_fe, &be->dpcm[stream].fe_clients); +spin_unlock_irqrestore (&fe->card->dpcm_lock, flags); dev_dbg(fe->dev, "connected new DPCM %s path %s %s %s\n", stream ? "capture" : "playback", fe->dai_link->name,
@@ -1283,6 +1286,7 @@ static void dpcm_be_reparent(struct snd_void dpcm_be_disconnect (struct snd_soc_pcm_runtime *fe,int stream) {struct snd_soc_dpcm *dpcm, *d; +unsigned long flags;list_for_each_entry_safe (dpcm, d, &fe->dpcm[stream].be_clients, list_be) { dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n",
@@ -1302,8 +1306,10 @@ void dpcm_be_disconnect(struct snd_soc_p#ifdef CONFIG_DEBUG_FS debugfs_remove (dpcm->debugfs_state);#endif +spin_lock_irqsave (&fe->card->dpcm_lock, flags);list_del (&dpcm->list_be);list_del (&dpcm->list_fe); +spin_unlock_irqrestore (&fe->card->dpcm_lock, flags);kfree (dpcm); } }
@@ -1557,10 +1563,13 @@ int dpcm_process_paths(struct snd_soc_pcvoid dpcm_clear_pending_state (struct snd_soc_pcm_runtime *fe,int stream) {struct snd_soc_dpcm *dpcm; +unsigned long flags; +spin_lock_irqsave (&fe->card->dpcm_lock, flags);list_for_each_entry (dpcm, &fe->dpcm[stream].be_clients, list_be) dpcm->be->dpcm[stream].runtime_update =SND_SOC_DPCM_UPDATE_NO ; +spin_unlock_irqrestore (&fe->card->dpcm_lock, flags); } static void dpcm_be_dai_startup_unwind(struct snd_soc_pcm_runtime *fe,
@@ -2626,6 +2635,7 @@ static int dpcm_run_update_startup(strucstruct snd_soc_dpcm *dpcm;enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream];int ret; +unsigned long flags;dev_dbg (fe->dev,"ASoC: runtime %s open on FE %s\n" , stream ?"capture" :"playback" , fe->dai_link->name);
@@ -2695,11 +2705,13 @@ close:dpcm_be_dai_shutdown (fe, stream); disconnect:/* disconnect any non started BEs */ +spin_lock_irqsave (&fe->card->dpcm_lock, flags);list_for_each_entry (dpcm, &fe->dpcm[stream].be_clients, list_be) {struct snd_soc_pcm_runtime *be = dpcm->be;if (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_START ) dpcm->state =SND_SOC_DPCM_LINK_STATE_FREE ; } +spin_unlock_irqrestore (&fe->card->dpcm_lock, flags);return ret; }
@@ -3278,7 +3290,10 @@ int snd_soc_dpcm_can_be_free_stop(struct {struct snd_soc_dpcm *dpcm;int state; +int ret =1 ; +unsigned long flags; +spin_lock_irqsave (&fe->card->dpcm_lock, flags);list_for_each_entry (dpcm, &be->dpcm[stream].fe_clients, list_fe) {if (dpcm->fe == fe)
@@ -3287,12 +3302,15 @@ int snd_soc_dpcm_can_be_free_stop(struct state = dpcm->fe->dpcm[stream].state;if (state ==SND_SOC_DPCM_STATE_START || state ==SND_SOC_DPCM_STATE_PAUSED || - state ==SND_SOC_DPCM_STATE_SUSPEND ) -return 0 ; + state ==SND_SOC_DPCM_STATE_SUSPEND ) { + ret =0 ; +break ; + } } +spin_unlock_irqrestore (&fe->card->dpcm_lock, flags);/* it's safe to free/stop this BE DAI */ -return 1 ; +return ret; }EXPORT_SYMBOL_GPL (snd_soc_dpcm_can_be_free_stop);
@@ -3305,7 +3323,10 @@ int snd_soc_dpcm_can_be_params(struct sn {struct snd_soc_dpcm *dpcm;int state; +int ret =1 ; +unsigned long flags; +spin_lock_irqsave (&fe->card->dpcm_lock, flags);list_for_each_entry (dpcm, &be->dpcm[stream].fe_clients, list_fe) {if (dpcm->fe == fe)
@@ -3315,12 +3336,15 @@ int snd_soc_dpcm_can_be_params(struct snif (state ==SND_SOC_DPCM_STATE_START || state ==SND_SOC_DPCM_STATE_PAUSED || state ==SND_SOC_DPCM_STATE_SUSPEND || - state ==SND_SOC_DPCM_STATE_PREPARE ) -return 0 ; + state ==SND_SOC_DPCM_STATE_PREPARE ) { + ret =0 ; +break ; + } } +spin_unlock_irqrestore (&fe->card->dpcm_lock, flags);/* it's safe to change hw_params */ -return 1 ; +return ret; }EXPORT_SYMBOL_GPL (snd_soc_dpcm_can_be_params);
@@ -3359,6 +3383,7 @@ static ssize_t dpcm_show_state(struct snstruct snd_pcm_hw_params *params = &fe->dpcm[stream].hw_params;struct snd_soc_dpcm *dpcm;ssize_t offset =0 ; +unsigned long flags;/* FE state */ offset += scnprintf(buf + offset, size - offset,
@@ -3386,6 +3411,7 @@ static ssize_t dpcm_show_state(struct sn goto out; } +spin_lock_irqsave (&fe->card->dpcm_lock, flags);list_for_each_entry (dpcm, &fe->dpcm[stream].be_clients, list_be) {struct snd_soc_pcm_runtime *be = dpcm->be; params = &dpcm->hw_params;
@@ -3406,7 +3432,7 @@ static ssize_t dpcm_show_state(struct snparams_channels (params), params_rate(params)); } - +spin_unlock_irqrestore (&fe->card->dpcm_lock, flags); out:return offset; }
Greg Kroah-Hartman
maintainerPATCH 209/239 regulator: core: Let boot-on regulators be powered off
In reply to Greg Kroah-HartmanFrom: Pascal Paillet <[email protected]>
commit 089b3f61ecfc43ca4ea26d595e1d31ead6de3f7b upstream.
Boot-on regulators are always kept on because their use_count value is now incremented at boot time and never cleaned.
Only increment count value for alway-on regulators. regulator_late_cleanup() is now able to power off boot-on regulators when unused.
--- drivers/regulator/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/regulator/core.c +3 -1
@@ -1211,7 +1211,9 @@ static int set_machine_constraints(strucrdev_err (rdev,"failed to enable\n" );return ret; } - rdev->use_count++; + +if (rdev->constraints->always_on) + rdev->use_count++; }print_constraints (rdev);
Greg Kroah-Hartman
maintainerPATCH 210/239 drm/radeon: fix error handling in radeon_driver_open_kms
In reply to Greg Kroah-HartmanFrom: Christian König <[email protected]>
commit 4722f463896cc0ef1a6f1c3cb2e171e949831249 upstream.
The return value was never initialized so the cleanup code executed when it isn't even necessary.
Just add proper error handling.
--- drivers/gpu/drm/radeon/radeon_kms.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/gpu/drm/radeon/radeon_kms.c +12 -10
@@ -641,18 +641,18 @@ int radeon_driver_open_kms(struct drm_de fpriv =kzalloc (sizeof (*fpriv),GFP_KERNEL );if (unlikely (!fpriv)) { r = -ENOMEM ; - goto out_suspend; + goto err_suspend; }if (rdev->accel_working) { vm = &fpriv->vm; r =radeon_vm_init (rdev, vm);if (r) - goto out_fpriv; + goto err_fpriv; r =radeon_bo_reserve (rdev->ring_tmp_bo.bo, false);if (r) - goto out_vm_fini; + goto err_vm_fini;/* map the ib pool buffer read only into * virtual address space */
@@ -660,7 +660,7 @@ int radeon_driver_open_kms(struct drm_de rdev->ring_tmp_bo.bo);if (!vm->ib_bo_va) { r = -ENOMEM ; - goto out_vm_fini; + goto err_vm_fini; } r = radeon_vm_bo_set_addr(rdev, vm->ib_bo_va,
@@ -668,19 +668,21 @@ int radeon_driver_open_kms(struct drm_deRADEON_VM_PAGE_READABLE | RADEON_VM_PAGE_SNOOPED);if (r) - goto out_vm_fini; + goto err_vm_fini; } file_priv->driver_priv = fpriv; } -if (!r) - goto out_suspend; +pm_runtime_mark_last_busy (dev->dev); +pm_runtime_put_autosuspend (dev->dev); +return 0 ; -out_vm_fini: +err_vm_fini:radeon_vm_fini (rdev, vm); -out_fpriv: +err_fpriv:kfree (fpriv); -out_suspend: + +err_suspend:pm_runtime_mark_last_busy (dev->dev);pm_runtime_put_autosuspend (dev->dev);return r;
Greg Kroah-Hartman
maintainerPATCH 211/239 ARM: dts: Fix vcsi regulator to be always-on for droid4 to prevent hangs
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
commit ddb52945999dcf35787bf221b62108806182578d upstream.
In addition to using vcsi regulator for the display, looks like droid4 is using vcsi regulator to trigger off mode internally with the PMIC firmware when the SoC enters deeper idle states. This is configured in the Motorola Mapphone Linux kernel sources as "zerov_regulator".
As we currently don't support off mode during idle for omap4, we must prevent vcsi from being disabled when the display is blanked to prevent the PMIC change to off mode. Otherwise the device will hang on entering idle when the display is blanked.
Before commit 089b3f61ecfc ("regulator: core: Let boot-on regulators be powered off"), the boot-on regulators never got disabled like they should and vcsi did not get turned off on idle.
Let's fix the issue by setting vcsi to always-on for now. Later on we may want to claim the vcsi regulator also in the PM code if needed.
--- arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi +2 -2
@@ -165,12 +165,12 @@ regulator-enable-ramp-delay = <1000>; }; - /* Used by DSS */ + /* Used by DSS and is the "zerov_regulator" trigger for SoC off mode */ vcsi: VCSI { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-enable-ramp-delay = <1000>; - regulator-boot-on; + regulator-always-on; }; vdac: VDAC {
Greg Kroah-Hartman
maintainerPATCH 212/239 firmware: Update Kconfig help text for Google firmware
In reply to Greg Kroah-HartmanFrom: Ben Hutchings <[email protected]>
commit d185a3466f0cd5af8f1c5c782c53bc0e6f2e7136 upstream.
The help text for GOOGLE_FIRMWARE states that it should only be enabled when building a kernel for Google's own servers. However, many of the drivers dependent on it are also useful on Chromebooks or on any platform using coreboot.
Update the help text to reflect this double duty.
--- drivers/firmware/google/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/google/Kconfig +3 -3
@@ -2,9 +2,9 @@ menuconfig GOOGLE_FIRMWARE bool "Google Firmware Drivers" default n help - These firmware drivers are used by Google's servers. They are - only useful if you are working directly on one of their - proprietary servers. If in doubt, say "N". + These firmware drivers are used by Google servers, + Chromebooks and other devices using coreboot firmware. + If in doubt, say "N". if GOOGLE_FIRMWARE
Greg Kroah-Hartman
maintainerPATCH 213/239 media: rcar-csi2: Optimize the selection PHTW register
In reply to Greg Kroah-HartmanFrom: Suresh Udipi <[email protected]>
commit 549cc89cd09a85aaa16dc07ef3db811d5cf9bcb1 upstream.
PHTW register is selected based on default bit rate from Table[1]. for the bit rates less than or equal to 250. Currently first value of default bit rate which is greater than or equal to the caculated mbps is selected. This selection can be further improved by selecting the default bit rate which is nearest to the calculated value.
[1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.12]
--- drivers/media/platform/rcar-vin/rcar-csi2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/media/platform/rcar-vin/rcar-csi2.c +8 -1
@@ -843,10 +843,17 @@ static int rcsi2_phtw_write_mbps(struct const struct rcsi2_mbps_reg *values, u16 code) {const struct rcsi2_mbps_reg *value; +const struct rcsi2_mbps_reg *prev_value =NULL ; -for (value = values; value->mbps; value++) +for (value = values; value->mbps; value++) {if (value->mbps >= mbps)break ; + prev_value = value; + } + +if (prev_value && + ((mbps - prev_value->mbps) <= (value->mbps - mbps))) + value = prev_value;if (!value->mbps) {dev_err (priv->dev,"Unsupported PHY speed (%u Mbps)" , mbps);
Greg Kroah-Hartman
maintainerPATCH 214/239 Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization
In reply to Greg Kroah-HartmanFrom: Lukas Bulwahn <[email protected]>
commit 82ca67321f55a8d1da6ac3ed611da3c32818bb37 upstream.
The config RANDOMIZE_SLAB does not exist, the authors probably intended to refer to the config RANDOMIZE_BASE, which provides kernel address-space randomization. They probably just confused SLAB with BASE (these two four-letter words coincidentally share three common letters), as they also point out the config SLAB_FREELIST_RANDOM as further randomization within the same sentence.
Fix the reference of the config for kernel address-space randomization to the config that provides that.
--- Documentation/admin-guide/hw-vuln/spectre.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/admin-guide/hw-vuln/spectre.rst +1 -1
@@ -468,7 +468,7 @@ Spectre variant 2 before invoking any firmware code to prevent Spectre variant 2 exploits using the firmware. - Using kernel address space randomization (CONFIG_RANDOMIZE_SLAB=y + Using kernel address space randomization (CONFIG_RANDOMIZE_BASE=y and CONFIG_SLAB_FREELIST_RANDOM=y in the kernel configuration) makes attacks on the kernel generally more difficult.
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 4.19.226 release. There are 239 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-4.19.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Greg Kroah-Hartman
maintainerPATCH 215/239 RDMA/hns: Modify the mapping attribute of doorbell to device
In reply to Greg Kroah-HartmanFrom: Yixing Liu <[email protected]>
commit 39d5534b1302189c809e90641ffae8cbdc42a8fc upstream.
It is more general for ARM device drivers to use the device attribute to map PCI BAR spaces.
--- drivers/infiniband/hw/hns/hns_roce_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_main.c +1 -1
@@ -432,7 +432,7 @@ static int hns_roce_mmap(struct ib_ucontreturn -EINVAL ;if (vma->vm_pgoff ==0 ) { - vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); + vma->vm_page_prot =pgprot_device (vma->vm_page_prot);if (io_remap_pfn_range (vma, vma->vm_start,to_hr_ucontext (context)->uar.pfn,PAGE_SIZE , vma->vm_page_prot))
Greg Kroah-Hartman
maintainerPATCH 216/239 RDMA/rxe: Fix a typo in opcode name
In reply to Greg Kroah-HartmanFrom: Chengguang Xu <[email protected]>
commit 8d1cfb884e881efd69a3be4ef10772c71cb22216 upstream.
There is a redundant ']' in the name of opcode IB_OPCODE_RC_SEND_MIDDLE, so just fix it.
--- drivers/infiniband/sw/rxe/rxe_opcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_opcode.c +1 -1
@@ -137,7 +137,7 @@ struct rxe_opcode_info rxe_opcode[RXE_NU } }, [IB_OPCODE_RC_SEND_MIDDLE] = { - .name = "IB_OPCODE_RC_SEND_MIDDLE]", + .name = "IB_OPCODE_RC_SEND_MIDDLE", .mask =RXE_PAYLOAD_MASK |RXE_REQ_MASK |RXE_SEND_MASK | RXE_MIDDLE_MASK, .length = RXE_BTH_BYTES,
Greg Kroah-Hartman
maintainerPATCH 217/239 dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK
In reply to Greg Kroah-HartmanFrom: Amelie Delaunay <[email protected]>
commit e7f110889a87307fb0fed408a5dee1707796ca04 upstream.
This patch fixes STM32_MDMA_CTBR_TSEL_MASK, which is [5:0], not [7:0].
--- drivers/dma/stm32-mdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/stm32-mdma.c +1 -1
@@ -194,7 +194,7 @@#define STM32_MDMA_CTBR (x) (0x68 + 0x40 * (x))#define STM32_MDMA_CTBR_DBUS BIT(17)#define STM32_MDMA_CTBR_SBUS BIT(16) -#define STM32_MDMA_CTBR_TSEL_MASK GENMASK(7, 0) +#define STM32_MDMA_CTBR_TSEL_MASK GENMASK(5, 0)#define STM32_MDMA_CTBR_TSEL (n) STM32_MDMA_SET(n, \ STM32_MDMA_CTBR_TSEL_MASK)
Greg Kroah-Hartman
maintainerPATCH 218/239 powerpc/cell: Fix clang -Wimplicit-fallthrough warning
In reply to Greg Kroah-HartmanFrom: Anders Roxell <[email protected]>
commit e89257e28e844f5d1d39081bb901d9f1183a7705 upstream.
Clang warns:
arch/powerpc/platforms/cell/pervasive.c:81:2: error: unannotated fall-through between switch labels
case SRR1_WAKEEE:
^
arch/powerpc/platforms/cell/pervasive.c:81:2: note: insert 'break;' to avoid fall-through
case SRR1_WAKEEE:
^
break;1 error generated.
Clang is more pedantic than GCC, which does not warn when failing through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst. Add athe missing break to silence the warning.
--- arch/powerpc/platforms/cell/pervasive.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/pervasive.c +1 -0
@@ -90,6 +90,7 @@ static int cbe_system_reset_exception(stswitch (regs->msr &SRR1_WAKEMASK ) {case SRR1_WAKEDEC :set_dec (1 ); +break ;case SRR1_WAKEEE :/* * Handle these when interrupts get re-enabled and we take
Greg Kroah-Hartman
maintainerPATCH 219/239 powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
In reply to Greg Kroah-HartmanFrom: Tobias Waldekranz <[email protected]>
commit 0d375d610fa96524e2ee2b46830a46a7bfa92a9f upstream.
This block is used in (at least) T1024 and T1040, including their variants like T1023 etc.
--- arch/powerpc/boot/dts/fsl/qoriq-fman3l-0.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/boot/dts/fsl/qoriq-fman3l-0.dtsi +2 -0
@@ -79,6 +79,7 @@ fman0: fman@400000 { #size-cells = <0>; compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xfc000 0x1000>; + fsl,erratum-a009885; }; xmdio0: mdio@fd000 {
@@ -86,6 +87,7 @@ fman0: fman@400000 { #size-cells = <0>; compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; reg = <0xfd000 0x1000>; + fsl,erratum-a009885; }; };
Greg Kroah-Hartman
maintainerPATCH 220/239 net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
In reply to Greg Kroah-HartmanFrom: Tobias Waldekranz <[email protected]>
commit 3f7c239c7844d2044ed399399d97a5f1c6008e1b upstream.
As reported by sparse: In the remove path, the driver would attempt to unmap its own priv pointer - instead of the io memory that it mapped in probe.
--- drivers/net/ethernet/freescale/xgmac_mdio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/xgmac_mdio.c +2 -1
@@ -301,9 +301,10 @@ err_ioremap:static int xgmac_mdio_remove (struct platform_device *pdev) {struct mii_bus *bus =platform_get_drvdata (pdev); +struct mdio_fsl_priv *priv = bus->priv;mdiobus_unregister (bus); -iounmap (bus->priv); +iounmap (priv->mdio_base);mdiobus_free (bus);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 221/239 parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
commit d24846a4246b6e61ecbd036880a4adf61681d241 upstream.
kobject_init_and_add() takes reference even when it fails. According to the doc of kobject_init_and_add():
If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object.
Fix memory leak by calling kobject_put().
--- drivers/parisc/pdc_stable.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/parisc/pdc_stable.c +3 -1
@@ -992,8 +992,10 @@ pdcs_register_pathentries(void) entry->kobj.kset = paths_kset; err =kobject_init_and_add (&entry->kobj, &ktype_pdcspath,NULL ,"%s" , entry->name); -if (err) +if (err) { +kobject_put (&entry->kobj);return err; + }/* kobject is now registered */ write_lock (&entry->rw_lock);
Greg Kroah-Hartman
maintainerPATCH 222/239 af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 9d6d7f1cb67cdee15f1a0e85aacfb924e0e02435 upstream.
wait_for_unix_gc() reads unix_tot_inflight & gc_in_progress without synchronization.
Adds READ_ONCE()/WRITE_ONCE() and their associated comments to better document the intent.
BUG: KCSAN: data-race in unix_inflight / wait_for_unix_gc
write to 0xffffffff86e2b7c0 of 4 bytes by task 9380 on cpu 0:
unix_inflight+0x1e8/0x260 net/unix/scm.c:63 unix_attach_fds+0x10c/0x1e0 net/unix/scm.c:121 unix_scm_to_skb net/unix/af_unix.c:1674 [inline] unix_dgram_sendmsg+0x679/0x16b0 net/unix/af_unix.c:1817 unix_seqpacket_sendmsg+0xcc/0x110 net/unix/af_unix.c:2258 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2549 __do_sys_sendmmsg net/socket.c:2578 [inline] __se_sys_sendmmsg net/socket.c:2575 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae
read to 0xffffffff86e2b7c0 of 4 bytes by task 9375 on cpu 1:
wait_for_unix_gc+0x24/0x160 net/unix/garbage.c:196 unix_dgram_sendmsg+0x8e/0x16b0 net/unix/af_unix.c:1772 unix_seqpacket_sendmsg+0xcc/0x110 net/unix/af_unix.c:2258 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2549 __do_sys_sendmmsg net/socket.c:2578 [inline] __se_sys_sendmmsg net/socket.c:2575 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae
value changed: 0x00000002 -> 0x00000004
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 9375 Comm: syz-executor.1 Not tainted 5.16.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
--- net/unix/garbage.c | 14 +++++++++++--- net/unix/scm.c | 6 ++++-- 2 files changed, 15 insertions(+), 5 deletions(-)
net/unix/garbage.c +11 -3
@@ -197,8 +197,11 @@ void wait_for_unix_gc(void) {/* If number of inflight sockets is insane, * force a garbage collect right now. +* Paired with the WRITE_ONCE() in unix_inflight(), +* unix_notinflight() and gc_in_progress(). */ -if (unix_tot_inflight >UNIX_INFLIGHT_TRIGGER_GC && !gc_in_progress) +if (READ_ONCE (unix_tot_inflight) >UNIX_INFLIGHT_TRIGGER_GC && + !READ_ONCE (gc_in_progress))unix_gc ();wait_event (unix_gc_wait, gc_in_progress == false); }
@@ -218,7 +221,9 @@ void unix_gc(void)if (gc_in_progress) goto out; - gc_in_progress = true; +/* Paired with READ_ONCE() in wait_for_unix_gc(). */ +WRITE_ONCE (gc_in_progress, true); +/* First, select candidates for garbage collection. Only * in-flight sockets are considered, and from those only ones * which don't have any external reference.
@@ -304,7 +309,10 @@ void unix_gc(void)/* All candidates should have been detached by now. */ BUG_ON (!list_empty (&gc_candidates)); - gc_in_progress = false; + +/* Paired with READ_ONCE() in wait_for_unix_gc(). */ +WRITE_ONCE (gc_in_progress, false); +wake_up (&unix_gc_wait); out:
net/unix/scm.c +4 -2
@@ -56,7 +56,8 @@ void unix_inflight(struct user_struct *u }else {BUG_ON (list_empty (&u->link)); } - unix_tot_inflight++; +/* Paired with READ_ONCE() in wait_for_unix_gc() */ +WRITE_ONCE (unix_tot_inflight, unix_tot_inflight +1 ); } user->unix_inflight++;spin_unlock (&unix_gc_lock);
@@ -76,7 +77,8 @@ void unix_notinflight(struct user_structif (atomic_long_dec_and_test (&u->inflight))list_del_init (&u->link); - unix_tot_inflight--; +/* Paired with READ_ONCE() in wait_for_unix_gc() */ +WRITE_ONCE (unix_tot_inflight, unix_tot_inflight -1 ); } user->unix_inflight--;spin_unlock (&unix_gc_lock);
Greg Kroah-Hartman
maintainerPATCH 223/239 net: axienet: Wait for PhyRstCmplt after core reset
In reply to Greg Kroah-HartmanFrom: Robert Hancock <[email protected]>
commit b400c2f4f4c53c86594dd57098970d97d488bfde upstream.
When resetting the device, wait for the PhyRstCmplt bit to be set in the interrupt status register before continuing initialization, to ensure that the core is actually ready. When using an external PHY, this also ensures we do not start trying to access the PHY while it is still in reset. The PHY reset is initiated by the core reset which is triggered just above, but remains asserted for 5ms after the core is reset according to the documentation.
The MgtRdy bit could also be waited for, but unfortunately when using 7-series devices, the bit does not appear to work as documented (it seems to behave as some sort of link state indication and not just an indication the transceiver is ready) so it can't really be relied on for this purpose.
--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +10 -0
@@ -279,6 +279,16 @@ static int axienet_dma_bd_init(struct neaxienet_dma_out32 (lp,XAXIDMA_TX_CR_OFFSET , cr |XAXIDMA_CR_RUNSTOP_MASK ); +/* Wait for PhyRstCmplt bit to be set, indicating the PHY reset has finished */ + ret =read_poll_timeout (axienet_ior, value, + value &XAE_INT_PHYRSTCMPLT_MASK , +DELAY_OF_ONE_MILLISEC ,50000 , false, lp, +XAE_IS_OFFSET ); +if (ret) { +dev_err (lp->dev,"%s: timeout waiting for PhyRstCmplt\n" , __func__); +return ret; + } +return 0 ; out:axienet_dma_bd_release (ndev);
Greg Kroah-Hartman
maintainerPATCH 224/239 net: axienet: fix number of TX ring slots for available check
In reply to Greg Kroah-HartmanFrom: Robert Hancock <[email protected]>
commit aba57a823d2985a2cc8c74a2535f3a88e68d9424 upstream.
The check for the number of available TX ring slots was off by 1 since a slot is required for the skb header as well as each fragment. This could result in overwriting a TX ring slot that was still in use.
--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +2 -2
@@ -682,7 +682,7 @@ axienet_start_xmit(struct sk_buff *skb, num_frag =skb_shinfo (skb)->nr_frags; cur_p = &lp->tx_bd_v[lp->tx_bd_tail]; -if (axienet_check_tx_bd_space (lp, num_frag)) { +if (axienet_check_tx_bd_space (lp, num_frag +1 )) {if (netif_queue_stopped (ndev))return NETDEV_TX_BUSY ;
@@ -692,7 +692,7 @@ axienet_start_xmit(struct sk_buff *skb,smp_mb ();/* Space might have just been freed - check again */ -if (axienet_check_tx_bd_space (lp, num_frag)) +if (axienet_check_tx_bd_space (lp, num_frag +1 ))return NETDEV_TX_BUSY ;netif_wake_queue (ndev);
Greg Kroah-Hartman
maintainerPATCH 225/239 rtc: pxa: fix null pointer dereference
In reply to Greg Kroah-HartmanFrom: Laurence de Bruxelles <[email protected]>
commit 34127b3632b21e5c391756e724b1198eb9917981 upstream.
With the latest stable kernel versions the rtc on the PXA based Zaurus does not work, when booting I see the following kernel messages:
pxa-rtc pxa-rtc: failed to find rtc clock source pxa-rtc pxa-rtc: Unable to init SA1100 RTC sub-device
pxa-rtc: probe of pxa-rtc failed with error -2
hctosys: unable to open rtc device (rtc0)
I think this is because commit f2997775b111 ("rtc: sa1100: fix possible race condition") moved the allocation of the rtc_device struct out of sa1100_rtc_init and into sa1100_rtc_probe. This means that pxa_rtc_probe also needs to do allocation for the rtc_device struct, otherwise sa1100_rtc_init will try to dereference a null pointer. This patch adds that allocation by copying how sa1100_rtc_probe in drivers/rtc/rtc-sa1100.c does it; after the IRQs are set up a managed rtc_device is allocated.
I've tested this patch with qemu-system-arm -machine akita and with a real Zaurus SL-C1000 applied to 4.19, 5.4, and 5.10.
--- drivers/rtc/rtc-pxa.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/rtc/rtc-pxa.c +4 -0
@@ -349,6 +349,10 @@ static int __init pxa_rtc_probe(struct preturn -ENXIO ; } + sa1100_rtc->rtc =devm_rtc_allocate_device (&pdev->dev); +if (IS_ERR (sa1100_rtc->rtc)) +return PTR_ERR (sa1100_rtc->rtc); + pxa_rtc->base =devm_ioremap (dev, pxa_rtc->ress->start,resource_size (pxa_rtc->ress));if (!pxa_rtc->base) {
Greg Kroah-Hartman
maintainerPATCH 226/239 netns: add schedule point in ops_exit_list()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 2836615aa22de55b8fca5e32fe1b27a67cda625e upstream.
When under stress, cleanup_net() can have to dismantle netns in big numbers. ops_exit_list() currently calls many helpers [1] that have no schedule point, and we can end up with soft lockups, particularly on hosts with many cpus.
Even for moderate amount of netns processed by cleanup_net() this patch avoids latency spikes.
[1] Some of these helpers like fib_sync_up() and fib_sync_down_dev() are very slow because net/ipv4/fib_semantics.c uses host-wide hash tables, and ifindex is used as the only input of two hash functions. ifindexes tend to be the same for all netns (lo.ifindex==1 per instance) This will be fixed in a separate patch.
--- net/core/net_namespace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/core/net_namespace.c +3 -1
@@ -149,8 +149,10 @@ static void ops_exit_list(const struct p {struct net *net;if (ops->exit) { -list_for_each_entry (net, net_exit_list, exit_list) +list_for_each_entry (net, net_exit_list, exit_list) { ops->exit (net); +cond_resched (); + } }if (ops->exit_batch) ops->exit_batch (net_exit_list);
Greg Kroah-Hartman
maintainerPATCH 227/239 libcxgb: Dont accidentally set RTO_ONLINK in cxgb_find_route()
In reply to Greg Kroah-HartmanFrom: Guillaume Nault <[email protected]>
commit a915deaa9abe4fb3a440312c954253a6a733608e upstream.
Mask the ECN bits before calling ip_route_output_ports(). The tos variable might be passed directly from an IPv4 header, so it may have the last ECN bit set. This interferes with the route lookup process as ip_route_output_key_hash() interpretes this bit specially (to restrict the route scope).
Found by code inspection, compile tested only.
--- drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c +2 -1
@@ -32,6 +32,7 @@#include <linux/tcp.h> #include <linux/ipv6.h> +#include <net/inet_ecn.h> #include <net/route.h> #include <net/ip6_route.h>
@@ -99,7 +100,7 @@ cxgb_find_route(struct cxgb4_lld_info *l rt =ip_route_output_ports (&init_net, &fl4,NULL , peer_ip, local_ip, peer_port, local_port,IPPROTO_TCP , - tos,0 ); + tos & ~INET_ECN_MASK ,0 );if (IS_ERR (rt))return NULL ; n =dst_neigh_lookup (&rt->dst, &peer_ip);
Greg Kroah-Hartman
maintainerPATCH 228/239 dmaengine: at_xdmac: Dont start transactions at tx_submit level
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit bccfb96b59179d4f96cbbd1ddff8fac6d335eae4 upstream.
tx_submit is supposed to push the current transaction descriptor to a pending queue, waiting for issue_pending() to be called. issue_pending() must start the transfer, not tx_submit(), thus remove at_xdmac_start_xfer() from at_xdmac_tx_submit(). Clients of at_xdmac that assume that tx_submit() starts the transfer must be updated and call dma_async_issue_pending() if they miss to call it (one example is atmel_serial).
As the at_xdmac_start_xfer() is now called only from at_xdmac_advance_work() when !at_xdmac_chan_is_enabled(), the at_xdmac_chan_is_enabled() check is no longer needed in at_xdmac_start_xfer(), thus remove it.
--- drivers/dma/at_xdmac.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/dma/at_xdmac.c +0 -6
@@ -344,9 +344,6 @@ static void at_xdmac_start_xfer(struct adev_vdbg (chan2dev (&atchan->chan),"%s: desc 0x%p\n" , __func__, first); -if (at_xdmac_chan_is_enabled (atchan)) -return ; -/* Set transfer as active to not try to start it again. */ first->active_xfer = true;
@@ -430,9 +427,6 @@ static dma_cookie_t at_xdmac_tx_submit(sdev_vdbg (chan2dev (tx->chan),"%s: atchan 0x%p, add desc 0x%p to xfers_list\n" , __func__, atchan, desc);list_add_tail (&desc->xfer_node, &atchan->xfers_list); -if (list_is_singular (&atchan->xfers_list)) -at_xdmac_start_xfer (atchan, desc); -spin_unlock_irqrestore (&atchan->lock, irqflags);return cookie; }
Greg Kroah-Hartman
maintainerPATCH 229/239 dmaengine: at_xdmac: Print debug message after realeasing the lock
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit 5edc24ac876a928f36f407a0fcdb33b94a3a210f upstream.
It is desirable to do the prints without the lock held if possible, so move the print after the lock is released.
--- drivers/dma/at_xdmac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/dma/at_xdmac.c +4 -2
@@ -424,10 +424,12 @@ static dma_cookie_t at_xdmac_tx_submit(sspin_lock_irqsave (&atchan->lock, irqflags); cookie =dma_cookie_assign (tx); -dev_vdbg (chan2dev (tx->chan),"%s: atchan 0x%p, add desc 0x%p to xfers_list\n" , - __func__, atchan, desc);list_add_tail (&desc->xfer_node, &atchan->xfers_list);spin_unlock_irqrestore (&atchan->lock, irqflags); + +dev_vdbg (chan2dev (tx->chan),"%s: atchan 0x%p, add desc 0x%p to xfers_list\n" , + __func__, atchan, desc); +return cookie; }
Greg Kroah-Hartman
maintainerPATCH 230/239 dmaengine: at_xdmac: Fix lld view setting
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit 1385eb4d14d447cc5d744bc2ac34f43be66c9963 upstream.
AT_XDMAC_CNDC_NDVIEW_NDV3 was set even for AT_XDMAC_MBR_UBC_NDV2, because of the wrong bit handling. Fix it.
--- drivers/dma/at_xdmac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/at_xdmac.c +3 -1
@@ -100,6 +100,7 @@#define AT_XDMAC_CNDC_NDE (0x1 << 0)/* Channel x Next Descriptor Enable */ #define AT_XDMAC_CNDC_NDSUP (0x1 << 1)/* Channel x Next Descriptor Source Update */ #define AT_XDMAC_CNDC_NDDUP (0x1 << 2)/* Channel x Next Descriptor Destination Update */ +#define AT_XDMAC_CNDC_NDVIEW_MASK GENMASK(28, 27)#define AT_XDMAC_CNDC_NDVIEW_NDV0 (0x0 << 3)/* Channel x Next Descriptor View 0 */ #define AT_XDMAC_CNDC_NDVIEW_NDV1 (0x1 << 3)/* Channel x Next Descriptor View 1 */ #define AT_XDMAC_CNDC_NDVIEW_NDV2 (0x2 << 3)/* Channel x Next Descriptor View 2 */
@@ -359,7 +360,8 @@ static void at_xdmac_start_xfer(struct a*/ if (at_xdmac_chan_is_cyclic (atchan)) reg =AT_XDMAC_CNDC_NDVIEW_NDV1 ; -else if (first->lld.mbr_ubc &AT_XDMAC_MBR_UBC_NDV3 ) +else if ((first->lld.mbr_ubc & +AT_XDMAC_CNDC_NDVIEW_MASK ) ==AT_XDMAC_MBR_UBC_NDV3 ) reg =AT_XDMAC_CNDC_NDVIEW_NDV3 ;else reg =AT_XDMAC_CNDC_NDVIEW_NDV2 ;
Greg Kroah-Hartman
maintainerPATCH 231/239 dmaengine: at_xdmac: Fix at_xdmac_lld struct definition
In reply to Greg Kroah-HartmanFrom: Tudor Ambarus <[email protected]>
commit 912f7c6f7fac273f40e621447cf17d14b50d6e5b upstream.
The hardware channel next descriptor view structure contains just fields of 32 bits, while dma_addr_t can be of type u64 or u32 depending on CONFIG_ARCH_DMA_ADDR_T_64BIT. Force u32 to comply with what the hardware expects.
--- drivers/dma/at_xdmac.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/dma/at_xdmac.c +9 -9
@@ -232,15 +232,15 @@ struct at_xdmac {/* Linked List Descriptor */ struct at_xdmac_lld { -dma_addr_t mbr_nda;/* Next Descriptor Member */ -u32 mbr_ubc;/* Microblock Control Member */ -dma_addr_t mbr_sa;/* Source Address Member */ -dma_addr_t mbr_da;/* Destination Address Member */ -u32 mbr_cfg;/* Configuration Register */ -u32 mbr_bc;/* Block Control Register */ -u32 mbr_ds;/* Data Stride Register */ -u32 mbr_sus;/* Source Microblock Stride Register */ -u32 mbr_dus;/* Destination Microblock Stride Register */ +u32 mbr_nda;/* Next Descriptor Member */ +u32 mbr_ubc;/* Microblock Control Member */ +u32 mbr_sa;/* Source Address Member */ +u32 mbr_da;/* Destination Address Member */ +u32 mbr_cfg;/* Configuration Register */ +u32 mbr_bc;/* Block Control Register */ +u32 mbr_ds;/* Data Stride Register */ +u32 mbr_sus;/* Source Microblock Stride Register */ +u32 mbr_dus;/* Destination Microblock Stride Register */ };/* 64-bit alignment needed to update CNDA and CUBC registers in an atomic way. */
Greg Kroah-Hartman
maintainerPATCH 232/239 net_sched: restore "mpu xxx" handling
In reply to Greg Kroah-HartmanFrom: Kevin Bracey <[email protected]>
commit fb80445c438c78b40b547d12b8d56596ce4ccfeb upstream.
commit 56b765b79e9a ("htb: improved accuracy at high rates") broke "overhead X", "linklayer atm" and "mpu X" attributes.
"overhead X" and "linklayer atm" have already been fixed. This restores the "mpu X" handling, as might be used by DOCSIS or Ethernet shaping:
tc class add ... htb rate X overhead 4 mpu 64
The code being fixed is used by htb, tbf and act_police. Cake has its own mpu handling. qdisc_calculate_pkt_len still uses the size table containing values adjusted for mpu by user space.
iproute2 tc has always passed mpu into the kernel via a tc_ratespec structure, but the kernel never directly acted on it, merely stored it so that it could be read back by tc class show.
Rather, tc would generate length-to-time tables that included the mpu (and linklayer) in their construction, and the kernel used those tables.
Since v3.7, the tables were no longer used. Along with "mpu", this also broke "overhead" and "linklayer" which were fixed in 01cb71d2d47b ("net_sched: restore "overhead xxx" handling", v3.10) and 8a8e3d84b171 ("net_sched: restore "linklayer atm" handling", v3.11).
"overhead" was fixed by simply restoring use of tc_ratespec::overhead - this had originally been used by the kernel but was initially omitted from the new non-table-based calculations.
"linklayer" had been handled in the table like "mpu", but the mode was not originally passed in tc_ratespec. The new implementation was made to handle it by getting new versions of tc to pass the mode in an extended tc_ratespec, and for older versions of tc the table contents were analysed at load time to deduce linklayer.
As "mpu" has always been given to the kernel in tc_ratespec, accompanying the mpu-based table, we can restore system functionality with no userspace change by making the kernel act on the tc_ratespec value.
--- include/net/sch_generic.h | 5 +++++ net/sched/sch_generic.c | 1 + 2 files changed, 6 insertions(+)
include/net/sch_generic.h +5 -0
@@ -1077,6 +1077,7 @@ struct psched_ratecfg {u64 rate_bytes_ps;/* bytes per second */ u32 mult;u16 overhead; +u16 mpu;u8 linklayer;u8 shift; };
@@ -1086,6 +1087,9 @@ static inline u64 psched_l2t_ns(const st { len += r->overhead; +if (len < r->mpu) + len = r->mpu; +if (unlikely (r->linklayer ==TC_LINKLAYER_ATM ))return ((u64)(DIV_ROUND_UP (len,48 )*53 ) * r->mult) >> r->shift;
@@ -1108,6 +1112,7 @@ static inline void psched_ratecfg_getrat res->rate =min_t (u64, r->rate_bytes_ps, ~0U ); res->overhead = r->overhead; + res->mpu = r->mpu; res->linklayer = (r->linklayer &TC_LINKLAYER_MASK ); }
net/sched/sch_generic.c +1 -0
@@ -1367,6 +1367,7 @@ void psched_ratecfg_precompute(struct ps {memset (r,0 ,sizeof (*r)); r->overhead = conf->overhead; + r->mpu = conf->mpu; r->rate_bytes_ps =max_t (u64, conf->rate, rate64); r->linklayer = (conf->linklayer &TC_LINKLAYER_MASK ); r->mult =1 ;
Greg Kroah-Hartman
maintainerPATCH 233/239 bcmgenet: add WOL IRQ check
In reply to Greg Kroah-HartmanFrom: Sergey Shtylyov <[email protected]>
commit 9deb48b53e7f4056c2eaa2dc2ee3338df619e4f6 upstream.
The driver neglects to check the result of platform_get_irq_optional()'s call and blithely passes the negative error codes to devm_request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL. Stop calling devm_request_irq() with the invalid IRQ #s.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +6 -4
@@ -3516,10 +3516,12 @@ static int bcmgenet_probe(struct platfor/* Request the WOL interrupt and advertise suspend if available */ priv->wol_irq_disabled = true; - err =devm_request_irq (&pdev->dev, priv->wol_irq, bcmgenet_wol_isr,0 , - dev->name, priv); -if (!err) -device_set_wakeup_capable (&pdev->dev,1 ); +if (priv->wol_irq >0 ) { + err =devm_request_irq (&pdev->dev, priv->wol_irq, + bcmgenet_wol_isr,0 , dev->name, priv); +if (!err) +device_set_wakeup_capable (&pdev->dev,1 ); + }/* Set the needed headroom to account for any possible * features enabling/disabling at runtime
Greg Kroah-Hartman
maintainerPATCH 234/239 scripts/dtc: dtx_diff: remove broken example from help text
In reply to Greg Kroah-HartmanFrom: Matthias Schiffer <[email protected]>
commit d8adf5b92a9d2205620874d498c39923ecea8749 upstream.
dtx_diff suggests to use <(...) syntax to pipe two inputs into it, but this has never worked: The /proc/self/fds/... paths passed by the shell will fail the [ -f "${dtx}" ] && [ -r "${dtx}" ] check in compile_to_dts, but even with this check removed, the function cannot work: hexdump will eat up the DTB magic, making the subsequent dtc call fail, as a pipe cannot be rewound.
Simply remove this broken example, as there is already an alternative one that works fine.
--- scripts/dtc/dtx_diff | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
scripts/dtc/dtx_diff +2 -6
@@ -56,12 +56,8 @@ Otherwise DTx is treated as a dts source or '/include/' to be processed. If DTx_1 and DTx_2 are in different architectures, then this script - may not work since \${ARCH} is part of the include path. Two possible - workarounds: - - `basename $0` \\ - <(ARCH=arch_of_dtx_1 `basename $0` DTx_1) \\ - <(ARCH=arch_of_dtx_2 `basename $0` DTx_2) + may not work since \${ARCH} is part of the include path. The following + workaround can be used: `basename $0` ARCH=arch_of_dtx_1 DTx_1 >tmp_dtx_1.dts `basename $0` ARCH=arch_of_dtx_2 DTx_2 >tmp_dtx_2.dts
Greg Kroah-Hartman
maintainerPATCH 235/239 lib82596: Fix IRQ check in sni_82596_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
commit 99218cbf81bf21355a3de61cd46a706d36e900e6 upstream.
platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example:
int irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;Fix the check of return value to catch errors correctly.
--- drivers/net/ethernet/i825xx/sni_82596.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/i825xx/sni_82596.c +2 -1
@@ -122,9 +122,10 @@ static int sni_82596_probe(struct platfo netdevice->dev_addr[5 ] =readb (eth_addr +0x06 );iounmap (eth_addr); -if (!netdevice->irq) { +if (netdevice->irq <0 ) {printk (KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n" , __FILE__, netdevice->base_addr); + retval = netdevice->irq; goto probe_failed; }
Greg Kroah-Hartman
maintainerPATCH 236/239 mtd: nand: bbt: Fix corner case in bad block table handling
In reply to Greg Kroah-HartmanFrom: Doyle, Patrick <[email protected]>
commit fd0d8d85f7230052e638a56d1bfea170c488e6bc upstream.
In the unlikely event that both blocks 10 and 11 are marked as bad (on a 32 bit machine), then the process of marking block 10 as bad stomps on cached entry for block 11. There are (of course) other examples.
--- drivers/mtd/nand/bbt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/bbt.c +1 -1
@@ -123,7 +123,7 @@ int nanddev_bbt_set_block_status(structunsigned int rbits = bits_per_block + offs -BITS_PER_LONG ; pos[1 ] &= ~GENMASK (rbits -1 ,0 ); - pos[1 ] |= val >> rbits; + pos[1 ] |= val >> (bits_per_block - rbits); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 237/239 mips,s390,sh,sparc: gup: Work around the "COW can break either way" issue
In reply to Greg Kroah-HartmanFrom: Ben Hutchings <[email protected]>
In Linux 4.14 and 4.19 these architectures still have their own implementations of get_user_pages_fast(). These also need to force the write flag on when taking the fast path.
--- arch/mips/mm/gup.c | 9 ++++++++- arch/s390/mm/gup.c | 9 ++++++++- arch/sh/mm/gup.c | 9 ++++++++- arch/sparc/mm/gup.c | 9 ++++++++- 4 files changed, 32 insertions(+), 4 deletions(-)
arch/mips/mm/gup.c +8 -1
@@ -274,7 +274,14 @@ int get_user_pages_fast(unsigned long st next =pgd_addr_end (addr, end);if (pgd_none (pgd)) goto slow; -if (!gup_pud_range (pgd, addr, next, write, pages, &nr)) +/* +* The FAST_GUP case requires FOLL_WRITE even for pure reads, +* because get_user_pages() may need to cause an early COW in +* order to avoid confusing the normal COW routines. So only +* targets that are already writable are safe to do by just +* looking at the page tables. +*/ +if (!gup_pud_range (pgd, addr, next,1 , pages, &nr)) goto slow; }while (pgdp++, addr = next, addr != end);local_irq_enable ();
arch/s390/mm/gup.c +8 -1
@@ -287,7 +287,14 @@ int get_user_pages_fast(unsigned long stmight_sleep (); start &=PAGE_MASK ; - nr =__get_user_pages_fast (start, nr_pages, write, pages); +/* +* The FAST_GUP case requires FOLL_WRITE even for pure reads, +* because get_user_pages() may need to cause an early COW in +* order to avoid confusing the normal COW routines. So only +* targets that are already writable are safe to do by just +* looking at the page tables. +*/ + nr =__get_user_pages_fast (start, nr_pages,1 , pages);if (nr == nr_pages)return nr;
arch/sh/mm/gup.c +8 -1
@@ -242,7 +242,14 @@ int get_user_pages_fast(unsigned long st next =pgd_addr_end (addr, end);if (pgd_none (pgd)) goto slow; -if (!gup_pud_range (pgd, addr, next, write, pages, &nr)) +/* +* The FAST_GUP case requires FOLL_WRITE even for pure reads, +* because get_user_pages() may need to cause an early COW in +* order to avoid confusing the normal COW routines. So only +* targets that are already writable are safe to do by just +* looking at the page tables. +*/ +if (!gup_pud_range (pgd, addr, next,1 , pages, &nr)) goto slow; }while (pgdp++, addr = next, addr != end);local_irq_enable ();
arch/sparc/mm/gup.c +8 -1
@@ -303,7 +303,14 @@ int get_user_pages_fast(unsigned long st next =pgd_addr_end (addr, end);if (pgd_none (pgd)) goto slow; -if (!gup_pud_range (pgd, addr, next, write, pages, &nr)) +/* +* The FAST_GUP case requires FOLL_WRITE even for pure reads, +* because get_user_pages() may need to cause an early COW in +* order to avoid confusing the normal COW routines. So only +* targets that are already writable are safe to do by just +* looking at the page tables. +*/ +if (!gup_pud_range (pgd, addr, next,1 , pages, &nr)) goto slow; }while (pgdp++, addr = next, addr != end);
Greg Kroah-Hartman
maintainerPATCH 238/239 fuse: fix bad inode
In reply to Greg Kroah-HartmanFrom: Miklos Szeredi <[email protected]>
commit 5d069dbe8aaf2a197142558b6fb2978189ba3454 upstream.
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches dnotify mark to the open directory. After that a fuse_do_getattr() call finds that attributes returned by the server are inconsistent, and calls make_bad_inode() which, among other things does:
inode->i_mode = S_IFREG;
This then confuses dnotify which doesn't tear down its structures properly and eventually crashes.
Avoid calling make_bad_inode() on a live inode: switch to a private flag on the fuse inode. Also add the test to ops which the bad_inode_ops would have caught.
This bug goes back to the initial merge of fuse in 2.6.14...
[bwh: Backported to 4.19:
- Drop changes in fuse_dir_fsync(), fuse_readahead(), fuse_evict_inode()
- In fuse_get_link(), return ERR_PTR(-EIO) for bad inodes
- Convert some additional calls to is_bad_inode()
- Adjust filename, context]
--- fs/fuse/acl.c | 6 ++++++ fs/fuse/dir.c | 40 +++++++++++++++++++++++++++++++++++----- fs/fuse/file.c | 27 ++++++++++++++++++--------- fs/fuse/fuse_i.h | 12 ++++++++++++ fs/fuse/inode.c | 2 +- fs/fuse/xattr.c | 9 +++++++++ 6 files changed, 81 insertions(+), 15 deletions(-)
fs/fuse/acl.c +6 -0
@@ -19,6 +19,9 @@ struct posix_acl *fuse_get_acl(struct invoid *value =NULL ;struct posix_acl *acl; +if (fuse_is_bad (inode)) +return ERR_PTR (-EIO ); +if (!fc->posix_acl || fc->no_getxattr)return NULL ;
@@ -53,6 +56,9 @@ int fuse_set_acl(struct inode *inode, stconst char *name;int ret; +if (fuse_is_bad (inode)) +return -EIO ; +if (!fc->posix_acl || fc->no_setxattr)return -EOPNOTSUPP ;
fs/fuse/dir.c +35 -5
@@ -187,7 +187,7 @@ static int fuse_dentry_revalidate(structint ret; inode =d_inode_rcu (entry); -if (inode &&is_bad_inode (inode)) +if (inode &&fuse_is_bad (inode)) goto invalid;else if (time_before64 (fuse_dentry_time (entry),get_jiffies_64 ()) || (flags &LOOKUP_REVAL )) {
@@ -364,6 +364,9 @@ static struct dentry *fuse_lookup(structbool outarg_valid = true;bool locked; +if (fuse_is_bad (dir)) +return ERR_PTR (-EIO ); + locked =fuse_lock_inode (dir); err =fuse_lookup_name (dir->i_sb,get_node_id (dir), &entry->d_name, &outarg, &inode);
@@ -504,6 +507,9 @@ static int fuse_atomic_open(struct inodestruct fuse_conn *fc =get_fuse_conn (dir);struct dentry *res =NULL ; +if (fuse_is_bad (dir)) +return -EIO ; +if (d_in_lookup (entry)) { res =fuse_lookup (dir, entry,0 );if (IS_ERR (res))
@@ -552,6 +558,9 @@ static int create_new_entry(struct fuse_int err;struct fuse_forget_link *forget; +if (fuse_is_bad (dir)) +return -EIO ; + forget =fuse_alloc_forget ();if (!forget)return -ENOMEM ;
@@ -679,6 +688,9 @@ static int fuse_unlink(struct inode *dirstruct fuse_conn *fc =get_fuse_conn (dir);FUSE_ARGS (args); +if (fuse_is_bad (dir)) +return -EIO ; + args.in.h.opcode =FUSE_UNLINK ; args.in.h.nodeid =get_node_id (dir); args.in.numargs =1 ;
@@ -715,6 +727,9 @@ static int fuse_rmdir(struct inode *dir,struct fuse_conn *fc =get_fuse_conn (dir);FUSE_ARGS (args); +if (fuse_is_bad (dir)) +return -EIO ; + args.in.h.opcode =FUSE_RMDIR ; args.in.h.nodeid =get_node_id (dir); args.in.numargs =1 ;
@@ -793,6 +808,9 @@ static int fuse_rename2(struct inode *olstruct fuse_conn *fc =get_fuse_conn (olddir);int err; +if (fuse_is_bad (olddir)) +return -EIO ; +if (flags & ~(RENAME_NOREPLACE |RENAME_EXCHANGE ))return -EINVAL ;
@@ -928,7 +946,7 @@ static int fuse_do_getattr(struct inodeif (!err) {if (fuse_invalid_attr (&outarg.attr) || (inode->i_mode ^ outarg.attr.mode) &S_IFMT ) { -make_bad_inode (inode); +fuse_make_bad (inode); err = -EIO ; }else { fuse_change_attributes(inode, &outarg.attr,
@@ -1125,6 +1143,9 @@ static int fuse_permission(struct inodebool refreshed = false;int err =0 ; +if (fuse_is_bad (inode)) +return -EIO ; +if (!fuse_allow_current_process (fc))return -EACCES ;
@@ -1262,7 +1283,7 @@ retry:dput (dentry); goto retry; } -if (is_bad_inode (inode)) { +if (fuse_is_bad (inode)) {dput (dentry);return -EIO ; }
@@ -1360,7 +1381,7 @@ static int fuse_readdir(struct file *filu64 attr_version =0 ;bool locked; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode))return -EIO ; req =fuse_get_req (fc,1 );
@@ -1420,6 +1441,9 @@ static const char *fuse_get_link(structif (!dentry)return ERR_PTR (-ECHILD ); +if (fuse_is_bad (inode)) +return ERR_PTR (-EIO ); + link =kmalloc (PAGE_SIZE ,GFP_KERNEL );if (!link)return ERR_PTR (-ENOMEM );
@@ -1718,7 +1742,7 @@ int fuse_do_setattr(struct dentry *dentrif (fuse_invalid_attr (&outarg.attr) || (inode->i_mode ^ outarg.attr.mode) &S_IFMT ) { -make_bad_inode (inode); +fuse_make_bad (inode); err = -EIO ; goto error; }
@@ -1774,6 +1798,9 @@ static int fuse_setattr(struct dentry *estruct file *file = (attr->ia_valid &ATTR_FILE ) ? attr->ia_file :NULL ;int ret; +if (fuse_is_bad (inode)) +return -EIO ; +if (!fuse_allow_current_process (get_fuse_conn (inode)))return -EACCES ;
@@ -1832,6 +1859,9 @@ static int fuse_getattr(const struct patstruct inode *inode =d_inode (path->dentry);struct fuse_conn *fc =get_fuse_conn (inode); +if (fuse_is_bad (inode)) +return -EIO ; +if (!fuse_allow_current_process (fc))return -EACCES ;
fs/fuse/file.c +18 -9
@@ -210,6 +210,9 @@ int fuse_open_common(struct inode *inode fc->atomic_o_trunc && fc->writeback_cache; +if (fuse_is_bad (inode)) +return -EIO ; + err =generic_file_open (inode, file);if (err)return err;
@@ -411,7 +414,7 @@ static int fuse_flush(struct file *file,struct fuse_flush_in inarg;int err; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode))return -EIO ;if (fc->no_flush)
@@ -459,7 +462,7 @@ int fuse_fsync_common(struct file *file,struct fuse_fsync_in inarg;int err; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode))return -EIO ;inode_lock (inode);
@@ -774,7 +777,7 @@ static int fuse_readpage(struct file *fiint err; err = -EIO ; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode)) goto out; err =fuse_do_readpage (file, page);
@@ -901,7 +904,7 @@ static int fuse_readpages(struct file *fint nr_alloc =min_t (unsigned, nr_pages,FUSE_MAX_PAGES_PER_REQ ); err = -EIO ; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode)) goto out; data.file = file;
@@ -931,6 +934,9 @@ static ssize_t fuse_file_read_iter(strucstruct inode *inode = iocb->ki_filp->f_mapping->host;struct fuse_conn *fc =get_fuse_conn (inode); +if (fuse_is_bad (inode)) +return -EIO ; +/* * In auto invalidate mode, always update attributes on read. * Otherwise, only update if we attempt to read past EOF (to ensure
@@ -1131,7 +1137,7 @@ static ssize_t fuse_perform_write(structint err =0 ;ssize_t res =0 ; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode))return -EIO ;if (inode->i_size < pos +iov_iter_count (ii))
@@ -1188,6 +1194,9 @@ static ssize_t fuse_file_write_iter(strussize_t err;loff_t endbyte =0 ; +if (fuse_is_bad (inode)) +return -EIO ; +if (get_fuse_conn (inode)->writeback_cache) {/* Update size (EOF optimization) and mode (SUID clearing) */ err =fuse_update_attributes (mapping->host, file);
@@ -1424,7 +1433,7 @@ static ssize_t __fuse_direct_read(structssize_t res;struct inode *inode =file_inode (io->iocb->ki_filp); -if (is_bad_inode (inode)) +if (fuse_is_bad (inode))return -EIO ; res =fuse_direct_io (io, iter, ppos,0 );
@@ -1446,7 +1455,7 @@ static ssize_t fuse_direct_write_iter(ststruct fuse_io_priv io =FUSE_IO_PRIV_SYNC (iocb);ssize_t res; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode))return -EIO ;/* Don't allow parallel writes to the same file */
@@ -1920,7 +1929,7 @@ static int fuse_writepages(struct addresint err; err = -EIO ; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode)) goto out; data.inode = inode;
@@ -2705,7 +2714,7 @@ long fuse_ioctl_common(struct file *fileif (!fuse_allow_current_process (fc))return -EACCES ; -if (is_bad_inode (inode)) +if (fuse_is_bad (inode))return -EIO ;return fuse_do_ioctl (file, cmd, arg, flags);
fs/fuse/fuse_i.h +12 -0
@@ -118,6 +118,8 @@ enum {FUSE_I_INIT_RDPLUS ,/** An operation changing file size is in progress */ FUSE_I_SIZE_UNSTABLE , +/* Bad inode */ + FUSE_I_BAD, };struct fuse_conn ;
@@ -700,6 +702,16 @@ static inline u64 get_node_id(struct inoreturn get_fuse_inode (inode)->nodeid; } +static inline void fuse_make_bad (struct inode *inode) +{ +set_bit (FUSE_I_BAD , &get_fuse_inode (inode)->state); +} + +static inline bool fuse_is_bad (struct inode *inode) +{ +return unlikely (test_bit (FUSE_I_BAD , &get_fuse_inode (inode)->state)); +} +/** Device operations */ extern const struct file_operations fuse_dev_operations;
fs/fuse/inode.c +1 -1
@@ -317,7 +317,7 @@ struct inode *fuse_iget(struct super_blounlock_new_inode (inode); }else if ((inode->i_mode ^ attr->mode) &S_IFMT ) {/* Inode has changed type, any I/O on the old should fail */ -make_bad_inode (inode); +fuse_make_bad (inode);iput (inode); goto retry; }
fs/fuse/xattr.c +9 -0
@@ -113,6 +113,9 @@ ssize_t fuse_listxattr(struct dentry *enstruct fuse_getxattr_out outarg;ssize_t ret; +if (fuse_is_bad (inode)) +return -EIO ; +if (!fuse_allow_current_process (fc))return -EACCES ;
@@ -178,6 +181,9 @@ static int fuse_xattr_get(const struct x struct dentry *dentry, struct inode *inode, const char *name, void *value, size_t size) { + if (fuse_is_bad(inode)) + return -EIO; +return fuse_getxattr (inode, name, value, size); }
@@ -186,6 +192,9 @@ static int fuse_xattr_set(const struct x const char *name, const void *value, size_t size, int flags) { + if (fuse_is_bad(inode)) + return -EIO; +if (!value)return fuse_removexattr (inode, name);
Greg Kroah-Hartman
maintainerPATCH 239/239 fuse: fix live lock in fuse_iget()
In reply to Greg Kroah-HartmanFrom: Amir Goldstein <[email protected]>
commit 775c5033a0d164622d9d10dd0f0a5531639ed3ed upstream.
Commit 5d069dbe8aaf ("fuse: fix bad inode") replaced make_bad_inode() in fuse_iget() with a private implementation fuse_make_bad().
The private implementation fails to remove the bad inode from inode cache, so the retry loop with iget5_locked() finds the same bad inode and marks it bad forever.
kmsg snip:
[ ] rcu: INFO: rcu_sched self-detected stall on CPU
...
[ ] ? bit_wait_io+0x50/0x50 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ? find_inode.isra.32+0x60/0xb0 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ilookup5_nowait+0x65/0x90 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ilookup5.part.36+0x2e/0x80 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ? fuse_inode_eq+0x20/0x20 [ ] iget5_locked+0x21/0x80 [ ] ? fuse_inode_eq+0x20/0x20 [ ] fuse_iget+0x96/0x1b0
--- fs/fuse/fuse_i.h | 1 + 1 file changed, 1 insertion(+)
fs/fuse/fuse_i.h +1 -0
@@ -704,6 +704,7 @@ static inline u64 get_node_id(struct inostatic inline void fuse_make_bad (struct inode *inode) { +remove_inode_hash (inode);set_bit (FUSE_I_BAD , &get_fuse_inode (inode)->state); }
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.226 release. There are 239 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Jan 2022 18:39:11 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.226 release. There are 239 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Jan 2022 18:39:11 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 4.19.226-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-4.19.y
* git commit: ebabcfeda281e1c6226b219845d71930c729dae0
* git describe: v4.19.225-240-gebabcfeda281
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-4.19.y/build/v4.19.225-240-gebabcfeda281
## Test Regressions (compared to v4.19.225-213-gad801d4f7db5) No test regressions found.
## Metric Regressions (compared to v4.19.225-213-gad801d4f7db5) No metric regressions found.
## Test Fixes (compared to v4.19.225-213-gad801d4f7db5) No test fixes found.
## Metric Fixes (compared to v4.19.225-213-gad801d4f7db5) No metric fixes found.
## Test result summary
total: 85753, pass: 69950, fail: 717, skip: 13259, xfail: 1827
## Build Summary
* arm: 250 total, 246 passed, 4 failed
* arm64: 35 total, 35 passed, 0 failed
* dragonboard-410c: 1 total, 1 passed, 0 failed
* hi6220-hikey: 1 total, 1 passed, 0 failed
* i386: 19 total, 19 passed, 0 failed
* juno-r2: 1 total, 1 passed, 0 failed
* mips: 26 total, 26 passed, 0 failed
* powerpc: 52 total, 48 passed, 4 failed
* s390: 12 total, 12 passed, 0 failed
* sparc: 12 total, 12 passed, 0 failed
* x15: 1 total, 1 passed, 0 failed
* x86: 1 total, 1 passed, 0 failed
* x86_64: 34 total, 34 passed, 0 failed
## Test suites summary
* fwts
* kselftest-android
* kselftest-arm64
* kselftest-arm64/arm64.btitest.bti_c_func
* kselftest-arm64/arm64.btitest.bti_j_func
* kselftest-arm64/arm64.btitest.bti_jc_func
* kselftest-arm64/arm64.btitest.bti_none_func
* kselftest-arm64/arm64.btitest.nohint_func
* kselftest-arm64/arm64.btitest.paciasp_func
* kselftest-arm64/arm64.nobtitest.bti_c_func
* kselftest-arm64/arm64.nobtitest.bti_j_func
* kselftest-arm64/arm64.nobtitest.bti_jc_func
* kselftest-arm64/arm64.nobtitest.bti_none_func
* kselftest-arm64/arm64.nobtitest.nohint_func
* kselftest-arm64/arm64.nobtitest.paciasp_func
* kselftest-bpf
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kvm-unit-tests
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* packetdrill
* perf
* rcutorture
* ssuite
* v4l2-compliance
--
Linaro LKFT
https://lkft.linaro.org
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.226 release. There are 239 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Jan 2022 18:39:11 +0000. Anything received after that time might be too late.
Build test:
mips (gcc version 11.2.1 20220121): 63 configs -> no failure arm (gcc version 11.2.1 20220121): 116 configs -> no new failure arm64 (gcc version 11.2.1 20220121): 2 configs -> no failure x86_64 (gcc version 11.2.1 20220121): 4 configs -> no failure
Boot test:x86_64: Booted on my test laptop. No regression.x86_64: Booted on qemu. No regression. [1]
[1]. https://openqa.qa.codethink.co.uk/tests/651
--
Regards
Sudip
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.226 release. There are 239 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Jan 2022 18:39:11 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v4.19:
10 builds: 10 pass, 0 fail
22 boots: 22 pass, 0 fail
40 tests: 40 pass, 0 failLinux version: 4.19.226-rc1-gcedebae149c2
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.226 release. There are 239 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Jan 2022 18:39:11 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Tested on arm64 and x86 for 4.19.226-rc1,
Kernel repo:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Branch: linux-4.19.y
Version: 4.19.226-rc1
Commit: ebabcfeda281e1c6226b219845d71930c729dae0
Compiler: gcc version 7.3.0 (GCC)
arm64:
--------------------------------------------------------------------
Testcase Result Summary:
total: 8941
passed: 8941
failed: 0
timeout: 0
--------------------------------------------------------------------
x86:
--------------------------------------------------------------------
Testcase Result Summary:
total: 8941
passed: 8941
failed: 0
timeout: 0
--------------------------------------------------------------------
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.226 release. There are 239 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 26 Jan 2022 18:39:11 +0000. Anything received after that time might be too late.
Build results:
total: 155 pass: 155 fail: 0 Qemu test results: total: 425 pass: 425 fail: 0
Guenter