All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6
@ 2017-08-21 22:27 Hauke Mehrtens
  2017-08-21 22:27 ` [PATCH 01/21] copy: do not copy files removed in kernel 4.13 Hauke Mehrtens
                   ` (21 more replies)
  0 siblings, 22 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:27 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This brings backports to kernel 4.13-rc6.

This was build tested with kernel 3.18, 4.4 and 4.9. and runtime tested 
with iwlwifi on kernel 4.9.

Are you planing to to releases in a tar?
Which kernel versions are currently support by backports?
patches/0079-netdev-destructor.cocci takes very long to apply, about 3 
times longer all others together.
Should we remove ssb and bcma from backports and use the in kernel 
versions instead? I do not expect so many changes any more affecting the 
wifi drivers.

Is the compat wireless build server still being used?

Hauke Mehrtens (21):
  copy: do not copy files removed in kernel 4.13
  patches: header fix for st-nci not needed any more
  header: skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8()
  header: skbuff: fix signature of skb_put(), skb_push() and ()
  header: backport mii_ethtool_{get,set}_link_ksettings()
  patches: adapt the stat64 usage for usbnet
  header: add module_param_hw_array()
  header: backport devm_acpi_dev_add_driver_gpios()
  header: add get_random_u32()
  header: rename wait_queue_entry_t to wait_queue_t
  backport: add __print_array()
  compat: avoid usage of kvzalloc() in rhashtable.c
  patch: Allow usage of pci_error_handlers->reset_notify
  header: add offsetofend()
  dependencies: add deps for struct acpi_gpio_mapping
  patches: brcmfmac: fix netdev destructor
  patches: backport the probe_new for i2c drivers
  patches: adapt signature of proto_ops->accept
  header: add linux/refcount.h
  header: add dma_wmb()
  copy-list: add quantenna qtnfmac driver

 backport/backport-include/asm/barrier.h            |   4 +
 backport/backport-include/linux/acpi.h             |   9 +
 backport/backport-include/linux/ftrace_event.h     |  10 +
 backport/backport-include/linux/mii.h              |   7 +
 backport/backport-include/linux/moduleparam.h      |   5 +
 backport/backport-include/linux/random.h           |   7 +
 backport/backport-include/linux/refcount.h         |  47 +++++
 backport/backport-include/linux/skbuff.h           |  44 ++++
 backport/backport-include/linux/stddef.h           |  16 ++
 backport/backport-include/linux/wait.h             |   4 +
 backport/backport-include/trace/ftrace.h           |   9 +
 backport/compat/Makefile                           |   1 +
 backport/compat/backport-4.0.c                     |  46 +++++
 backport/compat/backport-4.10.c                    | 223 +++++++++++++++++++++
 copy-list                                          |   3 +-
 dependencies                                       |  15 +-
 .../0013-fix-makefile-includes/st-nci-spi.patch    |  10 -
 patches/0075-ndo-stats-64.cocci                    |   2 +-
 patches/0075-ndo-stats-64/usbnet.patch             |  26 +++
 patches/0079-netdev-destructor/brcmfmac.patch      |  35 ++++
 patches/0080-i2c-proble-new.cocci                  |  25 +++
 patches/0081-proto_ops-accept/nfc.patch            |  16 ++
 patches/0082-pci_error_handlers.cocci              |  32 +++
 patches/lib-rhashtable.patch                       |  17 +-
 24 files changed, 593 insertions(+), 20 deletions(-)
 create mode 100644 backport/backport-include/linux/ftrace_event.h
 create mode 100644 backport/backport-include/linux/refcount.h
 create mode 100644 backport/backport-include/linux/stddef.h
 create mode 100644 backport/backport-include/trace/ftrace.h
 create mode 100644 backport/compat/backport-4.10.c
 delete mode 100644 patches/0013-fix-makefile-includes/st-nci-spi.patch
 create mode 100644 patches/0075-ndo-stats-64/usbnet.patch
 create mode 100644 patches/0079-netdev-destructor/brcmfmac.patch
 create mode 100644 patches/0080-i2c-proble-new.cocci
 create mode 100644 patches/0081-proto_ops-accept/nfc.patch
 create mode 100644 patches/0082-pci_error_handlers.cocci

-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH 01/21] copy: do not copy files removed in kernel 4.13
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
@ 2017-08-21 22:27 ` Hauke Mehrtens
  2017-09-06 14:56   ` Johannes Berg
  2017-08-21 22:27 ` [PATCH 02/21] patches: header fix for st-nci not needed any more Hauke Mehrtens
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:27 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

These files were removed in kernel 4.13 and should not be copied any
more.

The wil6210_uapi.h file was removed in a520b49ec155767 ("wil6210: remove
ioctl interface") and the st-nci.h file in commit 61a04101c8a486d ("NFC:
st-nci: Get rid of platform data")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 copy-list | 2 --
 1 file changed, 2 deletions(-)

diff --git a/copy-list b/copy-list
index 3b1fa2ac..17afcb4c 100644
--- a/copy-list
+++ b/copy-list
@@ -31,7 +31,6 @@ include/linux/pci_ids.h
 include/uapi/linux/pci_regs.h
 include/linux/mmc/sdio_ids.h
 include/linux/ath9k_platform.h
-include/uapi/linux/wil6210_uapi.h
 include/linux/wl12xx.h
 include/linux/rndis.h
 include/linux/bcm47xx_wdt.h
@@ -113,7 +112,6 @@ include/uapi/linux/nfc.h
 drivers/nfc/
 include/linux/platform_data/nfcmrvl.h
 include/linux/platform_data/nxp-nci.h
-include/linux/platform_data/st-nci.h
 
 # MPLS labels, checked on skb->protocol on the
 # respective 802 family, only ethernet seems to use
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 02/21] patches: header fix for st-nci not needed any more
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
  2017-08-21 22:27 ` [PATCH 01/21] copy: do not copy files removed in kernel 4.13 Hauke Mehrtens
@ 2017-08-21 22:27 ` Hauke Mehrtens
  2017-08-21 22:27 ` [PATCH 03/21] header: skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8() Hauke Mehrtens
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:27 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

The linux/of.h file is now already included in the upstream kernel.
This include was added in commit a89e68f118e ("NFC: st-nci: Covert to
use GPIO descriptor")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0013-fix-makefile-includes/st-nci-spi.patch | 10 ----------
 1 file changed, 10 deletions(-)
 delete mode 100644 patches/0013-fix-makefile-includes/st-nci-spi.patch

diff --git a/patches/0013-fix-makefile-includes/st-nci-spi.patch b/patches/0013-fix-makefile-includes/st-nci-spi.patch
deleted file mode 100644
index 1ecd1618..00000000
--- a/patches/0013-fix-makefile-includes/st-nci-spi.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/drivers/nfc/st-nci/spi.c
-+++ b/drivers/nfc/st-nci/spi.c
-@@ -21,6 +21,7 @@
- #include <linux/spi/spi.h>
- #include <linux/gpio.h>
- #include <linux/gpio/consumer.h>
-+#include <linux/of.h>
- #include <linux/of_irq.h>
- #include <linux/of_gpio.h>
- #include <linux/acpi.h>
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 03/21] header: skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
  2017-08-21 22:27 ` [PATCH 01/21] copy: do not copy files removed in kernel 4.13 Hauke Mehrtens
  2017-08-21 22:27 ` [PATCH 02/21] patches: header fix for st-nci not needed any more Hauke Mehrtens
@ 2017-08-21 22:27 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 04/21] header: skbuff: fix signature of skb_put(), skb_push() and () Hauke Mehrtens
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:27 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

These functions were added in kernel 4.13 and are used by many driver
now.

This was added in the following upsteram comits:
e45a79da863c19 ("skbuff/mac80211: introduce and use skb_put_zero()")
59ae1d127ac0ae ("networking: introduce and use skb_put_data()")
634fef61076d64 ("networking: add and use skb_put_u8()")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/skbuff.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index dc957487..09894a96 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -315,4 +315,30 @@ __u32 skb_get_hash_perturb(const struct sk_buff *skb, u32 perturb)
 
 #endif
 
