From: Greg Kroah-Hartman Date: Thu, 3 Aug 2017 22:11:01 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v4.12.5~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b719557bd99d8900aa8aa3915ea07399f6144472;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: net-phy-do-not-perform-software-reset-for-generic-phy.patch nfc-fdp-fix-null-pointer-dereference.patch --- diff --git a/queue-4.4/net-phy-do-not-perform-software-reset-for-generic-phy.patch b/queue-4.4/net-phy-do-not-perform-software-reset-for-generic-phy.patch new file mode 100644 index 00000000000..1d7f8b5c228 --- /dev/null +++ b/queue-4.4/net-phy-do-not-perform-software-reset-for-generic-phy.patch @@ -0,0 +1,55 @@ +From 0878fff1f42c18e448ab5b8b4f6a3eb32365b5b6 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Sun, 5 Mar 2017 12:34:49 -0800 +Subject: net: phy: Do not perform software reset for Generic PHY + +From: Florian Fainelli + +commit 0878fff1f42c18e448ab5b8b4f6a3eb32365b5b6 upstream. + +The Generic PHY driver is a catch-all PHY driver and it should preserve +whatever prior initialization has been done by boot loader or firmware +agents. For specific PHY device configuration it is expected that a +specialized PHY driver would take over that role. + +Resetting the generic PHY was a bad idea that has lead to several +complaints and downstream workarounds e.g: in OpenWrt/LEDE so restore +the behavior prior to 87aa9f9c61ad ("net: phy: consolidate PHY +reset in phy_init_hw()"). + +Reported-by: Felix Fietkau +Fixes: 87aa9f9c61ad ("net: phy: consolidate PHY reset in phy_init_hw()") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/phy/phy_device.c | 2 +- + include/linux/phy.h | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -1442,7 +1442,7 @@ static struct phy_driver genphy_driver[] + .phy_id = 0xffffffff, + .phy_id_mask = 0xffffffff, + .name = "Generic PHY", +- .soft_reset = genphy_soft_reset, ++ .soft_reset = genphy_no_soft_reset, + .config_init = genphy_config_init, + .features = PHY_GBIT_FEATURES | SUPPORTED_MII | + SUPPORTED_AUI | SUPPORTED_FIBRE | +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -785,6 +785,10 @@ int genphy_read_status(struct phy_device + int genphy_suspend(struct phy_device *phydev); + int genphy_resume(struct phy_device *phydev); + int genphy_soft_reset(struct phy_device *phydev); ++static inline int genphy_no_soft_reset(struct phy_device *phydev) ++{ ++ return 0; ++} + void phy_driver_unregister(struct phy_driver *drv); + void phy_drivers_unregister(struct phy_driver *drv, int n); + int phy_driver_register(struct phy_driver *new_driver); diff --git a/queue-4.4/nfc-fdp-fix-null-pointer-dereference.patch b/queue-4.4/nfc-fdp-fix-null-pointer-dereference.patch new file mode 100644 index 00000000000..892baf3997b --- /dev/null +++ b/queue-4.4/nfc-fdp-fix-null-pointer-dereference.patch @@ -0,0 +1,42 @@ +From b6355fb3f5f40bbce165847d277e64896cab8f95 Mon Sep 17 00:00:00 2001 +From: Sudip Mukherjee +Date: Tue, 20 Dec 2016 21:09:04 +0000 +Subject: nfc: fdp: fix NULL pointer dereference + +From: Sudip Mukherjee + +commit b6355fb3f5f40bbce165847d277e64896cab8f95 upstream. + +We are checking phy after dereferencing it. We can print the debug +information after checking it. If phy is NULL then we will get a good +stack trace to tell us that we are in this irq handler. + +Signed-off-by: Sudip Mukherjee +Signed-off-by: Samuel Ortiz +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/nfc/fdp/i2c.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/nfc/fdp/i2c.c ++++ b/drivers/nfc/fdp/i2c.c +@@ -210,14 +210,14 @@ static irqreturn_t fdp_nci_i2c_irq_threa + struct sk_buff *skb; + int r; + +- client = phy->i2c_dev; +- dev_dbg(&client->dev, "%s\n", __func__); +- + if (!phy || irq != phy->i2c_dev->irq) { + WARN_ON_ONCE(1); + return IRQ_NONE; + } + ++ client = phy->i2c_dev; ++ dev_dbg(&client->dev, "%s\n", __func__); ++ + r = fdp_nci_i2c_read(phy, &skb); + + if (r == -EREMOTEIO) diff --git a/queue-4.4/series b/queue-4.4/series index b4568493ea7..7289e7737ae 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -20,3 +20,5 @@ perf-intel-pt-fix-last_ip-usage.patch perf-intel-pt-use-fup-always-when-scanning-for-an-ip.patch perf-intel-pt-ensure-never-to-set-last_ip-when-packet-count-is-zero.patch xfs-don-t-bug-on-mixed-direct-and-mapped-i-o.patch +nfc-fdp-fix-null-pointer-dereference.patch +net-phy-do-not-perform-software-reset-for-generic-phy.patch