Backports Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/6] backport: some patches from our internal tree 2019-03-15
@ 2019-03-15 14:33 Luca Coelho
  2019-03-15 14:33 ` [PATCH 1/6] backport: add v5.* to the Makefile Luca Coelho
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Luca Coelho @ 2019-03-15 14:33 UTC (permalink / raw)
  To: backports; +Cc: Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

Hi,

These are a few new patches that we had pending in our internal tree.
They update some things for v5.0, fix some bugs and add things needed
by iwlwifi.

Please review.


Cheers,
Luca.


Johannes Berg (1):
  backports: genetlink: avoid NULL dereference

Luca Coelho (5):
  backport: add v5.* to the Makefile
  backports: update iwlwifi pci device removal patch for v5.0
  backport: add atomic_fetch_add_unless()
  backport: add include ftrace_event.h back to backport-4.0.c
  backport: fix handling of nospec.h for 4.15.0 and 4.15.1

 backport/Makefile                             | 5 +++--
 backport/backport-include/linux/atomic.h      | 9 +++++++++
 backport/backport-include/linux/nospec.h      | 3 ++-
 backport/compat/backport-4.0.c                | 1 +
 backport/compat/backport-genetlink.c          | 9 +++------
 patches/0085-iwlwifi-pci-device-removal.patch | 8 ++++----
 6 files changed, 22 insertions(+), 13 deletions(-)

-- 
2.20.1

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

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

* [PATCH 1/6] backport: add v5.* to the Makefile
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
@ 2019-03-15 14:33 ` Luca Coelho
  2019-03-15 14:33 ` [PATCH 2/6] backports: update iwlwifi pci device removal patch for v5.0 Luca Coelho
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2019-03-15 14:33 UTC (permalink / raw)
  To: backports; +Cc: Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

Now that 4.21 became 5.0, we need to update the Makefile accordingly.
Stop looking at 4.19 for the 4.* series and add 5.*.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 backport/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/backport/Makefile b/backport/Makefile
index 0fd4cdb2f322..ee7df4ba29ce 100644
--- a/backport/Makefile
+++ b/backport/Makefile
@@ -85,12 +85,13 @@ mrproper:
 			done								\
 		) > Kconfig.kernel							;\
 		kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion |	\
-			sed 's/^\(\([3-4]\|2\.6\)\.[0-9]\+\).*/\1/;t;d')		;\
+			sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d')		;\
 		test "$$kver" != "" || echo "Kernel version parse failed!"		;\
 		test "$$kver" != ""							;\
 		kvers="$$(seq 14 39 | sed 's/^/2.6./')"					;\
 		kvers="$$kvers $$(seq 0 19 | sed 's/^/3./')"				;\
-		kvers="$$kvers $$(seq 0 99 | sed 's/^/4./')"				;\
+		kvers="$$kvers $$(seq 0 20 | sed 's/^/4./')"				;\
+		kvers="$$kvers $$(seq 0 99 | sed 's/^/5./')"				;\
 		print=0									;\
 		for v in $$kvers ; do							\
 			if [ "$$print" = "1" ] ; then					\
-- 
2.20.1

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

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

* [PATCH 2/6] backports: update iwlwifi pci device removal patch for v5.0
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
  2019-03-15 14:33 ` [PATCH 1/6] backport: add v5.* to the Makefile Luca Coelho
@ 2019-03-15 14:33 ` Luca Coelho
  2019-03-15 14:33 ` [PATCH 3/6] backport: add atomic_fetch_add_unless() Luca Coelho
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2019-03-15 14:33 UTC (permalink / raw)
  To: backports; +Cc: Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

The code surrounding the #ifdef we add has changed.  Update the patch
accordingly.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 patches/0085-iwlwifi-pci-device-removal.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/patches/0085-iwlwifi-pci-device-removal.patch b/patches/0085-iwlwifi-pci-device-removal.patch
index 84fa7f9264a8..97a904f6365f 100644
--- a/patches/0085-iwlwifi-pci-device-removal.patch
+++ b/patches/0085-iwlwifi-pci-device-removal.patch
@@ -1,18 +1,18 @@
 diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