+#if LINUX_VERSION_IS_LESS(4,13,0)
+static inline void *skb_put_zero(struct sk_buff *skb, unsigned int len)
+{
+	void *tmp = skb_put(skb, len);
+
+	memset(tmp, 0, len);
+
+	return tmp;
+}
+
+static inline void *skb_put_data(struct sk_buff *skb, const void *data,
+				 unsigned int len)
+{
+	void *tmp = skb_put(skb, len);
+
+	memcpy(tmp, data, len);
+
+	return tmp;
+}
+
+static inline void skb_put_u8(struct sk_buff *skb, u8 val)
+{
+	*(u8 *)skb_put(skb, 1) = val;
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 04/21] header: skbuff: fix signature of skb_put(), skb_push() and ()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2017-08-21 22:27 ` [PATCH 03/21] header: skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 05/21] header: backport mii_ethtool_{get,set}_link_ksettings() Hauke Mehrtens
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

In older kernel versions these functions returned a unsigned char*, now
they return a void *.

This change was done in upstream commit d58ff35122847a8 ("networking:
make skb_push & __skb_push return void pointers")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/skbuff.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 09894a96..61f3b98f 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -316,6 +316,24 @@ __u32 skb_get_hash_perturb(const struct sk_buff *skb, u32 perturb)
 #endif
 
 #if LINUX_VERSION_IS_LESS(4,13,0)
+static inline void *backport_skb_put(struct sk_buff *skb, unsigned int len)
+{
+	return skb_put(skb, len);
+}
+#define skb_put LINUX_BACKPORT(skb_put)
+
+static inline void *backport_skb_push(struct sk_buff *skb, unsigned int len)
+{
+	return skb_push(skb, len);
+}
+#define skb_push LINUX_BACKPORT(skb_push)
+
+static inline void *backport___skb_push(struct sk_buff *skb, unsigned int len)
+{
+	return __skb_push(skb, len);
+}
+#define __skb_push LINUX_BACKPORT(__skb_push)
+
 static inline void *skb_put_zero(struct sk_buff *skb, unsigned int len)
 {
 	void *tmp = skb_put(skb, len);
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 05/21] header: backport mii_ethtool_{get,set}_link_ksettings()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 04/21] header: skbuff: fix signature of skb_put(), skb_push() and () Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 06/21] patches: adapt the stat64 usage for usbnet Hauke Mehrtens
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This function was added in kernel 4.10 and is needed by the usbnet
drivers.

These functions were added in upstream commit: bc8ee596afe8f3 ("net:
mii: add generic function to support ksetting support")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/mii.h |   7 ++
 backport/compat/Makefile              |   1 +
 backport/compat/backport-4.10.c       | 223 ++++++++++++++++++++++++++++++++++
 dependencies                          |   4 +
 4 files changed, 235 insertions(+)
 create mode 100644 backport/compat/backport-4.10.c

diff --git a/backport/backport-include/linux/mii.h b/backport/backport-include/linux/mii.h
index 5b0ecf97..e5aad0f6 100644
--- a/backport/backport-include/linux/mii.h
+++ b/backport/backport-include/linux/mii.h
@@ -144,4 +144,11 @@ static inline u32 mii_lpa_to_ethtool_lpa_x(u32 lpa)
 }
 #endif
 
+#if LINUX_VERSION_IN_RANGE(4,6,0, 4,11,0)
+extern int mii_ethtool_get_link_ksettings(
+	struct mii_if_info *mii, struct ethtool_link_ksettings *cmd);
+extern int mii_ethtool_set_link_ksettings(
+	struct mii_if_info *mii, const struct ethtool_link_ksettings *cmd);
+#endif /* LINUX_VERSION_IN_RANGE(4,6,0, 4,11,0) */
+
 #endif /* __BACKPORT_LINUX_MII_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 95d1bd2f..1078357f 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -35,6 +35,7 @@ compat-$(CPTCFG_KERNEL_4_5) += backport-4.5.o
 compat-$(CPTCFG_KERNEL_4_6) += backport-4.6.o
 compat-$(CPTCFG_KERNEL_4_7) += backport-4.7.o
 compat-$(CPTCFG_KERNEL_4_8) += backport-4.8.o
+compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o
 
 compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o
 compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o
diff --git a/backport/compat/backport-4.10.c b/backport/compat/backport-4.10.c
new file mode 100644
index 00000000..b4d7edea
--- /dev/null
+++ b/backport/compat/backport-4.10.c
@@ -0,0 +1,223 @@
+/*
+ * Copyright(c) 2017 Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Backport functionality introduced in Linux 4.10.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/netdevice.h>
+#include <linux/ethtool.h>
+#include <linux/mii.h>
+
+#if LINUX_VERSION_IS_GEQ(4,6,0)
+static u32 mii_get_an(struct mii_if_info *mii, u16 addr)
+{
+	int advert;
+
+	advert = mii->mdio_read(mii->dev, mii->phy_id, addr);
+
+	return mii_lpa_to_ethtool_lpa_t(advert);
+}
+
+/**
+ * mii_ethtool_set_link_ksettings - set settings that are specified in @cmd
+ * @mii: MII interfaces
+ * @cmd: requested ethtool_link_ksettings
+ *
+ * Returns 0 for success, negative on error.
+ */
+int mii_ethtool_set_link_ksettings(struct mii_if_info *mii,
+				   const struct ethtool_link_ksettings *cmd)
+{
+	struct net_device *dev = mii->dev;
+	u32 speed = cmd->base.speed;
+
+	if (speed != SPEED_10 &&
+	    speed != SPEED_100 &&
+	    speed != SPEED_1000)
+		return -EINVAL;
+	if (cmd->base.duplex != DUPLEX_HALF && cmd->base.duplex != DUPLEX_FULL)
+		return -EINVAL;
+	if (cmd->base.port != PORT_MII)
+		return -EINVAL;
+	if (cmd->base.phy_address != mii->phy_id)
+		return -EINVAL;
+	if (cmd->base.autoneg != AUTONEG_DISABLE &&
+	    cmd->base.autoneg != AUTONEG_ENABLE)
+		return -EINVAL;
+	if ((speed == SPEED_1000) && (!mii->supports_gmii))
+		return -EINVAL;
+
+	/* ignore supported, maxtxpkt, maxrxpkt */
+
+	if (cmd->base.autoneg == AUTONEG_ENABLE) {
+		u32 bmcr, advert, tmp;
+		u32 advert2 = 0, tmp2 = 0;
+		u32 advertising;
+
+		ethtool_convert_link_mode_to_legacy_u32(
+			&advertising, cmd->link_modes.advertising);
+
+		if ((advertising & (ADVERTISED_10baseT_Half |
+				    ADVERTISED_10baseT_Full |
+				    ADVERTISED_100baseT_Half |
+				    ADVERTISED_100baseT_Full |
+				    ADVERTISED_1000baseT_Half |
+				    ADVERTISED_1000baseT_Full)) == 0)
+			return -EINVAL;
+
+		/* advertise only what has been requested */
+		advert = mii->mdio_read(dev, mii->phy_id, MII_ADVERTISE);
+		tmp = advert & ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
+		if (mii->supports_gmii) {
+			advert2 = mii->mdio_read(dev, mii->phy_id,
+						 MII_CTRL1000);
+			tmp2 = advert2 &
+				~(ADVERTISE_1000HALF | ADVERTISE_1000FULL);
+		}
+		tmp |= ethtool_adv_to_mii_adv_t(advertising);
+
+		if (mii->supports_gmii)
+			tmp2 |= ethtool_adv_to_mii_ctrl1000_t(advertising);
+		if (advert != tmp) {
+			mii->mdio_write(dev, mii->phy_id, MII_ADVERTISE, tmp);
+			mii->advertising = tmp;
+		}
+		if ((mii->supports_gmii) && (advert2 != tmp2))
+			mii->mdio_write(dev, mii->phy_id, MII_CTRL1000, tmp2);
+
+		/* turn on autonegotiation, and force a renegotiate */
+		bmcr = mii->mdio_read(dev, mii->phy_id, MII_BMCR);
+		bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
+		mii->mdio_write(dev, mii->phy_id, MII_BMCR, bmcr);
+
+		mii->force_media = 0;
+	} else {
+		u32 bmcr, tmp;
+
+		/* turn off auto negotiation, set speed and duplexity */
+		bmcr = mii->mdio_read(dev, mii->phy_id, MII_BMCR);
+		tmp = bmcr & ~(BMCR_ANENABLE | BMCR_SPEED100 |
+			       BMCR_SPEED1000 | BMCR_FULLDPLX);
+		if (speed == SPEED_1000)
+			tmp |= BMCR_SPEED1000;
+		else if (speed == SPEED_100)
+			tmp |= BMCR_SPEED100;
+		if (cmd->base.duplex == DUPLEX_FULL) {
+			tmp |= BMCR_FULLDPLX;
+			mii->full_duplex = 1;
+		} else {
+			mii->full_duplex = 0;
+		}
+		if (bmcr != tmp)
+			mii->mdio_write(dev, mii->phy_id, MII_BMCR, tmp);
+
+		mii->force_media = 1;
+	}
+	return 0;
+}
+EXPORT_SYMBOL(mii_ethtool_set_link_ksettings);
+
+
+/**
+ * mii_ethtool_get_link_ksettings - get settings that are specified in @cmd
+ * @mii: MII interface
+ * @cmd: requested ethtool_link_ksettings
+ *
+ * The @cmd parameter is expected to have been cleared before calling
+ * mii_ethtool_get_link_ksettings().
+ *
+ * Returns 0 for success, negative on error.
+ */
+int mii_ethtool_get_link_ksettings(struct mii_if_info *mii,
+				   struct ethtool_link_ksettings *cmd)
+{
+	struct net_device *dev = mii->dev;
+	u16 bmcr, bmsr, ctrl1000 = 0, stat1000 = 0;
+	u32 nego, supported, advertising, lp_advertising;
+
+	supported = (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
+		     SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
+		     SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII);
+	if (mii->supports_gmii)
+		supported |= SUPPORTED_1000baseT_Half |
+			SUPPORTED_1000baseT_Full;
+
+	/* only supports twisted-pair */
+	cmd->base.port = PORT_MII;
+
+	/* this isn't fully supported at higher layers */
+	cmd->base.phy_address = mii->phy_id;
+	cmd->base.mdio_support = ETH_MDIO_SUPPORTS_C22;
+
+	advertising = ADVERTISED_TP | ADVERTISED_MII;
+
+	bmcr = mii->mdio_read(dev, mii->phy_id, MII_BMCR);
+	bmsr = mii->mdio_read(dev, mii->phy_id, MII_BMSR);
+	if (mii->supports_gmii) {
+		ctrl1000 = mii->mdio_read(dev, mii->phy_id, MII_CTRL1000);
+		stat1000 = mii->mdio_read(dev, mii->phy_id, MII_STAT1000);
+	}
+	if (bmcr & BMCR_ANENABLE) {
+		advertising |= ADVERTISED_Autoneg;
+		cmd->base.autoneg = AUTONEG_ENABLE;
+
+		advertising |= mii_get_an(mii, MII_ADVERTISE);
+		if (mii->supports_gmii)
+			advertising |= mii_ctrl1000_to_ethtool_adv_t(ctrl1000);
+
+		if (bmsr & BMSR_ANEGCOMPLETE) {
+			lp_advertising = mii_get_an(mii, MII_LPA);
+			lp_advertising |=
+					mii_stat1000_to_ethtool_lpa_t(stat1000);
+		} else {
+			lp_advertising = 0;
+		}
+
+		nego = advertising & lp_advertising;
+
+		if (nego & (ADVERTISED_1000baseT_Full |
+			    ADVERTISED_1000baseT_Half)) {
+			cmd->base.speed = SPEED_1000;
+			cmd->base.duplex = !!(nego & ADVERTISED_1000baseT_Full);
+		} else if (nego & (ADVERTISED_100baseT_Full |
+				   ADVERTISED_100baseT_Half)) {
+			cmd->base.speed = SPEED_100;
+			cmd->base.duplex = !!(nego & ADVERTISED_100baseT_Full);
+		} else {
+			cmd->base.speed = SPEED_10;
+			cmd->base.duplex = !!(nego & ADVERTISED_10baseT_Full);
+		}
+	} else {
+		cmd->base.autoneg = AUTONEG_DISABLE;
+
+		cmd->base.speed = ((bmcr & BMCR_SPEED1000 &&
+				    (bmcr & BMCR_SPEED100) == 0) ?
+				   SPEED_1000 :
+				   ((bmcr & BMCR_SPEED100) ?
+				    SPEED_100 : SPEED_10));
+		cmd->base.duplex = (bmcr & BMCR_FULLDPLX) ?
+			DUPLEX_FULL : DUPLEX_HALF;
+
+		lp_advertising = 0;
+	}
+
+	mii->full_duplex = cmd->base.duplex;
+
+	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
+						supported);
+	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
+						advertising);
+	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.lp_advertising,
+						lp_advertising);
+
+	/* ignore maxtxpkt, maxrxpkt for now */
+
+	return 0;
+}
+EXPORT_SYMBOL(mii_ethtool_get_link_ksettings);
+#endif /* LINUX_VERSION_IS_GEQ(4,6,0) */
diff --git a/dependencies b/dependencies
index 43afe487..f97e12ad 100644
--- a/dependencies
+++ b/dependencies
@@ -153,3 +153,7 @@ LIBERTAS 4.3
 
 # some prototypes changed - might be fixable but I'm lazy
 NFC_WILINK 4.8
+
+# struct ethtool_link_ksettings is missing, I'm lazy
+USB_USBNET 4.6
+USB_NET_RNDIS_WLAN 4.6
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 06/21] patches: adapt the stat64 usage for usbnet
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 05/21] header: backport mii_ethtool_{get,set}_link_ksettings() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 07/21] header: add module_param_hw_array() Hauke Mehrtens
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

The usbnet driver shares the stat64 implementation over multiple drivers
and file, the spatch is not able to handle this, add a manual patch to
work around this problem.

The spatch is still modifying all usbnet drivers, but the function gets
exported by the usbnet main driver now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0075-ndo-stats-64.cocci        |  2 +-
 patches/0075-ndo-stats-64/usbnet.patch | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 patches/0075-ndo-stats-64/usbnet.patch

diff --git a/patches/0075-ndo-stats-64.cocci b/patches/0075-ndo-stats-64.cocci
index 756be958..86131824 100644
--- a/patches/0075-ndo-stats-64.cocci
+++ b/patches/0075-ndo-stats-64.cocci
@@ -18,7 +18,7 @@ identifier r.stats64_fn;
 @@
 void stats64_fn(...) {...}
 +#if LINUX_VERSION_IS_LESS(4,11,0)
-+static struct rtnl_link_stats64 *
++struct rtnl_link_stats64 *
 +stats64_fn_wrap(struct net_device *dev,
 +		 struct rtnl_link_stats64 *stats)
 +{
diff --git a/patches/0075-ndo-stats-64/usbnet.patch b/patches/0075-ndo-stats-64/usbnet.patch
new file mode 100644
index 00000000..09de2784
--- /dev/null
+++ b/patches/0075-ndo-stats-64/usbnet.patch
@@ -0,0 +1,26 @@
+diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
+index 095bcfd..6305c41 100644
+--- a/drivers/net/usb/usbnet.c
++++ b/drivers/net/usb/usbnet.c
+@@ -1014,6 +1014,7 @@
+ 	}
+ }
+ EXPORT_SYMBOL_GPL(usbnet_get_stats64);
++EXPORT_SYMBOL_GPL(bp_usbnet_get_stats64);
+ 
+ u32 usbnet_get_link (struct net_device *net)
+ {
+diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
+index 9711637..363f6b9 100644
+--- a/include/linux/usb/usbnet.h
++++ b/include/linux/usb/usbnet.h
+@@ -283,5 +283,9 @@ extern void usbnet_status_stop(struct usbnet *dev);
+ extern void usbnet_update_max_qlen(struct usbnet *dev);
+ extern void usbnet_get_stats64(struct net_device *dev,
+ 			       struct rtnl_link_stats64 *stats);
++#if LINUX_VERSION_IS_LESS(4,11,0)
++struct rtnl_link_stats64 *
++bp_usbnet_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats);
++#endif
+ 
+ #endif /* __LINUX_USB_USBNET_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 07/21] header: add module_param_hw_array()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (5 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 06/21] patches: adapt the stat64 usage for usbnet Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-09-06 15:00   ` Johannes Berg
  2017-08-21 22:28 ` [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios() Hauke Mehrtens
                   ` (14 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This macro is used for some module parameters.

This hwtype was newly introduced for module parameters in kernel 4.12,
just ignore it on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/moduleparam.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backport/backport-include/linux/moduleparam.h b/backport/backport-include/linux/moduleparam.h
index 1c7dfad4..9a8e03b5 100644
--- a/backport/backport-include/linux/moduleparam.h
+++ b/backport/backport-include/linux/moduleparam.h
@@ -36,4 +36,9 @@ extern int param_get_ullong(char *buffer, const struct kernel_param *kp);
 #define param_check_ullong(name, p) __param_check(name, p, unsigned long long)
 #endif
 
+#if LINUX_VERSION_IS_LESS(4,12,0)
+#define module_param_hw_array(name, type, hwtype, nump, perm) \
+	module_param_array(name, type, nump, perm)
+#endif
+
 #endif /* __BACKPORT_LINUX_MODULEPARAM_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (6 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 07/21] header: add module_param_hw_array() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-09-06 15:01   ` Johannes Berg
  2017-08-21 22:28 ` [PATCH 09/21] header: add get_random_u32() Hauke Mehrtens
                   ` (13 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This is used by some NFC drivers to get information from the ACPI.
This was added in kernel 4.13, but backporting it to older kernel
versions than 3.19 is hard because such old kernel versions do not even
have struct acpi_gpio_mapping. This only adds the empty version of this
function as this normally needed some extra support in the generic ACPI
code and I do not care about this functionality.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/acpi.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/backport-include/linux/acpi.h b/backport/backport-include/linux/acpi.h
index c63648b6..fe183626 100644
--- a/backport/backport-include/linux/acpi.h
+++ b/backport/backport-include/linux/acpi.h
@@ -60,4 +60,13 @@ static inline struct acpi_device *_acpi_get_companion(struct device *dev)
 static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
 #endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
 
+#if LINUX_VERSION_IN_RANGE(3,19,0, 4,13,0)
+#define devm_acpi_dev_add_driver_gpios LINUX_BACKPORT(devm_acpi_dev_add_driver_gpios)
+static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
+			      const struct acpi_gpio_mapping *gpios)
+{
+	return -ENXIO;
+}
+#endif /* LINUX_VERSION_IN_RANGE(4,19,0, 4,13,0) */
+
 #endif /* __BACKPORT_LINUX_ACPI_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 09/21] header: add get_random_u32()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (7 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 10/21] header: rename wait_queue_entry_t to wait_queue_t Hauke Mehrtens
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This was renamed in upstream kernel and changed from unsigned int to u32.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/random.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/linux/random.h b/backport/backport-include/linux/random.h
index a9dda73b..7d817d8b 100644
--- a/backport/backport-include/linux/random.h
+++ b/backport/backport-include/linux/random.h
@@ -42,4 +42,11 @@ static inline u32 prandom_u32_max(u32 ep_ro)
 }
 #endif /* LINUX_VERSION_IS_LESS(3,14,0) */
 
