All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: backports@vger.kernel.org
Cc: johannes.berg@intel.com, Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 09/14] backports: Remove coredump subsystem backport
Date: Tue, 12 Oct 2021 00:22:22 +0200	[thread overview]
Message-ID: <20211011222227.1189850-10-hauke@hauke-m.de> (raw)
In-Reply-To: <20211011222227.1189850-1-hauke@hauke-m.de>

This is not needed on kernel 4.0 and later. These kernel versions
already ship a compatible coredump system.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 .../linux/{bp-devcoredump.h => devcoredump.h} |  6 +-
 backport/compat/Kconfig                       | 11 ---
 backport/compat/backport-4.7.c                | 11 +--
 backport/compat/backports.h                   | 16 -----
 backport/compat/main.c                        | 11 ---
 patches/devcoredump.patch                     | 67 -------------------
 6 files changed, 5 insertions(+), 117 deletions(-)
 rename backport/backport-include/linux/{bp-devcoredump.h => devcoredump.h} (86%)
 delete mode 100644 backport/compat/backports.h
 delete mode 100644 patches/devcoredump.patch

diff --git a/backport/backport-include/linux/bp-devcoredump.h b/backport/backport-include/linux/devcoredump.h
similarity index 86%
rename from backport/backport-include/linux/bp-devcoredump.h
rename to backport/backport-include/linux/devcoredump.h
index 4a8c228b..49b7c30d 100644
--- a/backport/backport-include/linux/bp-devcoredump.h
+++ b/backport/backport-include/linux/devcoredump.h
@@ -1,5 +1,6 @@
 #ifndef __BACKPORT_LINUX_DEVCOREDUMP_H
 #define __BACKPORT_LINUX_DEVCOREDUMP_H
+#include_next <linux/devcoredump.h>
 #include <linux/version.h>
 #include <linux/scatterlist.h>
 
@@ -15,10 +16,9 @@ void backport_dev_coredumpm(struct device *dev, struct module *owner,
 					    size_t datalen),
 			    void (*free_fn)(void *data))
 {
-	return dev_coredumpm(dev, owner, (const void *)data, datalen, gfp,
-			     (void *)read_fn, (void *)free_fn);
+	dev_coredumpm(dev, owner, (const void *)data, datalen, gfp,
+		      (void *)read_fn, (void *)free_fn);
 }
-
 #define dev_coredumpm LINUX_BACKPORT(dev_coredumpm)
 
 #define dev_coredumpsg LINUX_BACKPORT(dev_coredumpsg)
diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index 625b605e..98752f6f 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -76,17 +76,6 @@ config BPAUTO_USERSEL_BUILD_ALL
 	  It's only really useful for compat testing, so
 	  you probably shouldn't enable it.
 
-config BPAUTO_WANT_DEV_COREDUMP
-	bool
-
-config BPAUTO_BUILD_WANT_DEV_COREDUMP
-	bool
-	default n if DEV_COREDUMP
-	default n if DISABLE_DEV_COREDUMP
-	default y if BPAUTO_WANT_DEV_COREDUMP
-	#h-file linux/devcoredump.h
-	#c-file drivers/base/devcoredump.c
-
 config BPAUTO_RHASHTABLE
 	bool
 	# current API of rhashtable was introduced in version 4.9
diff --git a/backport/compat/backport-4.7.c b/backport/compat/backport-4.7.c
index b47764e6..d261abe6 100644
--- a/backport/compat/backport-4.7.c
+++ b/backport/compat/backport-4.7.c
@@ -8,9 +8,11 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/devcoredump.h>
 #include <linux/export.h>
 #include <linux/list.h>
 #include <linux/rcupdate.h>
+#include <linux/scatterlist.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>
@@ -116,14 +118,6 @@ int nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen,
 }
 EXPORT_SYMBOL_GPL(nla_put_64bit);
 
-/*
- * Below 3.18 or if the kernel has devcoredump disabled, we copied the
- * entire devcoredump, so no need to define these functions.
- */
-#if !defined(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP)
-#include <linux/devcoredump.h>
-#include <linux/scatterlist.h>
-
 static void devcd_free_sgtable(void *data)
 {
 	struct scatterlist *table = data;
@@ -180,4 +174,3 @@ void dev_coredumpsg(struct device *dev, struct scatterlist *table,
 		      (void *)devcd_free_sgtable);
 }
 EXPORT_SYMBOL_GPL(dev_coredumpsg);
-#endif /* !CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP */
diff --git a/backport/compat/backports.h b/backport/compat/backports.h
deleted file mode 100644
index 53848888..00000000
--- a/backport/compat/backports.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef LINUX_BACKPORTS_PRIVATE_H
-#define LINUX_BACKPORTS_PRIVATE_H
-
-#include <linux/version.h>
-
-#ifdef CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP
-int devcoredump_init(void);
-void devcoredump_exit(void);
-#else
-static inline int devcoredump_init(void)
-{ return 0; }
-static inline void devcoredump_exit(void)
-{}
-#endif
-
-#endif /* LINUX_BACKPORTS_PRIVATE_H */
diff --git a/backport/compat/main.c b/backport/compat/main.c
index 0bf04201..2540e757 100644
--- a/backport/compat/main.c
+++ b/backport/compat/main.c
@@ -2,7 +2,6 @@
 #include <linux/init.h>
 #include <linux/pm_qos.h>
 #include <linux/workqueue.h>