-index cc8c53dc0ab6..68296b65a680 100644
+index f74281508197..3b11bd68f261 100644
 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
-@@ -1968,6 +1968,9 @@ static void iwl_trans_pcie_removal_wk(st
+@@ -1964,6 +1964,9 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk)
  	struct iwl_trans_pcie_removal *removal =
  		container_of(wk, struct iwl_trans_pcie_removal, work);
  	struct pci_dev *pdev = removal->pdev;
 +#if LINUX_VERSION_IS_LESS(3,14,0)
 +	dev_err(&pdev->dev, "Device gone - can't remove on old kernels.\n");
 +#else
- 	char *prop[] = {"EVENT=INACCESSIBLE", NULL};
+ 	static char *prop[] = {"EVENT=INACCESSIBLE", NULL};
  
  	dev_err(&pdev->dev, "Device gone - attempting removal\n");
-@@ -1976,6 +1979,7 @@ static void iwl_trans_pcie_removal_wk(st
+@@ -1972,6 +1975,7 @@ static void iwl_trans_pcie_removal_wk(struct work_struct *wk)
  	pci_dev_put(pdev);
  	pci_stop_and_remove_bus_device(pdev);
  	pci_unlock_rescan_remove();
-- 
2.20.1

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

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

* [PATCH 3/6] backport: add atomic_fetch_add_unless()
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
  2019-03-15 14:33 ` [PATCH 1/6] backport: add v5.* to the Makefile Luca Coelho
  2019-03-15 14:33 ` [PATCH 2/6] backports: update iwlwifi pci device removal patch for v5.0 Luca Coelho
@ 2019-03-15 14:33 ` Luca Coelho
  2019-03-15 14:33 ` [PATCH 4/6] backport: add include ftrace_event.h back to backport-4.0.c Luca Coelho
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2019-03-15 14:33 UTC (permalink / raw)
  To: backports; +Cc: Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

The iwlwifi driver now needs this function.  Backport it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 backport/backport-include/linux/atomic.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/backport-include/linux/atomic.h b/backport/backport-include/linux/atomic.h
index b4dd2e1d34f0..9ceb586e864a 100644
--- a/backport/backport-include/linux/atomic.h
+++ b/backport/backport-include/linux/atomic.h
@@ -51,4 +51,13 @@
 
 #endif /* atomic_try_cmpxchg_acquire */
 
+#if LINUX_VERSION_IS_LESS(4,19,0)
+#ifndef atomic_fetch_add_unless
+static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)
+{
+	return __atomic_add_unless(v, a, u);
+}
+#endif
+#endif
+
 #endif /* __BP_ATOMIC_H */
-- 
2.20.1

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

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

* [PATCH 4/6] backport: add include ftrace_event.h back to backport-4.0.c
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
                   ` (2 preceding siblings ...)
  2019-03-15 14:33 ` [PATCH 3/6] backport: add atomic_fetch_add_unless() Luca Coelho
@ 2019-03-15 14:33 ` Luca Coelho
  2019-03-15 14:33 ` [PATCH 5/6] backport: fix handling of nospec.h for 4.15.0 and 4.15.1 Luca Coelho
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2019-03-15 14:33 UTC (permalink / raw)
  To: backports; +Cc: Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

At least one function, namely ftrace_print_array_seq(), still needs
the ftrace_event.h header file, otherwise sparse may warning that it
is declared as non-static without pre-declaration.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 backport/compat/backport-4.0.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/backport/compat/backport-4.0.c b/backport/compat/backport-4.0.c
index 84a4c6bf27b7..fbe0ddbc3bdd 100644
--- a/backport/compat/backport-4.0.c
+++ b/backport/compat/backport-4.0.c
@@ -15,6 +15,7 @@
 #include <linux/printk.h>
 #include <linux/export.h>
 #include <linux/trace_seq.h>