+#if LINUX_VERSION_IS_LESS(4,11,0)
+static inline u32 get_random_u32(void)
+{
+	return get_random_int();
+}
+#endif
+
 #endif /* __BACKPORT_RANDOM_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 10/21] header: rename wait_queue_entry_t to wait_queue_t
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (8 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 09/21] header: add get_random_u32() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 11/21] backport: add __print_array() Hauke Mehrtens
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

In kernel 4.13 wait_queue_t was renamed to wait_queue_entry_t, reverse
this for older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/wait.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backport/backport-include/linux/wait.h b/backport/backport-include/linux/wait.h
index 3059ff1d..c4b1114e 100644
--- a/backport/backport-include/linux/wait.h
+++ b/backport/backport-include/linux/wait.h
@@ -76,4 +76,8 @@ wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
 #endif
 #endif
 
+#if LINUX_VERSION_IS_LESS(4,13,0)
+#define wait_queue_entry_t wait_queue_t
+#endif
+
 #endif /* __BACKPORT_LINUX_WAIT_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 11/21] backport: add __print_array()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (9 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 10/21] header: rename wait_queue_entry_t to wait_queue_t Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c Hauke Mehrtens
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This is used in the tracing system and needed by wireless now, it was
introduced in commit 6ea22486ba46bc ("tracing: Add array printing
helper").
This code is copied from kernel 4.0.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/ftrace_event.h | 10 ++++++
 backport/backport-include/trace/ftrace.h       |  9 +++++
 backport/compat/backport-4.0.c                 | 46 ++++++++++++++++++++++++++
 3 files changed, 65 insertions(+)
 create mode 100644 backport/backport-include/linux/ftrace_event.h
 create mode 100644 backport/backport-include/trace/ftrace.h

diff --git a/backport/backport-include/linux/ftrace_event.h b/backport/backport-include/linux/ftrace_event.h
new file mode 100644
index 00000000..edea21ee
--- /dev/null
+++ b/backport/backport-include/linux/ftrace_event.h
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_FTRACE_EVENT_H
+#define __BACKPORT_LINUX_FTRACE_EVENT_H
+#include_next <linux/ftrace_event.h>
+
+#if LINUX_VERSION_IS_LESS(4,0,0)
+const char *ftrace_print_array_seq(struct trace_seq *p,
+				   const void *buf, int buf_len,
+				   size_t el_size);
+#endif
+#endif /* __BACKPORT_LINUX_FTRACE_EVENT_H */
diff --git a/backport/backport-include/trace/ftrace.h b/backport/backport-include/trace/ftrace.h
new file mode 100644
index 00000000..5fda0ce5
--- /dev/null
+++ b/backport/backport-include/trace/ftrace.h
@@ -0,0 +1,9 @@
+#undef __print_array
+#define __print_array(array, count, el_size)				\
+	({								\
+		BUILD_BUG_ON(el_size != 1 && el_size != 2 &&		\
+			     el_size != 4 && el_size != 8);		\
+		ftrace_print_array_seq(p, array, count, el_size);	\
+	})
+
+#include_next <trace/ftrace.h>
diff --git a/backport/compat/backport-4.0.c b/backport/compat/backport-4.0.c
index 8ae16115..71095f19 100644
--- a/backport/compat/backport-4.0.c
+++ b/backport/compat/backport-4.0.c
@@ -14,6 +14,8 @@
 #include <linux/ctype.h>
 #include <linux/printk.h>
 #include <linux/export.h>
+#include <linux/trace_seq.h>
+#include <linux/ftrace_event.h>
 #include <asm/unaligned.h>
 
 static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
@@ -321,3 +323,47 @@ overflow1:
 	return ascii ? ascii_column + len : (groupsize * 2 + 1) * ngroups - 1;
 }
 EXPORT_SYMBOL_GPL(hex_dump_to_buffer);
