This is a note to let you know that I've just added the patch titled
Revert "dt-bindings: Add LEGO MINDSTORMS EV3 compatible specification"
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Sasha Levin <alexander.levin(a)verizon.com>
Date: Thu, 16 Nov 2017 21:04:58 -0500
Subject: Revert "dt-bindings: Add LEGO MINDSTORMS EV3 compatible specification"
From: Sasha Levin <alexander.levin(a)verizon.com>
This reverts commit 852bf68b7a62195c3c0c63f3b11f3f30958fc220.
As Ben pointed out, these drivers don't exist in <=4.9.
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
Documentation/devicetree/bindings/arm/davinci.txt | 4 ----
1 file changed, 4 deletions(-)
--- a/Documentation/devicetree/bindings/arm/davinci.txt
+++ b/Documentation/devicetree/bindings/arm/davinci.txt
@@ -13,10 +13,6 @@ EnBW AM1808 based CMC board
Required root node properties:
- compatible = "enbw,cmc", "ti,da850;
-LEGO MINDSTORMS EV3 (AM1808 based)
-Required root node properties:
- - compatible = "lego,ev3", "ti,da850";
-
Generic DaVinci Boards
----------------------
Patches currently in stable-queue which might be from alexander.levin(a)verizon.com are
queue-4.9/ata-sata_mv-should-depend-on-has_dma.patch
queue-4.9/scsi-lpfc-clear-the-vendorversion-in-the-plogi-plogi-acc-payload.patch
queue-4.9/arm-dts-omap5-uevm-allow-bootloader-to-configure-usb-ethernet-mac.patch
queue-4.9/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch
queue-4.9/extcon-remove-potential-problem-when-calling-extcon_register_notifier.patch
queue-4.9/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch
queue-4.9/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch
queue-4.9/staging-greybus-add-host-device-function-pointer-checks.patch
queue-4.9/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch
queue-4.9/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch
queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-error.patch
queue-4.9/ata-sata_highbank-should-depend-on-has_dma.patch
queue-4.9/power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch
queue-4.9/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch
queue-4.9/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch
queue-4.9/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch
queue-4.9/power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch
queue-4.9/revert-dt-bindings-add-vendor-prefix-for-lego.patch
queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch
queue-4.9/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch
queue-4.9/ixgbe-reduce-i2c-retry-count-on-x550-devices.patch
queue-4.9/ixgbe-do-not-disable-fec-from-the-driver.patch
queue-4.9/x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch
queue-4.9/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch
queue-4.9/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch
queue-4.9/arm-dts-fix-omap3-off-mode-pull-defines.patch
queue-4.9/arm-dts-fix-compatible-for-ti81xx-uarts-for-8250.patch
queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-errors.patch
queue-4.9/scsi-lpfc-add-missing-memory-barrier.patch
queue-4.9/alsa-vx-fix-possible-transfer-overflow.patch
queue-4.9/backlight-lcd-fix-race-condition-during-register.patch
queue-4.9/fm10k-request-reset-when-mbx-state-changes.patch
queue-4.9/arm64-dts-ns2-reserve-memory-for-nitro-firmware.patch
queue-4.9/staging-rtl8712-fixed-little-endian-problem.patch
queue-4.9/revert-crypto-xts-add-ecb-dependency.patch
queue-4.9/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch
queue-4.9/staging-wilc1000-fix-endian-sparse-warning.patch
queue-4.9/alsa-hda-realtek-add-new-codec-id-alc299.patch
queue-4.9/ixgbe-fix-aer-error-handling.patch
queue-4.9/scsi-ufs-add-capability-to-keep-auto-bkops-always-enabled.patch
queue-4.9/tcp-provide-timestamps-for-partial-writes.patch
queue-4.9/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch
queue-4.9/ixgbe-configure-advertised-speeds-correctly-for-kr-kx-backplane.patch
queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch
queue-4.9/ixgbe-add-mask-for-64-rss-queues.patch
queue-4.9/revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch
queue-4.9/rtc-rx8010-change-lock-mechanism.patch
queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch
queue-4.9/ata-ata_bmdma-should-depend-on-has_dma.patch
queue-4.9/drm-omap-panel-sony-acx565akm.c-add-module_alias.patch
queue-4.9/ixgbe-fix-reporting-of-100mb-capability.patch
queue-4.9/igb-close-suspend-race-in-netif_device_detach.patch
queue-4.9/igb-reset-the-phy-before-reading-the-phy-id.patch
queue-4.9/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch
queue-4.9/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch
queue-4.9/scsi-ufs-qcom-fix-module-autoload.patch
queue-4.9/arm-dts-fix-am335x-and-dm814x-scm-syscon-to-probe-children.patch
This is a note to let you know that I've just added the patch titled
Revert "dt-bindings: Add vendor prefix for LEGO"
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
revert-dt-bindings-add-vendor-prefix-for-lego.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Sasha Levin <alexander.levin(a)verizon.com>
Date: Thu, 16 Nov 2017 21:04:38 -0500
Subject: Revert "dt-bindings: Add vendor prefix for LEGO"
From: Sasha Levin <alexander.levin(a)verizon.com>
This reverts commit 04e13a5ec96db94c1cc8ce7b0b1e1b626e0c00c7.
As Ben pointed out, these drivers don't exist in <=4.9.
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 -
1 file changed, 1 deletion(-)
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -154,7 +154,6 @@ kosagi Sutajio Ko-Usagi PTE Ltd.
kyo Kyocera Corporation
lacie LaCie
lantiq Lantiq Semiconductor
-lego LEGO Systems A/S
lenovo Lenovo Group Ltd.
lg LG Corporation
linux Linux-specific binding
Patches currently in stable-queue which might be from alexander.levin(a)verizon.com are
queue-4.9/ata-sata_mv-should-depend-on-has_dma.patch
queue-4.9/scsi-lpfc-clear-the-vendorversion-in-the-plogi-plogi-acc-payload.patch
queue-4.9/arm-dts-omap5-uevm-allow-bootloader-to-configure-usb-ethernet-mac.patch
queue-4.9/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch
queue-4.9/extcon-remove-potential-problem-when-calling-extcon_register_notifier.patch
queue-4.9/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch
queue-4.9/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch
queue-4.9/staging-greybus-add-host-device-function-pointer-checks.patch
queue-4.9/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch
queue-4.9/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch
queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-error.patch
queue-4.9/ata-sata_highbank-should-depend-on-has_dma.patch
queue-4.9/power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch
queue-4.9/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch
queue-4.9/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch
queue-4.9/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch
queue-4.9/power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch
queue-4.9/revert-dt-bindings-add-vendor-prefix-for-lego.patch
queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch
queue-4.9/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch
queue-4.9/ixgbe-reduce-i2c-retry-count-on-x550-devices.patch
queue-4.9/ixgbe-do-not-disable-fec-from-the-driver.patch
queue-4.9/x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch
queue-4.9/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch
queue-4.9/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch
queue-4.9/arm-dts-fix-omap3-off-mode-pull-defines.patch
queue-4.9/arm-dts-fix-compatible-for-ti81xx-uarts-for-8250.patch
queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-errors.patch
queue-4.9/scsi-lpfc-add-missing-memory-barrier.patch
queue-4.9/alsa-vx-fix-possible-transfer-overflow.patch
queue-4.9/backlight-lcd-fix-race-condition-during-register.patch
queue-4.9/fm10k-request-reset-when-mbx-state-changes.patch
queue-4.9/arm64-dts-ns2-reserve-memory-for-nitro-firmware.patch
queue-4.9/staging-rtl8712-fixed-little-endian-problem.patch
queue-4.9/revert-crypto-xts-add-ecb-dependency.patch
queue-4.9/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch
queue-4.9/staging-wilc1000-fix-endian-sparse-warning.patch
queue-4.9/alsa-hda-realtek-add-new-codec-id-alc299.patch
queue-4.9/ixgbe-fix-aer-error-handling.patch
queue-4.9/scsi-ufs-add-capability-to-keep-auto-bkops-always-enabled.patch
queue-4.9/tcp-provide-timestamps-for-partial-writes.patch
queue-4.9/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch
queue-4.9/ixgbe-configure-advertised-speeds-correctly-for-kr-kx-backplane.patch
queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch
queue-4.9/ixgbe-add-mask-for-64-rss-queues.patch
queue-4.9/revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch
queue-4.9/rtc-rx8010-change-lock-mechanism.patch
queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch
queue-4.9/ata-ata_bmdma-should-depend-on-has_dma.patch
queue-4.9/drm-omap-panel-sony-acx565akm.c-add-module_alias.patch
queue-4.9/ixgbe-fix-reporting-of-100mb-capability.patch
queue-4.9/igb-close-suspend-race-in-netif_device_detach.patch
queue-4.9/igb-reset-the-phy-before-reading-the-phy-id.patch
queue-4.9/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch
queue-4.9/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch
queue-4.9/scsi-ufs-qcom-fix-module-autoload.patch
queue-4.9/arm-dts-fix-am335x-and-dm814x-scm-syscon-to-probe-children.patch
This is a note to let you know that I've just added the patch titled
power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Hans de Goede <hdegoede(a)redhat.com>
Date: Wed, 14 Dec 2016 17:38:51 +0100
Subject: power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time
From: Hans de Goede <hdegoede(a)redhat.com>
[ Upstream commit 4949fc5e071f8e8d8122e0b16cf6a2ec1ca36258 ]
In order for the MSB -> LSB latching to work correctly we must read the
2 8 bit registers of a 15 bit value in one consecutive read.
This fixes charge_full reporting 3498768 on some reads and 3354624 one
other reads on my tablet (for the 3354624 value the raw LSB is 0x00).
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
Signed-off-by: Sebastian Reichel <sre(a)kernel.org>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/power/supply/axp288_fuel_gauge.c | 63 ++++++++++++++++---------------
1 file changed, 34 insertions(+), 29 deletions(-)
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -29,6 +29,7 @@
#include <linux/iio/consumer.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
+#include <asm/unaligned.h>
#define CHRG_STAT_BAT_SAFE_MODE (1 << 3)
#define CHRG_STAT_BAT_VALID (1 << 4)
@@ -73,17 +74,15 @@
#define FG_CNTL_CC_EN (1 << 6)
#define FG_CNTL_GAUGE_EN (1 << 7)
+#define FG_15BIT_WORD_VALID (1 << 15)
+#define FG_15BIT_VAL_MASK 0x7fff
+
#define FG_REP_CAP_VALID (1 << 7)
#define FG_REP_CAP_VAL_MASK 0x7F
#define FG_DES_CAP1_VALID (1 << 7)
-#define FG_DES_CAP1_VAL_MASK 0x7F
-#define FG_DES_CAP0_VAL_MASK 0xFF
#define FG_DES_CAP_RES_LSB 1456 /* 1.456mAhr */
-#define FG_CC_MTR1_VALID (1 << 7)
-#define FG_CC_MTR1_VAL_MASK 0x7F
-#define FG_CC_MTR0_VAL_MASK 0xFF
#define FG_DES_CC_RES_LSB 1456 /* 1.456mAhr */
#define FG_OCV_CAP_VALID (1 << 7)
@@ -189,6 +188,28 @@ static int fuel_gauge_reg_writeb(struct
return ret;
}
+static int fuel_gauge_read_15bit_word(struct axp288_fg_info *info, int reg)
+{
+ unsigned char buf[2];
+ int ret;
+
+ ret = regmap_bulk_read(info->regmap, reg, buf, 2);
+ if (ret < 0) {
+ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n",
+ reg, ret);
+ return ret;
+ }
+
+ ret = get_unaligned_be16(buf);
+ if (!(ret & FG_15BIT_WORD_VALID)) {
+ dev_err(&info->pdev->dev, "Error reg 0x%02x contents not valid\n",
+ reg);
+ return -ENXIO;
+ }
+
+ return ret & FG_15BIT_VAL_MASK;
+}
+
static int pmic_read_adc_val(const char *name, int *raw_val,
struct axp288_fg_info *info)
{
@@ -255,18 +276,12 @@ static int fuel_gauge_debug_show(struct
seq_printf(s, " FG_OCVL[%02x] : %02x\n",
AXP288_FG_OCVL_REG,
fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG));
- seq_printf(s, "FG_DES_CAP1[%02x] : %02x\n",
+ seq_printf(s, " FG_DES_CAP[%02x] : %04x\n",
AXP288_FG_DES_CAP1_REG,
- fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP1_REG));
- seq_printf(s, "FG_DES_CAP0[%02x] : %02x\n",
- AXP288_FG_DES_CAP0_REG,
- fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP0_REG));
- seq_printf(s, " FG_CC_MTR1[%02x] : %02x\n",
+ fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG));
+ seq_printf(s, " FG_CC_MTR[%02x] : %04x\n",
AXP288_FG_CC_MTR1_REG,
- fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR1_REG));
- seq_printf(s, " FG_CC_MTR0[%02x] : %02x\n",
- AXP288_FG_CC_MTR0_REG,
- fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR0_REG));
+ fuel_gauge_read_15bit_word(info, AXP288_FG_CC_MTR1_REG));
seq_printf(s, " FG_OCV_CAP[%02x] : %02x\n",
AXP288_FG_OCV_CAP_REG,
fuel_gauge_reg_readb(info, AXP288_FG_OCV_CAP_REG));
@@ -663,28 +678,18 @@ static int fuel_gauge_get_property(struc
val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
break;
case POWER_SUPPLY_PROP_CHARGE_NOW:
- ret = fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR1_REG);
+ ret = fuel_gauge_read_15bit_word(info, AXP288_FG_CC_MTR1_REG);
if (ret < 0)
goto fuel_gauge_read_err;
- value = (ret & FG_CC_MTR1_VAL_MASK) << 8;
- ret = fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR0_REG);
- if (ret < 0)
- goto fuel_gauge_read_err;
- value |= (ret & FG_CC_MTR0_VAL_MASK);
- val->intval = value * FG_DES_CAP_RES_LSB;
+ val->intval = ret * FG_DES_CAP_RES_LSB;
break;
case POWER_SUPPLY_PROP_CHARGE_FULL:
- ret = fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP1_REG);
+ ret = fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG);
if (ret < 0)
goto fuel_gauge_read_err;
- value = (ret & FG_DES_CAP1_VAL_MASK) << 8;
- ret = fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP0_REG);
- if (ret < 0)
- goto fuel_gauge_read_err;
- value |= (ret & FG_DES_CAP0_VAL_MASK);
- val->intval = value * FG_DES_CAP_RES_LSB;
+ val->intval = ret * FG_DES_CAP_RES_LSB;
break;
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
val->intval = PROP_CURR(info->pdata->design_cap);
Patches currently in stable-queue which might be from hdegoede(a)redhat.com are
queue-4.9/power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch
queue-4.9/power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch
This is a note to let you know that I've just added the patch titled
power: supply: axp288_fuel_gauge: Read 12 bit values 2 registers at a time
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Hans de Goede <hdegoede(a)redhat.com>
Date: Wed, 14 Dec 2016 17:38:52 +0100
Subject: power: supply: axp288_fuel_gauge: Read 12 bit values 2 registers at a time
From: Hans de Goede <hdegoede(a)redhat.com>
[ Upstream commit 248efcf00602f0282587999bcc221a872bd72530 ]
In order for the MSB -> LSB latching to work correctly we must read the
2 8 bit registers of a 12 bit value in one consecutive read.
This fixes voltage_ocv reporting inconsistent values on my tablet.
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
Signed-off-by: Sebastian Reichel <sre(a)kernel.org>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/power/supply/axp288_fuel_gauge.c | 40 +++++++++++++++++--------------
1 file changed, 22 insertions(+), 18 deletions(-)
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -210,6 +210,22 @@ static int fuel_gauge_read_15bit_word(st
return ret & FG_15BIT_VAL_MASK;
}
+static int fuel_gauge_read_12bit_word(struct axp288_fg_info *info, int reg)
+{
+ unsigned char buf[2];
+ int ret;
+
+ ret = regmap_bulk_read(info->regmap, reg, buf, 2);
+ if (ret < 0) {
+ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n",
+ reg, ret);
+ return ret;
+ }
+
+ /* 12-bit data values have upper 8 bits in buf[0], lower 4 in buf[1] */
+ return (buf[0] << 4) | ((buf[1] >> 4) & 0x0f);
+}
+
static int pmic_read_adc_val(const char *name, int *raw_val,
struct axp288_fg_info *info)
{
@@ -270,12 +286,9 @@ static int fuel_gauge_debug_show(struct
seq_printf(s, " FG_RDC0[%02x] : %02x\n",
AXP288_FG_RDC0_REG,
fuel_gauge_reg_readb(info, AXP288_FG_RDC0_REG));
- seq_printf(s, " FG_OCVH[%02x] : %02x\n",
+ seq_printf(s, " FG_OCV[%02x] : %04x\n",
AXP288_FG_OCVH_REG,
- fuel_gauge_reg_readb(info, AXP288_FG_OCVH_REG));
- seq_printf(s, " FG_OCVL[%02x] : %02x\n",
- AXP288_FG_OCVL_REG,
- fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG));
+ fuel_gauge_read_12bit_word(info, AXP288_FG_OCVH_REG));
seq_printf(s, " FG_DES_CAP[%02x] : %04x\n",
AXP288_FG_DES_CAP1_REG,
fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG));
@@ -532,21 +545,12 @@ temp_read_fail:
static int fuel_gauge_get_vocv(struct axp288_fg_info *info, int *vocv)
{
- int ret, value;
-
- /* 12-bit data value, upper 8 in OCVH, lower 4 in OCVL */
- ret = fuel_gauge_reg_readb(info, AXP288_FG_OCVH_REG);
- if (ret < 0)
- goto vocv_read_fail;
- value = ret << 4;
+ int ret;
- ret = fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG);
- if (ret < 0)
- goto vocv_read_fail;
- value |= (ret & 0xf);
+ ret = fuel_gauge_read_12bit_word(info, AXP288_FG_OCVH_REG);
+ if (ret >= 0)
+ *vocv = VOLTAGE_FROM_ADC(ret);
- *vocv = VOLTAGE_FROM_ADC(value);
-vocv_read_fail:
return ret;
}
Patches currently in stable-queue which might be from hdegoede(a)redhat.com are
queue-4.9/power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch
queue-4.9/power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch
This is a note to let you know that I've just added the patch titled
MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Paul Burton <paul.burton(a)imgtec.com>
Date: Mon, 7 Nov 2016 11:30:41 +0000
Subject: MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds
From: Paul Burton <paul.burton(a)imgtec.com>
[ Upstream commit 9799270affc53414da96e77e454a5616b39cdab0 ]
Code in arch/mips/netlogic/common/irq.c which handles the XLP PIC fails
to build in XLR configurations due to cpu_is_xlp9xx not being defined,
leading to the following build failure:
arch/mips/netlogic/common/irq.c: In function ‘xlp_of_pic_init’:
arch/mips/netlogic/common/irq.c:298:2: error: implicit declaration
of function ‘cpu_is_xlp9xx’ [-Werror=implicit-function-declaration]
if (cpu_is_xlp9xx()) {
^
Although the code was conditional upon CONFIG_OF which is indirectly
selected by CONFIG_NLM_XLP_BOARD but not CONFIG_NLM_XLR_BOARD, the
failing XLR with CONFIG_OF configuration can be configured manually or
by randconfig.
Fix the build failure by making the affected XLP PIC code conditional
upon CONFIG_CPU_XLP which is used to guard the inclusion of
asm/netlogic/xlp-hal/xlp.h that provides the required cpu_is_xlp9xx
function.
[ralf(a)linux-mips.org: Fixed up as per Jayachandran's suggestion.]
Signed-off-by: Paul Burton <paul.burton(a)imgtec.com>
Cc: Jayachandran C <jchandra(a)broadcom.com>
Cc: linux-mips(a)linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14524/
Signed-off-by: Ralf Baechle <ralf(a)linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/mips/netlogic/common/irq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/mips/netlogic/common/irq.c
+++ b/arch/mips/netlogic/common/irq.c
@@ -275,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void)
do_IRQ(nlm_irq_to_xirq(node, i));
}
-#ifdef CONFIG_OF
+#ifdef CONFIG_CPU_XLP
static const struct irq_domain_ops xlp_pic_irq_domain_ops = {
.xlate = irq_domain_xlate_onetwocell,
};
@@ -348,7 +348,7 @@ void __init arch_init_irq(void)
#if defined(CONFIG_CPU_XLR)
nlm_setup_fmn_irq();
#endif
-#if defined(CONFIG_OF)
+#ifdef CONFIG_CPU_XLP
of_irq_init(xlp_pic_irq_ids);
#endif
}
Patches currently in stable-queue which might be from paul.burton(a)imgtec.com are
queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch
queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch
queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch
This is a note to let you know that I've just added the patch titled
MIPS: traps: Ensure L1 & L2 ECC checking match for CM3 systems
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Paul Burton <paul.burton(a)imgtec.com>
Date: Mon, 17 Oct 2016 16:01:07 +0100
Subject: MIPS: traps: Ensure L1 & L2 ECC checking match for CM3 systems
From: Paul Burton <paul.burton(a)imgtec.com>
[ Upstream commit 35e6de38858f59b6b65dcfeaf700b5d06fc2b93d ]
On systems with CM3, we must ensure that the L1 & L2 ECC enables are set
to the same value. This is presumed by the hardware & cache corruption
can occur when it is not the case. Support enabling & disabling the L2
ECC checking on CM3 systems where this is controlled via a GCR, and
ensure that it matches the state of L1 ECC checking. Remove I6400 from
the switch statement it will no longer hit, and which was incorrect
since the L2 ECC enable bit isn't in the CP0 ErrCtl register.
Signed-off-by: Paul Burton <paul.burton(a)imgtec.com>
Cc: linux-mips(a)linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14413/
Signed-off-by: Ralf Baechle <ralf(a)linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/mips/include/asm/mips-cm.h | 7 ++++
arch/mips/kernel/traps.c | 63 ++++++++++++++++++++++++++++++++++++++--
2 files changed, 67 insertions(+), 3 deletions(-)
--- a/arch/mips/include/asm/mips-cm.h
+++ b/arch/mips/include/asm/mips-cm.h
@@ -187,6 +187,7 @@ BUILD_CM_R_(config, MIPS_CM_GCB_OFS + 0
BUILD_CM_RW(base, MIPS_CM_GCB_OFS + 0x08)
BUILD_CM_RW(access, MIPS_CM_GCB_OFS + 0x20)
BUILD_CM_R_(rev, MIPS_CM_GCB_OFS + 0x30)
+BUILD_CM_RW(err_control, MIPS_CM_GCB_OFS + 0x38)
BUILD_CM_RW(error_mask, MIPS_CM_GCB_OFS + 0x40)
BUILD_CM_RW(error_cause, MIPS_CM_GCB_OFS + 0x48)
BUILD_CM_RW(error_addr, MIPS_CM_GCB_OFS + 0x50)
@@ -266,6 +267,12 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80)
#define CM_REV_CM2_5 CM_ENCODE_REV(7, 0)
#define CM_REV_CM3 CM_ENCODE_REV(8, 0)
+/* GCR_ERR_CONTROL register fields */
+#define CM_GCR_ERR_CONTROL_L2_ECC_EN_SHF 1
+#define CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK (_ULCAST_(0x1) << 1)
+#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_SHF 0
+#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK (_ULCAST_(0x1) << 0)
+
/* GCR_ERROR_CAUSE register fields */
#define CM_GCR_ERROR_CAUSE_ERRTYPE_SHF 27
#define CM_GCR_ERROR_CAUSE_ERRTYPE_MSK (_ULCAST_(0x1f) << 27)
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -51,6 +51,7 @@
#include <asm/idle.h>
#include <asm/mips-cm.h>
#include <asm/mips-r2-to-r6-emul.h>
+#include <asm/mips-cm.h>
#include <asm/mipsregs.h>
#include <asm/mipsmtregs.h>
#include <asm/module.h>
@@ -1646,6 +1647,65 @@ __setup("nol2par", nol2parity);
*/
static inline void parity_protection_init(void)
{
+#define ERRCTL_PE 0x80000000
+#define ERRCTL_L2P 0x00800000
+
+ if (mips_cm_revision() >= CM_REV_CM3) {
+ ulong gcr_ectl, cp0_ectl;
+
+ /*
+ * With CM3 systems we need to ensure that the L1 & L2
+ * parity enables are set to the same value, since this
+ * is presumed by the hardware engineers.
+ *
+ * If the user disabled either of L1 or L2 ECC checking,
+ * disable both.
+ */
+ l1parity &= l2parity;
+ l2parity &= l1parity;
+
+ /* Probe L1 ECC support */
+ cp0_ectl = read_c0_ecc();
+ write_c0_ecc(cp0_ectl | ERRCTL_PE);
+ back_to_back_c0_hazard();
+ cp0_ectl = read_c0_ecc();
+
+ /* Probe L2 ECC support */
+ gcr_ectl = read_gcr_err_control();
+
+ if (!(gcr_ectl & CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK) ||
+ !(cp0_ectl & ERRCTL_PE)) {
+ /*
+ * One of L1 or L2 ECC checking isn't supported,
+ * so we cannot enable either.
+ */
+ l1parity = l2parity = 0;
+ }
+
+ /* Configure L1 ECC checking */
+ if (l1parity)
+ cp0_ectl |= ERRCTL_PE;
+ else
+ cp0_ectl &= ~ERRCTL_PE;
+ write_c0_ecc(cp0_ectl);
+ back_to_back_c0_hazard();
+ WARN_ON(!!(read_c0_ecc() & ERRCTL_PE) != l1parity);
+
+ /* Configure L2 ECC checking */
+ if (l2parity)
+ gcr_ectl |= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK;
+ else
+ gcr_ectl &= ~CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK;
+ write_gcr_err_control(gcr_ectl);
+ gcr_ectl = read_gcr_err_control();
+ gcr_ectl &= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK;
+ WARN_ON(!!gcr_ectl != l2parity);
+
+ pr_info("Cache parity protection %sabled\n",
+ l1parity ? "en" : "dis");
+ return;
+ }
+
switch (current_cpu_type()) {
case CPU_24K:
case CPU_34K:
@@ -1656,11 +1716,8 @@ static inline void parity_protection_ini
case CPU_PROAPTIV:
case CPU_P5600:
case CPU_QEMU_GENERIC:
- case CPU_I6400:
case CPU_P6600:
{
-#define ERRCTL_PE 0x80000000
-#define ERRCTL_L2P 0x00800000
unsigned long errctl;
unsigned int l1parity_present, l2parity_present;
Patches currently in stable-queue which might be from paul.burton(a)imgtec.com are
queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch
queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch
queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch
This is a note to let you know that I've just added the patch titled
MIPS: init: Ensure reserved memory regions are not added to bootmem
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Marcin Nowakowski <marcin.nowakowski(a)imgtec.com>
Date: Wed, 23 Nov 2016 14:43:44 +0100
Subject: MIPS: init: Ensure reserved memory regions are not added to bootmem
From: Marcin Nowakowski <marcin.nowakowski(a)imgtec.com>
[ Upstream commit e89ef66d7682f031f026eee6bba03c8c2248d2a9 ]
Memories managed through boot_mem_map are generally expected to define
non-crossing areas. However, if part of a larger memory block is marked
as reserved, it would still be added to bootmem allocator as an
available block and could end up being overwritten by the allocator.
Prevent this by explicitly marking the memory as reserved it if exists
in the range used by bootmem allocator.
Signed-off-by: Marcin Nowakowski <marcin.nowakowski(a)imgtec.com>
Cc: linux-mips(a)linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14608/
Signed-off-by: Ralf Baechle <ralf(a)linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/mips/kernel/setup.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -551,6 +551,10 @@ static void __init bootmem_init(void)
continue;
default:
/* Not usable memory */
+ if (start > min_low_pfn && end < max_low_pfn)
+ reserve_bootmem(boot_mem_map.map[i].addr,
+ boot_mem_map.map[i].size,
+ BOOTMEM_DEFAULT);
continue;
}
Patches currently in stable-queue which might be from marcin.nowakowski(a)imgtec.com are
queue-4.9/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch
queue-4.9/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch
This is a note to let you know that I've just added the patch titled
MIPS: init: Ensure bootmem does not corrupt reserved memory
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Marcin Nowakowski <marcin.nowakowski(a)imgtec.com>
Date: Wed, 23 Nov 2016 14:43:45 +0100
Subject: MIPS: init: Ensure bootmem does not corrupt reserved memory
From: Marcin Nowakowski <marcin.nowakowski(a)imgtec.com>
[ Upstream commit d9b5b658210f28ed9f70c757d553e679d76e2986 ]
Current init code initialises bootmem allocator with all of the low
memory that it assumes is available, but does not check for reserved
memory block, which can lead to corruption of data that may be stored
there.
Move bootmem's allocation map to a location that does not cross any
reserved regions
Signed-off-by: Marcin Nowakowski <marcin.nowakowski(a)imgtec.com>
Cc: linux-mips(a)linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14609/
Signed-off-by: Ralf Baechle <ralf(a)linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/mips/kernel/setup.c | 74 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 71 insertions(+), 3 deletions(-)
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -153,6 +153,35 @@ void __init detect_memory_region(phys_ad
add_memory_region(start, size, BOOT_MEM_RAM);
}
+bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
+{
+ int i;
+ bool in_ram = false, free = true;
+
+ for (i = 0; i < boot_mem_map.nr_map; i++) {
+ phys_addr_t start_, end_;
+
+ start_ = boot_mem_map.map[i].addr;
+ end_ = boot_mem_map.map[i].addr + boot_mem_map.map[i].size;
+
+ switch (boot_mem_map.map[i].type) {
+ case BOOT_MEM_RAM:
+ if (start >= start_ && start + size <= end_)
+ in_ram = true;
+ break;
+ case BOOT_MEM_RESERVED:
+ if ((start >= start_ && start < end_) ||
+ (start < start_ && start + size >= start_))
+ free = false;
+ break;
+ default:
+ continue;
+ }
+ }
+
+ return in_ram && free;
+}
+
static void __init print_memory_map(void)
{
int i;
@@ -332,11 +361,19 @@ static void __init bootmem_init(void)
#else /* !CONFIG_SGI_IP27 */
+static unsigned long __init bootmap_bytes(unsigned long pages)
+{
+ unsigned long bytes = DIV_ROUND_UP(pages, 8);
+
+ return ALIGN(bytes, sizeof(long));
+}
+
static void __init bootmem_init(void)
{
unsigned long reserved_end;
unsigned long mapstart = ~0UL;
unsigned long bootmap_size;
+ bool bootmap_valid = false;
int i;
/*
@@ -430,11 +467,42 @@ static void __init bootmem_init(void)
#endif
/*
- * Initialize the boot-time allocator with low memory only.
+ * check that mapstart doesn't overlap with any of
+ * memory regions that have been reserved through eg. DTB
*/
- bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart,
- min_low_pfn, max_low_pfn);
+ bootmap_size = bootmap_bytes(max_low_pfn - min_low_pfn);
+
+ bootmap_valid = memory_region_available(PFN_PHYS(mapstart),
+ bootmap_size);
+ for (i = 0; i < boot_mem_map.nr_map && !bootmap_valid; i++) {
+ unsigned long mapstart_addr;
+
+ switch (boot_mem_map.map[i].type) {
+ case BOOT_MEM_RESERVED:
+ mapstart_addr = PFN_ALIGN(boot_mem_map.map[i].addr +
+ boot_mem_map.map[i].size);
+ if (PHYS_PFN(mapstart_addr) < mapstart)
+ break;
+
+ bootmap_valid = memory_region_available(mapstart_addr,
+ bootmap_size);
+ if (bootmap_valid)
+ mapstart = PHYS_PFN(mapstart_addr);
+ break;
+ default:
+ break;
+ }
+ }
+ if (!bootmap_valid)
+ panic("No memory area to place a bootmap bitmap");
+
+ /*
+ * Initialize the boot-time allocator with low memory only.
+ */
+ if (bootmap_size != init_bootmem_node(NODE_DATA(0), mapstart,
+ min_low_pfn, max_low_pfn))
+ panic("Unexpected memory size required for bootmap");
for (i = 0; i < boot_mem_map.nr_map; i++) {
unsigned long start, end;
Patches currently in stable-queue which might be from marcin.nowakowski(a)imgtec.com are
queue-4.9/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch
queue-4.9/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch
This is a note to let you know that I've just added the patch titled
MIPS: End asm function prologue macros with .insn
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mips-end-asm-function-prologue-macros-with-.insn.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Paul Burton <paul.burton(a)imgtec.com>
Date: Mon, 7 Nov 2016 11:14:09 +0000
Subject: MIPS: End asm function prologue macros with .insn
From: Paul Burton <paul.burton(a)imgtec.com>
[ Upstream commit 08889582b8aa0bbc01a1e5a0033b9f98d2e11caa ]
When building a kernel targeting a microMIPS ISA, recent GNU linkers
will fail the link if they cannot determine that the target of a branch
or jump is microMIPS code, with errors such as the following:
mips-img-linux-gnu-ld: arch/mips/built-in.o: .text+0x542c:
Unsupported jump between ISA modes; consider recompiling with
interlinking enabled.
mips-img-linux-gnu-ld: final link failed: Bad value
or:
./arch/mips/include/asm/uaccess.h:1017: warning: JALX to a
non-word-aligned address
Placing anything other than an instruction at the start of a function
written in assembly appears to trigger such errors. In order to prepare
for allowing us to follow function prologue macros with an EXPORT_SYMBOL
invocation, end the prologue macros (LEAD, NESTED & FEXPORT) with a
.insn directive. This ensures that the start of the function is marked
as code, which always makes sense for functions & safely prevents us
from hitting the link errors described above.
Signed-off-by: Paul Burton <paul.burton(a)imgtec.com>
Reviewed-by: Maciej W. Rozycki <macro(a)imgtec.com>
Cc: linux-mips(a)linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14508/
Signed-off-by: Ralf Baechle <ralf(a)linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/mips/include/asm/asm.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/arch/mips/include/asm/asm.h
+++ b/arch/mips/include/asm/asm.h
@@ -54,7 +54,8 @@
.align 2; \
.type symbol, @function; \
.ent symbol, 0; \
-symbol: .frame sp, 0, ra
+symbol: .frame sp, 0, ra; \
+ .insn
/*
* NESTED - declare nested routine entry point
@@ -63,8 +64,9 @@ symbol: .frame sp, 0, ra
.globl symbol; \
.align 2; \
.type symbol, @function; \
- .ent symbol, 0; \
-symbol: .frame sp, framesize, rpc
+ .ent symbol, 0; \
+symbol: .frame sp, framesize, rpc; \
+ .insn
/*
* END - mark end of function
@@ -86,7 +88,7 @@ symbol:
#define FEXPORT(symbol) \
.globl symbol; \
.type symbol, @function; \
-symbol:
+symbol: .insn
/*
* ABS - export absolute symbol
Patches currently in stable-queue which might be from paul.burton(a)imgtec.com are
queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch
queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch
queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch
This is a note to let you know that I've just added the patch titled
ixgbe: handle close/suspend race with netif_device_detach/present
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Nov 19 11:32:28 CET 2017
From: Emil Tantilov <emil.s.tantilov(a)intel.com>
Date: Fri, 11 Nov 2016 10:07:47 -0800
Subject: ixgbe: handle close/suspend race with netif_device_detach/present
From: Emil Tantilov <emil.s.tantilov(a)intel.com>
[ Upstream commit f7f37e7ff2b9b7eff7fbd035569cab35896869a3 ]
When an interface is part of a namespace it is possible that
ixgbe_close() may be called while __ixgbe_shutdown() is running
which ends up in a double free WARN and/or a BUG in free_msi_irqs().
To handle this situation we extend the rtnl_lock() to protect the
call to netif_device_detach() and ixgbe_clear_interrupt_scheme()
in __ixgbe_shutdown() and check for netif_device_present()
to avoid clearing the interrupts second time in ixgbe_close();
Also extend the rtnl lock in ixgbe_resume() to netif_device_attach().
Signed-off-by: Emil Tantilov <emil.s.tantilov(a)intel.com>
Tested-by: Andrew Bowers <andrewx.bowers(a)intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher(a)intel.com>
Signed-off-by: Sasha Levin <alexander.levin(a)verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6194,7 +6194,8 @@ int ixgbe_close(struct net_device *netde
ixgbe_ptp_stop(adapter);
- ixgbe_close_suspend(adapter);
+ if (netif_device_present(netdev))
+ ixgbe_close_suspend(adapter);
ixgbe_fdir_filter_exit(adapter);
@@ -6239,14 +6240,12 @@ static int ixgbe_resume(struct pci_dev *
if (!err && netif_running(netdev))
err = ixgbe_open(netdev);
- rtnl_unlock();
- if (err)
- return err;
-
- netif_device_attach(netdev);
+ if (!err)
+ netif_device_attach(netdev);
+ rtnl_unlock();
- return 0;
+ return err;
}
#endif /* CONFIG_PM */
@@ -6261,14 +6260,14 @@ static int __ixgbe_shutdown(struct pci_d
int retval = 0;
#endif
+ rtnl_lock();
netif_device_detach(netdev);
- rtnl_lock();
if (netif_running(netdev))
ixgbe_close_suspend(adapter);
- rtnl_unlock();
ixgbe_clear_interrupt_scheme(adapter);
+ rtnl_unlock();
#ifdef CONFIG_PM
retval = pci_save_state(pdev);
Patches currently in stable-queue which might be from emil.s.tantilov(a)intel.com are
queue-4.9/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch
queue-4.9/ixgbe-do-not-disable-fec-from-the-driver.patch
queue-4.9/ixgbe-fix-aer-error-handling.patch
queue-4.9/ixgbe-add-mask-for-64-rss-queues.patch