+#include <linux/ftrace_event.h>
 #include <asm/unaligned.h>
 
 /**
-- 
2.20.1

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

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

* [PATCH 5/6] backport: fix handling of nospec.h for 4.15.0 and 4.15.1
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
                   ` (3 preceding siblings ...)
  2019-03-15 14:33 ` [PATCH 4/6] backport: add include ftrace_event.h back to backport-4.0.c Luca Coelho
@ 2019-03-15 14:33 ` Luca Coelho
  2019-03-15 14:33 ` [PATCH 6/6] backports: genetlink: avoid NULL dereference Luca Coelho
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2019-03-15 14:33 UTC (permalink / raw)
  To: backports; +Cc: Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

The patch that introduces nospec.h was cherry-picked for 4.15 only in
4.15.2, so we need to adjust the ifdefs of our stub.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 backport/backport-include/linux/nospec.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backport/backport-include/linux/nospec.h b/backport/backport-include/linux/nospec.h
index 50cf46737cbb..07647241f78f 100644
--- a/backport/backport-include/linux/nospec.h
+++ b/backport/backport-include/linux/nospec.h
@@ -1,7 +1,8 @@
 #ifndef _BACKPORT_LINUX_NOSPEC_H
 #define _BACKPORT_LINUX_NOSPEC_H
 
-#if LINUX_VERSION_IS_GEQ(4,14,18) || \
+#if LINUX_VERSION_IS_GEQ(4,15,2) || \
+    LINUX_VERSION_IN_RANGE(4,14,18, 4,15,0) || \
     LINUX_VERSION_IN_RANGE(4,9,81, 4,10,0) || \
     LINUX_VERSION_IN_RANGE(4,4,118, 4,5,0)
 #include_next <linux/nospec.h>
-- 
2.20.1

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

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

* [PATCH 6/6] backports: genetlink: avoid NULL dereference
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
                   ` (4 preceding siblings ...)
  2019-03-15 14:33 ` [PATCH 5/6] backport: fix handling of nospec.h for 4.15.0 and 4.15.1 Luca Coelho
@ 2019-03-15 14:33 ` Luca Coelho
  2019-03-19 21:55 ` [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Hauke Mehrtens
  2019-03-28 15:03 ` Hauke Mehrtens
  7 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2019-03-15 14:33 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg, Luca Coelho

From: Johannes Berg <johannes.berg@intel.com>

If we fail to allocate extack, we fall back to the code path
that tries to send an error *with* extack, but that will
access our extack pointer. It also doesn't make sense, so just
return an error back to netlink immediately and let it handle
sending the error message to userspace.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 backport/compat/backport-genetlink.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/backport/compat/backport-genetlink.c b/backport/compat/backport-genetlink.c
index 71bf45adf88d..885f17568333 100644
--- a/backport/compat/backport-genetlink.c
+++ b/backport/compat/backport-genetlink.c
@@ -157,12 +157,10 @@ static int backport_pre_doit(__genl_const struct genl_ops *ops,
 #if LINUX_VERSION_IS_LESS(4,12,0)
 	struct netlink_ext_ack *extack = kzalloc(sizeof(*extack), GFP_KERNEL);
 
-	__bp_genl_info_userhdr_set(info, extack);
+	if (!extack)
+		return -ENOMEM;
 
-	if (!extack) {
-		err = -ENOMEM;
-		goto err;
-	}
+	__bp_genl_info_userhdr_set(info, extack);
 
 	extack->__bp_doit = ops->doit;
 #else
@@ -175,7 +173,6 @@ static int backport_pre_doit(__genl_const struct genl_ops *ops,
 		err = family->pre_doit(ops, skb, info);
 
 #if LINUX_VERSION_IS_LESS(4,12,0)
-err:
 	if (err) {
 		/* signal to do nothing */
 		extack->__bp_doit = NULL;
-- 
2.20.1

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

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

* Re: [PATCH 0/6] backport: some patches from our internal tree 2019-03-15
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
                   ` (5 preceding siblings ...)
  2019-03-15 14:33 ` [PATCH 6/6] backports: genetlink: avoid NULL dereference Luca Coelho