+
+const char *
+ftrace_print_array_seq(struct trace_seq *p, const void *buf, int buf_len,
+		       size_t el_size)
+{
+	const char *ret = trace_seq_buffer_ptr(p);
+	const char *prefix = "";
+	void *ptr = (void *)buf;
+
+	trace_seq_putc(p, '{');
+
+	while (ptr < buf + buf_len) {
+		switch (el_size) {
+		case 1:
+			trace_seq_printf(p, "%s0x%x", prefix,
+					 *(u8 *)ptr);
+			break;
+		case 2:
+			trace_seq_printf(p, "%s0x%x", prefix,
+					 *(u16 *)ptr);
+			break;
+		case 4:
+			trace_seq_printf(p, "%s0x%x", prefix,
+					 *(u32 *)ptr);
+			break;
+		case 8:
+			trace_seq_printf(p, "%s0x%llx", prefix,
+					 *(u64 *)ptr);
+			break;
+		default:
+			trace_seq_printf(p, "BAD SIZE:%zu 0x%x", el_size,
+					 *(u8 *)ptr);
+			el_size = 1;
+		}
+		prefix = ",";
+		ptr += el_size;
+	}
+
+	trace_seq_putc(p, '}');
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+EXPORT_SYMBOL(ftrace_print_array_seq);
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (10 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 11/21] backport: add __print_array() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-09-06 15:05   ` Johannes Berg
  2017-08-21 22:28 ` [PATCH 13/21] patch: Allow usage of pci_error_handlers->reset_notify Hauke Mehrtens
                   ` (9 subsequent siblings)
  21 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This reverts commit 12e8fd6fd3802 ("lib/rhashtable.c: use kvzalloc() in
bucket_table_alloc() when possible") from upstream kernel.
Kernel versions older that 4.12 do not have kvzalloc() try to avoid the
usage of this.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/lib-rhashtable.patch | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/patches/lib-rhashtable.patch b/patches/lib-rhashtable.patch
index 9c262b02..35424efb 100644
--- a/patches/lib-rhashtable.patch
+++ b/patches/lib-rhashtable.patch
@@ -27,6 +27,19 @@
  		if (!tbl->locks)
  			return -ENOMEM;
  		for (i = 0; i < size; i++)
--- 
-1.9.1
+@@ -226,10 +226,11 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht,
+ 	int i;
+ 
+ 	size = sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]);
+-	if (gfp != GFP_KERNEL)
++	if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER) ||
++	    gfp != GFP_KERNEL)
+ 		tbl = kzalloc(size, gfp | __GFP_NOWARN | __GFP_NORETRY);
+-	else
+-		tbl = kvzalloc(size, gfp);
++	if (tbl == NULL && gfp == GFP_KERNEL)
++		tbl = vzalloc(size);
+ 
+ 	size = nbuckets;
+ 
 
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 13/21] patch: Allow usage of pci_error_handlers->reset_notify
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (11 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 14/21] header: add offsetofend() Hauke Mehrtens
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

The member reset_notify in the struct pci_error_handlers was divided
into reset_prepare and reset_done in upstream commit 775755ed3c65fb
("PCI: Split ->reset_notify() method into ->reset_prepare() and
->reset_done()"). Make new code also work with old kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0082-pci_error_handlers.cocci | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 patches/0082-pci_error_handlers.cocci

diff --git a/patches/0082-pci_error_handlers.cocci b/patches/0082-pci_error_handlers.cocci
new file mode 100644
index 00000000..9b5573d4
--- /dev/null
+++ b/patches/0082-pci_error_handlers.cocci
@@ -0,0 +1,32 @@
+@r@
+identifier OPS;
+identifier pcie_reset_prepare_fn;
+identifier pcie_reset_done_fn;
+fresh identifier pcie_reset_notify_fn = pcie_reset_prepare_fn ## "_notify";
+position p;
+@@
+struct pci_error_handlers OPS@p = {
++#if LINUX_VERSION_IS_GEQ(4,13,0)
+	.reset_prepare = pcie_reset_prepare_fn,
+	.reset_done = pcie_reset_done_fn,
++#else
++	.reset_notify = pcie_reset_notify_fn,
++#endif
+};
+
+
+@@
+identifier r.pcie_reset_prepare_fn;
+identifier r.pcie_reset_done_fn;
+identifier r.pcie_reset_notify_fn;
+@@
+void pcie_reset_done_fn(...) {...}
++#if LINUX_VERSION_IS_LESS(4,13,0)
++static void pcie_reset_notify_fn(struct pci_dev *dev, bool prepare)
++{
++	if (prepare)
++		pcie_reset_prepare_fn(dev);
++	else
++		pcie_reset_done_fn(dev);
++}
++#endif
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 14/21] header: add offsetofend()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (12 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 13/21] patch: Allow usage of pci_error_handlers->reset_notify Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 15/21] dependencies: add deps for struct acpi_gpio_mapping Hauke Mehrtens
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

offsetofend() was moved from vfio.h to stddef.h in commit
3876488444e7123 ("include/stddef.h: Move offsetofend() from vfio.h to a
generic kernel header") for kernel 4.1. Add it again to stddef.h so it
is available in more include paths.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/stddef.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 backport/backport-include/linux/stddef.h

diff --git a/backport/backport-include/linux/stddef.h b/backport/backport-include/linux/stddef.h
new file mode 100644
index 00000000..2c836b00
--- /dev/null
+++ b/backport/backport-include/linux/stddef.h
@@ -0,0 +1,16 @@
+#ifndef __BACKPORT_LINUX_STDDEF_H
+#define __BACKPORT_LINUX_STDDEF_H
+#include_next <linux/stddef.h>
+
+#ifndef offsetofend
+/**
+ * offsetofend(TYPE, MEMBER)
+ *
+ * @TYPE: The type of the structure
+ * @MEMBER: The member within the structure to get the end offset of
+ */
+#define offsetofend(TYPE, MEMBER) \
+	(offsetof(TYPE, MEMBER)	+ sizeof(((TYPE *)0)->MEMBER))
+#endif
+
+#endif /* __BACKPORT_LINUX_STDDEF_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 15/21] dependencies: add deps for struct acpi_gpio_mapping
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (13 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 14/21] header: add offsetofend() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Hauke Mehrtens
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

These NFC drivers are using struct acpi_gpio_mapping which was added in
kernel 3.19. Do not try to build them on older kernel versions where
this structures is not available.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 dependencies | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/dependencies b/dependencies
index f97e12ad..9b46abc1 100644
--- a/dependencies
+++ b/dependencies
@@ -58,11 +58,12 @@ NFC_PN544_I2C 3.17
 # this needs devm_gpiod_get_index() with 4 arguments.
 NFC_NXP_NCI_I2C 3.17
 
-# this needs device_property..() functions
-NFC_FDP_I2C 3.18
-NFC_ST21NFCA_I2C 3.18
-NFC_ST_NCI_I2C 3.18
-NFC_ST_NCI_SPI 3.18
+# this needs device_property..() functions and struct acpi_gpio_mapping
+NFC_FDP_I2C 3.19
+NFC_ST21NFCA_I2C 3.19
+NFC_ST_NCI_I2C 3.19
+NFC_ST_NCI_SPI 3.19
+NFC_PN544_I2C 3.19
 
 # for whoever wants to backport this: GPIOF_EXPORT was redefined via commit
 # 79a9becd on v3.13-rc1~120^2~15, before this it was redefined via commit
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 16/21] patches: brcmfmac: fix netdev destructor
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (14 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 15/21] dependencies: add deps for struct acpi_gpio_mapping Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-09-06 15:05   ` Johannes Berg
  2017-09-13 19:36   ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Arend van Spriel
  2017-08-21 22:28 ` [PATCH 17/21] patches: backport the probe_new for i2c drivers Hauke Mehrtens
                   ` (5 subsequent siblings)
  21 siblings, 2 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

brcmfmac uses a complicated netdev destructor handling. The
brcmf_net_attach() function just adds a normal destructor and later the
brcmf_add_if() function sets the needs_free_netdev callback.

The normal spatch was not applied correctly to this file, add a patch
before to try to fx this problem manually.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0079-netdev-destructor/brcmfmac.patch | 35 +++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 patches/0079-netdev-destructor/brcmfmac.patch

diff --git a/patches/0079-netdev-destructor/brcmfmac.patch b/patches/0079-netdev-destructor/brcmfmac.patch
new file mode 100644
index 00000000..3f328b26
--- /dev/null
+++ b/patches/0079-netdev-destructor/brcmfmac.patch
@@ -0,0 +1,35 @@
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+index b5a561b..6f5466f 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -462,6 +462,18 @@ static const struct net_device_ops brcmf_netdev_ops_pri = {
+ 	.ndo_set_rx_mode = brcmf_netdev_set_multicast_list
+ };
+ 
++#undef netdev_set_priv_destructor
++#define netdev_set_priv_destructor(_dev, _destructor) \
++	(_dev)->destructor = _destructor
++
++#if LINUX_VERSION_IS_LESS(4,12,0)
++static void __brcmf_cfg80211_free_netdev(struct net_device *ndev)
++{
++	brcmf_cfg80211_free_netdev(ndev);
++	free_netdev(ndev);
++}
++#endif
++
+ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked)
+ {
+ 	struct brcmf_pub *drvr = ifp->drvr;
+@@ -634,7 +646,11 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
+ 		if (!ndev)
+ 			return ERR_PTR(-ENOMEM);
+ 
++#if LINUX_VERSION_IS_LESS(4,12,0)
++		ndev->priv_destructor = __brcmf_cfg80211_free_netdev;
++#else
+ 		ndev->needs_free_netdev = true;
++#endif
+ 		ifp = netdev_priv(ndev);
+ 		ifp->ndev = ndev;
+ 		/* store mapping ifidx to bsscfgidx */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 17/21] patches: backport the probe_new for i2c drivers
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (15 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 18/21] patches: adapt signature of proto_ops->accept Hauke Mehrtens
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

I2C got a new probe function which does not take the struct
i2c_device_id any more, backport this to older kernel versions with a
spatch.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0080-i2c-proble-new.cocci | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 patches/0080-i2c-proble-new.cocci