-#include "backports.h"
 
 MODULE_AUTHOR("Luis R. Rodriguez");
 MODULE_DESCRIPTION("Kernel backport module");
@@ -53,10 +52,6 @@ EXPORT_SYMBOL_GPL(backport_dependency_symbol);
 
 static int __init backport_init(void)
 {
-	int ret = devcoredump_init();
-	if (ret)
-		return ret;
-
 	printk(KERN_INFO "Loading modules backported from " CPTCFG_KERNEL_NAME
 #ifndef BACKPORTS_GIT_TRACKED
 		" version " CPTCFG_KERNEL_VERSION
@@ -77,9 +72,3 @@ static int __init backport_init(void)
         return 0;
 }
 subsys_initcall(backport_init);
-
-static void __exit backport_exit(void)
-{
-	devcoredump_exit();
-}
-module_exit(backport_exit);
diff --git a/patches/devcoredump.patch b/patches/devcoredump.patch
deleted file mode 100644
index e56d52c8..00000000
--- a/patches/devcoredump.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/compat/drivers-base-devcoredump.c
-+++ b/compat/drivers-base-devcoredump.c
-@@ -16,6 +16,7 @@
- #include <linux/slab.h>
- #include <linux/fs.h>
- #include <linux/workqueue.h>
-+#include "backports.h"
- 
- static struct class devcd_class;
- 
-@@ -54,8 +55,7 @@ static void devcd_dev_release(struct dev
- 	 * a struct device to know when it goes away?
- 	 */
- 	if (devcd->failing_dev->kobj.sd)
--		sysfs_delete_link(&devcd->failing_dev->kobj, &dev->kobj,
--				  "devcoredump");
-+		sysfs_remove_link(&devcd->failing_dev->kobj, "devcoredump");
- 
- 	put_device(devcd->failing_dev);
- 	kfree(devcd);
-@@ -334,15 +334,13 @@ void dev_coredumpsg(struct device *dev,
- }
- EXPORT_SYMBOL_GPL(dev_coredumpsg);
- 
--static int __init devcoredump_init(void)
-+int __init devcoredump_init(void)
- {
- 	return class_register(&devcd_class);
- }
--__initcall(devcoredump_init);
- 
--static void __exit devcoredump_exit(void)
-+void __exit devcoredump_exit(void)
- {
- 	class_for_each_device(&devcd_class, NULL, NULL, devcd_free);
- 	class_unregister(&devcd_class);
- }
--__exitcall(devcoredump_exit);
---- a/include/linux/backport-devcoredump.h
-+++ b/include/linux/backport-devcoredump.h
-@@ -51,7 +51,7 @@ static inline void _devcd_free_sgtable(s
- }
- 
- 
--#ifdef CONFIG_DEV_COREDUMP
-+#ifdef CPTCFG_BPAUTO_WANT_DEV_COREDUMP
- void dev_coredumpv(struct device *dev, void *data, size_t datalen,
- 		   gfp_t gfp);
- 
-@@ -85,6 +85,6 @@ static inline void dev_coredumpsg(struct
- {
- 	_devcd_free_sgtable(table);
- }
--#endif /* CONFIG_DEV_COREDUMP */
-+#endif /* CPTCFG_BPAUTO_WANT_DEV_COREDUMP */
- 
- #endif /* __DEVCOREDUMP_H */
---- a/include/linux/devcoredump.h
-+++ b/include/linux/devcoredump.h
-@@ -1,6 +1,7 @@
- /* Automatically created during backport process */
- #ifndef CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP
- #include_next <linux/devcoredump.h>
-+#include <linux/bp-devcoredump.h>
- #else
- #undef dev_coredumpv
- #define dev_coredumpv LINUX_BACKPORT(dev_coredumpv)
-- 
2.30.2

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

  parent reply	other threads:[~2021-10-11 22:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 22:22 [PATCH 00/14] backports: Remove support for kernel < 4.4 Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 01/14] backports: Add support deb with zstd compression Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 02/14] backports: cmake: Fixes for python3 Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 03/14] backprots: Add *.mod to .gitignore Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 04/14] backports: Remove 3.X kernel headers Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 05/14] backports: Remove 3.X kernel patches Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 06/14] backports: dependencies: Remove dependencies to kernel 3.X Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 07/14] backports: Remove led subsystem backport Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 08/14] backports: Remove MII " Hauke Mehrtens
2021-10-11 22:22 ` Hauke Mehrtens [this message]
2021-10-11 22:22 ` [PATCH 10/14] backports: Remove support for kernel smaller than 4.0 Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 11/14] backports: Remove support for kernel smaller than 4.1 Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 12/14] backports: Remove support for kernel smaller than 4.2 Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 13/14] backports: Remove support for kernel smaller than 4.3 Hauke Mehrtens
2021-10-11 22:22 ` [PATCH 14/14] backports: Remove support for kernel smaller than 4.4 Hauke Mehrtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211011222227.1189850-10-hauke@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=backports@vger.kernel.org \
    --cc=johannes.berg@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.