@ 2019-03-19 21:55 ` Hauke Mehrtens
  2019-03-28 15:03 ` Hauke Mehrtens
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2019-03-19 21:55 UTC (permalink / raw)
  To: Luca Coelho, backports; +Cc: Luca Coelho

On 3/15/19 3:33 PM, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
> 
> Hi,
> 
> These are a few new patches that we had pending in our internal tree.
> They update some things for v5.0, fix some bugs and add things needed
> by iwlwifi.
> 
> Please review.
> 
> 
> Cheers,
> Luca.
> 
> 
> Johannes Berg (1):
>   backports: genetlink: avoid NULL dereference
> 
> Luca Coelho (5):
>   backport: add v5.* to the Makefile
>   backports: update iwlwifi pci device removal patch for v5.0
>   backport: add atomic_fetch_add_unless()
>   backport: add include ftrace_event.h back to backport-4.0.c
>   backport: fix handling of nospec.h for 4.15.0 and 4.15.1

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: [PATCH 0/6] backport: some patches from our internal tree 2019-03-15
  2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
                   ` (6 preceding siblings ...)
  2019-03-19 21:55 ` [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Hauke Mehrtens
@ 2019-03-28 15:03 ` Hauke Mehrtens
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2019-03-28 15:03 UTC (permalink / raw)
  To: Luca Coelho, backports; +Cc: Luca Coelho

On 3/15/19 3:33 PM, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
> 
> Hi,
> 
> These are a few new patches that we had pending in our internal tree.
> They update some things for v5.0, fix some bugs and add things needed
> by iwlwifi.
> 
> Please review.
> 
> 
> Cheers,
> Luca.
> 
> 
> Johannes Berg (1):
>   backports: genetlink: avoid NULL dereference
> 
> Luca Coelho (5):
>   backport: add v5.* to the Makefile
>   backports: update iwlwifi pci device removal patch for v5.0
>   backport: add atomic_fetch_add_unless()
>   backport: add include ftrace_event.h back to backport-4.0.c
>   backport: fix handling of nospec.h for 4.15.0 and 4.15.1
> 
>  backport/Makefile                             | 5 +++--
>  backport/backport-include/linux/atomic.h      | 9 +++++++++
>  backport/backport-include/linux/nospec.h      | 3 ++-
>  backport/compat/backport-4.0.c                | 1 +
>  backport/compat/backport-genetlink.c          | 9 +++------
>  patches/0085-iwlwifi-pci-device-removal.patch | 8 ++++----
>  6 files changed, 22 insertions(+), 13 deletions(-)
> 

Hi Luca,

I allied all your patches.

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

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

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-15 14:33 [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Luca Coelho
2019-03-15 14:33 ` [PATCH 1/6] backport: add v5.* to the Makefile Luca Coelho
2019-03-15 14:33 ` [PATCH 2/6] backports: update iwlwifi pci device removal patch for v5.0 Luca Coelho
2019-03-15 14:33 ` [PATCH 3/6] backport: add atomic_fetch_add_unless() Luca Coelho
2019-03-15 14:33 ` [PATCH 4/6] backport: add include ftrace_event.h back to backport-4.0.c Luca Coelho
2019-03-15 14:33 ` [PATCH 5/6] backport: fix handling of nospec.h for 4.15.0 and 4.15.1 Luca Coelho
2019-03-15 14:33 ` [PATCH 6/6] backports: genetlink: avoid NULL dereference Luca Coelho
2019-03-19 21:55 ` [PATCH 0/6] backport: some patches from our internal tree 2019-03-15 Hauke Mehrtens
2019-03-28 15:03 ` Hauke Mehrtens

Backports Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/backports/0 backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ https://lore.kernel.org/backports \
		backports@vger.kernel.org backports@archiver.kernel.org
	public-inbox-index backports

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.backports


AGPL code for this site: git clone https://public-inbox.org/ public-inbox