diff --git a/patches/0080-i2c-proble-new.cocci b/patches/0080-i2c-proble-new.cocci
new file mode 100644
index 00000000..35580aca
--- /dev/null
+++ b/patches/0080-i2c-proble-new.cocci
@@ -0,0 +1,25 @@
+@r@
+identifier OPS;
+identifier i2c_probe;
+fresh identifier i2c_probe_wrap = "bp_" ## i2c_probe;
+position p;
+@@
+struct i2c_driver OPS@p = {
++#if LINUX_VERSION_IS_GEQ(4,10,0)
+	.probe_new = i2c_probe,
++#else
++	.probe = i2c_probe_wrap,
++#endif
+};
+
+@@
+identifier r.i2c_probe_wrap;
+identifier r.i2c_probe;
+@@
+int i2c_probe(...) {...}
++#if LINUX_VERSION_IS_LESS(4,10,0)
++static int i2c_probe_wrap(struct i2c_client *client, const struct i2c_device_id *id)
++{
++	return i2c_probe(client);
++}
++#endif
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 18/21] patches: adapt signature of proto_ops->accept
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (16 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 17/21] patches: backport the probe_new for i2c drivers Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 19/21] header: add linux/refcount.h Hauke Mehrtens
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

In commit cdfbabfb2f0ce ("net: Work around lockdep limitation in sockets
that use sockets") a extra parameter was added to proto_ops->accept(),
do not assume it on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0081-proto_ops-accept/nfc.patch | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 patches/0081-proto_ops-accept/nfc.patch

diff --git a/patches/0081-proto_ops-accept/nfc.patch b/patches/0081-proto_ops-accept/nfc.patch
new file mode 100644
index 00000000..decd13a8
--- /dev/null
+++ b/patches/0081-proto_ops-accept/nfc.patch
@@ -0,0 +1,16 @@
+diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
+index 043c6d3..5b4e44c 100644
+--- a/net/nfc/llcp_sock.c
++++ b/net/nfc/llcp_sock.c
+@@ -443,7 +443,11 @@ struct sock *nfc_llcp_accept_dequeue(struct sock *parent,
+ }
+ 
+ static int llcp_sock_accept(struct socket *sock, struct socket *newsock,
++#if LINUX_VERSION_IS_GEQ(4,11,0)
+ 			    int flags, bool kern)
++#else
++			    int flags)
++#endif
+ {
+ 	DECLARE_WAITQUEUE(wait, current);
+ 	struct sock *sk = sock->sk, *new_sk;
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 19/21] header: add linux/refcount.h
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (17 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 18/21] patches: adapt signature of proto_ops->accept Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 20/21] header: add dma_wmb() Hauke Mehrtens
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

Add the new linux/refcount.h header file.  This was added in kernel 4.11
and is used by some drivers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/refcount.h | 47 ++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 backport/backport-include/linux/refcount.h

diff --git a/backport/backport-include/linux/refcount.h b/backport/backport-include/linux/refcount.h
new file mode 100644
index 00000000..96219f76
--- /dev/null
+++ b/backport/backport-include/linux/refcount.h
@@ -0,0 +1,47 @@
+#ifndef __BACKPORT_LINUX_REFCOUNT_H
+#define __BACKPORT_LINUX_REFCOUNT_H
+#if LINUX_VERSION_IS_GEQ(4,11,0)
+#include_next <linux/refcount.h>
+#else
+
+#include <linux/atomic.h>
+#include <linux/mutex.h>
+#include <linux/spinlock.h>
+#include <linux/kernel.h>
+
+/**
+ * refcount_t - variant of atomic_t specialized for reference counts
+ * @refs: atomic_t counter field
+ *
+ * The counter saturates at UINT_MAX and will not move once
+ * there. This avoids wrapping the counter and causing 'spurious'
+ * use-after-free bugs.
+ */
+typedef struct refcount_struct {
+	atomic_t refs;
+} refcount_t;
+
+#define REFCOUNT_INIT(n)	{ .refs = ATOMIC_INIT(n), }
+
+/**
+ * refcount_set - set a refcount's value
+ * @r: the refcount
+ * @n: value to which the refcount will be set
+ */
+static inline void refcount_set(refcount_t *r, unsigned int n)
+{
+	atomic_set(&r->refs, n);
+}
+
+static inline void refcount_inc(refcount_t *r)
+{
+	atomic_inc(&r->refs);
+}
+
+static inline __must_check bool refcount_dec_and_test(refcount_t *r)
+{
+	return atomic_dec_and_test(&r->refs);
+}
+
+#endif /* LINUX_VERSION_IS_GEQ(4,11,0) */
+#endif /* __BACKPORT_LINUX_REFCOUNT_H */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 20/21] header: add dma_wmb()
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (18 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 19/21] header: add linux/refcount.h Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-08-21 22:28 ` [PATCH 21/21] copy-list: add quantenna qtnfmac driver Hauke Mehrtens
  2017-09-05  9:00 ` [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Johannes Berg
  21 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This is used by the qtnfmac driver.
This was added in commit 1077fa36f23e259 ("arch: Add lightweight memory
barriers dma_rmb() and dma_wmb()")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/asm/barrier.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backport/backport-include/asm/barrier.h b/backport/backport-include/asm/barrier.h
index 9147fb05..9e1e1f11 100644
--- a/backport/backport-include/asm/barrier.h
+++ b/backport/backport-include/asm/barrier.h
@@ -11,6 +11,10 @@
 #define dma_rmb()	rmb()
 #endif
 
+#ifndef dma_wmb
+#define dma_wmb()	wmb()
+#endif
+
 #ifndef smp_mb__after_atomic
 #define smp_mb__after_atomic smp_mb__after_clear_bit
 #endif
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH 21/21] copy-list: add quantenna qtnfmac driver
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (19 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 20/21] header: add dma_wmb() Hauke Mehrtens
@ 2017-08-21 22:28 ` Hauke Mehrtens
  2017-09-06 15:10   ` Johannes Berg
  2017-09-05  9:00 ` [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Johannes Berg
  21 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-08-21 22:28 UTC (permalink / raw)
  To: johannes; +Cc: backports, Hauke Mehrtens

This driver was compile tested on kernel 3.18 and 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 copy-list | 1 +
 1 file changed, 1 insertion(+)

diff --git a/copy-list b/copy-list
index 17afcb4c..88e91c61 100644
--- a/copy-list
+++ b/copy-list
@@ -73,6 +73,7 @@ drivers/net/wireless/ralink/
 drivers/net/wireless/zydas/
 drivers/net/wireless/marvell/
 drivers/net/wireless/intersil/
+drivers/net/wireless/quantenna/
 drivers/net/wireless/realtek/
 drivers/net/wireless/ti/
 drivers/net/wireless/mediatek/
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6
  2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
                   ` (20 preceding siblings ...)
  2017-08-21 22:28 ` [PATCH 21/21] copy-list: add quantenna qtnfmac driver Hauke Mehrtens
@ 2017-09-05  9:00 ` Johannes Berg
  2017-09-05 21:41   ` Hauke Mehrtens
  2017-09-13 20:00   ` Arend van Spriel
  21 siblings, 2 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-05  9:00 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

Hi Hauke,

> This was build tested with kernel 3.18, 4.4 and 4.9. and runtime
> tested with iwlwifi on kernel 4.9.

Cool.

> Are you planing to to releases in a tar?

Not personally, no. I barely have time to do any maintenance here to
start with, and still haven't set up any infrastructure to allow others
to really help out significantly.

> Which kernel versions are currently support by backports?

I think we didn't really change anything, so should be 3.0+

> patches/0079-netdev-destructor.cocci takes very long to apply, about
> 3 times longer all others together.

I doubt we can do anything about that.

> Should we remove ssb and bcma from backports and use the in kernel 
> versions instead? I do not expect so many changes any more affecting
> the wifi drivers.

I have no opinion either way.

> Is the compat wireless build server still being used?

It's still *there*, but I haven't really used it in a long time. I was
planning to set up some kind of auto-builder but haven't gotten around
to it.

johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6
  2017-09-05  9:00 ` [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Johannes Berg
@ 2017-09-05 21:41   ` Hauke Mehrtens
  2017-09-06  7:23     ` Johannes Berg
  2017-09-13 20:00   ` Arend van Spriel
  1 sibling, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-09-05 21:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports

On 09/05/2017 11:00 AM, Johannes Berg wrote:
> Hi Hauke,
> 
>> This was build tested with kernel 3.18, 4.4 and 4.9. and runtime
>> tested with iwlwifi on kernel 4.9.
> 
> Cool.

I have some patches to use it in LEDE, and tried it there with ath9k and
ath10k, but hope to do some more testing.

>> Are you planing to to releases in a tar?
> 
> Not personally, no. I barely have time to do any maintenance here to
> start with, and still haven't set up any infrastructure to allow others
> to really help out significantly.
> 
>> Which kernel versions are currently support by backports?
> 
> I think we didn't really change anything, so should be 3.0+

I would prefer to drop everything < 3.10, or do not care about older
kernel versions. For LEDE I am only interested in 3.18 or 4.4 and more
recent.

>> patches/0079-netdev-destructor.cocci takes very long to apply, about
>> 3 times longer all others together.
> 
> I doubt we can do anything about that.
> 
>> Should we remove ssb and bcma from backports and use the in kernel 
>> versions instead? I do not expect so many changes any more affecting
>> the wifi drivers.
> 
> I have no opinion either way.

When I find some time I will check how much problems with will cause for
kernel >= 3.10.

>> Is the compat wireless build server still being used?
> 
> It's still *there*, but I haven't really used it in a long time. I was
> planning to set up some kind of auto-builder but haven't gotten around
> to it.
> 
> johannes
> 

How do we want to proceed with these patches?

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6
  2017-09-05 21:41   ` Hauke Mehrtens
@ 2017-09-06  7:23     ` Johannes Berg
  0 siblings, 0 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-06  7:23 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

On Tue, 2017-09-05 at 23:41 +0200, Hauke Mehrtens wrote:
> 
> I would prefer to drop everything < 3.10, or do not care about older
> kernel versions. For LEDE I am only interested in 3.18 or 4.4 and
> more recent.

I think internally we still might care about some older versions, not
sure though.

There's also still a 3.2 and 3.4 LTS kernel on kernel.org, with the
former (3.2) having been updated just a week ago or so.

Perhaps we should phase out older non-LTS kernels, but how much effort
would that be, and how much effort is going into those older kernels
anyway?

> How do we want to proceed with these patches?

I just got back from sabbatical, but once I have some more time I'll go
ahead and review/apply them, and hopefully also start working on some
auto-building infrastructure.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 01/21] copy: do not copy files removed in kernel 4.13
  2017-08-21 22:27 ` [PATCH 01/21] copy: do not copy files removed in kernel 4.13 Hauke Mehrtens
@ 2017-09-06 14:56   ` Johannes Berg
  0 siblings, 0 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 14:56 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

This and patch 2 were already covered by AceLan Kao's patches.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 07/21] header: add module_param_hw_array()
  2017-08-21 22:28 ` [PATCH 07/21] header: add module_param_hw_array() Hauke Mehrtens
@ 2017-09-06 15:00   ` Johannes Berg
  0 siblings, 0 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 15:00 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

Applied 3-7.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios()
  2017-08-21 22:28 ` [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios() Hauke Mehrtens
@ 2017-09-06 15:01   ` Johannes Berg
  2017-09-06 21:58     ` Hauke Mehrtens
  0 siblings, 1 reply; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 15:01 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

On Tue, 2017-08-22 at 00:28 +0200, Hauke Mehrtens wrote:
> This is used by some NFC drivers to get information from the ACPI.
> This was added in kernel 4.13, but backporting it to older kernel
> versions than 3.19 is hard because such old kernel versions do not
> even
> have struct acpi_gpio_mapping. This only adds the empty version of
> this
> function as this normally needed some extra support in the generic
> ACPI
> code and I do not care about this functionality.


> +#if LINUX_VERSION_IN_RANGE(3,19,0, 4,13,0)

This I don't understand - you said it's hard to do for <3.19, and then
make a simple no-op for all, but don't do it for <3.19 at all?

Why not just LINUX_VERION_LESS(4,13,0)?

> +#define devm_acpi_dev_add_driver_gpios
> LINUX_BACKPORT(devm_acpi_dev_add_driver_gpios)
> +static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
> +			      const struct acpi_gpio_mapping *gpios)
> +{
> +	return -ENXIO;
> +}
> +#endif /* LINUX_VERSION_IN_RANGE(4,19,0, 4,13,0) */

Also, typo here.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 16/21] patches: brcmfmac: fix netdev destructor
  2017-08-21 22:28 ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Hauke Mehrtens
@ 2017-09-06 15:05   ` Johannes Berg
  2017-09-07  7:48     ` Arend van Spriel
  2017-09-13 19:36   ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Arend van Spriel
  1 sibling, 1 reply; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 15:05 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

Arend, can you review this?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c
  2017-08-21 22:28 ` [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c Hauke Mehrtens
@ 2017-09-06 15:05   ` Johannes Berg
  2017-09-06 22:12     ` Hauke Mehrtens
  0 siblings, 1 reply; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 15:05 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

On Tue, 2017-08-22 at 00:28 +0200, Hauke Mehrtens wrote:
> This reverts commit 12e8fd6fd3802 ("lib/rhashtable.c: use kvzalloc()
> in
> bucket_table_alloc() when possible") from upstream kernel.
> Kernel versions older that 4.12 do not have kvzalloc() try to avoid
> the
> usage of this.

Can't we backport these? There was a patch from AceLan Kao to do so in
a pretty simple fashion, but that should still be better than a patch?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 21/21] copy-list: add quantenna qtnfmac driver
  2017-08-21 22:28 ` [PATCH 21/21] copy-list: add quantenna qtnfmac driver Hauke Mehrtens
@ 2017-09-06 15:10   ` Johannes Berg
  2017-09-06 15:13     ` Johannes Berg
  2017-09-06 15:14     ` Johannes Berg
  0 siblings, 2 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 15:10 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

Alright, I've also applied

 9 - 11
13 - 15
17, 18, 20, 21

As for 12, see the question there.

On 16 I'd like Arend to take a look.

And finally 19, it seems like we should be able to just add something
like

config BPAUTO_REFCOUNT
	def_bool y
	#h-file linux/refcount.h

to compat/Kconfig and the scripting should take care of everything
else?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 21/21] copy-list: add quantenna qtnfmac driver
  2017-09-06 15:10   ` Johannes Berg
@ 2017-09-06 15:13     ` Johannes Berg
  2017-09-06 22:14       ` Hauke Mehrtens
  2017-09-06 15:14     ` Johannes Berg
  1 sibling, 1 reply; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 15:13 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

On Wed, 2017-09-06 at 17:10 +0200, Johannes Berg wrote:
> 
> And finally 19, it seems like we should be able to just add something
> like
> 
> config BPAUTO_REFCOUNT
> 	def_bool y
> 	#h-file linux/refcount.h

And perhaps that also needs
	#c-file lib/refcount.c

but even that seems reasonably self-contained?

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 21/21] copy-list: add quantenna qtnfmac driver
  2017-09-06 15:10   ` Johannes Berg
  2017-09-06 15:13     ` Johannes Berg
@ 2017-09-06 15:14     ` Johannes Berg
  1 sibling, 0 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-06 15:14 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

On Wed, 2017-09-06 at 17:10 +0200, Johannes Berg wrote:
> 
> config BPAUTO_REFCOUNT
> 	def_bool y
> 	#h-file linux/refcount.h
> 

Err, well, it also needs a kernel version dependency :)

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios()
  2017-09-06 15:01   ` Johannes Berg
@ 2017-09-06 21:58     ` Hauke Mehrtens
  2017-09-08  9:25       ` Johannes Berg
  0 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-09-06 21:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports

On 09/06/2017 05:01 PM, Johannes Berg wrote:
> On Tue, 2017-08-22 at 00:28 +0200, Hauke Mehrtens wrote:
>> This is used by some NFC drivers to get information from the ACPI.
>> This was added in kernel 4.13, but backporting it to older kernel
>> versions than 3.19 is hard because such old kernel versions do not
>> even
>> have struct acpi_gpio_mapping. This only adds the empty version of
>> this
>> function as this normally needed some extra support in the generic
>> ACPI
>> code and I do not care about this functionality.
> 
> 
>> +#if LINUX_VERSION_IN_RANGE(3,19,0, 4,13,0)
> 
> This I don't understand - you said it's hard to do for <3.19, and then
> make a simple no-op for all, but don't do it for <3.19 at all?
> 
> Why not just LINUX_VERION_LESS(4,13,0)?

struct acpi_gpio_mapping was added to kernel 3.19. We could add here a
dummy struct acpi_gpio_mapping, but the drivers anyway need more
adjustments to compile properly.

>> +#define devm_acpi_dev_add_driver_gpios
>> LINUX_BACKPORT(devm_acpi_dev_add_driver_gpios)
>> +static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
>> +			      const struct acpi_gpio_mapping *gpios)
>> +{
>> +	return -ENXIO;
>> +}
>> +#endif /* LINUX_VERSION_IN_RANGE(4,19,0, 4,13,0) */

This should be
+#endif /* LINUX_VERSION_IN_RANGE(3,19,0, 4,13,0) */

> 
> Also, typo here.
> 
> johannes
> --
> To unsubscribe from this list: send the line "unsubscribe backports" in
> 

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c
  2017-09-06 15:05   ` Johannes Berg
@ 2017-09-06 22:12     ` Hauke Mehrtens
  2017-09-08  9:25       ` Johannes Berg
  0 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-09-06 22:12 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports, AceLan Kao

On 09/06/2017 05:05 PM, Johannes Berg wrote:
> On Tue, 2017-08-22 at 00:28 +0200, Hauke Mehrtens wrote:
>> This reverts commit 12e8fd6fd3802 ("lib/rhashtable.c: use kvzalloc()
>> in
>> bucket_table_alloc() when possible") from upstream kernel.
>> Kernel versions older that 4.12 do not have kvzalloc() try to avoid
>> the
>> usage of this.
> 
> Can't we backport these? There was a patch from AceLan Kao to do so in
> a pretty simple fashion, but that should still be better than a patch?
> 
> johannes

Hi,

I think AceLan Kao's patch misses the implementation of kvmalloc_node().
We can implement this for node == NUMA_NO_NODE by using __vmalloc()
instead of __vmalloc_node_flags_caller() which should be fine.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 21/21] copy-list: add quantenna qtnfmac driver
  2017-09-06 15:13     ` Johannes Berg
@ 2017-09-06 22:14       ` Hauke Mehrtens
  0 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-09-06 22:14 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports

On 09/06/2017 05:13 PM, Johannes Berg wrote:
> On Wed, 2017-09-06 at 17:10 +0200, Johannes Berg wrote:
>>
>> And finally 19, it seems like we should be able to just add something
>> like
>>
>> config BPAUTO_REFCOUNT
>> 	def_bool y
>> 	#h-file linux/refcount.h
> 
> And perhaps that also needs
> 	#c-file lib/refcount.c
> 
> but even that seems reasonably self-contained?
> 
> johannes

I will try this. Currently the drivers are only using the header file
implementation.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 16/21] patches: brcmfmac: fix netdev destructor
  2017-09-06 15:05   ` Johannes Berg
@ 2017-09-07  7:48     ` Arend van Spriel
  2017-09-07  9:04       ` compilation errors in ath10k driver with latest backports git KAVITA MATHUR
  0 siblings, 1 reply; 48+ messages in thread
From: Arend van Spriel @ 2017-09-07  7:48 UTC (permalink / raw)
  To: Johannes Berg, Hauke Mehrtens; +Cc: backports

On 06-09-17 17:05, Johannes Berg wrote:
> Arend, can you review this?

Sorry for the late response. I saw the patch flying by and intended to 
look into it, but did not get to it yet. Raising the prio ;-)

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* compilation errors in ath10k driver with latest backports git
  2017-09-07  7:48     ` Arend van Spriel
@ 2017-09-07  9:04       ` KAVITA MATHUR
  2017-09-07  9:17         ` Arend van Spriel
  0 siblings, 1 reply; 48+ messages in thread
From: KAVITA MATHUR @ 2017-09-07  9:04 UTC (permalink / raw)
  To: Arend van Spriel, Johannes Berg, Hauke Mehrtens; +Cc: backports

Hi,

I am using backports git and ath10k git to download latest changes in ath0k driver.
There are build errors in ath10k drivers due to definitions not backported from kernel
4.12. Backpors-git is backported kernel till 4.8. Please suggest how to fix these issues.

Following is the build error log:

CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.13.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.15.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.18.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.19.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.1.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.2.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.4.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.5.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.7.o
LD [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/compat.o
CC [M]
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/main.o
CC [M]
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/regd.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/hw.o
CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/key.o
CC [M]
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/dfs_pattern_detector.o
CC [M]
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/dfs_pri_detector.o
LD [M]  /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath.o
CC [M]
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.o
In file included from
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.h:22,
               from
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.c:18:
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/core.h:465:
error: expected specifier-qualifier-list before 'guid_t'
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.c:
In function 'ath10k_tx_h_add_p2p_noa_ie':
/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.c:3492:
error: implicit declaration of function 'skb_put_data'
make[8]: ***
[/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.o]
Error 1
make[7]: ***
[/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k]
Error 2
make[6]: ***
[/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath] Error 2
make[5]: *** [/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless]
Error 2
make[4]: *** [_module_/home/shw/kavita/backports/backports-output_14Aug17] Error 2
make[3]: *** [modules] Error 2
make[2]: *** [modules] Error 2
make[1]: *** [modules] Error 2
make: *** [default] Error 2 


Thanks & Regards,
कविता माथुर Kavita Mathur 
वरिष्ठ अनुसंधान अभियंता  Senior Research Engineer 
सी-डॉट                      C-DOT
इलैक्ट्रॉनिक्स सिटी फेज़ I         Electronics City Phase I
होसूर रोड, बेंगलूरु               Hosur Road, Bengaluru – 560100
फोन  Ph 080-28529896
Disclaimer:
----------
This email and any files transmitted with it

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: compilation errors in ath10k driver with latest backports git
  2017-09-07  9:04       ` compilation errors in ath10k driver with latest backports git KAVITA MATHUR
@ 2017-09-07  9:17         ` Arend van Spriel
  0 siblings, 0 replies; 48+ messages in thread
From: Arend van Spriel @ 2017-09-07  9:17 UTC (permalink / raw)
  To: KAVITA MATHUR, Johannes Berg, Hauke Mehrtens; +Cc: backports

On 07-09-17 11:04, KAVITA MATHUR wrote:
> Hi,
> 
> I am using backports git and ath10k git to download latest changes in ath0k driver.
> There are build errors in ath10k drivers due to definitions not backported from kernel
> 4.12. Backpors-git is backported kernel till 4.8. Please suggest how to fix these issues.
> 
> Following is the build error log:
> 
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.13.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.15.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.18.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-3.19.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.1.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.2.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.4.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.5.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/backport-4.7.o
> LD [M]  /home/shw/kavita/backports/backports-output_14Aug17/compat/compat.o
> CC [M]
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/main.o
> CC [M]
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/regd.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/hw.o
> CC [M]  /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/key.o
> CC [M]
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/dfs_pattern_detector.o
> CC [M]
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/dfs_pri_detector.o
> LD [M]  /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath.o
> CC [M]
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.o
> In file included from
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.h:22,
>                 from
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.c:18:
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/core.h:465:
> error: expected specifier-qualifier-list before 'guid_t'
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.c:
> In function 'ath10k_tx_h_add_p2p_noa_ie':
> /home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.c:3492:
> error: implicit declaration of function 'skb_put_data'
> make[8]: ***
> [/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k/mac.o]
> Error 1
> make[7]: ***
> [/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath/ath10k]
> Error 2
> make[6]: ***
> [/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless/ath] Error 2
> make[5]: *** [/home/shw/kavita/backports/backports-output_14Aug17/drivers/net/wireless]
> Error 2
> make[4]: *** [_module_/home/shw/kavita/backports/backports-output_14Aug17] Error 2
> make[3]: *** [modules] Error 2
> make[2]: *** [modules] Error 2
> make[1]: *** [modules] Error 2
> make: *** [default] Error 2

Hi Kavita,

You could try the patch submitted by Hauke titled "[PATCH 03/21] header: 
skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8()", but you 
will likely stumble on more. His entire patch series should do the 
trick. It is still under review.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c
  2017-09-06 22:12     ` Hauke Mehrtens
@ 2017-09-08  9:25       ` Johannes Berg
  0 siblings, 0 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-08  9:25 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports, AceLan Kao

On Thu, 2017-09-07 at 00:12 +0200, Hauke Mehrtens wrote:
> On 09/06/2017 05:05 PM, Johannes Berg wrote:
> > On Tue, 2017-08-22 at 00:28 +0200, Hauke Mehrtens wrote:
> > > This reverts commit 12e8fd6fd3802 ("lib/rhashtable.c: use
> > > kvzalloc()
> > > in
> > > bucket_table_alloc() when possible") from upstream kernel.
> > > Kernel versions older that 4.12 do not have kvzalloc() try to
> > > avoid
> > > the
> > > usage of this.
> > 
> > Can't we backport these? There was a patch from AceLan Kao to do so
> > in
> > a pretty simple fashion, but that should still be better than a
> > patch?
> > 
> > johannes
> 
> Hi,
> 
> I think AceLan Kao's patch misses the implementation of
> kvmalloc_node().
> We can implement this for node == NUMA_NO_NODE by using __vmalloc()
> instead of __vmalloc_node_flags_caller() which should be fine.

Sounds reasonable to me.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios()
  2017-09-06 21:58     ` Hauke Mehrtens
@ 2017-09-08  9:25       ` Johannes Berg
  2017-09-08  9:28         ` Johannes Berg
  0 siblings, 1 reply; 48+ messages in thread
From: Johannes Berg @ 2017-09-08  9:25 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

On Wed, 2017-09-06 at 23:58 +0200, Hauke Mehrtens wrote:
> 
> > This I don't understand - you said it's hard to do for <3.19, and
> > then
> > make a simple no-op for all, but don't do it for <3.19 at all?
> > 
> > Why not just LINUX_VERION_LESS(4,13,0)?
> 
> struct acpi_gpio_mapping was added to kernel 3.19. We could add here
> a dummy struct acpi_gpio_mapping, but the drivers anyway need more
> adjustments to compile properly.

Ok.

> > > +#define devm_acpi_dev_add_driver_gpios
> > > LINUX_BACKPORT(devm_acpi_dev_add_driver_gpios)
> > > +static inline int devm_acpi_dev_add_driver_gpios(struct device
> > > *dev,
> > > +			      const struct acpi_gpio_mapping
> > > *gpios)
> > > +{
> > > +	return -ENXIO;
> > > +}
> > > +#endif /* LINUX_VERSION_IN_RANGE(4,19,0, 4,13,0) */
> 
> This should be
> +#endif /* LINUX_VERSION_IN_RANGE(3,19,0, 4,13,0) */

Right. I'll fix this and apply then.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios()
  2017-09-08  9:25       ` Johannes Berg
@ 2017-09-08  9:28         ` Johannes Berg
  0 siblings, 0 replies; 48+ messages in thread
From: Johannes Berg @ 2017-09-08  9:28 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: backports

On Fri, 2017-09-08 at 11:25 +0200, Johannes Berg wrote:
> 
> Right. I'll fix this and apply then.

Heh, turns out I accidentally applied it already anyway - so I just
fixed the version thing then.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 16/21] patches: brcmfmac: fix netdev destructor
  2017-08-21 22:28 ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Hauke Mehrtens
  2017-09-06 15:05   ` Johannes Berg
@ 2017-09-13 19:36   ` Arend van Spriel
  2017-09-14  7:21     ` Johannes Berg
  1 sibling, 1 reply; 48+ messages in thread
From: Arend van Spriel @ 2017-09-13 19:36 UTC (permalink / raw)
  To: Hauke Mehrtens, johannes; +Cc: backports

On 22-08-17 00:28, Hauke Mehrtens wrote:
> brcmfmac uses a complicated netdev destructor handling. The
> brcmf_net_attach() function just adds a normal destructor and later the
> brcmf_add_if() function sets the needs_free_netdev callback.
> 
> The normal spatch was not applied correctly to this file, add a patch
> before to try to fx this problem manually.

Way overdue, but better late than never. I think we prefer to use 
spatch, but I understand the destructor handling in brcmfmac is complicated.

The story above does not tell it right. brcmf_add_if() is called first 
doing the alloc_netdev() setting needs_free_netdev to true and 
subsequently brcmf_net_attach() is called doing the 
register_netdevice(). When that is successful and only then I set the 
priv_destructor. The reason for this was to keep the error path simple, 
because when register_netdevice() fails it calls the priv_destructor 
although that is not documented in struct net_device:

  *	@priv_destructor:	Called from unregister

I think I will make an attempt to change brcmfmac so we can get rid of 
this patch file and rely on the spatch, but for now I am fine with it.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6
  2017-09-05  9:00 ` [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Johannes Berg
  2017-09-05 21:41   ` Hauke Mehrtens
@ 2017-09-13 20:00   ` Arend van Spriel
  2017-09-17 22:07     ` Hauke Mehrtens
  1 sibling, 1 reply; 48+ messages in thread
From: Arend van Spriel @ 2017-09-13 20:00 UTC (permalink / raw)
  To: Johannes Berg, Hauke Mehrtens; +Cc: backports



On 05-09-17 11:00, Johannes Berg wrote:
> Hi Hauke,
> 

[...]

>> patches/0079-netdev-destructor.cocci takes very long to apply, about
>> 3 times longer all others together.
> 
> I doubt we can do anything about that.

Not sure what is causing it. Might just be the amount of network device 
drivers. When discussing (parts of) this spatch Julia mentioned about 
use of disjunction vs expression:

"""
You can put a disjunction: \(fn1\|fn2\).  Another option is to make an
identifier metavariable with an appropriate regular expression, but this
would be less efficient than the disjuction option.  Coccinelle does 
some optimizations based on what is the pattern matching code, but not 
regular expression constraints.
"""

but I ended up using the disjunction:

RET = \(register_netdevice\|register_ndev\)(NDEV);
if (<+... RET ...+>) {

so that can not be optimized further.

>> Should we remove ssb and bcma from backports and use the in kernel
>> versions instead? I do not expect so many changes any more affecting
>> the wifi drivers.
> 
> I have no opinion either way.

There may be some new cores coming up in our wifi chips that BCMA would 
need to add, but also heard rumors about switching to new backplane type.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 16/21] patches: brcmfmac: fix netdev destructor
  2017-09-13 19:36   ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Arend van Spriel
@ 2017-09-14  7:21     ` Johannes Berg
  2017-09-17 22:00       ` Hauke Mehrtens
  0 siblings, 1 reply; 48+ messages in thread
From: Johannes Berg @ 2017-09-14  7:21 UTC (permalink / raw)
  To: Arend van Spriel, Hauke Mehrtens; +Cc: backports

On Wed, 2017-09-13 at 21:36 +0200, Arend van Spriel wrote:
> 
> Way overdue, but better late than never. 

No worries, I already applied the patch anyway ;-)

> I think we prefer to use 
> spatch, but I understand the destructor handling in brcmfmac is
> complicated.

Agree - and making changes across header files is hard in spatch.

> The story above does not tell it right. brcmf_add_if() is called
> first 
> doing the alloc_netdev() setting needs_free_netdev to true and 
> subsequently brcmf_net_attach() is called doing the 
> register_netdevice(). When that is successful and only then I set
> the 
> priv_destructor. The reason for this was to keep the error path
> simple, 
> because when register_netdevice() fails it calls the priv_destructor 
> although that is not documented in struct net_device:
> 
>   *	@priv_destructor:	Called from unregister

Ok, too late now I guess, since the patch is in. But at least we'll
have your explanation here :)

> I think I will make an attempt to change brcmfmac so we can get rid
> of this patch file and rely on the spatch, but for now I am fine with
> it.

Thanks for the review!

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 16/21] patches: brcmfmac: fix netdev destructor
  2017-09-14  7:21     ` Johannes Berg
@ 2017-09-17 22:00       ` Hauke Mehrtens
  2017-09-18  7:16         ` Arend van Spriel
  0 siblings, 1 reply; 48+ messages in thread
From: Hauke Mehrtens @ 2017-09-17 22:00 UTC (permalink / raw)
  To: Johannes Berg, Arend van Spriel; +Cc: backports

On 09/14/2017 09:21 AM, Johannes Berg wrote:
> On Wed, 2017-09-13 at 21:36 +0200, Arend van Spriel wrote:
>>
>> Way overdue, but better late than never. 
> 
> No worries, I already applied the patch anyway ;-)
> 
>> I think we prefer to use 
>> spatch, but I understand the destructor handling in brcmfmac is
>> complicated.
> 
> Agree - and making changes across header files is hard in spatch.

I have no idea how to do this with spatch, I would appreciate if you
could convert this to an spatch, I do not know how.

>> The story above does not tell it right. brcmf_add_if() is called
>> first 
>> doing the alloc_netdev() setting needs_free_netdev to true and 
>> subsequently brcmf_net_attach() is called doing the 
>> register_netdevice(). When that is successful and only then I set
>> the 
>> priv_destructor. The reason for this was to keep the error path
>> simple, 
>> because when register_netdevice() fails it calls the priv_destructor 
>> although that is not documented in struct net_device:
>>
>>   *	@priv_destructor:	Called from unregister
> 
> Ok, too late now I guess, since the patch is in. But at least we'll
> have your explanation here :)
> 
>> I think I will make an attempt to change brcmfmac so we can get rid
>> of this patch file and rely on the spatch, but for now I am fine with
>> it.
> 
> Thanks for the review!

I fixed this patch in a later commit again, there was a problem with
recent kernel versions.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6
  2017-09-13 20:00   ` Arend van Spriel
@ 2017-09-17 22:07     ` Hauke Mehrtens
  0 siblings, 0 replies; 48+ messages in thread
From: Hauke Mehrtens @ 2017-09-17 22:07 UTC (permalink / raw)
  To: Arend van Spriel, Johannes Berg; +Cc: backports

On 09/13/2017 10:00 PM, Arend van Spriel wrote:
> 
> 
> On 05-09-17 11:00, Johannes Berg wrote:
>> Hi Hauke,
>>
> 
> [...]
> 
>>> patches/0079-netdev-destructor.cocci takes very long to apply, about
>>> 3 times longer all others together.
>>
>> I doubt we can do anything about that.
> 
> Not sure what is causing it. Might just be the amount of network device
> drivers. When discussing (parts of) this spatch Julia mentioned about
> use of disjunction vs expression:
> 
> """
> You can put a disjunction: \(fn1\|fn2\).  Another option is to make an
> identifier metavariable with an appropriate regular expression, but this
> would be less efficient than the disjuction option.  Coccinelle does
> some optimizations based on what is the pattern matching code, but not
> regular expression constraints.
> """
> 
> but I ended up using the disjunction:
> 
> RET = \(register_netdevice\|register_ndev\)(NDEV);
> if (<+... RET ...+>) {
> 
> so that can not be optimized further.
> 
>>> Should we remove ssb and bcma from backports and use the in kernel
>>> versions instead? I do not expect so many changes any more affecting
>>> the wifi drivers.
>>
>> I have no opinion either way.
> 
> There may be some new cores coming up in our wifi chips that BCMA would
> need to add, but also heard rumors about switching to new backplane type.

Isn't brcmfmac only using some header files from bcma and the rest is
implemented in firmware? We can still add the parts that are needed for
brcmfmac to backports. If there are new softmac devices planned and you
want to provide a driver for them then bcma is helpful.

In OpenWrt and LEDE bcma and ssb are compiled into the kernel because we
need it also for flash driver and other essential things to boot up.
Removing bcma and ssb from backports would bring it closer to the
version used in LEDE.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH 16/21] patches: brcmfmac: fix netdev destructor
  2017-09-17 22:00       ` Hauke Mehrtens
@ 2017-09-18  7:16         ` Arend van Spriel
  0 siblings, 0 replies; 48+ messages in thread
From: Arend van Spriel @ 2017-09-18  7:16 UTC (permalink / raw)
  To: Hauke Mehrtens, Johannes Berg; +Cc: backports

On 9/18/2017 12:00 AM, Hauke Mehrtens wrote:
> On 09/14/2017 09:21 AM, Johannes Berg wrote:
>> On Wed, 2017-09-13 at 21:36 +0200, Arend van Spriel wrote:
>>>
>>> Way overdue, but better late than never.
>>
>> No worries, I already applied the patch anyway ;-)
>>
>>> I think we prefer to use
>>> spatch, but I understand the destructor handling in brcmfmac is
>>> complicated.
>>
>> Agree - and making changes across header files is hard in spatch.
>
> I have no idea how to do this with spatch, I would appreciate if you
> could convert this to an spatch, I do not know how.

No problem. Well, maybe it is, but I will give it a try ;-)

>>> The story above does not tell it right. brcmf_add_if() is called
>>> first
>>> doing the alloc_netdev() setting needs_free_netdev to true and
>>> subsequently brcmf_net_attach() is called doing the
>>> register_netdevice(). When that is successful and only then I set
>>> the
>>> priv_destructor. The reason for this was to keep the error path
>>> simple,
>>> because when register_netdevice() fails it calls the priv_destructor
>>> although that is not documented in struct net_device:
>>>
>>>    *	@priv_destructor:	Called from unregister
>>
>> Ok, too late now I guess, since the patch is in. But at least we'll
>> have your explanation here :)
>>
>>> I think I will make an attempt to change brcmfmac so we can get rid
>>> of this patch file and rely on the spatch, but for now I am fine with
>>> it.
>>
>> Thanks for the review!
>
> I fixed this patch in a later commit again, there was a problem with
> recent kernel versions.

I saw that patch, but did not incorporate it in this response. Thanks 
for fixing it.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2017-09-18  7:16 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21 22:27 [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Hauke Mehrtens
2017-08-21 22:27 ` [PATCH 01/21] copy: do not copy files removed in kernel 4.13 Hauke Mehrtens
2017-09-06 14:56   ` Johannes Berg
2017-08-21 22:27 ` [PATCH 02/21] patches: header fix for st-nci not needed any more Hauke Mehrtens
2017-08-21 22:27 ` [PATCH 03/21] header: skbuff: add skb_put_zero(), skb_put_data() and skb_put_u8() Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 04/21] header: skbuff: fix signature of skb_put(), skb_push() and () Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 05/21] header: backport mii_ethtool_{get,set}_link_ksettings() Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 06/21] patches: adapt the stat64 usage for usbnet Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 07/21] header: add module_param_hw_array() Hauke Mehrtens
2017-09-06 15:00   ` Johannes Berg
2017-08-21 22:28 ` [PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios() Hauke Mehrtens
2017-09-06 15:01   ` Johannes Berg
2017-09-06 21:58     ` Hauke Mehrtens
2017-09-08  9:25       ` Johannes Berg
2017-09-08  9:28         ` Johannes Berg
2017-08-21 22:28 ` [PATCH 09/21] header: add get_random_u32() Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 10/21] header: rename wait_queue_entry_t to wait_queue_t Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 11/21] backport: add __print_array() Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 12/21] compat: avoid usage of kvzalloc() in rhashtable.c Hauke Mehrtens
2017-09-06 15:05   ` Johannes Berg
2017-09-06 22:12     ` Hauke Mehrtens
2017-09-08  9:25       ` Johannes Berg
2017-08-21 22:28 ` [PATCH 13/21] patch: Allow usage of pci_error_handlers->reset_notify Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 14/21] header: add offsetofend() Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 15/21] dependencies: add deps for struct acpi_gpio_mapping Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Hauke Mehrtens
2017-09-06 15:05   ` Johannes Berg
2017-09-07  7:48     ` Arend van Spriel
2017-09-07  9:04       ` compilation errors in ath10k driver with latest backports git KAVITA MATHUR
2017-09-07  9:17         ` Arend van Spriel
2017-09-13 19:36   ` [PATCH 16/21] patches: brcmfmac: fix netdev destructor Arend van Spriel
2017-09-14  7:21     ` Johannes Berg
2017-09-17 22:00       ` Hauke Mehrtens
2017-09-18  7:16         ` Arend van Spriel
2017-08-21 22:28 ` [PATCH 17/21] patches: backport the probe_new for i2c drivers Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 18/21] patches: adapt signature of proto_ops->accept Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 19/21] header: add linux/refcount.h Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 20/21] header: add dma_wmb() Hauke Mehrtens
2017-08-21 22:28 ` [PATCH 21/21] copy-list: add quantenna qtnfmac driver Hauke Mehrtens
2017-09-06 15:10   ` Johannes Berg
2017-09-06 15:13     ` Johannes Berg
2017-09-06 22:14       ` Hauke Mehrtens
2017-09-06 15:14     ` Johannes Berg
2017-09-05  9:00 ` [PATCH 00/21] backports: multiple changes for kernel 3.13-rc6 Johannes Berg
2017-09-05 21:41   ` Hauke Mehrtens
2017-09-06  7:23     ` Johannes Berg
2017-09-13 20:00   ` Arend van Spriel
2017-09-17 22:07     ` Hauke Mehrtens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.